/* SupperTempo — Service-Rail Menu Column
   warm linen screen, tall service rail, slim menu strips,
   form-first Add card, search-first Find field, lifted plate tabs */

:root {
  --primary: #5b3a29;
  --secondary: #f2e8d5;
  --accent: #d89b2b;
  --plum: #7a4658;
  --graphite: #55524a;
  --linen: #faf4e8;
  --card: #fffdf7;
  --ink: #33231a;
  --faint: #8a7a6a;
  --line: #e3d6bf;
  --danger: #a3402f;
  --radius: 14px;
  --tab-h: 74px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background: var(--linen);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 10px);
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- top strip (identity, not navigation) ---------- */
.topstrip {
  background: var(--primary);
  color: var(--secondary);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
}
.topstrip-inner { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.top-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); align-self: center; flex: none;
}
.top-name { font-size: 1.25rem; font-weight: 700; letter-spacing: .02em; }
.top-seat { font-size: .78rem; opacity: .75; font-style: italic; }

main { padding: 14px 14px 0; max-width: 560px; margin: 0 auto; }

/* ---------- service rail ---------- */
.service-rail { display: flex; flex-direction: column; gap: 12px; }

.counter-row { display: flex; gap: 10px; }
.counter {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-left: 6px solid var(--accent); border-radius: var(--radius);
  padding: 10px 12px; min-height: 56px;
}
.counter--prepping { border-left-color: var(--plum); }
.counter-num { font-size: 1.7rem; font-weight: 700; color: var(--primary); min-width: 1.4em; }
.counter-word { font-size: .82rem; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); }

.add-strip {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--accent); color: #3d2708; border: none; border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: 0 2px 0 #b57f1d;
}
.add-strip-label { display: block; font-size: 1.05rem; font-weight: 700; letter-spacing: .01em; }
.add-strip-hint { display: block; font-size: .8rem; margin-top: 3px; opacity: .8; font-style: italic; }
.add-strip:active { transform: translateY(1px); box-shadow: 0 1px 0 #b57f1d; }

.next-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px 14px; margin-top: 2px;
  box-shadow: 0 6px 14px rgba(91, 58, 41, .08);
}
.next-eyebrow {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); font-weight: 700; margin-bottom: 6px;
}
.next-name { font-size: 1.45rem; color: var(--primary); line-height: 1.2; }
.next-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .9rem; color: var(--faint); flex-wrap: wrap; }
.next-order { font-weight: 700; color: var(--primary); }
.next-cue { width: 100%; font-style: italic; }
.ghost-btn {
  margin-top: 12px; background: none; border: 1px solid var(--primary);
  color: var(--primary); border-radius: 999px; padding: 9px 18px;
  font: inherit; font-size: .9rem; cursor: pointer;
}
.ghost-btn:active { background: var(--secondary); }

/* ---------- empty plate states ---------- */
.empty-plate { text-align: center; padding: 34px 10px 20px; }
.plate-ring {
  display: block; width: 84px; height: 84px; margin: 0 auto 12px;
  border: 2px dashed var(--line); border-radius: 50%;
  box-shadow: inset 0 0 0 10px var(--linen), inset 0 0 0 11px var(--line);
}
.empty-line { color: var(--faint); font-style: italic; font-size: .95rem; }

/* ---------- courses: slim menu strips ---------- */
.stage-group { margin-bottom: 16px; }
.group-head {
  display: flex; align-items: center; gap: 8px;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--faint); margin: 4px 2px 8px;
}
.group-head .dot { width: 8px; height: 8px; }
.group-count { margin-left: auto; font-variant-numeric: tabular-nums; }

.course-row {
  display: flex; align-items: stretch; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; overflow: hidden; min-height: 58px;
}
.stage-band { width: 7px; flex: none; }
.stage-band--planned { background: var(--accent); }
.stage-band--prepping { background: var(--plum); }
.stage-band--served { background: var(--graphite); }

.order-notch {
  flex: none; width: 40px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--primary); font-size: 1.05rem;
  background: var(--secondary); font-variant-numeric: tabular-nums;
}
.row-main {
  flex: 1; min-width: 0; padding: 8px 10px;
  display: flex; flex-direction: column; justify-content: center;
  background: none; border: none; text-align: left; font: inherit; cursor: pointer;
}
.row-name {
  font-size: 1rem; color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.row-cue {
  font-size: .8rem; color: var(--faint); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-side { flex: none; display: flex; align-items: center; gap: 2px; padding-right: 6px; }
.row-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  padding: 10px 8px; border-radius: 10px; color: var(--faint); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.row-btn:active { background: var(--secondary); color: var(--primary); }
.row-btn--del:active { color: var(--danger); background: #f6e3de; }
.row-stage {
  display: flex; align-items: center; gap: 5px;
  font-size: .72rem; color: var(--faint); margin-right: 4px;
}

/* stage dots: filled/hollow, no check marks */
.dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none;
  box-sizing: border-box;
}
.dot--planned { background: var(--accent); border: 2px solid var(--accent); }
.dot--prepping { background: var(--plum); border: 2px solid var(--plum); }
.dot--served { background: var(--graphite); border: 2px solid var(--graphite); }
.dot--hollow-planned { background: transparent; border: 2px solid var(--accent); }
.dot--hollow-prepping { background: transparent; border: 2px solid var(--plum); }
.dot--hollow-served { background: transparent; border: 2px solid var(--graphite); }

/* ---------- add / edit form ---------- */
.add-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 16px; box-shadow: 0 6px 14px rgba(91, 58, 41, .08);
}
.form-title { font-size: 1.2rem; color: var(--primary); margin-bottom: 14px; }
.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); margin-bottom: 6px;
}
.field-label em { font-style: normal; font-size: .7rem; letter-spacing: .03em; }
.field-label .req { color: var(--accent); font-weight: 700; }
.field-label .opt { color: var(--faint); }

