/* Mosaic Work. Graphite on porcelain; colour is kept for signals only:
   teal = going (applied, active, live), ochre = held (waiting for a person), brick = stopped
   (blocked, rejected, lapsed). Everything else is ink, rules and space. */

:root {
  --paper: #f4f5f2;
  --surface: #ffffff;
  --sunk: #eaece7;
  --ink: #1d2320;
  --muted: #59605b;
  --rule: #d5d9d2;
  --rule-strong: #b9beb6;
  --go: #0e6a5e;
  --go-soft: #dcece7;
  --hold: #84570a;
  --hold-mark: #c98f1c;
  --hold-soft: #f7ecd5;
  --stop: #a23b26;
  --stop-soft: #f6e1db;
  --focus: #0e6a5e;
  --btn-ink: #ffffff;
  --shadow: 0 1px 0 rgba(29, 35, 32, 0.06);
  --radius: 6px;
  --gutter: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131614;
    --surface: #1a1e1c;
    --sunk: #171a18;
    --ink: #e2e6e3;
    --muted: #9ba49e;
    --rule: #2b312e;
    --rule-strong: #3d4440;
    --go: #5fc3b0;
    --go-soft: #16332d;
    --hold: #e6b45a;
    --hold-mark: #e6b45a;
    --hold-soft: #352a14;
    --stop: #ef8a73;
    --stop-soft: #3a1e17;
    --focus: #5fc3b0;
    --btn-ink: #0f1311;
    --shadow: none;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

a { color: var(--go); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: 0.95rem; margin-top: 1.25rem; }
p { margin: 0; }
code, .ref { font-family: var(--mono); font-size: 0.86em; }
pre { margin: 0; }
kbd {
  font-family: var(--mono); font-size: 0.8em; padding: 0 0.35em; border: 1px solid var(--rule-strong);
  border-bottom-width: 2px; border-radius: 4px; background: var(--surface);
}

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.skip {
  position: absolute; left: var(--gutter); top: -3rem; z-index: 10; padding: 0.5rem 0.75rem;
  background: var(--ink); color: var(--paper); border-radius: var(--radius);
}
.skip:focus { top: 0.5rem; }

.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.n { color: var(--muted); font-weight: 500; font-size: 0.85em; margin-left: 0.25rem; }

/* ---- the header ---- */

.top { background: var(--surface); border-bottom: 1px solid var(--rule); }
.top-inner {
  display: flex; align-items: center; gap: 1.25rem; padding: 0 var(--gutter); min-height: 3.25rem;
  max-width: 120rem; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink);
  text-decoration: none; white-space: nowrap; letter-spacing: -0.01em;
}
.mark {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none;
  background:
    linear-gradient(var(--go), var(--go)) 0 0 / 6px 6px no-repeat,
    linear-gradient(var(--hold-mark), var(--hold-mark)) 8px 8px / 6px 6px no-repeat,
    linear-gradient(var(--rule-strong), var(--rule-strong)) 8px 0 / 6px 6px no-repeat,
    linear-gradient(var(--rule-strong), var(--rule-strong)) 0 8px / 6px 6px no-repeat;
}
.nav { position: relative; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.nav a {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.85rem 0.6rem 0.75rem;
  color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 550;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.count {
  display: inline-block; min-width: 1.35rem; padding: 0 0.35rem; border-radius: 999px; text-align: center;
  background: var(--hold-soft); color: var(--hold); font-size: 0.8rem; font-weight: 700; line-height: 1.35rem;
}
.me { display: flex; align-items: center; gap: 0.75rem; white-space: nowrap; }
.me form { margin: 0; }
.me-name { color: var(--muted); }
.live { font-size: 0.8rem; color: var(--go); display: inline-flex; align-items: center; gap: 0.35rem; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.live.off { color: var(--muted); }

/* ---- the page ---- */

main { display: block; padding: 1.5rem var(--gutter) 4rem; max-width: 120rem; margin: 0 auto; }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.75rem 2rem;
  margin-bottom: 1.25rem;
}
.page-head > div { min-width: 0; max-width: 48rem; }
.sub { color: var(--muted); margin-top: 0.3rem; }
.qkey { color: var(--muted); font-weight: 500; font-size: 0.7em; margin-left: 0.2rem; }
.subnav { display: flex; gap: 0.25rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: 2px; background: var(--surface); }
.subnav a { padding: 0.3rem 0.7rem; border-radius: 4px; color: var(--muted); text-decoration: none; font-weight: 550; font-size: 0.9rem; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { background: var(--sunk); color: var(--ink); }

.notice {
  margin: 0 0 1.25rem; padding: 0.6rem 0.85rem; border-left: 3px solid var(--go); background: var(--go-soft);
  border-radius: 0 var(--radius) var(--radius) 0; max-width: 48rem;
}
.msg { padding: 0.55rem 0.8rem; border-radius: var(--radius); background: var(--sunk); max-width: 48rem; }
.msg.warn { background: var(--hold-soft); color: var(--ink); border-left: 3px solid var(--hold-mark); }
.msg.error { background: var(--stop-soft); color: var(--ink); border-left: 3px solid var(--stop); }
.empty { color: var(--muted); }
.empty-state { max-width: 36rem; padding: 2rem 0; color: var(--muted); }

section + section { margin-top: 2rem; }
section > h2 { margin-bottom: 0.75rem; }

/* ---- the board ---- */

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); gap: 0.75rem; align-items: start; }
.lane { background: var(--sunk); border-radius: var(--radius); padding: 0.65rem 0.5rem 0.5rem; min-width: 0; }
.lane + .lane { margin-top: 0; }
.lane h2 { font-size: 0.9rem; padding: 0 0.35rem 0.55rem; margin: 0; display: flex; align-items: baseline; }
.lane-done .card, .lane-cancelled .card { background: transparent; box-shadow: none; }
.lane-done .card-title, .lane-cancelled .card-title { color: var(--muted); }
.lane .empty { padding: 0.25rem 0.35rem 0.5rem; font-size: 0.88rem; }
.more { font-size: 0.82rem; color: var(--muted); padding: 0.4rem 0.35rem 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.card {
  position: relative; background: var(--surface); border-radius: 4px; padding: 0.55rem 0.65rem 0.6rem;
  box-shadow: var(--shadow); border: 1px solid var(--rule); border-left-width: 3px; border-left-color: var(--rule);
}
.card.held-active { border-left-color: var(--go); }
.card.held-waiting { border-left-color: var(--hold-mark); }
.card.held-lapsed { border-left-color: var(--stop); }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--muted); }
.key { font-weight: 650; color: var(--ink); letter-spacing: 0.01em; white-space: nowrap; }
.card .key { color: var(--muted); }
.card-title { display: block; margin-top: 0.2rem; color: var(--ink); text-decoration: none; font-weight: 500; line-height: 1.35; }
a.card-title:hover { text-decoration: underline; }
a.card-title::after { content: ""; position: absolute; inset: 0; }
.card a.card-title:focus-visible { outline: none; }
.card:has(a.card-title:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

.prio { font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.prio.p0 { color: var(--stop); }
.prio.p1 { color: var(--hold); }
.flag {
  display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0 0.4rem; border-radius: 3px;
  background: var(--sunk); color: var(--muted); line-height: 1.35rem; white-space: nowrap;
}
.flag.blocked, .flag.wrong { background: var(--stop-soft); color: var(--stop); }
.flag.hold { background: var(--hold-soft); color: var(--hold); }
.labels { list-style: none; margin: 0.4rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.labels li, .facts .label {
  font-size: 0.75rem; padding: 0 0.4rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--muted);
  line-height: 1.3rem;
}

/* A claim: how fresh it is, where it runs, and the lease left as a thin bar. */
.claim { position: relative; margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px dashed var(--rule); font-size: 0.82rem; z-index: 1; pointer-events: none; }
.claim .fresh { font-weight: 600; color: var(--go); }
.held-waiting .fresh { color: var(--hold); }
.held-lapsed .fresh { color: var(--stop); }
.claim .where { color: var(--muted); margin-top: 0.1rem; }
.nowrap { white-space: nowrap; }
.branch { font-family: var(--mono); font-size: 0.92em; margin-left: 0.35rem; color: var(--ink); }
.claim .branch { display: block; margin-left: 0; overflow-wrap: anywhere; }
.lease { display: block; height: 3px; margin-top: 0.45rem; border-radius: 2px; background: var(--rule); position: relative; overflow: hidden; }
.lease::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: var(--go); border-radius: 2px; }
.held-waiting .lease::after { background: var(--hold-mark); }
.lease-1::after { width: 10%; } .lease-2::after { width: 20%; } .lease-3::after { width: 30%; }
.lease-4::after { width: 40%; } .lease-5::after { width: 50%; } .lease-6::after { width: 60%; }
.lease-7::after { width: 70%; } .lease-8::after { width: 80%; } .lease-9::after { width: 90%; }
.lease-10::after { width: 100%; }

/* ---- a ticket ---- */

.ticket-head { max-width: 60rem; margin-bottom: 1.5rem; }
.crumbs { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.35rem; }
.ticket-head h1 { font-size: 1.55rem; }
.ticket-head h1 .key { color: var(--muted); font-weight: 600; margin-right: 0.25rem; }
.facts { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; font-size: 0.88rem; }
.pill {
  display: inline-block; padding: 0 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  line-height: 1.45rem; background: var(--sunk); color: var(--ink); white-space: nowrap;
}
.pill.cat-in_progress, .pill.status-applied, .pill.status-approved { background: var(--go-soft); color: var(--go); }
.pill.cat-ready { background: var(--surface); border: 1px solid var(--rule-strong); line-height: calc(1.45rem - 2px); }
.pill.cat-cancelled, .pill.status-rejected, .pill.status-stale, .pill.status-expired { background: var(--stop-soft); color: var(--stop); }
.pill.status-held, .pill.status-open { background: var(--hold-soft); color: var(--hold); }

.ticket { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; align-items: start; max-width: 84rem; }
.ticket-main { min-width: 0; }
.ticket-side { min-width: 0; position: sticky; top: 1rem; }
.ticket-side section + section { margin-top: 1.5rem; }
.ticket-side h2 { font-size: 0.9rem; }

pre.text, pre.json {
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: inherit; line-height: 1.55;
  max-width: 46rem;
}
pre.json {
  font-family: var(--mono); font-size: 0.82rem; background: var(--sunk); padding: 0.6rem 0.75rem;
  border-radius: var(--radius); max-height: 22rem; overflow-y: auto;
}

.decisions, .comments, .history { list-style: none; margin: 0; padding: 0; }
.decision { padding: 0.75rem 0; border-top: 1px solid var(--rule); max-width: 46rem; }
.decision:first-child { border-top: 0; padding-top: 0; }
.decision-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; }
.decision-head time { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.conf { font-size: 0.85rem; color: var(--muted); }
.reason { margin-top: 0.35rem; }
.note { margin-top: 0.35rem; color: var(--muted); }
details { margin-top: 0.4rem; }
summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; }
.aside-link { margin-top: 0.75rem; font-size: 0.9rem; }
form.inline { display: inline; margin: 0; }
.decision form.inline { display: block; margin-top: 0.35rem; }

