/* İ.Z.A.N. shared UI: base components, direction B "Canlı Kontrol" (2026-10-22). Class-based and framework-free;
   every page that loads /ui/tokens.css and this file gets the same parts, in the light and the dark theme.
   Names (stable, documented in docs/en/api.md "Shared UI"):
     .btn (.primary .secondary .ghost .danger|.red · .sm .lg · [disabled] .busy) in a .buttons row; one .primary
       per surface · .chips > button (.selected .faint) · .badge (button.badge, .on) · .kbd
     .dot (.live .wait .crit .idle; .live and .wait pulse) · .chip with a status class .s-working .s-waiting
       .s-done .s-error .s-idle · .tag (.ok .warn .crit .neu)
     .card (.solid .flat .sunk) · .risk-strip (.low .med .high .crit) inside a .has-risk card · .risk-band
     .list-row (.lead .main > .t .s · .trail) · .bar > .top + .rail > i (.warn .work) · .meter > i
     .eyebrow · .num · .big-num · table.md · .empty / .empty-state · .note-small (.bad) · .toast · .live-strip
     form controls inside .ui-form (the campus: #form): label, input, select, textarea, .field-unit,
       .choice-list > .choice, .segmented, .day-grid, .note (.warn) · .spacer
   The form selectors are written `:is(#form, .ui-form)` so the campus keeps its id-level weight. */
* {
  box-sizing: border-box;
}
body {
  background: var(--surface-0);
  color: var(--text-1);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* A page without the 3D scene shows the ground of direction B: two soft lights and a dot grid. */
body.ui-ground {
  background-image: var(--ground-image);
  background-size: var(--ground-size);
  background-attachment: fixed;
}
.spacer {
  flex: 1;
}

/* ——— Focus ———
   One ring everywhere, only for the keyboard (`:focus-visible`), never removed without a replacement. */
:where(button, a, [tabindex], summary, .btn, .choice, .segmented > *, .day-grid > *):focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

/* ——— Badges, keys and chips ——— */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-s);
  background: var(--chip);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
}
.badge b {
  color: var(--text-1);
  font-weight: 600;
}
button.badge {
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition:
    background var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease);
}
/* In presentation mode the badge stays highlighted: one look shows whether amounts are hidden. */
button.badge.on {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}
button.badge:hover {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent);
  color: var(--text-1);
}
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* ——— Status dot ———
   Live and waiting dots pulse; under reduced motion they stay still. Colour is never the only signal: the dot sits
   next to a word. */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success-dot);
  flex: none;
  display: inline-block;
}
/* No inline style: a page with a strict CSP (İZAN Server) refuses style attributes. */
.dot.idle {
  background: var(--idle);
}
.dot.live {
  background: var(--live);
  color: color-mix(in srgb, var(--live) 60%, transparent);
  animation: ui-pulse var(--pulse) infinite;
}
.dot.wait {
  background: var(--warn-dot);
  color: color-mix(in srgb, var(--warn-dot) 60%, transparent);
  animation: ui-pulse var(--pulse) infinite;
}
.dot.crit {
  background: var(--danger-dot);
}
@keyframes ui-pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dot.live,
  .dot.wait {
    animation: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 40%, transparent);
  }
}

/* ——— Status chips and tags ——— */
.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.s-working {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.s-waiting {
  background: var(--warn-soft);
  color: var(--warn);
}
.s-done {
  background: var(--success-soft);
  color: var(--success);
}
.s-error {
  background: var(--danger-soft);
  color: var(--danger);
}
.s-idle {
  background: var(--surface-2);
  color: var(--text-2);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 7px;
  white-space: nowrap;
}
.tag.ok {
  color: var(--success);
  background: color-mix(in srgb, var(--success-dot) 18%, transparent);
  box-shadow: 0 0 12px -2px color-mix(in srgb, var(--success-dot) 50%, transparent);
}
.tag.warn {
  color: var(--warn);
  background: var(--warn-soft);
}
.tag.crit {
  color: var(--danger);
  background: var(--danger-soft);
}
.tag.neu {
  color: var(--text-2);
  background: var(--surface-2);
}

/* ——— Buttons ———
   One filled .primary per surface (a card, a sheet, a bar); every other action is .secondary (the default look),
   .ghost or .danger. Sizes: .sm 28 px, the default 32 px, .lg 44 px (a sheet's action bar). */
.buttons {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.btn {
  /* `min-width: 0` made buttons narrower than their text: with three buttons side by side
     the labels overflowed their boxes and overlapped. Now each button asks for its text
     width, and a button that does not fit wraps to the next line (the row is `flex-wrap`). */
  flex: 1 1 auto;
  min-width: max-content;
  max-width: 100%;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-s);
  cursor: pointer;
  border: 0;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-1);
  font: 600 13px/1 var(--font);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    background var(--dur-1) var(--ease),
    box-shadow var(--dur-1) var(--ease),
    filter var(--dur-1) var(--ease);
}
.btn:hover {
  background: var(--surface-2);
}
.btn.primary {
  background: var(--primary-fill);
  box-shadow: var(--primary-glow);
  color: var(--on-primary);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.ghost {
  box-shadow: none;
  color: var(--text-2);
  font-weight: 500;
}
.btn.ghost:hover {
  color: var(--text-1);
}
.btn.red,
.btn.danger {
  color: var(--danger);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent);
}
.btn.red:hover,
.btn.danger:hover {
  background: var(--danger-soft);
}
.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}
.btn.lg {
  height: 44px;
  padding: 0 18px;
  font-size: 15px;
  border-radius: var(--radius-m);
}
.btn .kbd {
  margin-left: 8px;
  opacity: 0.9;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: default;
  filter: none;
}
.btn.busy {
  opacity: 0.5;
  pointer-events: none;
}
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

