/* Layers: tokens, base elements, components, then small feature blocks. New screens use the first three before adding any
   CSS of their own (docs/architecture.md, "UI building blocks"). Light only, system fonts, no web fonts (D-026, D-043). */

/* 1. Tokens */
:root {
  --paper: #faf5ec;
  --sheet: #fffdf9;
  --ink: #2b2220;
  --ink-soft: #66544d;
  --line: #d9cdbf;
  --edge: #8c7b70;
  --accent: #7a2a3e;
  --accent-soft: #f3e4e1;
  --error: #a3122a;
  --good: #2f6b3f;
  --good-soft: #e7f0e4;
  --warn: #8a5a12;
  --warn-soft: #f8eed6;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  color-scheme: light;
}
[hidden] { display: none !important; }

/* 2. Base elements */
body { font: 16px/1.5 system-ui, sans-serif; max-width: 40rem; margin: 0 auto; padding: 0 16px 2rem; background: var(--paper); color: var(--ink); }
body.wide { max-width: 64rem; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin: 1.25rem 0 0.5rem; }
h1 { font-size: 2.2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.75rem; }
a { color: var(--accent); }
main { margin-top: 2rem; }
button, .btn { font: inherit; font-weight: 500; padding: 7px 14px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--sheet); color: var(--ink); cursor: pointer; }
button:disabled { opacity: 0.55; cursor: default; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], select, textarea { font: inherit; color: var(--ink); background: var(--sheet); border: 1px solid var(--edge); border-radius: 6px; padding: 7px 10px; box-sizing: border-box; max-width: 100%; }
textarea { width: 100%; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 500; font-size: 14px; padding: 0; margin-bottom: 4px; }
label { font-weight: 500; font-size: 14px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.urgent { font-weight: bold; }

/* 3. Components */
.btn { display: inline-block; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.link { border-color: transparent; background: none; color: var(--accent); text-decoration: underline; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.field { display: grid; gap: 4px; }
.field input, .field select, .field textarea { width: 100%; }
.hint { font-size: 12.5px; color: var(--ink-soft); }
.note { color: var(--ink-soft); font-size: 13.5px; }
.notice, #status, #notice { margin: 0 0 8px; padding: 8px 12px; border-radius: 6px; background: var(--accent-soft); }
.degraded { color: var(--error); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
/* The test-run notice (D-017) stands apart from the texts fine print: a tinted, bordered box. */
.fine { color: var(--ink); font-size: 13px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 6px; padding: 10px 12px; }
.header, .nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 0; }
.header { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.logo { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Containers that lay their children out in a grid own the spacing, so their text has no margins of its own. */
.profile :is(h1, h2, h3, h4, p), .box :is(h1, h2, h3, h4, p), .card :is(h1, h2, h3, h4, p), .hero-text :is(h1, p), .progress p,
.countdown p, #account :is(h1, h2, p), .survey section :is(h2, h3, p), .sort-col h3 { margin: 0; }
#account, .survey section { display: grid; gap: 14px; }
#account { gap: 16px; justify-items: start; }
#account .card { justify-self: stretch; }
#account-message { color: var(--ink-soft); }

/* 4. Feature blocks. Landing page (#79, D-026). */
#landing main { margin-top: 0; display: grid; gap: 2.5rem; }
#landing h1 { margin: 0; }
#landing h2 { margin: 0 0 0.75rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding-top: 1rem; }
.hero-text { display: grid; gap: 16px; }
.sub { color: var(--ink-soft); max-width: 60ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hero img { width: 100%; height: auto; border-radius: 12px; display: block; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.box { background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.step-n { font-size: 0.75rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
#faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
#faq summary { cursor: pointer; font-weight: 600; }
#faq details p { margin-top: 8px; color: var(--ink-soft); }
.footer { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: var(--ink-soft); }
@media (max-width: 40rem) {
  h1 { font-size: 1.8rem; }
  .hero, .cols3, .two { grid-template-columns: 1fr; }
}

/* Sign-up forms: About you (#32), the survey pages (D-028) and the partner invite screens (D-029) share one form look. */
.profile { max-width: 32rem; margin: 2rem auto; display: grid; gap: 14px; }
.profile .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 400; }
.profile .check input { margin-top: 3px; }
.profile .sms-box { display: grid; gap: 6px; font-size: 13.5px; }
.profile .sms-box > div { display: grid; gap: 6px; }
.profile .sms-box p { color: var(--ink-soft); font-size: 13px; }
.profile input[type="text"], .profile input[type="tel"], .profile input[type="email"], .survey select, .survey textarea { width: 100%; }
.settings-note { color: var(--ink-soft); font-size: 13.5px; }
.survey .flow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.survey .flow ol { margin: 0; padding-left: 1.2rem; font-size: 13.5px; color: var(--ink-soft); }
.survey #invite-form { display: grid; gap: 8px; }
.survey #partner-survey-shared { color: var(--ink-soft); font-size: 13.5px; margin: 0; padding-left: 1.2rem; }
@media (max-width: 40rem) {
  .survey .flow { grid-template-columns: 1fr; }
}

/* Survey polish (D-032): clickable cards, the progress bar, yes/no questions. */
.progress { max-width: 32rem; margin: 2rem auto 0; display: grid; gap: 6px; }
.progress-bar { display: flex; gap: 6px; }
.progress-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress-bar span.on { background: var(--accent); }
.survey .choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.survey .choices.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.survey .choice { position: relative; border: 1.5px solid var(--edge); border-radius: 10px; padding: 14px; display: grid; gap: 8px; align-content: start; cursor: pointer; background: var(--sheet); font-weight: 400; font-size: 1rem; }
.survey .choice input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.survey .choice:hover { border-color: var(--ink); }
.survey .choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--sheet)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.survey .choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.survey .choice .title { font-weight: 600; font-size: 1.05rem; }
.survey .choice .desc { color: var(--ink-soft); font-size: 13.5px; }
.survey .choice .icon { color: var(--accent); }
.survey .ticks { display: grid; gap: 6px; }
.survey .check { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; font-weight: 400; }
@media (max-width: 40rem) {
  .survey .choices, .survey .choices.three { grid-template-columns: 1fr; }
  .survey .choices.yesno { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The account view (#76): the countdown sits above every signed-in page; "Your next date" is a card. */
.countdown { background: var(--accent-soft); border-radius: 6px; padding: 8px 14px; margin: 0 0 1rem; font-weight: 500; }
.next-date { justify-items: start; }
.next-date #next-date-card { display: grid; gap: 0.5rem; justify-items: start; }
.next-date .next-date-step { font-weight: 600; color: var(--accent); }
.next-date #date-plans { display: grid; gap: 0.5rem; justify-items: start; max-width: 20rem; padding: 10px 14px; border-radius: 6px; background: var(--accent-soft); font-size: 13.5px; }
.next-date #date-plans :is(h3, p), .next-date #date-plans > div { margin: 0; }
.next-date #date-plans .btn { font-size: inherit; }
#account-invite-card { justify-items: start; }

/* The interests card sort (D-040): three columns on a wide screen; on a phone they stack, the unsorted pile first. */
.survey .sort { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 12px 0; }
.survey .sort-middle { order: -1; }
.survey .sort-col { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px; background: var(--sheet); display: grid; gap: 10px; align-content: start; }
.survey .sort-middle { background: var(--paper); }
.survey .sort-col h3 { font-size: 0.95rem; }
.survey .sort-cards { display: grid; gap: 8px; align-content: start; min-height: 2.5rem; }
.survey .sort-group { display: grid; gap: 8px; }
.survey .sort-group h4 { margin: 4px 0 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); font-family: system-ui, sans-serif; }
.survey .sort-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--sheet); }
.survey .sort-graphic { font-size: 1.4rem; line-height: 1; }
.survey .sort-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.survey .sort-actions button { padding: 4px 10px; font-size: 13.5px; }
.survey .sort-all { justify-content: flex-start; }
@media (min-width: 48rem) {
  .survey .sort { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .survey .sort-middle { order: 0; }
}
/* The sort bar (D-049): Back, the count and Next stay in view while scrolling; the page takes the 64rem column while it shows. */
.survey .sort-bar { position: sticky; top: 0; z-index: 1; align-items: center; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 0; }
.survey .sort-bar .note { margin: 0; }
body:has(#survey-interests:not([hidden])) :is(.survey, .progress, .settings-bar) { max-width: 64rem; }
.survey .survey-part { display: grid; gap: 14px; }

/* Settings (D-048): a list of cards, one per category, and one sticky bar (Back to Settings, the count, Save updates) over a panel. */
.settings-bar { position: sticky; top: 0; z-index: 1; align-items: center; max-width: 32rem; margin: 0 auto; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 0; }
.settings-bar .note { margin: 0; }
.settings-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* Staff page (D-045): tabs, KPI tiles, chips, the table's scroll wrapper, the date-view grid, label/value grids, the compact
   table and the stop-card header. Tokens and the shared buttons only: no new colour or button style. */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: 8px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--ink-soft); font-weight: 500; text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button { padding: 8px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: var(--ink-soft); }
.tabs button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
/* Activities list (D-063): heading row, one filter row, in-page tabs, pressed Coverage controls. */
#activities-view .heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
#activities-view .heading-row h2 { margin: 0; }
#activities-view .tabs { margin-bottom: 0; }
#activities-view .filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
#activities-view .filter-row .field { flex: 1 1 10rem; }
#activities-view .filter-row > label { display: inline-flex; gap: 6px; align-items: center; }
#activities-view .compact .btn.link { padding: 0 4px; }
#activities-view .compact .btn.link[aria-pressed="true"] { background: var(--accent-soft); font-weight: 700; }
/* Curated Dates and the Date Builder (D-066): two columns on a computer, lock buttons, drop gaps, the 15-minute time bar. */
#curated-view .heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
#curated-view .heading-row h2 { margin: 0; }
#curated-view tbody tr { cursor: pointer; }
#curated-view tbody tr:hover { background: var(--accent-soft); }
#curated-date-view del { color: var(--ink-soft); }
#curated-date-view .tick { display: flex; gap: 8px; align-items: center; }
/* The Date Builder (D-073, amends D-043 and D-066): its own layout, ported from the wireframe. Colours only through the tokens above, never a
   literal; category colours are Drinks --accent, Dining --warn, Experience --good. */
body.wide:has(#builder-view:not([hidden])) { max-width: 80rem; }
#builder-narrow { display: none; }
/* The plan card across the top: works-line and Lock in, the three limits, time left, the time bar, the price meter. */
#builder-view .plan { gap: 10px; }
#builder-view .plan-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
#builder-view .works { font-family: var(--serif); }
#builder-view .lock-panel { display: grid; gap: 8px; padding: 8px 0 2px; border-top: 1px dashed var(--line); }
#builder-view .lock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#builder-view .plan-limits { display: flex; flex-wrap: wrap; gap: 8px 16px; }
#builder-view .plan-limits .field { flex: 0 1 12rem; }
#builder-view .plan label { font-size: 13px; color: var(--ink-soft); }
#builder-view .plan-left { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
#builder-view .left-line { font-family: var(--serif); font-size: 1.1rem; }
#builder-view .bar-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
#builder-view .bar-legend:empty { display: none; }
#builder-view .bar-legend .swatch { width: 22px; height: 10px; border-radius: 3px; border: 1px solid var(--line); background: repeating-linear-gradient(135deg, var(--line) 0 3px, var(--sheet) 3px 6px); }
#builder-view .plan-limit-lines { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
/* Lock buttons: green, pressed ink, ruled out struck through. */
#builder-nights .btn, #builder-starts .btn { border: 1.5px solid var(--good); border-radius: 6px; background: var(--good-soft); color: var(--good); padding: 1px 10px; font-size: 13.5px; text-decoration: none; }
#builder-nights .btn[aria-pressed="true"], #builder-starts .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
#builder-nights .btn:disabled, #builder-starts .btn:disabled { border-color: var(--line); background: var(--paper); color: var(--ink-soft); opacity: 1; text-decoration: line-through; }
/* The time bar and the price meter: the same 5-minute and price cells, drawn edge to edge in one row; the ticks are a second row of cells. */
#builder-bar, #builder-meter, #builder-ticks { gap: 0; flex-wrap: nowrap; }
#builder-bar, #builder-meter { border: 1px solid var(--line); border-right-width: 0; border-radius: 6px; overflow: hidden; }
#builder-bar .cell, #builder-meter .cell { flex: 1 1 0; width: auto; min-width: 0; border-radius: 0; border-width: 0 1px 0 0; }
#builder-bar .cell { height: 24px; }
#builder-meter { flex: 1 1 12rem; }
#builder-meter .cell { height: 10px; }
#builder-bar .cell.walk { background: var(--line); border-color: var(--line); }
#builder-ticks { margin-top: -6px; }
#builder-ticks .tick { flex: 1 1 0; min-width: 0; height: 18px; font-size: 12px; color: var(--ink-soft); white-space: nowrap; text-indent: 3px; }
#builder-ticks .tick:not(:empty) { border-left: 1px solid var(--edge); }
/* Two columns: Your date, narrow and sticky (it scrolls on its own when taller than the window), and the tray. */
#builder-view .builder-cols { display: grid; grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); gap: 18px; align-items: start; }
#builder-view .builder-date { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
#builder-view .date-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
#builder-view .date-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
#builder-view #builder-id { border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft); }
#builder-view #builder-id:empty { display: none; }
#builder-view .submit-box { display: grid; gap: 4px; justify-items: start; border-top: 1px solid var(--line); padding-top: 10px; }
/* The Date Description (D-082): layout only. A template token is bold and underlined, in the text colour. */
#builder-view .description-box { border-top: 1px solid var(--line); padding-top: 10px; }
#builder-view .description-tools, #a-form .description-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#builder-view .description-stops p { margin: 0 0 2px; }
.description-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.template-token { font-weight: 700; text-decoration: underline; }
/* The timeline: a time column and a card per stop, a dotted walk between stops, drop gaps, the room box. */
#builder-view .timeline { display: grid; }
#builder-view .stop { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 10px; }
#builder-view .stop > * { min-width: 0; }
#builder-view .when { font-family: var(--serif); text-align: right; padding-top: 12px; font-size: 0.92rem; line-height: 1.2; }
#builder-view .when span { display: block; }
#builder-view .when .sub { font-family: system-ui, sans-serif; font-size: 12px; color: var(--ink-soft); }
#builder-view .stop-card { border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 8px; background: var(--sheet); padding: 8px 10px; display: grid; gap: 3px; }
#builder-view .stop-card.dining { border-left-color: var(--warn); }
#builder-view .stop-card.experience { border-left-color: var(--good); }
#builder-view .card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
#builder-view .leg { margin-left: calc(5.2rem + 10px); padding: 3px 0 3px 14px; border-left: 2px dotted var(--edge); font-size: 12.5px; color: var(--ink-soft); }
#builder-view .gap { height: 10px; margin-left: calc(5.2rem + 10px); border-radius: 6px; }
#builder-view .gap.drop-empty { height: auto; margin-left: 0; padding: 22px; border: 2px dashed var(--line); border-radius: 8px; text-align: center; color: var(--ink-soft); }
#builder-view .gap.fits, #builder-view .gap.limit, #builder-view .gap.refused { height: auto; min-height: 40px; padding: 4px 8px; border: 2px dashed var(--good); background: var(--good-soft); color: var(--ink); display: grid; place-items: center; font-size: 12.5px; text-align: center; }
#builder-view .gap.limit { border-color: var(--warn); background: var(--warn-soft); }
#builder-view .gap.refused { border-color: var(--error); background: var(--sheet); color: var(--error); }
#builder-view .room { margin: 6px 0 0 calc(5.2rem + 10px); padding: 8px 10px; border: 2px dashed var(--line); border-radius: 8px; display: grid; gap: 2px; }
/* The stop controls: borderless icons, shown on hover or keyboard focus (opacity keeps them in the tab order) and always on touch. */
#builder-view .mini { display: flex; margin-left: auto; opacity: 0; transition: opacity 0.1s; }
#builder-view .stop-card:hover .mini, #builder-view .stop-card:focus-within .mini { opacity: 1; }
@media (hover: none) { #builder-view .mini { opacity: 1; } }
#builder-view .mini button { border: 0; border-radius: 4px; background: none; padding: 0 5px; color: var(--ink-soft); font-size: 15px; line-height: 1.2; }
#builder-view .mini button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
/* Name buttons on cards and stops: plain bold text, accent and underlined on hover. */
#builder-view .btn.name { border: 0; background: none; padding: 0; font-weight: 600; text-align: left; text-decoration: none; color: var(--ink); }
#builder-view .btn.name:hover { color: var(--accent); text-decoration: underline; }
#builder-view h4 .btn.name { font-family: var(--serif); font-size: 1.05rem; }
/* The tray head: Area and Category pills (pressed: ink fill), the filters, the hint line. */
#builder-view .tray-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
#builder-view .tray-row .field { flex: 0 1 11rem; }
#builder-view .tray-row .field.grow { flex: 1 1 14rem; }
#builder-view .tray-row .field.sort { display: flex; align-items: center; gap: 6px; flex: 0 1 auto; margin-left: auto; }
#builder-view .tray-row .field.sort select { width: auto; }
#builder-view .pills { display: flex; flex-wrap: wrap; gap: 6px; }
#builder-view .pills .btn, #builder-view #builder-unused { border: 1.5px solid var(--edge); border-radius: 999px; background: var(--sheet); color: var(--ink); padding: 2px 12px; font-size: 14px; font-weight: 500; text-decoration: none; }
#builder-view .pills .btn[aria-pressed="true"], #builder-view #builder-unused[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
/* Tray cards: the photo on top, then the body, then the Add footer. */
#builder-view .tray-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
#builder-view .tray-card { padding: 0; gap: 0; overflow: hidden; }
#builder-view .tray-card[draggable="true"] { cursor: grab; }
#builder-view .tray-card.dimmed { opacity: 0.6; }
#builder-view .tray-card .photo-ph { max-width: none; height: 80px; margin: 0; aspect-ratio: auto; border-width: 0 0 1px; border-radius: 0; }
#builder-view .card-body { padding: 10px 12px; display: grid; gap: 5px; }
#builder-view .tray-card .card-head { justify-content: space-between; }
#builder-view .card-foot { padding: 0 12px 12px; display: flex; justify-content: flex-end; }
#builder-view .imp { display: grid; gap: 2px; font-size: 12.5px; }
#builder-view .imp-row { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 2px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); }
#builder-view .imp-key { min-width: 3.4rem; font-weight: 600; }
.timebar { display: flex; flex-wrap: wrap; gap: 2px; }
.timebar .cell { width: 14px; height: 14px; border-radius: 3px; background: var(--sheet); border: 1px solid var(--line); box-sizing: border-box; }
.timebar .cell.striped { background: repeating-linear-gradient(135deg, var(--line) 0 3px, var(--sheet) 3px 6px); }
.timebar .fill-drinks { background: var(--accent); border-color: var(--accent); }
.timebar .fill-dining { background: var(--warn); border-color: var(--warn); }
.timebar .fill-experience { background: var(--good); border-color: var(--good); }
/* The price meter (D-067): the same cells, filled good and warn from 90%, a dashed mark after the 90% cell; a dimmed card has little left. */
.meter .cell.fill { background: var(--good); border-color: var(--good); }
.meter .cell.fill.warn { background: var(--warn); border-color: var(--warn); }
.meter .cell.mark { border-right: 2px dashed var(--ink-soft); }
#activity-detail { width: min(44rem, 92vw); max-height: 90vh; overflow: auto; }
@media (max-width: 61.875rem) {
  #builder-narrow { display: grid; }
  #builder-wide { display: none; }
}
#app [role="status"]:empty { display: none; }
.stack { display: grid; gap: 14px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.chip { display: inline-block; padding: 1px 10px; border-radius: 12px; background: var(--accent-soft); font-size: 13px; }
.chip.flag { border: 1px solid var(--accent); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.table-wrap { overflow-x: auto; max-width: 100%; }
#board td { padding: 8px; vertical-align: middle; }
#board tr:hover td { background: var(--paper); }
#board .last { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-soft); }
.chip.attention::before, .chip.texts::before { color: var(--accent); font-weight: 700; margin-right: 4px; }
.chip.attention::before { content: "!"; }
.chip.texts::before { content: "\2709"; }
.chip a { color: inherit; }
.table-wrap th { font-size: 13px; color: var(--ink-soft); font-weight: 500; }
.table-wrap td { vertical-align: top; }
.compact th, .compact td { padding: 4px 8px; font-size: 14px; }
.compact .status { display: block; font-size: 12.5px; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
#invites-list .notice { flex: 1 0 100%; margin: 0; }
#texts .notice { margin: 4px 0 0; }
#texts .msg { margin: 8px 0 0; }
#texts .msg-text { margin: 4px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet); white-space: pre-wrap; }
.person { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.date-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 16px 0; }
.date-grid .col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.kv { display: grid; grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.card.stop { background: var(--paper); }
.stop-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.stop-head .n, .stop .venue { font-weight: 600; }
.stop .actions { justify-content: flex-start; }
#stop-form fieldset { display: grid; gap: 8px; }
/* Date steps, board steps, "What to do now", badges, legend, the move pop-up (D-054). Tokens and the shared buttons only. */
.flow { display: grid; gap: 10px; }
.flow-group { display: grid; gap: 4px; min-width: 0; }
.flow-group > .lbl { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 500; }
.flow-cards { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; min-width: 0; }
@media (min-width: 64rem) { .flow-cards.path { flex-wrap: nowrap; } }
.arrow { align-self: center; color: var(--edge); font-size: 13px; }
.step { flex: 0 1 auto; min-width: 0; display: grid; gap: 2px; align-content: start; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink-soft); font-weight: 400; font-size: 12.5px; line-height: 1.35; cursor: default; }
.step .top { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; }
.step .nm { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.step .cnt { font-size: 12px; color: var(--ink-soft); }
.step.full { flex: 2 1 0; min-width: 9rem; max-width: 17rem; }
.step.slim { flex: 1 1 0; min-width: 6rem; }
.step.mini { flex: 1 1 0; min-width: 5rem; background: transparent; border-style: dashed; align-content: center; }
.step.mini .nm { font-weight: 500; font-size: 12.5px; color: var(--ink-soft); }
button.step { background: var(--sheet); border-color: var(--edge); cursor: pointer; }
button.step:hover { border-color: var(--ink); }
button.step .top { color: var(--accent); font-weight: 600; }
.step[aria-current="step"] { border: 1.5px solid var(--accent); background: var(--accent-soft); color: var(--ink); }
.step[aria-current="step"] .top { color: var(--accent); font-weight: 600; }
.board-flow { margin-bottom: 14px; }
.board-flow .step { flex: 1 1 0; min-width: 7rem; }
.board-flow .step[aria-pressed="true"] { flex: 2.4 1 0; min-width: 10rem; border: 1.5px solid var(--accent); background: var(--accent-soft); }
.board-flow .step.theirs { border-style: dashed; background: transparent; }
.board-flow .step.theirs .top { color: var(--ink-soft); font-weight: 500; }
.board-flow .step.theirs[aria-pressed="true"] { border-style: solid; background: var(--accent-soft); }
.step .foot { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 2px; }
.badge { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 3px; box-sizing: border-box; border: 1px solid var(--accent); border-radius: 10px; color: var(--accent); font-size: 11.5px; font-weight: 700; line-height: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; }
.legend > span { display: inline-flex; gap: 6px; align-items: center; }
.legend .swatch { width: 18px; height: 12px; border: 1px solid var(--edge); border-radius: 4px; background: var(--sheet); }
.legend .swatch.theirs { border-style: dashed; background: transparent; }
.date-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 14px; }
.date-top h2 { font-size: 1.1rem; }
.date-top #date-people { display: flex; flex-wrap: wrap; gap: 0 16px; }
.countdown { font-family: var(--serif); font-size: 1.05rem; color: var(--accent); }
.countdown:empty { display: none; }
.guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 24px; padding: 14px 16px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); }
.guide-job { display: grid; gap: 6px; align-content: start; }
.guide .eyebrow { font-size: 11.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.guide .job { font-family: var(--serif); font-size: 1.2rem; line-height: 1.3; }
.guide-points { display: grid; gap: 8px; font-size: 14.5px; align-content: start; }
.guide-points .point { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr); gap: 6px; }
.guide-points .mark { color: var(--accent); font-weight: 600; text-align: center; }
@media (min-width: 48rem) {
  .guide { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: start; }
  .guide-job { padding-right: 16px; border-right: 1px solid var(--line); }
}
.date-btn { padding: 3px 10px; font-size: 14px; white-space: nowrap; }
.date-btn::after { content: "\203A"; margin-left: 6px; color: var(--accent); font-weight: 600; }
.who { display: grid; gap: 6px; }
.who label, .check { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; }
dialog { border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); color: var(--ink); padding: 18px; width: min(32rem, calc(100vw - 32px)); box-sizing: border-box; }
dialog::backdrop { background: rgb(43 34 32 / 0.35); }
/* Activities (D-051): the day and filter tick rows and the photo placeholder. Tokens only. */
.days { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.days label { display: inline-flex; gap: 6px; align-items: center; }
.mark { margin-left: 6px; font-size: 12px; font-weight: 500; }
.mark[data-mark="required"] { color: var(--accent); }
.mark[data-mark="optional"] { color: var(--ink-soft); }
.photo-ph { aspect-ratio: 16 / 9; max-width: 16rem; margin-top: 10px; border: 1px dashed var(--edge); border-radius: 6px; background: var(--paper); }
@media (min-width: 48rem) {
  .date-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Calendar (#197, D-059): a Sunday-first month grid of day cells. Layout only; colours are the existing tokens. */
.cal { max-width: 40rem; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.cal-bar h2 { margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0.75rem 0; }
.cal-day, .cal-blank { min-height: 3.5rem; }
.cal-day { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--sheet); font: inherit; font-size: 13px; }
div.cal-day { color: var(--ink-soft); }
.cal-num { font-weight: 500; }
.cal-tag { font-size: 11px; color: var(--ink-soft); }
.cal-day.today .cal-num { text-decoration: underline; }
.cal-day.night { border-color: var(--edge); }
.cal-day.selected { background: var(--accent-soft); border-color: var(--accent); border-width: 2px; }
.cal-day.target { background: var(--accent-soft); border: 2px dashed var(--accent); }
.cal-day.was-here { border-style: dashed; }

/* Loading panel: shown instead of the landing while the page is signing in (boot.js sets the marker, app.js clears it). */
#signing-in-panel { display: none; }
.signing-in #signing-in-panel { display: grid; justify-items: center; gap: 16px; margin-top: 20vh; }
.signing-in #landing { display: none; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; opacity: 0; animation: spinner-fade 0.2s 0.3s forwards, spinner-turn 0.9s linear infinite; }
@keyframes spinner-fade { to { opacity: 1; } }
@keyframes spinner-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: spinner-fade 0.2s 0.3s forwards; }
}
/* The Customers notes keep the line breaks staff typed (D-071). */
#notes-list p { margin: 0 0 2px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* The night and Past dates (D-091): layout only, on the shared tokens and components. */
#night-top { display: grid; gap: 2px; }
#night-top .night-label { color: var(--ink-soft); font-size: 13.5px; }
#night-top .night-address { font-family: var(--serif); font-size: 1.25rem; }
#night-body { display: grid; gap: 8px; }
#night-body .night-row { padding: 8px 12px; border-radius: 6px; border: 1px dashed var(--edge); color: var(--ink-soft); }
#night-body .night-row.past { border: 0; padding: 2px 0; }
#night-body .night-stop { display: grid; gap: 4px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); }
#night-body .night-welcome { background: var(--accent-soft); border-radius: 6px; padding: 10px 12px; }
.night-call { position: sticky; bottom: 0; background: var(--accent-soft); border-top: 1px solid var(--line); padding: 10px 0; text-align: center; }
#past-list { display: grid; gap: 10px; }
#past-list .past-stop { color: var(--ink); }
