/* C3Marley dashboard: operate mode, one long ledger page. */
body.app { background: var(--parchment); color: var(--ink); }
.bar { background: var(--charcoal); color: var(--ink-on-dark); padding-top: env(safe-area-inset-top, 0px); border-bottom: 4px double var(--red-bright, #e06a5e); }
.bar__in { display: flex; align-items: center; gap: var(--s-5); padding: var(--s-3) var(--gutter); flex-wrap: wrap; }
.bar .mark span { font-size: 1.25rem; }
.bar__ctx { margin: 0; font: 400 var(--t-xs)/1.3 var(--f-mono); color: var(--ink-on-dark-soft); }
.bar__ctx span[aria-hidden] { color: var(--gold); padding-inline: 0.3em; }
.bar nav { margin-left: auto; }
.bar nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 var(--s-4); margin: 0; padding: 0; font-size: var(--t-sm); }
.bar nav a { color: var(--ink-on-dark-soft); text-decoration: none; display: inline-block; padding-block: 0.5rem; }
.bar nav a:hover { color: var(--parchment); text-decoration: underline; }
.bar :focus-visible { outline-color: var(--gold); }
@media (max-width: 46rem) { .bar__ctx { order: 3; width: 100%; } .bar nav { margin-left: 0; } }

.app__main { --margin-x: clamp(1.1rem, 3.2vw, 3rem); padding: var(--s-6) var(--gutter) var(--s-8) calc(var(--margin-x) + clamp(1rem, 2.5vw, 2.5rem)); min-height: 70vh; }
.app__head h1 { font: 400 var(--t-2xl)/1.05 var(--f-display); margin: 0 0 var(--s-2); letter-spacing: -0.01em; }
.app__head p { margin: 0 0 var(--s-4); max-width: 62ch; }
.app__end { margin-top: var(--s-7); display: grid; gap: var(--s-2); }
.key { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--s-3) var(--s-6); margin: var(--s-3) 0 0; }
.key div { border-top: 1px solid var(--rule-ink); padding-top: var(--s-2); }
.key dt { font: 700 var(--t-xs)/1.3 var(--f-mono); }
.key dd { margin: 0.25rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }
.reasons { margin: 0 0 var(--s-3); padding-left: 1.1rem; font-size: var(--t-xs); color: var(--ink); }
.reasons li { margin-bottom: 0.2rem; }
.soft { color: var(--ink-soft); }
.measure { max-width: 70ch; }

/* status chips: the totals as filters */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 46rem) { .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } .chip { flex: none; } }
.chip { font: 700 var(--t-xs)/1 var(--f-mono); padding: 0.55rem 0.7rem; min-height: 2.4rem; border: 1px solid var(--rule-ink); border-radius: 2px; background: transparent; color: var(--ink); cursor: pointer; display: inline-flex; gap: 0.5rem; align-items: center; }
.chip .num { font-weight: 400; color: var(--ink-soft); }
.chip--red { color: var(--red); border-color: color-mix(in oklab, var(--red) 45%, transparent); }
.chip--teal { color: var(--teal-deep); border-color: color-mix(in oklab, var(--teal) 55%, transparent); }
.chip:hover { background: var(--parchment-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--parchment); border-color: var(--ink); }
.chip[aria-pressed="true"] .num { color: var(--parchment-2); }

.totals-d { margin-top: var(--s-4); }
.totals-d summary { cursor: pointer; font: italic 400 var(--t-lg)/1.2 var(--f-display); padding-block: 0.4rem; width: max-content; max-width: 100%; }
.totals-d summary:hover { text-decoration: underline; }
.table-scroll { overflow-x: auto; position: relative; }
.st { min-width: 40rem; margin-top: var(--s-2); }
.st tbody th { font: 700 var(--t-xs)/1.3 var(--f-mono); }
.st tr.scored th, .st tr.scored .pts { color: var(--red); }
.st tr.exempt th, .st tr.exempt .pts { color: var(--teal-deep); }
.st .pts { color: var(--ink-soft); }

.tabs { display: flex; margin: var(--s-6) 0 0; border-bottom: 3px double var(--ink); }
.tabs [role="tab"] { font: 600 var(--t-sm)/1 var(--f-text); padding: 0.85rem 1.15rem; min-height: 2.9rem; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -3px; }
.tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs [role="tab"]:hover { color: var(--ink); }
.panel { padding-top: var(--s-5); }

