/* The TodoMVC look of the OpenID AuthZEN interop Todo application, written
   for this repository (not a copy of todomvc-app-css), with a decision
   timeline beside the list. No external fonts, no inline styles (CSP). */
:root {
  --ink: #1b1b1f;
  --muted: #5d5d66;
  --line: #e6e6ea;
  --accent: #b83f45;
  --accent-ink: #fff;
  --paper: #fff;
  --page: #f4f4f6;
  --soft: #f8f8fa;
  --ok: #1f7a3a;
  --ok-bg: #e5f4ea;
  --warn: #8a5a00;
  --warn-bg: #fdf1d8;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --info: #2f4fb8;
  --info-bg: #e8edfb;
  --ai: #6a3fb0;
  --ai-bg: #efe8fa;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.08);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececf1;
    --muted: #a3a3ad;
    --line: #34343c;
    --accent: #e0686e;
    --accent-ink: #1b1b1f;
    --paper: #1f1f24;
    --page: #151518;
    --soft: #26262c;
    --ok: #6fd08c;
    --ok-bg: #173022;
    --warn: #f0c060;
    --warn-bg: #3a2e12;
    --bad: #ff8a80;
    --bad-bg: #3d1c1a;
    --info: #9db2ff;
    --info-bg: #1d2747;
    --ai: #c7a6ff;
    --ai-bg: #2c2140;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--page);
  color: var(--ink);
}
[hidden] { display: none !important; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
code { font: 12px/1.35 var(--mono); word-break: break-all; }
pre { font: 12px/1.4 var(--mono); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px; overflow: auto; max-height: 320px; margin: 4px 0 8px; white-space: pre-wrap; word-break: break-all; }
.muted { color: var(--muted); font-size: 13px; }
a { color: var(--info); }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }

.button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 6px; padding: 6px 12px;
  font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px; line-height: 1.3;
}
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.button.quiet { color: var(--muted); }
.button.small { font-size: 13px; padding: 3px 8px; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 14px 16px 0;
}
.brand-mark { font-size: 44px; font-weight: 200; color: var(--accent); letter-spacing: -1px; line-height: 1; }
.brand-sub { color: var(--muted); font-size: 14px; margin-left: 6px; }
.page { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

/* Persona banner */
.persona {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  background: var(--paper); border-radius: 10px; padding: 12px 16px; margin: 14px 0; box-shadow: var(--shadow);
  border-left: 5px solid var(--accent);
}
.persona-text p { margin: 0; }
.persona-line { font-size: 17px; }
.persona-can { color: var(--ink); font-size: 14px; }
.persona-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px !important; }
.persona-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.persona-behind { grid-column: 1 / -1; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
}
.role-chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--info-bg); color: var(--info); vertical-align: 2px; }
.fact-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }

/* Two columns: the list and the timeline */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.layout.solo { grid-template-columns: minmax(0, 640px); justify-content: center; }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } .persona { grid-template-columns: auto 1fr; } .persona-actions { grid-column: 1 / -1; justify-content: flex-start; } }

