[hidden] { display: none !important; }
.flush { margin-top: 0; }
.wide { grid-column: 1 / -1; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 8px; }
h3.sub { font-size: 16px; margin: 16px 0 8px; }
h3.sub.flush { margin-top: 0; }
h2 { scroll-margin-top: 12px; }
section { margin-bottom: 8px; }
/* base.css gives ".card p" a size and colour; these rules are written to outrank it on purpose */
.card .small { font-size: 13px; }
.note { margin: 0 0 16px; padding: 10px 12px; border-inline-start: 3px solid var(--accent); background: var(--chip); border-radius: 8px; }
.notice { margin: 0 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow-wrap: anywhere; }
.notice.warn { border-color: var(--warn); color: var(--warn); font-weight: 600; }
.tools { margin: 0 0 12px; }

/* --- forms: a grid that folds to one column on a phone --- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px 12px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; }
.field > label.check { font-size: 15px; color: var(--ink); }
.check { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.check input, .tick input { width: 20px; height: 20px; flex: none; margin: 0; padding: 0; accent-color: var(--accent); }
.form .row { margin: 0; }
.row > label.small { margin-inline-end: 2px; }
.row > select { max-width: 100%; }
#import-file:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* --- events --- */
.evlist { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.evbtn { width: 100%; text-align: start; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; }
.evbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.evbtn .n { font-weight: 600; overflow-wrap: anywhere; }
.evbtn .left { font-weight: 600; color: var(--accent); text-align: end; }
.evbtn .left.past { color: var(--muted); }
.evbtn .m { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.event-flow { margin-top: 16px; }
.event-flow p { overflow-wrap: anywhere; }
.flow-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flow-actions > * { min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }
.flow-actions a { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.flow-actions [aria-disabled="true"] { opacity: .65; cursor: default; }
.flow-actions a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@media (max-width: 420px) { .flow-actions > * { width: 100%; } }

/* --- countdown --- */
.cd { text-align: center; margin-top: 16px; }
.cd .cd-days { font-size: clamp(34px, 11vw, 64px); font-weight: 700; line-height: 1.1; margin: 4px 0; color: var(--accent); }
.cd .cd-days .lbl { font-size: clamp(18px, 5vw, 26px); font-weight: 600; color: var(--ink); }
.cd .cd-sub { font-size: 16px; color: var(--ink); margin: 4px 0; overflow-wrap: anywhere; }
.cd #cd-live { margin: 4px 0 0; min-height: 1.5em; font-variant-numeric: tabular-nums; }
.jump { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0 0; }
.jump a { display: inline-block; padding: 6px 8px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; font-size: 14px; }

/* --- lists (checklist, budget, vendors, guests) --- */
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { background: var(--surface); border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: start; }
.list li[data-state="overdue"] { border-inline-start-color: var(--warn); }
.list li[data-state="soon"] { border-inline-start-color: var(--accent); }
.list li[data-state="done"] .t { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.list .t { font-weight: 600; overflow-wrap: anywhere; }
.list .meta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.list .notes { grid-column: 1 / -1; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.list .acts { grid-column: 1 / -1; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.list .acts button, .list .acts select { min-height: 32px; padding: 2px 10px; font-size: 13px; width: auto; max-width: 100%; }
.tick { display: flex; align-items: flex-start; gap: 8px; min-height: 32px; cursor: pointer; }
.tick input { margin-top: 3px; }
.pill.overdue { background: transparent; border: 1px solid var(--warn); color: var(--warn); font-weight: 600; }
.pill.soon { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pill.paid { background: var(--accent); color: var(--accent-ink); }
.starter { margin-bottom: 12px; }
.starter p { margin: 0 0 8px; }
.starter .row { margin-bottom: 8px; }
details summary { cursor: pointer; padding: 6px 0; }
.preview { margin: 0 0 4px; padding-inline-start: 20px; font-size: 14px; }
.preview li { margin-bottom: 2px; overflow-wrap: anywhere; }
.preview .off { color: var(--muted); font-variant-numeric: tabular-nums; }

/* --- totals: a long label wraps above its value; the value is never cut in the middle --- */
.stats { margin: 8px 0; display: grid; gap: 6px; }
.stat { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.stat dt { color: var(--muted); font-size: 14px; }
.stat dd { margin: 0; margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; text-align: end; overflow-wrap: anywhere; }
.stats.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- print: only #print-view renders; every control, the budget and the guest list stay off the page --- */
.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; font: 12pt/1.4 var(--font); }
  #print-view h1 { font-size: 22pt; margin: 0 0 4px; }
  #print-view h2 { font-size: 15pt; margin: 18px 0 6px; }
  #print-view p { margin: 0 0 6px; color: #000; }
  #print-view table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
  #print-view th, #print-view td { text-align: left; padding: 4px 6px; border-bottom: 1px solid #888; font-size: 11pt; vertical-align: top; overflow-wrap: break-word; }
  #print-view th { border-bottom: 2px solid #000; }
  #print-view th:nth-child(4), #print-view td:nth-child(4) { white-space: nowrap; }
  #print-view tr { break-inside: avoid; }
  #print-view a { color: #000; text-decoration: none; }
  #print-view .pbox { display: inline-block; width: 13px; height: 13px; border: 1.5px solid #000; line-height: 11px; text-align: center; font-size: 11px; font-weight: 700; }
  #print-view .small { font-size: 10pt; }
}

/* MARKED LAYER mobile-first-20261025: standalone controls stay usable at 320px. */
@media screen {
  body button, body select, body textarea, body summary, body .btn,
  body .event-list button, body .list .acts button, body .list .acts select,
  body .flow-nav a, body .flow-actions a, body .related a, body .jump a,
  body header.top a, body .check, body .tick,
  body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {
    min-block-size: 44px; min-inline-size: 44px; max-inline-size: 100%;
  }
  body button, body .btn, body summary, body .flow-nav a, body .flow-actions a,
  body .related a, body .jump a, body header.top a { white-space: normal; overflow-wrap: anywhere; }
  body .btn, body .flow-nav a, body .flow-actions a, body .related a,
  body .jump a, body header.top a { display: inline-flex; align-items: center; }
  body .list .acts button, body .list .acts select { padding-block: 8px; }
  body summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
  .row > *, .flow-nav > *, .flow-actions > *, .related > *, header.top > * { max-inline-size: 100%; }
}
@media screen and (max-width: 600px) {
  body input, body textarea, body select, body .list .acts select,
  body .language-control select { font-size: 16px; }
  .card, .field, .form, .event-fields, .tab-panel { min-inline-size: 0; }
  .coverage dt, .coverage dd, .totals dt { overflow-wrap: anywhere; }
}
@media screen and (max-width: 360px) {
  .card { padding: 12px; }
  .form, .event-fields { grid-template-columns: minmax(0, 1fr); }
  .coverage, .totals { grid-template-columns: minmax(0, 1fr); }
}
