:root {
  --bg: #e9edf3;
  --panel: #f7f8fb;
  --ink: #131b34;
  --muted: #56617a;
  --line: #c5cedc;
  --accent: #2446d8;
  --accent-ink: #ffffff;
  --marigold: #f5b82e;
  --marigold-ink: #3a2a00;
  --danger: #b42318;
  --paper: #ffffff;
  --paper-ink: #1b1b1b;
  --paper-muted: #666666;
  --shadow: rgba(19, 27, 52, 0.22);
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bill: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1326;
    --panel: #151d36;
    --ink: #e7ebf5;
    --muted: #9aa5bf;
    --line: #2c3758;
    --accent: #7d95ff;
    --accent-ink: #0d1326;
    --danger: #ff8a7a;
    --shadow: rgba(0, 0, 0, 0.55);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0d1326;
  --panel: #151d36;
  --ink: #e7ebf5;
  --muted: #9aa5bf;
  --line: #2c3758;
  --accent: #7d95ff;
  --accent-ink: #0d1326;
  --danger: #ff8a7a;
  --shadow: rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
abbr[title] { text-decoration: none; }

/* ---------- header ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px 32px 0;
}
.wordmark {
  font: 800 28px/1 var(--display);
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.who { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.who-text { color: var(--muted); }
.who-text strong { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.btn.ghost:hover { background: transparent; color: var(--ink); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 40px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 32px 96px;
}
.menu { min-width: 0; }
.bill-col {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 12px 20px 40px;
  scrollbar-width: thin;
}

.intro { padding: 40px 0 8px; max-width: 720px; }
.intro h1 {
  font: 800 clamp(48px, 7vw, 96px)/0.9 var(--display);
  letter-spacing: 0.005em;
  margin: 0 0 16px;
}
.intro p { font-size: 19px; color: var(--muted); margin: 0; max-width: 58ch; }

/* ---------- sections ---------- */
.sec { margin-top: 56px; }
.sec-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 8px 24px;
  border-top: 4px solid var(--ink);
  padding: 14px 0 12px;
}
.sec-head h2 {
  font: 800 clamp(56px, 7vw, 88px)/0.82 var(--display);
  margin: 0;
}
.sec-head p { margin: 0; color: var(--muted); max-width: 52ch; }
.plans.view { margin: 8px 0 4px; }

