/* Simple, phone-first styles */
:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e2e2df;
  --accent: #1f6f50;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok-bg: #e7f4ec;
  --err-bg: #fbe9e7;
  --star: #d9a400;
  --star-bg: #fff9e6;
  --star-text: #7a5c00;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617; --card: #222224; --text: #f2f2f2; --muted: #a0a0a6;
    --line: #38383b; --accent: #4fbf8f; --accent-text: #0b1a13;
    --danger: #ff8a80; --ok-bg: #173325; --err-bg: #3a1d1b;
    --star: #b38900; --star-bg: #2a2410; --star-text: #f0cf6a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
header.top {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
header.top .inner {
  max-width: 760px; margin: 0 auto; padding: 10px 16px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
header.top .brand { font-weight: 700; margin-right: auto; text-decoration: none; color: var(--text); }
header.top nav a {
  text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--text);
}
header.top nav a.on { background: var(--bg); font-weight: 600; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.muted { color: var(--muted); }
.small { font-size: .9rem; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 12px; font-size: 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
.btn, button {
  display: inline-block; padding: 12px 18px; font-size: 16px; font-weight: 600;
  border-radius: 10px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-text); cursor: pointer; text-decoration: none; text-align: center;
}
.btn.secondary, button.secondary { background: transparent; color: var(--accent); }
.btn.danger, button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button[disabled] { opacity: .6; cursor: wait; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.flash.ok { background: var(--ok-bg); }
.flash.error { background: var(--err-bg); color: var(--danger); }
ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
ul.list li:last-child { border-bottom: 0; }
ul.list .name { font-weight: 600; }
.check {
  display: flex; gap: 12px; align-items: center; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-weight: 400; margin: 0;
}
.check:last-child { border-bottom: 0; }
.check input { width: 22px; height: 22px; flex: none; }
.pill {
  display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted);
}
.pill.done { background: var(--ok-bg); color: var(--accent); border-color: transparent; font-weight: 600; }
.stat-row { display: flex; gap: 32px; }
.big { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }
.loading-bar { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.loading-bar span {
  display: block; height: 100%; width: 35%; background: var(--accent); border-radius: 99px;
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
code { font-size: .9em; }
pre.summary {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; font-size: .85rem; line-height: 1.5; margin: 0;
  max-height: 60vh; overflow-y: auto;
}

/* ----- employee ordering page ----- */
body.no-scroll { overflow: hidden; }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; margin: 8px 0 4px;
  position: sticky; top: 0; background: var(--bg); z-index: 4; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); text-decoration: none; font-size: .9rem; white-space: nowrap;
}
.chip.special { border-color: var(--star); color: var(--star-text); font-weight: 600; }
.menu-sec { scroll-margin-top: 60px; }
.menu-sec h2 { margin: 22px 0 8px; }
.item {
  display: flex; width: 100%; gap: 12px; justify-content: space-between; align-items: flex-start;
  text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 8px; font-weight: 400; cursor: pointer;
}
.item.special { border-color: var(--star); background: var(--star-bg); }
.item:active:not([disabled]) { transform: scale(.99); }
.item.sold-out { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
.item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-name { font-weight: 600; overflow-wrap: anywhere; }
.item-desc {
  color: var(--muted); font-size: .9rem; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.item-price { flex: none; font-weight: 600; }
.cart-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 6; max-width: 728px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; padding: 16px 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.cart-bar.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.04); } }

.sheet {
  position: fixed; inset: 0; z-index: 20; background: var(--card);
  display: flex; flex-direction: column;
}
.sheet[hidden] { display: none; }
@media (min-width: 700px) {
  .sheet { inset: 4vh auto; left: 50%; transform: translateX(-50%); width: 640px;
           border-radius: var(--radius); box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
}
.sheet-inner { flex: 1; overflow-y: auto; padding: 0 16px 16px; }
.sheet-top { display: flex; justify-content: flex-end; position: sticky; top: 0; background: var(--card); padding: 8px 0; }
.close { background: transparent; color: var(--text); border: 0; font-size: 28px; line-height: 1; padding: 4px 10px; }
.sheet-foot { border-top: 1px solid var(--line); padding: 12px 16px; background: var(--card); }
.sheet-foot button { width: 100%; }
.hint { color: var(--danger); font-size: .9rem; min-height: 1.2em; margin-bottom: 8px; }
.group { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.group legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0; margin-bottom: 6px; width: 100%; }
.group-name { font-weight: 700; }
.rule { color: var(--muted); font-size: .85rem; width: 100%; }
.badge { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.badge.need { background: var(--err-bg); color: var(--danger); }
.badge.ok { background: var(--ok-bg); color: var(--accent); }
.opt {
  display: flex; gap: 12px; align-items: center; padding: 12px; margin: 0 0 6px;
  border: 1px solid var(--line); border-radius: 10px; font-weight: 400; cursor: pointer;
}
.opt.on { border-color: var(--accent); background: var(--ok-bg); }
.opt.sold-out { opacity: .45; cursor: not-allowed; }
.opt input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.opt input.round { border-radius: 50%; }
.opt-name { flex: 1; overflow-wrap: anywhere; }
.opt-price { color: var(--muted); font-size: .9rem; flex: none; }
.nested { margin: -2px 0 10px 18px; padding-left: 12px; border-left: 3px solid var(--line); }
.nested .group { margin-top: 8px; }
.qty { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.qty span { margin-right: auto; font-weight: 600; }
.qty button { width: 44px; padding: 8px 0; }
.lines .line { display: block; }
.line-top { display: flex; justify-content: space-between; gap: 10px; }
.line-top.total { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 1.1rem; }
.small-btn { padding: 6px 12px; font-size: .9rem; }
.done-card { text-align: center; }
.big-check {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--ok-bg);
  color: var(--accent); font-size: 30px; line-height: 56px; font-weight: 700;
}
form.inline { display: inline; }
.wrap-anywhere { overflow-wrap: anywhere; }
