/* Ostra web apps: shared tokens and components. DESIGN.md "The Proof Sheet":
   graphite ground, two surface steps, two line steps, one signal colour, three
   status lamps; Inter for words, JetBrains Mono for every machine value. The
   light scheme is the doc tokens, mapped role for role. */

@font-face { font-family: 'Inter'; src: url('fonts/InterVariable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('fonts/JetBrainsMono-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  --bg: #0C0E11;
  --surface: #13161B;
  --surface-2: #1A1E24;
  --line: #242930;
  --line-2: #313741;
  --text: #E9EDF1;
  --text-2: #B3BBC5;
  --muted: #828C97;
  --idle: #4A525D;
  --signal: #3BD9F2;
  --signal-text: #3BD9F2;
  --signal-dim: rgba(59, 217, 242, .14);
  --code-bg: #3BD9F2;
  --code-ink: #062A31;
  --live: #3FCF8E;
  --warn: #F2B544;
  --down: #F2555A;
  --live-text: #3FCF8E;
  --warn-text: #F2B544;
  --down-text: #FF8A8E;
  --warn-dim: rgba(242, 181, 68, .09);
  --down-dim: rgba(242, 85, 90, .10);
  --down-line: #6B2A2E;
  --sector: rgba(233, 237, 241, .28);
  --scrim: rgba(5, 6, 8, .66);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--signal);
  --lift: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  --sheet-shadow: 0 24px 64px -24px rgba(0, 0, 0, .9);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --gutter: 16px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F3F5F7;
    --surface: #FFFFFF;
    --surface-2: #EEF1F4;
    --line: #DDE1E5;
    --line-2: #C9CFD6;
    --text: #0F1216;
    --text-2: #39414B;
    --muted: #5D6670;
    --idle: #A7AFB8;
    --signal: #0A8EA6;
    --signal-text: #08758A;
    --signal-dim: rgba(10, 142, 166, .12);
    --code-bg: rgba(10, 142, 166, .14);
    --code-ink: #065E6E;
    --live: #1FA86A;
    --warn: #D9941A;
    --down: #D9363C;
    --live-text: #12764A;
    --warn-text: #8A5A06;
    --down-text: #B4232A;
    --warn-dim: rgba(217, 148, 26, .09);
    --down-dim: rgba(217, 54, 60, .07);
    --down-line: #E7A9AC;
    --sector: rgba(12, 14, 17, .28);
    --scrim: rgba(15, 18, 22, .36);
    --lift: 0 1px 2px rgba(15, 18, 22, .05), 0 12px 32px -20px rgba(15, 18, 22, .25);
    --sheet-shadow: 0 24px 64px -28px rgba(15, 18, 22, .45);
    color-scheme: light;
  }
}

@media (min-width: 720px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: var(--line-2) var(--bg);
  background: var(--bg);
  scroll-padding-top: 72px;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--signal-dim); color: var(--text); }