/* ---------- tool rows ---------- */
.tool {
  display: grid;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.tool.in { box-shadow: inset 4px 0 0 var(--accent); padding-left: 20px; }
.tool-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tool-head h3 { font: 700 23px/1.2 var(--body); margin: 0; }
.leader {
  flex: 1 1 40px;
  min-width: 40px;
  border-bottom: 2px dotted var(--line);
  transform: translateY(-6px);
}
.price { font: 700 23px/1.2 var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.est {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: super;
}
.pick {
  background: var(--marigold);
  color: var(--marigold-ink);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.blurb { margin: 0; max-width: 64ch; }
.note { margin: 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.included { color: var(--muted); font-size: 14px; font-weight: 600; }

.plans {
  display: inline-flex;
  flex-wrap: wrap;
  width: fit-content;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.plans button {
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-right: 1.5px solid var(--line);
  background: transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.plans button:last-child { border-right: 0; }
.plans button:hover { background: var(--panel); }
.plans button[aria-checked='true'] { background: var(--ink); color: var(--bg); }

.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.controls.in-cart { display: grid; gap: 10px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.stepper button {
  width: 38px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.stepper button:disabled { opacity: 0.3; cursor: not-allowed; }
.stepper .seats { min-width: 72px; text-align: center; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }

.why-field { display: grid; gap: 4px; max-width: 640px; }
.why-field.wide { margin-top: 16px; }
.why-field span { font-size: 14px; font-weight: 600; }
.why-field input,
.why-field textarea,
.custom-grid input,
.name-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.why-field textarea { resize: vertical; }
.why-field input.missing,
.custom-grid input.missing { border-color: var(--marigold); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 0.8; }

.custom-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; max-width: 640px; }
.custom-grid label { display: grid; gap: 4px; }
.custom-grid span { font-size: 14px; font-weight: 600; }

.ask {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
}
.ask p { margin: 0; max-width: 56ch; }

/* ---------- projects ---------- */
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.proj {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  text-align: left;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
}
.proj:hover { border-color: var(--ink); }
.proj .box { width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 5px; margin-top: 2px; }
.proj.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.proj.on .box {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4 10.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}
.proj-text { display: grid; gap: 4px; }
.proj-text strong { font-size: 17px; }
.proj-text span { color: var(--muted); font-size: 14px; }

.fine { font-size: 13px; color: var(--muted); }
.menu-fine { margin-top: 40px; }

/* ---------- bill (the receipt) ---------- */
.bill-wrap { filter: drop-shadow(0 6px 10px var(--shadow)); }
.bill {
  --z: 9px;
  background: var(--paper);
  color: var(--paper-ink);
  font: 400 15px/1.45 var(--bill);
  padding: 30px 24px 34px;
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(2 * var(--z)) 51% repeat-x;
}
.bill-title { text-align: center; font-weight: 700; font-size: 18px; letter-spacing: 0.12em; }
.bill-meta { display: flex; justify-content: space-between; color: var(--paper-muted); font-size: 13px; margin-top: 6px; }
.bill hr { border: 0; border-top: 1.5px dashed #9a9a9a; margin: 14px 0; }
.bill .fill { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: baseline; gap: 8px; margin-top: 8px; }
.bill .fill span { color: var(--paper-muted); font-size: 13px; }
.bill .fill input,
.bill .notes textarea {
  width: 100%;
  border: 0;
  border-bottom: 1.5px dotted #8a8a8a;
  background: transparent;
  color: var(--paper-ink);
  font: inherit;
  padding: 2px 0;
  border-radius: 0;
}
.bill .fill input::placeholder, .bill textarea::placeholder { color: #9a9a9a; }
.bill .notes { display: grid; gap: 4px; margin-top: 12px; }
.bill .notes span { color: var(--paper-muted); font-size: 13px; }
.bill .notes textarea { border: 1.5px dotted #8a8a8a; padding: 6px; resize: vertical; }
.bill :focus-visible { outline-color: #2446d8; }

.grp { font-weight: 700; margin: 10px 0 4px; letter-spacing: 0.04em; }
.lines { list-style: none; margin: 0; padding: 0; }
.line { padding: 3px 0; }
.lrow { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; }
.qty { color: var(--paper-muted); }
.amt { font-variant-numeric: tabular-nums; }
.why { padding-left: 44px; font-size: 13px; color: var(--paper-muted); font-style: italic; overflow-wrap: anywhere; }
.why.missing { color: #a55d00; font-style: normal; font-weight: 700; }
.none { color: var(--paper-muted); font-size: 14px; }
.total, .subtotal { display: flex; justify-content: space-between; align-items: baseline; }
.total { font-weight: 700; font-size: 24px; }
.subtotal { color: var(--paper-muted); }
.bill .fine { color: var(--paper-muted); margin: 8px 0 0; }
.building { margin: 0; }
.empty { color: var(--paper-muted); text-align: center; margin: 24px 0; }
.bill .send { width: 100%; margin-top: 16px; min-height: 48px; font-family: var(--body); font-size: 16px; background: #2446d8; border-color: #2446d8; color: #fff; }
.status { text-align: center; font-size: 13px; color: var(--paper-muted); margin: 10px 0 0; min-height: 1.4em; }
.thanks { text-align: center; margin-top: 18px; letter-spacing: 0.1em; font-size: 13px; }
.conflict { border: 1.5px solid #a55d00; padding: 10px; margin-top: 12px; font-size: 14px; }
.conflict p { margin: 0 0 8px; }
.conflict .btn { color: var(--paper-ink); border-color: var(--paper-ink); font-family: var(--body); }
.conflict .btn:hover { background: var(--paper-ink); color: var(--paper); }

/* The one motion: a new line prints onto the bill. */
@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-4px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}
.line.printed { animation: print 0.42s steps(7, end) both; }

/* ---------- team picker ---------- */
.picker { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; display: none; }
.picker.open { display: block; }
.picker-inner { max-width: 1100px; margin: 0 auto; padding: 56px 32px 64px; }
.picker h1 { font: 800 clamp(64px, 11vw, 144px)/0.85 var(--display); margin: 0 0 20px; }
.lede { font-size: 19px; color: var(--muted); max-width: 56ch; margin: 0 0 28px; }
.name-field { display: grid; gap: 6px; max-width: 420px; margin-bottom: 28px; }
.name-field span { font-weight: 600; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.team-btn {
  min-height: 64px;
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 18px;
  background: var(--panel);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.team-btn:hover { border-color: var(--ink); }
.team-btn.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.picker-foot { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- toast + mobile bar ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-bar { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; }
}
@media (max-width: 900px) {
  .top { padding: 14px 16px 0; }
  .wordmark { font-size: 24px; }
  .who-text { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 0 16px 120px; }
  .intro { padding-top: 24px; }
  .intro p { font-size: 17px; }
  .sec-head { grid-template-columns: minmax(0, 1fr); }
  .bill-col {
    position: fixed;
    inset: 0 0 64px 0;
    max-height: none;
    z-index: 30;
    background: var(--bg);
    padding: 20px 16px 32px;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s;
  }
  .bill-col.open { transform: none; visibility: visible; }
  body.bill-open { overflow: hidden; }
  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 10px 16px;
    background: var(--panel);
    border-top: 1.5px solid var(--line);
  }
  .toast { bottom: 80px; }
  .custom-grid { grid-template-columns: minmax(0, 1fr); }
  .picker-inner { padding: 32px 16px 48px; }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tool.in { padding-left: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .line.printed { animation: none; }
  .bill-col, .toast, .btn { transition: none; }
}

/* ---------- picker groups and name matching ---------- */
.team-group { font: 800 32px/1 var(--display); margin: 32px 0 12px; }
.team-btn { display: grid; gap: 4px; align-content: start; }
.tb-name { font-weight: 700; font-size: 18px; }
.tb-leads { font-weight: 500; font-size: 14px; color: var(--muted); }
.team-btn.match { border-color: var(--marigold); box-shadow: inset 0 0 0 2px var(--marigold); }
