/* =====================================================================
   Sky Team Ife — design system
   Dark throughout. Glass panels over a flat field, one accent colour,
   generous radii, Space Grotesk everywhere.

   --surface is the glass a panel is made of. --white stays literal
   white, for text and marks that sit on top of something dark.

   THE ACCENT
   ----------
   Everything accented hangs off --hue, --sat and --l, and js/look.js
   rolls a fresh set on every open — so the app is a different colour
   each time you come to it, and the button in the sidebar rolls again
   on demand.

   --l is not random and not fixed either: look.js solves it per hue so
   every accent lands at the same brightness as the blue the app was
   drawn around. Write lightness as an offset from it, never as a
   number, or that guarantee is lost. --on-accent is the colour of text
   sitting on an accent fill; never hard-code #fff there.
   ===================================================================== */

:root {
  --hue: 224;                 /* the app's blue, as a starting point */
  --sat: 100%;
  --l: 66%;                   /* look.js solves this per hue */
  --on-accent: #fff;

  --blue: hsl(var(--hue) var(--sat) var(--l));
  --blue-deep: hsl(var(--hue) var(--sat) calc(var(--l) - 7%));
  --blue-soft: hsl(var(--hue) var(--sat) calc(var(--l) + 15%));
  --blue-tint: hsl(var(--hue) var(--sat) var(--l) / .16);

  --void: #05091a;            /* behind everything, including the 3D field */
  --dark: #0a1024;            /* solid panels: sidebar, dark cards */
  --dark-2: #111a35;
  --dark-3: rgba(255,255,255,.10);

  --grey: rgba(255,255,255,.04);
  --grey-2: rgba(255,255,255,.07);
  --surface: rgba(255,255,255,.048);
  --surface-2: rgba(255,255,255,.075);
  --line: rgba(255,255,255,.13);
  --hair: rgba(255,255,255,.085);

  --white: #fff;
  --ink: #eef1fa;
  --muted: #9aa5c2;
  --faint: #6e7896;

  --ok: #56d99a;
  --ok-bg: rgba(86,217,154,.14);
  --warn: #f3c26b;
  --warn-bg: rgba(243,194,107,.14);
  --err: #ff8f86;
  --err-bg: rgba(255,143,134,.14);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;
  --pop: 0 14px 34px rgba(0,0,0,.34);
  --pop-sm: 0 8px 20px rgba(0,0,0,.26);
  --blur: none;
  --sb-w: 268px;
  --panel: rgba(10,16,36,.96);   /* top bar and tab bar */
  --font: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Tells the browser to draw native widgets — select popups, scrollbars,
     date pickers — in dark. Without it the option list comes back as
     black on black. */
  color-scheme: dark;
}

/* Native dropdowns. The popup is drawn by the OS, so the only reliable
   levers are color-scheme above and an explicit colour on the options —
   without both, the option list comes back black on black. */
select option, select optgroup {
  background-color: var(--dark);
  color: #eef1fa;
}

