/* Lightsmith design system: tokens from lightsmith-energy/design-system (core/tokens.json).
   Change colours, type and spacing there first, then mirror them here. */
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cabinet Grotesk"; src: url("fonts/cabinet-grotesk-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/switzer-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f9f8f6;
  --surface: #fdfdfc;
  --surface-warm: rgba(0, 0, 0, 0.05);
  --surface-input: #ffffff;
  --fg: #1a1f23;
  --muted: #58616a;
  --border: #e0dcd7;
  --border-soft: rgba(0, 0, 0, 0.05);
  --accent: #2085d5;
  --accent-on: #ffffff;
  --accent-ink: #0577b2;
  --accent-cta: #0577b2;
  --accent-cta-hover: #0c73ae;
  --success: #10b981;
  --success-text: #087f5b;
  --warn: #ffc247;
  --warn-text: var(--fg);
  --danger: #dc2626;
  --danger-on: #ffffff;
  --focus: #3b82f6;
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 9px;
  --radius-2xl: 16px;
  --radius-full: 9999px;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --leading-body: 1.55;
  --leading-tight: 1.15;
  --tracking-display: -0.02em;

  /* Type adjustments for this app. It is a long, text-heavy form, and the
     design system's dashboard weights and tracking read as dense here, so
     headings and emphasis sit one step lighter and text is set a little looser.
     To go back to the stock design-system type, delete this block's overrides:
     set the weights to 700 / 600 / 700 / 600, tracking to 0, and leading to the
     two tokens above. */
  --weight-display: 500;
  --weight-heading: 500;
  --weight-strong: 600;
  --weight-label: 500;
  --tracking-text: 0.012em;
  --tracking-heading: 0;
  --leading-text: 1.65;
  --leading-heading: 1.25;
  --container-max: 1120px;
  --font-display: 'Cabinet Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Switzer', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* Tints derived from the tokens above. */
  --accent-tint: color-mix(in srgb, var(--accent) 10%, transparent);
  --success-tint: color-mix(in srgb, var(--success) 12%, transparent);
  --warn-tint: color-mix(in srgb, var(--warn) 22%, transparent);
  --danger-tint: color-mix(in srgb, var(--danger) 8%, transparent);
  /* A dashed outline needs more contrast than a solid one to read as a line, but less than text. */
  --border-dashed: color-mix(in srgb, var(--muted) 45%, var(--border));
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2358616a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light dark;
}

