/* Fanetti AI - © 2026 Jon Fanetti - fanettiai.com - not for resale */
/* Event Planner · Parties and Guest Lists · styles
   Design tokens follow CONVENTIONS.md (Fanetti AI series). Only --accent* differ per app. */
:root {
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --radius: 12px; --radius-sm: 8px; --gap: 16px; --tap: 44px;
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef1f4; --border: #d5dbe1;
  --text: #1b2127; --text-muted: #55606b;
  --accent: #9d174d; --accent-hover: #831843; --accent-contrast: #ffffff; --accent-soft: #fce7f3;
  --danger: #b42318; --danger-soft: #fde8e6; --warn: #8a5a00; --warn-soft: #fff4d6; --ok-soft: #dff1e9; --ok: #1f6f50; --focus: #2563eb;
  --c2: #b45309; --c3: #0e7490;
  --p-red: #c62828; --p-orange: #c2410c; --p-gold: #a16207; --p-green: #2e7d32; --p-teal: #0f766e; --p-blue: #1d4ed8; --p-purple: #7e22ce; --p-pink: #be185d;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.06);
  --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #12161a; --surface: #1b2127; --surface-2: #242c33; --border: #36414b;
  --text: #e9eef2; --text-muted: #a5b1bc;
  --accent: #f9a8d4; --accent-hover: #fbcfe8; --accent-contrast: #12161a; --accent-soft: #4a1d34;
  --danger: #ff8a80; --danger-soft: #3a1f1d; --warn: #f2c14e; --warn-soft: #3a311a; --ok-soft: #1d3a2d; --ok: #7fdcb0; --focus: #7aa7ff;
  --c2: #fbbf24; --c3: #67e8f9;
  --p-red: #f87171; --p-orange: #fb923c; --p-gold: #facc15; --p-green: #4ade80; --p-teal: #2dd4bf; --p-blue: #60a5fa; --p-purple: #c084fc; --p-pink: #f472b6;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45; background: var(--bg); color: var(--text);
  padding-left: var(--safe-left); padding-right: var(--safe-right); -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.25rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; margin-top: 1em; } h4 { font-size: .95rem; margin: .75em 0 .25em; }
