/* Glass Box phone app - tokens and components from design/DESIGN-SPEC.md and design/mockups/phone-*.html */
@font-face {
  font-family: "Noto Sans Thai";
  src: url("/static/fonts/NotoSansThai-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --phone-bg: #F2F6F7; --surface: #FFFFFF; --surface-2: #E8F0F2; --ink: #102A37; --muted: #49636E; --line: #78939C;
  --accent: #0B6F78; --accent-deep: #07525A; --ok: #157A59; --blocked: #B42318; --denied: #8A3B0B; --masked: #6938A5;
  --skipped: #52616A; --error: #9F1C31; --running: #0B6F78; --human: #A15C00; --focus: #005FCC;
  --ease: cubic-bezier(.22,1,.36,1);
  --font: "Noto Sans Thai", "Noto Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #DCE6E9; color: var(--ink); font: 17px/1.55 var(--font); }
button, input, textarea, select { font: inherit; color: inherit; }
.tabnum { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: 12px; top: -80px; background: #fff; color: var(--ink); padding: 10px 14px; z-index: 10; border-radius: 8px; }
.skip:focus { top: 10px; }

.phone { width: min(480px, 100%); min-height: 100vh; margin: 0 auto; background: var(--phone-bg); position: relative; display: flex; flex-direction: column; }
@media (min-width: 520px) { .phone { margin: 20px auto; min-height: calc(100vh - 40px); box-shadow: 0 12px 36px #102a3722; } }

/* header */
.top { min-height: 72px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fff; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.brand-icon { color: var(--accent); display: grid; }
.brand small { display: block; font-size: 14px; color: var(--muted); font-weight: 500; line-height: 1.3; }
.lang { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.lang button { min-width: 48px; min-height: 44px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--accent); color: #fff; }

main { padding: 26px 20px 32px; flex: 1; outline: none; }
.screen { animation: fade 180ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
h1 { font-size: 26px; line-height: 1.32; margin: 0 0 8px; text-wrap: balance; }
h1.display { font-size: 32px; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 20px; line-height: 1.4; margin: 0 0 8px; }
p { margin: 0; }
.muted { color: var(--muted); margin: 0 0 20px; }
.sub { color: var(--muted); margin: 0; }
.caption { font-size: 14px; line-height: 1.45; color: var(--muted); }
.progress { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.bar { height: 4px; background: #D5E1E4; border-radius: 2px; overflow: hidden; margin-bottom: 22px; }
.bar span { display: block; height: 100%; background: var(--accent); }
.bar .w33 { width: 33%; } .bar .w66 { width: 66%; }
[data-icon] { display: inline-grid; flex: 0 0 auto; }
[data-icon] svg { width: 22px; height: 22px; }

/* start */
.pane { position: relative; padding: 28px 22px; border: 1px solid #8EABB3; border-radius: 20px; background: #ffffffd9; box-shadow: inset 0 0 0 4px #E4EEF0; }
.glass-icon { width: 72px; height: 72px; border: 1px solid var(--line); border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, #fff, #DFEDEF); color: var(--accent); margin-bottom: 26px; }
.glass-icon svg { width: 40px; height: 40px; }
.rule { margin: 22px 0 26px; padding: 14px 16px; border-radius: 12px; background: #E5F3EE; color: #124F3D; font-weight: 650; display: flex; gap: 10px; align-items: flex-start; }
.rule-icon { margin-top: 2px; }
.facts { margin-top: 22px; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.fact { display: flex; gap: 10px; }
.fact [data-icon] { color: var(--accent); }
.fact [data-icon] svg { width: 20px; height: 20px; }

/* buttons */
.cta { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; font-size: 17px; cursor: pointer; transition: background 180ms var(--ease); }
.cta:hover { background: var(--accent-deep); }
.cta:active { background: var(--accent-deep); }
.cta:disabled { background: #8FA6AD; color: #fff; cursor: not-allowed; }
.btn { min-height: 50px; padding: 8px 14px; border-radius: 11px; border: 1px solid var(--accent); background: #fff; color: var(--accent); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; cursor: pointer; width: 100%; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); }
.btn.tertiary { border-color: transparent; color: var(--muted); background: transparent; }
.btn.secondary { border-color: var(--line); color: var(--muted); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: grid; gap: 9px; margin-top: 18px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* sticky bottom */
.bottom { position: sticky; bottom: 0; padding: 12px 20px calc(13px + env(safe-area-inset-bottom)); background: #F8FBFBEF; border-top: 1px solid var(--line); z-index: 5; }
.bottom-hint { font-size: 14px; color: var(--muted); margin: 0 0 8px; text-align: center; }
.bottom-hint:empty { display: none; }

/* role */
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; margin-bottom: 12px; padding: 0; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role { min-height: 62px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.3; padding: 10px; text-align: left; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.role:hover { background: var(--surface-2); }
.role.wide { grid-column: 1 / -1; }
.role[aria-pressed="true"] { border: 2px solid var(--accent); background: #E5F3F4; }
.dot { width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 50%; flex: 0 0 18px; display: grid; place-items: center; }
.role[aria-pressed="true"] .dot { border-color: var(--accent); }
.role[aria-pressed="true"] .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.field-label { display: block; margin: 26px 0 8px; font-weight: 650; }
input[type], input:not([type]), textarea { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-size: 16px; padding: 12px; }
input::placeholder, textarea::placeholder { color: #566C75; }
.hint { margin: 7px 0 0; font-size: 14px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }

/* tasks */
.tasks { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.task { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.task.selected { border: 2px solid var(--accent); background: #E8F3F4; padding: 13px; }
.task-btn { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 38px 1fr 44px; gap: 10px; align-items: start; width: 100%; cursor: pointer; border-radius: 10px; }
.task-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.num { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
.task h2 { font-size: 16px; line-height: 1.4; margin: 0 0 4px; }
.task .desc { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 0; }
.pick { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: #fff; position: relative; }
.selected .pick { border: 2px solid var(--accent); }
.selected .pick::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--accent); }
.tag { display: inline-flex; min-height: 28px; align-items: center; margin-top: 9px; padding: 3px 10px; border-radius: 999px; color: #fff; font-size: 13px; font-weight: 700; }
.tag.allow { background: var(--ok); } .tag.policy { background: var(--denied); } .tag.guard { background: var(--blocked); } .tag.free { background: var(--accent); }
.reveal { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.reveal legend, .reveal label { font-size: 14px; font-weight: 650; margin-bottom: 8px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; min-width: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
textarea { min-height: 96px; line-height: 1.45; resize: vertical; }
.count { text-align: right; font-size: 14px; color: var(--muted); margin-top: 4px; }

/* trace */
.timer { font: 700 18px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 18px 0; font-variant-numeric: tabular-nums; }
.trace { position: relative; list-style: none; margin: 0; padding: 18px 16px; border: 1px solid #8EABB3; border-radius: 18px; background: #ffffffdb; box-shadow: inset 0 0 0 4px #E4EEF0; }
.trace::before { content: ""; position: absolute; left: 35px; top: 34px; bottom: 34px; width: 2px; background: #BFD0D4; }
.step { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; min-height: 55px; padding: 5px 0; }
.step-text { min-width: 0; }
.step strong { display: block; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.step small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.step .sstate { font-size: 13px; font-weight: 700; color: var(--muted); text-align: right; }
.step.st-ok .sstate { color: var(--ok); } .step.st-blocked .sstate { color: var(--blocked); } .step.st-denied .sstate { color: var(--denied); }
.step.st-masked .sstate { color: var(--masked); } .step.st-error .sstate { color: var(--error); } .step.st-running .sstate { color: var(--accent); }
.step details { margin-top: 4px; font-size: 13px; color: var(--muted); }
.step details summary { cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 650; }
.step details pre { white-space: pre-wrap; word-break: break-word; font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 4px 0 0; background: var(--surface-2); padding: 8px; border-radius: 8px; max-height: 220px; overflow: auto; }

/* status shapes */
.shape { z-index: 1; width: 28px; height: 28px; display: grid; place-items: center; color: #fff; justify-self: center; transition: background 220ms var(--ease), border-color 220ms var(--ease); }
.shape .glyph { display: grid; }
.shape svg { width: 15px; height: 15px; }
.shape.st-ok { border-radius: 50%; background: var(--ok); }
.shape.st-blocked { background: var(--blocked); clip-path: polygon(29% 0, 71% 0, 100% 29%, 100% 71%, 71% 100%, 29% 100%, 0 71%, 0 29%); }
.shape.st-denied { width: 24px; height: 24px; background: var(--denied); transform: rotate(45deg); }
.shape.st-denied .glyph { transform: rotate(-45deg); }
.shape.st-masked { background: var(--masked); clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%); }
.shape.st-skipped { border: 3px solid var(--skipped); border-radius: 50%; background: #fff; color: var(--skipped); }
.shape.st-error { background: var(--error); clip-path: polygon(50% 0, 100% 100%, 0 100%); align-items: end; padding-bottom: 2px; }
.shape.st-error svg { width: 13px; height: 13px; }
.shape.st-running { border: 5px double var(--accent); border-radius: 50%; background: #E1F0F2; color: var(--accent); }
.shape.st-running svg { animation: spin 1.6s linear infinite; }
.shape.st-pending { border: 3px solid #A9BCC2; border-radius: 50%; background: #fff; }
.step.st-running .shape { animation: breathe 2.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .72; } }
.hint-box { margin-top: 18px; border-radius: 12px; background: var(--accent); color: #fff; padding: 14px 16px; display: flex; gap: 10px; align-items: center; }
.note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 12px; }

/* result */
.outcome { padding: 20px; border: 1px solid #C8893E; border-radius: 18px; background: #FFF8ED; box-shadow: inset 0 0 0 4px #FAEAD3; margin-top: 14px; }
.outcome-head { display: flex; gap: 12px; }
.human-shape { width: 42px; height: 42px; border-radius: 12px; background: var(--human); color: #fff; display: grid; place-items: center; flex: 0 0 42px; }
.human-shape svg { width: 24px; height: 24px; }
.outcome h2 { font-size: 20px; line-height: 1.35; margin: 0 0 2px; }
.draft { font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: #7A4600; }
.await { color: #6B3E00; }
.warning { margin: 16px 0 0; padding-top: 15px; border-top: 1px solid #DFBD8D; font-size: 15px; }
.blocked-box { margin-top: 14px; padding: 18px; border: 1px solid #D78A82; border-radius: 18px; background: #FDF1EF; box-shadow: inset 0 0 0 4px #F9E1DE; }
.blocked-head { display: flex; gap: 12px; align-items: flex-start; }
.blocked-box h2 { font-size: 19px; margin: 0 0 4px; }
.blocked-box .shape { width: 36px; height: 36px; flex: 0 0 36px; }
.blocked-box .shape svg { width: 20px; height: 20px; }
.skipped-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.skipped-list li { font-size: 13px; padding: 4px 8px; border: 1px dashed var(--skipped); border-radius: 8px; color: var(--skipped); background: #fff; }
.answer { margin-top: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.answer h2 { font-size: 18px; margin: 0 0 8px; }
.ans-p { margin: 0 0 9px; overflow-wrap: anywhere; }
.ans-h { font-size: 17px; margin: 12px 0 6px; }
.ans-list { margin: 0 0 10px; padding-left: 22px; }
.ans-list li { margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin: 0 0 10px; }
.ans-table { border-collapse: collapse; font-size: 14px; min-width: 100%; }
.ans-table th, .ans-table td { border: 1px solid #C5D4D8; padding: 6px 8px; text-align: start; vertical-align: top; }
.ans-table th { background: var(--surface-2); }
.cite-inline { display: inline-block; padding: 0 6px; margin: 0 2px; border-radius: 6px; background: var(--surface-2); color: #294C5A; font-size: 13px; }
.cite { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.cite span { padding: 5px 8px; border-radius: 8px; background: var(--surface-2); color: #294C5A; font-size: 13px; }
.cite-title { font-size: 14px; font-weight: 650; color: var(--muted); margin-top: 10px; }
.footer-band { padding: 12px; border-radius: 10px; background: #E6F3EE; color: #124F3D; font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: flex-start; }
.footer-band [data-icon] svg { width: 18px; height: 18px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.badge { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 9px; color: #fff; font-size: 13px; font-weight: 700; }
.badge svg { width: 16px; height: 16px; }
.badge.ok { background: var(--ok); } .badge.denied { background: var(--denied); } .badge.blocked { background: var(--blocked); }
.badge.masked { background: var(--masked); } .badge.human { background: var(--human); } .badge.error { background: var(--error); }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; margin: 0; }
.metric { padding: 12px 8px; text-align: center; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric dd { margin: 0; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric dt { font-size: 13px; color: var(--muted); }
.metric dd.na { font-size: 13px; font-weight: 600; color: var(--muted); }
.metrics-title { font-size: 14px; font-weight: 650; color: var(--muted); margin: 14px 0 6px; }
.mini-trace { margin-top: 16px; }
.mini-trace summary { min-height: 44px; display: flex; align-items: center; font-weight: 650; color: var(--accent); cursor: pointer; }
.privacy { margin-top: 18px; }

/* card */
.card { aspect-ratio: 1 / 1; position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: inset 0 0 0 5px #E1ECEF; display: flex; flex-direction: column; }
.card::before, .card::after { content: ""; position: absolute; border: 1px solid #C6D6DA; border-radius: 18px; pointer-events: none; }
.card::before { inset: 14px; }
.card::after { width: 54px; height: 54px; right: 26px; top: 26px; transform: rotate(20deg); }
.mark { display: flex; gap: 8px; align-items: center; color: var(--accent); font-weight: 700; font-size: 15px; }
.nickname { margin-top: 12px; color: var(--muted); font-size: 14px; }
.card h2 { font-size: clamp(20px, 6.6vw, 26px); line-height: 1.28; margin: 6px 0 10px; max-width: 280px; }
.card-controls-title { font-size: 13px; color: var(--muted); font-weight: 650; margin-bottom: 6px; }
.controls { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.control { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; line-height: 1.3; }
.control .shape { width: 22px; height: 22px; flex: 0 0 22px; }
.control .shape svg { width: 13px; height: 13px; }
.control .shape.st-denied { width: 18px; height: 18px; flex-basis: 18px; margin: 0 2px; }
.qr-slot { position: absolute; right: 24px; bottom: 74px; display: grid; justify-items: center; gap: 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.qr-box { width: 84px; height: 84px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.card-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 700; color: #124F3D; position: relative; }

/* models */
.task-ctx { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: 14px; margin-bottom: 16px; }
.models { display: grid; gap: 10px; }
.model { min-height: 92px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; text-align: left; cursor: pointer; }
.model[aria-pressed="true"] { border: 2px solid var(--accent); background: #E7F2F3; padding: 13px; }
.check { width: 22px; height: 22px; border: 2px solid #718B94; border-radius: 6px; margin-top: 2px; position: relative; }
.model[aria-pressed="true"] .check { border-color: var(--accent); background: var(--accent); }
.model[aria-pressed="true"] .check::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.model strong { display: block; line-height: 1.3; }
.provider { display: block; font-size: 14px; color: var(--muted); margin-top: 3px; }
.wait { font: 700 14px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent); white-space: nowrap; }
.mnote { grid-column: 2 / -1; margin-top: 4px; padding: 8px; border-radius: 8px; background: #FFF2DF; color: #6E4100; font-size: 13px; }
.opt { display: inline-block; margin-top: 5px; font-size: 13px; color: var(--muted); }

/* race */
.lane { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; margin-top: 12px; }
.lane.running { background: #E8F3F4; }
.lane-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.lane strong { line-height: 1.3; }
.lstatus { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.lstatus .shape { width: 22px; height: 22px; }
.lstatus .shape svg { width: 13px; height: 13px; }
.lane .answer-mini { font-size: 15px; margin: 12px 0; color: #294652; }
.lane .answer-mini .ans-p { margin-bottom: 6px; }
.lane details summary { min-height: 44px; display: flex; align-items: center; color: var(--accent); font-weight: 650; cursor: pointer; }
.meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
.thinking { margin: 12px 0 4px; font-size: 14px; color: var(--accent); }
.lprogress { height: 6px; border-radius: 3px; background: #C9DADD; overflow: hidden; }
.lprogress span { display: block; height: 100%; background: var(--running); transition: width 220ms var(--ease); }
.vote { width: 100%; min-height: 44px; margin-top: 13px; border: 1px solid var(--accent); border-radius: 9px; background: #fff; color: var(--accent); font-weight: 700; cursor: pointer; }
.vote[aria-pressed="true"] { background: var(--accent); color: #fff; }
.vote:disabled:not([aria-pressed="true"]) { opacity: .55; cursor: not-allowed; }
.votes { margin-top: 22px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.votes h2 { font-size: 18px; margin: 0 0 4px; }
.votes p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.barrow { display: grid; grid-template-columns: 110px 1fr 32px; gap: 8px; align-items: center; font-size: 13px; margin: 8px 0; }
.vbar { height: 10px; background: #D9E4E6; border-radius: 5px; overflow: hidden; }
.vbar span { display: block; height: 100%; background: var(--accent); }

/* states */
.state { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: #fff; display: grid; grid-template-columns: 44px 1fr; gap: 12px; }
.state h1 { font-size: 20px; line-height: 1.35; margin: 0 0 4px; }
.state p { color: var(--muted); font-size: 15px; line-height: 1.45; }
.shape-lg .shape { width: 40px; height: 40px; }
.shape-lg .shape svg { width: 22px; height: 22px; }
.shape-lg .shape.st-denied { width: 32px; height: 32px; margin: 4px; }
.state-actions { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 6px; }
.inline-state { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid #D78A82; background: #FDF1EF; font-size: 15px; }
.inline-state strong { display: block; }

@media (max-width: 340px) {
  .roles { grid-template-columns: 1fr; }
  .metric dd { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Plain-language "what happened" card */
.story { border: 2px solid var(--line, #c9d6da); border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; background: #f4fafb; }
.story-head { display: flex; gap: 10px; align-items: center; font-size: 18px; line-height: 1.3; }
.story p { margin: 8px 0 0; font-size: 16px; line-height: 1.5; }
.story.tone-ok { border-color: #2e8b62; background: #eef8f3; }
.story.tone-denied { border-color: #b8641f; background: #fdf3ea; }
.story.tone-blocked { border-color: #c0443b; background: #fcefee; }
.story.tone-masked { border-color: #7a57b8; background: #f4effb; }
.story.tone-error { border-color: #b2304a; background: #fcedf0; }
