/* Porsa stylesheet, v2 (prompt 09, part A): ink on paper, one sun.
   Layers in order: fonts, reset, base, layout, components, utilities, print.
   Tokens live in tokens.css. Logical properties throughout (RTL first). No framework. */

@import url("tokens.5bf5e76f937c.css");

/* ================================================================ fonts */
@font-face { font-family: "Shabnam"; src: url("../vendor/fonts/shabnam/Shabnam-Regular.ec24935dfb05.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Shabnam"; src: url("../vendor/fonts/shabnam/Shabnam-Bold.a931370a97d7.woff2") format("woff2"); font-weight: 700; font-display: swap; }
/* Shabnam's own Persian digits at one width (docs/design/tools/build_digits.py), for tables */
@font-face { font-family: "Porsa Digits"; src: url("../vendor/fonts/porsa-digits/PorsaDigits-Regular.3e37d4759e65.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+06F0-06F9; }
@font-face { font-family: "Porsa Digits"; src: url("../vendor/fonts/porsa-digits/PorsaDigits-Bold.20c078f8b56d.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+06F0-06F9; }
/* Latin codes only (CH-0012): the stamp and code inputs */
@font-face { font-family: "Vazirmatn"; src: url("../vendor/vazirmatn/Vazirmatn[wght].f6d31671339d.woff2") format("woff2-variations"); font-weight: 100 900; font-display: swap; }

/* ================================================================ reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; line-height: var(--leading-body); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
table { border-collapse: collapse; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ================================================================ base */
html {
  font-family: var(--font-text);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  direction: rtl;
  text-align: right;
  letter-spacing: 0;
}
body { display: flex; flex-direction: column; background: var(--bg); }
::selection { background: var(--selection); color: var(--text); }
::placeholder { color: var(--text-3); opacity: 1; }
:root { caret-color: var(--ink); accent-color: var(--ink); }
/* focus: an ink line with the sun around it; the ink carries the contrast, the sun the eye */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); border-radius: var(--radius); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius); border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
html { scrollbar-color: var(--border-strong) transparent; }

/* six levels: display, title, heading, body, small, caption */
.display { font-size: var(--type-display); line-height: var(--leading-display); font-weight: var(--weight-bold); }
h1, .title { font-size: var(--type-title); line-height: var(--leading-display); font-weight: var(--weight-bold); }
h2, .heading { font-size: var(--type-heading); line-height: var(--leading-heading); font-weight: var(--weight-bold); }
h3 { font-size: var(--type-body); line-height: var(--leading-heading); font-weight: var(--weight-bold); }
h4 { font-size: var(--type-small); line-height: var(--leading-small); font-weight: var(--weight-bold); }
h1, h2, h3, h4, .display { text-wrap: balance; }
p { max-width: var(--measure); text-wrap: pretty; }
small, .small { font-size: var(--type-small); line-height: var(--leading-small); }
.micro, .caption { font-size: var(--type-caption); line-height: var(--leading-small); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
strong, b { font-weight: var(--weight-bold); }

/* links are ink with a thin underline set off the baseline; under the pointer it thickens */
a:where(:not([class])) {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 5px; text-decoration-color: var(--border-strong);
  transition: text-decoration-color var(--t-hover) var(--ease-out);
}
a:where(:not([class])):hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
hr { border: 0; border-block-start: 1px solid var(--border); }

/* numbers in Shabnam's digits at one width; Latin codes in Vazirmatn, isolated left to right */
.num { font-family: var(--font-figures); unicode-bidi: isolate; }
code, .code { font-family: var(--font-code); direction: ltr; unicode-bidi: isolate; }
.code { white-space: nowrap; } /* a code is one word: never broken at its hyphen (prompt 06b) */
.ltr { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 640px) { html { font-size: 17px; } }

/* a section heading; v1's underline is gone, the heading carries its own weight */
.titled { margin-block-end: var(--space-3); }

/* ================================================================ layout: band */
.skip { position: absolute; inset-inline-start: var(--space-4); inset-block-start: -80px; z-index: 60; padding: var(--space-2) var(--space-4); background: var(--ink); color: var(--on-ink); border-radius: var(--radius); text-decoration: none; }
.skip:focus { inset-block-start: var(--space-2); }

.band {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: var(--space-6);
  min-height: var(--band-height); padding-inline: var(--space-8);
  background: var(--bg); border-block-end: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--row); color: var(--ink); text-decoration: none; flex: none; }
.brand__mark { height: 48px; width: calc(48px * 760 / 621); }
.brand__word { height: 27px; width: calc(27px * 599 / 169); }
.brand:hover .brand__word { opacity: 0.82; }
.brand:focus-visible { outline-offset: 4px; }
.lockup { display: inline-flex; align-items: center; gap: var(--space-3); color: var(--ink); }
.lockup__mark { height: 44px; width: calc(44px * 760 / 621); }
.lockup__word { height: 24px; width: calc(24px * 599 / 169); }
.lockup--small .lockup__mark { height: 36px; width: calc(36px * 760 / 621); }
.lockup--small .lockup__word { height: 22px; width: calc(22px * 599 / 169); }

.band__nav { display: flex; gap: var(--space-5); align-self: stretch; }
.band__nav a { position: relative; display: inline-flex; align-items: center; white-space: nowrap; color: var(--text-2); text-decoration: none; }
.band__nav a:hover { color: var(--text); }
.band__nav a[aria-current="page"] { color: var(--text); font-weight: var(--weight-bold); }
.band__nav a[aria-current="page"]::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: 3px; background: var(--sun); }

/* the user's corner: name over role, the theme control, sign out */
.account { margin-inline-start: auto; display: flex; align-items: center; }
.account__toggle { display: none; }
.account__panel { display: flex; align-items: center; gap: var(--space-5); }
.account__who { display: flex; flex-direction: column; line-height: 1.35; max-width: none; }
.account__who strong { font-size: var(--type-small); color: var(--text); }
.account__who span { font-size: var(--type-caption); color: var(--text-2); }
.account form:not(.theme-switch) { display: contents; }

.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.theme-switch__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.theme-switch button { min-height: 40px; padding-inline: var(--space-3); border-radius: 2px; color: var(--text-2); font-size: var(--type-small); transition: background-color var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out); }
.theme-switch button:hover { color: var(--text); background: var(--surface-2); }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); font-weight: var(--weight-bold); }
.theme-switch button:focus-visible { outline-offset: 1px; }

