/* =========================================================
   QueueLess — shared iOS-style design system
   Tokens follow Apple HIG semantic system colors.
   ========================================================= */
:root {
  --bg: #f2f2f7;
  --cell: #ffffff;
  --cell-pressed: #e5e5ea;
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --separator: rgba(60, 60, 67, .29);
  --fill: rgba(120, 120, 128, .2);
  --fill-2: rgba(120, 120, 128, .16);
  --fill-3: rgba(118, 118, 128, .12);
  --gray: #8e8e93;
  --gray-2: #aeaeb2;
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --yellow: #ffcc00;
  --primary-bg: #1c1c1e;
  --primary-fg: #ffffff;
  --bar: rgba(242, 242, 247, .78);
  --material: rgba(246, 246, 246, .86);
  --material-sep: rgba(60, 60, 67, .36);
  --scrim: rgba(0, 0, 0, .2);
  --shadow-banner: 0 10px 40px rgba(0, 0, 0, .12);
  --accent: var(--blue);
  --r-group: 12px;
  --r-card: 22px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --cell: #1c1c1e;
    --cell-pressed: #2c2c2e;
    --label: #ffffff;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .6);
    --fill: rgba(120, 120, 128, .36);
    --fill-2: rgba(120, 120, 128, .32);
    --fill-3: rgba(118, 118, 128, .24);
    --blue: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --yellow: #ffd60a;
    --primary-bg: #ffffff;
    --primary-fg: #000000;
    --bar: rgba(22, 22, 24, .78);
    --material: rgba(37, 37, 37, .86);
    --material-sep: rgba(84, 84, 88, .65);
    --scrim: rgba(0, 0, 0, .45);
    --shadow-banner: 0 10px 40px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  font-family: var(--font);
  font-size: 17px; line-height: 22px; letter-spacing: -.41px;
  background: var(--bg); color: var(--label);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv11", "ss01";
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; opacity: .35; }
a { color: var(--blue); text-decoration: none; }
a:active { opacity: .6; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */
.num { font-variant-numeric: tabular-nums; }

.app { max-width: 480px; margin: 0 auto; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.app.wide { max-width: 1040px; }

/* ---------- Navigation bar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  transition: background .2s, box-shadow .2s;
}
.navbar.scrolled {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--separator);
}
.nav-title { font-size: 17px; font-weight: 600; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.navbar.scrolled .nav-title { opacity: 1; transform: none; }
.nav-left { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; letter-spacing: -.24px; color: var(--label); }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 4px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border-radius: 16px;
  color: var(--label); background: var(--fill-3); font-size: 15px; font-weight: 500; letter-spacing: -.24px;
}
.nav-btn:active { opacity: .6; }
.app-icon {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(180deg, #3a3a3c, #1c1c1e);
  color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; letter-spacing: 0;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.12);
}
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--label-2); letter-spacing: -.08px; margin-right: 6px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: live 2s infinite; }
.live.offline .live-dot { background: var(--gray); animation: none; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,.5); } 70%, 100% { box-shadow: 0 0 0 6px rgba(52,199,89,0); } }

.large-title { padding: 4px 16px 0; }
.large-title .eyebrow { font-size: 13px; line-height: 18px; color: var(--label-2); letter-spacing: -.08px; font-weight: 500; }
.large-title h1 { font-family: var(--font-display); font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; margin-top: 2px; }

/* ---------- Sections & inset-grouped lists ---------- */
.section { margin: 22px 16px 0; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; padding: 0 16px 7px; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--label-2); text-transform: uppercase; letter-spacing: -.08px; }
.section-header .count { text-transform: none; }
.section-footer { padding: 7px 16px 0; font-size: 13px; line-height: 18px; color: var(--label-2); letter-spacing: -.08px; }
.section-footer.error { color: var(--red); }

.group { background: var(--cell); border-radius: var(--r-group); overflow: hidden; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 0 16px; width: 100%; text-align: left;
  background: var(--cell); transition: background .15s;
}
a.row { color: var(--label); }
button.row:active:not(:disabled), a.row:active { background: var(--cell-pressed); transition: none; opacity: 1; }
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--separator); }
.row.has-icon + .row::before, .row + .row.has-icon::before { left: 58px; }
.row-label { flex: 1; min-width: 0; padding: 11px 0; }
.row-value { color: var(--label-2); white-space: nowrap; }
.row-sub { display: block; font-size: 13px; line-height: 18px; color: var(--label-2); letter-spacing: -.08px; }
.row.destructive { color: var(--red); }
.row.center { justify-content: center; }
.row.link { color: var(--blue); }
.chevron { color: var(--label-3); flex: none; }
.icon-tile { width: 30px; height: 30px; border-radius: 7px; flex: none; display: grid; place-items: center; color: #fff; background: var(--gray); }
.icon-tile.dark { background: #3a3a3c; }
.icon-tile.red { background: var(--red); }
.icon-tile.green { background: var(--green); }
.icon-tile.blue { background: var(--blue); }
.icon-tile.orange { background: var(--orange); }

/* Form rows */
.field-row { gap: 0; }
.field-row > label { width: 92px; flex: none; padding: 11px 0; }
.field-row input, .field-row select {
  flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 17px;
}
.field-row input::placeholder, textarea::placeholder { color: var(--label-3); }
.field-row .err-icon { color: var(--red); flex: none; display: none; margin-left: 8px; }
.field-row.invalid .err-icon { display: block; }
.clear-btn { display: none; width: 18px; height: 18px; border-radius: 50%; flex: none; margin-left: 8px; background: var(--gray-2); color: var(--cell); place-items: center; }
.field-row.has-value:focus-within .clear-btn { display: grid; }
.field-row.invalid .clear-btn { display: none !important; }
.text-area { display: block; width: 100%; min-height: 110px; padding: 12px 16px; border: 0; background: transparent; resize: none; font-size: 17px; line-height: 22px; }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px; border-radius: 14px; padding: 0 16px;
  font-size: 17px; font-weight: 600; letter-spacing: -.41px;
  transition: opacity .15s, transform .15s var(--ease), background .2s;
}
.btn:active:not(:disabled) { opacity: .7; transform: scale(.985); }
.btn-primary { background: var(--primary-bg); color: var(--primary-fg); }
.btn-success { background: var(--green); color: #fff; }
.btn-tinted { background: var(--fill-3); color: var(--label); }
.btn-danger-tinted { background: var(--fill-3); color: var(--red); }
.btn-sm { height: 34px; width: auto; border-radius: 17px; font-size: 15px; letter-spacing: -.24px; padding: 0 14px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: .8; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Stats strip */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--cell); border-radius: var(--r-group); }
.stats.four { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 12px 14px 13px; position: relative; min-width: 0; }
.stat + .stat::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: .5px; background: var(--separator); }
.stat-label { font-size: 12px; line-height: 16px; color: var(--label-2); letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-family: var(--font-rounded); font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: .35px; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--label-2); margin-left: 2px; letter-spacing: -.08px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--fill-3); font-size: 13px; font-weight: 600; letter-spacing: -.08px; white-space: nowrap; }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); transition: background .4s; }
.pill.pulse .pill-dot { animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* Switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .3s var(--ease), width .2s var(--ease); }
.switch input:checked ~ .track { background: var(--green); }
.switch input:checked ~ .knob { transform: translateX(20px); }
.switch input:active ~ .knob { width: 31px; }
.switch input:checked:active ~ .knob { transform: translateX(16px); }
.switch input:disabled { cursor: default; }
.switch input:disabled ~ .track, .switch input:disabled ~ .knob { opacity: .5; }
.switch input:focus-visible ~ .track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Notice card */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--cell); border-radius: var(--r-group); }
.notice strong { display: block; font-weight: 600; }
.notice p { font-size: 15px; line-height: 20px; color: var(--label-2); letter-spacing: -.24px; margin-top: 2px; }