/* Pill rows: kept for the panels that still use them; new forms use .choice-list or .segmented. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chips button {
  height: 28px;
  padding: 0 11px;
  border-radius: var(--radius-s);
  cursor: pointer;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--border);
  background: var(--surface-2);
  color: var(--text-1);
  font: 500 12px/1 var(--font);
}
.chips button:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-ink) 45%, transparent);
}
.chips button.selected {
  background: var(--primary);
  box-shadow: none;
  color: var(--on-primary);
  font-weight: 600;
}
.chips button.faint {
  opacity: 0.55;
}

/* ——— Card surface ———
   A glass card by default (it floats over the scene or the ground); .solid for a card that holds a long or scrolling
   list (blur over a moving list costs frames on a phone), .flat for a group inside a card, .sunk for a quiet well. */
.card {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-l);
  box-shadow: var(--elev-1);
}
.card.solid {
  background: var(--surface-1);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.card.flat {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}
.card.sunk {
  background: var(--surface-2);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}

/* ——— Risk strip ———
   A 3 px colour bar on the left edge of an approval card, plus a band at the top that names the level in words
   (`<div class="risk-band">Risk · high <span class="bars"><i></i><i></i><i></i><i class="o"></i></span></div>`).
   A critical card also gets a red ring and glow. */
.has-risk {
  overflow: hidden;
}
.risk-strip {
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--risk-c, var(--risk-high));
}
.risk-strip.low,
.risk-band.low {
  --risk-c: var(--risk-low);
}
.risk-strip.med,
.risk-band.med {
  --risk-c: var(--risk-med);
}
.risk-strip.high,
.risk-band.high {
  --risk-c: var(--risk-high);
}
.risk-strip.crit,
.risk-band.crit {
  --risk-c: var(--risk-crit);
}
.has-risk.crit {
  box-shadow:
    var(--elev-1),
    0 0 0 1px color-mix(in srgb, var(--risk-crit) 35%, transparent),
    0 0 40px -12px var(--risk-crit);
}
.risk-band {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--risk-c, var(--risk-high)) 14%, transparent), transparent);
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--risk-c, var(--risk-high)) 30%, transparent);
  color: var(--text-1);
  /* Sentence case in a small mono ("Risk · medium"): the uppercase, spaced band shouted over the card's title
     (review 2026-10-29). The colour, the strip and the bars carry the level. */
  font: 500 11px/1.2 var(--mono);
}
.risk-band .bars {
  display: inline-flex;
  gap: 3px;
}
.risk-band .bars i {
  width: 14px;
  height: 6px;
  border-radius: 2px;
  background: var(--risk-c, var(--risk-high));
}
.risk-band .bars i.o {
  opacity: 0.25;
}

/* ——— List rows ———
   `<div class="list-row"><span class="lead">…</span><div class="main"><div class="t">…</div><div class="s">…</div>
   </div><span class="trail">…</span></div>`: a hairline between rows, no box per row. */
.list-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.list-row:last-child {
  box-shadow: none;
}
.list-row .main {
  min-width: 0;
}
.list-row .t {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .s {
  font-size: 12px;
  color: var(--text-2);
}
.list-row .trail {
  font: 500 12px/1 var(--mono);
  color: var(--text-2);
}
button.list-row {
  width: 100%;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
button.list-row:hover {
  background: var(--surface-2);
}

/* ——— Bars and meters ——— */
.bar {
  margin-bottom: 9px;
}
.bar .top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}
.bar .top b {
  font-weight: 600;
}
.bar .top span {
  color: var(--text-2);
}
.rail,
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.rail i,
.meter i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-ink);
}
.rail i.warn,
.meter i.warn {
  background: var(--warn-dot);
}
/* A share of agents at work: the "working" dot colour, so a bar never reads as a status of its own. */
.rail i.work {
  background: var(--dot-working, var(--working));
}
/* Two shares side by side (at work, then waiting for a person): the segments meet with a hairline of ground. */
.rail.split {
  display: flex;
  gap: 1px;
}
.rail.split i {
  flex: none;
  border-radius: 0;
}
.rail.split i:first-child {
  border-radius: 3px 0 0 3px;
}
.rail.split i:last-child {
  border-radius: 0 3px 3px 0;
}
.rail.split i:only-child {
  border-radius: 3px;
}
.rail i.wait {
  background: var(--dot-waiting, var(--waiting));
}

