/* ════════════════════════════════════════════════════════════
   Desk: the managed IT screens (T-603)

   Impending Tech's look, not Chrysalis's. The service is Impending Tech's
   (Geoff, 29 Sep 2026: "IT look"), so these screens wear its palette and
   type rather than the shared design package. The values are the deployed
   impending.tech build's own tokens
   (_ds/impending-tech-design-system-*/tokens/colors.css), which is where
   that brand is defined. Nothing here reaches Carer or Home.

   Light neutrals are warm, never grey; there is no blue anywhere in this
   brand. Orange is the one hot accent and means "act on this".
   ════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/impending/archivo-variable-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/assets/impending/archivo-variable-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/assets/fonts/ibm-plex-mono-500-latin.woff2) format('woff2');
}

:root {
  --cream: #f6f4ef;
  --ink: #0f1f1d;
  --teal: #0e5b57;
  --teal-900: #073c3a;
  --teal-wash: rgba(41, 214, 194, 0.18);
  --orange: #ff8a00;
  --orange-700: #c46a00;
  --orange-100: #fff6ec;
  --paper: #ffffff;
  --paper-100: #efede6;
  --paper-400: #dad6cc;

  --text-heading: #23282b;
  --text-body: #5c5a53;
  --text-muted: #6e6b63;
  --text-notice: #6b5433;

  --line: #dfdbd1;
  --line-soft: #edeae2;
  --line-strong: #cfccc2;
  --border-notice: #f2dfc6;

  --hover-veil: rgba(46, 48, 54, 0.06);

  --font: 'Archivo', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --gutter: 48px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-body);
  background-color: var(--cream);
  /* The brand's paper: cream with a faint dot grid. */
  background-image: radial-gradient(var(--paper-400) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--teal);
}
a:hover {
  color: var(--orange-700);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Header and the six screens ───────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 72px;
  padding: 0 var(--gutter);
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand img {
  width: 32px;
  height: 32px;
}
.brand-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

.label {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.label--small {
  font-size: 10px;
}
.label--teal {
  color: var(--teal);
}

.screens {
  display: flex;
  gap: 4px;
}
.screen-link {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: 500 15px var(--font);
  color: #2e3036;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.screen-link:hover {
  background: var(--hover-veil);
}
.screen-link[aria-current='page'] {
  background: var(--ink);
  color: var(--cream);
}
.tab-icon {
  display: none;
}
.count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--ink);
  font: 600 12px var(--font);
  text-align: center;
}

.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.linklike {
  border: 0;
  background: none;
  padding: 0;
  font: 600 14px var(--font);
  color: var(--teal);
  cursor: pointer;
}
.linklike:hover {
  color: var(--orange-700);
}

.screen {
  padding: 40px var(--gutter) 64px;
}
.screen-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
}
.screen-head > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}
.screen-title {
  margin: 0;
  font-weight: 700;
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}
.lede {
  margin: 0;
  font-size: 16px;
}
.narrow {
  max-width: 1100px;
}

/* ── Status pills: the four states a check can be in ─────── */

.pill {
  display: inline-block;
  align-self: flex-start;
  padding: 5px 10px;
  border-radius: 999px;
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pill--today {
  background: var(--orange);
  color: var(--ink);
}
.pill--week {
  background: var(--orange-100);
  color: var(--text-notice);
  border: 1px solid var(--border-notice);
}
.pill--fine {
  background: var(--teal-wash);
  color: var(--teal-900);
}
.pill--none {
  background: var(--paper-100);
  color: var(--text-body);
}
/* First seen in the latest night's check (T-609). Ink, so it reads as a fact
   about the finding rather than another level of urgency. */
.pill--new {
  background: var(--ink);
  color: var(--cream);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
}
.subject-name .pill--new {
  margin-left: 10px;
  vertical-align: 2px;
}

/* ── Surfaces ─────────────────────────────────────────────── */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card--urgent {
  border-color: var(--orange);
  box-shadow: inset 0 3px 0 var(--orange);
}

.empty {
  margin: 0;
  padding: 24px;
  color: var(--text-muted);
}
.error {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--orange-100);
  border: 1px solid var(--border-notice);
  color: var(--text-notice);
}

