:root {
  --brand: #1e2140;      /* Buckeye Local navy (sampled from the logo) */
  --brand-dark: #12142a;
  --accent: #b9c0c9;     /* Buckeye Local silver */
  --amber: #e0a100;
  --bg: #f3f5f8;
  --card: #ffffff;
  --ink: #16202e;
  --muted: #5d6877;
  --line: #d7dde5;
  --ok: #1f7a3d;
  --warn: #b45309;
  --bad: #b42318;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
header.site { background: var(--brand); color: #fff; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 4px solid var(--accent); }
header.site .brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
header.site img.logo { height: 56px; width: auto; background: #fff; border-radius: 10px; padding: 4px; flex: none; }
header.site h1 { margin: 0; font-size: 1.25rem; }
header.site small { opacity: .85; display: block; font-weight: 400; }
header.site a { color: #fff; text-decoration: none; margin-left: 14px; font-size: .9rem; opacity: .9; }
header.site a:hover { text-decoration: underline; }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }
main.wide { max-width: none; margin: 0; padding-left: 12px; }
h2 { margin: 24px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.item { display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.item h3 { margin: 0; font-size: 1.05rem; }
.item p { margin: 0; color: var(--muted); font-size: .9rem; }
.price { font-weight: 700; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button, .btn { font: inherit; border: 0; border-radius: 8px; padding: 9px 14px; background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--brand-dark); }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
button.danger { background: var(--bad); }
button.small { padding: 5px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; width: 100%; background: #fff; }
label { display: block; font-size: .85rem; color: var(--muted); margin: 10px 0 4px; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 32px; height: 32px; padding: 0; font-size: 1.1rem; }
.cart { position: sticky; top: 12px; }
.layout { display: grid; gap: 20px; grid-template-columns: 190px 1fr 340px; align-items: start; }
.cats { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 4px; }
.cats button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; width: 100%; background: transparent; color: var(--ink); border: 1px solid transparent; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.cats button:hover { background: #e4e8ee; }
.cats button.on { background: var(--brand); color: #fff; }
.cats button .n { font-size: .8rem; font-weight: 600; opacity: .65; }
.cats button.allout { opacity: .5; }
.catsection[hidden] { display: none; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr 340px; }
  .cats { grid-column: 1 / -1; position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cats button { width: auto; white-space: nowrap; background: #fff; border-color: var(--line); flex: none; }
  .cats button:hover { background: #eef1f5; }
  .cats button.on { background: var(--brand); border-color: var(--brand); }
}
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } .cart { position: static; } }
.notice { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.notice.err { background: #fde8e6; color: var(--bad); }
.notice.ok { background: #e3f5e9; color: var(--ok); }
.notice.closed { background: #fff3d6; color: var(--warn); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eee; }
.badge.new { background: #fde8e6; color: var(--bad); }
.badge.preparing { background: #fff3d6; color: var(--warn); }
.badge.ready { background: #e3f5e9; color: var(--ok); }
.login { max-width: 380px; margin: 60px auto; }
.tickets { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ticket { border-left: 6px solid var(--line); }
.ticket.new { border-left-color: var(--bad); }
.ticket.preparing { border-left-color: var(--amber); }
.ticket.ready { border-left-color: var(--ok); }
.ticket ul { margin: 8px 0; padding-left: 20px; }
.ticket .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.num { font-size: 1.6rem; font-weight: 800; }
.dest { font-size: 1.15rem; font-weight: 700; color: var(--brand); margin: 2px 0 4px; }
.tabs a { margin-right: 14px; color: var(--brand); text-decoration: none; font-weight: 600; }
.muted { color: var(--muted); }
.inline { display: inline; }
.item.soldout { opacity: .6; }
.item.soldout h3 { text-decoration: line-through; text-decoration-color: var(--muted); }
.stockline { font-size: .8rem; font-weight: 700; margin-left: 6px; }
.stockline.low { color: var(--warn); }
.stockline.out { color: var(--bad); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin: 12px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .big { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.seg a { display: inline-block; padding: 6px 12px; border: 1px solid var(--brand); color: var(--brand); text-decoration: none; margin-right: -1px; font-size: .9rem; }
.seg a.on { background: var(--brand); color: #fff; }
.bar { height: 10px; background: var(--accent); border-radius: 5px; min-width: 2px; }
.bar-cell { width: 45%; }
.right { text-align: right; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.filters input[type=date] { width: auto; }
.badge.low { background: #fff3d6; color: var(--warn); }
.badge.out { background: #fde8e6; color: var(--bad); }
.badge.ok { background: #e3f5e9; color: var(--ok); }

.group { margin-bottom: 22px; }
.grouphead { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; background: var(--brand); color: #fff; padding: 12px 14px; border-radius: var(--radius) var(--radius) 0 0; }
.grouphead .dest, .grouphead .muted { color: #fff; }
.grouphead .muted { opacity: .8; }
.grouphead .pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.grouphead .pick span { background: rgba(255,255,255,.16); padding: 2px 9px; border-radius: 99px; font-size: .85rem; font-weight: 600; }
.grouphead button { background: var(--accent); color: var(--brand-dark); font-weight: 700; }
.group .tickets { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 12px; background: #eef1f5; }

#myOrders:empty { display: none; }
#myOrders { margin-bottom: 16px; display: grid; gap: 12px; }
.progress { background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--amber); border-radius: var(--radius); padding: 14px 16px; }
.progress.ready { border-left-color: var(--ok); }
.progress.done { border-left-color: var(--ok); opacity: .85; }
.progress.cancelled { border-left-color: var(--bad); }
.progress .phead { font-size: 1.1rem; margin-bottom: 2px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding-top: 14px; font-size: .85rem; color: var(--muted); text-align: center; }
.steps li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px; border-radius: 4px; background: var(--line); }
.steps li.did { color: var(--ink); }
.steps li.did::before { background: var(--brand); }
.steps li.now { color: var(--ink); font-weight: 700; }
.steps li.now::before { background: var(--amber); animation: pulse 1.4s ease-in-out infinite; }
.progress.ready .steps li.now::before, .progress.done .steps li.now::before { background: var(--ok); animation: none; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .steps li.now::before { animation: none; } }