.fade-in { animation: fadeIn .45s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.footer { text-align: center; font-size: 13px; color: var(--label-2); margin-top: 28px; letter-spacing: -.08px; line-height: 20px; }
.footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; }
.footer a, .footer button { color: var(--label-2); font-size: 13px; }
.footer a:hover, .footer button:hover { color: var(--label); }
.footer .copy { margin-top: 6px; color: var(--label-3); font-size: 12px; }

/* Offline / connection strip */
.conn { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translate(-50%, 150%); z-index: 40;
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 20px;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-banner); font-size: 14px; font-weight: 500; letter-spacing: -.15px; transition: transform .4s var(--ease); white-space: nowrap; }
.conn.show { transform: translate(-50%, 0); }

/* ---------- Banner ---------- */
.banner {
  position: fixed; z-index: 70; left: 50%; top: calc(8px + env(safe-area-inset-top));
  width: min(448px, calc(100% - 16px)); transform: translate(-50%, calc(-100% - 20px));
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 22px;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-banner); transition: transform .5s var(--ease); cursor: pointer;
}
.banner.show { transform: translate(-50%, 0); }
.banner .app-icon { width: 38px; height: 38px; border-radius: 9px; font-size: 19px; }
.banner-body { flex: 1; min-width: 0; }
.banner-top { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; line-height: 20px; letter-spacing: -.24px; }
.banner-top strong { font-weight: 600; }
.banner-top span { color: var(--label-2); font-size: 13px; }
.banner-text { font-size: 15px; line-height: 20px; letter-spacing: -.24px; }

