/* ==========================================================================
   Six Flags New England — Team Operations
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  color-scheme: light;

  --sf-red: #a8393c;
  --sf-red-dark: #862f32;
  --sf-blue: #2b3f63;
  --sf-blue-mid: #3d5175;

  --bg: #f4f5f7;
  --bg-elevated: #ffffff;
  --bg-sunken: #eceef1;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #f0f1f4;

  --text: #1e2230;
  --text-2: #545a6b;
  --text-3: #7c8293;
  --border: #e3e5ea;
  --border-strong: #ccd0d8;

  --accent: var(--sf-blue);
  --accent-text: #ffffff;
  --accent-soft: #eaedf3;

  --ok: #3d7a5c;
  --ok-soft: #eaf1ed;
  --warn: #8f7132;
  --warn-soft: #f4f0e6;
  --danger: #a3413c;
  --danger-soft: #f5ecec;
  --info: #4a5f80;
  --info-soft: #eaedf3;

  --shadow-sm: 0 1px 2px rgba(30, 34, 48, .04);
  --shadow: 0 1px 3px rgba(30, 34, 48, .05), 0 4px 12px rgba(30, 34, 48, .04);
  --shadow-lg: 0 8px 28px rgba(30, 34, 48, .12);

  --r-sm: 7px;
  --r: 11px;
  --r-lg: 16px;

  --nav-h: 62px;
  --top-h: 58px;
  --max-w: 1180px;

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #14171d;
  --bg-elevated: #1b1f27;
  --bg-sunken: #101319;
  --surface: #1b1f27;
  --surface-2: #212632;
  --surface-3: #29303d;

  --text: #e4e7ee;
  --text-2: #a2a9b8;
  --text-3: #7a8399;
  --border: #2b313d;
  --border-strong: #3a4252;

  --accent: #7e93bd;
  --accent-text: #12151c;
  --accent-soft: #242a36;

  --ok: #6fa88c;
  --ok-soft: #1c2622;
  --warn: #b79a63;
  --warn-soft: #272319;
  --danger: #c17f7b;
  --danger-soft: #2a1e1e;
  --info: #7e93bd;
  --info-soft: #242a36;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 32px rgba(0, 0, 0, .45);
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.16rem; }
h3 { font-size: 1rem; }
h4 { font-size: .88rem; }
p { margin: 0 0 .7em; }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ------------------------------- layout ---------------------------------- */

#app { min-height: 100dvh; display: flex; flex-direction: column; }

.shell { display: flex; flex-direction: column; min-height: 100dvh; }