@media (max-width: 720px) {
  .band { padding-inline: var(--space-4); gap: var(--space-3); }
  .brand__mark { height: 40px; width: calc(40px * 760 / 621); }
  .brand__word { height: 22px; width: calc(22px * 599 / 169); }
  .band__nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; gap: var(--space-5); min-height: var(--row); margin-block-start: calc(-1 * var(--space-2)); }
  .band__nav::-webkit-scrollbar { display: none; }
  .band { flex-wrap: wrap; }
  /* the panel opens in the flow under the band's first row and pushes the page down */
  .js .account { display: contents; }
  .js .account__toggle { display: inline-grid; place-items: center; width: var(--row); height: var(--row); margin-inline-start: auto; border-radius: var(--radius); color: var(--text); order: 1; }
  .js .account__toggle:hover, .js .account.is-open .account__toggle { background: var(--surface-2); }
  .js .account__panel {
    display: none; order: 2; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: var(--space-4);
    padding-block: var(--space-4); border-block-start: 1px solid var(--border);
  }
  .js .account.is-open .account__panel { display: flex; }
  .account__panel { flex-wrap: wrap; }
  .theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); }
  .theme-switch button { min-height: var(--row); }
  .account .button { min-height: var(--row); }
}

/* ================================================================ layout: page */
main.page { flex: 1; width: 100%; max-width: 1360px; margin-inline: auto; padding: var(--space-6) var(--space-8) var(--space-12); }
.page-foot { padding: var(--space-4) var(--space-8); color: var(--text-3); font-size: var(--type-caption); border-block-start: 1px solid var(--border); }
@media (max-width: 720px) { main.page { padding: var(--space-5) var(--space-4) var(--space-10); } .page-foot { padding-inline: var(--space-4); } }