.field input, .field select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--linen); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 12px; min-height: 48px; appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%),
                    linear-gradient(135deg, var(--faint) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(216, 155, 43, .25);
}
.field--invalid input { border-color: var(--danger); }
.field-error { display: block; margin-top: 5px; font-size: .82rem; color: var(--danger); }

.form-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.wide-btn {
  width: 100%; min-height: 50px; border: none; border-radius: 12px;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.wide-btn--saffron { background: var(--accent); color: #3d2708; box-shadow: 0 2px 0 #b57f1d; }
.wide-btn--saffron:active { transform: translateY(1px); box-shadow: none; }
.wide-btn--quiet { background: var(--secondary); color: var(--primary); border: 1px solid var(--line); }
.wide-btn--quiet:active { background: var(--line); }
.wide-btn--danger { background: var(--danger); color: #fff; }

/* ---------- find ---------- */
.find-block { display: flex; flex-direction: column; gap: 14px; }
.find-field { position: relative; display: block; }
.find-field input {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 44px 13px 18px; min-height: 50px;
}
.find-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(216, 155, 43, .25); }
.find-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--secondary); color: var(--primary); font-size: 1.15rem; cursor: pointer;
}
.find-hint { color: var(--faint); font-size: .85rem; font-style: italic; margin: 0 2px -6px; }

.find-row {
  display: flex; align-items: stretch; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 8px; overflow: hidden; min-height: 54px;
}
.find-match { font-size: .78rem; color: var(--faint); font-style: italic; }

.about-block {
  margin-top: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
}
.about-block summary { cursor: pointer; font-weight: 700; color: var(--primary); font-size: .92rem; }
.about-line { margin-top: 10px; font-size: .88rem; line-height: 1.5; color: var(--faint); }
.about-reset { margin-top: 12px; font-weight: 400; font-size: .9rem; }

/* ---------- dialog + toast ---------- */
.dialog-scrim {
  position: fixed; inset: 0; background: rgba(51, 35, 26, .45);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 40;
}
.dialog {
  background: var(--card); border-radius: var(--radius); padding: 20px 16px;
  width: 100%; max-width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.dialog-title { font-size: 1.05rem; color: var(--primary); font-weight: 700; }
.dialog-text { margin-top: 8px; color: var(--faint); font-size: .92rem; font-style: italic; }
.dialog .form-actions { margin-top: 16px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  background: var(--primary); color: var(--secondary);
  padding: 10px 18px; border-radius: 999px; font-size: .88rem;
  z-index: 50; max-width: 88vw; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ---------- bottom tabs: four dinner plates ---------- */
.bottomtabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--secondary);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: var(--tab-h);
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 10px 0 6px; font: inherit;
}
.tab-word {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--faint); font-family: Georgia, serif;
}
.tab[aria-current="page"] .tab-word { color: var(--primary); font-weight: 700; }

/* plate silhouette: round plate + small course tab on top + short fork on the left */
.tab-plate { position: relative; width: 30px; height: 26px; display: block; transition: transform .15s ease; }
.tab-lip {
  position: absolute; left: 50%; top: 7px; transform: translateX(-50%);
  width: 24px; height: 19px; border-radius: 50%;
  background: var(--faint);
}
.tab-lip::after {
  content: ""; position: absolute; inset: 5px 7px;
  border-radius: 50%; background: var(--secondary);
}
.tab-fork {
  position: absolute; left: 0; top: 10px; width: 6px; height: 13px;
  border-left: 2px solid var(--faint); border-right: 1px solid var(--faint);
}
.tab-fork::before {
  content: ""; position: absolute; top: -4px; left: -1px;
  width: 5px; height: 5px;
  border-left: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint);
}
.tab[aria-current="page"] .tab-lip { background: var(--accent); }
.tab[aria-current="page"] .tab-fork { border-color: var(--accent); }
.tab[aria-current="page"] .tab-fork::before { border-color: var(--accent); }
.tab[aria-current="page"] .tab-plate {
  transform: translateY(-4px);
}
.tab[aria-current="page"] .tab-lip { box-shadow: 0 6px 10px rgba(91, 58, 41, .28); }

@media (min-width: 560px) {
  main { padding-top: 20px; }
}
