:root {
  --teal: #00B8D9;          /* Swag Shack cyan (accent, selected states, primary buttons) */
  --teal-dark: #007C96;     /* cyan dark enough for text and links on white */
  --teal-soft: #E1F7FC;
  --ink: #111111;
  --ink-2: #5B6366;
  --line: #E3E6E8;
  --page: #FFFFFF;
  --card: #FFFFFF;
  --gold: #FFD23F;
  --ok: #1F7A4D;
  --warn-bg: #FFF4D6;
  --warn-ink: #6B4E00;
  --bad: #B3261E;
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --shadow-1: 0 1px 2px rgba(17,17,17,.04), 0 6px 20px rgba(17,17,17,.06);
  --shadow-2: 0 2px 4px rgba(17,17,17,.05), 0 12px 40px rgba(17,17,17,.14);
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.45 var(--font); -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { background: var(--ink); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.top img { height: 44px; width: 44px; object-fit: contain; }
.top h1 { font-size: 18px; margin: 0; letter-spacing: -0.2px; line-height: 1.15; }
.top p { margin: 2px 0 0; font-size: 13px; color: #B9C4C7; }
.top .spacer { flex: 1; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1100px; }

.notice { border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.notice.bad { background: #FCE4E2; color: var(--bad); }
.notice.ok { background: #DDF3E7; color: var(--ok); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 12px; }

.btn {
  text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; min-height: 50px;
  background: var(--teal); color: var(--ink);
}
.btn:hover { background: #00A3C0; }
.btn:disabled { background: #AEBBBE; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2B2F31; }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.ghost:hover { background: var(--teal-soft); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { min-height: 40px; padding: 8px 12px; font-size: 14px; }

label.field { display: block; margin: 0 0 12px; font-weight: 600; font-size: 14px; }
label.field span.hint { font-weight: 400; color: var(--ink-2); }
input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select {
  width: 100%; margin-top: 4px; padding: 12px; font-size: 16px; /* 16px stops iOS zoom */
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--teal); }

.money { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
[hidden] { display: none !important; }

/* ---------- storefront ---------- */
.product h2 { margin: 0; font-size: 19px; letter-spacing: -0.3px; }
.product .price { font-weight: 800; font-size: 19px; }
.product p { margin: 4px 0 10px; color: var(--ink-2); font-size: 14px; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.size {
  min-width: 52px; min-height: 48px; padding: 6px 12px; border-radius: 10px; font-weight: 700;
  background: #fff; border: 2px solid var(--line);
}
.size[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.size:disabled { color: #9AA6A9; background: #EEF2F2; text-decoration: line-through; cursor: not-allowed; }
.size small { display: block; font-size: 11px; font-weight: 600; color: var(--bad); text-decoration: none; }

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(17,17,17,.96); z-index: 10;
}
.cartbar .btn { max-width: 528px; margin: 0 auto; display: flex; background: var(--gold); color: var(--ink); }
.spacer-bottom { height: 92px; }

dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; margin: auto auto 0;
  border-radius: 20px 20px 0 0; background: var(--page);
}
dialog.sheet::backdrop { background: rgba(0,0,0,.55); }
.sheet-head { position: sticky; top: 0; background: var(--page); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-body { padding: 16px; overflow-y: auto; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.qty { justify-self: start; display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 44px; height: 40px; border: 0; background: #fff; font-size: 20px; font-weight: 700; }
.qty span { min-width: 28px; text-align: center; font-weight: 700; }
.totals { margin: 10px 0 14px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 20px; font-weight: 800; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; }
.totals .disc { color: var(--ok); font-weight: 700; }
.promo-row { display: flex; gap: 8px; }
.promo-row input { margin-top: 0; text-transform: uppercase; }
.fine { font-size: 12.5px; color: var(--ink-2); }
.fine a { color: var(--teal-dark); }

/* ---------- order ticket ---------- */
.ticket { background: #fff; border-radius: 18px; border: 1px solid var(--line); overflow: hidden; }
.ticket .stub { background: var(--ink); color: #fff; text-align: center; padding: 22px 16px 18px; position: relative; }
.ticket .stub small { color: #B9C4C7; display: block; }
.ticket .code { font-size: 64px; font-weight: 900; letter-spacing: 6px; line-height: 1.05; color: var(--gold); margin: 4px 0; font-variant-numeric: tabular-nums; }
.ticket .tear { border-top: 3px dashed var(--line); margin: 0 -1px; position: relative; }
.ticket .tear::before, .ticket .tear::after {
  content: ""; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; background: var(--page); border: 1px solid var(--line);
}
.ticket .tear::before { left: -13px; } .ticket .tear::after { right: -13px; }
.ticket .body { padding: 18px 16px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li { text-align: center; font-size: 13px; font-weight: 700; color: #8C999C; }
.steps li::before { content: ""; display: block; height: 8px; border-radius: 4px; background: var(--line); margin-bottom: 6px; }
.steps li.done { color: var(--ink); } .steps li.done::before { background: var(--teal); }
.steps li.now::before { background: var(--gold); box-shadow: 0 0 0 2px var(--ink) inset; }
.big-status { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; margin: 0 0 4px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.tab { border: 0; background: transparent; padding: 10px 14px; border-radius: 10px; font-weight: 700; white-space: nowrap; min-height: 44px; }
.tab[aria-selected=true] { background: var(--ink); color: #fff; }
.queuebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 800; background: var(--teal-soft); color: var(--teal-dark); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.bad { background: #FCE4E2; color: var(--bad); }
.order { border-left: 8px solid var(--teal); }
.order.runner_out { border-left-color: var(--gold); }
.order.ready { border-left-color: var(--ok); }
.order.flagged { outline: 3px solid var(--bad); }
.order .code { font-size: 32px; font-weight: 900; letter-spacing: 3px; line-height: 1; }
.order ul { margin: 8px 0; padding: 0; list-style: none; }
.order li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.order li:last-child { border: 0; }
.order .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.order .actions .btn { flex: 1 1 130px; }
.flagnote { background: #FCE4E2; color: var(--bad); font-weight: 700; padding: 8px 10px; border-radius: 10px; margin-top: 8px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t input[type=number] { width: 80px; margin: 0; padding: 8px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.stat { font-size: 28px; font-weight: 900; letter-spacing: -0.5px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 50; font-weight: 600; max-width: 90vw; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background .15s; }
}

/* ---------- v2: categories, photos, locations, offers ---------- */
.cats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 4px 16px; position: sticky; top: 0; z-index: 4; background: var(--page); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font-weight: 700; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-head { margin: 18px 0 8px; font-size: 14px; font-weight: 800; color: var(--ink-2); letter-spacing: .2px; }
.product .photobtn { display: block; width: calc(100% + 28px); margin: -14px -14px 12px; padding: 0; border: 0; background: #fff; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; cursor: zoom-in; position: relative; border-bottom: 1px solid var(--line); }
.product .photo { display: block; width: 100%; aspect-ratio: 1 / 1; max-width: none; object-fit: contain; background: #fff; }
.product .zoomhint { position: absolute; right: 10px; bottom: 10px; background: rgba(17,17,17,.78); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.zoomimg { display: block; width: 100%; max-height: 78vh; object-fit: contain; background: #fff; border-radius: 12px; }
.track { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.trackchip { flex: 1 1 200px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 12px 14px; text-decoration: none; min-height: 52px; }
.trackchip b { color: var(--gold); letter-spacing: 2px; font-size: 20px; }
.trackchip span { font-weight: 700; font-size: 14px; }
.trackchip.ready { background: var(--ok); } .trackchip.ready b { color: #fff; }
.offer { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; background: var(--gold); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; font-weight: 800; }
.offer small { display: block; font-weight: 600; opacity: .8; }
.offer .btn { background: var(--ink); color: #fff; }
fieldset.locs { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.locs legend { font-weight: 700; font-size: 14px; padding: 0; margin-bottom: 6px; }
.locopt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 12px; margin: 0 0 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; cursor: pointer; }
.locopt:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.locopt input { width: 22px; height: 22px; accent-color: var(--teal); flex: none; }
.linkbtn { background: none; border: 0; padding: 8px 0; color: var(--teal-dark); font-weight: 700; text-decoration: underline; min-height: 44px; }
dialog.sheet.center { border-radius: 20px; margin: auto; max-height: 90vh; width: calc(100% - 32px); }
.locimg { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.locbig { display: inline-block; background: var(--gold); color: var(--ink); font-weight: 900; border-radius: 8px; padding: 2px 10px; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--teal-soft); }
.clockbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fchips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 12px; }

/* ---------- v2.1: admin groups, compact rows, confirm ---------- */
details.grp { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; }
details.grp > summary { padding: 14px; font-weight: 800; font-size: 17px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; min-height: 52px; }
details.grp > summary::-webkit-details-marker { display: none; }
details.grp > summary::after { content: "+"; font-size: 24px; font-weight: 700; color: var(--ink-2); }
details.grp[open] > summary::after { content: "\2212"; }
.grp-body { padding: 0 12px 12px; }
details.itemrow { border-top: 1px solid var(--line); }
details.itemrow > summary { display: flex; align-items: center; gap: 12px; padding: 10px 2px; cursor: pointer; list-style: none; min-height: 64px; }
details.itemrow > summary::-webkit-details-marker { display: none; }
details.itemrow > summary::after { content: "\203A"; font-size: 24px; color: var(--ink-2); transition: transform .15s; }
details.itemrow[open] > summary::after { transform: rotate(90deg); }
details.itemrow .edit { padding: 4px 2px 16px; }
.grow { flex: 1; min-width: 0; }
.thumb.sm { width: 48px; height: 48px; flex: none; }
.searchbar { position: sticky; top: 64px; z-index: 3; background: var(--page); padding: 8px 0 10px; margin: 0 0 4px; }
.searchbar input { margin-top: 0; }
.subnav { margin: 0 0 14px; }
.bigclock { text-align: center; padding: 22px 16px; }
.bigclock .state { font-size: 26px; font-weight: 900; letter-spacing: -.4px; }
.bigclock .elapsed { font-size: 40px; font-weight: 900; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }
.bigclock .btn { min-height: 64px; font-size: 20px; width: 100%; }
.clockmini { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
dialog.sheet.center::backdrop { background: rgba(0,0,0,.6); }

/* ---------- v2.3: sleek storefront look (Swag Shack cyan + black, Nike-style restraint) ---------- */
body { background: #fff; letter-spacing: -0.005em; }
h1, h2, h3, .big-status, .stat, .product .price, .ticket .code, .cat-head { font-family: var(--display); }
.btn.ghost { border-width: 1.5px; border-color: #CDD2D4; }
.btn.ghost:hover { background: #F5F6F6; border-color: var(--ink); }
.btn { transition: background .2s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.98); }

.top { padding: 12px 18px; gap: 14px; background: var(--ink); position: sticky; top: 0; z-index: 8; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 8px 24px rgba(0,0,0,.18); }
.top h1 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.top p { color: var(--teal); font-weight: 600; }

/* product cards: borderless, big photo, quiet text */
.card.product { background: transparent; border: 0; padding: 0; margin: 0 0 30px; border-radius: 0; }
.card.product .photobtn { width: 100%; margin: 0 0 12px; border: 0; border-radius: var(--radius); background: #F5F5F5; }
.card.product .photo { background: #F5F5F5; mix-blend-mode: multiply; transition: transform .5s var(--ease); }
.card.product .photobtn:hover .photo { transform: scale(1.03); }
.product .zoomhint { right: 12px; bottom: 12px; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: var(--shadow-1); backdrop-filter: blur(6px); }
.product h2 { font-size: 18px; font-weight: 600; }
.product .price { font-size: 18px; font-weight: 600; }
.product p { margin: 2px 0 12px; }
.size { border: 1.5px solid #CDD2D4; border-radius: 12px; transition: border-color .15s, background .15s; }
.size:hover:not(:disabled) { border-color: var(--ink); }
.size[aria-pressed=true] { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.size:disabled { background: #F5F5F5; border-color: #EEE; }
.product .add { background: var(--ink); color: #fff; min-height: 54px; font-size: 16px; }
.product .add:hover { background: #2B2F31; }

.cat-head { font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; margin: 26px 0 14px; }
.cats { background: rgba(255,255,255,.94); backdrop-filter: blur(10px); top: 70px; padding: 10px 16px; margin-bottom: 14px; }
.chip { border: 1.5px solid #CDD2D4; background: #fff; transition: background .15s, border-color .15s, color .15s; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }

.cartbar { background: transparent; padding-top: 0; pointer-events: none; }
.cartbar .btn { pointer-events: auto; background: var(--teal); color: var(--ink); min-height: 56px; font-size: 17px; box-shadow: 0 10px 30px rgba(0,184,217,.35), 0 2px 6px rgba(17,17,17,.15); }
.cartbar .btn:hover { background: #00A3C0; }

.card { box-shadow: none; border-color: var(--line); }
.offer { border-radius: var(--radius); box-shadow: var(--shadow-1); }
.offer .btn { background: var(--ink); color: #fff; }
.trackchip { border-radius: var(--radius); box-shadow: var(--shadow-1); }
.trackchip b { font-family: var(--display); }
.notice { border-radius: 14px; }
.toast { border-radius: 999px; padding: 12px 20px; box-shadow: var(--shadow-2); }

input[type=text], input[type=tel], input[type=password], input[type=number], input[type=search], input[type=datetime-local], select {
  border: 1.5px solid #CDD2D4; border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(0,184,217,.25); }
.locopt { border: 1.5px solid #CDD2D4; border-radius: 14px; transition: border-color .15s, background .15s; }
.locopt:has(input:checked) { border: 2px solid var(--ink); background: #fff; }
.linkbtn { color: var(--teal-dark); }

/* windows: soft layered shadow, blurred backdrop, smooth slide/fade */
dialog.sheet { background: #fff; box-shadow: 0 -10px 40px rgba(17,17,17,.16), 0 -2px 8px rgba(17,17,17,.06); border-radius: 24px 24px 0 0; overflow: hidden; }
dialog.sheet.center { border-radius: 24px; box-shadow: var(--shadow-2); }
dialog.sheet::backdrop { background: rgba(17,17,17,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet-head { background: #fff; }
.sheet-body { max-height: calc(92vh - 70px); }
dialog.sheet.center .sheet-body { max-height: 88vh; }
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheetUp .38s var(--ease); }
  dialog.sheet.center[open] { animation: popIn .3s var(--ease); }
  dialog.sheet[open]::backdrop { animation: fadeIn .3s ease-out; }
  @keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes popIn { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .toast { animation: popIn .3s var(--ease); }
}

/* ticket */
.ticket { border: 0; border-radius: 24px; box-shadow: var(--shadow-2); }
.ticket .stub { padding: 26px 16px 22px; }
.ticket .code { font-weight: 600; }
.ticket .tear::before, .ticket .tear::after { background: var(--page); border: 0; box-shadow: inset 0 2px 4px rgba(17,17,17,.08); }
.steps li.done::before { background: var(--teal); }
.big-status { font-weight: 600; }

/* admin picks up the same palette */
.tabs { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(17,17,17,.04); }
.tab { border-radius: 999px; transition: background .15s; }
.tab:hover:not([aria-selected=true]) { background: #F0F2F3; }
.order { border-left-width: 6px; }
.stat { font-weight: 600; }