/* page header: title, one line of context, then the actions, all on the start side */
.page-head { display: grid; justify-items: start; gap: var(--space-3); margin-block-end: var(--space-6); }
.page-head > div:first-child { display: grid; gap: var(--space-1); }
.page-head p { color: var(--text-2); }
.page-head .cluster, .page-head .button-row { justify-content: flex-start; }

/* the record: a ruled section on the paper; meta in a narrow column at the start edge */
.record { display: grid; grid-template-columns: var(--meta-width) minmax(0, 1fr); border-block-start: 1px solid var(--ink); }
.record + .record, .record-grid + .record, .record + .record-grid { margin-block-start: var(--space-8); }
.record__margin { padding: var(--space-4) 0 var(--space-4) var(--space-5); border-inline-end: 1px solid var(--border); font-size: var(--type-small); color: var(--text-2); display: flex; flex-direction: column; gap: var(--space-3); }
.record__margin dl { display: flex; flex-direction: column; gap: var(--space-3); }
.record__margin dt { font-size: var(--type-caption); color: var(--text-2); }
.record__margin dd { color: var(--text); font-weight: var(--weight-bold); }
.record__margin .push { margin-block-start: auto; }
.record__body { padding: var(--space-4) var(--space-5) var(--space-5); min-width: 0; }
.record__body:first-child { padding-inline-start: 0; }
.record__foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-3) 0; border-block-start: 1px solid var(--border); background: var(--bg); }
.record--sticky-foot .record__foot { position: sticky; inset-block-end: 0; z-index: 5; }
@media (max-width: 1199px) {
  .record { grid-template-columns: minmax(0, 1fr); }
  .record__margin { border-inline-end: 0; border-block-end: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: var(--space-3) 0; }
  .record__margin dl { flex-direction: row; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
  .record__margin dt { display: inline; margin-inline-end: var(--space-1); }
  .record__margin dd { display: inline; }
  .record__margin .push { margin-block-start: 0; }
  .record__body { padding-inline: 0; }
}
.record-grid { display: grid; gap: var(--space-8); }
.record-grid--2 { grid-template-columns: 3fr 2fr; }
@media (max-width: 1000px) { .record-grid--2 { grid-template-columns: 1fr; } }

/* the stamp: the box a code is stamped in, staff surfaces only, never a parent surface */
.stamp { display: inline-block; border: 1.5px solid var(--stamp-ink); border-radius: var(--radius); padding: 0 var(--space-2); font-family: var(--font-code); font-weight: var(--weight-bold); font-size: var(--type-small); letter-spacing: 0.02em; direction: ltr; unicode-bidi: isolate; color: var(--stamp-ink); line-height: 1.7; }
.stamp--thread { border-color: var(--stamp-ink); }

/* ================================================================ components: buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--button-height); padding-inline: var(--space-5);
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--on-ink); font-weight: var(--weight-bold);
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) var(--ease-out), border-color var(--t-hover) var(--ease-out), color var(--t-hover) var(--ease-out);
}
.button:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.button:active { transform: scale(0.98); }
.button--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button--secondary:hover { background: var(--surface-2); border-color: var(--ink); }
.button--quiet { background: transparent; border-color: transparent; color: var(--text); font-weight: var(--weight-regular); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 5px; }
.button--quiet:hover { background: transparent; border-color: transparent; text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
.button--danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.button--danger:hover { background: var(--surface-2); border-color: var(--danger); }
.button--small { min-height: 36px; padding-inline: var(--space-3); font-size: var(--type-small); }
/* A finger is not a pointer: on touch screens and phones the small button is a full 44 px target
   (PRODUCT.md, accessibility; the 36 px step is a desktop density; prompt 06b). */
@media (pointer: coarse), (max-width: 640px) { .button--small { min-height: var(--row); } }
.button--wide { width: 100%; }
.button[disabled], .button[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; transform: none; }
.button.is-loading { position: relative; color: transparent; pointer-events: none; }
.button.is-loading::after { content: ""; position: absolute; inset-block-start: 50%; inset-inline-start: 50%; width: 18px; height: 18px; margin: -9px; border: 2px solid var(--on-ink); border-inline-end-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
.button--secondary.is-loading::after, .button--quiet.is-loading::after, .button--danger.is-loading::after { border-color: var(--ink); border-inline-end-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }

/* ================================================================ components: forms */
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-block-end: var(--space-4); }
.field > label, .field__label { font-weight: var(--weight-bold); font-size: var(--type-small); }
.field__help { color: var(--text-2); font-size: var(--type-caption); }
.field__error { display: flex; gap: var(--space-1); align-items: baseline; color: var(--danger); font-size: var(--type-small); font-weight: var(--weight-bold); }
.input, .select, .textarea {
  width: 100%; min-height: var(--input-height); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); line-height: var(--leading-small);
  transition: border-color var(--t-hover) var(--ease-out), box-shadow var(--t-hover) var(--ease-out);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--focus-halo); outline: 0; }
