/* AirTagus Academy · member portal + login.
   Fonts: DM Sans (headings, brand), IBM Plex Sans (UI and every number, tabular figures).
   Numbers never use a monospace font. */

:root {
  --navy: #0B2545;
  --deep: #123A63;
  --blue: #1C6EA4;
  --blue-ink: #175C8A;
  --teal: #3FA7B5;
  --teal-ink: #1E7480;
  --amber: #E3A33B;
  --amber-ink: #8A5A0B;
  --amber-soft: #FBF1DE;
  --red: #B42318;
  --red-soft: #FDECEA;
  --ok-soft: #E3F3F5;

  --bg: #F5F7F9;
  --surface: #FFFFFF;
  --surface-2: #FAFBFC;
  --mist: #EAF2F8;
  --line: #E1E7EE;
  --line-strong: #CBD5E0;
  --ink: #12233A;
  --muted: #5A6A7D;
  --faint: #8494A6;

  --font-ui: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'DM Sans', 'IBM Plex Sans', system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow: 0 1px 2px rgba(11, 37, 69, .05), 0 6px 20px rgba(11, 37, 69, .06);
  --shadow-lg: 0 20px 50px rgba(11, 37, 69, .18);
  --side-w: 248px;
  --focus: 0 0 0 3px rgba(28, 110, 164, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.5 var(--font-ui);
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); margin: 0; letter-spacing: -.01em; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .98rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--blue-ink); }
a:hover { color: var(--navy); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.num, td.num, .tile-value, .kpi { font-family: var(--font-ui); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.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; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .86rem; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ── Buttons & inputs ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--navy);
  font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--mist); border-color: #b7c7d8; color: var(--navy); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn-accent { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-accent:hover { background: var(--deep); color: #fff; }
.btn-danger { color: var(--red); border-color: #efc2bd; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); border-color: #e3a29a; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--mist); border-color: transparent; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .field > .label { font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.field .hint { font-size: .78rem; color: var(--faint); }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:hover { border-color: #b2c0cf; }
.input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--red); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-error { color: var(--red); font-size: .88rem; margin: 4px 0 12px; min-height: 1.2em; }

/* ── Login ────────────────────────────────────────── */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 48px clamp(28px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(1200px 600px at 110% 120%, rgba(63, 167, 181, .22), transparent 60%),
              linear-gradient(160deg, var(--deep) 0%, var(--navy) 62%, #071a33 100%);
}
.auth-brand .brand { color: #fff; }
.auth-brand .brand-word b { color: #9fd3dc; }
.auth-brand h1 { color: #fff; font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 700; max-width: 14ch; margin-bottom: 14px; }
.auth-brand .lede { color: rgba(255,255,255,.78); max-width: 42ch; font-size: 1.02rem; }
.auth-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; opacity: .9; pointer-events: none; }
.auth-foot { position: relative; font-size: .8rem; color: rgba(255,255,255,.55); }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg); position: relative; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-card .btn-primary { width: 100%; min-height: 46px; font-size: 1rem; margin-top: 4px; }
.auth-card .input { min-height: 46px; }
.auth-note { margin-top: 22px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--mist); color: var(--deep); font-size: .86rem; }
.auth-top { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; align-items: center; }
.auth-card .auth-mobile-brand { display: none; margin-bottom: 28px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--blue-ink); font-size: .82rem; font-weight: 600; padding: 6px 8px; cursor: pointer; border-radius: 6px; }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 2px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--amber); transition: width .2s, background .2s; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card .auth-mobile-brand { display: inline-flex; }
  .auth-main { justify-content: flex-start; padding-top: 72px; }
}