/* ── Today ────────────────────────────────────────────────── */

.overnight {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
}
.overnight-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
}
.overnight-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 400;
}
.overnight-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.today {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 40px;
  align-items: start;
}
.today-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.tile:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 10px rgba(15, 31, 29, 0.06);
}
.tile-title {
  margin: 0;
  font-weight: 600;
  font-size: 20px;
  color: var(--text-heading);
}
.tile-body {
  margin: 0;
  font-size: 15px;
}

.waiting {
  padding: 28px;
  display: flex;
  flex-direction: column;
}
.waiting-title {
  margin: 8px 0 4px;
  font-weight: 600;
  font-size: 20px;
  color: var(--text-heading);
}
.waiting-note {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.waiting-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}
.item-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-heading);
}
.item-note {
  font-size: 14px;
  color: var(--text-muted);
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px var(--font);
  cursor: pointer;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn--go {
  background: var(--orange);
  color: var(--ink);
}
.btn--go:hover:not(:disabled) {
  background: var(--orange-700);
}
.btn--quiet {
  background: var(--paper);
  color: var(--text-heading);
  border-color: var(--line-strong);
}
.btn--quiet:hover:not(:disabled) {
  background: var(--paper-100);
}

/* ── The ask box, on Today and on Ask ─────────────────────── */

.askbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.askbox input {
  flex-grow: 1;
  height: 44px;
  border: 0;
  background: transparent;
  font: 16px var(--font);
  color: var(--text-heading);
  outline: none;
}
.askbox:focus-within {
  border-color: var(--orange);
}

/* ── Fixes ────────────────────────────────────────────────── */

.fix-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  padding: 28px;
}
.fix-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fix-title {
  margin: 0;
  font-weight: 600;
  font-size: 21px;
  color: var(--text-heading);
}
.fix-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.facts {
  margin: 0;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  row-gap: 10px;
  column-gap: 16px;
  font-size: 15px;
}
.facts dt {
  color: var(--text-muted);
}
.facts dd {
  margin: 0;
  color: var(--text-heading);
}
.section-label {
  margin: 32px 0 12px;
}

/* ── Ask ──────────────────────────────────────────────────── */

