/* Tulevik session page (spec 4.8). One calm column, a vertical step rail
   with a single highlighted step. Colours are tokens: the contrast test
   (internal/web/assets) checks --muted and --fg on --bg and --surface. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --fg: #16212b;
  --muted: #56636f;
  --line: #d6dde3;
  --accent: #0d5c7a;
  --accent-soft: #e1eef3;
  --ok: #1d7a46;
  --ok-soft: #e3f3ea;
  --warn: #8a5a00;
  --warn-soft: #fbf0d9;
  --bad: #a3262a;
  --bad-soft: #f8e3e3;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f161c; --surface: #17212a; --fg: #e6edf2; --muted: #9aa8b4; --line: #2b3945;
    --accent: #6cc0dd; --accent-soft: #15303c; --ok: #6fd39b; --ok-soft: #143222;
    --warn: #e9b955; --warn-soft: #3a2d10; --bad: #f08a8a; --bad-soft: #3c1a1b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font-body); margin: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 0 48px;
  overflow-wrap: break-word }
.wrap { max-width: 680px; margin: 0 auto; display: grid; gap: 20px; min-width: 0 }
main { display: grid; gap: 20px; min-width: 0 }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 }
h1 { font-size: 1.6rem } h2 { font-size: 1.3rem } h3 { font-size: 1.05rem } h4 { font-size: 1rem }
p { margin: 0 }
a { color: var(--accent) }
button { font: inherit; cursor: pointer }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px }
[hidden] { display: none !important }

header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; flex-wrap: wrap }
.brand { font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; min-width: 0 }
.mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none }
.mark::after { content: ""; width: 10px; height: 10px; border: 3px solid var(--surface); border-radius: 50% }
.pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); gap: 2px }
.pill a { border-radius: 999px; padding: 6px 10px; display: flex; align-items: center; opacity: .6 }
.pill a[aria-current="true"] { background: var(--accent-soft); opacity: 1; box-shadow: inset 0 0 0 1.5px var(--accent) }
.pill svg { width: 26px; height: 18px; border-radius: 3px; display: block }

.welcome { background: var(--accent-soft); border-radius: var(--r); padding: 10px 14px }

/* steps */
ol.steps { list-style: none; margin: 0; padding: 0; display: grid }
.step { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 0 14px; position: relative }
.step:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: -2px; width: 2px; background: var(--line) }
.step.done:not(:last-child)::before { background: var(--ok) }
.dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--surface);
  border: 2px solid var(--line); color: var(--muted); z-index: 1; margin-top: 2px }
.dot > span, .dot::before { grid-area: 1 / 1 }
.step.upcoming .dot, .step.skipped .dot { width: 22px; height: 22px; margin: 7px 5px 0; font-size: .7rem; border-width: 1.5px }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface) }
.step.current .dot { background: var(--accent); border-color: var(--accent); color: var(--surface) }
.step.waiting .dot { background: var(--warn-soft); border-color: var(--warn); color: var(--warn) }
.step.done .dot > span, .step.skipped .dot > span, .step.milestone .dot > span { display: none }
.step.done .dot::before { content: "\2713" }
.step.skipped .dot::before { content: "\2013" }
.step.milestone:not(.done) .dot::before { content: "\2605" }
.step.milestone .dot { border-radius: 9px; transform: rotate(45deg) }
.step.milestone .dot::before { transform: rotate(-45deg) }
.body { padding: 6px 0 18px; min-width: 0 }
.label { display: flex; gap: 4px 8px; align-items: baseline; flex-wrap: wrap }
.step.upcoming .label, .step.skipped .label { color: var(--muted) }
.step.skipped .label strong { font-weight: 400; text-decoration: line-through; text-decoration-color: var(--line) }
.tag { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted) }
.when { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums }
.card { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; min-width: 0 }
.step.current .card { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft) }
.step.waiting .card { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft) }
.step.milestone.done .card { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft) }
.kicker { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--accent); font-family: var(--font-body) }
.step.waiting .kicker { color: var(--warn) }
.kicker.star, .milestone .kicker { color: var(--ok) }
.kicker.star::before { content: "\2605\00a0" }
.lead { font-weight: 700 }
.hint { color: var(--muted); font-size: .92rem }
.primary { display: inline-block; background: var(--accent); color: var(--surface); border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 700;
  max-width: 100%; overflow-wrap: anywhere; text-decoration: none }