.field--invalid .input, .field--invalid .select, .field--invalid .textarea, .input[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input[disabled], .select[disabled], .textarea[disabled] { opacity: 0.5; cursor: not-allowed; }
.textarea { min-height: calc(var(--row) * 2); resize: vertical; }
.select { appearance: none; padding-inline-end: var(--space-8); background-image: var(--select-chevron); background-repeat: no-repeat; background-position: left var(--space-3) center; }
.input--ltr, .input.code { direction: ltr; text-align: left; }
.input.code { font-family: var(--font-code); }
.search { position: relative; }
.search .input { padding-inline-start: 40px; }
.search .icon { position: absolute; inset-inline-start: var(--space-3); inset-block-start: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--row); cursor: pointer; }
.check input { appearance: none; flex: none; width: 22px; height: 22px; border: 1.5px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; transition: background-color var(--t-press) var(--ease-out), border-color var(--t-press) var(--ease-out); }
.check input:hover { border-color: var(--ink); }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
/* the tick is a drawn symbol, not text: physical sides, so RTL does not mirror it */
.check input[type="checkbox"]:checked::after { content: ""; width: 11px; height: 6px; border: 2px solid var(--on-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--on-ink); }
.check input:disabled { opacity: 0.45; cursor: not-allowed; }
.jalali { position: relative; }
/* the input reads left to right inside a right-to-left page: its own start edge is the left */
.jalali .input { padding-inline-start: 40px; direction: ltr; text-align: left; }
.jalali .icon { position: absolute; inset-inline-end: var(--space-3); inset-block-start: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-block: var(--space-3); border-block: 1px solid var(--border); margin-block-end: var(--space-5); }
.filter-row .field { margin: 0; }
.filter-row .search { min-width: min(100%, 18rem); }
.filter-row .select { width: auto; min-width: 10rem; }

/* the station keypad: 56 px keys */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); direction: ltr; width: 280px; }
.keypad button { min-height: var(--row-station); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-family: var(--font-figures); font-size: var(--type-heading); font-weight: var(--weight-bold); color: var(--text); transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) var(--ease-out); }
.keypad button:hover { background: var(--surface-2); border-color: var(--ink); }
.keypad button:active { transform: scale(0.97); background: var(--sun-wash); }
.keypad button.keypad__ghost { background: transparent; border-color: transparent; color: var(--text-2); font-family: var(--font-text); font-size: var(--type-body); font-weight: var(--weight-regular); }
.pin { display: flex; gap: var(--space-3); direction: ltr; }
.pin span { width: 44px; height: 52px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); display: grid; place-items: center; }
.pin span.is-filled::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); }