.comment { padding: 0.75rem 0.9rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); max-width: 46rem; }
.comment + .comment { margin-top: 0.5rem; }
.comment.by-system { background: transparent; border-style: dashed; }
.comment-head { font-size: 0.88rem; margin-bottom: 0.3rem; }
.comment-head time { color: var(--muted); margin-left: 0.4rem; }

.history { max-width: 46rem; }
.history li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 0.75rem; padding: 0.3rem 0; border-top: 1px solid var(--rule); font-size: 0.9rem; }
.history li:first-child { border-top: 0; }
.history time { color: var(--muted); grid-row: span 2; }
.history .who { font-weight: 600; }
.history + p { margin-top: 0.5rem; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.2rem 0.9rem; margin: 0.5rem 0 0; font-size: 0.88rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; }
.claim.side { border: 1px solid var(--rule); border-left: 3px solid var(--go); background: var(--surface); padding: 0.65rem 0.75rem; border-radius: var(--radius); margin: 0; pointer-events: auto; }
.claim.side.held-waiting { border-left-color: var(--hold-mark); }
.claim.side.held-lapsed { border-left-color: var(--stop); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 0.2rem 0; }
.ext li { display: flex; flex-wrap: wrap; gap: 0.15rem 0.5rem; }
.ext .ref { width: 100%; color: var(--ink); }