/* Night ops. Follows the device setting; data-theme on <html> overrides it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1215;
    --surface: #151a1e;
    --surface-warm: rgba(255, 255, 255, 0.05);
    --surface-input: #151a1e;
    --fg: #edece8;
    --muted: #959ea7;
    --border: #282e33;
    --border-soft: rgba(255, 255, 255, 0.05);
    --accent: #4aa8dc;
    --accent-ink: var(--accent);
    --success-text: #34d399;
    --warn-text: var(--warn);
    --danger: #f87171;
    --danger-on: #0f1215;
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23959ea7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
[data-theme="dark"] {
  --bg: #0f1215;
  --surface: #151a1e;
  --surface-warm: rgba(255, 255, 255, 0.05);
  --surface-input: #151a1e;
  --fg: #edece8;
  --muted: #959ea7;
  --border: #282e33;
  --border-soft: rgba(255, 255, 255, 0.05);
  --accent: #4aa8dc;
  --accent-ink: var(--accent);
  --success-text: #34d399;
  --warn-text: var(--warn);
  --danger: #f87171;
  --danger-on: #0f1215;
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23959ea7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-text); letter-spacing: var(--tracking-text); color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
strong, b { font-weight: var(--weight-strong); }
h1, h2 { font-family: var(--font-display); font-weight: var(--weight-display); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); }
h1 { font-size: var(--text-2xl); margin: 0 0 var(--space-3); }
h2 { font-size: var(--text-xl); margin: 0 0 var(--space-3); }
h3 { font-size: var(--text-lg); font-weight: var(--weight-heading); line-height: 1.45; margin: 0; }
p { margin: 0 0 var(--space-4); }
a { color: var(--accent-ink); }
a:hover { color: var(--accent-cta-hover); }
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: var(--space-2); background: var(--surface); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); z-index: 20; }
.skip:focus { left: var(--space-2); }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); line-height: 1.5; }
.lead { font-size: var(--text-lg); line-height: 1.6; color: var(--muted); max-width: 62ch; }
.pad { padding: var(--space-8) var(--space-4); }
.noscript { padding: var(--space-8); text-align: center; }

/* ----- header ----- */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-5); background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: var(--space-3); color: var(--fg); text-decoration: none; }
.brand:hover { color: var(--fg); }
.brand-mark { height: 30px; width: auto; flex: none; }
.ls-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ls-logo-light { display: none; }
  :root:not([data-theme="light"]) .ls-logo-dark { display: block; }
}
[data-theme="dark"] .ls-logo-light { display: none; }
[data-theme="dark"] .ls-logo-dark { display: block; }
.brand strong { display: block; font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-lg); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); }
.brand-sub { display: block; font-size: var(--text-xs); font-weight: 400; line-height: 1.4; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: var(--space-4); font-size: var(--text-sm); }
.top-nav a { text-decoration: none; font-weight: var(--weight-label); color: var(--fg); }
.top-nav a:hover { color: var(--accent-ink); }
.who { color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- page shells ----- */
main { padding: var(--space-6) var(--space-5) var(--space-12); }
main.centered { display: grid; place-items: start center; padding-top: 8vh; }
.page { max-width: var(--container-max); margin: 0 auto; }
.narrow-page { max-width: 760px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.page-head h1, .page-head h2 { margin: 0; }
.site-heading { font-size: var(--text-xl); letter-spacing: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); margin-bottom: var(--space-5); }
.card.narrow { width: 100%; max-width: 440px; padding: var(--space-8); }
.card.narrow .btn { margin-bottom: var(--space-4); }
.steps-list li { margin-bottom: var(--space-3); padding-left: var(--space-1); }
.plain-list { color: var(--muted); }
.plain-list li { margin-bottom: var(--space-1); }
.card > h3 { margin: var(--space-6) 0 var(--space-2); }

/* ----- buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font: inherit; font-size: var(--text-sm); font-weight: var(--weight-label); letter-spacing: var(--tracking-text); padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.4; min-height: 44px; }
.btn.primary { background: var(--accent-cta); color: var(--accent-on); }
.btn.primary:hover { background: var(--accent-cta-hover); color: var(--accent-on); }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--border); }
.btn.ghost:hover { background-image: linear-gradient(var(--surface-warm), var(--surface-warm)); color: var(--fg); }
.btn.danger { background: var(--danger); color: var(--danger-on); }
.btn.small { padding: var(--space-1) var(--space-3); min-height: 36px; }
.btn.big { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn.wide { width: 100%; }
.btn:disabled, .link:disabled { opacity: 0.55; cursor: not-allowed; }
@media (pointer: coarse) { .btn.small { min-height: 44px; } }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--accent-cta-hover); }
.danger-link, .danger-link:hover { color: var(--danger); }

/* ----- form controls: only the control carries a border ----- */
label, legend { font-weight: var(--weight-label); font-size: var(--text-sm); line-height: 1.45; }
legend { padding: 0; margin-bottom: var(--space-2); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  font: inherit; color: var(--fg); background: var(--surface-input); width: 100%; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); min-height: 44px;
}
/* Single-line controls share one height, so a date, a dropdown and a text box line up in a row. */
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select { height: 44px; line-height: 1.4; }
/* Dropdowns drop the browser's own look and take the same box as the other inputs, with our arrow. */
select { appearance: none; -webkit-appearance: none; padding-right: var(--space-8); background-image: var(--chevron); background-repeat: no-repeat; background-position: right var(--space-3) center; background-size: 16px 16px; cursor: pointer; text-overflow: ellipsis; }
select:disabled { cursor: not-allowed; }
input[type="date"] { -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
textarea { resize: vertical; min-height: 4.5rem; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:disabled, textarea:disabled, select:disabled { background: var(--bg); color: var(--muted); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent-cta); flex: none; margin: 0.15rem 0 0; }
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field.other { margin-top: var(--space-3); max-width: 420px; }
.opt { font-weight: 400; color: var(--muted); }
.field-error { color: var(--danger); font-size: var(--text-sm); margin: var(--space-1) 0 0; font-weight: var(--weight-label); }
.input-row { display: flex; align-items: center; gap: var(--space-2); }
.unit { color: var(--muted); font-size: var(--text-sm); white-space: nowrap; min-width: 2.2rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.grid .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: var(--space-2); font-weight: 400; font-size: var(--text-sm); cursor: pointer; }
.check.unknown { color: var(--muted); margin-top: var(--space-2); align-items: center; }
.check.unknown input { margin-top: 0; }
.check.none { margin-bottom: var(--space-3); }
.code-input { font-family: var(--font-mono); font-size: var(--text-2xl); letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
form .btn { margin-top: var(--space-4); }
.card.narrow form { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-2); }
.inline-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto; gap: var(--space-4); align-items: end; margin-bottom: var(--space-4); }
.inline-form .btn { margin: 0; }
.link-box { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ----- choices ----- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--space-2); }
.option { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; font-weight: 400; font-size: var(--text-base); line-height: 1.45; background: var(--surface-input); }
.option:hover { border-color: var(--muted); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.option-text { display: flex; flex-direction: column; }
.option-help { color: var(--muted); font-size: var(--text-sm); }
.pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.pills legend { width: 100%; }
.pill { display: inline-flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-full); cursor: pointer; font-weight: 400; font-size: var(--text-sm); background: var(--surface-input); min-height: 36px; }
.pill input { margin: 0; }
.pill:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }

/* ----- status badges ----- */
.chip { display: inline-flex; align-items: center; padding: 2px var(--space-2); border-radius: var(--radius-md); font-size: var(--text-xs); font-weight: 600; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; border: 1px solid transparent; }
.chip.required { background: var(--surface-warm); color: var(--fg); }
.chip.required.missing { background: var(--danger-tint); color: var(--danger); }
.chip.optional, .chip.draft { background: transparent; color: var(--muted); border-color: var(--border); }
.chip.done { background: var(--success-tint); color: var(--success-text); }
.chip.warn { background: var(--warn-tint); color: var(--warn-text); }

/* ----- progress bar ----- */
.bar { display: block; height: 8px; background: var(--surface-warm); border-radius: var(--radius-full); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; background: var(--accent); border-radius: var(--radius-full); transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1); }

/* ----- my sites ----- */
.site-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.site-card { display: flex; justify-content: space-between; gap: var(--space-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.site-card-main { flex: 1; min-width: 0; }
.site-card-main h2 { margin-bottom: var(--space-1); }
.site-card-main h2 a { color: var(--fg); text-decoration: none; }
.site-card-main h2 a:hover { text-decoration: underline; }
.site-card-main p { margin-bottom: var(--space-2); }
.site-card-main .bar { margin-bottom: var(--space-2); max-width: 420px; }
.site-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }

/* ----- the guided form ----- */
.form-layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: var(--space-8); max-width: var(--container-max); margin: 0 auto; align-items: start; }
.side { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); }
.back-link { text-decoration: none; }
.side-title { font-family: var(--font-display); font-weight: var(--weight-display); font-size: var(--text-lg); line-height: var(--leading-heading); letter-spacing: var(--tracking-heading); margin: var(--space-2) 0 var(--space-3); overflow-wrap: anywhere; }
.progress-block { margin-bottom: var(--space-4); }
.progress-text { display: block; font-size: var(--text-xs); font-weight: 500; color: var(--muted); margin-top: var(--space-2); }
.step-nav { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: 2px; }
.step-nav a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius-md); text-decoration: none; color: var(--fg); font-size: var(--text-sm); line-height: 1.4; min-height: 44px; }
.step-nav a:hover { background: var(--surface-warm); }
.step-nav .current a { background: var(--accent-tint); font-weight: 600; }
.step-dot { width: 1.5rem; height: 1.5rem; border-radius: var(--radius-full); display: grid; place-items: center; font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums; background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.step-nav .current .step-dot { background: var(--accent-cta); color: var(--accent-on); border-color: var(--accent-cta); }
.step-nav .complete .step-dot { background: var(--success-tint); color: var(--success-text); border-color: transparent; }
.step-meta { font-size: var(--text-xs); color: var(--muted); white-space: nowrap; font-weight: 400; }
.refine-toggle { padding: var(--space-3) var(--space-1); border-top: 1px solid var(--border); }
.save-line { margin: 0; padding: var(--space-3) var(--space-1) 0; border-top: 1px solid var(--border); color: var(--muted); }
.save-status.bad { color: var(--danger); font-weight: 600; }

.content { min-width: 0; }
.step-head { margin-bottom: var(--space-5); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); font-weight: 600; line-height: 1.4; color: var(--accent-ink); margin-bottom: var(--space-1); }
.section-title { margin: var(--space-6) 0 var(--space-3); font-family: var(--font-body); font-size: var(--text-lg); font-weight: var(--weight-heading); letter-spacing: var(--tracking-text); line-height: 1.45; color: var(--fg); }
.q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4); scroll-margin-top: 96px; }
.q.needs { border-color: var(--danger); }
.q-head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-2); }
.q-head h3 { flex: 1; }
.q-id { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.q-help { color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--space-4); max-width: 70ch; }
.q-hint { background: var(--surface-warm); border-radius: var(--radius-md); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.q-total { margin: var(--space-3) 0 0; font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.row-card { border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4) var(--space-4); margin-bottom: var(--space-3); }
.row-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-2); }
.row-num { font-weight: 600; font-size: var(--text-xs); font-variant-numeric: tabular-nums; width: 1.5rem; height: 1.5rem; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; margin-right: auto; }
.attachments { margin-bottom: var(--space-4); }
* + .attachments { margin-top: var(--space-5); }
.dropzone { border: 1px dashed var(--border-dashed); border-radius: var(--radius-lg); background: var(--bg); padding: var(--space-4); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; color: var(--muted); font-size: var(--text-sm); }
.dropzone:hover { border-color: var(--muted); }
.dropzone.over { border-color: var(--accent); border-style: solid; background: var(--accent-tint); }
.dropzone .btn { margin: 0; cursor: pointer; }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.file-list { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-1); }
.file-list li { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; overflow-wrap: anywhere; }
.upload-status { margin: var(--space-2) 0 0; color: var(--muted); }
.optional-note { margin-top: var(--space-4); }
.step-actions { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-6); }
.notice { border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); margin: var(--space-4) 0 0; }
.notice.warn { background: var(--warn-tint); color: var(--warn-text); font-weight: var(--weight-label); }