.ask {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: calc(100vh - 72px - 104px);
}
.log {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.me {
  align-self: flex-end;
  max-width: 560px;
  padding: 14px 18px;
  border-radius: 18px 18px 4px 18px;
  background: var(--ink);
  color: var(--cream);
  white-space: pre-wrap;
}
.reply {
  align-self: flex-start;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--text-heading);
  line-height: 1.6;
}
.reply p {
  margin: 0;
}
.reply-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.thinking {
  color: var(--text-muted);
  font-style: italic;
}
.ask-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font: 500 14px var(--font);
  color: var(--text-heading);
  cursor: pointer;
}
.chip:hover {
  background: var(--paper-100);
}
.ask-promise {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
/* Quiet on purpose: it is there when somebody wants it, not a second call to
   action beside the ask box. The confirm step replaces the link rather than
   opening a dialog, so the choice sits where the person was looking. */
.ask-clear {
  display: flex;
  justify-content: center;
}
.ask-clear .linklike {
  font-size: 13px;
}
.ask-clear-confirm {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.ask-clear-confirm[hidden],
.ask-clear-done[hidden] {
  display: none;
}
.ask-clear-confirm p,
.ask-clear-done {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Your IT ──────────────────────────────────────────────── */

.yourit {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.areas {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 112px;
}
.area {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font: 500 16px var(--font);
  color: var(--text-heading);
  text-align: left;
  cursor: pointer;
}
.area:hover {
  background: var(--hover-veil);
}
.area[aria-current='true'] {
  background: var(--paper);
  border-color: var(--line);
}
.dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--paper-400);
}
.dot--today {
  background: var(--orange);
}
.dot--week {
  background: var(--orange);
  opacity: 0.45;
}
.dot--fine {
  background: var(--teal);
}
.areas-note {
  margin: 24px 16px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.checks {
  max-width: 880px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.checks .lede {
  margin-bottom: 16px;
}
.check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 22px 0;
  border-top: 1px solid var(--line-soft);
  align-items: start;
}
.check:last-child {
  border-bottom: 1px solid var(--line-soft);
}
.check-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.check-title {
  margin: 0;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-heading);
}
.check-body {
  margin: 0;
  font-size: 15px;
}
.rule-line {
  font-size: 13px;
  color: var(--text-muted);
}
.subjects {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.subjects li {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  font-size: 15px;
}
.subject-name {
  font-weight: 600;
  color: var(--text-heading);
}

/* ── Report a problem (T-610) ─────────────────────────────── */

/* In the header on every screen. An orange keyline rather than a filled
   button: it has to be findable at once without shouting over the page. */
.report-open {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--orange);
  background: var(--paper);
  font: 600 14px var(--font);
  color: var(--text-heading);
  white-space: nowrap;
  cursor: pointer;
}
.report-open:hover {
  background: var(--orange-100);
}

.report {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 48px;
  align-items: start;
}
.report-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 760px;
}
.report-form .screen-head {
  margin-bottom: 0;
}
.report-form textarea {
  font: 16px/1.5 var(--font);
  color: var(--text-heading);
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  resize: vertical;
}
.report-form textarea:focus {
  outline: none;
  border-color: var(--orange);
}
.choices {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choices legend {
  margin-bottom: 10px;
}
.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 44px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  font-size: 14px;
  color: var(--text-body);
  cursor: pointer;
}
.choice strong {
  display: block;
  font-size: 15px;
  color: var(--text-heading);
}
.choice input {
  margin: 3px 0 0;
  accent-color: var(--orange-700);
}
.choice:has(input:checked) {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 1px var(--orange);
}
.report-send {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.report-answer {
  margin: 0;
}
.report-answer--sent {
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--teal-wash);
  color: var(--teal-900);
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.report-item .item-title {
  overflow-wrap: anywhere;
}

/* ── Evidence and History: ruled tables ───────────────────── */

.table {
  overflow: hidden;
}
.table-row {
  display: grid;
  gap: 24px;
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
  align-items: baseline;
  font-size: 15px;
}
.table-row:first-child {
  border-top: 0;
}
.table-head {
  background: var(--paper-100);
}
.evidence-row {
  grid-template-columns: 240px minmax(0, 1fr);
}
.history-row {
  grid-template-columns: 90px 200px minmax(0, 1fr);
}
.control-name {
  font-weight: 600;
  color: var(--text-heading);
}
.rule-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rule-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.fineprint {
  margin: 24px 0 0;
  max-width: 900px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fineprint p {
  margin: 0;
}
.time {
  font: 500 13px var(--mono);
  color: var(--text-muted);
}
.who {
  font-weight: 600;
  color: var(--text-heading);
}
.day {
  padding: 14px 24px;
  background: var(--paper-100);
  border-top: 1px solid var(--line-soft);
}
.day:first-child {
  border-top: 0;
}
.filters {
  display: flex;
  gap: 6px;
}
.filter {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font: 500 14px var(--font);
  color: var(--text-heading);
  cursor: pointer;
}
.filter[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* ── Queue: Impending Tech's own screen (T-636) ──────────────
   Denser than the customer screens on purpose: this is a work list read
   every morning, so one line per item, a table rather than cards, and the
   detail in a side panel that keeps the list in view. */

/* Which tabs a sign-in gets. Customer screens until the page knows the
   sign-in is ours, so a customer never sees our tab flash past. */
body:not(.mode-operator) [data-for='operator'],
body.mode-operator [data-for='customer'] {
  display: none;
}

.queue-customer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.queue-checked {
  font: 500 13px var(--mono);
  color: var(--text-muted);
}
.select {
  height: 40px;
  min-width: 220px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c5a53' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  font: 500 15px var(--font);
  color: var(--text-heading);
  appearance: none;
  cursor: pointer;
}
.select--small {
  height: 34px;
  min-width: 180px;
  font-size: 14px;
}

/* A job that will not run, said above the list (T-605), for an administrator
   who no longer sees Today. */
.queue-notices {
  margin-bottom: 20px;
}

.queue-views {
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.queue-views .filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter-n {
  font: 500 12px var(--mono);
  color: var(--text-muted);
}
.filter[aria-pressed='true'] .filter-n {
  color: var(--paper-400);
}

.queue-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-bottom: 20px;
}
.facet {
  display: flex;
  align-items: center;
  gap: 10px;
}
.facet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.facet-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--paper);
  font: 500 14px var(--font);
  color: var(--text-heading);
  cursor: pointer;
}
.facet-chip:hover {
  border-color: var(--text-muted);
}
.facet-chip[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.facet-chip:disabled {
  opacity: 0.45;
  cursor: default;
}
.facet-chip .filter-n {
  color: var(--text-muted);
}
.queue-reset {
  margin-left: auto;
}

/* The priority mark: a bar at the row's left edge and a dot on a chip. */
.prio {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper-400);
}
.prio--1 {
  background: var(--orange);
}
.prio--2 {
  background: #f2b567;
}
.prio--3 {
  background: var(--teal);
  opacity: 0.55;
}

.queue-table {
  overflow: hidden;
}
.queue-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 170px 150px 88px 128px;
  gap: 20px;
  align-items: center;
  width: 100%;
  min-height: 60px;
  padding: 10px 20px 10px 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
  font: 400 15px var(--font);
  color: var(--text-body);
  text-align: left;
  cursor: pointer;
  position: relative;
}
.queue-row:first-child {
  border-top: 0;
}
.queue-row:hover {
  background: #fbfaf7;
}
.queue-row[aria-current='true'] {
  background: var(--orange-100);
}
.queue-row:focus-visible {
  outline-offset: -2px;
}
.queue-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
}
.queue-row.is-p1::before {
  background: var(--orange);
}
.queue-row.is-p2::before {
  background: #f2b567;
}
.queue-head {
  min-height: 40px;
  background: var(--paper-100);
  cursor: default;
}
.queue-head:hover {
  background: var(--paper-100);
}
.queue-head span {
  font: 500 11px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.q-prio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 20px;
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-heading);
}
.q-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.q-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-heading);
  min-width: 0;
}
.q-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-sub {
  font-size: 14px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-kind {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--paper-100);
  font: 500 10px var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-body);
}
.q-kind--report {
  background: var(--teal-wash);
  color: var(--teal-900);
}
.q-cell {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-age {
  font: 500 13px var(--mono);
  color: var(--text-muted);
}
.pill--waiting {
  background: var(--paper);
  color: var(--text-heading);
  border: 1px solid var(--line-strong);
}
.pill--new-item {
  background: var(--ink);
  color: var(--cream);
}
.queue-keys {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper);
  font: 500 12px var(--mono);
  color: var(--text-heading);
}