p { margin: 0 0 .75em; }
a { color: var(--accent); overflow-wrap: anywhere; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.hint { color: var(--text-muted); font-size: .875rem; margin: 4px 0 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: var(--gap); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { min-height: var(--tap); display: inline-flex; align-items: center; position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 10px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: calc(8px + var(--safe-left)); }

/* ---------- buttons & inputs (44px tap targets) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); min-width: var(--tap); padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; touch-action: manipulation; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="dark"] .btn.danger { color: #2a0b08; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn.small { font-size: .9rem; padding: 0 10px; }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: 0 24px; }
.btn.icon-btn { padding: 0; width: var(--tap); }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; text-decoration: underline;
  min-height: var(--tap); display: inline-flex; align-items: center; touch-action: manipulation; }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  font: inherit; font-size: 16px; /* 16px stops iOS zooming into fields */ color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); min-height: var(--tap); padding: 6px 10px; width: 100%; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
input[type=range] { width: 100%; min-height: var(--tap); accent-color: var(--accent); }
.choice { display: flex; align-items: center; gap: 10px; min-height: var(--tap); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.field > label { font-weight: 600; font-size: .9rem; }
.field.inline { margin: 0; min-width: 140px; flex: 1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 12px; min-width: 0; }
legend { font-weight: 600; padding: 0 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-errors { color: var(--danger); background: var(--danger-soft); padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 12px; }
.form-errors ul { margin: 0; padding-left: 1.2em; }
.msgbox { padding: 8px 12px; border-radius: var(--radius-sm); margin: 8px 0; font-weight: 600; }
.msgbox.ok { background: var(--ok-soft); color: var(--ok); }
.msgbox.error { background: var(--danger-soft); color: var(--danger); }
.msgbox.warn { background: var(--warn-soft); color: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--gap); }
.card > h3:first-child, .card > h2:first-child { margin-top: 0; }
.chip { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.plain-list { list-style: none; margin: 0; padding: 0; }

/* ---------- header & tabs ---------- */
.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: calc(10px + var(--safe-top)) 20px 10px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { margin: 0; }
.tagline { margin: 0; font-size: .8rem; color: var(--text-muted); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.tab { min-height: var(--tap); padding: 0 14px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.tab:hover { background: var(--surface-2); }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 -3px 0 var(--accent); }
.header-actions { display: flex; gap: 6px; }

/* ---------- layout ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 20px 20px 40px; outline: none; }
.view-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.view-head h2, .view-head h3 { margin: 0; }
.view-head select { width: auto; }
.app-footer { text-align: center; color: var(--text-muted); font-size: .85rem; padding: 0 20px calc(24px + var(--safe-bottom)); }
.brandname { font-weight: 700; }
.banners { max-width: 1100px; margin: 12px auto 0; padding: 0 20px; display: grid; gap: 8px; }
.banners:empty { display: none; }
.banner { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.banner > span { flex: 1 1 260px; }
.banner.reminder { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.banner.error { background: var(--danger-soft); border-color: var(--danger); color: var(--text); }
.banner.info { background: var(--warn-soft); border-color: var(--warn); }
.empty { text-align: center; max-width: 560px; margin: 24px auto; }
.empty-emoji { font-size: 3rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 var(--gap); padding: 0; list-style: none; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
.stat-label { display: block; color: var(--text-muted); font-size: .85rem; }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; }
.stat-sub { display: block; color: var(--text-muted); font-size: .8rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { font-size: .85rem; color: var(--text-muted); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--gap); }

/* ---------- charts (inline SVG) ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart-grid line { stroke: var(--border); stroke-width: 1; }
.chart-grid text, .chart-x, .chart-val, .chart-empty { fill: var(--text-muted); font-size: 12px; font-family: var(--font); }
.chart-val { fill: var(--text); font-weight: 600; }
.chart-series polyline { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-series.s1 polyline { stroke: var(--accent); } .chart-series.s1 circle { fill: var(--accent); }
.chart-series.s2 polyline { stroke: var(--c2); } .chart-series.s2 circle { fill: var(--c2); }
.chart-series.s3 polyline { stroke: var(--c3); } .chart-series.s3 circle { fill: var(--c3); }
.chart-series.faint circle { fill: var(--text-muted); opacity: .55; }
.chart-series polyline.dash { stroke-dasharray: 6 5; }
.chart-goal { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-goal-text { fill: var(--ok); font-size: 12px; font-weight: 600; }
.chart-bar rect { fill: var(--accent); }
.chart-bar.alt rect { fill: var(--c2); }
.chart-bar.muted rect { fill: var(--border); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--text-muted); list-style: none; padding: 0; margin: 4px 0 0; }
.legend .sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent); }
.legend .sw.s2 { background: var(--c2); } .legend .sw.s3 { background: var(--c3); } .legend .sw.faint { background: var(--text-muted); }

/* ---------- dialogs & toast ---------- */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px - var(--safe-top) - var(--safe-bottom)); padding: 20px; overflow-y: auto; }
dialog::backdrop { background: rgb(10 14 22 / 55%); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; position: sticky; bottom: -20px; background: var(--surface); padding: 8px 0; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + var(--safe-bottom)); z-index: 50; display: flex; gap: 12px; align-items: center;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); max-width: calc(100vw - 24px); }
.toast .btn { background: var(--bg); color: var(--text); }