/* ---------- Alerts, action sheets, page sheets ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.open { opacity: 1; pointer-events: auto; }
.overlay.alert-overlay { display: grid; place-items: center; padding: 24px; }
.alert { width: 270px; border-radius: 14px; overflow: hidden; text-align: center; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); transform: scale(1.12); opacity: 0; transition: transform .3s var(--ease), opacity .2s; }
.overlay.open .alert { transform: scale(1); opacity: 1; }
.alert-body { padding: 20px 16px 18px; }
.alert-glyph { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--green); color: #fff; }
.alert-glyph.neutral { background: var(--primary-bg); color: var(--primary-fg); }
.alert h3 { font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.41px; }
.alert p { font-size: 13px; line-height: 18px; letter-spacing: -.08px; margin-top: 3px; }
.alert .ticket-chip { display: inline-block; margin-top: 10px; padding: 4px 10px; border-radius: 8px; background: var(--fill-3); font-family: var(--font-rounded); font-weight: 700; font-size: 17px; letter-spacing: .3px; }
.alert-actions { display: grid; }
.alert-actions.two { grid-template-columns: 1fr 1fr; }
.alert-btn { display: block; width: 100%; height: 44px; font-size: 17px; color: var(--blue); box-shadow: 0 -.5px 0 var(--material-sep); }
.alert-actions.two .alert-btn + .alert-btn { box-shadow: 0 -.5px 0 var(--material-sep), -.5px 0 0 var(--material-sep); }
.alert-btn.bold { font-weight: 600; }
.alert-btn.destructive { color: var(--red); }
.alert-btn:active { background: var(--fill-3); }

.overlay.sheet-overlay { display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: min(464px, 100%); padding: 0 8px calc(8px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .45s var(--ease); }
.overlay.open .sheet { transform: none; }
.sheet-group { border-radius: 14px; overflow: hidden; text-align: center; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); }
.sheet-msg { padding: 14px 16px; font-size: 13px; line-height: 18px; color: var(--label-2); letter-spacing: -.08px; }
.sheet-msg strong { display: block; font-weight: 600; margin-bottom: 2px; }
.sheet-btn { display: block; width: 100%; height: 57px; font-size: 20px; letter-spacing: .38px; color: var(--blue); box-shadow: 0 -.5px 0 var(--material-sep); }
.sheet-btn.destructive { color: var(--red); }
.sheet-btn.cancel { font-weight: 600; margin-top: 8px; border-radius: 14px; background: var(--cell); box-shadow: none; }
.sheet-btn:active { background: var(--fill-3); }

/* Page sheet (card that slides up, like iOS modal sheets) */
.page-sheet-overlay { display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 600px) { .page-sheet-overlay { align-items: center; } }
.page-sheet {
  width: min(480px, 100%); max-height: calc(100dvh - 24px - env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 14px 14px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .45s var(--ease);
}
@media (min-width: 600px) { .page-sheet { border-radius: 14px; padding-bottom: 24px; } }
.overlay.open .page-sheet { transform: none; }
.sheet-bar { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 56px; padding: 0 16px; background: var(--bg); }
.sheet-bar .grabber { position: absolute; top: 5px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill); }
.sheet-bar h3 { font-size: 17px; font-weight: 600; letter-spacing: -.41px; }
.sheet-bar .left { justify-self: start; color: var(--blue); }
.sheet-bar .right { justify-self: end; color: var(--blue); font-weight: 600; }
.sheet-bar button:disabled { opacity: .35; }
.prose { padding: 4px 32px 0; font-size: 15px; line-height: 21px; letter-spacing: -.24px; color: var(--label-2); }
.prose h4 { color: var(--label); font-size: 15px; font-weight: 600; margin-top: 16px; }
.prose p + p { margin-top: 8px; }

/* Rating */
.stars { display: flex; justify-content: center; gap: 6px; padding: 14px 16px 6px; }
.star { width: 44px; height: 44px; display: grid; place-items: center; color: var(--fill); transition: transform .2s var(--ease), color .15s; }
.star svg { width: 34px; height: 34px; }
.star.on { color: var(--yellow); }
.star:active { transform: scale(.88); }
.rating-label { text-align: center; font-size: 13px; color: var(--label-2); min-height: 18px; padding-bottom: 12px; letter-spacing: -.08px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.link-inline { color: var(--blue); font-size: inherit; line-height: inherit; letter-spacing: inherit; padding: 0; }
.link-inline:active { opacity: .6; }
