:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --line: rgba(0, 0, 0, 0.09);
  --fill: rgba(120, 120, 128, 0.12);
  --blue: #0071e3;
  --blue-text: #0066cc;
  --green: #30b350;
  --green-text: #1d7a34;
  --orange: #ff9f0a;
  --orange-text: #b25000;
  --red-text: #d70015;
  --glass: rgba(246, 246, 248, 0.72);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.08);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", "DejaVu Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000; --surface: #1c1c1e; --surface-2: #2c2c2e; --text: #f5f5f7; --text-2: #a1a1a6;
    --line: rgba(255, 255, 255, 0.12); --fill: rgba(120, 120, 128, 0.28);
    --blue: #0a84ff; --blue-text: #5eb0ff; --green: #32d74b; --green-text: #4cd964; --orange: #ff9f0a; --orange-text: #ffb340; --red-text: #ff6961;
    --glass: rgba(28, 28, 30, 0.72); --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000; --surface: #1c1c1e; --surface-2: #2c2c2e; --text: #f5f5f7; --text-2: #a1a1a6;
  --line: rgba(255, 255, 255, 0.12); --fill: rgba(120, 120, 128, 0.28);
  --blue: #0a84ff; --blue-text: #5eb0ff; --green: #32d74b; --green-text: #4cd964; --orange: #ff9f0a; --orange-text: #ffb340; --red-text: #ff6961;
  --glass: rgba(28, 28, 30, 0.72); --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.47 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; min-height: 100dvh;
}
::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--blue); }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.022em; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
h3 { font-size: 13px; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
a { color: var(--blue-text); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
.num, .tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--fill) transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* shell */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; padding: 22px 12px 14px; display: flex; flex-direction: column; gap: 4px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 650; letter-spacing: -0.01em; font-size: 16px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-label { padding: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button.navlink {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: var(--text); font-size: 14.5px;
  background: none; border: 0; text-align: left; width: 100%; text-decoration: none; transition: background-color 120ms ease;
}
.nav svg { width: 19px; height: 19px; flex: none; stroke: var(--text-2); }
.nav a[aria-current="page"] { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-text); font-weight: 600; }
.nav a[aria-current="page"] svg { stroke: var(--blue-text); }
.nav .pct { margin-left: auto; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .nav a:hover:not([aria-current="page"]) { background: var(--fill); text-decoration: none; } }
.side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.me small { display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.3; }
.me b { font-weight: 600; font-size: 14px; display: block; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; font-size: 11.5px; font-weight: 650; color: var(--text-2); flex: none; }

main { padding: 44px clamp(20px, 4vw, 48px) 72px; min-width: 0; }
.wrap { max-width: 920px; margin: 0 auto; }
@media (min-width: 1280px) { body.panel-open main { padding-right: 480px; } }
.head { margin-bottom: 28px; display: flex; flex-direction: column; gap: 6px; }
.head p { color: var(--text-2); font-size: 17px; text-wrap: pretty; }

/* grouped lists, the iOS way */
.group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.group + .group { margin-top: 28px; }
.section { margin-bottom: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; min-height: 52px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
a.row, button.row { color: inherit; width: 100%; background: none; border: 0; text-align: left; text-decoration: none; transition: background-color 120ms ease, transform 160ms var(--ease-out); }
button.row:active, a.row:active { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { background: var(--surface-2); text-decoration: none; } }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .sub { color: var(--text-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .code { width: 64px; flex: none; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.chev { width: 14px; height: 14px; stroke: var(--text-2); opacity: 0.6; flex: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-2); }

/* readiness */
.ready-head { padding: 22px 22px 6px; }
.ready-head h2 { font-size: 26px; letter-spacing: -0.02em; }
.ready-head h2 b { font-weight: 700; }
.bar { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--fill); margin: 14px 22px 12px; }
.bar i { display: block; height: 100%; transform-origin: left center; animation: grow 700ms var(--ease-out) backwards; }
.bar i:nth-child(2) { animation-delay: 60ms; } .bar i:nth-child(3) { animation-delay: 120ms; }
@keyframes grow { from { transform: scaleX(0); } }
.seg-ready { background: var(--green); } .seg-failing { background: #ff3b30; } .seg-evidence { background: var(--orange); } .seg-progress { background: var(--blue); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 0 22px 18px; color: var(--text-2); font-size: 13.5px; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: var(--fill); }
.legend .l-ready::before { background: var(--green); } .legend .l-evidence::before { background: var(--orange); } .legend .l-progress::before { background: var(--blue); }
.minibar { width: 84px; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; flex: none; }
.minibar i { display: block; height: 100%; background: var(--green); border-radius: 3px; }

.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--text-2); flex: none; }
.pill.ready { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-text); }
.pill.evidence { background: color-mix(in srgb, var(--orange) 20%, transparent); color: var(--orange-text); }
.pill.progress { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue-text); }
.pill.red { background: color-mix(in srgb, #ff3b30 16%, transparent); color: var(--red-text); }
.pill.na { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }

/* controls */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.search { flex: 1 1 220px; position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-2); pointer-events: none; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 0; background: var(--fill); outline: none; font-size: 15px;
  transition: box-shadow 140ms ease, background-color 140ms ease;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.search .input { padding-left: 34px; }
.input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); background: var(--surface); }
.input::placeholder { color: var(--text-2); opacity: 0.8; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 30px; width: auto; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out); }
.seg button:active { transform: scale(0.97); }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); font-weight: 600; }
.seg button:disabled { opacity: 0.5; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 12px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-text); font-size: 13.5px; font-weight: 500; border: 0; }
.chip span { font-size: 16px; line-height: 1; width: 18px; height: 18px; display: grid; place-items: center; }
.domain-title { padding: 22px 4px 8px; display: flex; justify-content: space-between; }
.domain-title:first-child { padding-top: 0; }
.meta { display: flex; align-items: center; gap: 10px; flex: none; }
.ev { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13px; min-width: 30px; justify-content: flex-end; }
.ev svg { width: 14px; height: 14px; stroke: currentColor; }
.owner-name { color: var(--text-2); font-size: 13.5px; width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.row.selected { background: color-mix(in srgb, var(--blue) 9%, transparent); }

/* buttons */
.btn { height: 38px; padding: 0 18px; border-radius: 19px; border: 0; background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; transition: transform 160ms var(--ease-out), opacity 160ms ease, background-color 160ms ease; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn.secondary { background: var(--fill); color: var(--blue-text); }
.btn.danger { background: transparent; color: var(--red-text); }
.btn.small { height: 30px; padding: 0 14px; font-size: 13.5px; }
.btn.block { width: 100%; height: 44px; border-radius: 12px; }
.linkbtn { background: none; border: 0; color: var(--blue-text); padding: 0; font-size: 14px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--red-text); }
.iconbtn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--fill); display: grid; place-items: center; transition: transform 160ms var(--ease-out); }
.iconbtn:active { transform: scale(0.94); }
.iconbtn svg { width: 14px; height: 14px; stroke: var(--text-2); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { flex: 1 1 180px; }
.err { color: var(--red-text); font-size: 13.5px; min-height: 20px; }
.pad { padding: 16px; }

/* auth */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 22px; }
.auth-card .logo { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto; }
.auth-card h1 { font-size: 28px; text-align: center; }
.auth-card p.lead { text-align: center; color: var(--text-2); margin-top: -12px; text-wrap: balance; }