/* ── Brand ────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.brand img { width: 38px; height: 38px; flex: none; }
.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word span { font-family: var(--font-head); font-weight: 700; font-size: 1.22rem; letter-spacing: -.02em; }
.brand-word b { font-weight: 700; color: var(--blue); }
.brand-word small { font-family: var(--font-head); font-weight: 600; font-size: .62rem; letter-spacing: .38em; color: var(--amber); margin-top: 4px; }

.lang-toggle { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.lang-toggle button { border: 0; background: transparent; padding: 4px 11px; font-size: .78rem; font-weight: 600; color: var(--muted); cursor: pointer; letter-spacing: .04em; }
.lang-toggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }

/* ── Portal shell ─────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  background: linear-gradient(180deg, var(--navy) 0%, #0a2140 100%); color: #cfdbe8;
  display: flex; flex-direction: column; padding: 20px 14px 16px; z-index: 40;
}
.side .brand { color: #fff; padding: 2px 8px 20px; }
.side .brand-word b { color: #9fd3dc; }
.nav-group { margin-top: 14px; }
.nav-group > h4 { font-family: var(--font-ui); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; color: #7f98b3; padding: 0 10px; margin: 0 0 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px;
  color: #d5e1ec; text-decoration: none; font-size: .92rem; font-weight: 500; position: relative;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: rgba(63,167,181,.16); color: #fff; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--amber); }
.nav .count { margin-left: auto; background: var(--amber); color: var(--navy); font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: .76rem; color: #7f98b3; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 12px clamp(16px, 3vw, 32px); background: rgba(245,247,249,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumbs { min-width: 0; flex: 1; }
.topbar .crumbs .eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 600; }
.topbar .crumbs h1 { font-size: 1.22rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: #fff; font: 600 .8rem var(--font-head); letter-spacing: .02em; flex: none; }
.user-chip .who { line-height: 1.2; }
.user-chip .who b { display: block; font-size: .88rem; color: var(--navy); }
.user-chip .who span { font-size: .74rem; color: var(--muted); }

.content { padding: clamp(16px, 3vw, 32px); max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { color: var(--muted); margin: 4px 0 0; max-width: 70ch; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mock-banner { background: var(--amber-soft); color: var(--amber-ink); border: 1px solid #f0d7a6; border-radius: var(--radius-sm); padding: 8px 12px; font-size: .84rem; margin-bottom: 16px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(84vw, 300px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(7, 26, 51, .42); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .user-chip .who { display: none; }
}

/* ── Cards, tiles, bars ───────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-head + .card-body { padding-top: 12px; }
.card-body { padding: 16px 20px 18px; }
.stack { display: grid; gap: 18px; }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.cols-even { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1080px) { .cols, .cols-even { grid-template-columns: 1fr; } }

.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px; position: relative; overflow: hidden; }
.tile .tile-label { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.tile .tile-value { font-size: 1.85rem; font-weight: 600; color: var(--navy); line-height: 1.15; margin-top: 6px; letter-spacing: -.01em; }
.tile .tile-value small { font-size: .9rem; font-weight: 500; color: var(--muted); margin-left: 3px; }
.tile .tile-sub { font-size: .8rem; color: var(--faint); margin-top: 2px; }
.tile.accent::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--amber); }
.tile.alert .tile-value { color: var(--red); }
a.tile { text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.tile:hover { border-color: #b9cadb; box-shadow: var(--shadow); }

.req { display: grid; gap: 16px; }
.req-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.req-row .req-label { font-weight: 500; font-size: .92rem; }
.req-row .req-val { font-size: .9rem; color: var(--muted); white-space: nowrap; }
.req-row .req-val b { color: var(--navy); font-weight: 600; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .5s ease; }
.bar.met > i { background: var(--teal); }
.bar.thin { height: 6px; }
.met-badge { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-ink); font-weight: 600; font-size: .8rem; }
.met-badge svg { width: 14px; height: 14px; }

.ring-wrap { display: flex; align-items: center; gap: 18px; }
.ring { width: 92px; height: 92px; flex: none; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--mist); }
.ring .val { stroke: var(--blue); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s ease; }
.ring text { font: 600 18px var(--font-ui); fill: var(--navy); font-variant-numeric: tabular-nums; }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover td { background: #f7fafc; }
table.data .cell-main { font-weight: 600; color: var(--navy); }
table.data .cell-sub { font-size: .8rem; color: var(--muted); }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
@media (max-width: 720px) {
  table.data.stackable thead { display: none; }
  table.data.stackable tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 4px; }
  table.data.stackable td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 10px; text-align: right; }
  table.data.stackable td::before { content: attr(data-label); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); text-align: left; }
  table.data.stackable td.num { justify-content: space-between; }
}

/* ── Badges ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.6; white-space: nowrap; background: var(--mist); color: var(--deep); }
.badge.ok { background: var(--ok-soft); color: var(--teal-ink); }
.badge.warn { background: var(--amber-soft); color: var(--amber-ink); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.dark { background: var(--navy); color: #fff; }
.badge.line { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); }
.badge.night { background: #1d2c4a; color: #d8e3f2; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ── Lists ────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--navy); }
.list .meta { font-size: .8rem; color: var(--muted); }

.announce { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.announce:last-child { border-bottom: 0; }
.announce h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.announce .body { white-space: pre-line; color: #2b3d52; }
.announce .meta { font-size: .78rem; color: var(--faint); margin-top: 8px; }

/* ── Enquiries board ──────────────────────────────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 6px; }
.lane { background: #edf1f5; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.lane > header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.lane > header h3 { font-size: .86rem; display: flex; align-items: center; gap: 8px; }
.lane .lane-count { font-size: .78rem; color: var(--muted); font-weight: 600; }
.enq { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm); }
.enq:hover { border-color: #b9cadb; }
.enq .enq-name { font-weight: 600; color: var(--navy); }
.enq .enq-msg { font-size: .82rem; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.enq .enq-meta { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-size: .76rem; color: var(--faint); flex-wrap: wrap; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; overflow: visible; } }

/* ── Cohort cards ─────────────────────────────────── */
.cohort-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.cohort-card { display: block; text-decoration: none; color: inherit; padding: 18px 20px; transition: border-color .15s, box-shadow .15s; }
.cohort-card:hover { border-color: #b9cadb; box-shadow: var(--shadow); color: inherit; }
.cohort-card h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.cohort-card .facts { display: flex; gap: 18px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cohort-card .facts div { font-size: .76rem; color: var(--muted); }
.cohort-card .facts b { display: block; font-size: 1.15rem; color: var(--navy); font-weight: 600; }

.phase-track { display: flex; gap: 4px; margin-top: 12px; }
.phase-track span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.phase-track span.on { background: var(--blue); }
.phase-track span.now { background: var(--amber); }

/* ── Chart ────────────────────────────────────────── */
.chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; align-items: end; height: 180px; padding-top: 8px; }
.chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.chart .stackbar { width: min(36px, 70%); display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; background: transparent; }
.chart .stackbar i { display: block; width: 100%; }
.chart .seg-dual { background: var(--blue); }
.chart .seg-solo { background: var(--teal); }
.chart .lbl { font-size: .74rem; color: var(--muted); text-transform: capitalize; }
.chart .v { font-size: .76rem; color: var(--navy); font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ── Profile header ───────────────────────────────── */
.person { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.person .avatar { width: 52px; height: 52px; font-size: 1.05rem; background: linear-gradient(135deg, var(--deep), var(--blue)); }
.person h1 { font-size: 1.45rem; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ── Modal & toast ────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(7, 26, 51, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; z-index: 100; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; }
.modal.wide { max-width: 760px; }
.modal > header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal > header h2 { font-size: 1.15rem; }
.modal .modal-body { padding: 16px 22px 6px; }
.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; flex-wrap: wrap; }
.modal .close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.secret { display: flex; align-items: center; gap: 10px; background: var(--mist); border-radius: var(--radius-sm); padding: 12px 14px; font: 600 1.15rem var(--font-ui); letter-spacing: .04em; color: var(--navy); word-break: break-all; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 360px; }
.toast.err { background: var(--red); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font-weight: 600; font-size: .9rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--amber); }

.loading { padding: 48px; text-align: center; color: var(--faint); }
.loading::before { content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px; border-radius: 50%; border: 3px solid var(--mist); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
.search { max-width: 280px; }
.sign-pill { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--teal-ink); font-weight: 600; }
.sign-pill svg { width: 14px; height: 14px; }
.cols > *, .cols-even > *, .stack > *, .tiles > * { min-width: 0; }
.chart + .legend { margin-top: 26px; }
.tiles.tiles-4 { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.tiles.tiles-4 .tile-value { font-size: 1.5rem; }
#view:focus, #view:focus-visible { box-shadow: none; outline: none; }
.toolbar .input.search { width: 220px; flex: 0 1 220px; }
@media (max-width: 640px) { .toolbar .input.search { flex: 1 1 100%; width: 100%; max-width: none; } .page-head .toolbar { width: 100%; } }
@media (max-width: 720px) {
  table.data.stackable, table.data.stackable tbody, table.data.stackable tfoot { display: block; width: 100%; }
  table.data.stackable tr { display: block; padding: 10px 2px; }
  table.data.stackable td { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; padding: 3px 8px; }
  table.data.stackable td.num { justify-content: stretch; }
  table.data.stackable td > .cell { min-width: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
  table.data.stackable td > .cell:empty::after { content: "—"; color: var(--faint); }
  table.data.stackable td[data-label=""] { grid-template-columns: 1fr; }
  table.data.stackable td[data-label=""]::before { display: none; }
  table.data.stackable tfoot tr { display: flex; flex-wrap: wrap; gap: 4px 14px; }
  table.data.stackable tfoot td { display: block; }
  table.data.stackable tfoot td::before { content: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 10px 12px; }
  .topbar .crumbs .eyebrow { display: none; }
  .topbar .crumbs h1 { font-size: 1.05rem; }
  .user-chip { display: none; }
}