/* ---- approvals ---- */

.keys-hint { font-size: 0.85rem; color: var(--muted); max-width: 30rem; }
.approvals-page { max-width: 56rem; }
.inbox { list-style: none; margin: 0; padding: 0; }
.inbox > li + li { margin-top: 0.85rem; }
.item {
  background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--hold-mark);
  border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem;
}
.item.is-escalation { border-left-color: var(--stop); }
.item:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.item-head h2 { font-size: 1.05rem; font-weight: 600; min-width: 0; }
.item-head .kind { display: block; font-size: 0.82rem; font-weight: 600; color: var(--hold); margin-bottom: 0.15rem; }
.is-escalation .item-head .kind { color: var(--stop); }
.item-head .key { margin-right: 0.15rem; }
.conf-block { text-align: right; flex: none; line-height: 1.1; }
.conf-value { display: block; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; }
.conf-label { font-size: 0.75rem; color: var(--muted); }
.reason { margin: 0.6rem 0 0; padding: 0; }
blockquote.reason p { font-size: 1rem; }
blockquote.reason p::before { content: "\201C"; color: var(--muted); }
blockquote.reason p::after { content: "\201D"; color: var(--muted); }
.item .msg, .item pre.json { margin-top: 0.75rem; }
.item pre.json { max-width: none; }
.facts-row { grid-template-columns: max-content minmax(0, 1fr) max-content minmax(0, 1fr); margin-top: 0.85rem; }
.soon { color: var(--stop); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--rule); }
.actions form { margin: 0; }
.note-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; flex: 1 1 18rem; }
.note-form label { width: 100%; font-size: 0.85rem; color: var(--muted); }
.note-form input { flex: 1 1 12rem; }