input, textarea { caret-color: var(--signal); }
a { color: var(--signal-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
/* A heading focused after navigation is announced, not ringed. */
[tabindex='-1']:focus, [tabindex='-1']:focus-visible { outline: none; box-shadow: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2 { font-variation-settings: 'opsz' 32; text-wrap: balance; }
p { text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
.mono, code, pre, time.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.n { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; letter-spacing: -0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.none { color: var(--muted); }
.sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.fine { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.lede { font-size: 16px; line-height: 1.55; color: var(--text-2); max-width: 62ch; }

.skip { position: absolute; left: 8px; top: -100px; z-index: 50; padding: 8px 12px; border-radius: 7px; background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; }
.skip:focus-visible { top: calc(8px + env(safe-area-inset-top)); }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-note { color: var(--muted); font-size: 14px; }

/* ---------- The mark and wordmark (never recoloured) ---------- */
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 20px; letter-spacing: -0.045em; line-height: 1; font-variation-settings: 'opsz' 32; color: var(--text); text-decoration: none; padding: 4px 2px; border-radius: 6px; }
.wordmark .mark { width: 1.2em; height: 1.2em; flex: none; }
.sector { stroke: var(--sector); }
.lit { stroke: #3BD9F2; }
.hub { fill: currentColor; }

/* ---------- Icons ---------- */
.icon { width: 16px; height: 16px; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 7px 14px; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font: 500 13.5px/1.2 var(--sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 120ms var(--ease), opacity 160ms var(--ease);
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.btn .icon { width: 15px; height: 15px; }
.btn-primary { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-danger { background: transparent; border-color: var(--down-line); color: var(--down-text); }
.btn-danger-text { color: var(--down-text); }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-wide { width: 100%; min-height: 44px; }
@media (hover: hover) {
  .btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
  .btn-primary:hover { background: var(--text-2); border-color: var(--text-2); }
  .btn-quiet:hover { border-color: transparent; color: var(--text); }
  .btn-danger:hover { background: var(--down-dim); border-color: var(--down); }
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn[aria-disabled='true'] { cursor: not-allowed; opacity: .45; }
.btn[aria-busy='true'] { opacity: .8; cursor: progress; }
.btn.done { color: var(--live-text); }
.icon-only { padding: 7px; min-width: 36px; }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.row-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions { margin-top: 6px; }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-row { display: grid; gap: 18px 16px; align-items: end; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } .field-row.three { grid-template-columns: 1.4fr .8fr .8fr; } }
label, legend { font-size: 14px; font-weight: 500; color: var(--text); }
.opt { font-weight: 400; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; line-height: 1.5; }
input[type='text'], input[type='email'], input[type='url'], input[type='tel'], input[type='password'], input[type='date'], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text);
  font: 400 16px/1.4 var(--sans);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}
.mono-input { font-family: var(--mono) !important; font-size: 15px !important; letter-spacing: -0.01em; }
textarea { min-height: 104px; resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; cursor: pointer; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-dim); border-radius: 7px; }
[aria-invalid='true'] { border-color: var(--down) !important; }
.field-error { color: var(--down-text); font-size: 13.5px; font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
.choice-set { display: grid; gap: 8px; }
.choice { display: grid; gap: 8px; }
@media (min-width: 640px) { .choice.cols-2 { grid-template-columns: 1fr 1fr; } }
.choice label, .tick {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
  font-weight: 400; font-size: 14px; line-height: 1.45; color: var(--text-2); cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease), color 160ms var(--ease);
}
.choice label b, .tick b { color: var(--text); font-weight: 600; display: block; margin-bottom: 1px; }
.tick b { display: inline; }
.choice input, .tick input {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--line-2); background: var(--surface); display: grid; place-items: center; cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.choice input { border-radius: 50%; }
.tick input { border-radius: 4px; }
.choice input::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text); transform: scale(0); transition: transform 160ms var(--ease); }
.tick input::before { content: ''; width: 9px; height: 5px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform 160ms var(--ease); }
.choice input:checked, .tick input:checked { border-color: var(--text); }
.tick input:checked { background: var(--text); }
.choice input:checked::before { transform: scale(1); }
.tick input:checked::before { transform: rotate(-45deg) scale(1); }
.choice input:focus-visible, .tick input:focus-visible { box-shadow: none; }
.choice label:has(input:checked), .tick:has(input:checked) { border-color: var(--text-2); background: var(--surface-2); color: var(--text); }
.choice label:has(input:focus-visible), .tick:has(input:focus-visible) { box-shadow: var(--ring); }
@media (hover: hover) { .choice label:hover, .tick:hover { border-color: var(--line-2); } }

/* ---------- Status: lamps and words (status colours only for status) ---------- */
.lamp { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--idle); }
.lamp[data-lamp='live'] { background: var(--live); }
.lamp[data-lamp='warn'] { background: var(--warn); }
.lamp[data-lamp='down'] { background: var(--down); }
.lamp[data-lamp='muted'] { background: var(--muted); }
.lamp[data-lamp='idle'] { background: transparent; box-shadow: inset 0 0 0 1.5px var(--idle); }
.lamp[data-lamp='sim'] { background: transparent; border: 1.5px dashed var(--muted); }
.status-word { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--text-2); white-space: nowrap; }
.status-word[data-lamp='live'] { color: var(--live-text); }
.status-word[data-lamp='warn'] { color: var(--warn-text); }
.status-word[data-lamp='down'] { color: var(--down-text); }
.status-word[data-lamp='muted'], .status-word[data-lamp='idle'], .status-word[data-lamp='sim'] { color: var(--text-2); }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font: 500 12px/1.4 var(--sans); white-space: nowrap; }
.chip.mono { font-family: var(--mono); font-weight: 400; font-size: 11.5px; }
.chip-num { color: var(--text); font-size: 12.5px; }
.chip-code { color: var(--text); }
.chip-sim { border-style: dashed; border-color: var(--line-2); background: transparent; }

/* ---------- Panels and facts ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel.lifted, .lifted { box-shadow: var(--lift); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 16px 20px 0; }
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.panel-aside { font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 14px 20px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; container-type: inline-size; }
.panel-body > p { color: var(--text-2); font-size: 14.5px; }
.panel-body > p.fine { font-size: 13.5px; color: var(--muted); }
.panel-foot { padding: 10px 20px 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
@media (min-width: 1100px) { .panel-head { padding: 18px 24px 0; } .panel-body { padding: 14px 24px 20px; } .panel-foot { padding: 10px 24px 12px; } }
.request { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.request .mono { font-size: 12px; }
.request b { font-weight: 500; color: var(--text-2); margin-right: 6px; }

.facts { margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; gap: 2px 16px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-size: 14px; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.facts dd.mono { font-size: 13.5px; }
@media (min-width: 560px) { .facts > div { grid-template-columns: 150px minmax(0, 1fr); } }

.owner-note { padding: 12px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 1.55; }
.note-from { font-size: 12.5px; color: var(--muted); font-weight: 500; margin-bottom: 3px; }

/* ---------- Copy fields and the secret shown once ---------- */
.copy-field { display: grid; gap: 4px; min-width: 0; }
.copy-label { font-size: 12.5px; color: var(--muted); }
.copy-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 4px 4px 12px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg); }
/* A value breaks after its own separators first (breakable() puts them in);
   a run with none, however long, still wraps inside the box and never under
   the Copy button beside it. */
