/* Keys: an architectural sheet. White paper, graphite ink, hairlines, one blueprint blue and one terracotta. */
:root {
  --ink: #15191c; --graphite: #3a4247; --muted: #6b747b; --faint: #9aa3a9; --line: #e4e7ea; --hair: #eef0f2;
  --paper: #ffffff; --wash: #f7f8f9; --blue: #1f5fbf; --blue-wash: #eaf1fb; --terra: #c4553b; --terra-wash: #fbefeb;
  --sand: #d9cfb6; --concrete: #a9b5be; --occupied: #cbd3da; --paid: #8196a8; --ok: #3d7a5c; --ask: #a87a1f; --ask-wash: #fbf4e4;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; --mono: "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); }
body { margin: 0; font: 13px/1.5 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 26px; font-weight: 300; letter-spacing: -.01em; margin: 0 0 6px; }
h2 { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); margin: 26px 0 10px; }
h3 { font-size: 12px; font-weight: 600; margin: 14px 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 11.5px; }

/* ── frame ── */
.top { display: flex; align-items: center; gap: 28px; height: 52px; padding: 0 24px; border-bottom: 1px solid var(--ink); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 2px; }
.mark i { width: 7px; height: 7px; background: var(--concrete); } .mark i:nth-child(2) { background: var(--blue); }
.mark i:nth-child(3) { background: var(--ink); }
nav { display: flex; gap: 2px; }
nav a { color: var(--muted); padding: 6px 10px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border-bottom: 2px solid transparent; }
nav a:hover { color: var(--ink); text-decoration: none; }
nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
nav b { margin-left: 6px; background: var(--ask); color: #fff; padding: 0 5px; font-size: 10px; letter-spacing: 0; }
.org { margin-left: auto; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
main { padding: 22px 24px 48px; }
footer { display: flex; justify-content: space-between; padding: 10px 24px 14px; color: var(--faint); font-size: 11px; border-top: 1px solid var(--line); }

/* ── shared pieces ── */
.head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.head p { margin: 0; max-width: 860px; }
.sheetno { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); text-align: right; line-height: 1.7; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); margin: 0 0 18px; }
.figures div { padding: 10px 14px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figures b { display: block; font-size: 26px; font-weight: 300; line-height: 1.1; }
.figures span { color: var(--muted); font-size: 11px; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.grid thead th { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
.grid tbody tr:hover { background: var(--wash); }
.num { text-align: right !important; }
.pill { display: inline-block; padding: 0 7px; font-size: 11px; border: 1px solid var(--line); color: var(--graphite); }
.pill.auto_done, .pill.approved { color: var(--ok); border-color: #cfe3d8; }
.pill.escalated { color: var(--ask); border-color: #ecdcb6; background: var(--ask-wash); }
.pill.rejected, .pill.failed, .pill.rolled_back { color: var(--terra); border-color: #f0cfc6; }
.pill.declined { color: var(--muted); }
.tier { font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.card { border: 1px solid var(--line); border-top: 2px solid var(--ink); padding: 12px 16px; margin: 12px 0; background: var(--paper); }
.card h2 { margin-top: 0; }
pre { background: var(--wash); border: 1px solid var(--hair); padding: 10px 12px; overflow: auto; font: 11.5px/1.5 var(--mono); max-height: 460px; }
input, select, button { font: inherit; }
input, select { border: 1px solid var(--line); padding: 5px 8px; background: var(--paper); }
button { border: 1px solid var(--ink); background: var(--paper); color: var(--ink); padding: 5px 12px; cursor: pointer; letter-spacing: .04em; }
button:hover { background: var(--ink); color: var(--paper); }
.filters { display: flex; gap: 8px; align-items: center; }
.inline { display: inline-flex; gap: 6px; margin-right: 14px; }
.notice { border-left: 2px solid var(--blue); background: var(--blue-wash); padding: 6px 12px; }
.two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; }

/* ── the building stack ── */
.screen-stack main { padding-top: 14px; }
.sheet-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 28px; align-items: center; padding: 8px 0 12px; position: sticky; top: 0; z-index: 6; background: #fff; border-bottom: 1px solid var(--ink); }
.clock { display: flex; align-items: center; gap: 12px; }
.clock-time { font-size: 40px; font-weight: 200; letter-spacing: -.02em; line-height: 1; min-width: 108px; }
.clock-day { font-size: 12px; color: var(--graphite); line-height: 1.35; } .clock-day small { color: var(--muted); font-size: 11px; }
.transport { display: flex; align-items: center; gap: 12px; }
.play { min-width: 74px; background: var(--ink); color: var(--paper); }
.play.on { background: var(--paper); color: var(--ink); }
.speeds { display: flex; } .speeds button { border-color: var(--line); color: var(--muted); padding: 5px 8px; font-size: 11px; }
.speeds button + button { border-left: 0; } .speeds button.on { color: var(--ink); border-color: var(--ink); }
.speeds button.on + button { border-left: 1px solid var(--line); }
.speeds button:hover { background: var(--wash); color: var(--ink); }
.scrub { width: 300px; } .scrub input { width: 100%; accent-color: var(--ink); margin: 0; }
.ticks { display: flex; justify-content: space-between; font-size: 9px; color: var(--faint); }
.tally { display: flex; justify-content: flex-end; gap: 0; margin: 0; }
.tally div { padding: 0 14px; border-left: 1px solid var(--line); }
.op-tally { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.op-tally div { padding: 5px 0 6px; } .op-tally div + div { border-left: 1px solid var(--line); padding-left: 10px; }
.op-tally dt { font-size: 10px; color: var(--muted); line-height: 1.2; } .op-tally dd { margin: 0; font-size: 20px; font-weight: 300; }
.tally dt { font-size: 10px; color: var(--muted); letter-spacing: .04em; white-space: nowrap; }
.tally dd { margin: 0; font-size: 22px; font-weight: 300; line-height: 1.15; }
.flash { animation: flash 900ms ease-out; }
@keyframes flash { from { color: var(--blue); } to { color: inherit; } }

.sheet-body { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 22px; margin-top: 14px; }
.elevation { position: relative; }
.elevation canvas { display: block; }
.tip { position: absolute; z-index: 5; background: var(--ink); color: #fff; padding: 6px 9px; font-size: 11px; line-height: 1.45; pointer-events: none; max-width: 240px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 7px 0 0; font-size: 11px; color: var(--graphite); }
.sw { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; }
.sw.occupied { background: var(--occupied); } .sw.paid { background: var(--paid); } .sw.vacant { background: #fff; outline: 2px solid #e4e8eb; outline-offset: -2px; box-shadow: 0 0 0 1px #e4e8eb; }
.sw.notlet { background: var(--sand); } .sw.arrears { background: var(--terra); } .sw.ticket { background: var(--blue); }
.sw.touched { background: #fff; outline: 1px solid var(--ink); }
.titleblock { margin-left: auto; color: var(--faint); font-size: 10px; letter-spacing: .03em; }
.titleblock a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }

.board { margin-top: 14px; border-top: 1px solid var(--ink); }
.board-head { display: flex; align-items: baseline; gap: 14px; } .board-head h2 { margin: 10px 0 8px; }
.board-head .muted { font-size: 11px; }
.lanes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border-left: 1px solid var(--line); }
.lane { border-right: 1px solid var(--line); padding: 0 8px 6px; min-height: 196px; }
.lane h3 { display: flex; justify-content: space-between; margin: 0 0 6px; padding: 4px 0; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--graphite); border-bottom: 1px solid var(--hair); }
.lane h3 b { font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink); }
.lane-closed .card, .lane-merged .card { opacity: .78; }
.lanes .card { margin: 0 0 5px; padding: 5px 7px 6px; border: 1px solid var(--line); border-left: 2px solid var(--concrete); display: flex; flex-direction: column; font-size: 11px; line-height: 1.35; }
.lanes .card.p-emergency { border-left-color: var(--terra); } .lanes .card.p-urgent { border-left-color: var(--ask); }
.lanes .card.late .c-due { color: var(--terra); }
.lanes .card.op { border-color: var(--ink); border-left: 2px solid var(--ink); }
.lanes .card.moved { animation: slide 700ms ease-out; }
@keyframes slide { from { transform: translateX(-14px); background: var(--blue-wash); } to { transform: none; background: var(--paper); } }
.c-top { display: flex; gap: 4px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.c-top b { font-weight: 600; flex-shrink: 0; } .c-cat { min-width: 0; overflow: hidden; text-overflow: ellipsis; } .prio { flex-shrink: 0; padding-left: 4px; margin-left: auto; font-style: normal; color: var(--faint); font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; }
.c-where { color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-due { color: var(--muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stamp { margin-top: 3px; font-size: 10px; } .stamp a { color: var(--ink); background: var(--wash); padding: 0 4px; }
.more { margin: 2px 0 0; font-size: 10.5px; color: var(--muted); }

.receipts { border-left: 1px solid var(--ink); padding-left: 16px; display: flex; flex-direction: column; min-height: 0; }
.receipts-head { display: flex; justify-content: space-between; align-items: baseline; } .receipts-head h2 { margin: 0 0 8px; }
.receipts-head .muted { font-size: 11px; }
.receipts ol { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: calc(100vh - 250px); }
.receipt a { display: grid; grid-template-columns: 38px minmax(0, 1fr); column-gap: 8px; padding: 7px 0 8px; border-bottom: 1px dashed var(--line); color: var(--ink); }
.receipt a:hover { background: var(--wash); text-decoration: none; }
.r-time { grid-row: span 4; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.r-title { font-weight: 600; font-size: 12px; } .r-where { color: var(--graphite); font-size: 11.5px; }
.r-call { font-family: var(--mono); font-size: 10.5px; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-word { font-size: 10.5px; color: var(--muted); }
.receipt.s-auto_done .r-word, .receipt.s-approved .r-word { color: var(--ok); }
.receipt.s-escalated .r-word { color: var(--ask); } .receipt.s-rejected .r-word, .receipt.s-rolled_back .r-word { color: var(--terra); }
.receipt.new a { animation: land 1400ms ease-out; }
@keyframes land { from { background: var(--blue-wash); transform: translateY(-6px); } to { background: transparent; transform: none; } }
.receipts .empty { color: var(--muted); padding: 10px 0; font-size: 12px; }
.history { font-size: 11px; margin-top: 10px; }

/* ── ledger ── */
.ledger-rows td.when { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.ledger-rows td.call { font-family: var(--mono); font-size: 11px; color: var(--blue); }
.ledger-rows tr.status-escalated td:first-child { box-shadow: inset 2px 0 var(--ask); }
.ledger-rows tr.status-rolled_back td:first-child, .ledger-rows tr.status-rejected td:first-child { box-shadow: inset 2px 0 var(--terra); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; border-top: 1px solid var(--ink); padding-top: 12px; }
.facts dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding-top: 1px; }
.facts dd { margin: 0; }
.undo-box { border: 1px solid var(--line); padding: 12px 14px; align-self: start; }
.undo-box form { display: flex; flex-direction: column; gap: 8px; }

/* ── queue ── */
.q-item { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; border-top: 1px solid var(--ink); padding: 14px 0; }
.q-item h3 { font-size: 15px; font-weight: 400; margin: 0 0 4px; }
.q-item form { display: flex; gap: 6px; margin-bottom: 6px; } .q-item form input { flex: 1; }

/* ── accuracy ── */
.bar { position: relative; height: 8px; background: var(--hair); min-width: 120px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--graphite); }
.bar.recall i { background: var(--blue); }
.weakest { border: 1px solid var(--terra); border-left-width: 3px; padding: 10px 14px; background: var(--terra-wash); margin: 0 0 18px; }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 12px; }
.day h3 { margin: 0 0 8px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite); }
.day .stack { display: flex; align-items: flex-end; gap: 6px; height: 70px; border-bottom: 1px solid var(--graphite); margin-bottom: 6px; }
.day .stack span { flex: 1; background: var(--concrete); position: relative; }
.day .stack span.r { background: var(--blue); } .day .stack span.a { background: var(--graphite); }
.day dl { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: 11px; gap: 1px 6px; }
.day dt { color: var(--muted); } .day dd { margin: 0; text-align: right; }
.day.busy { background: var(--wash); }
.key { display: flex; gap: 16px; font-size: 11px; color: var(--muted); margin: 6px 0 0; }

/* ── definitions, ask, docs ── */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.term { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 12px 14px 14px; }
.term h3 { font-size: 15px; font-weight: 400; margin: 0 0 2px; } .term p { margin: 4px 0; font-size: 12px; color: var(--graphite); }
.term .tag { display: inline-block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 0 5px; margin-right: 4px; }
.term .tag.two { color: var(--terra); border-color: #f0cfc6; }
.meanings { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.answer-figure { font-size: 44px; font-weight: 200; line-height: 1; margin: 6px 0; }
.ask-form { display: flex; gap: 8px; margin: 12px 0 8px; } .ask-form input { width: 520px; font-size: 15px; padding: 8px 10px; }
.examples a { display: inline-block; border: 1px solid var(--line); padding: 2px 8px; margin: 0 6px 6px 0; font-size: 12px; color: var(--graphite); }
.examples a:hover { border-color: var(--ink); text-decoration: none; }
.doc { max-width: 820px; font-size: 14px; line-height: 1.65; }
.doc h2:first-child { font-size: 30px; font-weight: 300; letter-spacing: -.01em; text-transform: none; color: var(--ink); margin: 0 0 14px; padding: 0; border: 0; }
.doc h3 { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--graphite); margin: 34px 0 10px; padding-top: 10px; border-top: 1px solid var(--ink); }
.doc h4 { font-size: 14px; margin: 22px 0 6px; } .doc code { font: 12px var(--mono); background: var(--wash); padding: 0 3px; }
.doc pre code { background: none; padding: 0; }
.doc table { border-collapse: collapse; width: 100%; font-size: 13px; } .doc th, .doc td { border-bottom: 1px solid var(--hair); padding: 5px 8px; text-align: left; vertical-align: top; }
.doc th { border-bottom: 1px solid var(--ink); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc-nav { display: flex; gap: 14px; font-size: 12px; margin-bottom: 18px; }