/* detail panel */
.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 20; background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(104%); visibility: hidden;
  transition: transform 320ms var(--ease-drawer), visibility 0s linear 320ms;
}
.panel.open { transform: none; visibility: visible; transition: transform 320ms var(--ease-drawer), visibility 0s; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); }
.panel-body { flex: 1; overflow-y: auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 26px; overscroll-behavior: contain; }
.panel-body .lede { color: var(--text-2); margin-top: 8px; text-wrap: pretty; }
.scrim { position: fixed; inset: 0; z-index: 15; background: rgba(0, 0, 0, 0.28); opacity: 0; pointer-events: none; transition: opacity 240ms ease; }
@media (max-width: 1279px) { body.panel-open .scrim { opacity: 1; pointer-events: auto; } }
body.more-open .scrim { opacity: 1; pointer-events: auto; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.ev-item { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; }
.ev-item .grow { flex: 1; min-width: 0; }
.ev-item b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.ev-item p { color: var(--text-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.hist { font-size: 13.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.hist b { color: var(--text); font-weight: 500; }
.notice { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange-text); padding: 10px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 500; }
.copybox { display: flex; gap: 8px; }
.copybox input { font-family: var(--mono); font-size: 12.5px; }

/* toasts */
#toasts { position: fixed; z-index: 50; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 22px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in 260ms var(--ease-out); max-width: min(92vw, 420px); }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 180ms ease, transform 180ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, var(--fill), transparent, var(--fill)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; opacity: 0.6; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* small screens: bottom tab bar */
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 10; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); gap: 0;
  }
  .side .brand, .side .nav-label, .side .spacer, .side .me { display: none; }
  .side { background: color-mix(in srgb, var(--bg) 90%, transparent); }
  .side .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a, .nav button.navlink { flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; font-size: 10.5px; flex: 1; text-align: center; min-width: 0; border-radius: 10px; }
  .nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .pct { display: none; }
  main { padding: 28px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 30px; }
  .ready-head h2 { font-size: 22px; }
  .row { padding: 12px 14px; gap: 10px; }
  .row .code { width: 52px; }
  .owner-name { display: none; }
  .panel { width: 100%; }
}
@media (max-width: 480px) { .row .sub { display: none; } .ev { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .panel { transition: opacity 150ms ease; transform: none; opacity: 0; }
  .panel.open { opacity: 1; }
}

.legend .l-red::before { background: #ff3b30; }
.checkrow { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.checkrow input { width: 18px; height: 18px; accent-color: var(--blue); }
.heatwrap { display: flex; gap: 28px; align-items: center; padding: 22px; margin-bottom: 24px; flex-wrap: wrap; }
.heat-grid { display: grid; grid-template-columns: repeat(5, 40px); grid-auto-rows: 40px; gap: 3px; flex: none; }
.heat { border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 14px; font-weight: 700; color: var(--text); }
.heat.low { background: color-mix(in srgb, var(--green) 20%, transparent); }
.heat.progress { background: color-mix(in srgb, var(--blue) 20%, transparent); }
.heat.evidence { background: color-mix(in srgb, var(--orange) 30%, transparent); }
.heat.red { background: color-mix(in srgb, #ff3b30 28%, transparent); }
.heat.has { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text) 35%, transparent); }
.heat-key { flex: 1; min-width: 220px; }
.panel-body textarea.input { font-family: inherit; }

/* readiness score cards (one per certificate) */
.scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.score { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; transition: transform 160ms var(--ease-out), box-shadow 160ms ease; }
.score:active { transform: scale(0.985); }
.score.active { box-shadow: 0 0 0 2px var(--blue), var(--shadow); }
@media (hover: hover) and (pointer: fine) { .score:hover { background: var(--surface-2); } }
.score-name { font-size: 13px; font-weight: 600; color: var(--text-2); }
.score-pct { font-size: 24px; letter-spacing: -0.02em; font-weight: 500; }
.score-pct b { font-weight: 700; }
.score-sub { font-size: 13px; color: var(--text-2); }
.bar.compact { margin: 10px 0 8px; height: 8px; }

/* mobile: short tab bar plus a More sheet */
.more { display: none; }
.nav button.navlink { color: var(--text); }
@media (max-width: 820px) {
  .more {
    display: block; position: fixed; z-index: 16; left: 10px; right: 10px; bottom: calc(70px + env(safe-area-inset-bottom));
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden;
    transform: translateY(16px) scale(0.98); transform-origin: bottom right; opacity: 0; visibility: hidden;
    transition: transform 260ms var(--ease-drawer), opacity 200ms ease, visibility 0s linear 260ms;
  }
  body.more-open .more { transform: none; opacity: 1; visibility: visible; transition: transform 260ms var(--ease-drawer), opacity 200ms ease, visibility 0s; }
  .more .row { min-height: 54px; }
  .more .more-ic { width: 22px; height: 22px; stroke: var(--text-2); flex: none; }
  .nav a, .nav button.navlink { font-size: 11px; min-height: 48px; }
  .nav svg { width: 24px; height: 24px; }
  .scores { grid-template-columns: 1fr 1fr; gap: 10px; }
  .score { padding: 14px 14px 12px; }
  .score-pct { font-size: 20px; }
  .score-sub { font-size: 12px; }
}

/* new version banner: one small line, bottom center */
.update-banner {
  position: fixed; z-index: 60; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 4px 4px 4px 14px; border-radius: 20px; background: var(--glass); color: var(--text); font-size: 13px; font-weight: 500; line-height: 1;
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--line); max-width: calc(100vw - 24px);
  transform: translate(-50%, 16px) scale(0.96); opacity: 0; transition: transform 320ms var(--ease-drawer), opacity 220ms ease;
}
.update-banner[hidden] { display: none; }
.update-banner.show { transform: translate(-50%, 0); opacity: 1; }
.ub-btn { height: 26px; padding: 0 12px; border: 0; border-radius: 13px; background: var(--blue); color: #fff; font-weight: 600; font-size: 12.5px; transition: transform 160ms var(--ease-out); }
.ub-btn:active { transform: scale(0.96); }
.ub-x { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.ub-x svg { width: 12px; height: 12px; stroke: var(--text-2); }
body.has-update #toasts { bottom: calc(60px + env(safe-area-inset-bottom)); }
@media (max-width: 820px) {
  .update-banner { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.has-update #toasts { bottom: calc(120px + env(safe-area-inset-bottom)); }
}

/* step checklist */
.steps { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 14px; overflow: hidden; }
.step { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 12px 14px; border: 0; background: none; position: relative; transition: background-color 120ms ease; }
.step-wrap + .step-wrap { border-top: 1px solid var(--line); }
.step-proof-toggle { display: inline-flex; align-items: center; gap: 6px; margin: -4px 14px 10px 50px; padding: 4px 10px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--blue) 9%, transparent); color: var(--blue-text); font-size: 13px; }
.step-proof-toggle svg { width: 14px; height: 14px; stroke: currentColor; flex: none; }
.step-proof { display: flex; flex-direction: column; gap: 10px; margin: 0 14px 14px 14px; padding: 12px; border-radius: 12px; background: var(--surface); }
.step-proof[hidden] { display: none; }
.step + .step::before { content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 1px; background: var(--line); }
.step:disabled { cursor: default; }
.step:not(:disabled):active { background: var(--fill); }
.tick { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-2) 60%, transparent); display: grid; place-items: center; color: #fff; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.tick svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.6); transition: transform 200ms var(--ease-out), opacity 120ms ease; }
.step.done .tick { background: var(--blue); box-shadow: none; }
.step.done .tick svg { opacity: 1; transform: none; }
.step-text { font-size: 14.5px; line-height: 1.4; text-wrap: pretty; }
.step.done .step-text { color: var(--text-2); }
.hints { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.hint { display: flex; align-items: baseline; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--line); }
.hint:first-of-type { border-top: 0; }
.covers { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 14px; overflow: hidden; }
.cover { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: var(--text); font-size: 14.5px; text-decoration: none; position: relative; }
.cover + .cover::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
@media (hover: hover) and (pointer: fine) { .cover:hover { background: var(--fill); text-decoration: none; } }
.steps-mini { font-size: 12.5px; color: var(--text-2); min-width: 30px; text-align: right; }
.panel-body h2 { text-wrap: balance; }

/* date and time fields: iOS gives them an intrinsic width, so pin them to their container */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], input[type="week"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 38px; text-align: left; overflow: hidden;
}
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value, input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
input[type="date"]::-webkit-datetime-edit, input[type="time"]::-webkit-datetime-edit { padding: 0; }
.field, .form-row .field, .form > * { min-width: 0; }
.panel-body, .panel-body .form, .panel-body .field { max-width: 100%; }
@media (max-width: 820px) { .input, select.input, textarea.input { font-size: 16px; } } /* 16px stops iOS zooming the page on focus */

/* guided journey */
.journey { padding: 0; }
.j-bar { display: flex; gap: 4px; padding: 16px 20px 0; }
.j-seg { flex: 1; height: 8px; border: 0; padding: 0; border-radius: 4px; background: var(--fill); position: relative; transition: background-color 200ms ease, transform 160ms var(--ease-out); }
.j-seg::after { content: ""; position: absolute; inset: -10px -2px; }
.j-seg:active { transform: scaleY(1.4); }
.j-seg.done { background: var(--green); }
.j-seg.current { background: var(--blue); }
.j-seg.viewing { box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 18%, transparent); }
.j-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 12px; }
.j-kicker { font-size: 13px; color: var(--text-2); font-weight: 600; }
.j-body h2 { font-size: 26px; letter-spacing: -0.02em; }
.j-explain { font-size: 16px; line-height: 1.5; color: var(--text); text-wrap: pretty; max-width: 62ch; }
.j-progress { display: flex; align-items: center; gap: 12px; }
.j-items { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.j-items li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; text-wrap: pretty; }
.j-dot { flex: none; width: 20px; height: 20px; border-radius: 50%; margin-top: 1px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-2) 55%, transparent); position: relative; }
.j-items li.ok .j-dot { background: var(--green); box-shadow: none; }
.j-items li.ok .j-dot::after { content: ""; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.j-items li.ok { color: var(--text-2); }
.j-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.j-guide { font-size: 14px; margin-top: 2px; }
.goals { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 4px; }
.goals[hidden] { display: none; }
.goal-opt { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--surface-2); transition: transform 160ms var(--ease-out), box-shadow 160ms ease; }
.goal-opt:active { transform: scale(0.98); }
.goal-opt span { font-size: 13.5px; color: var(--text-2); }
.goal-opt.on { box-shadow: inset 0 0 0 2px var(--blue); }
@media (hover: hover) and (pointer: fine) { .goal-opt:hover { background: var(--fill); } }
.steps-plain { display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.plain-step { display: flex; gap: 14px; align-items: flex-start; }
.plain-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-text); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
@media (max-width: 820px) { .j-body h2 { font-size: 22px; } .j-body { padding: 16px 16px 20px; } .j-bar { padding: 14px 16px 0; } }