.filters { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-4); align-items: end; }
.filters .field { flex: 0 1 12rem; }
.filters .grow { flex: 1 1 22rem; }
.select { font-family: var(--f-text); font-size: var(--t-sm); appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) 55%, calc(100% - 0.8rem) 55%; background-size: 0.35rem 0.35rem; background-repeat: no-repeat; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 3rem; font: 600 var(--t-sm)/1.2 var(--f-text); cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; accent-color: var(--red); }
.clear { min-height: 3rem; }
.count { font: 400 var(--t-xs)/1.4 var(--f-mono); color: var(--ink-soft); margin: var(--s-4) 0 var(--s-2); }

/* the register: one line per parcel, margin to margin */
.results-wrap { min-height: 60vh; border-top: 3px double var(--ink); }
.res { min-width: 64rem; table-layout: fixed; }
.res col { width: auto; }
.res th:nth-child(1) { width: 4.5rem; } .res th:nth-child(2) { width: 30%; }
.res th:nth-child(4) { width: 11rem; } .res th:nth-child(5) { width: 4.5rem; } .res th:nth-child(6) { width: 9.5rem; } .res th:nth-child(7) { width: 9.5rem; }
.res .blank { color: var(--ink-soft); font-style: italic; }
.res thead th { position: sticky; top: 0; background: var(--parchment); z-index: 1; }
.res th, .res td { padding-top: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res tbody tr { cursor: pointer; }
.res tbody tr:hover { background: color-mix(in oklab, var(--parchment-2) 70%, transparent); }
.res tbody tr.is-selected { background: var(--parchment-2); }
.res .own button { background: none; border: 0; padding: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 var(--t-sm)/1.35 var(--f-text); color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-ink); text-underline-offset: 0.2em; }
.res .own button:hover { text-decoration-color: var(--ink); }
.res .addr { color: var(--ink-soft); font: 400 var(--t-xs)/1.4 var(--f-mono); }
.res .sc { font: 700 var(--t-sm)/1 var(--f-mono); }
.res .b-high { color: var(--red); font-weight: 700; }
.res .b-partial { color: var(--red); }
.res .bd { font: 400 var(--t-xs)/1 var(--f-mono); }
.res .stt { font: 400 var(--t-xs)/1.3 var(--f-mono); }
.res .stt.scored { color: var(--red); font-weight: 700; }
.res .stt.exempt { color: var(--teal-deep); font-weight: 700; }
.res .chk { font: 700 var(--t-xs)/1 var(--f-mono); color: var(--red); }
.more { text-align: center; margin: 0; padding: var(--s-4); }

/* parcel slip: slides over the right edge, the register stays put */
.pd .chain small .mono { font-size: 1em; }
.pd {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(31rem, 100vw); overflow: auto;
  background: var(--parchment); border-left: 1px solid var(--ink); padding: calc(var(--s-6) + env(safe-area-inset-top, 0px)) var(--s-5) calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  box-shadow: -2px 0 0 0 var(--parchment), -3px 0 0 0 var(--rule-red);
  color: var(--ink);
}
.pd .drawer__close { top: 0.75rem; right: 0.75rem; }
.pd__title { font: italic 400 var(--t-xl)/1.1 var(--f-display); margin: 0 2.6rem var(--s-2) 0; }
.pd__addr { font-size: var(--t-xs); color: var(--ink-soft); margin: 0 0 var(--s-2); }
.pd .label { margin-top: var(--s-5); }
.pd .chain .link { max-width: 100%; }
.app__foot { border-top: 1px solid var(--rule-ink); padding: var(--s-5) var(--gutter) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)); font-size: var(--t-xs); color: var(--ink-soft); background: var(--parchment); }
.app__foot p { max-width: 65ch; margin: 0; }
@media (max-width: 46rem) {
  .app__main { --margin-x: 0.7rem; padding-left: calc(var(--margin-x) + 1rem); }
  .filters .field { flex: 1 1 45%; }
  /* phone: score, owner, check, assessed. The slip has the rest. */
  .res { min-width: 0; table-layout: auto; }
  .res th:nth-child(3), .res td:nth-child(3), .res th:nth-child(4), .res td:nth-child(4), .res th:nth-child(7), .res td:nth-child(7) { display: none; }
  .res .own button { white-space: normal; overflow-wrap: anywhere; }
  .res td.num { font-size: var(--t-xs); }
  .res th, .res td { white-space: normal; }
  .res td.num { white-space: nowrap; }
}

/* =====================================================================
   Round 4: the dashboard head is the ledger's running head, not chrome
   ===================================================================== */
