/* Linyamo — bold & trustworthy. Clinical blue #0b5fa5, black #111417. */

/* The `hidden` attribute must always win over display utilities (e.g. .btn
   sets display, which would otherwise override [hidden]). */
[hidden] { display: none !important; }

:root {
  --blue: #0b5fa5;
  --blue-dark: #084a80;
  --ink: #111417;
  --ink-tint: #e9edf2;
  --red: #d64545;
  --bg: #f4f7fa;
  --card: #ffffff;
  --text: #1a2430;
  --muted: #5f6f7e;
  --border: #dde5ec;
  --input-bg: #ffffff;
  --banner-amber-bg: #fff4d6;
  --banner-amber-tx: #7a5b00;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(11, 95, 165, .08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e141b;
    --card: #18222d;
    --text: #e8eef4;
    --muted: #9db0c0;
    --border: #2a3a49;
    --input-bg: #101922;
    --banner-amber-bg: #3a2f0a;
    --banner-amber-tx: #ffd75e;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0e141b; --card: #18222d; --text: #e8eef4; --muted: #9db0c0;
  --border: #2a3a49; --input-bg: #101922;
  --banner-amber-bg: #3a2f0a; --banner-amber-tx: #ffd75e;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
:root[data-theme="light"] {
  --bg: #f4f7fa; --card: #ffffff; --text: #1a2430; --muted: #5f6f7e;
  --border: #dde5ec; --input-bg: #ffffff;
  --banner-amber-bg: #fff4d6; --banner-amber-tx: #7a5b00;
  --shadow: 0 2px 10px rgba(11, 95, 165, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.error { color: var(--red); font-size: .9rem; }
.success { color: var(--blue); font-size: .9rem; }

/* ---------- Splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='104' viewBox='0 0 104 104'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 30 L40 52 L16 74'/%3E%3Cpath d='M40 30 L64 52 L40 74'/%3E%3Cpath d='M64 30 L88 52 L64 74'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, var(--blue) 0%, #0a4a83 60%, #083a66 100%);
  background-size: 104px 104px, cover;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .6s ease; color: #fff;
}
#splash.fade { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; padding: 2rem; max-width: 420px; }
.splash-logo {
  width: 116px; height: 116px; margin: 0 auto 1.1rem;
  background: #fff; border-radius: 30px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.splash-logo img { width: 100%; height: 100%; display: block; }
.splash-word { font-size: 2.6rem; margin: .2rem 0; letter-spacing: -.5px; font-weight: 800; }
.splash-tag { font-size: 1.15rem; opacity: .92; margin: .2rem 0 1.6rem; }
.splash-loader { height: 6px; background: rgba(255,255,255,.22); border-radius: 3px; overflow: hidden; margin: 0 auto; max-width: 240px; }
.splash-loader span { display: block; height: 100%; width: 40%; background: #fff; border-radius: 3px; animation: load 1.1s infinite ease-in-out; }
@keyframes load { 0% { transform: translateX(-100%);} 100% { transform: translateX(350%);} }
#splash-enter { margin-top: 1.4rem; }

/* ---------- App bar ---------- */
#appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  background-color: var(--blue);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.08' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22 L30 38 L12 54'/%3E%3Cpath d='M29 22 L47 38 L29 54'/%3E%3Cpath d='M46 22 L64 38 L46 54'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 76px 76px;
  color: #fff; padding: .6rem 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.brand { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.brand img { border-radius: 7px; display: block; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.appbar-actions { display: flex; gap: .4rem; position: relative; align-items: center; }
/* Sign in link in header */
.signin-link {
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: .35rem .8rem;
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 20px;
  white-space: nowrap;
}
.signin-link:hover {
  background: rgba(255,255,255,.15);
}
.icon-btn {
  background: rgba(255,255,255,.14); color: #fff; border: none;
  width: 38px; height: 38px; border-radius: 10px; font-size: 1.25rem; cursor: pointer;
}
.icon-btn:active { background: rgba(255,255,255,.28); }

/* ---------- Header dropdown menu ---------- */
.menu-dropdown {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 60;
  min-width: 11.5rem; display: flex; flex-direction: column; gap: .15rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: .35rem;
}
.menu-dropdown a {
  color: var(--text); text-decoration: none; font-weight: 600;
  padding: 1rem 1.1rem; border-radius: 9px; display: block; font-size: 1.05rem;
}
.menu-biz-header {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1.1rem .6rem;
}
.menu-biz-logo {
  width: 2.2rem; height: 2.2rem; border-radius: 50%; object-fit: cover;
  background: var(--border); flex-shrink: 0;
}
.menu-biz-name {
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#menu-public-links, #menu-biz-links { display: flex; flex-direction: column; gap: .15rem; }
.menu-dropdown a:hover, .menu-dropdown a:focus-visible { background: var(--border); }
.menu-dropdown[hidden] { display: none; }
.menu-sep { border: none; border-top: 1px solid var(--border); margin: .4rem 0; }

/* ---------- About page ---------- */
.steps { margin: 0; padding-left: 1.35rem; }
.steps li { margin-bottom: .55rem; }
.steps li:last-child { margin-bottom: 0; }
.about-foot { text-align: center; margin-top: 1.2rem; }

/* ---------- Layout ---------- */
#app { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.view h2 { margin: .4rem 0 1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow);
}
.card h3 { margin: .2rem 0 .8rem; }
.row { display: flex; align-items: center; }
.gap { gap: .6rem; }
.row .field { flex: 1; }

/* ---------- Buttons / fields ---------- */
.btn {
  display: inline-block; border: none; border-radius: 10px; cursor: pointer;
  font-size: 1rem; font-weight: 600; padding: .7rem 1.1rem; text-decoration: none; text-align: center;
}
.btn-block { display: block; width: 100%; margin: .5rem 0; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:active { background: var(--blue-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-light { background: #fff; color: var(--blue); }
.btn-link { background: none; color: var(--blue); padding: .5rem; }
.field { display: block; margin: .6rem 0; }
.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.field > span em.optional { font-style: normal; font-weight: 400; opacity: .7; }
.field input, .field select {
  width: 100%; padding: .7rem .8rem; font-size: 1rem; border-radius: 10px;
  border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
}
.field input:focus, .field select:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.field input[type="range"] { padding: 0; accent-color: var(--blue); }
.divider { display: flex; align-items: center; gap: .8rem; margin: 1rem 0; color: var(--muted); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Home ---------- */
.hero { text-align: center; margin: 1.4rem 0 1.6rem; }
.hero h2 { font-size: 1.9rem; line-height: 1.25; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 420px) { .card-grid { grid-template-columns: 1fr; } }
.big-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1rem; text-align: center; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; display: block;
}
.big-card h3 { margin: .6rem 0 .3rem; color: var(--blue); }
.big-card p { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }
.big-card-icon { font-size: 2.4rem; }

/* ---------- Join ---------- */
.biz-card { display: flex; gap: .9rem; align-items: center; margin-bottom: .6rem; }
.biz-card h3 { margin: 0; }
.biz-logo { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border); }
.biz-meta { list-style: none; padding: 0; margin: .6rem 0 1rem; }
.biz-meta li { margin: .35rem 0; font-size: .95rem; }
.biz-meta a { color: var(--blue); }

/* ---------- Ticket ---------- */
.ticket-head { text-align: center; margin: 1.2rem 0 .6rem; }
.now-serving-label {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.ticket-number { font-size: 5.4rem; font-weight: 900; color: var(--blue); line-height: 1; }
/* Side-by-side: now-serving number + vertical ticket badge */
.serving-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.serving-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Now serving: black border, black number */
.now-serving-box {
  display: inline-block;
  border: 3px solid #111;
  border-radius: 18px;
  padding: .3rem 1.4rem .5rem;
  background: #fff;
}
#t-now-serving {
  font-size: 5.2rem;
  font-weight: 900;
  color: #111;
  line-height: 1;
}
/* Ticket number in the stat row - stub with perforation + tear (option 2) */
.ticket-stat-val .ticket-shape {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  border: 2.5px solid #1a1a1a;
  border-radius: 14px;
  overflow: hidden;
  vertical-align: middle;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  min-width: 110px;
  height: 64px;
}
.ticket-stat-val .ticket-shape::before {
  content: '✂';
  width: 34px;
  flex-shrink: 0;
  background: #fff;
  border-right: 2.5px dashed #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #555;
}
/* Visible tear notch on the right edge */
.ticket-stat-val .ticket-shape::after {
  content: '';
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid #f2f4f7;
}
.ticket-stat-val #t-number {
  padding: 0 22px 0 16px;
  font-size: 2.1rem;
  font-weight: 800;
  color: #1a73e8;
  line-height: 1;
  background: none !important;
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}
/* Est. wait - no box, just the number, aligned with ticket height */
.stat-val.plain-box {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  font-size: 2.1rem;
  font-weight: 800;
  color: #1a73e8;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* Ultra-simple ticket - matches app's clean card style, no ticket metaphor */
.ticket-simple {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  margin: 1rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  text-align: center;
}
.ts-serving {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1rem;
}
.ts-serving b {
  color: #1a1a1a;
  font-size: 1.2rem;
}
.ts-serving b span {
  background: none !important;
}
.ts-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #22a355;
  border-radius: 50%;
  margin-right: 6px;
}
.ts-yours .ts-label {
  font-size: .75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #888;
}
.ts-num {
  font-size: 5rem;
  font-weight: 900;
  color: #1a73e8;
  line-height: 1.1;
}
.ts-num span {
  background: none !important;
}
.ts-wait {
  margin-top: .8rem;
  font-size: 1rem;
  color: #888;
}
.ts-wait #t-wait-num {
  font-weight: 700;
  color: #555;
  background: none !important;
}

/* Countdown clock style for Est. wait */
#t-wait {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 1px;
}
.next-wait-box {
  background: var(--ink-tint);
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: .7rem 1rem;
  margin: .8rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.next-wait-label { font-weight: 600; font-size: .9rem; }
.next-wait-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 1px;
}
.stat-row {
  display: flex;
  gap: .6rem;
  align-items: stretch;
}
.stat-row .stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.stat-row .stat-label {
  font-size: .78rem;
  margin-top: .4rem;
  text-align: center;
  line-height: 1.3;
}
.pill { display: inline-block; margin-top: .6rem; padding: .35rem .9rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.pill-saved { background: var(--ink-tint); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill-saved { background: #1d2630; color: #c9d8e8; } }
:root[data-theme="dark"] .pill-saved { background: #1d2630; color: #c9d8e8; }
.banner { border-radius: 12px; padding: .8rem 1rem; margin: .8rem 0; font-weight: 600; text-align: center; }
.banner-almost { background: var(--banner-amber-bg); color: var(--banner-amber-tx); animation: pulse 1.6s infinite; }
.banner-serving { background: var(--ink-tint); color: var(--ink); }
.banner-ended { background: var(--border); color: var(--text); }
.banner-closed { background: var(--banner-amber-bg); color: var(--banner-amber-tx); }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.02);} }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .4rem; text-align: center; }
.stat-val { display: block; font-size: 1.5rem; font-weight: 800; color: var(--blue); }
.stat-label { font-size: .78rem; color: var(--muted); }
.live-dot { font-size: .85rem; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); animation: blink 1.8s infinite; vertical-align: middle; }
@keyframes blink { 0%,100% { opacity: 1;} 50% { opacity: .35;} }
.stepper { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: .6rem; }
.stepper-val { font-size: 1.05rem; min-width: 90px; text-align: center; }

/* ---------- Statistics ---------- */
.bars { display: flex; flex-direction: column; gap: .3rem; margin: .5rem 0 1rem; }
.bar-row { display: flex; align-items: center; gap: .5rem; font-size: .8rem; }
.bar-label { width: 52px; flex: none; color: var(--muted); text-align: right; }
.bar-track { flex: 1; background: var(--border); border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 6px; }
.bar-fill.green { background: var(--ink); } /* legacy class name (JS hook); now black */
.bar-val { width: 34px; flex: none; font-weight: 700; }
.stars { display: flex; gap: .4rem; justify-content: center; margin: .6rem 0; }
.star { font-size: 2.2rem; background: none; border: none; cursor: pointer; color: var(--border); padding: 0 .1rem; }
.star.lit { color: #f5a623; }
.review { border-top: 1px solid var(--border); padding: .5rem 0; font-size: .88rem; }
.review .r-stars { color: #f5a623; font-weight: 700; }
.review .r-day { color: var(--muted); font-size: .75rem; }

/* ---------- Collapsible ---------- */
.collapse-toggle {
  width: 100%; background: none; border: none; color: var(--text);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.05rem; font-weight: 700; padding: .3rem 0; cursor: pointer;
}
.collapse-toggle .chev { color: var(--muted); font-size: 1.2rem; }

/* ---------- Ad slots (reserved, no real ad code) ---------- */
.ad-slot {
  border: 2px dashed var(--border); border-radius: 12px; color: var(--muted);
  text-align: center; font-size: .8rem; padding: 1.1rem; margin: 1rem 0;
  background: transparent;
}
/* Small page-bottom banner: compact and unobtrusive. */
.ad-slot.ad-small {
  padding: .45rem .5rem; font-size: .7rem; margin: .8rem 0 .2rem;
  border-radius: 8px;
}

/* ---------- Setup wizard ---------- */
.steps { display: flex; list-style: none; padding: 0; gap: .3rem; margin: 0 0 1rem; counter-reset: step; }
.steps li { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: block; width: 30px; height: 30px; line-height: 30px; margin: 0 auto .25rem;
  border-radius: 50%; background: var(--border); color: var(--text); font-weight: 700; font-size: .85rem;
}
.steps li.done::before { background: var(--ink); color: #fff; }
.steps li.active::before { background: var(--blue); color: #fff; }
.qr-mini { text-align: center; margin: 1rem 0; }
.qr-mini img { max-width: 220px; border: 1px solid var(--border); border-radius: 8px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .5rem; margin-bottom: 1rem; }
.tab { flex: 1; padding: .6rem; border-radius: 10px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text); font-weight: 600; cursor: pointer; }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Console ---------- */
.qr-card { text-align: center; border-top: 4px solid var(--ink); }
.qr-img { width: 220px; height: 220px; max-width: 70vw; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.qr-code { font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 1px; word-break: break-all; }
.keep-same { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: .8rem; }
.locked-note { background: var(--banner-amber-bg); color: var(--banner-amber-tx); border-radius: 10px; padding: .6rem .8rem; font-size: .88rem; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--border); border-radius: 26px; transition: .2s; cursor: pointer; }
.slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.check-row { display: flex; align-items: center; gap: .7rem; margin: .7rem 0; }
.logo-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .6rem; }
.console-only { font-style: normal; font-weight: 400; color: var(--muted); font-size: .78rem; }

/* ---------- Board ---------- */
.board-h { margin: 1rem 0 .4rem; font-size: .95rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ticket-row {
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem;
  background: var(--input-bg); overflow: hidden;
}
.ticket-row-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; cursor: pointer; width: 100%; background: none; border: none; color: var(--text); text-align: left; font-size: .95rem; }
.ticket-num { background: var(--blue); color: #fff; font-weight: 800; border-radius: 8px; min-width: 40px; height: 34px; display: inline-flex; align-items: center; justify-content: center; }
.ticket-row-head .who { flex: 1; }
.ticket-row-head .who small { display: block; color: var(--muted); }
.ticket-row-head .chev { color: var(--muted); }
/* Estimated wait badge — prominent pill so the receptionist can answer
   "how long?" at a glance. */
.wait-badge {
  background: #e8f1fa;
  color: var(--blue-dark);
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .65rem;
  border-radius: 20px;
  white-space: nowrap;
}
.eta-summary {
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue-dark);
}
.badge-prio { background: #fff4d6; color: #7a5b00; border-radius: 6px; padding: .1rem .45rem; font-size: .75rem; font-weight: 700; }
.ticket-row-detail { padding: .6rem .8rem; border-top: 1px solid var(--border); font-size: .9rem; }
.ticket-row-detail dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: 0 0 .6rem; }
.ticket-row-detail dt { color: var(--muted); }
.ticket-row-detail dd { margin: 0; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.btn-sm { padding: .45rem .8rem; font-size: .85rem; }
.serving-card {
  border: 2px solid #22a355;
  background: #f0faf4;
  border-radius: 12px;
}
/* Now-serving name: big and clear for the receptionist at a glance. */
.serving-card .ticket-row-head .who strong {
  font-size: 1.3rem;
  color: #14532d;
}
.serving-card .ticket-num {
  background: #22a355;
  font-size: 1.15rem;
  min-width: 48px;
  height: 42px;
}
.empty-note { color: var(--muted); font-size: .9rem; padding: .6rem 0; }
.addline { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .6rem; }

/* ---------- History ---------- */
.hist-item { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.status-served { color: var(--blue); font-weight: 700; }
.status-noshow, .status-removed, .status-left { color: var(--muted); }

/* ---------- Modal / toast ---------- */
#modal-root:empty { display: none; }
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: var(--card); border-radius: var(--radius); padding: 1.4rem; max-width: 400px; width: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.modal h3 { margin-top: 0; }
#toast-root { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 950; display: flex; flex-direction: column; gap: .5rem; align-items: center; width: min(92vw, 420px); }
.toast { background: #1a2430; color: #fff; border-radius: 10px; padding: .7rem 1rem; font-size: .92rem; box-shadow: 0 4px 16px rgba(0,0,0,.3); animation: toastin .25s ease; width: 100%; text-align: center; }
@keyframes toastin { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

/* ---------- Scanner overlay ---------- */
.scan-overlay { position: fixed; inset: 0; z-index: 900; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan-overlay video { width: 100%; max-width: 480px; }
.scan-hint { color: #fff; margin: 1rem; text-align: center; }

@media (min-width: 700px) {
  #app { padding-top: 1.6rem; }
}

/* ---------- Platform admin (hidden #/admin route) ---------- */
.admin-badge {
  display: inline-block; background: var(--blue); color: #fff;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 999px; vertical-align: middle; margin-left: .5rem;
}
.admin-badge[hidden] { display: none; }
#admin-badge { margin-left: .4rem; }
.stat-card { text-align: center; padding: .9rem .4rem; }
.table-wrap { overflow-x: auto; margin: 0 -.2rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .84rem; min-width: 560px; }
.admin-table th, .admin-table td { text-align: left; padding: .5rem .45rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table th { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; }
.admin-table tr.disabled-row td { opacity: .55; }
.btn-sm { padding: .32rem .65rem; font-size: .8rem; border-radius: 8px; }
.adslot-row { border: 1px solid var(--border); border-radius: 10px; padding: .7rem; margin-bottom: .7rem; }
.adslot-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .3rem; }

/* ---------- Terms of Service ---------- */
.terms-check {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .92rem; margin: .9rem 0; line-height: 1.45;
}
.terms-check input[type="checkbox"] {
  width: 1.15rem; height: 1.15rem; margin-top: .1rem; accent-color: var(--blue);
  flex-shrink: 0;
}
#terms-body p { font-size: .94rem; line-height: 1.6; margin: .55rem 0; }
.terms-section { margin-bottom: 1.1rem; }
.terms-section h3 { margin: 0 0 .35rem; font-size: 1.02rem; }
.terms-list { margin: .4rem 0; padding-left: 1.2rem; }
.terms-list li { font-size: .94rem; line-height: 1.55; margin-bottom: .35rem; }
/* LIMITATION OF LIABILITY — visually distinct bordered callout */
.terms-liability {
  border: 2px solid var(--red);
  border-radius: var(--radius);
  background: var(--card);
  padding: .9rem 1rem;
}
.terms-liability h3 { color: var(--red); }

/* ---------- App footer ---------- */
#app-footer {
  text-align: center; padding: 1.6rem 1rem 2.4rem;
  color: var(--muted); font-size: .85rem;
}
#app-footer a { color: var(--blue); }

/* ---------- Home v2 (chevron identity) ---------- */
.home-banner {
  margin: -1rem -1rem 1.3rem;
  border-radius: 0 0 26px 26px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.14' stroke-width='10' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 34 L46 60 L18 86'/%3E%3Cpath d='M46 34 L74 60 L46 86'/%3E%3Cpath d='M74 34 L102 60 L74 86'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--blue) 0%, #0e7cc0 48%, #0a0f16 135%);
  background-size: 120px 120px, cover;
  color: #fff;
  box-shadow: 0 4px 18px rgba(11, 95, 165, .25);
}
.home-banner-inner { text-align: center; padding: 2rem 1rem 2.1rem; }
.home-logo {
  display: inline-flex; width: 72px; height: 72px;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.25); margin-bottom: .7rem;
}
.home-logo img { width: 100%; height: 100%; display: block; }
.home-word { font-size: 2rem; font-weight: 800; letter-spacing: -.5px; }
.home-tag { margin: .25rem 0 0; font-size: 1.05rem; opacity: .95; }
.home-question {
  text-align: center; font-size: 1.4rem; font-weight: 800;
  margin: .2rem 0 1.1rem; letter-spacing: -.3px;
}
.choice-list { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1rem; }
.choice-card {
  position: relative; display: flex; align-items: center; gap: .9rem;
  background: var(--card); border: 1px solid var(--border);
  border-left: 5px solid var(--blue); border-radius: 18px;
  padding: 1.05rem .95rem; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow);
}
.choice-card:active { transform: scale(.99); }
.choice-card.choice-ink { border-left-color: var(--ink); }
.choice-icon {
  flex: none; width: 54px; height: 54px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.choice-blue .choice-icon { background: #e3eefb; color: var(--blue); }
.choice-ink .choice-icon { background: var(--ink-tint); color: var(--ink); }
.choice-icon svg { width: 28px; height: 28px; }
.choice-body { flex: 1; min-width: 0; }
.choice-body strong { display: block; font-size: 1.12rem; margin-bottom: .25rem; }
.choice-sub { display: block; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.choice-chev {
  flex: none; width: 44px; height: 44px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.choice-blue .choice-chev { color: var(--blue); border: 2px solid #bcd6f5; background: #f2f7fd; }
.choice-ink .choice-chev { color: var(--ink); border: 2px solid #c3ccd6; background: #f4f6f9; }
.choice-chev svg { width: 22px; height: 22px; }
.trust-line {
  text-align: center; color: var(--muted); font-size: .85rem;
  margin: 1.2rem 0 .4rem;
}
.trust-chev { color: var(--blue); font-weight: 800; }

@media (min-width: 700px) {
  .home-banner { margin-top: -1.6rem; }
}

/* ---------- Floating "Open live line" button ---------- */
.fab-line {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.1rem;
  border: none; border-radius: 999px;
  background: var(--blue); color: #fff;
  font-size: .95rem; font-weight: 700;
  box-shadow: 0 6px 20px rgba(11, 95, 165, .35);
  cursor: pointer;
}
.fab-line:active { transform: scale(.97); }
.fab-line[hidden] { display: none; }

/* ---------- Now Serving Display (monitor/TV kiosk) ---------- */
.display-view {
  position: fixed; inset: 0; z-index: 100;
  background: #fff; color: #111;
  display: flex; align-items: center; justify-content: center;
}
.display-view[hidden] { display: none; }
.display-inner { text-align: center; padding: 2rem; max-width: 90vw; }
.display-brand {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin-bottom: 3rem;
}
.display-logo { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; }
.display-bizname { font-size: 2rem; font-weight: 700; color: #333; }
.display-label {
  font-size: 2.5rem; font-weight: 600; letter-spacing: .3em;
  color: #666; margin-bottom: 1rem;
}
.display-number {
  font-size: 38vmin; font-weight: 900; line-height: 1;
  color: #111; font-variant-numeric: tabular-nums;
}
.display-fs-btn {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 101;
  background: rgba(0,0,0,.06); color: #333; border: 1px solid rgba(0,0,0,.15);
  border-radius: 12px; padding: .8rem 1.2rem; font-size: 1.1rem; cursor: pointer;
}
.display-fs-btn:hover { background: rgba(0,0,0,.12); }
.display-sub { font-size: 1.5rem; color: #888; margin-top: 2rem; }
@media (max-width: 600px) {
  .display-number { font-size: 7rem; }
  .display-label { font-size: 1.5rem; }
  .display-bizname { font-size: 1.3rem; }
}

/* ---------- Offline mode banner ---------- */
.offline-banner {
  background: #fff3cd; color: #856404; border: 1px solid #ffc107;
  border-radius: 12px; padding: .9rem 1.2rem; margin-bottom: 1rem;
  font-weight: 600; text-align: center;
}

.warning-note {
  color: #856404; background: #fff3cd; border: 1px solid #ffc107;
  border-radius: 8px; padding: .6rem .9rem; margin-top: .6rem; font-size: .9rem;
}
.warning-note[hidden] { display: none; }

/* Settings toggles */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  font-weight: 600;
  cursor: pointer;
}
.toggle-row:last-of-type { border-bottom: none; }
.toggle {
  appearance: none;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle:checked { background: var(--primary, #1d4ed8); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.toggle:checked::after { left: 25px; }
/* Flash screen alert overlay */
#flash-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .15s;
}
#flash-overlay.flash-on { opacity: 1; }

/* Notifications tutorial visuals */
.help-visual { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.phone-mock { flex: 1 1 140px; max-width: 200px; border: 2px solid #ccc; border-radius: 12px; overflow: hidden; background: #f8f8f8; }
.phone-bar { background: #e8e8e8; padding: .5rem; font-size: .85rem; display: flex; align-items: center; gap: .4rem; border-bottom: 1px solid #ddd; }
.phone-bar .lock { font-size: 1.1rem; }
.phone-tip { padding: .4rem .5rem; font-size: .8rem; color: #0066cc; background: #e8f4ff; }
.phone-menu { padding: .3rem; }
.phone-menu-row { padding: .5rem; font-size: .9rem; display: flex; align-items: center; gap: .5rem; border-bottom: 1px solid #eee; }
.phone-menu-row.highlight { background: #e8f5e9; font-weight: bold; color: #2e7d32; }

/* Tutorial images */
.help-img { width: 100%; max-width: 400px; border-radius: 12px; margin: 0.8rem 0; display: block; }

/* Tutorial videos */
.help-video { width: 100%; max-width: 640px; border-radius: 12px; margin: 0.8rem 0; display: block; background: #000; }

/* Bigger ticket page - readable but fits on screen */
.stat-val { font-size: 2rem; }
.stat-label { font-size: .9rem; }
.stat { padding: 1rem .4rem; }
.card { font-size: 1.05rem; }
.card h3 { font-size: 1.2rem; }
.btn { font-size: 1.1rem; padding: .9rem 1.2rem; }
.field input, .field select { font-size: 1.1rem; padding: .8rem; }
.field span { font-size: 1rem; }
.collapse-toggle { font-size: 1.1rem; }
.stepper-val { font-size: 1.2rem; }
.stepper button { font-size: 1.3rem; width: 48px; height: 48px; }

/* Notify presets */
.ping-presets { display: flex; gap: .6rem; justify-content: center; margin-bottom: .8rem; }
.ping-preset { min-width: 64px; font-size: 1.2rem; font-weight: 700; }

/* Name modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: #fff; border-radius: 16px;
  padding: 1.5rem; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.modal-card h3 { margin: 0 0 1rem; font-size: 1.3rem; }
.modal-card .field { margin-bottom: 1rem; }

/* Change name link */
.link { color: var(--blue); text-decoration: underline; font-size: 1rem; }
