/* Simple Conduct's list (Conduct::Simple::ListComponent, Conduct::Simple::RowComponent, Conduct::Simple::ReferralsComponent; the module conduct_simple; Board 4 of docs/conduct/simple/README.md): the masthead
   with the day's greeting and its two actions, the tabs, the new referrals as raised cards a row, the officer's morning as rows (Today, Waiting, the rest), Everyone's table, and the Director's week (four tiles and the lists
   behind them). A group's rows sit in one raised box, a hairline between them, so a page of eight is calm; what is late or waiting is said in a badge with its words, never by color alone, and a referral card is set apart by
   its tint and its border as well as its place.

   The tab the reader is on is marked by a line and a heavier word as well as aria-current. Numbered 63a to follow 63 in the link order. Tokens only and logical properties only, so it reads in light and in dark
   and mirrors in a right-to-left language. Nothing is pinned and nothing sets a height; everything that holds words may shrink and breaks a long word, so a language 40% longer never widens the page (WCAG 1.4.10).
   Every control is at least the touch target (--target-min). */

.conduct-simple-list-page {
  display: grid;
  gap: var(--space-6);
  min-inline-size: 0;
}

.conduct-simple-list {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-2) var(--space-6);
  min-inline-size: 0;
}

/* The masthead: the greeting and what the day holds on the start side, the two actions on the end side; they stack when there is no room. */
.conduct-simple-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4) var(--space-5);
  min-inline-size: 0;
}

.conduct-simple-head:has(.conduct-simple-records[open]) {
  z-index: 5;
}

.conduct-simple-head__words {
  display: grid;
  flex: 1 1 20rem;
  gap: var(--space-1);
  min-inline-size: 0;
}

.conduct-simple-head__title {
  margin: 0;
  min-inline-size: 0;
  color: var(--fg1);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

@media (min-width: 48rem) {
  .conduct-simple-head__title {
    font-size: var(--text-2xl);
  }
}

.conduct-simple-head__line {
  margin: 0;
  color: var(--fg2);
  overflow-wrap: anywhere;
}

.conduct-simple-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  padding: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  list-style: none;
  min-inline-size: 0;
}

.conduct-simple-facts__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

/* A small dot after each fact except the last, so a wrapped line never begins with a stray dot. */
.conduct-simple-facts__item:not(:last-child)::after {
  flex: none;
  inline-size: 0.25rem;
  block-size: 0.25rem;
  border-radius: 50%;
  background: var(--fg3);
  content: "";
}

/* Below a tablet the facts wrap, and a dot after the last fact of a line would hang at its end: the gap alone separates them. */
@media (max-width: 47.99rem) {
  .conduct-simple-facts__item:not(:last-child)::after {
    display: none;
  }
}

.conduct-simple-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

/* Office records are a disclosure that stands among the actions without moving its trigger when opened: below tablet width the menu anchors to the masthead's inline bounds, and from a tablet up directly under its button. */
.conduct-simple-records {
  min-inline-size: 0;
}

.conduct-simple-records > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.conduct-simple-records > summary::-webkit-details-marker {
  display: none;
}

.conduct-simple-records > summary::after {
  display: inline-block;
  inline-size: 0.4rem;
  block-size: 0.4rem;
  margin-inline-start: var(--space-2);
  border-block-end: 2px solid currentcolor;
  border-inline-end: 2px solid currentcolor;
  content: "";
  transform: translateY(-0.1rem) rotate(45deg);
}

.conduct-simple-records[open] > summary::after {
  transform: translateY(0.1rem) rotate(-135deg);
}

.conduct-simple-records__list {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2));
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 4;
  display: grid;
  gap: var(--space-1);
  max-inline-size: min(22rem, 100%);
  margin-block: 0;
  margin-inline: auto 0;
  padding: var(--space-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  list-style: none;
  min-inline-size: 0;
}

@media (min-width: 48rem) {
  .conduct-simple-records {
    position: relative;
  }

  .conduct-simple-records__list {
    inset-inline-start: auto;
    inset-inline-end: 0;
    inline-size: max-content;
    min-inline-size: 15rem;
    max-inline-size: min(22rem, 90vw);
    margin-inline: 0;
  }
}

.conduct-simple-records__link {
  display: flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--fg1);
  overflow-wrap: anywhere;
  text-decoration: none;
}