/* ----- panels and review ----- */
.panel { border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4); border: 1px solid var(--border); background: var(--surface); }
.panel.ok { background: var(--success-tint); border-color: transparent; }
.panel.warn { background: var(--warn-tint); border-color: transparent; }
.panel > :last-child { margin-bottom: 0; }
.panel ul { margin-bottom: var(--space-2); }
.review-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); margin-bottom: var(--space-4); }
.review-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-2); }
.review-head h2 { margin: 0; }
.review-list { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0; margin: 0; }
.review-list dt, .review-list dd { padding: var(--space-2) 0; border-top: 1px solid var(--border-soft); margin: 0; }
.review-list dt { color: var(--muted); font-size: var(--text-sm); padding-right: var(--space-4); }
.review-list dd { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ----- admin ----- */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tabs a { padding: var(--space-3) var(--space-4); text-decoration: none; color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-label); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); }
.tabs a.current { color: var(--accent-ink); border-bottom-color: var(--accent); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-4); }
.toolbar p { margin: 0; }
.table-wrap { overflow-x: auto; margin-bottom: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: 1.4; }
.table th, .table td { text-align: left; padding: 10px var(--space-4); border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table th { font-weight: var(--weight-label); color: var(--muted); border-bottom-color: var(--border); white-space: nowrap; }
.table tbody tr:hover { background: var(--surface-warm); }
.table tr:last-child td { border-bottom: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-4); display: flex; flex-direction: column; }
.stat strong { font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: 600; line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: var(--text-sm); }
.status-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); }
.status-list li { display: grid; grid-template-columns: 4.5rem 12rem 1fr; gap: var(--space-3); align-items: baseline; }
.status-list .chip { justify-self: start; }

/* ----- dialog and toast ----- */
.dialog { border: 1px solid var(--border); border-radius: var(--radius-2xl); padding: var(--space-8); max-width: 440px; width: calc(100% - 2rem); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(15, 18, 21, 0.5); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
/* Hidden outright when idle. Sliding it off-screen alone left the top edge of the empty box showing at the bottom of the window. */
.toast { position: fixed; left: 50%; bottom: var(--space-6); transform: translate(-50%, var(--space-4)); opacity: 0; visibility: hidden; pointer-events: none; background: var(--fg); color: var(--bg); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: var(--text-sm); max-width: calc(100% - 2rem); transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 200ms; z-index: 30; box-shadow: var(--shadow-lg); }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms cubic-bezier(0.4, 0, 0.2, 1); }

/* ----- small screens ----- */
@media (max-width: 1023px) {
  main { padding: var(--space-4) var(--space-4) var(--space-12); }
  .form-layout { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .side { position: static; }
  .step-nav { display: flex; overflow-x: auto; gap: var(--space-1); padding-bottom: var(--space-1); }
  .step-nav li { flex: none; }
  .step-nav a { grid-template-columns: auto auto; padding: var(--space-2) var(--space-3); }
  .step-meta { display: none; }
}
@media (max-width: 639px) {
  .grid, .review-list, .inline-form { grid-template-columns: minmax(0, 1fr); }
  .review-list dt { padding-bottom: 0; }
  .review-list dd { border-top: 0; padding-top: 2px; }
  .site-card { flex-direction: column; }
  .site-card-side { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .who { display: none; }
  .card.narrow { padding: var(--space-6); }
  .status-list li { grid-template-columns: 4.5rem 1fr; }
  .status-list li .muted { grid-column: 2; }
  h1 { font-size: var(--text-xl); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .top, .side, .step-actions, .toast { display: none; } .form-layout { display: block; } }