/* ================================================================ components: tabs */
.tabs { display: flex; gap: var(--space-6); border-block-end: 1px solid var(--border); margin-block-end: var(--space-5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__tab, .tabs > a, .tabs > button { position: relative; display: inline-flex; align-items: center; min-height: var(--row); color: var(--text-2); font-weight: var(--weight-bold); text-decoration: none; white-space: nowrap; transition: color var(--t-hover) var(--ease-out); }
.tabs__tab:hover, .tabs > a:hover { color: var(--text); }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--text); }
.tabs [aria-current="page"]::after, .tabs [aria-selected="true"]::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: -1px; height: 3px; background: var(--sun); }

/* ================================================================ components: data */
.table { width: 100%; }
.table th, .table td { padding: var(--space-2) var(--space-3); border-block-end: 1px solid var(--border); text-align: right; vertical-align: middle; transition: border-color var(--t-hover) var(--ease-out); }
.table th:first-child, .table td:first-child { padding-inline-start: 0; }
.table thead th, .table th[scope="col"] { font-size: var(--type-small); font-weight: var(--weight-bold); color: var(--text-2); border-block-end-color: var(--ink); white-space: nowrap; background: var(--surface); }
.table th[scope="row"] { font-weight: var(--weight-bold); color: var(--text); }
.table th[aria-sort] { cursor: pointer; }
.table th[aria-sort]::after { content: ""; display: inline-block; width: 0; height: 0; margin-inline-start: 6px; border: 4px solid transparent; border-block-start-color: currentColor; vertical-align: 2px; opacity: 0.6; }
.table th[aria-sort="ascending"]::after { transform: rotate(180deg); vertical-align: -1px; }
/* numbers read left to right and line up by place value: units under units */
.table td.num, .table th.num { text-align: right; direction: ltr; font-family: var(--font-figures); }
/* the pen line: the row under the pointer is underlined in ink */
.table tbody tr:hover > * { border-block-end-color: var(--ink); }
.table tbody tr.is-current > *, .table tbody tr[aria-current] > * { background: var(--sun-wash); }
.table tfoot td, .table tfoot th, .table tr.is-total > * { font-weight: var(--weight-bold); }
.table:has(> tfoot) > tbody > tr:last-child > *, .table tr:has(+ tr.is-total) > * { border-block-end-color: var(--ink); }
.table--ruled tbody tr { height: var(--row); }
.table--sticky thead th { position: sticky; inset-block-start: 0; z-index: 2; }
.table__toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-block-end: var(--space-3); }
.table-scroll { position: relative; overflow-x: auto; }
.table-scroll .table td { white-space: nowrap; }

/* ruled station rows */
.ruled { background-image: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) - 1px), var(--border) calc(var(--row) - 1px) var(--row)); }
.ruled__row { display: grid; align-items: center; min-height: var(--row); gap: var(--space-3); }
.ruled__row--head { color: var(--text-2); font-size: var(--type-small); font-weight: var(--weight-bold); }

/* status: a word in its ink on a 2 px rule, never colour alone, never a pill */
.status { display: inline-block; padding-block-end: 0; border-block-end: var(--rule-mark) solid currentColor; font-size: var(--type-small); font-weight: var(--weight-bold); line-height: 1.35; white-space: nowrap; color: var(--text-2); }
.status--ok { color: var(--ok); }
.status--warn { color: var(--warn); }
.status--danger { color: var(--danger); }
.status--neutral { color: var(--text-3); border-block-end-color: transparent; }
.status--thread, .status--current { color: var(--text); border-block-end-color: var(--sun); }

