/* Tavola — "pianta di sala": white stationery, a pale floor for the room, tables drawn with their seats. */
:root {
  --bg: #ffffff;
  --sala: #f4f1f2;
  --sala-line: #e6e0e3;
  --ink: #1f2330;
  --ink-2: #454a57;
  --muted: #5d6270;
  --line: #e2dde0;
  --line-2: #cbc4c8;
  --accent: #7a2e43;
  --accent-2: #5f2134;
  --accent-tint: #f7edf0;
  --sposa: #c4577a;
  --sposo: #3d6db0;
  --entrambi: #5b8c61;
  --none: #9aa0aa;
  --free: #b4acb0;
  --bad: #b3261e;
  --bad-tint: #fcebea;
  --warn: #8a5300;
  --warn-tint: #fdf3e1;
  --ok: #2c6e48;
  --f-ui: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  --f-display: Optima, "Optima Nova", Candara, "Avenir Next", "Segoe UI", sans-serif;
  --f-print: Didot, "Bodoni 72", "Bodoni MT", "Libre Bodoni", Georgia, "Times New Roman", serif;
  --r: 6px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-ui); }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: .005em; line-height: 1.2; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------- buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--r);
  background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn:hover { border-color: var(--ink-2); background: #faf8f9; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); border-color: #e3b9b6; }
.btn.danger:hover { background: var(--bad-tint); border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0 2px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }
.iconbtn { width: 40px; height: 40px; border: 0; border-radius: var(--r); background: transparent; cursor: pointer; font-size: 18px; color: var(--muted); }
.iconbtn:hover { background: var(--sala); color: var(--ink); }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; font-size: 15px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[aria-invalid=true] { border-color: var(--bad); background: var(--bad-tint); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
.field-error { color: var(--bad); font-size: 14px; margin: 6px 0 0; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 28px; padding: 12px clamp(16px, 3vw, 40px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--accent); text-decoration: none; font: 600 22px/1 var(--f-display); letter-spacing: .04em; }
.brand svg { width: 30px; height: 30px; }
.brand .seat-free { fill: none; stroke: currentColor; stroke-width: 1.2; }
.brand span { color: var(--ink); }
.top nav { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--ink-2); text-decoration: none; font-size: 15px; padding: 8px 10px; border-radius: var(--r); }
.top nav a:hover { background: var(--sala); color: var(--ink); }

/* ---------- intro ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; padding: 26px clamp(16px, 3vw, 40px) 18px; }
.intro h1 { margin: 0 0 6px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 500; letter-spacing: .01em; }
.intro p { margin: 0; max-width: 66ch; color: var(--ink-2); font-size: 16px; }
.intro-steps { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; color: var(--ink-2); font-size: 14px; }
.intro-steps li { display: flex; align-items: center; gap: 8px; max-width: 15em; line-height: 1.35; }
.intro-steps b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 1.5px solid var(--accent); border-radius: 50%; color: var(--accent); font: 600 14px var(--f-display); }

/* ---------- example bar ---------- */
.example-bar { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; margin: 0 clamp(16px, 3vw, 40px); padding: 10px 14px; background: var(--accent-tint); border: 1px solid #ead3da; border-radius: var(--r); }
.example-bar[hidden] { display: none; }
/* Own list saved: hide the example bar from the first paint (set in <head>, cleared by the page script). */
.tv-own .example-bar { display: none; }
.example-bar p { margin: 0; flex: 1 1 340px; font-size: 15px; }
.ex-tag { background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 4px 9px; border-radius: 3px; }
.ex-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- board ---------- */
.board { margin-top: 14px; border-top: 1px solid var(--line); }
.eventbar { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; padding: 14px clamp(16px, 3vw, 40px) 8px; }
.event-fields { flex: 1 1 360px; min-width: 0; }
#event-title { border: 0; border-bottom: 1px dashed transparent; border-radius: 0; padding: 2px 0; min-height: 0; font: 600 26px/1.25 var(--f-display); letter-spacing: .01em; background: transparent; }
#event-sub { border: 0; border-bottom: 1px dashed transparent; border-radius: 0; padding: 2px 0; min-height: 32px; color: var(--ink-2); background: transparent; }
#event-title:hover, #event-sub:hover { border-bottom-color: var(--line-2); }
#event-title:focus-visible, #event-sub:focus-visible { outline: none; border-bottom: 1px solid var(--accent); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: flex; flex-wrap: wrap; margin: 0; padding: 4px clamp(16px, 3vw, 40px) 14px; gap: 0; }
.stat { padding: 4px 22px 4px 0; margin-right: 22px; border-right: 1px solid var(--line); min-width: 0; }
.stat:last-child { border-right: 0; }
.stat dt { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.stat dd { margin: 0; font: 600 26px/1.15 var(--f-display); font-variant-numeric: tabular-nums; }
.stat dd small { display: block; font: 500 13px/1.3 var(--f-ui); color: var(--muted); margin-top: 1px; }
.stat.warn dd { color: var(--warn); }
.stat.bad dd { color: var(--bad); }
.stat.ok dd { color: var(--ok); }

.alert { margin: 0 clamp(16px, 3vw, 40px) 12px; padding: 10px 14px; border: 1px solid #e9b4b0; border-left: 4px solid var(--bad); background: var(--bad-tint); border-radius: var(--r); font-size: 15px; }
.alert p { margin: 2px 0; }
.alert .linkbtn { color: var(--bad); }

.mtabs { display: none; }

.work { display: grid; grid-template-columns: 340px minmax(0, 1fr); border-top: 1px solid var(--line); min-height: 560px; }

/* ---------- guest panel ---------- */
.guests { border-right: 1px solid var(--line); padding: 14px 18px 18px; display: flex; flex-direction: column; min-width: 0; }
.add-guest label { margin-top: 0; }
.add-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.add-row input { grid-column: 1 / -1; }
.add-row .btn { padding: 8px 12px; }
.paste { margin-top: 10px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.paste summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.paste textarea { margin: 6px 0 8px; resize: vertical; }
.finder { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { min-height: 34px; padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed=true] .n { color: #d8d9de; }
.guest-list { flex: 1; margin: 12px -8px 0; padding: 4px 4px 8px; border-radius: var(--r); min-height: 120px; }
.list-head { margin: 0 4px 6px; font-size: 13px; color: var(--muted); }
.list-empty { margin: 8px 4px; color: var(--muted); font-size: 15px; }
.hint-local { margin: 12px 0 0; font-size: 13px; color: var(--muted); }

/* a guest row */
.g { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 36px; padding: 5px 6px; border-radius: 4px; cursor: grab; font-size: 15px; line-height: 1.3; user-select: none; }
.g:hover { background: var(--sala); }
.g:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-tint); }
.g.dragging { opacity: .45; }
.g-name { flex: 1 1 9em; min-width: 0; overflow-wrap: anywhere; }
.g-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.tag { font-size: 12px; line-height: 1; padding: 4px 6px; border-radius: 3px; white-space: nowrap; font-weight: 600; }
.tag-kid { background: var(--warn-tint); color: #6e4300; }
.tag-diet { background: #e5f1e8; color: #1f5a37; }
.tag-note { background: #eceef2; color: var(--ink-2); }
.tag-apart { background: var(--bad-tint); color: var(--bad); }
.g.conflict { box-shadow: inset 3px 0 0 var(--bad); background: #fff6f5; }
.tbl.has-conflict { border-color: var(--bad); }
.tbl-warn { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--bad); }
.apart { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px 12px; margin: 16px 0 0; }
.apart legend { font-weight: 600; padding: 0 4px; }
.apart-list { list-style: none; margin: 0; padding: 0; }
.apart-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.apart-list li > span:first-child { flex: 1; }
.apart-empty, .apart-hint { margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.apart-empty[hidden] { display: none; }
.apart-hint { margin: 8px 0 0; }
.apart-add { display: flex; gap: 8px; margin-top: 8px; }
.apart-add select { flex: 1; min-width: 0; }
.g-table { flex: none; max-width: 40%; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-table.none { color: var(--warn); font-weight: 600; }
.dot { flex: none; display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--none); }
.dot.side-sposa { background: var(--sposa); }
.dot.side-sposo { background: var(--sposo); }
.dot.side-entrambi { background: var(--entrambi); }
.dot.free { background: #fff; border: 1.5px dashed var(--free); }

/* ---------- sala ---------- */
.sala { background: var(--sala); padding: 14px clamp(14px, 2vw, 24px) 28px; min-width: 0; outline: none;
  background-image: linear-gradient(var(--sala-line) 1px, transparent 1px), linear-gradient(90deg, var(--sala-line) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 12px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .legend-hint { color: var(--muted); margin-left: auto; }
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.tbl { background: #fff; border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 10px 8px; min-width: 0; transition: border-color .15s, background-color .15s; }
.tbl.is-full { border-top: 3px solid var(--ok); }
.tbl.is-over { border: 1px solid var(--bad); border-top: 3px solid var(--bad); background: #fffafa; }
.tbl.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-tint); }
.tbl.drag-full { outline: 2px dashed var(--bad); outline-offset: 2px; background: var(--bad-tint); }
.tbl-head { display: flex; align-items: flex-start; gap: 8px; }
.tbl-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; background: none; border: 0; padding: 4px 2px; min-height: 40px; cursor: pointer; border-radius: 4px; }
.tbl-name:hover .tbl-edit { opacity: 1; }
.tbl-num { flex: none; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border: 1.5px solid var(--ink-2); border-radius: 50%; font: 600 14px var(--f-display); }
.tbl-title { font: 600 19px/1.2 var(--f-display); overflow-wrap: anywhere; }
.tbl-edit { font-size: 12px; color: var(--accent); font-weight: 600; opacity: .0; text-decoration: underline; text-underline-offset: 2px; }
.tbl-name:focus-visible .tbl-edit { opacity: 1; }
.tbl-cap { flex: none; margin: 4px 0 0; text-align: right; font-size: 13px; color: var(--muted); line-height: 1.25; }
.tbl-cap b { display: block; font: 600 20px/1.1 var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.is-full .tbl-cap span { color: var(--ok); font-weight: 600; }
.is-over .tbl-cap b, .is-over .tbl-cap span { color: var(--bad); font-weight: 700; }
.tbl-meta { margin: 0 2px; font-size: 13px; color: var(--muted); }
.diagram { display: block; margin: 6px auto 4px; }
.diagram.round { width: 128px; height: 128px; }
.diagram.long { max-width: 100%; height: auto; }
.diagram .tabletop { fill: #faf7f8; stroke: var(--line-2); stroke-width: 1.2; }
.diagram .tnum { font: 600 20px var(--f-display); fill: var(--muted); text-anchor: middle; }
.diagram.long .tnum { font-size: 15px; }
.seat { stroke: #fff; stroke-width: 1.5; fill: var(--none); }
.seat.side-sposa { fill: var(--sposa); }
.seat.side-sposo { fill: var(--sposo); }
.seat.side-entrambi { fill: var(--entrambi); }
.seat.free { fill: #fff; stroke: var(--free); stroke-dasharray: 2.4 2; stroke-width: 1.3; }
.seat.over { stroke: var(--bad); stroke-width: 2.4; }
.tbl-guests { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.drop-hint { margin: 6px 4px; font-size: 14px; color: var(--muted); font-style: italic; }
.tbl-add { width: 100%; min-height: 40px; margin-top: 6px; border: 1px dashed var(--line-2); border-radius: 4px; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.tables.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tables.compact .tbl-guests, .tables.compact .tbl-add { display: none; }
.legend .chip { min-height: 34px; }
.pick-first { margin-top: 10px; }
.tbl-add:hover { background: var(--accent-tint); border-color: var(--accent); }

.empty { background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 28px; max-width: 560px; }
.empty[hidden] { display: none; }
.empty-title { font: 600 22px var(--f-display); margin: 0 0 6px; }
.empty p { margin: 0 0 14px; color: var(--ink-2); }
.empty-actions { display: flex; gap: 8px; flex-wrap: wrap; }


/* ---------- guide / csv / faq ---------- */
.guide, .csvdoc, .faq { padding: 44px clamp(16px, 3vw, 40px) 8px; max-width: 1240px; }
.guide h2, .csvdoc h2, .faq h2 { font-size: clamp(24px, 2.4vw, 30px); font-weight: 500; margin: 0 0 18px; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; }
.guide-grid > div { border-top: 2px solid var(--ink); padding-top: 12px; }
.guide h3 { font-size: 18px; margin: 4px 0 6px; }
.guide p, .guide li, .csvdoc p, .faq p { font-size: 16px; color: var(--ink-2); }
.guide ul { padding-left: 18px; margin: 6px 0; }
.guide li { margin-bottom: 6px; }
.csvdoc p { max-width: 80ch; }
.table-scroll { overflow-x: auto; margin: 6px 0 12px; }
.doc-table { border-collapse: collapse; width: 100%; max-width: 980px; font-size: 15px; }
.doc-table th, .doc-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); border-bottom: 2px solid var(--ink); }
.doc-table tbody th { font-weight: 600; white-space: nowrap; }
.doc-table small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.faq { padding-bottom: 40px; max-width: 900px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: 17px; min-height: 44px; }
.faq details p { margin: 0 0 14px; }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 22px clamp(16px, 3vw, 40px) 30px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 15px; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.foot-brand { font: 600 20px var(--f-display); color: var(--accent); letter-spacing: .04em; }
.foot a { color: var(--ink-2); }
.foot .tw-xlinks a { color: var(--ink-2); }

/* ---------- dialogs ---------- */
.dlg { padding: 0; border: 0; border-radius: 10px; width: min(600px, calc(100vw - 24px)); max-height: min(88vh, 860px); color: var(--ink); background: #fff; box-shadow: 0 24px 60px rgba(31, 35, 48, .25); }
.dlg::backdrop { background: rgba(31, 35, 48, .45); }
.dlg-inner { display: flex; flex-direction: column; max-height: min(88vh, 860px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 8px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 22px; font-weight: 600; overflow-wrap: anywhere; outline: none; }
.dlg-body { padding: 4px 20px 16px; overflow-y: auto; }
.dlg-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fbfafb; }
.dlg-foot .btn.primary { margin-left: auto; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; }
legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 6px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.pick-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 48px; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; cursor: pointer; text-align: left; }
.pick-btn:hover { border-color: var(--ink-2); }
.pk-name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.pk-sub { font-size: 13px; color: var(--muted); }
.pick-btn.current { border: 2px solid var(--accent); background: var(--accent-tint); }
.pick-btn.full .pk-sub { color: var(--warn); }
.pick-btn.none .pk-name { color: var(--ink-2); }
.shapes { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.shapes legend { width: 100%; }
.shapes label, .radio-line { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); min-height: 40px; }
.radio-line small { color: var(--muted); font-size: 13px; font-weight: 400; }
.radio-line { flex-wrap: wrap; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.stepper { display: grid; grid-template-columns: 44px 100px 44px; gap: 6px; }
.stepper input { text-align: center; font-variant-numeric: tabular-nums; }
.order { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.check-list { margin-top: 10px; max-height: 46vh; overflow-y: auto; border-top: 1px solid var(--line); }
.check-line { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--ink); cursor: pointer; flex-wrap: wrap; }
.check-line small { width: 100%; padding-left: 49px; margin-top: -4px; color: var(--muted); font-size: 13px; font-weight: 400; }
.check-line:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; }
.file-row label.btn { margin: 0; color: var(--ink); font-size: 15px; }
.file-row:focus-within label.btn { outline: 2px solid var(--accent); outline-offset: 2px; }
.preview { margin-top: 12px; }
.pv-sum { font-size: 16px; margin: 8px 0 2px; }
.pv-err { margin: 8px 0; padding-left: 18px; color: var(--warn); font-size: 14px; }
.warn-line { margin: 8px 0; padding: 8px 10px; background: var(--bad-tint); border-left: 3px solid var(--bad); font-size: 14px; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.pv-table th, .pv-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pv-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; z-index: 60; display: flex; align-items: center; gap: 14px; max-width: min(620px, calc(100vw - 32px)); padding: 10px 14px 10px 18px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); transform: translate(-50%, 140%); opacity: 0; transition: transform .2s, opacity .2s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-act { flex: none; min-height: 36px; padding: 6px 10px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 5px; background: transparent; color: #fff; font-weight: 700; cursor: pointer; }
.toast-act:hover { background: rgba(255, 255, 255, .12); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .intro { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .work { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .top { gap: 10px; flex-wrap: wrap; }
  .top nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top nav a { white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; }
  .intro-steps { flex-direction: column; gap: 8px; }
  .intro-steps li { max-width: none; }
  .eventbar { padding-top: 12px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .actions .btn { width: 100%; }
  .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 0; }
  .stat { margin-right: 0; padding: 2px 10px; border-right: 1px solid var(--line); }
  .stat:nth-child(3n) { border-right: 0; }
  .stat dd { font-size: 23px; }
  .stat dt { letter-spacing: .05em; }
  .mtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 16px 0; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; position: sticky; top: 0; z-index: 5; background: #fff; }
  .mtabs button { min-height: 46px; border: 0; background: #fff; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--ink-2); }
  .mtabs button span { font-weight: 500; color: var(--muted); font-size: 13px; }
  .mtabs button[aria-selected=true] { background: var(--ink); color: #fff; }
  .mtabs button[aria-selected=true] span { color: #d8d9de; }
  .work { grid-template-columns: 1fr; border-top: 0; margin-top: 10px; }
  .work[data-view=sala] .guests { display: none; }
  .work[data-view=guests] .sala { display: none; }
  .guests { border-right: 0; padding: 12px 16px; }
  .sala { padding: 12px 12px 24px; }
  .legend .legend-hint { margin-left: 0; width: 100%; }
  .legend .chip { min-height: 40px; }
  .tables.compact { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tables.compact .tbl { padding: 8px 6px 6px; }
  .tables.compact .tbl-head { flex-direction: column; gap: 0; }
  .tables.compact .tbl-cap { text-align: left; margin: 0 2px; }
  .tables.compact .tbl-cap b { display: inline; margin-right: 6px; }
  .tables.compact .tbl-meta { display: none; }
  .tables.compact .diagram.round { width: 112px; height: 112px; }
  .tables.compact .tbl-title { font-size: 17px; }
  .g { min-height: 44px; }
  .chip { min-height: 40px; }
  .tbl-edit { opacity: 1; }
  .guide-grid { grid-template-columns: 1fr; }
  .dlg { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 12px 12px 0 0; max-height: 92vh; }
  .dlg-inner { max-height: 92vh; }
  .two { grid-template-columns: 1fr; }
  .pick-list { grid-template-columns: 1fr 1fr; }
  .faq summary { font-size: 16px; }
  .foot a { display: inline-flex; min-height: 40px; align-items: center; }
  .brand { min-height: 40px; }
  #event-title, #event-sub { min-height: 40px; }
  .paste summary { min-height: 40px; }
  .hint-local .linkbtn { min-height: 40px; }
}
@media (max-width: 420px) {
  .example-bar { margin: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- print ---------- */
.print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  html, body { background: #fff; }
  body { font-size: 10.5pt; }
  .print-root { display: block; color: #1a1a1a; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-root section + section { break-before: page; }
  .p-head { text-align: center; margin-bottom: 5mm; }
  .p-kicker { margin: 0 0 2mm; font: 600 8.5pt var(--f-ui); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }
  .p-title { margin: 0; font: 400 28pt/1.1 var(--f-print); letter-spacing: .01em; }
  .p-title.small { font-size: 22pt; text-align: center; }
  .p-sub { margin: 2mm 0 0; text-align: center; font: italic 11pt var(--f-print); color: #444; }
  .p-orn { width: 40mm; height: 3mm; margin: 3mm auto 0; background: linear-gradient(var(--accent), var(--accent)) center / 100% .3mm no-repeat; position: relative; }
  .p-orn::after { content: ""; position: absolute; left: 50%; top: 50%; width: 2.2mm; height: 2.2mm; background: #fff; border: .3mm solid var(--accent); transform: translate(-50%, -50%) rotate(45deg); }
  .p-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4mm 6mm; align-items: start; }
  [data-paper=a4l] .p-grid, [data-paper=a3p] .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .p-table { break-inside: avoid; text-align: center; padding: 2.5mm 2mm 1mm; border-top: .3mm solid #b8a9ae; min-width: 0; }
  .p-headtable { grid-column: 1 / -1; }
  .p-headtable ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6mm; }
  .p-tnum { margin: 0; min-height: 3mm; font: 600 7.5pt var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
  .p-tname { margin: .5mm 0 1.5mm; font: 400 15pt/1.15 var(--f-print); overflow-wrap: anywhere; }
  .p-table ul { list-style: none; margin: 0; padding: 0; }
  .p-table li { font: 10.5pt/1.4 var(--f-print); overflow-wrap: anywhere; }
  [data-paper=a3p] .p-title { font-size: 40pt; }
  [data-paper=a4l] .p-title { font-size: 24pt; }
  [data-paper=a4l] .p-head { margin-bottom: 3mm; }
  [data-paper=a4l] .p-orn { display: none; }
  [data-paper=a4l] .p-table li { line-height: 1.32; }
  [data-paper=a3p] .p-tname { font-size: 19pt; }
  [data-paper=a3p] .p-table li { font-size: 13pt; }
  .p-lookup .p-sub, .p-catering .p-sub { margin-bottom: 6mm; }
  .p-cols { columns: 3; column-gap: 7mm; }
  [data-paper=a4l] .p-cols, [data-paper=a3p] .p-cols { columns: 4; }
  .p-letter { margin: 2.5mm 0 1mm; font: 400 14pt var(--f-print); color: var(--accent); break-after: avoid; border-bottom: .2mm solid #d5c9cd; }
  .p-entry { display: flex; align-items: baseline; gap: 1.5mm; margin: 0; font: 9.5pt/1.55 var(--f-ui); break-inside: avoid; }
  .p-person { flex: 0 1 auto; max-width: 58%; min-width: 0; overflow-wrap: anywhere; }
  .p-lead { flex: 1 1 4mm; min-width: 3mm; border-bottom: .25mm dotted #888; transform: translateY(-1mm); }
  .p-where { flex: none; max-width: 48%; text-align: right; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
  .p-cat { width: 100%; border-collapse: collapse; font: 9.5pt/1.4 var(--f-ui); table-layout: fixed; }
  .p-cat th { text-align: left; font-size: 7.5pt; letter-spacing: .04em; text-transform: uppercase; border-bottom: .4mm solid #222; padding: 1.5mm 1.5mm; overflow-wrap: anywhere; }
  .p-cat th:nth-child(n+2):nth-child(-n+5) { text-align: right; }
  .p-cat td { border-bottom: .2mm solid #ccc; padding: 1.5mm; vertical-align: top; overflow-wrap: anywhere; }
  .p-cat th:nth-child(1) { width: 19%; }
  .p-cat th:nth-child(2), .p-cat th:nth-child(3) { width: 8%; }
  .p-cat th:nth-child(4), .p-cat th:nth-child(5) { width: 10%; }
  .p-cat .num { text-align: right; font-variant-numeric: tabular-nums; }
  .p-cat tr { break-inside: avoid; }
  .p-cat tfoot td { font-weight: 700; border-top: .4mm solid #222; border-bottom: 0; }
  .p-note { font: 9pt var(--f-ui); color: #555; margin-top: 3mm; }
}

/* ---------- text pages (about, privacy) ---------- */
.page { max-width: 760px; padding: 36px clamp(16px, 3vw, 40px) 48px; }
.page h1 { font-size: clamp(30px, 3.4vw, 40px); font-weight: 500; margin: 0 0 14px; }
.page h2 { font-size: 22px; margin: 30px 0 8px; }
.page p, .page li { font-size: 16px; color: var(--ink-2); }
.page ul { padding-left: 20px; }
.page li { margin-bottom: 6px; }
.page code { font: 14px ui-monospace, Menlo, Consolas, monospace; background: var(--sala); padding: 1px 5px; border-radius: 3px; }
.page .updated { font-size: 14px; color: var(--muted); margin-top: 28px; }
.page .lead { font-size: 18px; color: var(--ink); }