/* ---- forms ---- */

input, select, button, textarea { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]), select {
  width: 100%; max-width: 28rem; padding: 0.45rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--surface); min-height: 2.4rem;
}
input.num:not([type=checkbox]) { max-width: 7rem; }
input[aria-invalid="true"] { border-color: var(--stop); }
input[type=checkbox], input[type=radio] { accent-color: var(--go); width: 1rem; height: 1rem; margin: 0; flex: none; }
label { font-weight: 550; }
.field { display: grid; gap: 0.3rem; align-content: start; }
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.help { color: var(--muted); font-size: 0.85rem; font-weight: 400; max-width: 38rem; }
.field-error { color: var(--stop); font-size: 0.85rem; font-weight: 600; }
.stack { display: grid; gap: 1rem; }
.stack fieldset, fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 0.45rem; }
legend { font-weight: 600; padding: 0; margin-bottom: 0.35rem; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

button {
  cursor: pointer; padding: 0.45rem 0.95rem; border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--surface); font-weight: 600; min-height: 2.4rem;
}
button:hover { border-color: var(--ink); }
button.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
button.primary:hover { background: var(--go); border-color: var(--go); color: var(--btn-ink); }
button.danger { color: var(--stop); }
button.danger:hover { border-color: var(--stop); }
button.quiet { background: transparent; border-color: transparent; padding: 0.3rem 0.5rem; min-height: 0; color: var(--muted); font-weight: 550; }
button.quiet:hover { color: var(--ink); border-color: var(--rule-strong); }
button.danger.quiet { color: var(--stop); }
button:disabled { opacity: 0.55; cursor: default; }
fieldset:disabled button { opacity: 0.55; }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.2rem 1.3rem; }
.narrow { max-width: 40rem; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 1.25rem; align-items: start; max-width: 76rem; }
.settings section + section { margin-top: 0; }
.states { list-style: none; padding: 0; margin: 0.5rem 0 0; display: grid; gap: 0.3rem; font-size: 0.9rem; }
.new-kind { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.new-kind + div { margin-top: 1rem; }

/* ---- tables ---- */

.table-wrap { overflow-x: auto; max-width: 100%; position: relative; }
table.grid { border-collapse: collapse; width: 100%; font-size: 0.9rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.grid th, .grid td { overflow-wrap: break-word; word-break: normal; text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); }
.grid thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; background: var(--sunk); }
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid tbody th { font-weight: 600; }
.grid tr.revoked { color: var(--muted); }
.grid tr.revoked th { font-weight: 400; text-decoration: line-through; }
.grid tr.has-error input { border-color: var(--stop); }
.thresholds th, .thresholds td { vertical-align: middle; }
.thresholds td:last-child, .thresholds th:last-child { width: 8rem; }
.thresholds { margin-top: 0.75rem; }
.calibration .band { text-align: right; white-space: nowrap; }
.calibration .cell { text-align: right; min-width: 7rem; }
.calibration .rate { display: block; font-weight: 650; font-size: 1rem; }
.calibration .of { display: block; font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.calibration .of.rej { color: var(--stop); }
.calibration .th-cell { white-space: nowrap; }
.role-form { display: flex; gap: 0.4rem; align-items: center; }
.role-form select { width: auto; min-height: 2rem; padding: 0.2rem 0.4rem; }
.table-wrap + p { margin-top: 0.6rem; }
.table-wrap + form, .empty + form { margin-top: 1.25rem; }
.grid td form.inline { display: inline-block; }

/* ---- a token shown once ---- */

.reveal { border: 1px solid var(--go); background: var(--go-soft); border-radius: var(--radius); padding: 1rem 1.1rem; max-width: 46rem; margin-bottom: 2rem; display: grid; gap: 0.6rem; }
.reveal input.token { font-family: var(--mono); font-size: 0.9rem; max-width: 100%; }

/* ---- sign-in and errors ---- */

.signin { max-width: 26rem; margin: 10vh auto 0; display: grid; gap: 1rem; }
.brand-line { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.lede { color: var(--muted); }
.error-page { max-width: 34rem; margin: 8vh auto 0; display: grid; gap: 0.75rem; }
.error-page .status { color: var(--muted); font-weight: 600; }

/* ---- narrow screens ---- */

@media (max-width: 1000px) {
  .ticket { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .ticket-side { position: static; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .top-inner { flex-wrap: wrap; gap: 0 0.75rem; padding-top: 0.5rem; }
  .brand { order: 1; }
  .me { order: 2; margin-left: auto; gap: 0.4rem; }
  .me-name { display: none; }
  .nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 calc(var(--gutter) - 0.6rem); }
  main { padding-top: 1.1rem; }
  h1 { font-size: 1.35rem; }
  .ticket-head h1 { font-size: 1.3rem; }
  .facts-row { grid-template-columns: max-content minmax(0, 1fr); }
  .item { padding: 0.85rem 0.85rem 1rem; }
  .history li { grid-template-columns: minmax(0, 1fr); }
  .history time { grid-row: auto; }
  .keys-hint { display: none; }
  .table-wrap table.grid { min-width: 34rem; }
  .lane-in_progress { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