.howto { margin: 0 0 16px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 600; color: var(--blue-text); list-style: none; }
.howto summary::-webkit-details-marker { display: none; }
.howto ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); text-wrap: pretty; }

/* brand */
.brand { gap: 10px; }
.brand-mark { width: 26px !important; height: auto !important; border-radius: 0 !important; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-size: 17px; letter-spacing: -0.02em; font-weight: 700; }
.brand small { font-size: 11.5px; color: var(--text-2); font-weight: 500; letter-spacing: 0; }
.wordmark { height: 34px; width: auto; margin: 0 auto; display: block; }
.auth-card .wordmark { height: 40px; }
:root[data-theme="dark"] .brand-mark, :root[data-theme="dark"] .wordmark { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark, :root:not([data-theme="light"]) .wordmark { filter: invert(1); } }

/* decisions */
.decisions { display: flex; flex-direction: column; gap: 8px; background: color-mix(in srgb, var(--orange) 14%, transparent); border-radius: 14px; padding: 14px 16px; }
.decisions p { font-size: 14px; color: var(--text); text-wrap: pretty; }
.decisions .label { color: var(--orange-text); }
mark.open { background: color-mix(in srgb, var(--orange) 28%, transparent); color: inherit; border-radius: 4px; padding: 1px 4px; }

