:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #f0ebe3;
  --ink: #1f1c18;
  --ink-2: #4a443d;
  --muted: #6e675e;
  --line: #e2dbd0;
  --line-strong: #cfc6b8;
  --control-border: #887b6b;
  --topbar-height: 60px;
  --control-height: 40px;
  --touch-height: 44px;
  --space-sm: 8px;
  --accent: #8f4630;
  --accent-ink: #ffffff;
  --accent-soft: #f3e4dc;
  --ok: #2f6b45;
  --ok-soft: #e3f0e6;
  --warn: #8a5a00;
  --warn-soft: #f8edd5;
  --bad: #9c2f2f;
  --bad-soft: #f7e1df;
  --focus: #8f4630;
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 16px;
  --pad: clamp(14px, 2.4vw, 28px);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgb(31 28 24 / 6%), 0 4px 16px rgb(31 28 24 / 5%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1e1c1a;
    --surface-2: #26231f;
    --ink: #ece6dd;
    --ink-2: #cfc7bb;
    --muted: #a39b8f;
    --line: #34302b;
    --line-strong: #4a443c;
    --control-border: #82796e;
    --accent: #d99a7f;
    --accent-ink: #1b1512;
    --accent-soft: #3a2a23;
    --ok: #8cc9a0;
    --ok-soft: #1f3226;
    --warn: #e5bd6b;
    --warn-soft: #362b17;
    --bad: #ec9a92;
    --bad-soft: #3b201e;
    --focus: #d99a7f;
    --shadow: none;
    color-scheme: dark;
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: 0.005em; margin: 0; }