* { box-sizing: border-box; }
/* min-height, never height: a fixed 100% turns body into a box that
   clips anything past the fold instead of letting the page scroll. */
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--void);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.14; }
p { margin: 0; }
svg { display: block; flex: none; }
::selection { background: var(--blue); color: var(--on-accent); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* Lime marker behind a word, the way a highlighter would leave it */
.hl { background: var(--blue); color: var(--on-accent); border-radius: 7px; padding: 0 8px; display: inline-block; }
.hl-dark { background: var(--dark); color: var(--white); border-radius: 7px; padding: 0 8px; display: inline-block; }

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 20px; font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease, color .15s ease;
}
.btn:hover { background: var(--grey); }
.btn:active { transform: translateY(2px); }
.btn-p { background: var(--dark); color: var(--white); }
.btn-p:hover { background: var(--dark-3); }
.btn-a { background: var(--blue); color: var(--on-accent); }
.btn-a:hover { background: var(--blue-deep); }
.btn-g { background: transparent; }
.btn-g:hover { background: rgba(255,255,255,.09); }
.btn-d { background: var(--surface); color: var(--err); border-color: var(--err); }
.btn-d:hover { background: var(--err-bg); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 15px 28px; font-size: 15.5px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-pop { box-shadow: var(--pop-sm); }
.btn-pop:active { box-shadow: none; }
.btn-icon { padding: 8px; border-radius: var(--r-sm); }
.btn-round { border-radius: var(--r-pill); }

/* ================================ SHELL ============================== */
.shell { display: flex; min-height: 100vh; position: relative; }
/* Only .main needs lifting above the 3D field. Setting position on .sb
   or .tabs here would override the fixed positioning they take on a
   phone, drop them back into the flex row, and crush .main to nothing. */
.shell > .main { position: relative; z-index: 2; }
.sb {
  width: var(--sb-w); flex: none; background: rgba(10,16,36,.72); color: var(--white);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line); z-index: 2;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.sb-top { padding: 22px 20px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.brand-mk {
  width: 30px; height: 30px; border-radius: var(--r-sm); color: var(--blue);
  display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none;
}
/* The mark sits on the navy sidebar, so it goes white there. */
.sb .brand-mk { color: #fff; }
.logo { display: block; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 12px 14px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--dark-3); border-radius: 3px; }
.sb-grp {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 16px 10px 7px;
}
.sb-a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 14px; color: #d3d4dc; margin-bottom: 2px; transition: background .14s, color .14s;
}
.sb-a:hover { background: var(--dark-3); color: var(--white); }
.sb-a.on { background: var(--blue); color: var(--on-accent); font-weight: 500; }
.sb-a span { flex: 1; }
.sb-a .cnt {
  flex: none; font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,.11);
  padding: 1px 7px; border-radius: var(--r-pill); color: #d3d4dc;
}
.sb-a.on .cnt { background: rgba(255,255,255,.22); color: var(--on-accent); }
/* Accounts waiting to be approved — this one should catch the eye. */
.sb-a .cnt-a { background: var(--blue); color: var(--on-accent); }
.sb-a.on .cnt-a { background: var(--on-accent); color: var(--blue); }
/* The folded half of the sidebar. */
.sb-more {
  display: flex; align-items: center; gap: 11px; width: 100%; margin-top: 10px;
  padding: 9px 12px; border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--faint); font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; transition: color .15s ease;
}
.sb-more:hover { color: #d3d4dc; }
.sb-more svg { transition: transform .2s ease; }
.sb-more.on svg { transform: rotate(180deg); }
.sb-more.on { color: #d3d4dc; }
.sb-sub {
  display: grid; grid-template-rows: 0fr; overflow: hidden;
  transition: grid-template-rows .26s cubic-bezier(.3,.8,.35,1);
}
.sb-sub.open { grid-template-rows: 1fr; }
.sb-sub > div { min-height: 0; overflow: hidden; }
.sb-sub .sb-a:first-child { margin-top: 2px; }

/* The standing, in the Director's rail. Narrow by design: a position, a
   name and a score, because anything more belongs on the page. */
.sb-ranks { margin-top: 6px; }
.sb-rk {
  display: flex; align-items: center; gap: 9px; padding: 6px 12px;
  border-radius: var(--r-sm); font-size: 13px; color: #d3d4dc;
  transition: background .14s, color .14s;
}
.sb-rk:hover { background: var(--dark-3); color: var(--white); }
.sb-rk-n { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-rk-s { font-size: 11.5px; font-weight: 600; color: var(--blue-soft); flex: none; }
.sb-rk-none { padding: 4px 12px 8px; font-size: 12px; color: var(--faint); }

.sb-btm { padding: 14px; border-top: 1px solid var(--dark-3); }
.sb-row { display: flex; gap: 8px; align-items: stretch; }
.sb-row .sb-out { flex: 1; }
/* Rolls a new accent hue. It wears the colour it is about to change, so
   the button itself is the preview of what the app currently looks like. */
.sb-hue {
  flex: none; width: 42px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--dark-3); border-radius: var(--r-sm);
  background: transparent; color: var(--blue);
  transition: background .14s, color .14s, transform .14s;
}
.sb-hue:hover { background: var(--dark-3); }
.sb-hue:active { transform: rotate(-25deg) scale(.94); }
.sb-user { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.av {
  width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--blue); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none;
}
.sb-user-nm { font-size: 13.5px; font-weight: 500; }
.sb-user-em { font-size: 11.5px; color: #8b8c99; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 168px; }
.sb-out {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px;
  background: transparent; border: 1px solid var(--dark-3); border-radius: var(--r-sm);
  color: #d3d4dc; font-size: 13.5px; cursor: pointer; transition: background .14s;
}
.sb-out:hover { background: var(--dark-3); color: var(--white); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tb {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; background: rgba(7,12,28,.72); border-bottom: 1px solid var(--hair);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.crumb { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.tb-t { font-size: 21px; font-weight: 600; letter-spacing: -.025em; }
.tb-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.burger { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px; cursor: pointer; }
.wk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wk-l { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.wk select {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface);
  font-size: 13.5px; cursor: pointer; max-width: 260px;
}
.page { padding: 26px; max-width: 1360px; width: 100%; }
.page.enter { animation: fade .26s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.scrim { display: none; }

/* ================================ CARDS ============================== */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--pop);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.card + .card { margin-top: 18px; }
.card-flat { box-shadow: none; }
.card-grey { background: var(--grey); }
.card-blue { background: var(--blue); color: var(--on-accent); }
.card-dark { background: var(--dark); color: var(--white); border-color: var(--line); }
.card-dark .card-s, .card-dark .kpi-l, .card-dark .kpi-m { color: #a9aab6; }
.card-dark .hl { color: var(--on-accent); }
.card-h { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.card-h .card-t { flex: 1; }
.card-t { font-size: 16.5px; font-weight: 600; letter-spacing: -.02em; }
.card-s { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.card-a { margin-left: auto; display: flex; gap: 8px; align-items: center; flex: none; }

.sec { margin-bottom: 26px; }
.sec-h { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-t { font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
.sec-d { font-size: 13.5px; color: var(--muted); max-width: 560px; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ================================= KPI =============================== */
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 18px 16px; box-shadow: var(--pop);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.kpi-blue { background: var(--blue); color: var(--on-accent); }
.kpi-blue .kpi-l, .kpi-blue .kpi-m { color: rgba(255,255,255,.78); }
.kpi-blue .up { color: #b7f5cd; } .kpi-blue .down { color: #ffc4bd; }
.kpi-dark { background: var(--dark); color: var(--white); }
.kpi-dark .kpi-l, .kpi-dark .kpi-m { color: #a9aab6; }
.kpi-l {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
}
.kpi-v { font-size: 32px; font-weight: 600; letter-spacing: -.035em; margin-top: 10px; line-height: 1.05; }
.kpi-m { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--err); font-weight: 600; }

/* A feature flag, as a row with a switch at the end. */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--hair);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle {
  flex: none; width: 42px; height: 24px; border-radius: var(--r-pill); border: 0;
  background: var(--grey-2); position: relative; cursor: pointer; padding: 0;
  transition: background .15s ease;
}
.toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease;
}
.toggle.on { background: var(--blue); }
.toggle.on .toggle-knob { transform: translateX(18px); }
.toggle-soon { opacity: .5; cursor: not-allowed; }

/* The three subscription lengths, as cards rather than one flat button. */
.plan-c {
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  background: var(--surface-2); text-align: center;
}
.plan-c-on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.plan-l { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.plan-p { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.plan-n { font-size: 11px; color: var(--faint); margin-top: 4px; min-height: 14px; }

/* ================================ TAGS =============================== */
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--surface); white-space: nowrap;
}
.t-ok { background: var(--blue); color: var(--on-accent); }
.t-b { background: var(--surface); }
.t-warn { background: var(--warn-bg); border-color: rgba(243,194,107,.42); color: var(--warn); }
.t-err { background: var(--err-bg); border-color: rgba(255,143,134,.42); color: var(--err); }
.t-dark { background: var(--dark); color: var(--white); }
.t-gold { background: var(--dark); color: var(--blue-soft); }
.t-mute { background: var(--grey); color: var(--muted); border-color: var(--hair); }

/* =============================== TABLE =============================== */
.tw { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 0 12px 9px; white-space: nowrap;
  border-bottom: 1px solid var(--hair);
}
tbody td { padding: 12px; border-bottom: 1px solid var(--hair); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--blue-tint); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nm { font-weight: 500; }
.sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.rk {
  width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--grey); border: 1px solid var(--hair);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.rk-1 { background: var(--blue); border-color: var(--line); color: var(--on-accent); }
.rk-2, .rk-3 { background: var(--blue-tint); border-color: var(--line); }

/* ================================ BARS =============================== */
.bar { height: 8px; border-radius: var(--r-pill); background: var(--grey-2); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--dark); border-radius: var(--r-pill); }
.bar.gold i { background: var(--blue); }

/* =============================== CHARTS ============================== */
.chart { width: 100%; height: 208px; }
.chart .gl { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.chart .bx { fill: var(--dark); }
.chart .bx.hi { fill: var(--blue); stroke: var(--line); stroke-width: 1; }
.chart .ln { fill: none; stroke: var(--dark); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .ar { fill: rgba(79, 131, 255, .26); }
.chart .dt { fill: var(--white); stroke: var(--dark); stroke-width: 2.5; }
.chart .lb { fill: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .06em; }
.chart .vl { fill: var(--ink); font-size: 11px; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: transparent; padding: 6px 11px; font-size: 12.5px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; color: var(--muted);
}
.seg button + button { border-left: 1px solid var(--hair); }
.seg button.on { background: var(--blue); color: var(--on-accent); font-weight: 500; }

/* The week picker: at most four buttons, since a month is at most four
   weeks. The dot marks the one still open for filing, whether or not it
   is the one currently on screen. */
.wk-seg button { padding: 7px 13px; font-size: 13px; position: relative; }
.wk-seg button.open::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--ok);
}
.wk-seg button.open.on::after { background: var(--on-accent); }

/* The manual pull, next to whichever picker a page has. */
.btn-refresh {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  color: var(--muted); cursor: pointer; transition: background .14s, color .14s;
}
.btn-refresh:hover { background: var(--grey); color: var(--ink); }
.btn-refresh.spin svg { animation: spin .6s linear; }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* =============================== FORMS =============================== */
.field { margin-bottom: 15px; }
.field > label {
  display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px;
  letter-spacing: .01em;
}
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 11px 14px;
  background: var(--surface); font-size: 14px; transition: box-shadow .14s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; box-shadow: 0 0 0 3px hsl(var(--hue) var(--sat) var(--l) / .30); border-color: var(--blue); background: var(--surface-2); }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.55; }
.input.bad { border-color: var(--err); }
.err-t { font-size: 12.5px; color: var(--err); margin-top: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); cursor: pointer;
}
.chip.on { background: var(--blue); color: var(--on-accent); font-weight: 500; }
.chip.new { background: var(--dark); color: var(--white); }
.chip button { background: none; border: 0; cursor: pointer; padding: 0; display: grid; opacity: .6; }
.chip button:hover { opacity: 1; }

/* combo box for niches */
.combo { position: relative; }
.menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; max-height: 232px;
  overflow-y: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--pop); padding: 6px;
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 8px; text-align: left; border: 0;
  background: none; padding: 9px 11px; border-radius: var(--r-sm); font-size: 13.5px; cursor: pointer;
}
.menu button:hover, .menu button.on { background: var(--blue-tint); }
.menu .empty-row { padding: 10px 11px; font-size: 13px; color: var(--faint); }
.auto { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.auto button {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 11px 13px;
  border: 1px solid var(--hair); border-radius: var(--r); background: var(--surface); cursor: pointer;
  font-size: 14px;
}
.auto button:hover { border-color: var(--line); background: var(--blue-tint); }

/* =============================== NOTES =============================== */
.note {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: var(--r);
  border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; align-items: flex-start;
}
.note svg { margin-top: 1px; }
.n-info { background: var(--grey); }
.n-gold { background: var(--blue-tint); }
.n-ok { background: var(--ok-bg); border-color: rgba(86,217,154,.4); color: #b6f0d3; }
.n-warn { background: var(--warn-bg); border-color: rgba(243,194,107,.4); color: #f7ddab; }
.n-err { background: var(--err-bg); border-color: rgba(255,143,134,.4); color: #ffc7c2; }

.empty { text-align: center; padding: 42px 20px; }
.empty-ic {
  width: 54px; height: 54px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--blue); color: var(--on-accent); display: grid; place-items: center; margin: 0 auto 14px;
}
.empty-t { font-size: 16px; font-weight: 600; }
.empty-d { font-size: 13.5px; color: var(--muted); margin: 6px auto 16px; max-width: 380px; line-height: 1.55; }

/* =============================== MODAL =============================== */
.mo {
  position: fixed; inset: 0; z-index: 100; background: rgba(3, 6, 18, .72);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .18s ease; backdrop-filter: blur(2px);
}
.mo-c {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  width: 100%; max-width: 470px; max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -22px rgba(13, 27, 61, .5); animation: pop .2s ease;
}
.mo-c.wide { max-width: 760px; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.mo-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 0; }
.mo-t { font-size: 17.5px; font-weight: 600; letter-spacing: -.02em; }
.mo-x { margin-left: auto; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: var(--r-sm); color: var(--muted); }
.mo-x:hover { background: var(--grey); color: var(--ink); }
.mo-b { padding: 18px 20px; overflow-y: auto; }
.mo-f { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; align-items: center; flex-wrap: wrap; }
.mo-f .left { margin-right: auto; }

/* =============================== TOASTS ============================== */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--dark); color: var(--white);
  padding: 13px 16px; border-radius: var(--r); font-size: 13.5px; max-width: 360px;
  box-shadow: 0 14px 34px -14px rgba(13, 27, 61, .7); animation: slide .24s ease;
}
.toast svg { color: var(--blue-soft); margin-top: 1px; }
.toast.no svg { color: #ff9a91; }
@keyframes slide { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ============================== TICKETS ============================== */
.ticket {
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--pop);
}
.ticket-h { background: var(--dark); color: var(--white); padding: 16px 18px; }
.ticket-h .t-n { font-size: 15.5px; font-weight: 600; }
.ticket-h .t-m { font-size: 12.5px; color: #a9aab6; margin-top: 3px; }
.ticket-b { padding: 18px; display: flex; gap: 18px; align-items: center; }
.ticket.void { opacity: .62; }
.qr-box { width: 152px; height: 152px; flex: none; border: 1px solid var(--line); border-radius: var(--r); padding: 8px; background: var(--surface); }
.qr-box svg, .qr-box canvas { width: 100%; height: 100%; display: block; }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; font-weight: 600;
  letter-spacing: .12em; background: var(--blue-tint); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 5px 11px; display: inline-block;
}

/* =============================== AUTH ================================ */
/* One card, dead centre, floating on a slow field of Sky Team marks. */
.auth {
  min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden;
  display: grid; place-items: center;
  padding: calc(34px + var(--safe-t)) 18px calc(30px + var(--safe-b));
  background: var(--void);
}
.auth-mid {
  position: relative; z-index: 3; width: 100%; max-width: 428px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}

/* ======================= THE BACKDROP ================================
   Was a perspective scene: eleven marks at their own translateZ, a
   requestAnimationFrame loop easing the whole stage toward the pointer,
   and a blur on every panel above it. It looked good and it cost a
   frame budget the app could not spare, so it is a gradient now.
   Nothing animates. Nothing composites. It paints once. */
.bg3d {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  /* Three washes off the accent hue: the middle one is thrown 40° round
     the wheel so the field keeps its two-tone depth whatever the hue
     lands on. */
  background:
    radial-gradient(70% 55% at 18% 8%,   hsl(var(--hue) var(--sat) var(--l) / .20), transparent 62%),
    radial-gradient(60% 50% at 88% 12%,  hsl(calc(var(--hue) + 40) var(--sat) var(--l) / .16), transparent 60%),
    radial-gradient(75% 60% at 50% 108%, hsl(var(--hue) var(--sat) calc(var(--l) - 7%) / .14), transparent 66%),
    var(--void);
}
.shell > .bg3d { position: fixed; }

/* ---- the glass card ---- */
.auth-card {
  position: relative; z-index: 3; width: 100%;
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-xl); padding: 36px 30px 30px; color: #fff;
  /* Nothing behind it to blur now the field is flat, so the filter
     would be pure cost for no picture. */
  box-shadow: 0 34px 90px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.20);
  animation: card-in .7s cubic-bezier(.2,.85,.25,1) both;
}
/* A highlight that rakes across the top edge, like the reference. */
.auth-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(150deg, rgba(255,255,255,.16), rgba(255,255,255,0) 42%);
}
@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }

.auth-brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px;
  position: relative; z-index: 1;
}
.auth-brand .mark { width: 46px; height: 46px; color: #fff; }
.auth-brand span {
  font-size: 12.5px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: rgba(255,255,255,.82);
}

.auth-h { font-size: 27px; font-weight: 600; letter-spacing: -.03em; text-align: center; color: #fff; }
.auth-s {
  font-size: 13.5px; color: rgba(255,255,255,.58); margin: 10px 0 26px;
  line-height: 1.6; text-align: center;
}
.auth-card .field { position: relative; z-index: 1; }
.auth-card label { color: rgba(255,255,255,.66); font-weight: 500; }
.auth-card .input, .auth-card .select, .auth-card textarea.input {
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.16);
  color: #fff; border-radius: var(--r); padding: 13px 15px;
}
.auth-card .input::placeholder { color: rgba(255,255,255,.30); }
.auth-card .input:focus, .auth-card .select:focus {
  border-color: hsl(var(--hue) var(--sat) calc(var(--l) + 10%) / .75); background: rgba(255,255,255,.09);
  box-shadow: 0 0 0 4px hsl(var(--hue) var(--sat) calc(var(--l) - 7%) / .20);
}
.auth-card .select option { background: #0d1b3d; color: #fff; }
.auth-card .btn-a {
  background: linear-gradient(135deg,
    hsl(var(--hue) var(--sat) calc(var(--l) + 9%)) 0%, hsl(var(--hue) var(--sat) calc(var(--l) - 7%)) 52%, hsl(var(--hue) calc(var(--sat) - 25%) calc(var(--l) - 18%)) 100%);
  border: 0; color: var(--on-accent); border-radius: var(--r); font-size: 15.5px; font-weight: 600;
  letter-spacing: .04em; box-shadow: 0 12px 30px hsl(var(--hue) var(--sat) calc(var(--l) - 7%) / .40);
}
.auth-card .btn-a:hover { box-shadow: 0 16px 38px hsl(var(--hue) var(--sat) calc(var(--l) - 7%) / .52); }
.auth-card .btn:not(.btn-a) {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: var(--r);
}
.auth-card .btn:not(.btn-a):hover { background: rgba(255,255,255,.12); }
.auth-card .note { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: rgba(255,255,255,.76); }
.auth-card .note b { color: #fff; }

.auth-row { display: flex; justify-content: flex-end; margin: -4px 0 18px; position: relative; z-index: 1; }
.auth-row a { font-size: 12.5px; color: rgba(255,255,255,.62); }
.auth-row a:hover { color: #fff; }
.auth-alt {
  font-size: 13px; color: rgba(255,255,255,.55); text-align: center; margin-top: 20px;
  position: relative; z-index: 1;
}
.auth-alt a { font-weight: 600; color: #fff; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Shown under the card, and again in the app once you are inside. */
.credit {
  font-size: 11.5px; letter-spacing: .04em; color: rgba(255,255,255,.34);
  text-align: center; position: relative; z-index: 3;
}
.credit b { font-weight: 600; color: rgba(255,255,255,.62); }

.divider {
  display: flex; align-items: center; gap: 12px; margin: 22px 0; color: rgba(255,255,255,.42);
  font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600;
  position: relative; z-index: 1;
}
.divider::before, .divider::after { content: ""; height: 1px; background: rgba(255,255,255,.16); flex: 1; }

/* The role fork sits on glass too. */
.auth-card .pick-o {
  background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.16); color: #fff;
  border-radius: var(--r-lg);
}
.auth-card .pick-o:hover { background: rgba(255,255,255,.11); }
.auth-card .pick-o.on { background: hsl(var(--hue) var(--sat) calc(var(--l) - 7%) / .30); border-color: hsl(var(--hue) var(--sat) calc(var(--l) + 10%) / .6); }
.auth-card .pick-o .pick-d { color: rgba(255,255,255,.55); }
.auth-card .pick-o.on .pick-d { color: rgba(255,255,255,.78); }

/* ============================ SCAN PAGE ============================== */
.scan-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(18px + var(--safe-t)) 18px calc(18px + var(--safe-b)); gap: 14px; position: relative; z-index: 2; }
.scan-card { width: 100%; max-width: 430px; }
.scan-foot { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.big-ok {
  width: 74px; height: 74px; border-radius: 50%; background: var(--blue); color: var(--on-accent); border: 1px solid var(--line);
  display: grid; place-items: center; margin: 6px auto 16px;
}
.big-no { background: var(--err-bg); border-color: var(--err); color: var(--err); }

/* ============================= MISC ================================== */
.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(13,27,61,.18);
  border-top-color: var(--ink); animation: spin .7s linear infinite;
}
.spinner.light { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; min-height: 60vh; gap: 12px; }
.skel { background: linear-gradient(90deg, #eee 25%, #f6f6f6 37%, #eee 63%); background-size: 400% 100%; animation: sh 1.3s ease infinite; border-radius: 8px; }
@keyframes sh { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.dots { display: flex; gap: 6px; margin-right: auto; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--hair); }
.dots i.on { background: var(--dark); width: 20px; border-radius: var(--r-pill); }
.tour-art { background: var(--blue-tint); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.tour-n { font-size: 11px; letter-spacing: .13em; text-transform: uppercase; font-weight: 600; }
.tour-ic { width: 46px; height: 46px; border-radius: var(--r); background: var(--dark); color: var(--blue-soft); display: grid; place-items: center; margin: 14px 0 12px; }
.tour-h { font-size: 21px; font-weight: 600; letter-spacing: -.03em; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.tar { text-align: right; }
.mt0 { margin-top: 0; }
.hide { display: none !important; }

/* ============================ RESPONSIVE ============================= */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2, .g3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sb {
    position: fixed; left: 0; top: 0; z-index: 90; transform: translateX(-100%);
    transition: transform .24s ease; box-shadow: 0 0 60px rgba(0,0,0,.3);
  }
  body.nav-open .sb { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(13,27,61,.5); z-index: 80; }
  .burger { display: grid; }
  .page { padding: 18px 16px 40px; }
  .tb { padding: 12px 16px; }
  .tb-t { font-size: 18px; }
  .tb-help span { display: none; }
  .g2, .g4 { grid-template-columns: minmax(0, 1fr); }
  .two { grid-template-columns: 1fr; }
  .ticket-b { flex-direction: column; align-items: stretch; }
  .qr-box { width: 100%; height: auto; aspect-ratio: 1; }
  .wk select { max-width: 168px; }
  .toasts { left: 16px; right: 16px; bottom: calc(var(--tabh) + var(--safe-b) + 16px); }
  .toast { max-width: none; }
}

/* ====================== PHONE — APP BEHAVIOUR ======================== */
/* Installed to a home screen there is no browser chrome to lean on, so
   the app has to supply its own: a fixed header, a bottom tab bar, and
   padding that clears the notch and the home indicator. */
:root { --tabh: 0px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }

.tabs { display: none; }

@media (max-width: 860px) {
  :root { --tabh: 62px; }

  html, body { overscroll-behavior-y: none; }
  body { -webkit-tap-highlight-color: transparent; }
  .main { -webkit-overflow-scrolling: touch; }

  /* Header pins to the top and clears the notch. */
  .tb {
    position: sticky; top: 0; z-index: 40;
    padding-top: calc(12px + var(--safe-t));
    background: rgba(7,12,28,.80);
    border-bottom: 1px solid var(--line);
  }
  .sb { padding-top: var(--safe-t); }
  .page { padding-bottom: calc(var(--tabh) + var(--safe-b) + 28px); }

  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; align-items: stretch;
    height: calc(var(--tabh) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(7,12,28,.82); backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur); border-top: 1px solid var(--line);
  }
  .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: none; cursor: pointer; text-decoration: none;
    color: var(--muted); font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
    padding: 0; min-height: 44px; transition: color .16s ease;
  }
  .tab.on { color: var(--blue); }
  .tab-i { position: relative; display: grid; place-items: center; height: 22px; }
  .tab.on .tab-i { transform: translateY(-1px); }
  .tab-b {
    position: absolute; top: -5px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: var(--r-sm); background: var(--blue); color: var(--on-accent);
    font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px; text-align: center;
  }
  .tab:active { color: var(--blue); }


  /* A card header is a title and an action side by side. At this width
     they do not fit, so the action drops underneath. */
  .card-h { flex-wrap: wrap; }
  .card-h .card-a { margin-left: 0; width: 100%; }
  .card-h .card-a .btn { width: 100%; }

  /* Touch targets and inputs that iOS will not zoom into. */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .seg button { min-height: 38px; padding-left: 16px; padding-right: 16px; }
  .input, .select, textarea.input { font-size: 16px; padding: 12px 13px; }
  .sb-a { padding-top: 11px; padding-bottom: 11px; }
  .card { padding: 18px 16px; }
  .tw { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }

  /* Nothing may push the page sideways. `clip` rather than `hidden`,
     because `hidden` makes an element a scroll container and that is
     what stops the page scrolling down at all. */
  html, body { max-width: 100%; overflow-x: clip; }

  /* ---- weight ----------------------------------------------------
     A phone pays for all of this and sees almost none of it. Every
     backdrop-filter forces the browser to re-blur what is behind the
     element on each frame, and eleven animated layers in a preserve-3d
     scene keep asking it to. Both go. The washes stay, because a flat
     gradient costs nothing and keeps the app looking like itself. */
  :root { --blur: none; }
  .bg3d { perspective: none; }
  .bg3d-stage { transform: none; animation: none; }
  .bg3d .d, .bg3d .dust { display: none; }
  .bg3d .wash { animation: none; }
  .card, .sb, .tabs, .mo-c, .auth-card, .inst {
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  }
  .tabs { background: rgba(9,14,32,.96); }
  /* Entrance animations on every card add up to a stutter on a slow
     phone. The page still fades in as a whole. !important because the
     motion section further down the file would otherwise win. */
  .page.enter .kpi, .page.enter .card { animation: none !important; }
  .card:hover, .kpi:hover, .ticket:hover { transform: none !important; box-shadow: var(--pop-sm); }
}

/* Standalone: no browser bar, so the header carries the status bar. */
html.standalone .tb { padding-top: calc(14px + var(--safe-t)); }
html.standalone .inst { display: none; }

@media (max-width: 860px) and (display-mode: standalone) {
  .scan-wrap { padding-top: calc(20px + var(--safe-t)); }
}

/* ============================ MOTION ================================= */
/* Subtle lifts. Cards rise a touch, the hard offset shadow grows. */
.card, .kpi, .ticket { transition: transform .18s ease, box-shadow .18s ease; }
.card:hover, .kpi:hover, .ticket:hover { transform: translateY(-2px); box-shadow: 0 20px 44px rgba(0,0,0,.42); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(2px); }
.btn-pop:hover { box-shadow: var(--pop); }
.sb-a, .chip, .tag { transition: transform .15s ease, background .15s ease, color .15s ease; }
.sb-a:hover { transform: translateX(2px); }

/* Staggered entrance for KPI rows and cards inside a freshly routed page */
.page.enter .kpi, .page.enter .card { animation: rise .45s cubic-bezier(.22,.9,.3,1) both; }
.page.enter .kpi:nth-child(1) { animation-delay: .02s; }
.page.enter .kpi:nth-child(2) { animation-delay: .07s; }
.page.enter .kpi:nth-child(3) { animation-delay: .12s; }
.page.enter .kpi:nth-child(4) { animation-delay: .17s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Chart bars grow up out of the baseline, dots pop in */
.chart .bx { transform-origin: bottom; animation: grow .5s cubic-bezier(.22,.9,.3,1) both; }
.chart .dt { animation: pip .4s ease both .25s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pip { from { opacity: 0; } to { opacity: 1; } }

/* The same credit at the foot of every page, for the phone, where the
   rail it normally lives in is behind a menu. */
.pg-credit {
  margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--hair);
  font-size: 11.5px; color: var(--faint); text-align: center;
}
.pg-credit b { font-weight: 600; color: var(--muted); }

/* The credit line, once you are inside the app. */
.sb-credit {
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--dark-3);
  font-size: 10.5px; letter-spacing: .03em; color: #6d7590; text-align: center;
}
.sb-credit b { font-weight: 600; color: #97a0bb; }
.scan-wrap .credit { color: var(--faint); margin-top: -4px; }
.scan-wrap .credit b { color: var(--muted); }

/* ======================= THE MARK, ANIMATED ========================== */
/* The star is a hole punched through an SVG mask, so whatever sits
   behind the mark shows through it. Every star turns; only the one on
   the card assembles itself first. */
.mark { display: block; overflow: visible; }
.mk-star { transform-box: fill-box; transform-origin: center; }
@keyframes mk-turn { from { rotate: 0deg; } to { rotate: 360deg; } }
@keyframes mk-twinkle { 0%, 100% { scale: 1; } 50% { scale: 1.14; } }

/* The card mark: blocks fly in from opposite sides and settle, then the
   pair sways while the star turns and twinkles between them. */
.brand-anim { animation: mk-breathe 7s ease-in-out infinite; }
.brand-anim .mk-top { animation: mk-in-r 1s cubic-bezier(.2,.85,.25,1) both .18s, mk-sway 7s ease-in-out infinite 1.2s; }
.brand-anim .mk-bot { animation: mk-in-l 1s cubic-bezier(.2,.85,.25,1) both .3s,  mk-sway 7s ease-in-out infinite 1.2s reverse; }
.brand-anim .mk-star { animation: mk-turn 13s linear infinite, mk-twinkle 3.4s ease-in-out infinite; }

@keyframes mk-in-r { from { opacity: 0; transform: translateX(38px); } to { opacity: 1; transform: none; } }
@keyframes mk-in-l { from { opacity: 0; transform: translateX(-38px); } to { opacity: 1; transform: none; } }
@keyframes mk-sway { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2.5px); } }
@keyframes mk-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* Tickets and QR cards tilt gently in 3D when hovered */
.tilt { transform-style: preserve-3d; }
.tilt:hover { transform: perspective(900px) rotateX(2.5deg) rotateY(-3deg) translateY(-2px); }

/* The scan page is opened on a phone, always. Give it the notch too. */
.scan-brand { display: grid; place-items: center; color: var(--blue); margin-bottom: 14px; }

/* ============ AN OFFICE'S WEEKS, ONE ROW EACH, TAP FOR MORE ========== */
.perf-wk {
  display: flex; align-items: center; gap: 16px; padding: 14px 4px;
  border-bottom: 1px solid var(--hair);
}
.perf-wk:last-child { border-bottom: 0; }
.perf-wk.click { cursor: pointer; }
.perf-wk.click:hover { background: var(--grey); border-radius: var(--r-sm); }
.perf-wk > svg { flex: none; color: var(--faint); }
.perf-wk-t { flex: none; width: 92px; }
.perf-wk-m { flex: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.perf-v { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.perf-l { font-size: 11px; color: var(--muted); margin-top: 1px; }
@media (max-width: 640px) {
  .perf-wk { flex-wrap: wrap; }
  .perf-wk-m { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
}

/* ================== WHO WAS IN THE ROOM THIS WEEK ==================== */
.room { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.room-c {
  display: flex; align-items: center; gap: 11px; padding: 14px;
  border: 1px solid var(--hair); border-radius: var(--r); background: var(--grey);
}
.room-c svg { color: var(--blue-soft); flex: none; }
.room-v { font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.room-l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* The four headcount inputs on the report form. */
.gsm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gsm .field { margin: 0; }
@media (max-width: 900px) { .room, .gsm { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .room { grid-template-columns: minmax(0, 1fr); } }

/* ===================== WHAT THE PLATFORM DOES ======================== */
.ticks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; }
.ticks li svg { color: var(--ok); margin-top: 2px; }
.ticks li span { flex: 1; }

/* On the sign-in card it is smaller, and folded behind a heading. */
.does {
  margin: -6px 0 24px; padding: 16px 16px 15px; border-radius: var(--r-lg);
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.10);
  position: relative; z-index: 1;
}
.does-h {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
  color: rgba(255,255,255,.44); margin-bottom: 11px;
}
.does .ticks li { font-size: 12.5px; color: rgba(255,255,255,.80); gap: 9px; }
.does .ticks { gap: 8px; }

/* The guide's numbered steps. */
.steps { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-n {
  position: relative; width: 42px; height: 42px; flex: none; border-radius: var(--r);
  background: var(--blue-tint); border: 1px solid var(--line); color: var(--blue-soft);
  display: grid; place-items: center;
}
.step-n i {
  position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--blue); color: var(--on-accent); font-style: normal; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.step-t { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.step-d { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.step-d b { color: var(--ink); font-weight: 600; }
.card-dark .ticks li { color: rgba(255,255,255,.86); }

/* ============= SCAN — THE ZONE TABLE, AFTER SIGNING IN =============== */
.rank-wrap { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.rank-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 14px; font-weight: 600; margin-bottom: 10px;
}
.rank-h span { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--r); background: var(--grey);
  border: 1px solid transparent;
}
.rank li.me { background: var(--blue-tint); border-color: var(--blue); }
.rank-n {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2);
  color: var(--muted); font-size: 11.5px; font-weight: 700; display: grid; place-items: center;
}
.rank li.me .rank-n { background: var(--blue); color: var(--on-accent); }
.rank-o { flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.rank-o i { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--blue); margin-left: 7px; }
.rank-v { flex: none; text-align: right; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.rank-v em { display: block; font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--muted); }

/* ================= SCAN — CONFIRMING IT IS YOU ======================= */
.who { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; }
.who-av {
  width: 46px; height: 46px; border-radius: 50%; flex: none; background: var(--blue); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 600; font-size: 15px; letter-spacing: .02em;
}
.who-n { font-weight: 600; font-size: 17px; line-height: 1.25; }
.ph-mask {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono, ui-monospace, monospace); font-size: 22px; font-weight: 600;
  letter-spacing: .1em; background: var(--blue-tint); border-radius: var(--r-lg);
  padding: 16px; margin-bottom: 16px; color: var(--dark);
}
.ph-mask span { color: var(--muted); letter-spacing: .16em; }
.ph-in { text-align: center; letter-spacing: .5em; font-size: 26px; font-weight: 600; padding: 14px 12px; }
.ph-in::placeholder { letter-spacing: .5em; }

/* ===================== JOINING AS — THE FORK ========================= */
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 0 18px; }
.pick-o {
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  padding: 18px 16px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 9px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.pick-o:hover { transform: translateY(-2px); box-shadow: var(--pop-sm); background: var(--blue-tint); }
.pick-o.on { background: var(--dark); color: #fff; box-shadow: var(--pop-sm); }
.pick-o .pick-ic {
  width: 40px; height: 40px; border-radius: var(--r); background: var(--blue); color: var(--on-accent);
  display: grid; place-items: center;
}
.pick-o .pick-t { font-weight: 600; font-size: 15px; }
.pick-o .pick-d { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.pick-o.on .pick-d { color: #aeb6cd; }
.pick-sm { margin: 0; }
@media (max-width: 560px) {
  .pick { grid-template-columns: 1fr; }
  .auth-card { padding: 30px 22px 26px; border-radius: var(--r-xl); }
  .auth-h { font-size: 24px; }
  /* Fewer, larger shapes read better on a small screen. */
  .bm-5, .bm-6 { display: none; }
}

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

/* =====================================================================
   THE INSTALL INVITATION
   ---------------------------------------------------------------------
   Fixed, always, in every theme and at every width. It used to be
   position:fixed only inside the phone media query, so on a laptop it
   fell back to being a flex child of .shell, sat in the row next to the
   sidebar and the main column, and squeezed the page. Nothing about it
   may touch layout: it is fixed, it is out of flow, and the only thing
   below it is the tab bar it clears.

   app.js only renders it on a real handheld, so a laptop never sees it
   at all. These rules exist so that if it ever does render, it cannot
   push anything about.
   ===================================================================== */
.inst {
  position: fixed;
  left: 12px; right: 12px;
  bottom: calc(var(--tabh, 0px) + var(--safe-b, 0px) + 12px);
  z-index: 90;
  display: flex; align-items: center; gap: 12px;
  max-width: 520px; margin: 0 auto;
  background: var(--dark); color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-lg);
  padding: 12px 12px 12px 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,.42);
  animation: rise .4s cubic-bezier(.22,.9,.3,1) both .6s;
}
.inst-ic { color: #fff; flex: none; }
.inst-t { flex: 1; display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.inst-t b { font-size: 13.5px; font-weight: 600; }
.inst-t span { font-size: 11.5px; color: #b7c0d6; }
/* The dismiss used to be grey on navy and effectively invisible. It is a
   filled circle now, with a border, so it can always be found. */
.inst-x {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.24); border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  transition: background .14s ease;
}
.inst-x:hover { background: rgba(255,255,255,.24); }
html.standalone .inst { display: none; }

/* =====================================================================
   THE WALKTHROUGH
   ---------------------------------------------------------------------
   Seven cards on first sign-in. It sits over the app rather than
   replacing it, and lights up the sidebar item each step is about, so
   the words always have the thing they describe next to them.
   ===================================================================== */
.tour {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 20px;
  background: rgba(5,9,26,.72);
  animation: fade .2s ease;
}
.tour-c {
  width: 100%; max-width: 430px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 24px 20px; box-shadow: var(--pop);
  animation: rise .34s cubic-bezier(.22,.9,.3,1) both;
}
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tour-mk { color: var(--blue); display: grid; place-items: center; }
.tour-x {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--grey); color: var(--muted); cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.tour-x:hover { background: var(--grey-2); color: var(--ink); }
.tour-n {
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--blue); font-weight: 700; margin-bottom: 7px;
}
.tour-t { font-size: 21px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 9px; }
.tour-d { font-size: 14px; line-height: 1.6; color: var(--muted); }
.tour-dots { display: flex; gap: 6px; margin: 20px 0 18px; }
.tour-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line);
  transition: background .2s ease, width .2s ease;
}
.tour-dots i.on { background: var(--blue); width: 20px; border-radius: 4px; }
.tour-btm { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* The sidebar item the current step is talking about. */
.sb-a.tour-lit {
  background: var(--blue); color: var(--on-accent); font-weight: 500;
  box-shadow: 0 0 0 3px hsl(var(--hue) var(--sat) var(--l) / .35);
}

@media (max-width: 560px) {
  .tour { place-items: end center; padding: 0; }
  .tour-c {
    max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: calc(20px + var(--safe-b, 0px));
  }
}