/* ——— Text roles ——— */
.eyebrow {
  font: 500 12px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
/* Cost, context and calls read as instruments: monospace, tabular, strong. */
.num {
  font-family: var(--mono);
  font-feature-settings: 'tnum';
  font-weight: 500;
}
.big-num {
  font: 500 24px/1.1 var(--mono);
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum';
  color: var(--text-1);
}
table.md th,
table.md td {
  border: 1px solid var(--hairline);
  padding: 3px 8px;
  text-align: left;
}
table.md th {
  font-weight: 600;
  background: var(--surface-2);
}
.note-small {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-2);
}
.note-small.bad {
  color: var(--danger);
}

/* ——— Empty state ———
   .empty is the one-line form; .empty-state the full one: `<div class="empty-state"><b>No routines yet</b>
   <p>…</p><button class="btn primary">New routine</button></div>`. */
.empty {
  padding: 14px 12px;
  color: var(--text-2);
  font-size: 12px;
}
.empty-state {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 24px 14px;
  text-align: center;
  color: var(--text-2);
  font-size: 13px;
}
.empty-state b {
  color: var(--text-1);
  font-size: 15px;
  font-weight: 600;
}
.empty-state p {
  margin: 0;
  max-width: 36ch;
}
.empty-state .btn {
  flex: none;
  margin-top: 6px;
}

/* ——— Toast (/ui/toast.js) ——— */
.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--elev-3);
  color: var(--text-1);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity var(--dur-2) var(--ease),
    transform var(--dur-2) var(--ease);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.toast.ok .dot {
  background: var(--success-dot);
}
.toast.bad {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.toast.bad .dot {
  background: var(--danger-dot);
}
.toast .btn {
  flex: none;
}

/* ——— Live status bar ———
   One monospace line of what runs: `● 3 live / ● 1 approval / $1.92 today` (/ui/topbar.js liveMarkup with
   `stats`). Figures in --text-1, words in --text-2, separators faint. */
.live-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font: 12px/1 var(--mono);
  color: var(--text-2);
}
.live-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.live-strip b {
  color: var(--text-1);
  font-weight: 500;
}
.live-strip .sep {
  opacity: 0.4;
}

/* ——— Form controls ——— */
/* A field label in sentence case: uppercase spaced labels read as decoration. */
:is(#form, .ui-form) label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
:is(#form, .ui-form) input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='file'])),
:is(#form, .ui-form) select,
:is(#form, .ui-form) textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--radius-m);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--border-strong);
  background: color-mix(in srgb, var(--surface-1) 70%, var(--surface-0));
  color: var(--text-1);
  font: inherit;
  transition: box-shadow var(--dur-1) var(--ease);
}
:is(#form, .ui-form) textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 11px;
  line-height: 1.45;
  resize: vertical;
}
:is(#form, .ui-form) select {
  appearance: none;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
    linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position:
    right 15px center,
    right 10px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
:is(#form, .ui-form) :is(input, select, textarea):focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-ink);
}
:is(#form, .ui-form) :is(input, select, textarea)::placeholder {
  color: var(--text-3);
}
/* A number with its unit inside the field: `<div class="field-unit"><input type="number"><span class="u">min
   </span></div>`. */
.field-unit {
  display: flex;
  align-items: center;
  position: relative;
}
.field-unit .u {
  position: absolute;
  right: 11px;
  color: var(--text-2);
  font-size: 13px;
  pointer-events: none;
}
:is(#form, .ui-form) .field-unit input {
  padding-right: 44px;
}

/* Selection list: one option per row with a description, instead of a pill row.
   `<div class="choice-list" role="radiogroup"><button class="choice on" role="radio" aria-checked="true">
   <span class="ra"></span><span><span class="n">Name</span><span class="d">What it does</span></span>
   <span class="x">extra</span></button>…</div>` (/ui/controls.js draws and binds it). */
.choice-list {
  display: grid;
  border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--hairline);
  overflow: hidden;
}
.choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.choice + .choice {
  box-shadow: 0 -1px 0 var(--hairline);
}
.choice:hover {
  background: var(--surface-2);
}
.choice .ra {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--border-strong);
}
.choice.multi .ra {
  border-radius: 5px;
}
.choice.on {
  background: var(--accent-soft);
}
.choice.on .ra {
  box-shadow: inset 0 0 0 5px var(--accent-ink);
}
.choice .n {
  display: block;
  font-size: 14px;
  font-weight: 600;
}
.choice .d {
  display: block;
  font-size: 13px;
  color: var(--text-2);
}
.choice .x {
  font: 12px/1.4 var(--font);
  color: var(--text-2);
}
.choice[disabled] {
  opacity: 0.5;
  cursor: default;
}

/* Segmented control: two to four exclusive options of equal weight. */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
}
.segmented > button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-s);
  background: none;
  color: var(--text-2);
  font: 500 13px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.segmented > button.on {
  background: var(--seg-on);
  color: var(--text-1);
  box-shadow:
    0 1px 2px color-mix(in srgb, var(--shade) 14%, transparent),
    0 0 0 1px var(--hairline);
}

