/* Server Rotation: wine and brass, like a host stand at night. One elevated element: the "up next" panel. */
:root {
  --bg: #ffffff;
  --soft: #f6f3f2;          /* panels, rows */
  --ink: #221a1d;
  --muted: #5e5357;
  --line: #e4dcdd;
  --line-strong: #8d8285;   /* input borders, 3:1 on white */
  --wine: #8a1c32;          /* accent, buttons */
  --wine-ink: #ffffff;
  --wine-soft: #f7e6ea;
  --brass: #c9963a;         /* decoration only */
  --brass-text: #85600f;    /* brass that passes AA as text */
  --panel: #2a1a1f;         /* up next */
  --panel-ink: #fbf4f1;
  --panel-muted: #d9c5c9;
  --focus: #b66d00;
  --danger: #a3261b;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 10px;
  --r-s: 6px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161113;
    --soft: #211a1d;
    --ink: #f3ebec;
    --muted: #b9abaf;
    --line: #3a2f33;
    --line-strong: #85777b;
    --wine: #d9637a;
    --wine-ink: #1a0d11;
    --wine-soft: #3a1d25;
    --brass: #d8a64a;
    --brass-text: #e2b45c;
    --panel: #5c1626;
    --panel-ink: #fff6f3;
    --panel-muted: #efc9d1;
    --focus: #f0a63a;
    --danger: #f08a7e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--wine); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 5; }
.skip:focus { left: 8px; top: 8px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.2rem/1 var(--serif); }
.brand svg { color: var(--wine); flex: none; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: 10px 0; }
.topbar nav a:hover { color: var(--ink); }

/* hero */
.hero { padding: 22px 0 10px; max-width: 46rem; }
h1 { font: 700 clamp(1.75rem, 5.2vw, 2.6rem)/1.12 var(--serif); margin: 0 0 8px; letter-spacing: -.01em; }
.lede { margin: 0; color: var(--muted); font-size: 1.05rem; }
h2 { font: 700 1.4rem/1.2 var(--serif); margin: 0 0 10px; }

/* buttons and fields */
.btn { font: 600 1rem/1.2 var(--sans); min-height: 48px; padding: 10px 18px; border-radius: var(--r-s); border: 2px solid var(--wine);
  background: var(--wine); color: var(--wine-ink); cursor: pointer; touch-action: manipulation; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--wine); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { border-color: var(--wine); filter: none; }
.btn.small { min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.btn.icon { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.2rem; }
.btn.danger { color: var(--danger); }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
input, select { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-s); min-height: 46px; padding: 8px 10px; }
select { padding-right: 6px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.field > span:first-child { font-weight: 600; }
.check, .radio { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.check input, .radio input { width: 22px; height: 22px; min-height: 0; accent-color: var(--wine); margin: 0; flex: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .95rem; margin: 0 0 10px; }
.note { color: var(--muted); font-size: .95rem; }

/* tabs */
.tool { margin: 14px 0 8px; position: relative; }
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs [role=tab] { font: 600 1rem var(--sans); background: none; border: 0; color: var(--muted); padding: 12px 14px; min-height: 48px;
  border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; }
.tabs [role=tab][aria-selected=true] { color: var(--ink); border-bottom-color: var(--wine); }

/* ---------- host stand ---------- */
.stand { display: grid; gap: 22px; }
@media (min-width: 900px) { .stand { grid-template-columns: minmax(330px, 400px) 1fr; align-items: start; gap: 34px; } .seat-col { position: sticky; top: 12px; } }
.upnext { background: var(--panel); color: var(--panel-ink); border-radius: var(--r); padding: 16px 20px 18px; box-shadow: 0 8px 24px rgb(42 26 31 / .22); }
.upnext.none { background: var(--soft); color: var(--ink); box-shadow: none; border: 2px dashed var(--line-strong); }
.un-label { margin: 0; color: var(--panel-muted); font-size: .95rem; }
.upnext.none .un-label { color: var(--muted); }
.un-name { margin: 2px 0 2px; font: 700 clamp(2.1rem, 9vw, 2.9rem)/1.08 var(--serif); overflow-wrap: anywhere; }
.un-meta { margin: 0; color: var(--panel-muted); font-size: 1rem; min-height: 1.5em; }
.upnext.none .un-meta { color: var(--muted); }

.party { margin: 18px 0 0; }
.sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.size { font: 700 1.35rem var(--sans); min-height: 58px; border-radius: var(--r-s); border: 2px solid var(--line-strong); background: var(--bg);
  color: var(--ink); cursor: pointer; touch-action: manipulation; }
.size[aria-pressed=true] { background: var(--wine); border-color: var(--wine); color: var(--wine-ink); }
.more-size { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .95rem; color: var(--muted); }
.more-size input { width: 96px; font-weight: 700; }
.more-size.on input { border-color: var(--wine); border-width: 2px; }
.btn.seat { width: 100%; min-height: 66px; margin-top: 14px; font-size: 1.2rem; border-radius: var(--r); }
.btn.seat span { font-weight: 500; }
.after-seat { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.after-seat .btn { flex: none; }
.last { margin: 0; color: var(--muted); font-size: .95rem; }

.floor-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.floor-head h2 { margin: 0; }
.tot { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.servers { list-style: none; margin: 0; padding: 0; }
.srv { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.srv.is-up { background: var(--wine-soft); box-shadow: inset 4px 0 0 var(--wine); padding-left: 14px; }
.srv.flash { animation: flash .9s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--brass) 45%, transparent); } }
.srv-main { flex: 1 1 200px; min-width: 0; }
.srv-name { margin: 0; font-weight: 700; font-size: 1.15rem; overflow-wrap: anywhere; }
.secb { font-weight: 600; font-size: .85rem; color: var(--brass-text); border: 1.5px solid currentColor; border-radius: 4px; padding: 0 5px; margin-left: 4px; white-space: nowrap; vertical-align: 2px; }
.up-tag { font-weight: 600; font-size: .9rem; color: var(--wine); margin-left: 4px; }
.srv-facts { margin: 2px 0 6px; color: var(--muted); font-size: .95rem; font-variant-numeric: tabular-nums; }
.sitout { color: var(--brass-text); font-weight: 600; }
.bar { display: block; height: 6px; background: var(--line); border-radius: 3px; max-width: 320px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brass); border-radius: 3px; }
.srv-act { display: flex; gap: 8px; align-items: center; flex: none; }
.srv-act select { min-width: 9.5em; }
.s-break .srv-name, .s-cut .srv-name { color: var(--muted); }
.s-cut .srv-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.s-break .bar span, .s-cut .bar span { background: var(--line-strong); }
.s-full .srv-facts::after { content: " · section full"; color: var(--brass-text); font-weight: 600; }

details.more { border-bottom: 1px solid var(--line); }
details.more > summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 48px; list-style-position: inside; }
.more-in { padding: 0 0 16px; }
.opt { margin-bottom: 12px; }
#f-large, #f-full { max-width: 340px; margin-bottom: 6px; }
#f-full { margin-top: 6px; }
.check-wrap .hint { margin: -8px 0 4px 32px; }
.edit-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.edit-list li { display: flex; gap: 6px; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.grow input { width: 100%; }
.sec input, .field.sec input { width: 4.6em; }
.add-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.add-row .grow { flex: 1 1 160px; }

/* ---------- section planner ---------- */
.planner { display: grid; gap: 26px; }
@media (min-width: 900px) { .planner { grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr); align-items: start; } .plan-out { position: sticky; top: 12px; order: 2; } }
.count { max-width: 260px; }
.stepper { display: flex; gap: 6px; }
.stepper input { width: 74px; text-align: center; font-weight: 700; }
.stepper .btn { min-width: 48px; padding: 0; font-size: 1.3rem; }
.result { margin-top: 16px; background: var(--soft); border-radius: var(--r); padding: 16px; }
.result .empty { margin: 0; color: var(--muted); }
.strip { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.tb { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 40px; height: 44px; border-radius: 5px;
  border: 2px solid var(--sb); background: var(--sf); color: #221a1d; line-height: 1.05; padding: 0 4px; }
.tb b { font-size: .95rem; }
.tb i { font-style: normal; font-size: .75rem; }
.secs { list-style: none; margin: 0; padding: 0; }
.secs li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.sl { flex: 1; min-width: 0; }
.sl b { margin-right: 6px; }
.ss { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ss b { font-size: 1.25rem; }
.spread { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }
.sw { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
  background: var(--sf); border: 2px solid var(--sb); color: #221a1d; flex: none; }
/* section colours: light fill + darker edge, readable printed in black and white because of the numbers */
.c1 { --sf: #f6d7d0; --sb: #b5523e; } .c2 { --sf: #d6e6f5; --sb: #3d6f9e; } .c3 { --sf: #dcedd3; --sb: #4f7d3a; }
.c4 { --sf: #f8e7b9; --sb: #a77b12; } .c5 { --sf: #e6dcf1; --sb: #6d5394; } .c6 { --sf: #d3ecea; --sb: #2f7d77; }
.c7 { --sf: #f5d9e7; --sb: #a2426f; } .c8 { --sf: #e7e1d6; --sb: #7a6a50; } .c9 { --sf: #dfe3e8; --sb: #56606c; } .c10 { --sf: #fde0c5; --sb: #b8641b; }
.tables { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 8px 16px; }
.tables li { display: flex; align-items: center; gap: 6px; }
.tables input[data-tf=label] { width: 4.6em; font-weight: 700; }
.tables input[data-tf=seats] { width: 4em; }
.tables .unit { color: var(--muted); font-size: .9rem; }
.add-tables { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.add-tables input { width: 4.2em; }

/* ---------- paper sheet ---------- */
.sheet-opts { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; margin-bottom: 18px; }
.sheet-opts .field input { width: 6em; }
.sheet-opts .check { flex: 1 1 260px; }
.preview { border: 1px solid var(--line); border-radius: var(--r); background: var(--soft); padding: 12px; overflow: hidden; }
.paper-scale { position: relative; }
.paper { width: 1000px; transform-origin: 0 0; background: #fff; color: #1d1d1d; padding: 28px 32px; box-shadow: 0 1px 4px rgb(0 0 0 / .18); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .2s;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-s); max-width: min(92vw, 520px); margin: 0; z-index: 4; font-size: .95rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- content ---------- */
.content { max-width: 44rem; padding: 22px 0 30px; }
.content section { margin-top: 30px; }
.content p, .content li { margin: 0 0 12px; }
.content ul { padding-left: 1.2em; }
#faq details { border-top: 1px solid var(--line); }
#faq details:last-child { border-bottom: 1px solid var(--line); }
#faq summary { cursor: pointer; font-weight: 600; padding: 13px 0; }
#faq details p { margin: 0 0 14px; }

footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 18px 0 28px; color: var(--muted); font-size: .95rem; }
footer p { margin: 0 0 8px; }

/* 404 */
.nf { padding: 40px 0 60px; }

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

/* ---------- printed layouts (also used for the on-screen sheet preview) ---------- */
.print-area { display: none; }
.pp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2.5px solid #1d1d1d; padding-bottom: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.pp-head h2 { font: 700 24pt/1.1 var(--serif); margin: 0; color: #1d1d1d; }
.pp-head p { margin: 0; font-size: 11pt; color: #333; }
.pp-sub { font-size: 11pt; margin: 0 0 8px; color: #333; }
.pgrid { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11pt; color: #1d1d1d; }
.pgrid th { font-size: 10pt; font-weight: 700; border: 1px solid #555; padding: 4px 2px; background: #f1ecec; }
.pgrid td { border: 1px solid #777; padding: 0 6px; }
.pgrid .nm { width: 19%; text-align: left; font-weight: 700; font-size: 12pt; }
.pgrid th.nm { font-size: 10pt; padding-left: 6px; }
.pgrid .sc { width: 6%; text-align: center; }
.pgrid .cv { width: 8%; }
.pgrid td.turn { padding: 0; position: relative; }
.pgrid td.turn span { position: absolute; left: 12%; right: 12%; top: 50%; border-top: 1px dotted #999; }
.pkey { font-size: 10pt; color: #333; margin: 8px 0 0; }
.plog { width: 100%; border-collapse: collapse; font-size: 11pt; table-layout: fixed; }
.plog th { text-align: left; border-bottom: 2px solid #1d1d1d; padding: 4px 6px; }
.plog td { border-bottom: 1px solid #888; height: .36in; }
.plog th:nth-child(1), .plog th:nth-child(2), .plog th:nth-child(3) { width: 12%; }
.plog th:nth-child(4) { width: 26%; }

@media print {
  @page { size: portrait; margin: 0.5in; }
  @page landscape { size: landscape; margin: 0.4in; }
  :root { --bg: #fff; --ink: #1d1d1d; }
  body { background: #fff; color: #1d1d1d; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .skip, .topbar, main, footer, .toast { display: none !important; }
  body[data-print=shift] #print-shift, body[data-print=sections] #print-sections, body[data-print=sheet] #print-sheet { display: block; }
  #print-sheet { page: landscape; }
  .ps.log { break-before: page; }
  .pgrid thead { display: table-header-group; }
  .pgrid tr, .pt tr, .plog tr { break-inside: avoid; }

  .pt { width: 100%; border-collapse: collapse; font-size: 12pt; margin-top: 10px; }
  .pt th { text-align: left; border-bottom: 2px solid #1d1d1d; padding: 6px 8px; font-size: 10.5pt; }
  .pt td { border-bottom: 1px solid #999; padding: 8px; vertical-align: middle; }
  .pt td small { display: block; color: #444; font-size: 9.5pt; }
  .pt .n, .pt th.n { text-align: right; font-variant-numeric: tabular-nums; width: 12%; }
  .pt tfoot td { border-top: 2px solid #1d1d1d; border-bottom: 0; font-weight: 700; }
  .pt td.wr { width: 34%; }
  .pt td.wr span { display: block; border-bottom: 1px solid #555; min-height: 1.6em; margin-right: 18px; font-weight: 700; font-size: 14pt; }
  #print-sections .pt { font-size: 13pt; }
  #print-sections .pt td { padding: 12px 8px; }
  .pt.log { font-size: 10.5pt; }
  .pt.log td { padding: 4px 8px; }
  #print-shift h3 { font: 700 15pt var(--serif); margin: 22px 0 0; break-after: avoid; }
  .pt .sw { width: 34px; height: 34px; font-size: 13pt; }
  .pstrip { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 16px; }
  .pstrip .tb { min-width: 58px; height: 62px; border-width: 2px; }
  .pstrip .tb b { font-size: 14pt; }
  .pstrip .tb i, .pstrip .tb u { font-style: normal; text-decoration: none; font-size: 8.5pt; }
  .pstrip .tb u { font-weight: 700; }
}