.secondary { display: inline-block; background: transparent; color: var(--accent); border: 1.5px solid var(--accent); border-radius: 8px; padding: 7px 12px;
  font-weight: 700; text-decoration: none }
.link { background: none; border: 0; color: var(--accent); padding: 0; text-decoration: underline; font: inherit; cursor: pointer }
.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--accent-soft); overflow: hidden; color: var(--accent) }
.bar::-webkit-progress-bar { background: var(--accent-soft); border-radius: 99px }
.bar::-webkit-progress-value { background: var(--accent); border-radius: 99px; transition: width .6s }
.bar::-moz-progress-bar { background: var(--accent); border-radius: 99px }
.spin { width: 12px; height: 12px; border: 2px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; display: inline-block;
  animation: spin 1s linear infinite; vertical-align: -1px; margin-right: 6px }
@keyframes spin { to { transform: rotate(360deg) } }
.bigaddr { font-family: var(--font-head); font-size: clamp(1.2rem, 6vw, 1.8rem); font-weight: 700; overflow-wrap: anywhere; background: var(--bg); border-radius: 8px; padding: 12px 14px }

/* panels and the report */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0 }
.panel.milestone { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft) }
details > summary { cursor: pointer }
details.folded > summary { color: var(--muted); list-style: none; display: flex; flex-wrap: wrap; gap: 4px 10px }
details.folded > summary::-webkit-details-marker { display: none }
details.folded[open] > summary .link { display: none }
details.folded > .steps { margin-top: 12px }
.summary { display: grid; gap: 4px; font-weight: 700 }
details.group { border-top: 1px solid var(--line); padding-top: 10px }
details.group > summary { font-weight: 700; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap }
details.group > summary > span:last-child { color: var(--muted); font-weight: 400; white-space: nowrap }
.lvl { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--muted) }
.no-impact > summary .lvl { background: var(--ok) }
.recommended > summary .lvl { background: var(--accent) }
.behavior-changing > summary .lvl { background: var(--warn) }
details.action { padding: 10px 0 10px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px }
details.action:first-of-type { border-top: 0 }
details.action > summary { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline }
details.action > summary > span:first-child { flex: 1 1 14em; min-width: 0 }
details.action[open] > * + * { margin-top: 8px }
details.action ol { margin: 0; padding-left: 1.4em }
.size { font-variant-numeric: tabular-nums; color: var(--ok); font-weight: 700; font-size: .9rem }
.chip { display: inline-block; font-size: .8rem; border-radius: 99px; padding: 2px 10px; background: var(--ok-soft); color: var(--ok); font-weight: 700 }
.gaps { margin: 0; padding-left: 1.2em; color: var(--muted) }
ul.checks { margin: 0; padding-left: 1.2em; display: grid; gap: 6px }

footer { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 6px }
footer a, footer .link { color: var(--muted) }
form.inline { margin: 0 }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap }

/* the live panel (spec 4.8.7) */
.live { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 10px; min-width: 0 }
.live-head { display: flex; align-items: center; gap: 8px }
.live .live-head .kicker { margin: 0; color: var(--ok) }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s ease-out infinite }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--ok) } 70%, 100% { box-shadow: 0 0 0 7px transparent } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px }
.stats > div { background: var(--bg); border-radius: 8px; padding: 8px 10px; display: grid; align-content: start; min-width: 0 }
.stats strong { font-family: var(--font-head); font-size: 1.2rem; font-variant-numeric: tabular-nums; line-height: 1.25 }
.stats small { color: var(--muted); font-size: .8rem; line-height: 1.35 }
.stats .sub { color: var(--fg) }
ol.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .92rem }
ol.feed li { display: grid; grid-template-columns: 4.9em minmax(0, 1fr); gap: 8px; padding: 2px 0 }
.live > ol.feed li:first-child { font-weight: 700 }
ol.feed time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; padding-top: 1px }
ol.feed li.pending { display: none }
ol.feed li.new { animation: fadein .45s ease-out }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
details.more > summary { color: var(--accent); text-decoration: underline; list-style: none }
details.more > summary::-webkit-details-marker { display: none }
details.more > .feed { margin-top: 4px }

@media (prefers-reduced-motion: reduce) {
  .spin, .pulse, ol.feed li.new { animation: none }
  .bar::-webkit-progress-value { transition: none }
}
@media print {
  header nav, footer form, .notify, .live { display: none }
}