.conduct-simple-records__link:hover {
  background: var(--accent-soft);
  color: var(--accent-text);
  text-decoration: underline;
}

.conduct-simple-records__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The tabs: the page the reader is on is marked by a heavier line and word as well as aria-current. */
.conduct-simple-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-end: 1px solid var(--rule);
}

.conduct-simple-tabs__tab {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  padding-inline: var(--space-3);
  border-block-end: 2px solid var(--rule);
  margin-block-end: -1px;
  color: var(--fg2);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.conduct-simple-tabs__tab:hover {
  color: var(--fg1);
}

.conduct-simple-tabs__tab[aria-current="page"] {
  border-block-end: 3px solid var(--accent);
  color: var(--fg1);
  font-weight: 700;
}

.conduct-simple-tabs__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The new referrals: one raised card a row, the person and the incident and the words on the start side, Take it and Assign to colleague on the end side; they stack when there is no room. A card is set apart by its
   edge and its place as well as its button, which is not told by color alone (it has its own heading and button). */
.conduct-simple-referrals__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.conduct-simple-referrals__item {
  display: grid;
  min-inline-size: 0;
}

.conduct-simple-referral {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--accent-line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  min-inline-size: 0;
}

@media (max-width: 47.99rem) {
  .conduct-simple-referral {
    padding: var(--space-4);
  }

  .conduct-simple-group__rows {
    padding-inline: var(--space-4);
  }
}

.conduct-simple-referral__main {
  display: grid;
  flex: 999 1 28rem;
  gap: var(--space-2);
  min-inline-size: 0;
}

.conduct-simple-referral__identity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  min-inline-size: 0;
}

.conduct-simple-referral__name {
  margin: 0;
  min-inline-size: 0;
  color: var(--fg1);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.conduct-simple-referral__meta,
.conduct-simple-referral__words,
.conduct-simple-referral__duplicates {
  margin: 0;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.conduct-simple-referral__meta {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.conduct-simple-referral__words {
  max-inline-size: 70ch;
  color: var(--fg1);
  font-size: var(--text-base);
  line-height: 1.55;
}

.conduct-simple-referral:has(.conduct-simple-referral__read[open]) {
  align-items: flex-start;
}

.conduct-simple-referral__main:has(.conduct-simple-referral__read[open]) .conduct-simple-referral__words {
  display: none;
}

.conduct-simple-referral__read {
  min-inline-size: 0;
}

.conduct-simple-referral__read-summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-block-size: 1.75rem;
  padding-inline-end: var(--space-1);
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

@media (pointer: coarse) {
  .conduct-simple-referral__read-summary {
    min-block-size: var(--target-min);
  }
}

.conduct-simple-referral__read-summary::-webkit-details-marker {
  display: none;
}

.conduct-simple-referral__read-summary:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.conduct-simple-referral__read-summary:focus-visible {
  border-radius: var(--radius-sm);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.conduct-simple-referral__read-summary::after {
  content: "";
  inline-size: 0.45rem;
  block-size: 0.45rem;
  border-inline-end: 2px solid currentcolor;
  border-block-end: 2px solid currentcolor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 140ms ease;
  flex-shrink: 0;
}

.conduct-simple-referral__read[open] > .conduct-simple-referral__read-summary::after {
  transform: rotate(-135deg) translateY(-1px);
}

.conduct-simple-referral__read-open {
  display: none;
}

.conduct-simple-referral__read[open] .conduct-simple-referral__read-closed {
  display: none;
}

.conduct-simple-referral__read[open] .conduct-simple-referral__read-open {
  display: inline;
}

.conduct-simple-referral__body {
  display: grid;
  gap: var(--space-3);
  margin-block-start: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-inline-size: 0;
}

.conduct-simple-referral__full-words {
  margin: 0;
  max-inline-size: 72ch;
  color: var(--fg1);
  font-size: var(--text-base);
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.conduct-simple-referral__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding-block-start: var(--space-2);
  border-block-start: 1px solid var(--rule);
  font-size: var(--text-sm);
  min-inline-size: 0;
}

.conduct-simple-referral__link {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
  color: var(--accent-text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (pointer: coarse) {
  .conduct-simple-referral__link {
    min-block-size: var(--target-min);
  }
}

.conduct-simple-referral__duplicates {
  color: var(--accent-text);
  font-size: var(--text-sm);
  font-weight: 500;
}

.conduct-simple-referral:has(.conduct-simple-referral__give[open]) {
  position: relative;
  z-index: 2;
}

.conduct-simple-referral__actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  max-inline-size: 100%;
  align-items: center;
  gap: var(--space-3);
  min-inline-size: 0;
}

.conduct-simple-referral__take {
  display: flex;
  margin: 0;
  min-inline-size: 0;
}

.conduct-simple-referral__give {
  min-inline-size: 0;
}

.conduct-simple-referral__give > summary {
  list-style: none;
  cursor: pointer;
}

.conduct-simple-referral__give > summary::-webkit-details-marker {
  display: none;
}

/* The colleague popover opens below the card without shifting Take it or Assign to colleague on any viewport. */
.conduct-simple-referral__give-form {
  position: absolute;
  inset-block-start: calc(100% + var(--space-2));
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3);
  max-inline-size: min(26rem, 100%);
  margin-block: 0;
  margin-inline: auto 0;
  padding: var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  min-inline-size: 0;
}

@media (min-width: 48rem) {
  .conduct-simple-referral__give {
    position: relative;
  }

  .conduct-simple-referral__give-form {
    inset-inline-start: auto;
    inset-inline-end: 0;
    inline-size: max-content;
    min-inline-size: 18rem;
    max-inline-size: min(26rem, 90vw);
    margin-inline: 0;
  }
}

.conduct-simple-referrals__more {
  margin-block: var(--space-3) 0;
}

.conduct-simple-list__closed a,
.conduct-simple-referrals__more a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
}

/* The groups of cases: a row each, a hairline between, the button at the end of the row and under the words when there is no room (a phone, a longer language). */
.conduct-simple-group__rows {
  display: grid;
  margin: 0;
  padding: 0;
  padding-inline: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  list-style: none;
  min-inline-size: 0;
}

.conduct-simple-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-4);
  border-block-end: 1px solid var(--rule);
  min-inline-size: 0;
}

.conduct-simple-row:last-child {
  border-block-end: 0;
}

.conduct-simple-row__what {
  display: grid;
  flex: 1 1 20rem;
  gap: var(--space-1);
  min-inline-size: 0;
}

.conduct-simple-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-3);
  min-inline-size: 0;
}

