:root {
  --paper: #F2EDE4;
  --card: #FBF8F2;
  --line: #E2D9CC;
  --line-2: #CFC4B5;
  --chip: #E9E2D6;
  --ink: #221E1B;
  --muted: #6B6259;
  --tomato: #FF6A3D;
  --butter: #F6CD5B;
  --sage: #A9C3A0;
  --lilac: #C9B8E8;
  --oat: #E9DCC8;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --dots: "Doto", var(--mono);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--ink); }
a:hover { color: #B8431C; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; padding: 22px 20px 120px; display: flex; flex-direction: column; gap: 18px; }

.label { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.big-num { font-family: var(--dots); font-weight: 800; font-size: 40px; line-height: 1; }
.mid-num { font-family: var(--dots); font-weight: 800; font-size: 30px; line-height: 1; }
h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; }
h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.head .stack { display: flex; flex-direction: column; gap: 6px; }
.head .right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: .8px; color: var(--muted); text-transform: uppercase; }
.input, textarea.input {
  width: 100%; min-height: 52px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--card); font-size: 16px; outline: none;
}
textarea.input { min-height: 140px; line-height: 1.5; resize: vertical; }
.input:focus { border-color: var(--ink); }
.search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 0 14px; height: 52px; }
.search input { border: 0; outline: 0; background: transparent; font-size: 16px; flex: 1; min-width: 0; }

/* buttons */
.btn {
  min-height: 56px; border-radius: 18px; border: 0; background: var(--tomato); color: var(--ink);
  font-size: 15px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 20px; box-shadow: inset 0 -3px 0 rgba(34,30,27,.15); text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; border: 1.5px solid var(--ink); box-shadow: none; }
.btn.dark { background: var(--ink); color: var(--card); box-shadow: none; }
.btn.small { min-height: 44px; border-radius: 14px; font-size: 13px; padding: 0 14px; }
.btn.danger { background: transparent; border: 1.5px solid #B23A16; color: #8F2D10; box-shadow: none; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; }

/* chips with LED */
.chip {
  min-height: 40px; padding: 0 14px 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.chip .led { width: 8px; height: 8px; border-radius: 4px; background: #D6CCBE; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); font-weight: 600; }
.chip[aria-pressed="true"] .led { background: var(--tomato); box-shadow: 0 0 0 3px rgba(255,106,61,.25); }
.tag { font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 6px; }
.veg { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; }
.veg i { width: 7px; height: 7px; border-radius: 4px; background: #5E8A55; display: inline-block; }

/* segmented tabs */
.tabs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 4px; background: var(--ink); padding: 5px; border-radius: 18px; }
.tabs button { min-height: 44px; border: 0; border-radius: 14px; background: transparent; color: #CFC5B8; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--tomato); color: var(--ink); }
.tabs button:disabled { opacity: .5; cursor: default; }

/* cards & lists */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card.butter { background: var(--butter); border: 0; }
.card.ink { background: var(--ink); border: 0; color: var(--card); }
.card.lilac { background: var(--lilac); border: 0; }
.list-head { display: flex; justify-content: space-between; padding-bottom: 8px; }
.rrow { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.rrow:hover { color: inherit; }
.rrow .num { font-family: var(--mono); font-size: 11px; color: var(--muted); width: 18px; flex-shrink: 0; }
.rrow .body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.rrow h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.2px; line-height: 1.25; }
.meta { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .4px; color: var(--muted); text-transform: uppercase; }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* glyphs (stand-in for photos) */
.glyph { position: relative; flex-shrink: 0; overflow: hidden; border-radius: 18px; }
.glyph span { position: absolute; }

/* recipe page */
.ing { list-style: none; margin: 0; padding: 0; }
.ing li { border-bottom: 1px solid var(--line); }
.ing label { display: flex; gap: 14px; align-items: center; min-height: 52px; cursor: pointer; font-size: 15px; }
.tick { appearance: none; -webkit-appearance: none; width: 24px; height: 24px; margin: 0; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); cursor: pointer; flex-shrink: 0; }
.tick:checked { background: var(--tomato); box-shadow: inset 0 0 0 4px var(--card); }
.tick:checked + span { text-decoration: line-through; color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.steps li { counter-increment: s; display: flex; gap: 14px; font-size: 16px; line-height: 1.5; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--mono); font-size: 12px; color: var(--muted); padding-top: 4px; width: 20px; flex-shrink: 0; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 15px; background: #D6CCBE; position: relative; cursor: pointer; margin: 0; flex-shrink: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 12px; background: var(--card); transition: left .15s; }
.switch input:checked { background: var(--tomato); }
.switch input:checked::after { left: 25px; }

/* circle */
.seats { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.seats span { aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border: 1.5px solid var(--line-2); }
.avatar { width: 36px; height: 36px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }

/* nav */
nav.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: max(18px, env(safe-area-inset-bottom));
  width: min(362px, calc(100% - 28px)); height: 68px; border-radius: 34px; background: var(--ink);
  display: flex; justify-content: space-around; align-items: center; padding: 0 6px; z-index: 10;
}
nav.dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 64px; min-height: 48px; text-decoration: none; color: #B5AB9F; font-family: var(--mono); font-size: 11px; }
nav.dock a[aria-current="page"] { color: var(--card); }
nav.dock a[aria-current="page"] .lbl::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 3px; background: var(--tomato); margin-right: 4px; vertical-align: middle; }
nav.dock a.plus { width: 52px; height: 52px; min-width: 52px; border-radius: 26px; background: var(--tomato); color: var(--ink); }
nav.dock a.plus[aria-current="page"] { background: var(--butter); }

/* toast */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 100px; background: var(--ink); color: var(--card); padding: 12px 16px; border-radius: 14px; font-size: 14px; z-index: 20; max-width: calc(100% - 40px); }
.toast.err { background: #8F2D10; }

/* login */
.login { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 32px 24px; max-width: 440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 12px; }

/* pdf drop zone */
.drop { min-height: 260px; border: 2px dashed var(--line-2); border-radius: 28px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; cursor: pointer; text-align: center; }
.drop:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.drop-icon { width: 72px; height: 72px; border-radius: 36px; background: var(--butter); display: flex; align-items: center; justify-content: center; }