/* policy as a document */
.doc-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.doc { background: #fff; color: #1d1d1f; border-radius: 6px; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 56px); max-width: 820px; margin: 0 auto; }
.doc-head { margin-bottom: 28px; }
.doc-logo { margin: 0 0 14px; height: 30px; }
.doc .wordmark { filter: none !important; }
.doc-kicker { font-size: 11.5px; letter-spacing: 0.04em; color: #6e6e73; font-weight: 600; }
.doc h1 { font-size: 30px; margin-bottom: 4px; }
.doc-sub { color: #6e6e73; margin-bottom: 20px; }
.doc-meta { border-collapse: collapse; width: 100%; margin-bottom: 28px; font-size: 14px; }
.doc-meta th { text-align: left; font-weight: 600; color: #6e6e73; width: 160px; padding: 8px 12px 8px 0; border-top: 1px solid rgba(0,0,0,0.1); vertical-align: top; }
.doc-meta td { padding: 8px 0; border-top: 1px solid rgba(0,0,0,0.1); }
.doc-body h2 { font-size: 19px; margin: 26px 0 8px; letter-spacing: -0.01em; }
.doc-body h3 { font-size: 15.5px; margin: 18px 0 6px; font-weight: 650; color: #1d1d1f; }
.doc-body p { margin: 8px 0; line-height: 1.55; text-wrap: pretty; }
.doc-body ul { margin: 8px 0; padding-left: 22px; line-height: 1.5; }
.doc-body li { margin: 3px 0; }
.doc-table { overflow-x: auto; margin: 12px 0; }
.doc-table table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.doc-table th, .doc-table td { border: 1px solid rgba(0,0,0,0.12); padding: 6px 9px; text-align: left; vertical-align: top; }
.doc-table th { background: #f5f5f7; font-weight: 600; }
.doc-foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid rgba(0,0,0,0.12); font-size: 11.5px; color: #6e6e73; }
@media print {
  .side, .more, .scrim, .doc-bar, .notice, #toasts, #update-banner, .panel { display: none !important; }
  body { background: #fff; }
  .app { display: block; } main { padding: 0 !important; }
  .doc { box-shadow: none; max-width: none; padding: 0; }
  mark.open { background: none; border: 1px solid #999; }
}

/* iOS date inputs ignore width in odd ways: the wrapper clips them to the column no matter what */
.date-wrap { position: relative; width: 100%; max-width: 100%; min-width: 0; overflow: hidden; border-radius: 10px; background: var(--fill); transition: box-shadow 140ms ease, background-color 140ms ease; }
.date-wrap:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); background: var(--surface); }
.date-wrap input[type="date"].input { background: transparent; box-shadow: none; width: 100%; max-width: 100%; text-align: left; display: block; }
.date-wrap input[type="date"]::-webkit-calendar-picker-indicator { margin: 0 10px 0 4px; }

.toast { display: flex; align-items: center; gap: 14px; }
.toast-undo { border: 0; background: none; color: var(--bg); font-weight: 700; font-size: 14px; padding: 0; text-decoration: underline; text-underline-offset: 3px; opacity: 0.9; }
.row.archived { opacity: 0.6; }
.pill.archived { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
details.withdrawn { margin-top: 6px; font-size: 14px; }
details.withdrawn summary { cursor: pointer; color: var(--text-2); }

@media (max-width: 480px) { .row .sub.keep { display: block; } }
details.more-connect > summary { cursor: pointer; color: var(--blue-text); font-weight: 600; font-size: 14.5px; padding: 4px; margin-bottom: 12px; list-style: none; }
details.more-connect > summary::-webkit-details-marker { display: none; }

/* integration check breakdown */
.check { position: relative; }
.check + .check::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: 1px; background: var(--line); }
.check .row + .row::before { display: none; }
.check-detail { margin: -4px 16px 14px 16px; }
.check-detail > summary { cursor: pointer; color: var(--blue-text); font-size: 14px; font-weight: 600; list-style: none; padding: 2px 0 8px; }
.check-detail > summary::-webkit-details-marker { display: none; }
.findings { display: flex; flex-direction: column; background: var(--surface-2); border-radius: 12px; overflow: hidden; max-height: 320px; overflow-y: auto; }
.finding { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 9px 14px; font-size: 14px; position: relative; }
.finding + .finding::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--line); }
.finding a { font-weight: 600; overflow-wrap: anywhere; }
.finding .muted { font-size: 13px; white-space: nowrap; }
.fixbox { margin: 12px 0 0; }
.fixbox b { display: block; color: var(--text); margin-bottom: 2px; }

.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: 4px; text-align: left; border: 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; transition: transform 160ms var(--ease-out), background-color 160ms ease; }
.tile:active { transform: scale(0.985); }
@media (hover: hover) and (pointer: fine) { .tile:hover { background: var(--surface-2); } }
.tile-name { font-weight: 650; font-size: 15.5px; }
.tile-kind { font-size: 12px; color: var(--text-2); font-weight: 600; }
.tile-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.4; text-wrap: pretty; }

/* the question flow */
.q-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.q-card h2 { font-size: 24px; letter-spacing: -0.02em; text-wrap: balance; }
.q-progress { display: flex; align-items: center; gap: 12px; }
.q-body { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--surface-2); font-size: 15.5px; line-height: 1.35; font-weight: 500; transition: transform 160ms var(--ease-out), background-color 140ms ease, box-shadow 140ms ease; text-wrap: pretty; }
.opt:active { transform: scale(0.985); }
.opt.ghost { background: transparent; color: var(--blue-text); box-shadow: inset 0 0 0 1px var(--line); }
.opt.small { width: auto; padding: 9px 14px; font-size: 14.5px; border-radius: 12px; }
.opt[aria-pressed="true"] { background: color-mix(in srgb, var(--blue) 14%, transparent); box-shadow: inset 0 0 0 2px var(--blue); }
.opt-tick { flex: none; width: 20px; height: 20px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-2) 55%, transparent); position: relative; }
.opt[aria-pressed="true"] .opt-tick { background: var(--blue); box-shadow: none; }
.opt[aria-pressed="true"] .opt-tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@media (hover: hover) and (pointer: fine) { .opt:not([aria-pressed="true"]):hover { background: var(--fill); } }
.opt-group { display: flex; flex-wrap: wrap; gap: 8px; }
.q-other { display: flex; gap: 8px; }
.q-other .input { flex: 1; }
.q-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
details.answered { margin-top: 24px; max-width: 640px; }
details.answered > summary { cursor: pointer; color: var(--text-2); font-weight: 600; font-size: 14px; }
.actions-row { margin: 8px 0 24px; }