.conduct-simple-row__name {
  margin: 0;
  min-inline-size: 0;
  color: var(--fg1);
  font-size: var(--text-md);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.conduct-simple-row__next,
.conduct-simple-row__reason,
.conduct-simple-row__context {
  margin-block: 0;
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.conduct-simple-row__next {
  color: var(--fg1);
  font-weight: 600;
}

.conduct-simple-row__reason {
  color: var(--fg2);
}

.conduct-simple-row__context {
  color: var(--fg2);
  font-size: var(--text-sm);
}

.conduct-simple-row__act {
  display: flex;
  flex: none;
  min-inline-size: 0;
}

/* Everyone's: the shared table, with the quiet words and the link to the closed cases under it. */
.conduct-simple-list table.data.data-table tbody th[scope="row"] a {
  display: inline-flex;
  align-items: center;
  min-block-size: 1.5rem;
}

@media (pointer: coarse) {
  .conduct-simple-list table.data.data-table tbody th[scope="row"] a {
    min-block-size: var(--target-min);
  }
}

.conduct-simple-list__none {
  color: var(--fg2);
}

.conduct-simple-list__yours {
  font-weight: 700;
}

.conduct-simple-list__note,
.conduct-simple-list__closed {
  margin-block: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
}

/* The Director's week: four tiles that wrap from four across to one, each a figure, what it counts and one line that says it. */
.conduct-simple-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.conduct-simple-tile {
  display: grid;
  gap: var(--space-1);
  align-content: start;
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  min-inline-size: 0;
}

.conduct-simple-tile__figure {
  margin: 0;
  color: var(--fg1);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.1;
}

.conduct-simple-tile__figure[data-tone="accent"] {
  color: var(--accent-text);
}

.conduct-simple-tile__figure[data-tone="warn"] {
  color: var(--tone-warn-fg);
}

.conduct-simple-tile__label {
  margin: 0;
  color: var(--fg1);
  font-size: var(--text-base);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.conduct-simple-tile__note {
  margin: 0;
  color: var(--fg2);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