/* ---------- phones (360–430px) and small windows ---------- */
@media (max-width: 760px) {
  .app-header { padding: calc(8px + var(--safe-top)) 12px 8px; gap: 8px; }
  .brand { flex: 1; }
  .tagline { display: none; }
  .tabs { order: 3; flex-basis: 100%; }
  .tab { padding: 0 10px; }
  main { padding: 14px 12px 32px; }
  .banners { padding: 0 12px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding: 8px 6px; }
}
@media (max-width: 430px) {
  h1 { font-size: 1.05rem; }
  main { padding-left: 8px; padding-right: 8px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .view-head > .row { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.2rem; }
}
@media (pointer: coarse), (max-width: 430px) {
  .link-btn { min-height: var(--tap); min-width: var(--tap); }
}

/* ---------- print: the current page (or the part picked with body[data-print]) without buttons ---------- */
@media print {
  .app-header, .banners, .toast, .app-footer, .btn, .no-print, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .stat { box-shadow: none; break-inside: avoid; }
  main { padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ================= Shared extras ================= */
dialog.wide { width: min(820px, calc(100vw - 24px)); }
details.more { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; margin: 8px 0 0; }
details.more > summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 600; }
details.more[open] > summary { margin-bottom: 8px; }
/* ================= series components (lists, stats, progress, tables) ================= */
.over-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; margin-top: var(--gap); }
.over-grid > .stack > .card > h3:first-child { margin-top: 0; }
.stat.big .stat-value { font-size: 1.6rem; }
.note-line { font-size: .875rem; color: var(--text-muted); margin: 4px 0 0; }
.disclaimer { margin-top: var(--gap); }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.mini-list li:last-child { border-bottom: 0; }
.mini-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; flex: 1; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.when { font-size: .85rem; color: var(--text-muted); }
.cat-ico { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--accent-soft); font-size: 1.25rem; }
.sub-list { list-style: none; margin: var(--gap) 0 0; padding: 0; display: grid; gap: 8px; }
.sub-row { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 64px; padding: 10px 12px; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; }
.sub-row:hover { background: var(--surface-2); }
.sub-row.dim { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.sub-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sub-row-name { font-weight: 700; overflow-wrap: anywhere; }
.sub-row-meta { font-size: .85rem; color: var(--text-muted); }
.sub-row-cost { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.status { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.status.good { background: var(--ok-soft); border-color: var(--ok); }
.status.later { background: var(--accent-soft); border-color: var(--accent); }
.status.cancelled { background: var(--danger-soft); border-color: var(--danger); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 6px 0; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 8px 0; }
.dl dt { color: var(--text-muted); font-size: .9rem; }
.dl dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.rate-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.rate-row .field { margin: 0; flex: 1 1 160px; }
.cmp-grid { display: grid; gap: 10px; }
.cmp-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.cmp-card.on { border: 2px solid var(--accent); background: var(--accent-soft); }
.cmp-card h4 { margin-top: 0; }
.btn.chosen { border-color: var(--accent); color: var(--text); font-weight: 700; }
.order-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.order-list li:last-child { border-bottom: 0; }
.order-n { font-weight: 700; width: 1.5em; text-align: center; color: var(--text-muted); }
.target { margin: 0; font-weight: 600; flex: 2 1 200px; }
.big-num { font-size: 2.2rem; font-weight: 700; margin: 0; color: var(--accent); }
.table-wrap { overflow-x: auto; margin-top: 8px; }
table.sched { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .925rem; }
table.sched th, table.sched td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
table.sched .num { text-align: right; white-space: nowrap; }
table.sched thead th { color: var(--text-muted); font-weight: 600; }
table.sched tr.milestone { background: var(--ok-soft); }
.msgbox p:last-child { margin-bottom: 0; }
.print-only { display: none; }
@media (max-width: 760px) {
  .over-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .sub-row .cat-ico { display: none; }
  table.sched th, table.sched td { padding: 6px 4px; }
  .order-list .cat-ico { display: none; }
}
@media print {
  .sub-row, .cmp-card { box-shadow: none; break-inside: avoid; }
  .print-only { display: block; }
  .print-title { font-weight: 700; }
  table.sched tr { break-inside: avoid; }
  .chart-series.s1 polyline { stroke: #000; }
}
/* Fanetti AI credit line (static text only) */
.fai-footer { padding: 4px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.fai-credit { margin: 6px 0 0; text-align: center; color: var(--text-muted, #55606b); font-size: .8rem; line-height: 1.4; }
@media (max-width: 699px) { .fai-footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); } }
@media print {
  body .app-footer, body .fai-footer, body[data-print] > .app-footer:not(#fai), body[data-print] > .fai-footer:not(#fai) { display: block !important; padding: 8pt 0 0; }
  body .app-footer > :not(.fai-credit) { display: none !important; }
  body .fai-credit { color: #000; font-size: 8pt; text-align: center; }
}

/* ---------- lists ---------- */
.day-title { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.day-title h3 { margin: 0; }
.group-list { display: grid; gap: 10px; margin-top: var(--gap); }
.group-list .sub-list { margin-top: 8px; }

/* ---------- Event Planner ---------- */
.progress > span { width: var(--pct, 0%); }
.ev-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.ev-card .sub-row-cost { align-items: flex-end; }
.when { color: var(--text-muted); font-weight: 600; }
.keep-lines { white-space: pre-line; overflow-wrap: anywhere; }
.task-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.task-row:last-child { border-bottom: 0; }
.task-row .sub-row-text { flex: 1 1 200px; min-width: 0; }
.task-row.dim .sub-row-name { text-decoration: line-through; color: var(--text-muted); }
.check-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; flex: none; cursor: pointer; }
.task-row input[type=checkbox] { width: 24px; height: 24px; margin: 0; }
.qty { min-width: 3ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-time { min-width: 6.5em; font-weight: 700; font-variant-numeric: tabular-nums; }
.rsvp-sel { width: auto; min-width: 9.5em; }
.rsvp-sel.rsvp-yes { border-color: var(--ok); background: var(--ok-soft); }
.rsvp-sel.rsvp-maybe { border-color: var(--warn); background: var(--warn-soft); }
.rsvp-sel.rsvp-no { border-color: var(--border); background: var(--surface-2); }
.rule-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.rule-row .field { flex: 0 1 140px; }
.rule-word { padding-bottom: 14px; font-weight: 600; }
.field.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field.inline > label { margin: 0; }
.field.inline select { width: auto; }
.filters { margin-bottom: 4px; }
.filters .field { margin-bottom: 4px; }
.group-list h4 { margin: 4px 0 0; }
.tpl-card .mini-list { margin: 0; padding: 0; list-style: none; }
.tpl-card h3 .chip { vertical-align: middle; margin-left: 4px; }
@media (max-width: 430px) {
  .rsvp-sel { min-width: 0; flex: 1 1 auto; }
  .slot-time { min-width: 5.5em; }
}
@media print {
  .task-row, .tpl-card { break-inside: avoid; }
  .task-row.dim .sub-row-name { color: #000; }
  .filters, .rsvp-sel { display: none !important; }
  .print-only { display: inline; }
  section.print-only { display: block; }
  .progress { display: none; }
  /* Print run sheet: the event header, supplies, dietary needs, schedule and the "Coming" list only */
  body[data-print="runsheet"] #view-events > :not(.pr-run) { display: none !important; }
  /* Print guest list: the event header, headcount and every guest with their reply */
  body[data-print="guests"] #view-events > :not(.pr-guests) { display: none !important; }
  body[data-print="guests"] .stats { grid-template-columns: repeat(4, 1fr); }
  body[data-print="guests"] #statTasks, body[data-print="guests"] #statGot { display: none; }
}
main { min-height: 100vh; }

/* Windows High Contrast: keep custom borders, pressed states, progress bars and chart lines visible. */
@media (forced-colors: active) {
  .card, .stat, .status, .chip, dialog { border: 1px solid CanvasText; }
  .btn, .tab, .seg > * { border: 1px solid ButtonText; }
  .btn[aria-pressed="true"], .btn.chosen, .tab[aria-selected="true"], .seg [aria-pressed="true"] {
    border: 2px solid Highlight;
    outline: 2px solid Highlight;
    outline-offset: 1px;
  }
  .progress { border: 1px solid CanvasText; background: Canvas; }
  .progress > span { background: Highlight; }
  .chart-grid line { stroke: CanvasText; }
  .chart-series.s1 polyline, .chart-series.s1 circle, .chart-bar rect { stroke: Highlight; fill: Highlight; }
  .chart-series.s2 polyline, .chart-series.s2 circle { stroke: CanvasText; fill: CanvasText; }
  .chart-series.s3 polyline, .chart-series.s3 circle { stroke: CanvasText; fill: CanvasText; }
  .chart-goal { stroke: CanvasText; }
  .chart-goal-text { fill: CanvasText; }
}
