/* Material Design 3 styling, hand-written to keep the app dependency-free.
   Tokens follow M3 naming; --md-primary is overridden by the questionnaire accent. */

/* The same two Inter files are used for the UI and embedded in the PDF. */
@font-face {
  font-family: 'Inter';
  src: url('../../fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 100 450;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../../fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 451 900;
  font-display: swap;
}

:root {
  --md-surface: #fbf9fd;
  --md-surface-container-lowest: #ffffff;
  --md-surface-container-low: #f5f3f8;
  --md-surface-container: #efedf2;
  --md-surface-container-high: #e9e7ec;
  --md-on-surface: #1b1b1f;
  --md-on-surface-variant: #46464f;
  --md-outline: #777680;
  --md-outline-variant: #c7c5d0;
  --md-inverse-surface: #303034;
  --md-inverse-on-surface: #f3eff4;
  --md-error: #ba1a1a;
  --md-error-container: #ffdad6;
  --md-on-error-container: #410002;
  --md-scrim: rgb(0 0 0 / 0.32);
  --md-shadow-1: 0 1px 2px rgb(0 0 0 / 0.3), 0 1px 3px 1px rgb(0 0 0 / 0.15);
  --md-shadow-2: 0 1px 2px rgb(0 0 0 / 0.3), 0 2px 6px 2px rgb(0 0 0 / 0.15);
  --md-shadow-3: 0 4px 8px 3px rgb(0 0 0 / 0.15), 0 1px 3px rgb(0 0 0 / 0.3);
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 28px;
  --font: 'Inter', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

/* Primary-derived tokens live on .app so they follow the questionnaire accent. */
.app {
  --md-primary: var(--accent, #4355b9);
  --md-on-primary: #ffffff;
  --md-primary-container: color-mix(in srgb, var(--md-primary) 14%, #ffffff);
  --md-on-primary-container: color-mix(in srgb, var(--md-primary) 70%, #000000);
  --md-secondary-container: color-mix(in srgb, var(--md-primary) 10%, #f1f1f6);
  --md-on-secondary-container: #1b1b21;
  --md-inverse-primary: color-mix(in srgb, var(--md-primary) 45%, #ffffff);
}

@media (prefers-color-scheme: dark) {
  :root {
    --md-surface: #131316;
    --md-surface-container-lowest: #0e0e11;
    --md-surface-container-low: #1b1b1f;
    --md-surface-container: #1f1f23;
    --md-surface-container-high: #2a2a2d;
    --md-on-surface: #e4e1e6;
    --md-on-surface-variant: #c7c5d0;
    --md-outline: #91909a;
    --md-outline-variant: #46464f;
    --md-inverse-surface: #e4e1e6;
    --md-inverse-on-surface: #303034;
    --md-error: #ffb4ab;
    --md-error-container: #93000a;
    --md-on-error-container: #ffdad6;
    color-scheme: dark;
  }
  .app {
    --md-primary: var(--accent-dark, #b9c3ff);
    --md-on-primary: #10131f;
    --md-primary-container: color-mix(in srgb, var(--md-primary) 35%, #121218);
    --md-on-primary-container: #eceefe;
    --md-secondary-container: color-mix(in srgb, var(--md-primary) 20%, #2a2a31);
    --md-on-secondary-container: #e4e1e9;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.01em;
  color: var(--md-on-surface);
  background: var(--md-surface);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Typography ---- */
.title-large { font-size: 22px; line-height: 28px; font-weight: 500; letter-spacing: 0; margin: 0; }
.title-medium { font-size: 16px; line-height: 24px; font-weight: 600; margin: 0; }
.title-small { font-size: 14px; line-height: 20px; font-weight: 600; margin: 0; }
.label-medium { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; }
.body-small { font-size: 12px; line-height: 16px; color: var(--md-on-surface-variant); }
.muted { color: var(--md-on-surface-variant); }

/* ---- Layout ---- */
.app { min-height: 100%; display: flex; flex-direction: column; }
.top-app-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  min-height: 64px; padding: 8px 8px 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: var(--md-surface);
  transition: background 0.2s, box-shadow 0.2s;
}
.top-app-bar.scrolled { background: var(--md-surface-container); }
.top-app-bar .brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.top-app-bar .brand img { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.top-app-bar .brand .title-large { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-app-bar .brand .body-small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-actions { display: flex; align-items: center; gap: 4px; }

main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 16px 16px 120px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.spacer { flex: 1; }

/* ---- Buttons ---- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 24px; border-radius: 20px; border: 0; cursor: pointer;
  font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; overflow: hidden;
  background: transparent; color: var(--md-primary);
}
.btn::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity 0.15s; }
.btn:hover::before { opacity: 0.08; }
.btn:active::before { opacity: 0.12; }
.btn:disabled { opacity: 0.38; cursor: default; }
.btn:disabled::before { opacity: 0; }
.btn .icon { width: 18px; height: 18px; margin-left: -8px; }
.btn.filled { background: var(--md-primary); color: var(--md-on-primary); }
.btn.filled:hover { box-shadow: var(--md-shadow-1); }
.btn.tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn.outlined { border: 1px solid var(--md-outline); }
.btn.text { padding: 0 12px; }
.btn.text .icon { margin-left: -4px; }
.btn.danger { color: var(--md-error); }

.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 20px; border: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: transparent; color: var(--md-on-surface-variant); cursor: pointer; overflow: hidden;
}
.icon-btn::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0; }
.icon-btn:hover::before { opacity: 0.08; }
.icon-btn:active::before { opacity: 0.12; }
.icon-btn:disabled { opacity: 0.38; cursor: default; }
.icon-btn:disabled::before { opacity: 0; }
.icon-btn.small { width: 36px; height: 36px; }
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }
.icon-btn.small .icon { width: 20px; height: 20px; }

.fab {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 8;
  height: 56px; padding: 0 20px 0 16px; border-radius: 16px; box-shadow: var(--md-shadow-3);
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.fab .icon { width: 24px; height: 24px; margin-left: 0; }

/* ---- Cards ---- */
.card {
  background: var(--md-surface-container-low); border-radius: var(--radius-m);
  padding: 20px; border: 1px solid transparent;
}
.card.outlined { background: var(--md-surface); border-color: var(--md-outline-variant); }
.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.card-header .title-medium { flex: 1; min-width: 0; }

.section-card { position: relative; overflow: hidden; padding-left: 24px; }
.section-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--section-accent);
}
.section-eyebrow { color: var(--section-accent); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- Text fields (M3 outlined, label always floated) ---- */
.field { position: relative; display: flex; flex-direction: column; min-width: 0; }
.field > label {
  position: absolute; top: -8px; left: 12px; padding: 0 4px; z-index: 1;
  font-size: 12px; line-height: 16px; color: var(--md-on-surface-variant);
  background: var(--field-bg, var(--md-surface-container-low)); border-radius: 2px;
  max-width: calc(100% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 4px;
  border: 1px solid var(--md-outline); background: transparent; outline: none;
}
.field textarea { resize: vertical; line-height: 20px; }
.field select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777680'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 24px; }
.field select option { background: var(--md-surface-container-high); color: var(--md-on-surface); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--md-on-surface); }
.field input:focus, .field select:focus, .field textarea:focus { border: 2px solid var(--md-primary); padding: 11px 15px; }
.field:focus-within > label { color: var(--md-primary); }
.field .supporting { font-size: 12px; line-height: 16px; padding: 4px 16px 0; color: var(--md-on-surface-variant); }
.field.error input, .field.error select, .field.error textarea { border-color: var(--md-error); }
.field.error > label, .field.error .supporting { color: var(--md-error); }
.field.mono textarea { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px; line-height: 18px; }
.field.compact input, .field.compact select { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.field.compact input:focus, .field.compact select:focus { padding-top: 7px; padding-bottom: 7px; }

/* ---- Switch (M3) ---- */
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; width: 52px; height: 32px; border-radius: 16px; flex: none;
  background: var(--md-surface-container-high); border: 2px solid var(--md-outline); transition: background 0.15s, border-color 0.15s;
}
.switch .thumb {
  position: absolute; top: 50%; left: 6px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--md-outline); transform: translateY(-50%); transition: all 0.15s;
}
.switch input:checked + .track { background: var(--md-primary); border-color: var(--md-primary); }
.switch input:checked + .track .thumb { left: 22px; width: 24px; height: 24px; background: var(--md-on-primary); }
.switch input:focus-visible + .track { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* ---- Chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--md-outline-variant); background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--md-on-surface-variant); overflow: hidden;
}
.chip::before { content: ''; position: absolute; inset: 0; background: currentColor; opacity: 0; }
.chip:hover::before { opacity: 0.08; }
.chip[aria-pressed='true'] { background: var(--md-secondary-container); border-color: transparent; color: var(--md-on-secondary-container); }
.chip .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--dot); flex: none; }
.assist-chip { height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px; background: var(--md-surface-container-high); color: var(--md-on-surface-variant); white-space: nowrap; }
.assist-chip.primary { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.assist-chip .icon { width: 14px; height: 14px; }

.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-row { display: flex; gap: 8px; align-items: center; }
.option-row .field { flex: 1; }
.option-row .field.value { flex: 0 1 34%; }

.condition { border-radius: var(--radius-s); background: color-mix(in srgb, var(--md-primary) 6%, transparent); padding: 12px; --field-bg: var(--md-surface-container-lowest); }
.condition .rule { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; margin-top: 12px; }
.condition .rule .field select, .condition .rule .field input { background-color: var(--md-surface-container-lowest); }
@media (max-width: 600px) {
  .condition .rule { grid-template-columns: 1fr auto; }
  .condition .rule .field:nth-child(1) { grid-column: 1 / -1; }
}

.divider { height: 1px; background: var(--md-outline-variant); margin: 4px 0; border: 0; }

/* ---- Banners ---- */
.banner { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius-m); }
.banner.error { background: var(--md-error-container); color: var(--md-on-error-container); }
.banner.info { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.banner code { font-size: 12px; opacity: 0.8; }

.hidden-note { font-size: 12px; color: var(--md-on-surface-variant); display: flex; gap: 6px; align-items: center; }
@keyframes appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---- Dialog, menu, snackbar ---- */
dialog.dialog {
  border: 0; padding: 24px; border-radius: var(--radius-xl); max-width: min(560px, calc(100vw - 32px));
  background: var(--md-surface-container-high); color: var(--md-on-surface); box-shadow: var(--md-shadow-3);
}
dialog.dialog::backdrop { background: var(--md-scrim); }
dialog.dialog h2 { margin: 0 0 16px; font-size: 24px; line-height: 32px; font-weight: 400; }
dialog.dialog .dialog-body { color: var(--md-on-surface-variant); max-height: 50vh; overflow: auto; }
dialog.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

.menu-anchor { position: relative; }
.menu {
  position: absolute; right: 0; top: 44px; z-index: 20; min-width: 220px; padding: 8px 0;
  background: var(--md-surface-container); border-radius: 4px; box-shadow: var(--md-shadow-2);
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 16px; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--md-on-surface);
}
.menu button:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.menu .icon { color: var(--md-on-surface-variant); }
.menu hr { border: 0; height: 1px; background: var(--md-outline-variant); margin: 8px 0; }

.snackbar {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px 4px 16px; max-width: calc(100vw - 32px);
  background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); border-radius: 4px; box-shadow: var(--md-shadow-3);
  animation: appear 0.2s ease-out;
}
.snackbar .btn { color: var(--md-inverse-primary); padding: 0 12px; }

/* ---- Responsive ---- */
.hide-sm { display: inline-flex; }
@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  main { padding: 12px 12px 120px; }
  .card { padding: 16px; }
  .section-card { padding-left: 20px; }
}
@media (min-width: 721px) { .show-sm { display: none !important; } }

/* ================= Brief Builder screens ================= */
.page { width: 100%; max-width: 880px; margin: 0 auto; padding: 16px 16px 120px; }
.block { display: block; }
.left { text-align: left; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-app-bar .brand { color: inherit; text-decoration: none; }
.page-head { justify-content: space-between; }
.plain-list { margin: 8px 0; padding-left: 20px; }
.error-text { color: var(--md-error); }
.subtle-flag { opacity: 0.85; }

/* banners */
.banner { align-items: flex-start; }
.banner > .icon { margin-top: 1px; }
.banner.ok { background: color-mix(in srgb, #1e8e3e 14%, var(--md-surface)); color: var(--md-on-surface); }
.banner.warn { background: color-mix(in srgb, #f9ab00 18%, var(--md-surface)); color: var(--md-on-surface); }
.banner.sticky { position: sticky; top: 64px; z-index: 9; align-items: center; }
.banner.local-warning { font-size: 13px; line-height: 18px; }
.update-banner { margin: 0 16px; align-items: center; }
.assist-chip.warn { background: color-mix(in srgb, #f9ab00 25%, var(--md-surface)); color: var(--md-on-surface); }

.empty-card { text-align: center; padding: 32px 16px; border-radius: var(--radius-m); background: var(--md-surface-container-low); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-card .icon { width: 40px; height: 40px; color: var(--md-primary); }
.empty-card p { margin: 0; max-width: 460px; }

/* briefs list */
.brief-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.brief-card { display: flex; align-items: flex-start; gap: 4px; background: var(--md-surface-container-low); border-radius: var(--radius-m); padding: 4px 4px 4px 0; position: relative; }
.brief-card.broken, .brief-card.cannot-open, .brief-card.future { outline: 1px solid var(--md-error); }
.brief-main { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 14px 16px; cursor: pointer; color: inherit; border-radius: var(--radius-m); }
.brief-main:hover { background: color-mix(in srgb, var(--md-on-surface) 5%, transparent); }
.brief-card .body-small { margin-top: 2px; }
.brief-card .status-note { color: var(--md-error); }
.brief-card .menu-anchor { margin-top: 8px; margin-right: 4px; }
.backup-card { margin-top: 8px; }

/* workspace */
.workspace { display: flex; flex-direction: column; flex: 1; }
.workspace-head { display: flex; align-items: center; gap: 4px; padding: 0 8px 8px; max-width: 880px; width: 100%; margin: 0 auto; }
.save-status { font-size: 12px; color: var(--md-on-surface-variant); }
.save-status.error, .save-status.conflict { color: var(--md-error); font-weight: 600; }
.stepper { display: flex; gap: 4px; max-width: 880px; width: 100%; margin: 0 auto; padding: 0 12px; position: sticky; top: 64px; z-index: 9; background: var(--md-surface); border-bottom: 1px solid var(--md-outline-variant); }
.step { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 4px; border: 0; background: none; cursor: pointer; color: var(--md-on-surface-variant); font-weight: 500; font-size: 13px; position: relative; }
.step-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--md-surface-container-high); flex: none; }
.step.done .step-num { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.step[aria-current='step'] { color: var(--md-primary); }
.step[aria-current='step'] .step-num { background: var(--md-primary); color: var(--md-on-primary); }
.step[aria-current='step']::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--md-primary); }
@media (max-width: 520px) { .step { flex-direction: column; gap: 2px; padding: 6px 0; font-size: 11px; min-height: 54px; } }
.step-footer { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; }

/* sections step */
.section-card { padding: 0 16px 0 22px; }
.section-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; background: none; cursor: pointer; color: inherit; text-align: left; }
.section-number { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--section-accent) 16%, transparent); color: var(--section-accent); flex: none; }
.section-head .meta, .question-main .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.section-body { padding: 0 0 16px; --field-bg: var(--md-surface-container-low); }
.question-list { display: flex; flex-direction: column; gap: 8px; }
.question-row { display: flex; align-items: center; background: var(--md-surface-container-lowest); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-s); }
.question-row.focus { outline: 2px solid var(--md-primary); }
.question-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 12px; border: 0; background: none; cursor: pointer; color: inherit; text-align: left; min-height: 56px; }
.question-main .label { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.type-icon { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: color-mix(in srgb, var(--section-accent) 12%, transparent); color: var(--section-accent); }
.type-icon .icon { width: 20px; height: 20px; }

/* bottom sheet */
dialog.sheet { border: 0; padding: 0; background: var(--md-surface-container-low); color: var(--md-on-surface); box-shadow: var(--md-shadow-3); width: min(640px, 100vw); max-width: 100vw; max-height: min(92vh, 900px); margin: auto; border-radius: var(--radius-xl); overflow: hidden; }
dialog.sheet::backdrop { background: var(--md-scrim); }
.sheet-inner { display: flex; flex-direction: column; max-height: min(92vh, 900px); }
.sheet-header { display: flex; align-items: center; gap: 8px; padding: 16px 8px 8px 20px; }
.sheet-header h2 { flex: 1; }
.sheet-body { padding: 8px 20px 20px; overflow-y: auto; flex: 1; --field-bg: var(--md-surface-container-low); }
.sheet-footer, .sheet-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
.sheet-footer { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--md-outline-variant); background: var(--md-surface-container-low); }
@media (max-width: 720px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}
.template-list { display: flex; flex-direction: column; gap: 8px; }
.template { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--md-outline-variant); border-radius: var(--radius-m); background: var(--md-surface-container-lowest); cursor: pointer; color: inherit; text-align: left; }
.template:hover { background: var(--md-surface-container); }
.template-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--tint) 16%, transparent); color: var(--tint); }
.template > .icon { color: var(--md-on-surface-variant); }

/* dialogs and lists */
.radio-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.radio { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; color: var(--md-on-surface); }
.radio input { margin-top: 4px; accent-color: var(--md-primary); }
.check-row { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 16px; cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--md-primary); flex: none; }
.summary-list, .restore-list, .overview-list, .issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.summary-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--md-outline-variant); }
.summary-list li:first-child { border-top: 0; }
.summary-list li.out { color: var(--md-on-surface-variant); text-decoration: line-through; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); }
.summary-list li.out .body-small { text-decoration: none; }
.summary-list li.in .icon { color: #1e8e3e; }
.restore-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); background: var(--md-surface-container-lowest); }
.restore-list li.ready .icon { color: #1e8e3e; }
.restore-list li.skipped .icon { color: var(--md-error); }
.issue { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-s); background: var(--md-surface-container-lowest); }
.issue.error .icon { color: var(--md-error); }
.issue.warn .icon { color: #b06d00; }
.overview .row { align-items: center; }
.overview-list { margin-top: 8px; padding-left: 40px; gap: 4px; }
.overview-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.scenario-q { display: flex; flex-direction: column; gap: 8px; }
.section-card { overflow: visible; }
.section-card::before { border-radius: var(--radius-m) 0 0 var(--radius-m); }
.app.in-brief .top-app-bar { display: none; }
.app.in-brief .workspace-head { position: sticky; top: 0; z-index: 11; background: var(--md-surface); padding-top: max(8px, env(safe-area-inset-top)); min-height: 60px; box-sizing: border-box; }
.app.in-brief .stepper { top: calc(60px + env(safe-area-inset-top)); }
.app.in-brief .banner.sticky { top: calc(108px + env(safe-area-inset-top)); }
.workspace-head, .stepper { --hw: 880px; }

/* Understated "show more" link at the end of the section picker */
.link-button.show-all {
  display: block; margin: 12px auto 0; padding: 8px 12px; background: none; border: 0;
  font: inherit; font-size: 0.8125rem; color: var(--md-on-surface-variant, #49454f);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px;
}
.link-button.show-all:hover { color: var(--md-on-surface, #1d1b20); }