/* the counter: an ink numeral in a sun dot */
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding-inline: 6px; border-radius: var(--radius-dot); background: var(--sun); color: var(--on-sun); font-family: var(--font-figures); font-size: var(--type-caption); font-weight: var(--weight-bold); line-height: 1; unicode-bidi: isolate; }
/* the one figure the page is about: ink numerals over a sun stroke */
.key-figure { display: inline-block; font-family: var(--font-text); font-size: var(--type-display); font-weight: var(--weight-bold); line-height: 1.15; padding-inline: 2px; background: linear-gradient(to top, var(--sun) 0 0.22em, transparent 0.22em) no-repeat; unicode-bidi: isolate; }

/* choice buttons for attendance-like marking */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.choices button { min-height: var(--row); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-weight: var(--weight-bold); transition: transform var(--t-press) var(--ease-out), background-color var(--t-press) var(--ease-out), border-color var(--t-press) var(--ease-out); }
.choices button:hover { border-color: var(--ink); }
.choices button:active { transform: scale(0.97); }
.choices button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.choices button[aria-pressed="true"].is-ok { background: var(--ok); border-color: var(--ok); color: var(--on-ink); }
.choices button[aria-pressed="true"].is-warn { background: var(--warn); border-color: var(--warn); color: var(--on-ink); }
.choices button[aria-pressed="true"].is-danger { background: var(--danger); border-color: var(--danger); color: var(--on-ink); }

/* draft: anything an AI wrote, until a named person approves it */
.draft { border: 1px dashed var(--warn); border-radius: var(--radius); padding: var(--space-3) var(--space-4); background: transparent; }
.draft__label { display: flex; align-items: center; gap: var(--space-2); color: var(--warn); font-weight: var(--weight-bold); font-size: var(--type-small); margin-block-end: var(--space-2); }
.draft__meta { color: var(--text-2); font-size: var(--type-caption); margin-block-start: var(--space-2); }

/* the phone's action bar: the one primary action stays under the thumb */
.actionbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-3); border-block-start: 1px solid var(--border); }
.actionbar__note { color: var(--text-2); font-size: var(--type-small); }
@media (max-width: 640px) {
  .actionbar { position: sticky; inset-block-end: 0; z-index: 15; background: var(--bg); margin-inline: calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom)); }
  .actionbar .button { flex: 1; }
}

/* ================================================================ components: feedback */
.notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-block-start: 2px solid var(--text-2); border-radius: 0; background: var(--surface); margin-block-end: var(--space-4); }
.notice .icon { flex: none; margin-block-start: 3px; }
.notice--info { border-block-start-color: var(--ink); }
.notice--ok { border-block-start-color: var(--ok); }
.notice--warn { border-block-start-color: var(--warn); }
.notice--error { border-block-start-color: var(--danger); }
.notice--ok .icon { color: var(--ok); } .notice--warn .icon { color: var(--warn); } .notice--error .icon { color: var(--danger); } .notice--info .icon { color: var(--ink); }
.toasts { position: fixed; inset-block-end: var(--space-5); inset-inline-start: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); z-index: 70; width: min(var(--toast-width), calc(100vw - 2 * var(--space-5))); }
.toast { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--ink); border-radius: var(--radius); transition: opacity var(--t-exit) var(--ease-out), translate var(--t-enter) var(--ease-out); }
@starting-style { .toast { opacity: 0; translate: 0 8px; } }
.toast.is-leaving { opacity: 0; translate: 0 8px; }
.toast .icon { flex: none; margin-block-start: 3px; }
.toast--ok .icon, .toast--success .icon { color: var(--ok); } .toast--error .icon { color: var(--danger); } .toast--info .icon { color: var(--ink); }
.toast__close { margin-inline-start: auto; margin-block: calc(-1 * var(--space-2)); color: var(--text-2); width: var(--row); height: var(--row); display: grid; place-items: center; border-radius: var(--radius); }
.toast__close:hover { background: var(--surface-2); color: var(--text); }