/* Day grid: the seven weekdays, several may be on. */
.day-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-grid > button {
  height: 38px;
  border: 0;
  border-radius: var(--radius-m);
  box-shadow: inset 0 0 0 1px var(--hairline);
  background: none;
  color: var(--text-2);
  font: 500 13px/1 var(--font);
  cursor: pointer;
}
.day-grid > button.on {
  background: var(--primary);
  box-shadow: none;
  color: var(--on-primary);
  font-weight: 600;
}
:is(#form, .ui-form) .note {
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
:is(#form, .ui-form) .note.warn {
  color: var(--warn);
}
@media (max-width: 760px) {
  /* iOS zooms the page and shifts the view when a field with text smaller than 16 pixels
     gets focus. On the phone every text field is 16 pixels; there is no other fix,
     iOS Safari ignores `user-scalable=no`. */
  input,
  textarea,
  select {
    font-size: 16px;
  }
  :is(#form, .ui-form) input:where(:not([type='checkbox'], [type='radio'], [type='range'], [type='file'])),
  :is(#form, .ui-form) select {
    height: 44px;
  }
}

/* ——— Summary-first blocks ———
   .lead: the one sentence of state at the top of a screen. .section-h: a heading in sentence case, with an optional
   count in <b>. .metrics > .metric: a big number only with a label above it and a context line under it.
   .seg > i.p-*: parts of one whole in one bar, read through a .legend. .att-row: one line of a "Needs attention"
   list (tinted .ico, title and sub line, an optional .chip-s, one verb). Colour carries meaning only. */
.lead {
  margin: 2px 0 14px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-1);
}
.section-h {
  margin: 18px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.section-h b {
  margin-left: 4px;
  font-weight: 500;
  color: var(--text-2);
}
.section-h small {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}
.metric {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface-1);
  box-shadow: var(--elev-1);
}
.metric .label,
.metric .ctx {
  font-size: 12px;
  color: var(--text-2);
}
.metric .label {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.metric .num {
  margin: 4px 0 2px;
  font: 500 22px/1.15 var(--mono);
  letter-spacing: -0.03em;
  font-feature-settings: 'tnum';
}
.seg {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
.seg i {
  display: block;
  height: 100%;
}
.p-wait {
  --c: var(--dot-waiting, var(--waiting));
}
.p-work {
  --c: var(--dot-working, var(--working));
}
.p-done {
  --c: var(--dot-done, var(--done));
}
.p-late {
  --c: var(--error);
}
.p-rest {
  --c: color-mix(in srgb, var(--idle) 45%, transparent);
}
.seg i[class^='p-'] {
  background: var(--c);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 13px;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.legend b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.att-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  box-shadow: inset 0 -1px 0 var(--hairline);
}
.att-row:last-child {
  box-shadow: none;
}
.att-row .ico {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-m);
  display: grid;
  place-items: center;
}
.att-row .ico svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.t-wait {
  background: var(--warn-soft);
  color: var(--warn);
}
.t-info {
  background: var(--info-soft, var(--sea-soft));
  color: var(--info, var(--working));
}
.t-bad {
  background: var(--danger-soft);
  color: var(--danger);
}
.t-idle {
  background: var(--surface-2);
  color: var(--text-2);
}
.att-row .t {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.att-row .s {
  font-size: 12px;
  color: var(--text-2);
}
.chip-s {
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.att-row .btn {
  flex: none;
}

/* Links inside a sheet or form: the accent ink, no browser blue, no underline until hover (ui-audit). */
:is(#form, .ui-form) a {
  color: var(--accent-ink);
  font-weight: 500;
  text-decoration: none;
}
:is(#form, .ui-form) a:hover {
  text-decoration: underline;
}