/* The side panel. It sits over the right of the list so the row that opened
   it stays in view; on a phone it becomes the whole screen. */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px rgba(15, 31, 29, 0.12);
  overflow-y: auto;
  animation: drawer-in 180ms ease-out;
}
@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .drawer {
    animation: none;
  }
}
.drawer-veil {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(15, 31, 29, 0.18);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 28px 0;
}
.drawer-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-heading);
  cursor: pointer;
}
.drawer-close:hover {
  background: var(--hover-veil);
}
.drawer-title {
  margin: 10px 28px 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-heading);
  outline: none;
}
.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 28px 40px;
}
.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-section p {
  margin: 0;
}
.drawer-fix {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--orange-100);
  border: 1px solid var(--border-notice);
  color: var(--text-heading);
}
.drawer-quote {
  padding: 14px 16px;
  border-left: 3px solid var(--teal);
  background: #fbfaf7;
  color: var(--text-heading);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.drawer-note {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--paper-100);
  font-size: 14px;
}
.subjects {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.subjects li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
}
.subjects li:first-child {
  border-top: 0;
}
.subject-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-heading);
  overflow-wrap: anywhere;
}
.drawer-facts {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  font-size: 14px;
}
.drawer-facts dt {
  color: var(--text-muted);
}
.drawer-facts dd {
  margin: 0;
  color: var(--text-heading);
  overflow-wrap: anywhere;
}
.mono {
  font: 500 13px var(--mono);
}
.status-set {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Narrow screens: one column, the nav scrolls sideways ─── */

@media (max-width: 1100px) {
  :root {
    --gutter: 24px;
  }
  .today,
  .yourit,
  .report {
    grid-template-columns: minmax(0, 1fr);
  }
  .areas {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .areas-note {
    display: none;
  }
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .queue-row {
    grid-template-columns: 88px minmax(0, 1fr) 140px 80px 120px;
  }
  .queue-row .q-area {
    display: none;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  /* On a phone the six screens become a tab bar along the bottom (T-609),
     where a thumb reaches them. The sideways-scrolling row it replaces hid
     Evidence and History off the edge. */
  .screens {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    gap: 0;
    padding: 0 4px env(safe-area-inset-bottom);
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .screen-link {
    flex: 1 1 0;
    flex-direction: column;
    gap: 3px;
    height: 64px;
    padding: 8px 0 0;
    border-radius: 0;
    font-size: 11px;
    color: var(--text-body);
    position: relative;
  }
  .screen-link:hover {
    background: transparent;
  }
  .screen-link[aria-current='page'] {
    background: transparent;
    color: var(--ink);
    font-weight: 600;
  }
  .screen-link[aria-current='page'] .tab-icon {
    color: var(--orange-700);
  }
  .tab-icon {
    display: block;
  }
  .count {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    min-width: 18px;
    padding: 0 5px;
    font-size: 11px;
  }
  main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .topbar {
    position: static;
  }
  .topbar-end {
    margin-left: auto;
  }
  .tiles {
    grid-template-columns: minmax(0, 1fr);
  }
  .choice-row {
    grid-template-columns: minmax(0, 1fr);
  }
  /* On a phone the header keeps the report button and the sign-out, and drops
     the check time and the name, which Today shows anyway. */
  #checked,
  #who {
    display: none;
  }
  .fix {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .facts {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  .facts dd {
    margin-bottom: 10px;
  }
  .evidence-row,
  .history-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .screen-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .screen-title {
    font-size: 28px;
  }
  /* On a phone the filters are single rows that scroll sideways, so the list
     starts on the first screen rather than under three rows of chips. */
  .queue-customer {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
  }
  .queue-customer .select {
    min-width: 0;
    height: 36px;
    font-size: 14px;
  }
  .queue-views,
  .facet-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-right: calc(-1 * var(--gutter));
    padding-right: var(--gutter);
  }
  .queue-views .filter,
  .facet-chip {
    flex-shrink: 0;
  }
  .queue-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .facet {
    min-width: 0;
  }
  /* A scrolling row inside a flex row needs a floor of zero, or it grows to
     its content and widens the whole page, tab bar included. */
  .facet-chips {
    flex: 1 1 0;
    min-width: 0;
  }
  .facet {
    width: 100%;
  }
  .q-title {
    align-items: flex-start;
  }
  .q-title-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
  }
  .q-kind {
    margin-top: 3px;
  }
  .facet > .label {
    width: 64px;
    flex-shrink: 0;
  }
  .queue-reset {
    margin-left: 0;
    align-self: flex-start;
  }
  .queue-head {
    display: none;
  }
  /* A row becomes two lines: the item and its state, then who and when. */
  .queue-row {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'item item item state'
      'cust area age age';
    gap: 6px 14px;
    padding: 14px 16px 14px 20px;
  }
  .queue-row .q-prio {
    display: none;
  }
  .queue-row .q-item {
    grid-area: item;
  }
  .queue-row .q-state {
    grid-area: state;
  }
  .queue-row .q-customer {
    grid-area: cust;
  }
  .queue-row .q-area {
    grid-area: area;
    display: block;
  }
  .queue-row .q-age {
    grid-area: age;
  }
  .queue-row .q-cell,
  .queue-row .q-age {
    font-size: 13px;
    color: var(--text-muted);
  }
  .queue-keys {
    display: none;
  }
  .drawer {
    width: 100%;
    border-left: 0;
  }
  .drawer-facts {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 2px;
  }
  .drawer-facts dd {
    margin-bottom: 8px;
  }
}

/* The way into the sales CRM, which wears Chrysalis's look on its own pages.
   Shown only to a sign-in with people in it (whoami's sales flag). */
.topbar-link {
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
}
.topbar-link:hover {
  color: var(--orange-700);
}