/* empty: the mark, small, and one sentence */
.empty { display: grid; justify-items: center; gap: var(--space-2); text-align: center; padding: var(--space-10) var(--space-5); color: var(--text-2); }
.empty .icon { width: 28px; height: 28px; color: var(--text-3); }
.empty__mark { width: 84px; height: calc(84px * 621 / 760); color: var(--text-2); margin-block-end: var(--space-2); }
.empty h3 { color: var(--text); }
.empty p { max-width: 46ch; }
.empty .button { margin-block-start: var(--space-3); }

/* confirmation without a browser dialog: the action reveals its confirm inline */
.confirm { display: inline-flex; align-items: center; gap: var(--space-2); }
.confirm__ask { display: none; align-items: center; gap: var(--space-2); }
.confirm.is-open .confirm__trigger { display: none; }
.confirm.is-open .confirm__ask { display: inline-flex; }
.confirm__ask span { font-size: var(--type-small); color: var(--text-2); }

/* skeleton: shapes of the final layout, breathing */
.skeleton { display: block; background: var(--surface-2); border-radius: var(--radius); animation: breathe 1600ms var(--ease-in-out) infinite; }
.skeleton--text { height: 1em; margin-block: 0.45em; }
.skeleton--row { height: var(--row); }
@keyframes breathe { 50% { opacity: 0.55; } }

/* ================================================================ components: icons, misc */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--small { width: 16px; height: 16px; }
.icon--mirror { transform: scaleX(-1); }
.history { display: flex; gap: 5px; align-items: flex-end; height: 22px; width: 110px; direction: ltr; }
.history i { flex: 1; background: var(--border-strong); }
.history i.is-now { background: var(--ink); }
.meter { display: inline-block; vertical-align: middle; width: 110px; height: 6px; background: var(--surface-2); overflow: hidden; direction: ltr; }
.meter i { display: block; height: 100%; background: var(--ink); }
.messages { display: flex; flex-direction: column; gap: var(--space-3); }
.message { max-width: 88%; padding: var(--space-2) var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); line-height: 1.75; }
.message--house { align-self: flex-start; }
.message--family { align-self: flex-end; background: var(--surface-2); }
.message__meta { display: block; font-size: var(--type-caption); color: var(--text-2); margin-block-start: var(--space-1); }
.day-mark { align-self: center; font-size: var(--type-caption); color: var(--text-2); padding-block-end: 2px; border-block-end: 1.5px solid var(--text); }

/* chart anatomy (tokens: --chart-*): legend under the title, ink and sun marks, faint grid */
.chart { display: grid; gap: var(--space-2); }
.chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--type-small); color: var(--chart-label); }
.chart__key { display: inline-flex; align-items: center; gap: var(--space-2); }
.chart__key::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: var(--chart-1); }
.chart__key--sun::before { background: var(--chart-2); box-shadow: inset 0 0 0 1px var(--chart-edge); }
.chart svg { overflow: visible; }

/* /status/: the modules still to be built (they no longer sit in the contents) */
.later { margin-block-start: var(--space-10); padding-block-start: var(--space-4); border-block-start: 1px solid var(--ink); }
.later__list { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); margin-block-start: var(--space-3); }

/* ================================================================ utilities */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-block-start: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.grow { flex: 1; }
.push-end { margin-inline-start: auto; }
.center { text-align: center; }
.table .align-end, .align-end { text-align: end; }
@media (max-width: 640px) { .hide-on-phone { display: none !important; } }
@media (min-width: 641px) { .only-phone { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
@media (hover: none) { .table tbody tr:hover > * { border-block-end-color: var(--border); } }

/* ================================================================ print: ink on white, no chrome */
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --text-2: #333; --text-3: #555; --ink: #000; --border: #bbb; --border-strong: #777; --sun: #fac515; }
  .band, .shell, .scrim, .toasts, .page-foot, .actionbar, .skip, .no-print, .theme-switch, .confirm, .button { display: none !important; }
  body { display: block; }
  main.page { max-width: none; padding: 0; }
  a { text-decoration: none; }
  .record, tr, .notice { break-inside: avoid; }
  thead { display: table-header-group; }
  @page { margin: 16mm 14mm; }
}