a { color: var(--accent); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.skip:focus { top: 8px; }

/* Top bar hugs the viewport edges. */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px var(--pad);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.wordmark { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 600; }
.wordmark-mark { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.wordmark-mark circle { fill: var(--accent); stroke: none; }
.topnav, .nav-actions { display: flex; align-items: center; gap: 6px; }
.btn.nav-toggle, .btn.mobile-jump, .pill.demo { display: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-2); background: var(--surface-2);
  white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.live::before { background: var(--ok); }
.pill.demo::before { background: var(--warn); }

.banner {
  padding: 10px var(--pad);
  background: var(--warn-soft); color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.banner strong { font-weight: 600; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 7px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { min-height: 30px; padding: 4px 10px; font-size: 13.5px; }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

/* Layout: brief on the left, results fill the rest of the screen. */
.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: var(--pad);
  padding: var(--pad);
  max-width: 1920px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .brief-pane, .results-pane { grid-column: 1; grid-row: auto; }
  .btn.mobile-jump { display: inline-flex; margin-bottom: 12px; }
}

.brief-pane {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow: auto;
}
@media (max-width: 900px) {
  .brief-pane { position: static; max-height: none; }
}
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pane-title { font-size: 18px; }

.brief-pane { grid-column: 1; grid-row: 1; }
.results-pane { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
  .brief-pane, .results-pane { grid-column: 1; grid-row: auto; }
}

/* Form */
.group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.group legend, .group > summary { font-family: var(--serif); font-size: 16px; font-weight: 600; padding: 0; margin-bottom: 8px; }
details.group { border-top: 1px solid var(--line); padding-top: 12px; }
details.group > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after { content: '+'; font-family: var(--sans); color: var(--muted); font-size: 18px; line-height: 1; }
details.group[open] > summary::after { content: '–'; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.opt { font-weight: 400; color: var(--muted); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.muted { color: var(--muted); }

input[type="text"], input:not([type]), input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; min-height: var(--control-height); padding: 8px 10px;
  border: 1px solid var(--control-border); border-radius: var(--radius-sm);
  background: var(--bg);
}
textarea { resize: vertical; min-height: 72px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.lookup-status:empty { display: none; }
.lookup-status { margin: 4px 0; }
[role="group"][aria-invalid="true"] { outline: 1px solid var(--bad); outline-offset: 3px; border-radius: var(--radius-sm); }
.field-error { margin: 0; font-size: 13px; color: var(--bad); }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--ink); margin-bottom: 12px; font-size: 14px; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle {
  min-height: 34px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px;
}
.toggles.compact .toggle { padding: 4px 10px; font-size: 13.5px; }
.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }

.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; flex-wrap: wrap; }
.segmented button { border: 0; background: var(--surface); padding: 7px 12px; min-height: 36px; cursor: pointer; font-size: 14px; border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--focus); outline-offset: -3px; }
.segmented button[aria-checked="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

.anchor-add { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 6px; margin: 8px 0; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  max-height: 260px; overflow: auto;
}
.combo-list li { padding: 7px 9px; border-radius: 4px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--surface-2); }
.combo-list .sub { display: block; font-size: 12.5px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13.5px;
}
.chip .kind { color: var(--muted); font-size: 12px; }
.chip button { border: 0; background: transparent; cursor: pointer; width: 26px; height: 26px; border-radius: 50%; color: var(--muted); }
.chip button:hover { background: var(--line); color: var(--ink); }

.submit-row { position: sticky; bottom: -16px; background: var(--surface); padding: 12px 0 4px; border-top: 1px solid var(--line); }
.submit-row .btn { width: 100%; min-height: 44px; font-size: 15.5px; }

/* Results */
.results-pane { min-width: 0; }
#results, #brief-title, #results h2 { scroll-margin-top: calc(var(--topbar-height) + 12px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

.empty { padding: clamp(20px, 4vw, 40px); }
.empty h2 { font-size: 22px; margin-bottom: 6px; }
.empty p { margin: 0 0 18px; color: var(--ink-2); max-width: 60ch; }
.examples { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.example {
  width: 100%; height: 100%; text-align: left; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line-strong);
  background: var(--bg); cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 92px;
}
.example:hover { border-color: var(--accent); }
.example strong { font-family: var(--serif); font-size: 16px; }
.example span { color: var(--muted); font-size: 13.5px; }

.status-card { padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.status-card h2 { font-size: 19px; }
.status-card.error { border-color: var(--bad); background: var(--bad-soft); }
.progress { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.progress li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-left: 3px solid var(--line-strong); background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; animation: fade-in .2s ease; }
.progress li.decision { border-left-color: var(--accent); }
.progress li.error { border-left-color: var(--bad); }
.progress .t-meta { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
@keyframes fade-in { from { opacity: 0; transform: translateY(2px); } }
.skeleton { height: 14px; border-radius: 4px; background: var(--surface-2); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.plan-head { padding: 16px 18px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.plan-head h2 { font-size: 20px; }
.plan-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; width: max-content; min-width: min(200px, calc(100vw - 28px)); max-width: calc(100vw - 28px);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 4px; margin: 0; list-style: none; overflow-y: auto;
}
.menu-list button { white-space: normal; text-align: left; width: 100%; justify-content: flex-start; border: 0; }

.notices { padding: 10px 18px 0; display: flex; flex-direction: column; gap: 6px; }
.notice { font-size: 13.5px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); }
.notice.info { background: var(--surface-2); }

.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 12px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14.5px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tabpanel { padding: 16px 18px 22px; }

.budget { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.meter { flex: 1 1 160px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; min-width: 120px; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter.over > span { background: var(--bad); }

.week { margin-bottom: 22px; }
.week h3 { font-size: 15px; color: var(--muted); font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.slot { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.slot.locked { border-color: var(--accent); }
.slot.declined { opacity: .7; }
.slot-top { display: flex; gap: 12px; align-items: flex-start; }
.date { flex: 0 0 auto; width: 52px; text-align: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 4px 0; background: var(--surface); }
.date .dow { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.date .day { display: block; font-family: var(--serif); font-size: 20px; line-height: 1.1; }
.date .mon { display: block; font-size: 11px; color: var(--muted); }
.slot-title { min-width: 0; }
.slot-title .format { font-size: 12.5px; color: var(--accent); font-weight: 600; }
.slot-title h4 { font-size: 16.5px; line-height: 1.3; overflow-wrap: anywhere; }
.slot-desc { margin: 0; color: var(--ink-2); font-size: 14px; }
.why { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.momentum { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.spark { flex: 0 0 auto; }
.spark polyline { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.momentum.up .spark polyline { stroke: var(--ok); }
.momentum.down .spark polyline { stroke: var(--bad); }
.partner { font-size: 13.5px; color: var(--ink-2); }
.partner strong { color: var(--ink); font-weight: 600; }
.badge { margin-left: auto; flex: 0 0 auto; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.confirmed { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.declined { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.held, .badge.contacted { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.booking { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.fit-details > summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.fit-details[open] > summary { margin-bottom: var(--space-sm); }
.fit-details > p, .fit-details > .why, .fit-details > .momentum { margin-bottom: var(--space-sm); }
.booking > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.booking[open] > summary { margin-bottom: 4px; }
.slot-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-meta label { font-size: 12.5px; }
.slot-meta select, .slot-meta input { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.slot-notes textarea { min-height: 54px; font-size: 14px; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.alts { border-top: 1px dashed var(--line-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.alt { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.alt p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.item-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.item-head h4 { font-size: 16px; }
.score { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.section-title { font-size: 17px; margin: 4px 0 10px; }
.section-title + .hint { margin-top: -6px; margin-bottom: 12px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 22px; }

.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare-table th, .compare-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare-table th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.compare-table td.generic { color: var(--muted); }
.nowrap { white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--bg); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-family: var(--serif); font-size: 20px; }
.stat .v small { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.table-wrap { overflow-x: auto; }

.trace { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trace li { border-left: 3px solid var(--line-strong); padding: 6px 10px; background: var(--bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.trace li.decision { border-left-color: var(--accent); }
.trace li.error { border-left-color: var(--bad); }
.trace .t-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.trace .t-meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trace code { display: block; font: 12px/1.45 var(--mono); color: var(--ink-2); margin-top: 4px; overflow-wrap: anywhere; }
.trace p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-2); }

.toast {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 14px; box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

.dialog { border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow); }
.dialog::backdrop { background: rgb(20 18 16 / 45%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 18px; }
.dialog-body { padding: 14px 16px 18px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ol { padding-left: 20px; }
.saved-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.saved-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.saved-list .meta { font-size: 12.5px; color: var(--muted); }
.saved-list .actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .topnav { gap: 0; }
  .topnav .btn { padding: 6px 7px; font-size: 13px; min-height: 34px; }
  .wordmark { font-size: 17px; }
  #source-pill { display: none; }
  .plan-head { padding: 14px; }
  .tabpanel { padding: 14px 12px 20px; }
  .slot-meta { grid-template-columns: 1fr; }
  .tabs { padding: 0 6px; }
  .tab { flex: 1 0 28%; padding: 10px 8px; min-height: var(--touch-height); }
  .btn, .btn.small, .toggle, .segmented button, .booking > summary, .fit-details > summary, .chip button { min-height: var(--touch-height); }
  .chip button { min-width: var(--touch-height); }
  .booking > summary, .fit-details > summary { padding: 11px 0; }
  .menu-list { left: 0; right: auto; }
  .anchor-add { grid-template-columns: minmax(0, 1fr) auto; }
  .anchor-add select { grid-column: 1 / -1; }
}

@media (max-width: 400px) {
  .topbar { padding: 10px 14px; }
  .topnav .nav-toggle { display: inline-flex; min-height: var(--touch-height); padding: 8px 14px; }
  .nav-actions { display: none; position: absolute; right: 14px; top: calc(100% + 4px); padding: 4px; flex-direction: column; align-items: stretch; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: calc(100vw - 28px); }
  .nav-toggle[aria-expanded="true"] + .nav-actions { display: flex; }
  .nav-actions .btn { justify-content: flex-start; min-height: var(--touch-height); padding: 8px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  @page { margin: 14mm; }
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #eee;
    --ink: #000; --ink-2: #333; --muted: #555; --accent: #333;
    --accent-ink: #fff; --accent-soft: #eee; --line: #bbb; --line-strong: #777;
    --control-border: #777; --ok: #333; --warn: #333; --bad: #333;
    --ok-soft: #eee; --warn-soft: #eee; --bad-soft: #eee;
    color-scheme: light;
  }
  .topbar, .brief-pane, .banner, .tabs, .toolbar, .slot-actions, .booking, .fit-details, .alts, .toast, .skip, .mobile-jump, dialog { display: none !important; }
  html, body { background: #fff; color: #000; }
  body { font-size: 10pt; }
  .layout { display: block; padding: 0; }
  .card, .slot { box-shadow: none; border-color: var(--line); background: #fff; }
  .plan-head { padding: 0 0 12px; }
  .plan-sub, .print-source { font-size: 10pt; }
  .print-source { padding: 8px 18px; margin: 0; }
  .tabpanel[hidden] { display: none !important; }
  .slots { grid-template-columns: 1fr 1fr; }
  .slot { break-inside: avoid; gap: 6px; padding: 10px; }
  .slot-desc, .why, .partner { font-size: 9pt; }
  .date { background: #eee; color: #000; }
  .badge { color: #333; background: #eee; }
  .week h3 { break-after: avoid; page-break-after: avoid; }
  .week .slots { break-before: avoid; page-break-before: avoid; }
  .notices { padding-top: 8px; }
  .notice { background: #fff; color: #333; padding: 0; font-size: 9pt; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