.topbar {
  /* Above the tab bars (40/45) so the all-tabs dropdown is never covered. */
  position: sticky; top: 0; z-index: 50;
  background: var(--sf-blue);
  color: #fff;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}
:root[data-theme="dark"] .topbar {
  background: #1b2233;
  border-bottom: 1px solid var(--border);
}
.topbar__brand {
  display: flex; align-items: center; gap: 11px; min-width: 0;
  appearance: none; border: 0; background: none; padding: 2px; margin: -2px;
  color: inherit; font: inherit; cursor: pointer; border-radius: 10px; text-align: left;
}
.topbar__brand:hover .topbar__word { opacity: .82; }
.topbar__brand svg { flex: none; filter: drop-shadow(0 1px 3px rgba(0,0,0,.28)); }
.topbar__titles { min-width: 0; line-height: 1.15; }
.topbar__word {
  font-size: 17.5px; font-weight: 700; letter-spacing: -.025em; color: #fff;
  transition: opacity .14s;
}
.topbar__park {
  font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}

.greeting { margin-bottom: 16px; }
.greeting h1 { font-size: 1.62rem; letter-spacing: -.03em; }
.greeting__date { font-size: 13.5px; color: var(--text-3); margin-top: 3px; }
.topbar__spacer { flex: 1; }
.topbar__date { font-size: 12.5px; opacity: .8; text-align: right; white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: 6px; }

.iconbtn {
  appearance: none; border: 0; background: rgba(255,255,255,.14); color: #fff;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  cursor: pointer; transition: background .15s; position: relative; flex: none;
}
.iconbtn:hover { background: rgba(255,255,255,.26); }
.iconbtn svg { width: 19px; height: 19px; }

.main { flex: 1; padding: 18px 16px calc(var(--nav-h) + 28px); }
.main__inner { max-width: var(--max-w); margin: 0 auto; }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  display: flex; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(16,24,60,.05);
}
.tabbar__inner { display: flex; width: 100%; max-width: 620px; }
.tab {
  flex: 1; appearance: none; border: 0; background: none; cursor: pointer;
  padding: 8px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-3); font-size: 10.5px; font-weight: 600; font-family: inherit;
  letter-spacing: .01em; position: relative; transition: color .14s;
}
.tab svg { width: 21px; height: 21px; }
.tab:hover { color: var(--text-2); }
.tab.is-active { color: var(--accent); }
.tab.is-active::before {
  content: ''; position: absolute; top: 0; left: 26%; right: 26%; height: 2.5px;
  background: var(--accent); border-radius: 0 0 3px 3px;
}
.tab__badge {
  position: absolute; top: 3px; left: 50%; margin-left: 3px;
  background: var(--sf-red); color: #fff; font-size: 9.5px; font-weight: 700;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

/* Six or seven destinations still have to fit a 375px phone. */
.tabbar--dense .tab { font-size: 9.5px; padding: 7px 2px 8px; gap: 2px; letter-spacing: -.01em; }
.tabbar--dense .tab svg { width: 19px; height: 19px; }
.tabbar--dense .tab__badge { margin-left: 1px; min-width: 15px; height: 15px; font-size: 9px; }
/* Where a short label exists it replaces the full one, but only on a phone. */
.tabbar--dense .tab__label--full { display: none; }
.tabbar--dense .tab__label--short { display: block; }

/* Eight or nine destinations — an owner's full set — on a 390px phone. */
.tabbar--packed .tab { font-size: 9px; padding: 6px 1px 7px; gap: 1px; }
.tabbar--packed .tab svg { width: 18px; height: 18px; }
.tabbar--packed .tab__label--full, .tabbar--packed .tab__label--short {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (min-width: 900px) {
  .tabbar {
    position: sticky; top: var(--top-h); bottom: auto;
    border-top: 0; border-bottom: 1px solid var(--border); box-shadow: none;
  }
  .tabbar__inner { max-width: var(--max-w); }
  .tab { flex-direction: row; justify-content: center; gap: 7px; font-size: 13px; padding: 11px 8px; }
  /* The indicator hugs the centered icon+label group instead of the whole cell. */
  .tab.is-active::before { left: 50%; right: auto; width: 52px; transform: translateX(-50%); }
  .tab svg { width: 17px; height: 17px; }
  .tab.is-active::before { top: auto; bottom: 0; border-radius: 3px 3px 0 0; }
  .tab__badge { position: static; margin-left: 2px; box-shadow: none; }
  /* On a wide screen there is room for the full labels again. */
  .tabbar--dense .tab { font-size: 12.5px; padding: 11px 6px; gap: 6px; }
  .tabbar--dense .tab svg { width: 17px; height: 17px; }
  .tabbar--dense .tab__badge { min-width: 16px; height: 16px; font-size: 9.5px; }
  .tabbar--dense .tab__label--full { display: block; }
  .tabbar--dense .tab__label--short { display: none; }
  .tabbar--packed .tab { font-size: 12px; padding: 11px 5px; gap: 5px; }
  .tabbar--packed .tab svg { width: 17px; height: 17px; }
  .main { padding: 22px 16px 48px; }
}

/* ------------------------------- cards ----------------------------------- */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.card + .card, .stack > * + * { margin-top: 14px; }
.card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 15px; border-bottom: 1px solid var(--border);
}
.card__head h2, .card__head h3 { flex: 1; min-width: 0; }
.card__body { padding: 15px; }
.card__body--tight { padding: 10px 15px; }
.card__foot { padding: 11px 15px; border-top: 1px solid var(--border); background: var(--surface-2);
  border-radius: 0 0 var(--r) var(--r); }

.section-title {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-3); margin: 22px 0 9px;
}
.section-title:first-child { margin-top: 0; }