.copy-value { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow-wrap: break-word; word-break: normal; hyphens: none; padding: 4px 0; }
.copy-value.long { overflow-wrap: anywhere; }
.btn-copy { min-height: 30px; padding: 4px 9px; font-size: 12.5px; flex: none; }
.secret-once { display: grid; gap: 12px; padding: 16px; border-radius: 10px; border: 1px solid var(--text-2); background: var(--surface-2); }
.secret-once:focus-visible { box-shadow: var(--ring); }
.secret-head { display: flex; align-items: center; gap: 8px; }
.secret-head h3 { font-size: 15px; font-weight: 600; }
.secret-once > p { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.secret-once strong { color: var(--text); }
.secret-once .copy-row { background: var(--bg); }
.secret-actions { display: flex; justify-content: flex-end; }

/* ---------- Feedback ---------- */
.notice { padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.notice[data-kind='ok'] { border-color: color-mix(in srgb, var(--live) 40%, var(--line)); }
.notice[data-kind='error'] { border-color: var(--down-line); background: var(--down-dim); }
.notice[data-kind='error'] strong { color: var(--down-text); }
.error-block { display: grid; gap: 12px; justify-items: start; padding: 16px; border: 1px solid var(--down-line); border-radius: 10px; background: var(--down-dim); }
.error-block strong { color: var(--down-text); }
.skeleton { display: grid; gap: 12px; padding: 8px 0; }
.skeleton span { display: block; height: 14px; border-radius: 4px; background: var(--surface-2); }
.skeleton .w60 { width: 60%; height: 22px; }
.skeleton .w80 { width: 80%; }
.skeleton .w100 { width: 100%; }
@media (prefers-reduced-motion: no-preference) { .skeleton span { animation: shimmer 1.4s var(--ease) infinite; } }
@keyframes shimmer { 50% { opacity: .55; } }
.empty-line { color: var(--muted); font-size: 14px; padding: 6px 0; }

/* The one authored motion: a value settling in from a slight blur. */
.settle { animation: settle 360ms var(--ease); }
@keyframes settle { from { opacity: .4; filter: blur(3px); transform: translateY(3px); } to { opacity: 1; filter: none; transform: none; } }

/* ---------- Pending values (as on the website) ---------- */
.pending { text-decoration: underline dashed var(--warn); text-decoration-thickness: 1.5px; text-underline-offset: 4px; text-decoration-skip-ink: none; overflow-wrap: anywhere; }
.pending::after { content: 'Pending ' attr(data-pending); display: inline-block; margin-left: 6px; padding: 1px 4px; border: 1px solid var(--warn); border-radius: 4px; font: 600 10.5px/1.3 var(--sans); letter-spacing: .01em; color: var(--warn-text); vertical-align: 2px; text-decoration: none; white-space: nowrap; }
.placeholder-block { padding: 14px 16px; border: 1px dashed var(--warn); border-radius: 10px; background: var(--warn-dim); color: var(--text-2); font-size: 14.5px; display: grid; gap: 4px; }
.placeholder-block strong { color: var(--text); }
.ph-tag { display: inline-block; margin: 0 6px 0 8px; padding: 1px 5px; border: 1px solid var(--warn); border-radius: 4px; font: 600 10.5px/1.3 var(--sans); color: var(--warn-text); letter-spacing: .01em; vertical-align: 1px; }

/* ---------- Tables: ruled; stacked rows on a phone ---------- */
.table-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.records { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.records th, .records td { text-align: left; vertical-align: top; padding: 10px 12px; border-top: 1px solid var(--line); line-height: 1.45; }
.records thead th { border-top: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.records tbody th { font-weight: 500; color: var(--text); }
.records td { color: var(--text-2); }
.records td.mono, .records th.mono { font-size: 12.5px; color: var(--text); }
.records td.num, .records th.num { text-align: right; }
.records tfoot th, .records tfoot td { border-top: 1px solid var(--line-2); font-weight: 600; color: var(--text); }
.records .act { text-align: right; white-space: nowrap; }
.records tr.is-revoked th, .records tr.is-revoked td { color: var(--muted); }
.records tr.is-revoked .key-name { text-decoration: line-through; text-decoration-color: var(--muted); }
.row-error { display: block; font-family: var(--sans); font-size: 12px; color: var(--down-text); }
.records .to { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .records thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .records, .records tbody, .records tfoot { display: block; }
  .records tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px; border-top: 1px solid var(--line); }
  .records tbody tr:first-child { border-top: 0; }
  .records th, .records td { display: block; padding: 0; border: 0; text-align: left !important; min-width: 0; overflow-wrap: anywhere; }
  .records td::before, .records tbody th::before { content: attr(data-k); display: block; font: 400 11.5px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; }
  .records tbody th[data-k='Name']::before, .records tbody th[data-k='Person']::before { content: none; }
  .records tbody th, .records td.to { grid-column: 1 / -1; }
  .records .act { grid-column: 1 / -1; text-align: left; }
  .records .act:empty { display: none; }
  .records tfoot tr { border-top: 1px solid var(--line-2); }
  .records tfoot th { grid-column: 1 / -1; }
  .records tfoot th, .records tfoot td { border: 0; }
  .records tfoot td:empty { display: none; }
}

/* ---------- Code highlight ---------- */
.code { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; color: var(--code-ink); background: var(--code-bg); padding: 1px 6px; border-radius: 4px; }

/* ---------- Dialog ---------- */
.dialog { overscroll-behavior: contain; width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--sheet-shadow); }
.dialog::backdrop { background: var(--scrim); }
.dialog-form { display: grid; gap: 14px; padding: 20px; }
.dialog-form h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.dialog-body { display: grid; gap: 8px; color: var(--text-2); font-size: 14.5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] { animation: rise 200ms var(--ease); }
  .dialog[open]::backdrop { animation: fade 200ms var(--ease); }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Page heads ---------- */
.page-head { display: grid; gap: 8px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.12; }
.page-head h1:focus { outline: none; }
@media (min-width: 720px) { .page-head h1 { font-size: 30px; letter-spacing: -0.04em; } }
.back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: 13.5px; color: var(--muted); text-decoration: none; padding: 2px 0; }
@media (hover: hover) { .back:hover { color: var(--text); } }
.back .icon { width: 14px; height: 14px; }

/* ---------- Mock mode strip (never on a deployed page) ---------- */
.mockbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 7px max(var(--gutter), env(safe-area-inset-right)) 7px max(var(--gutter), env(safe-area-inset-left)); border-bottom: 1px dashed var(--line-2); background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.mockbar strong { color: var(--text); }
.mock-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mock-controls label { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.mock-controls select { min-height: 30px; padding: 4px 30px 4px 8px; font-size: 13px; width: auto; max-width: 62vw; }
.mock-controls a { font-size: 12.5px; }
.mock-tag { font-size: 12px; color: var(--muted); font-weight: 500; }
@media (max-width: 719px) { .mock-say { display: none; } .mockbar { flex-wrap: nowrap; gap: 10px; } .mockbar > p { flex: none; } .mock-controls { flex-wrap: nowrap; min-width: 0; } .mock-controls label { display: none; } .mock-controls select { min-width: 0; flex: 1 1 auto; max-width: 160px; } }
@media (min-width: 960px) { .mockbar { position: sticky; top: 0; z-index: 40; } }

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