/* TodoMVC */
.todoapp { background: var(--paper); box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; }
.new-todo {
  width: 100%; padding: 16px 16px 16px 60px; border: none; font: inherit; font-size: 22px; background: var(--paper); color: var(--ink);
  box-shadow: inset 0 -2px 1px rgba(0, 0, 0, 0.03);
}
.new-todo:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.new-todo::placeholder { font-style: italic; color: var(--muted); opacity: 0.8; }
.new-todo:disabled { background: var(--soft); }
.signed-out { padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.signed-out h2 { font-size: 19px; margin: 4px 0 8px; }
.pitch { margin: 0 0 14px; padding-left: 20px; }
.pitch li { margin: 3px 0; }
.people { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.person { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; background: var(--soft); }
.person b { font-size: 15px; }
.person code { font-size: 12px; }
.person p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.main { border-top: 1px solid var(--line); }
.todo-list { margin: 0; padding: 0; list-style: none; }
.todo-list li { position: relative; font-size: 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.todo-list li.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--warn-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .todo-list li.flash { animation: none; } }
.todo-list li .toggle {
  appearance: none; width: 28px; height: 28px; margin: 0 14px; border: 1px solid var(--muted); border-radius: 50%; cursor: pointer; flex: none; background: var(--paper);
}
.todo-list li .toggle:checked { border-color: #3ea390; background: radial-gradient(circle, #3ea390 0 35%, transparent 36%); }
.todo-list li label { flex: 1; padding: 14px 8px; word-break: break-word; cursor: text; }
.todo-list li.completed label { color: var(--muted); text-decoration: line-through; }
.todo-list li .owner { font-size: 12px; color: var(--muted); margin-right: 6px; white-space: nowrap; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); }
.todo-list li .owner.mine { color: var(--info); border-color: var(--info); }
.todo-list li .destroy {
  border: none; background: none; font-size: 26px; color: var(--muted); width: 40px; cursor: pointer; opacity: 0.35;
}
.todo-list li:hover .destroy, .todo-list li .destroy:focus-visible { opacity: 1; color: var(--accent); }
.todo-list li .edit { flex: 1; font: inherit; font-size: 20px; padding: 10px 8px; margin: 0 8px; border: 1px solid var(--muted); background: var(--paper); color: var(--ink); }
.footer {
  padding: 10px 15px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-size: 14px; color: var(--muted); border-top: 1px solid var(--line);
}
.filters { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.filters a { color: inherit; padding: 3px 7px; border: 1px solid transparent; border-radius: 3px; text-decoration: none; }
.filters a.selected, .filters a:hover { border-color: var(--accent); }
.clear-completed { border: none; background: none; color: inherit; cursor: pointer; font: inherit; }
.clear-completed:hover { text-decoration: underline; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 4px 0; }

/* Panels */
.panel { background: var(--paper); padding: 14px 16px; margin: 16px 0; border-radius: 8px; box-shadow: var(--shadow); }
.panel h2, .col-log h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.callout.stepup { border-left: 5px solid var(--warn); }
.callout p { margin: 8px 0; }

/* Badges for participants and outcomes */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.b-policy { background: var(--info-bg); color: var(--info); }
.b-ai { background: var(--ai-bg); color: var(--ai); }
.b-human { background: var(--warn-bg); color: var(--warn); }
.b-stepup { background: var(--warn-bg); color: var(--warn); }
.b-off { background: var(--soft); color: var(--muted); border: 1px dashed var(--line); }
.verdict { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.verdict[data-verdict="allow"] { background: var(--ok-bg); color: var(--ok); }
.verdict[data-verdict="deny"] { background: var(--bad-bg); color: var(--bad); }
.verdict[data-verdict="require_approval"] { background: var(--warn-bg); color: var(--warn); }
.legend { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 6px 0 10px; }
.legend .badge { margin-left: 6px; }
.legend .badge:first-child { margin-left: 0; }

/* Timeline */
.col-log { background: var(--paper); border-radius: 8px; padding: 14px 16px; box-shadow: var(--shadow); }
.col-log > .muted { margin: 4px 0 0; }
.decisions, .approvals { margin: 0; padding: 0; list-style: none; }
.event { border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.event[data-outcome="allow"] { border-left-color: var(--ok); }
.event[data-outcome="deny"] { border-left-color: var(--bad); }
.event[data-outcome="require_approval"] { border-left-color: var(--warn); }
.event[data-outcome="step_up"] { border-left-color: var(--warn); }
.event.fresh { box-shadow: 0 0 0 3px var(--info-bg); }
.event-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-head .when { margin-left: auto; color: var(--muted); font-size: 12px; }
.event .what { margin: 6px 0 4px; font-weight: 600; }
.event .reason { margin: 4px 0 6px; }
.participants { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.steps { list-style: none; margin: 6px 0; padding: 0; font-size: 14px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 8px; padding: 4px 0; align-items: start; }
.steps .mark { font-weight: 700; width: 1.2em; text-align: center; }
.steps .mark[data-v="ok"] { color: var(--ok); }
.steps .mark[data-v="no"] { color: var(--bad); }
.steps .mark[data-v="wait"] { color: var(--warn); }
.steps .mark[data-v="skip"] { color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }

/* Progressive disclosure */
details.behind { margin-top: 8px; font-size: 14px; }
details.behind > summary { cursor: pointer; color: var(--info); font-size: 13px; }
details.behind[open] > summary { margin-bottom: 6px; }
.explain { margin: 0; }
.explain dt { font-weight: 600; margin-top: 8px; font-size: 13px; }
.explain dd { margin: 2px 0 0; font-size: 13px; }
abbr[title], dfn[title] { text-decoration: underline dotted; cursor: help; font-style: normal; }

/* Approvals */
.gate { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.gate .gate-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gate .what { font-weight: 600; }
.stepper { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font-size: 14px; }
.stepper li { display: grid; grid-template-columns: 1.6em 1fr; gap: 6px; color: var(--muted); }
.stepper li .n { width: 1.4em; height: 1.4em; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.stepper li[data-state="done"] { color: var(--ink); }
.stepper li[data-state="done"] .n { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.stepper li[data-state="now"] { color: var(--ink); font-weight: 600; }
.stepper li[data-state="now"] .n { background: var(--warn-bg); color: var(--warn); border-color: var(--warn); }

/* Demo script */
.script { background: var(--paper); border-radius: 10px; padding: 14px 16px; margin: 14px 0 0; box-shadow: var(--shadow); border-top: 4px solid var(--info); }
.script h2 { font-size: 18px; margin: 0; }
.script-head p { margin: 4px 0 0; }
.script-steps { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); counter-reset: step; }
.script-steps > li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; counter-increment: step; position: relative; }
.script-steps > li.current { border-color: var(--info); box-shadow: 0 0 0 2px var(--info-bg); }
.script-steps > li h3 { font-size: 15px; margin: 0 0 4px; }
.script-steps > li h3::before { content: counter(step) ". "; color: var(--muted); }
.script-steps > li p { margin: 4px 0; font-size: 14px; }
.script-steps .as { font-size: 12px; color: var(--muted); }
.script-steps .try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0; font-size: 13px; }
.script-steps .try q { font-family: var(--mono); font-size: 12px; background: var(--soft); padding: 1px 6px; border-radius: 4px; }

.status { min-height: 1.4em; text-align: center; color: var(--muted); font-size: 14px; }

/* Decision receipt */
.record { max-width: 760px; width: calc(100% - 24px); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); padding: 16px 20px; }
.record::backdrop { background: rgba(0, 0, 0, 0.45); }
.record-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.record h2 { font-size: 19px; margin: 0; display: flex; gap: 8px; align-items: center; }
.record h3 { font-size: 15px; margin: 14px 0 4px; }
.receipt { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 10px 0; font-size: 15px; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; }
.trust { background: var(--ok-bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
.trust p { margin: 4px 0; }
.trust h3 { margin-top: 0; }
.record dl.tech { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.record dl.tech dt { color: var(--muted); }
.record dl.tech dd { margin: 0; }
.record table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record td, .record th { text-align: left; border-bottom: 1px solid var(--line); padding: 4px; vertical-align: top; }
.reasons { margin: 4px 0; padding-left: 20px; }
.reasons li { margin: 3px 0; }
.notice { max-width: 560px; margin: 80px auto; background: var(--paper); padding: 24px; }

/* ------------------------------------------------------------------------
   Demo pass: one idea per screen. Every request travels a route of four
   checkpoints (your key, the policy, the AI check, a person); colour means
   which checkpoint, never decoration. Plain rules instead of shadowed cards.
   ------------------------------------------------------------------------ */
:root {
  --ink: #17212b;
  --muted: #5b6672;
  --line: #dce1e6;
  --page: #ffffff;
  --paper: #ffffff;
  --soft: #f5f7f9;
  --accent: #17212b;
  --accent-ink: #ffffff;
  --c-key: #0f766e;
  --c-policy: #2a4fd0;
  --c-ai: #7a3fc2;
  --c-human: #b45309;
  --ok: #15803d;
  --ok-bg: #e8f5ec;
  --bad: #b91c1c;
  --bad-bg: #fdecec;
  --warn: #b45309;
  --warn-bg: #fdf3e6;
  --info: #2a4fd0;
  --info-bg: #ecf0fd;
  --ai: #7a3fc2;
  --ai-bg: #f3ecfb;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7ecf1;
    --muted: #9aa5b1;
    --line: #2c3540;
    --page: #11171d;
    --paper: #11171d;
    --soft: #18202a;
    --accent: #e7ecf1;
    --accent-ink: #11171d;
    --c-key: #2dd4bf;
    --c-policy: #8aa4ff;
    --c-ai: #c4a1ff;
    --c-human: #f5a524;
    --ok: #4ade80;
    --ok-bg: #12291c;
    --bad: #f87171;
    --bad-bg: #2d1515;
    --warn: #f5a524;
    --warn-bg: #2b2112;
    --info: #8aa4ff;
    --info-bg: #182240;
    --ai: #c4a1ff;
    --ai-bg: #231a35;
  }
}

body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.brand-mark { color: var(--ink); font-weight: 700; font-size: 26px; letter-spacing: -0.03em; }
.brand-sub { font-size: 14px; }

/* Rules, not floating cards. */
.persona {
  border-radius: 0; border-left: 0; padding: 14px 0; margin: 10px 0 18px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.avatar { background: var(--ink); color: var(--paper); width: 40px; height: 40px; font-size: 17px; }
.todoapp, .panel, .col-log, .script { box-shadow: none; }
.todoapp { border: 1px solid var(--line); border-radius: 10px; }
.new-todo { font-size: 19px; }
.new-todo:focus { outline-color: var(--c-policy); }
.button:hover { border-color: var(--ink); }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Participant colours drive every badge. */
.badge.b-policy { color: var(--c-policy); background: color-mix(in srgb, var(--c-policy) 10%, transparent); }
.badge.b-ai { color: var(--c-ai); background: color-mix(in srgb, var(--c-ai) 11%, transparent); }
.badge.b-human { color: var(--c-human); background: color-mix(in srgb, var(--c-human) 12%, transparent); }
.badge.b-stepup { color: var(--c-key); background: color-mix(in srgb, var(--c-key) 11%, transparent); }

/* --------------------------------------------------------- the route */
.route {
  list-style: none; margin: 12px 0 14px; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: start;
  position: relative;
}
.station { position: relative; display: grid; justify-items: center; text-align: center; gap: 3px; padding: 0 4px; }
/* The track between stations: solid when the request got this far. */
.station:not(.end)::after {
  content: ""; position: absolute; top: 17px; left: calc(50% + 19px); right: calc(-50% + 19px);
  border-top: 2px solid var(--line);
}
.station[data-v="ok"]:not(.end)::after { border-top-color: var(--ok); }
.station[data-v="skip"]:not(.end)::after { border-top-style: dashed; }
.station[data-station="human"]::after { right: -8px; left: calc(50% + 19px); }
.node {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--line); background: var(--paper); color: var(--muted); font-size: 17px; z-index: 1;
}
.station[data-station="key"] .node { --c: var(--c-key); }
.station[data-station="policy"] .node { --c: var(--c-policy); }
.station[data-station="ai"] .node { --c: var(--c-ai); }
.station[data-station="human"] .node { --c: var(--c-human); }
.station[data-v="ok"] .node { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--paper)); }
.station[data-v="wait"] .node { border-color: var(--warn); color: var(--warn); background: var(--warn-bg); border-style: dashed; }
.station[data-v="no"] .node { border-color: var(--bad); color: var(--paper); background: var(--bad); }
.station[data-v="skip"] .node { border-style: dashed; opacity: 0.55; }
.station-label { font-size: 13px; font-weight: 650; color: var(--ink); }
.station[data-v="skip"] .station-label { color: var(--muted); font-weight: 500; }
.station-note { font-size: 12px; line-height: 1.3; color: var(--muted); max-width: 13ch; }
.station[data-v="no"] .station-note { color: var(--bad); }
.station[data-v="wait"] .station-note { color: var(--warn); }
.station.end { align-self: start; display: flex; align-items: center; height: 36px; padding-left: 12px; }
.stamp {
  display: inline-block; font-weight: 750; font-size: 14px; padding: 6px 12px; border-radius: 6px;
  border: 2px solid currentColor; white-space: nowrap;
}
.station.end[data-v="ok"] .stamp { color: var(--ok); }
.station.end[data-v="no"] .stamp { color: var(--bad); }
.station.end[data-v="wait"] .stamp { color: var(--warn); }

/* The one orchestrated moment: a fresh decision lights its route in order. */
@media (prefers-reduced-motion: no-preference) {
  .event.fresh .node, .event.fresh .stamp { animation: light 360ms ease-out both; }
  .event.fresh .station:nth-child(2) .node { animation-delay: 120ms; }
  .event.fresh .station:nth-child(3) .node { animation-delay: 240ms; }
  .event.fresh .station:nth-child(4) .node { animation-delay: 360ms; }
  .event.fresh .station.end .stamp { animation-delay: 500ms; }
}
@keyframes light { from { opacity: 0.15; transform: scale(0.85); } to { opacity: 1; transform: none; } }

/* The head of a card already says the outcome in the stamp: keep the badges, drop the duplicate pill. */
.event .event-head .verdict { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.event { border-radius: 10px; border: 1px solid var(--line); box-shadow: none; }
.event .what { font-size: 16px; font-weight: 650; }
.event + .event { opacity: 0.86; }
.event + .event .route { transform: scale(0.92); transform-origin: left center; }

@media (max-width: 560px) {
  .route { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 10px; }
  .station.end { grid-column: 1 / -1; justify-self: start; margin-top: 0; padding-left: 0; }
  .station-note { display: none; }
}
.event.fresh { box-shadow: none; }