.q-facts { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); text-wrap: pretty; }
.q-facts b { color: var(--text); font-weight: 600; }
.q-link { align-self: flex-start; font-size: 14.5px; font-weight: 600; }

/* live view of a run */
.run-panel { padding: 14px 16px 12px; background: color-mix(in srgb, var(--blue) 6%, var(--surface)); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.run-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.run-bar { display: flex; gap: 3px; height: 6px; }
.rb { flex: 1; border-radius: 3px; background: var(--fill); position: relative; overflow: hidden; }
.rb::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(calc(var(--p, 0) / 100%)); background: var(--blue); transition: transform 500ms var(--ease-out); }
.rb.pass::after { background: var(--green); transform: none; } .rb.fail::after { background: #ff3b30; transform: none; } .rb.error::after { background: var(--orange); transform: none; }
.rb.indet::after { transform: none; width: 40%; animation: sweep 1.3s ease-in-out infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.run-list { display: flex; flex-direction: column; gap: 8px; }
.run-line { display: flex; gap: 10px; align-items: flex-start; }
.run-line.queued { opacity: 0.55; }
.run-t { font-size: 14px; font-weight: 600; }
.run-s { font-size: 13px; color: var(--text-2); text-wrap: pretty; overflow-wrap: anywhere; }
.run-ic { flex: none; width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; position: relative; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text-2) 45%, transparent); }
.run-ic.pass { background: var(--green); box-shadow: none; } .run-ic.fail { background: #ff3b30; box-shadow: none; } .run-ic.error { background: var(--orange); box-shadow: none; }
.run-ic.pass::after { content: ""; position: absolute; left: 6px; top: 3px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.run-ic.fail::after, .run-ic.error::after { content: "!"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.run-ic.running, .spin { box-shadow: none; border: 2px solid color-mix(in srgb, var(--blue) 25%, transparent); border-top-color: var(--blue); animation: spin 0.8s linear infinite; }
.spin { width: 18px; height: 18px; border-radius: 50%; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .run-ic.running, .spin, .rb.indet::after { animation: none; } .rb.indet::after { width: 100%; opacity: 0.4; } }
.run-line .grow { flex: 1; min-width: 0; }

/* long strings never push the page wider than the screen */
.code-chip { display: inline-block; max-width: 100%; overflow-x: auto; white-space: nowrap; vertical-align: bottom; font-family: var(--mono); font-size: 12.5px; background: var(--fill); color: var(--text); padding: 2px 8px; border-radius: 7px; cursor: copy; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.howto li, .howto p, .j-explain, .q-card p, .notice, .run-s, .doc-body p, .doc-body li, .row .sub, .panel-body p, .ev-item p { overflow-wrap: anywhere; }
main { overflow-x: clip; }
.howto, .howto ol { max-width: 100%; }

/* breakdown rows: the label keeps its width, a long note wraps under it instead of squeezing it */
.finding { flex-wrap: wrap; gap: 2px 12px; }
.finding > a, .finding > span:first-child { flex: 0 1 auto; max-width: 100%; overflow-wrap: anywhere; }
.finding .muted { white-space: normal; flex: 1 1 12ch; min-width: 0; text-align: right; overflow-wrap: break-word; }
@media (max-width: 560px) { .finding { flex-direction: column; gap: 1px; } .finding .muted { text-align: left; flex: none; } }

.doc-bar { flex-wrap: wrap; }
.doc-action { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 9%, var(--surface)); font-size: 14.5px; }
.doc-action span { flex: 1 1 220px; text-wrap: pretty; }

/* the visual editor (kit from the PRD tab) wears this app's colors */
.pe-host { position: relative; border-radius: 12px; background: var(--fill); min-width: 0; transition: box-shadow 140ms ease, background-color 140ms ease; }
.pe-host:focus-within { background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent); }
.pe {
  --label: var(--text); --label-2: var(--text-2); --label-3: color-mix(in srgb, var(--text-2) 55%, transparent);
  --fill-2: color-mix(in srgb, var(--fill) 70%, transparent); --separator: var(--line); --hairline: var(--line);
  --accent: var(--blue); --accent-tint: color-mix(in srgb, var(--blue) 14%, transparent);
  --bg: transparent; --chat-bg: var(--surface); --font-mono: var(--mono);
  --tap: 38px; --r-sm: 9px; --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 14px; --s-8: 24px; --t-fast: 150ms;
  --safe-top: 0px; --topbar-h: 0px; --pe-sticky-top: 0px;
  --pe-code-bg: var(--fill); --pe-quote: color-mix(in srgb, var(--blue) 50%, transparent); --pe-done: var(--green-text);
  font-family: var(--font); font-size: 15px;
}
.pe .pe-bar { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 12px 12px 0 0; }
.pe .pe-surface { min-height: var(--pe-min, 200px); }
.pe-host.tall { --pe-min: 340px; }
.pe-host.short { --pe-min: 96px; }

.vendor-help { margin-bottom: 22px; display: flex; flex-direction: column; gap: 10px; }
.vendor-help h2 { font-size: 21px; }
.scan p { font-size: 14px; text-wrap: pretty; margin: 0 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* register rows: the badges drop under the name on narrow screens so names stay readable */
@media (max-width: 640px) { .row.reg-row { flex-wrap: wrap; } .row.reg-row .grow { flex: 1 1 100%; } .row.reg-row .meta { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; } }
@media (max-width: 480px) { .row.reg-row .sub { display: block; white-space: normal; } }

.interview-card { background: color-mix(in srgb, var(--blue) 8%, var(--surface-2)); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.interview-card.done { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-text); font-size: 14px; }
.iv-q { font-size: 17px; font-weight: 650; color: var(--text); letter-spacing: -0.01em; }
.interview-card .q-body { margin-top: 2px; }

/* dashboard rows: what, how far (a thin bar), and the state in words */
.stat-row { gap: 12px; flex-wrap: wrap; }
.stat-bar { display: flex; gap: 2px; width: 120px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--fill); flex: none; }
.stat-bar i { display: block; height: 100%; }
.dash-next { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
@media (max-width: 640px) { .stat-row .grow { flex: 1 1 100%; } .stat-bar { flex: 1 1 auto; width: auto; min-width: 80px; } }

.edit-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }

/* every accordion starts closed, and the arrow says it opens */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 9px 2px 1px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 160ms var(--ease-out); opacity: 0.7; }
details[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { details > summary::before { transition: none; } }

.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.add-doc { background: var(--surface-2); border-radius: 14px; padding: 14px; }

/* a control as a task: proof sits inside it */
.composer { display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: 14px; padding: 14px; }
.hint-chip { text-align: left; border: 0; background: color-mix(in srgb, var(--blue) 9%, transparent); color: var(--blue-text); border-radius: 12px; padding: 7px 12px; font-size: 13.5px; line-height: 1.35; transition: transform 160ms var(--ease-out); }
.hint-chip:active { transform: scale(0.98); }
.hints { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.suggest { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--text-2); background: color-mix(in srgb, var(--blue) 7%, transparent); border-radius: 10px; padding: 8px 12px; }
.suggest b { color: var(--text); }
.cdetails > summary { color: var(--text-2); font-weight: 600; font-size: 14px; padding: 6px 0; }

.your-work { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.your-work h2 { font-size: 24px; letter-spacing: -0.02em; margin: 2px 0 6px; }
.next-task { display: block; color: var(--text); font-size: 14.5px; text-wrap: pretty; text-decoration: none; }
.next-task:hover { text-decoration: underline; }
.dash-details > summary { font-weight: 600; font-size: 15px; color: var(--text); padding: 6px 4px; }
.composer .seg { align-self: stretch !important; }
.composer .seg button { flex: 1; padding-inline: 6px; font-size: 13px; white-space: nowrap; }

/* ---- tasks ---- */
.tasks-bar select.input { width: auto; min-width: 150px; max-width: 100%; height: 36px; padding-top: 0; padding-bottom: 0; }
.tasks-bar .grow { flex: 1; }
.task-row { cursor: pointer; transition: background-color 120ms var(--ease-out); }
.task-row:active { background: var(--fill); }
.task-row:focus-visible, .tcard:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.row .sub.bad, .tcard .sub.bad { color: var(--red-text); }
.tcheck { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--text-3, #aeaeb2); background: none; display: grid; place-items: center; color: #fff; padding: 0; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 160ms var(--ease-out); }
.tcheck svg { width: 14px; height: 14px; opacity: 0; transform: scale(0.7); transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out); }
.tcheck:active { transform: scale(0.9); }
.tcheck.on { background: var(--blue); border-color: var(--blue); }
.tcheck.on svg { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .tcheck:not(.on):hover { border-color: var(--blue); } .tcheck:not(.on):hover svg { opacity: 0.35; color: var(--blue); transform: none; } }
.task-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.guide-strip { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 20px; border-radius: 14px; background: color-mix(in srgb, var(--blue) 9%, transparent); color: var(--blue-text); text-decoration: none; font-size: 14.5px; }
.task-meta { font-size: 13.5px; margin-top: 4px; }
.task-body { white-space: pre-line; color: var(--text); font-size: 14.5px; line-height: 1.5; text-wrap: pretty; overflow-wrap: anywhere; }
.status-seg { align-self: stretch; }
.status-seg button { flex: 1; padding-inline: 6px; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.bcol { background: var(--surface-2); border-radius: 14px; padding: 10px; min-height: 160px; transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
.bcol.over { background: color-mix(in srgb, var(--blue) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1.5px var(--blue); }
.bcol-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px 10px; font-size: 13.5px; }
.bcol-body { display: flex; flex-direction: column; gap: 8px; }
.bcol-empty { color: var(--text-2); font-size: 13px; text-align: center; padding: 18px 0; }
.tcard { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); cursor: pointer; transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), opacity 160ms var(--ease-out); }
.tcard:active { transform: scale(0.985); }
.tcard.drag { opacity: 0.5; }
.tcard .title { font-weight: 500; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.tcard .sub { font-size: 12.5px; color: var(--text-2); }
.tcard .pill { font-size: 11.5px; }
.tcard.selected, .tcard[data-id].selected { box-shadow: 0 0 0 2px var(--blue); }
@media (prefers-reduced-motion: reduce) { .tcheck, .tcheck svg, .tcard, .bcol { transition: none; } }
@media (max-width: 720px) { .tasks-bar select.input { flex: 1 1 100%; } .tasks-bar .seg { flex: 1 1 100%; } .tasks-bar .seg button { flex: 1; } }
.person-row { flex-wrap: nowrap; }
@media (max-width: 640px) { .person-row .grow { flex: 1 1 0; } .person-row .pill { align-self: flex-start; margin-top: 2px; } }
@media (max-width: 480px) { .person-row .sub, .task-row .sub, .stat-row .sub { display: block; } }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.handout-row { gap: 8px 10px; padding: 12px; flex-wrap: wrap; align-items: flex-start; }
.handout-row .tcheck { width: 20px; height: 20px; margin-top: 1px; }
.handout-row .tcheck svg { width: 12px; height: 12px; }
.handout-row .grow { flex: 1 1 calc(100% - 34px); min-width: 0; }
select.handout { flex: 1 1 100%; width: calc(100% - 30px); margin-left: 30px; height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13.5px; }
.role-row { align-items: flex-start; }
.role-row .input { margin-top: 6px; height: 34px; }
.resp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resp-chip { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--fill); color: var(--text); font-size: 13px; font-weight: 500; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 160ms var(--ease-out); }
.resp-chip:active { transform: scale(0.97); }
.resp-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue-text); font-weight: 600; }
@media (max-width: 480px) { .role-row .sub { display: block; } }
.policy-embed { max-height: 340px; overflow-y: auto; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-size: 14px; overscroll-behavior: contain; }
.policy-embed h1 { font-size: 18px; } .policy-embed h2 { font-size: 16px; } .policy-embed h3 { font-size: 15px; }
.finding-row { padding: 8px 12px; min-height: 0; }
.embed-guided { padding: 14px; border-radius: 14px; background: var(--surface-2); }
.ctx .q-facts { font-size: 14px; }
.owner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) { .row .sub.keep { display: block; } .owner-actions { flex: 1 1 100%; } }