.bar { background: var(--parchment); color: var(--ink); border-bottom: 1px solid var(--rule-red); box-shadow: 0 3px 0 -2px var(--parchment), 0 4px 0 -2px var(--rule-red); }
.bar .mark { color: var(--ink); }
.bar__ctx { color: var(--ink-soft); }
.bar__ctx span[aria-hidden] { color: var(--ink-soft); }
.bar nav a { color: var(--ink-soft); }
.bar nav a:hover { color: var(--ink); }
.bar :focus-visible { outline-color: var(--ink); }
.app__main { padding-top: var(--s-5); }
.app__headrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-6); }
.app__head h1 { font-size: var(--t-xl); margin: 0; }
.app__head p { margin: 0 0 var(--s-3); font-size: var(--t-sm); }
/* status index: plain entries, like the index tabs of a ledger. No boxes. */
.chips { gap: 0; border-top: 1px solid var(--rule-ink); border-bottom: 1px solid var(--rule-ink); }
.chip { border: 0; border-radius: 0; min-height: 2.5rem; padding: 0.4rem 0.75rem; background: transparent; position: relative; }
.chip + .chip { box-shadow: inset 1px 0 0 0 var(--rule); }
.chip[aria-pressed="true"] { background: transparent; color: inherit; border: 0; }
.chip[aria-pressed="true"]::after { content: ""; position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.3rem; height: 2px; background: currentColor; }
.chip[aria-pressed="true"] .num { color: inherit; }
.chip:hover { background: var(--parchment-2); }
.tabs { margin-top: var(--s-4); }
.panel { padding-top: var(--s-3); }
.filters .field label { font-size: var(--t-xs); }
.filters .input { min-height: 2.6rem; padding-block: 0.45rem; }
.check, .clear { min-height: 2.6rem; }
@media (max-width: 46rem) {
  .chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .res .own button { overflow-wrap: break-word; word-break: normal; }
}
/* dashboard fonts: never swap after first paint (cached on the next visit) */
@font-face { font-family: "IM Fell English"; src: url(/fonts/im-fell-english-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: optional; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: optional; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: optional; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: optional; }
@font-face { font-family: "JetBrains Mono"; src: url(/fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: optional; }

.key-d { margin-top: var(--s-2); }
.key-d summary { font-size: var(--t-base); }
.empty .copy { margin-left: 0.25rem; }

/* round 4 craft: one baseline per register entry */
.res th, .res td { vertical-align: baseline; }
.sig th, .sig td { vertical-align: baseline; }
.chip { padding-inline: 0.6rem; }
@media (max-width: 46rem) { .res td.num { overflow: visible; text-overflow: clip; } .bar__in { gap: var(--s-2) var(--s-4); } }

/* round 5 */
.res .unc { font: 400 var(--t-xs)/1 var(--f-mono); color: var(--ink-soft); }
.res .chk-m { display: none; font: 700 var(--t-xs)/1 var(--f-mono); color: var(--red); text-decoration: none; }
.own-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-ink); text-underline-offset: 0.2em; }
.own-link:hover { text-decoration-color: var(--ink); }
.chip { padding-inline: 0.5rem; font-size: 0.78rem; }
@media (max-width: 46rem) {
  .bar__ctx { display: none; }
  .app__head p { font-size: var(--t-sm); margin-bottom: var(--s-2); }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .res th:nth-child(5), .res td:nth-child(5) { display: none; }
  .res .chk-m { display: inline; }
  .res th:nth-child(2) { width: auto; }
  .key-d { margin-top: 0; }
}

/* round 6 */
.res th:nth-child(5) { width: 7.5rem; }
.res .unc-m { color: var(--ink-soft); font-weight: 400; }
.owner-filter { margin: var(--s-3) 0 0; font-size: var(--t-sm); display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.note-line { display: block; }
@media (max-width: 46rem) {
  .filters .grow { flex-basis: 100%; }
  .res td, .res th { vertical-align: top; }
  .res th:nth-child(1) { width: 3rem; }
}

.key dt .soft { font-weight: 400; font-family: var(--f-mono); font-size: 0.92em; }
@media (max-width: 46rem) { .filters .input { font-size: 0.9rem; } }

.res th:nth-child(2), .res td:nth-child(2) { padding-left: 0.75rem; }

.res .sc { font-weight: 400; }
.res .sc.b-high { font-weight: 700; }
/* LCP text paints in the system face, so first paint never waits on a web font */
.app__head p { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