.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); }
@media (min-width: 720px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 980px) {
  .split { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: 16px; align-items: start; }
  .split--even { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

/* ------------------------------ controls --------------------------------- */

.btn {
  appearance: none; font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .14s, border-color .14s, transform .06s; white-space: nowrap;
  text-decoration: none; line-height: 1.35;
}
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn--primary:hover:not(:disabled) { filter: brightness(1.09); background: var(--accent); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover:not(:disabled) { filter: brightness(1.08); background: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn--sm { font-size: 12.5px; padding: 6px 11px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--block { width: 100%; }
.btn--lg { font-size: 15.5px; padding: 12px 20px; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row--end { justify-content: flex-end; }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label {
  display: block; font-size: 12.5px; font-weight: 650; color: var(--text-2); margin-bottom: 5px;
}
.hint { font-size: 12px; color: var(--text-3); }
.field .hint { margin-top: 5px; }
/* Marks the handful of fields a form actually refuses to submit without. */
.req { color: var(--danger); margin-left: 3px; font-weight: 700; }
input[type=text], input[type=password], input[type=tel], input[type=number],
input[type=date], input[type=search], input[type=email], select, textarea {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 11px; transition: border-color .14s, background .14s;
}
textarea { resize: vertical; min-height: 82px; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, select:disabled, textarea:disabled { opacity: .6; cursor: not-allowed; }
select {
  appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%237a8399' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* ------------------------------- pills ----------------------------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
  letter-spacing: .015em;
}
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--danger { background: var(--danger-soft); color: var(--danger); }
.pill--info { background: var(--info-soft); color: var(--info); }
.pill--accent { background: var(--accent-soft); color: var(--accent); }
.pill--owner {
  background: #5a6480;
  color: #fff; box-shadow: 0 1px 3px rgba(122, 92, 240, .35);
}
.pill--dot::before { content:''; width:6px; height:6px; border-radius:50%; background: currentColor; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  appearance: none; font-family: inherit; cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all .13s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

/* ------------------------------ avatars ---------------------------------- */

.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px; letter-spacing: -.02em;
  border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar--xl { width: 92px; height: 92px; font-size: 30px; }

/* ------------------------------- lists ----------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }

.rowitem {
  display: flex; align-items: center; gap: 12px; padding: 12px 15px;
  width: 100%; text-align: left; background: none; border: 0; font: inherit;
  color: inherit; cursor: pointer; transition: background .12s;
}
.rowitem:hover { background: var(--surface-2); }
.rowitem__main { flex: 1; min-width: 0; }
.rowitem__title { font-weight: 620; font-size: 14.5px; }
.rowitem__sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Rows that carry several short codes wrap instead of hiding half of them. */
.rowitem__sub--wrap { white-space: normal; overflow: visible; text-overflow: clip; }
.rowitem__end { display: flex; align-items: center; gap: 8px; flex: none; }
.chev { color: var(--text-3); flex: none; }

/* ------------------------------ empty/loading ---------------------------- */

.empty { text-align: center; padding: 34px 20px; color: var(--text-3); }
.empty__icon {
  width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 13px;
  background: var(--surface-3); display: grid; place-items: center; color: var(--text-3);
}
.empty__icon svg { width: 23px; height: 23px; }
.empty h3 { color: var(--text-2); margin-bottom: 5px; font-size: .96rem; }
.empty p { font-size: 13.5px; max-width: 380px; margin: 0 auto 14px; }

.spinner {
  width: 17px; height: 17px; border-radius: 50%; flex: none;
  border: 2.2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 40px; color: var(--text-3); font-size: 14px; }

.skeleton {
  background: var(--surface-3);
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ------------------------------ feedback --------------------------------- */

.toasts {
  position: fixed; bottom: calc(var(--nav-h) + 14px); left: 12px; right: 12px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
@media (min-width: 900px) { .toasts { bottom: 20px; left: auto; right: 20px; align-items: flex-end; } }
.toast {
  pointer-events: auto; max-width: 460px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  padding: 11px 14px; font-size: 13.5px; color: var(--text);
  display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .22s cubic-bezier(.2,.9,.3,1);
}
.toast--ok { border-left-color: var(--ok); }
.toast--error { border-left-color: var(--danger); }
.toast--warn { border-left-color: var(--warn); }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast--ok svg { color: var(--ok); } .toast--error svg { color: var(--danger); }
.toast--warn svg { color: var(--warn); } .toast--info svg { color: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.alert {
  padding: 11px 13px; border-radius: var(--r-sm); font-size: 13.5px;
  background: var(--info-soft); color: var(--info); border: 1px solid transparent;
  display: flex; gap: 9px; align-items: flex-start;
}
.alert--error { background: var(--danger-soft); color: var(--danger); }
.alert--ok { background: var(--ok-soft); color: var(--ok); }
.alert--warn { background: var(--warn-soft); color: var(--warn); }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert + * { margin-top: 13px; }

/* ------------------------------- modal ----------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(10, 14, 28, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fade .16s;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 22px; } }
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--bg-elevated); width: 100%; max-width: 560px;
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lg);
  max-height: 92dvh; display: flex; flex-direction: column;
  animation: sheetIn .24s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 640px) { .modal { border-radius: var(--r-lg); } }
.modal--wide { max-width: 860px; }
.modal--full { max-width: 1140px; }
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } }
.modal__head {
  padding: 15px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex: none;
}
.modal__head h2 { flex: 1; min-width: 0; }
.modal__body { padding: 18px; overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal__foot {
  padding: 13px 18px; border-top: 1px solid var(--border); flex: none;
  display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2);
  padding-bottom: max(13px, env(safe-area-inset-bottom));
}

/* ------------------------------- tables ---------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 520px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 700; padding: 9px 12px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }

/* ------------------------------- misc ------------------------------------ */

.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.hstack { display: flex; align-items: center; gap: 9px; }
.hstack--wrap { flex-wrap: wrap; }
.vstack { display: flex; flex-direction: column; gap: 9px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 14px 0; border: 0; }

.stat { padding: 13px 15px; }
.stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 700; }
.stat__value { font-size: 25px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px;
  font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat__sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.meter { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width .4s; }
.meter__fill--ok { background: var(--ok); }
.meter__fill--warn { background: var(--warn); }
.meter__fill--danger { background: var(--danger); }

/* ------------------------------- auth ------------------------------------ */

.auth {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(43,63,99,.10), transparent 62%),
    var(--bg);
}
.auth__card { width: 100%; max-width: 432px; }
.auth__brand { text-align: center; margin-bottom: 22px; }
.auth__mark {
  width: 62px; height: 62px; margin: 0 auto 14px;
  display: grid; place-items: center;
  filter: drop-shadow(0 6px 18px rgba(200, 24, 31, .34));
}
.auth__brand h1 { font-size: 1.72rem; letter-spacing: -.035em; }
.auth__brand p { color: var(--text-3); font-size: 13.5px; margin-top: 4px; }
.auth__tabs { display: flex; gap: 5px; background: var(--surface-3); padding: 4px;
  border-radius: var(--r-sm); margin-bottom: 17px; }
.auth__tab {
  flex: 1; appearance: none; border: 0; background: none; font: inherit; cursor: pointer;
  padding: 8px; border-radius: 6px; font-size: 13.5px; font-weight: 620; color: var(--text-2);
}
.auth__tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.auth__demo {
  margin-top: 15px; font-size: 12.5px; color: var(--text-3); text-align: center; line-height: 1.65;
}
.auth__demo code {
  font-family: var(--mono); background: var(--surface-3); padding: 1px 5px;
  border-radius: 4px; color: var(--text-2); font-size: 11.5px;
}

/* ------------------------------ chat ------------------------------------- */

.chat { display: flex; flex-direction: column; height: min(66dvh, 560px); }
.chat__log {
  flex: 1; overflow-y: auto; padding: 14px 15px; display: flex; flex-direction: column; gap: 11px;
  background: var(--surface-2); -webkit-overflow-scrolling: touch;
}
.msg { display: flex; gap: 9px; max-width: 88%; }
.msg--own { align-self: flex-end; flex-direction: row-reverse; }
.msg__bubble {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 13px; padding: 8px 12px; box-shadow: var(--shadow-sm); min-width: 0;
}
.msg--own .msg__bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.msg__meta { font-size: 11px; color: var(--text-3); margin-bottom: 3px; font-weight: 620; }
.msg--own .msg__meta { color: rgba(255,255,255,.75); }
.msg__text { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__time { font-size: 10.5px; opacity: .6; margin-top: 3px; }
.chat__compose {
  display: flex; gap: 9px; padding: 11px 12px; border-top: 1px solid var(--border);
  background: var(--surface); align-items: flex-end;
}
.chat__compose textarea { min-height: 42px; max-height: 130px; resize: none; }
.day-sep { text-align: center; font-size: 11px; color: var(--text-3); font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; margin: 5px 0; }

/* --------------------------- scanner / transfers -------------------------- */

.scanner {
  position: relative; background: #000; border-radius: var(--r);
  overflow: hidden; aspect-ratio: 4/3; max-height: 340px;
}
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner__frame {
  position: absolute; inset: 16% 10%; border: 2.5px solid rgba(255,255,255,.85);
  border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.42);
}
.scanner__frame::after {
  content: ''; position: absolute; left: 6px; right: 6px; top: 50%; height: 2px;
  background: var(--sf-red); box-shadow: 0 0 12px var(--sf-red);
  animation: scanline 2.1s ease-in-out infinite;
}
@keyframes scanline { 0%,100% { top: 12%; } 50% { top: 86%; } }
.scanner__hint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  color: #fff; font-size: 12.5px; text-shadow: 0 1px 4px rgba(0,0,0,.9); padding: 0 12px;
}

.route-group { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.route-group + .route-group { margin-top: 12px; }
.route-group__head {
  padding: 10px 14px; background: var(--surface-3);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.route-group__label { font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.route-arrow { color: var(--sf-red); font-weight: 700; }

/* --------------------------- layout designer ------------------------------ */

.designer { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .designer { grid-template-columns: 226px minmax(0,1fr); align-items: start; } }

.palette { max-height: 460px; overflow-y: auto; }
.palette__group { padding: 9px 12px 3px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.palette__item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 12px;
  background: none; border: 0; font: inherit; cursor: grab; color: var(--text); text-align: left;
  font-size: 13px; transition: background .12s;
}
.palette__item:hover { background: var(--surface-2); }
.palette__item:active { cursor: grabbing; }
.palette__swatch { width: 15px; height: 15px; border-radius: 4px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }

.canvas-wrap {
  position: relative; overflow: auto; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: var(--r);
  height: min(66dvh, 620px); touch-action: none;
}
.canvas {
  position: relative; transform-origin: 0 0;
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, rgba(127,140,170,.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(127,140,170,.16) 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: var(--shadow);
}
.fixture {
  position: absolute; border-radius: 4px; cursor: move;
  display: grid; place-items: center; overflow: hidden;
  font-size: 10px; font-weight: 650; color: #fff; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.22); user-select: none; padding: 2px;
  line-height: 1.15;
}
.fixture.is-selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); z-index: 5; }
.fixture__handle {
  position: absolute; width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff; cursor: grab;
  box-shadow: var(--shadow-sm);
}
.fixture__rotate { top: -22px; left: 50%; margin-left: -7.5px; }
.fixture__resize { right: -7.5px; bottom: -7.5px; cursor: nwse-resize; background: var(--ok); }

.designer__toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.trash {
  border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 13px; text-align: center; color: var(--text-3); font-size: 13px;
  transition: all .16s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.trash.is-over { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }

/* ----------------------------- visual/AI ---------------------------------- */

.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--r);
  padding: 26px 18px; text-align: center; cursor: pointer; transition: all .16s;
  background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--text-3); margin-bottom: 8px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb__x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.68); color: #fff; border: 0; cursor: pointer; display: grid;
  place-items: center; font-size: 14px; line-height: 1; padding: 0;
}

.finding { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.finding:last-child { border-bottom: 0; }
.finding__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none;
  background: var(--text-3); }
.finding__dot--high { background: var(--danger); }
.finding__dot--medium { background: var(--warn); }
.finding__dot--low { background: var(--ok); }
.finding__title { font-weight: 620; font-size: 14px; }
.finding__detail { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }

.rec-list { counter-reset: rec; list-style: none; margin: 0; padding: 0; }
.rec-list li {
  counter-increment: rec; position: relative; padding: 9px 0 9px 34px; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.rec-list li:last-child { border-bottom: 0; }
.rec-list li::before {
  content: counter(rec); position: absolute; left: 0; top: 9px;
  width: 23px; height: 23px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent); font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}

.concept-frame {
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
  background: var(--surface-3);
}
.concept-frame svg { display: block; width: 100%; height: auto; }

.compare { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare figure { margin: 0; }
.compare figcaption {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin-bottom: 7px;
}
.compare img { width: 100%; border-radius: var(--r); border: 1px solid var(--border); display: block; }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.metric { background: var(--surface-2); border-radius: var(--r-sm); padding: 9px 11px; }
.metric__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); font-weight: 700; }
.metric__value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }

/* --------------------------- today at the park ---------------------------- */

.daygrid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.daytile {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 13px;
}
.daytile__glyph { font-size: 25px; line-height: 1.1; flex: none; }
.daytile__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); font-weight: 700;
}
.daytile__value {
  font-size: 18px; font-weight: 680; letter-spacing: -.02em; margin-top: 2px;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.daytile__sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.daynote {
  margin-top: 13px; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--warn-soft); color: var(--text);
  border-left: 3px solid var(--warn); font-size: 13.8px;
}

/* ------------------------------ update feed ------------------------------- */

.update { padding: 13px 15px; border-bottom: 1px solid var(--border); }
.update:last-child { border-bottom: 0; }
.update__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.update__title { font-weight: 650; font-size: 14.5px; flex: 1; min-width: 140px; }
.update__body { font-size: 13.8px; color: var(--text-2); white-space: pre-wrap; }
.update__foot { font-size: 12px; color: var(--text-3); margin-top: 7px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* ------------------------------ task item -------------------------------- */

.task { display: flex; gap: 11px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.task.is-done { opacity: .62; }
.task__check {
  width: 23px; height: 23px; border-radius: 7px; border: 2px solid var(--border-strong);
  background: var(--surface); cursor: pointer; flex: none; margin-top: 1px;
  display: grid; place-items: center; padding: 0; transition: all .14s; color: transparent;
}
.task__check:hover { border-color: var(--accent); }
.task__check.is-done { background: var(--ok); border-color: var(--ok); color: #fff; }
.task__check svg { width: 13px; height: 13px; }
.task__main { flex: 1; min-width: 0; }
.task__title { font-weight: 620; font-size: 14.5px; }
.task.is-done .task__title { text-decoration: line-through; }
.task__desc { font-size: 13.3px; color: var(--text-2); margin-top: 3px; white-space: pre-wrap; }
.task__meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; align-items: center; }

.checklist-item { display: flex; align-items: center; gap: 10px; padding: 9px 15px;
  border-bottom: 1px solid var(--border); }
.checklist-item:last-child { border-bottom: 0; }
.checklist-item.is-done .checklist-item__text { text-decoration: line-through; color: var(--text-3); }
.checklist-item__text { flex: 1; min-width: 0; font-size: 14px; }
.drag-handle { cursor: grab; color: var(--text-3); flex: none; touch-action: none; }
.checklist-item.is-dragging { opacity: .45; }

/* ------------------------------ utilities -------------------------------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

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

@media print {
  .topbar, .tabbar, .btn, .toasts { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
}

/* Bell badge anchors to the topbar icon button. */
.iconbtn { position: relative; }
.iconbtn .tab__badge { position: absolute; top: 1px; right: 1px; }

/* ------------------------- schedule import UI ------------------------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: 100%; padding: 26px 14px;
  border: 2px dashed var(--border); border-radius: 14px;
  background: var(--surface-2); color: inherit; font: inherit; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.import-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.import-row:last-of-type { border-bottom: 0; }

/* ---------------------- all-tabs dropdown (topbar) --------------------- */
.topbar__actions { position: relative; }
.navmenu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 200px; padding: 6px;
  background: var(--bg-elevated); color: var(--text);
  border: 1px solid var(--border); border-radius: 13px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column;
}
.navmenu__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 9px;
  background: none; color: inherit; font: inherit; font-size: 14.5px;
  cursor: pointer; text-align: left;
}
.navmenu__item:hover { background: var(--surface-2); }
.navmenu__item.is-active { color: var(--accent); font-weight: 650; }

/* --------------- installed-app safe areas (Dynamic Island etc.) --------------- */
/* viewport-fit=cover lets the app paint edge-to-edge; these insets keep the
   top bar below the notch/island and the tab bar above the home indicator. */
.topbar { padding-top: calc(env(safe-area-inset-top, 0px)); }
.tabbar { padding-bottom: calc(env(safe-area-inset-bottom, 0px)); }
.main { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.navmenu { top: calc(100% + 8px + env(safe-area-inset-top, 0px) * 0); }

/* ------------------------- Home quick actions ------------------------- */
.quickbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 9px;
}
.quickbar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 13px 6px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r, 12px);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, transform .05s;
}
.quickbar__btn:hover { border-color: var(--accent); }
.quickbar__btn:active { transform: scale(.97); }
.quickbar__btn svg { color: var(--accent); }
@media (max-width: 420px) {
  .quickbar__btn { font-size: 11.5px; padding: 11px 4px 9px; }
}

/* ------------------------------ legal prose ---------------------------- */
.prose h3 { font-size: 14.5px; margin: 16px 0 5px; }
.prose p, .prose li { font-size: 13.8px; line-height: 1.55; }
.prose ul { padding-left: 19px; margin: 6px 0; }
.prose li { margin-bottom: 7px; }

/* ------------------------- scanner flashlight ------------------------- */
.scanner__torch {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(0,0,0,.45); border-color: transparent;
  font-size: 17px; line-height: 1; padding: 8px 10px; border-radius: 10px;
}
.scanner__torch.is-on { background: var(--warn, #b98300); }

/* Quick actions point here when the browser wants a real tap first. */
@keyframes btnpulse { 0%,100% { box-shadow: 0 0 0 0 rgba(43,63,99,.28); } 55% { box-shadow: 0 0 0 7px rgba(43,63,99,0); } }
.btn--pulse { animation: btnpulse 1.6s ease-out 3; }

/* Rows that open something say so on hover. */
.row--click { cursor: pointer; }
.row--click:hover { background: var(--bg-sunken); }

/* Some people find movement distracting; the OS setting is honoured. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
