/* ==========================================================================
   Airlines Flow Benchmark — design system
   Tokens first (light + dark), then components. Components only use tokens,
   never raw colours, so both themes stay consistent and accessible.
   Documented in docs/design-system.md · checked by tests/contrast.js
   ========================================================================== */

/* ---------- tokens: light (default) ---------- */
:root {
  color-scheme: light;

  /* surfaces */
  --bg: #E9E8F0;              /* page behind the app frame */
  --bg-app: #F5F5FA;          /* app frame */
  --surface: #FFFFFF;         /* cards, inputs */
  --surface-2: #EFEFF6;       /* wells, list rows, metrics */
  --surface-3: #E3E3EE;       /* tracks: meters, progress, idle bars */
  --overlay: rgba(20, 20, 31, .88);

  /* lines */
  --border: #E3E3EC;          /* decorative separators */
  --border-strong: #85859C;   /* input / control outlines (≥3:1 on surface) */

  /* text */
  --text: #14141F;
  --text-muted: #5C5C72;      /* ≥4.5:1 on surface and surface-2 */
  --text-on-ink: #FFFFFF;

  /* brand */
  --ink: #14141F;             /* primary buttons ("Share access") */
  --ink-hover: #2B2B3D;
  --accent: #5457C2;          /* links, selection, focus (≥4.5:1 on surface) */
  --accent-hover: #3F42A8;
  --accent-soft: #E7E7FA;
  --accent-chart: #7C7FDB;    /* highlighted chart bar: ≥3:1 on surface and surface-2 */
  --on-accent: #FFFFFF;
  --focus: #5457C2;

  /* status: text colour + soft background, every pair ≥4.5:1 */
  --success: #0D6E55;  --success-soft: #DDF2EA;
  --warning: #93400A;  --warning-soft: #FCEBDB;
  --fresh-yellow: #B07D00;   /* sidebar dot: updated in the last 2 months */
  --danger:  #B4204F;  --danger-soft:  #FBE5EC;
  --neutral: #4A4A5E;  --neutral-soft: #ECECF3;
  --violet:  #6236A8;  --violet-soft:  #EFE7FB;
  --highlight: #FFF3E8;       /* "changed" rows */

  /* stat cards (reference: pink → lavender → periwinkle) */
  --grad-1: linear-gradient(110deg, #FBE6EC 0%, #F1E4F3 100%);
  --grad-2: linear-gradient(110deg, #F1E4F3 0%, #E6E4F8 100%);
  --grad-3: linear-gradient(110deg, #E6E4F8 0%, #E1E8FA 100%);
  --grad-4: linear-gradient(110deg, #E1E8FA 0%, #E3F1F3 100%);
  --hatch: repeating-linear-gradient(135deg, transparent 0 6px, rgba(20, 20, 31, .045) 6px 7px);

  /* shape, depth, type, motion */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20, 20, 40, .04), 0 6px 20px rgba(20, 20, 40, .05);
  --shadow-2: 0 2px 6px rgba(20, 20, 40, .06), 0 14px 40px rgba(20, 20, 40, .08);
  --font: 'Figtree', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-display: 32px; --fs-h1: 30px; --fs-h2: 19px; --fs-body: 14px; --fs-small: 12.5px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- tokens: dark ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080D; --bg-app: #101018; --surface: #191924; --surface-2: #20202E; --surface-3: #2A2A3B;
  --overlay: rgba(4, 4, 8, .9);
  --border: #2B2B3C; --border-strong: #73738E;
  --text: #EDEDF5; --text-muted: #A9A9BF; --text-on-ink: #12121A;
  --ink: #EDEDF5; --ink-hover: #FFFFFF;
  --accent: #A9ACFA; --accent-hover: #C4C6FF; --accent-soft: #2A2B4E; --accent-chart: #6D70D6; --on-accent: #12121A; --focus: #A9ACFA;
  --success: #74DBBC; --success-soft: #16352C;
  --warning: #F6B783; --warning-soft: #3B2A1C; --fresh-yellow: #E8C547;
  --danger:  #F590B3; --danger-soft:  #3C1E2B;
  --neutral: #C2C2D4; --neutral-soft: #2A2A3A;
  --violet:  #CFB6FA; --violet-soft:  #2F2545;
  --highlight: #2E2519;
  --grad-1: linear-gradient(110deg, #2C1D27 0%, #281F33 100%);
  --grad-2: linear-gradient(110deg, #281F33 0%, #22213A 100%);
  --grad-3: linear-gradient(110deg, #22213A 0%, #1C2338 100%);
  --grad-4: linear-gradient(110deg, #1C2338 0%, #1B2B2E 100%);
  --hatch: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .05) 6px 7px);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 10px 40px rgba(0, 0, 0, .45);
}
/* "System" (no data-theme): follow the operating system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #08080D; --bg-app: #101018; --surface: #191924; --surface-2: #20202E; --surface-3: #2A2A3B;
    --overlay: rgba(4, 4, 8, .9);
    --border: #2B2B3C; --border-strong: #73738E;
    --text: #EDEDF5; --text-muted: #A9A9BF; --text-on-ink: #12121A;
    --ink: #EDEDF5; --ink-hover: #FFFFFF;
    --accent: #A9ACFA; --accent-hover: #C4C6FF; --accent-soft: #2A2B4E; --accent-chart: #6D70D6; --on-accent: #12121A; --focus: #A9ACFA;
    --success: #74DBBC; --success-soft: #16352C;
    --warning: #F6B783; --warning-soft: #3B2A1C; --fresh-yellow: #E8C547;
    --danger:  #F590B3; --danger-soft:  #3C1E2B;
    --neutral: #C2C2D4; --neutral-soft: #2A2A3A;
    --violet:  #CFB6FA; --violet-soft:  #2F2545;
    --highlight: #2E2519;
    --grad-1: linear-gradient(110deg, #2C1D27 0%, #281F33 100%);
    --grad-2: linear-gradient(110deg, #281F33 0%, #22213A 100%);
    --grad-3: linear-gradient(110deg, #22213A 0%, #1C2338 100%);
    --grad-4: linear-gradient(110deg, #1C2338 0%, #1B2B2E 100%);
    --hatch: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .05) 6px 7px);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 10px 40px rgba(0, 0, 0, .45);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; } a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { margin: 0; font-weight: 500; font-size: var(--fs-h1); line-height: 1.2; letter-spacing: -0.015em; display: flex; align-items: center; min-height: 44px; }
h2 { margin: 0 0 12px; font-size: var(--fs-h2); font-weight: 500; letter-spacing: -0.01em; }
h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.muted { color: var(--text-muted); } .small { font-size: var(--fs-small); } .b { font-weight: 600; } .i { font-style: italic; }
.warn { color: var(--warning); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 260px; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- app frame + header ---------- */
.frame { max-width: 1480px; margin: 20px auto; background: var(--bg-app); border-radius: var(--r-xl); box-shadow: var(--shadow-2); overflow: clip; }
.topbar { background: transparent; color: var(--text); border-bottom: 1px solid var(--border); }
.topbar-in { padding: 18px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--ink); color: var(--text-on-ink); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-name { font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }
.brand-sub, .muted-light { font-size: var(--fs-small); color: var(--text-muted); }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: var(--fs-small); }
.pill-dark { padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--text); border: 1px solid var(--border); font-weight: 500; }
.theme-toggle { gap: 6px; }

/* ---------- layout ---------- */
.shell { padding: 24px 28px 32px; display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.sidebar { flex: 1 1 280px; max-width: 320px; display: flex; flex-direction: column; gap: 4px; }
main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.two { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.two > * { flex: 1 1 380px; min-width: 0; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.row-between h2 { margin: 0; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); }
.empty p { margin: 0; color: var(--text-muted); }
.scroll { overflow-x: auto; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 0 6px 6px; }

/* ---------- sidebar navigation ---------- */
.nav-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: var(--r-md); cursor: pointer; text-align: left; background: transparent; border: 1px solid transparent; line-height: 1.3; color: var(--text); transition: background .15s var(--ease); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow-1); }
.nav-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: 1 1 auto; }
.nav-item .logo-fallback { display: flex; align-items: flex-start; gap: 10px; }
.nav-item .logo-fallback .logo-name { line-height: 1.3; padding-top: 2px; overflow-wrap: anywhere; }
.nav-item .chip { flex: 0 0 auto; }
.nav-name { font-weight: 600; }
.nav-sub { font-size: var(--fs-small); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-label { display: flex; justify-content: space-between; margin-top: 14px; padding: 12px 8px 4px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); }
.nav-toggle { width: 100%; align-items: center; background: none; border-left: 0; border-right: 0; border-bottom: 0; border-radius: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-toggle:hover { color: var(--text); }
.nav-toggle .row-gap { gap: 6px; }
.nav-toggle .chev { transition: transform .15s var(--ease); }
.nav-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-group-list { display: flex; flex-direction: column; gap: 4px; }
.nav-group-list[hidden] { display: none; }
.policy { margin-top: 14px; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-muted); }
.policy-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.policy-edit { margin-top: 10px; width: 100%; justify-content: center; }
.policy-check { align-items: flex-start; font-weight: 500; color: var(--text); font-size: 14px; }
.policy-check input { margin-top: 2px; width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
.d-block { display: block; font-weight: 400; }
.pax-row { padding: 12px 0; border-top: 1px solid var(--border); }
.pax-row legend { color: var(--text); padding: 0; margin-bottom: 8px; }
.policy-actions { position: sticky; bottom: 12px; z-index: 5; box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.12)); }
.run-policy { margin-top: 4px; max-width: 820px; }

/* ---------- airline logos ---------- */
.logo { object-fit: contain; display: inline-block; vertical-align: middle; }
.logo.logo-sm { height: 22px; max-width: 120px; } .logo.logo-lg { height: 40px; max-width: 240px; }
/* Logos are transparent; in dark mode the dark-mode version (lightened where too dark) is shown instead. */
.logo-pair { display: inline-flex; vertical-align: middle; }
.logo-pair .logo-dark { display: none; }
:root[data-theme="dark"] .logo-pair .logo-light { display: none; }
:root[data-theme="dark"] .logo-pair .logo-dark { display: inline-block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .logo-pair .logo-light { display: none; } :root:not([data-theme]) .logo-pair .logo-dark { display: inline-block; } }
.logo-fallback.logo-sm, .logo-fallback.logo-lg { height: auto; max-width: none; }
.logo-fallback { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.logo-fallback .code { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 11px; letter-spacing: .04em; min-width: 32px; height: 24px; padding: 0 6px; }
.logo-fallback .logo-name { font-weight: 600; }
.logo-fallback.logo-lg .code { min-width: 48px; height: 44px; font-size: 15px; padding: 0 8px; border-radius: var(--r-md); }
.w-logo { min-width: 110px; display: inline-flex; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 6px 14px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--text-on-ink); min-height: 44px; padding: 10px 20px; font-size: 14px; }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-light { background: var(--ink); border-color: var(--ink); color: var(--text-on-ink); min-height: 44px; padding: 10px 20px; }
.btn-light:hover { background: var(--ink-hover); }
.btn-dashed { border-style: dashed; min-height: 48px; margin-top: 6px; font-size: 14px; border-radius: var(--r-pill); }
.btn.danger { color: var(--danger); }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.round { width: 44px; height: 44px; }
.linkbtn { border: none; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 0; font-weight: 600; }

/* ---------- chips, tags, banners ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.st-ok, .r-excellent { background: var(--success-soft); color: var(--success); }
.st-friction, .k-added, .r-basic { background: var(--warning-soft); color: var(--warning); }
.st-blocked { background: var(--danger-soft); color: var(--danger); }
.st-muted, .r-none { background: var(--neutral-soft); color: var(--neutral); }
.k-changed, .r-good { background: var(--accent-soft); color: var(--accent); }
.k-price { background: var(--violet-soft); color: var(--violet); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.tag-sample { background: var(--warning-soft); color: var(--warning); }
.banner { padding: 12px 16px; border-radius: var(--r-md); }
.summary { margin: 0; padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }

/* ---------- title, run picker, tabs ---------- */
.title-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.title-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.run-one { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.run-picker { display: flex; flex-direction: column; gap: 6px; }
.run-nav { display: flex; align-items: center; gap: 8px; }
.run-nav select { width: auto; max-width: min(460px, 70vw); }
.run-nav .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.linkbtn.plain { text-decoration: none; color: inherit; font-weight: 600; font-size: 12px; }
.linkbtn.plain:hover { color: var(--accent); text-decoration: underline; }
th.col-on .linkbtn.plain { color: var(--accent); }
.label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; font-size: 13px; font-weight: 600; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.pill.on { background: var(--ink); border-color: var(--ink); color: var(--text-on-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.dot.st-ok { background: var(--success); } .dot.st-friction { background: var(--warning); } .dot.st-blocked { background: var(--danger); } .dot.st-muted { background: var(--border-strong); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-pill); width: fit-content; max-width: 100%; }
.tab { min-height: 40px; padding: 8px 16px; border: none; background: transparent; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-muted); border-radius: var(--r-pill); }
.tab:hover { color: var(--text); }
.tab.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }

/* ---------- overview: stat cards + tables ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tile { padding: 18px 20px; display: flex; align-items: center; gap: 14px; border: none; box-shadow: none; }
.tiles .tile:nth-child(4n+1) { background: var(--grad-1); } .tiles .tile:nth-child(4n+2) { background: var(--grad-2); }
.tiles .tile:nth-child(4n+3) { background: var(--grad-3); } .tiles .tile:nth-child(4n+4) { background: var(--grad-4); }
.tile-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: var(--shadow-1); }
.tile-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.tile-value { font-size: 28px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table thead th { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.table tbody th { font-weight: 600; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: none; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.change-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 10px 12px; border-radius: var(--r-md); background: var(--highlight); margin-bottom: 6px; }

/* ---------- flow ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 10px; min-width: 780px; }
.steps li { display: flex; }
.step { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 16px; border-radius: var(--r-lg); cursor: pointer; text-align: left; background: var(--surface); color: var(--text); border: 2px solid var(--border); }
.step:hover { border-color: var(--border-strong); }
.step.on { border-color: var(--accent); background: var(--accent-soft); }
.step-name { font-weight: 600; font-size: 15px; }
.step-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: 6px; }
.step-time { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.metric-v { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.shots figure { margin: 0; }
.shot { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; cursor: zoom-in; background: var(--surface-2); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shots figcaption { font-size: 12px; margin-top: 6px; }
.shot-host { display: block; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot-wrap { position: relative; }
.shot-del, .shot-check { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--danger); cursor: pointer; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow-1); }
.shot-wrap:hover .shot-del, .shot-del:focus-visible, .shot-check { opacity: 1; }
@media (hover: none) { .shot-del { opacity: 1; } }
.shot-check input { width: 18px; height: 18px; }
figure.picked .shot { outline: 3px solid var(--accent); outline-offset: 1px; }
.shot-badge { position: absolute; left: 6px; top: 6px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); background: var(--ink); color: var(--text-on-ink); }

/* ---------- premium storytelling ---------- */
.premium-head { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.big-score { font-size: 56px; font-weight: 600; line-height: 1; }
.big-score span { font-size: 20px; color: var(--text-muted); }
.crit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.crit-grid h2 { margin: 0; }
.crit { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.crit h3 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.rating { display: flex; align-items: center; gap: 10px; }
.meter { display: inline-flex; gap: 4px; }
.meter span { width: 28px; height: 10px; border-radius: var(--r-pill); background: var(--surface-3); }
.meter span.fill { background: var(--accent); }

/* ---------- timeline + chart ---------- */
.grid-table { width: 100%; border-collapse: separate; border-spacing: 6px; min-width: 640px; font-size: 13px; }
.grid-table th { text-align: left; font-size: 12px; color: var(--text-muted); font-weight: 600; padding: 4px; }
.grid-table tbody th { color: var(--text); white-space: nowrap; font-size: 13px; }
.cell { padding: 8px 10px; border-radius: var(--r-sm); min-width: 96px; }
.cell.changed { outline: 2px solid var(--accent); outline-offset: -2px; }
.cell.dark { background: var(--ink); color: var(--text-on-ink); }
.bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; border-bottom: 1px solid var(--border); }
.bar-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar { width: 100%; max-width: 64px; border-radius: 14px 14px 4px 4px; background: var(--surface-2) var(--hatch); border: 1px solid var(--border); }
.bar.on { background: var(--accent-chart); border-color: var(--accent-chart); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 14px; padding-bottom: 14px; position: relative; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 auto; }

/* ---------- media ---------- */
.video { width: 100%; max-height: 560px; border-radius: var(--r-md); background: #0B0B12; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; }
.chapter { flex: 1 1 120px; min-height: 48px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 6px 10px; border-radius: var(--r-md); cursor: pointer; background: var(--accent-soft); color: var(--accent); border: none; text-align: left; }
.chapter.disabled { background: var(--neutral-soft); color: var(--text-muted); cursor: not-allowed; }

/* ---------- compare ---------- */
.compare-pick { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.side { flex: 1 1 300px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--border); }
.side label { flex: 1 1 130px; }
.badge { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.badge-a { background: var(--accent); color: var(--on-accent); } .badge-b { background: var(--ink); color: var(--text-on-ink); }
.hdr { display: inline-flex; align-items: center; gap: 8px; }
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.side-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.side-card .metrics { gap: 8px; }
.side-card .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; min-height: 36px; }
input, select, textarea { min-height: 42px; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); font-size: 14px; color: var(--text); font-weight: 400; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-table { min-width: 860px; }
.form-table td { padding: 6px; }
fieldset { border: none; margin: 0; padding: 0; }
legend { margin-bottom: 8px; }
.check-pill { flex-direction: row; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--text); font-size: 14px; }
.filters { max-width: 760px; }

/* ---------- update panel ---------- */
.update-panel { border: 2px solid var(--accent); }
.update-panel h2 { margin: 0; }
.progress { height: 10px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .4s var(--ease); }
.job-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.segs { display: flex; gap: 4px; flex: 1 1 320px; }
.seg { flex: 1 1 0; min-width: 0; text-align: center; font-size: 11px; font-weight: 600; padding: 4px 2px; border-radius: 6px; background: var(--surface-3); color: var(--neutral); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg.fill { background: var(--accent); color: var(--on-accent); }
.seg.now { background: var(--surface); color: var(--accent); outline: 2px solid var(--accent); outline-offset: -2px; }
.job-msg { flex: 1 1 100%; overflow-wrap: anywhere; }

/* ---------- run management ---------- */
.runs-table td.actions { display: flex; gap: 6px; justify-content: flex-end; }
.runs-table tr.row-on td { background: var(--accent-soft); }
.runs-table input[type=checkbox] { width: 18px; height: 18px; }
.runs-table td.num { white-space: nowrap; }

/* ---------- lightbox: screenshot viewer, in the dialog panel style ---------- */
.lightbox { position: fixed; inset: 0; background: var(--overlay); overflow: auto; padding: 32px; z-index: 50; }
.lb-panel { margin: 0 auto; max-width: min(1200px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2); overflow: clip; }
.lb-head { align-items: flex-start; border-bottom: 1px solid var(--border); padding-bottom: 14px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.lb-cap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lb-cap h2 { font-size: 16px; overflow-wrap: anywhere; }
.lightbox img { width: 100%; height: auto; display: block; }
.lb-img { background: var(--surface-2); }
.lb-del { color: #FFB8CC; text-decoration: underline; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .frame { margin: 0; border-radius: 0; } }
@media (max-width: 900px) {
  .sidebar { max-width: none; flex-basis: 100%; }
  .sidebar .nav-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px; background: var(--surface); }
}
@media (max-width: 700px) {
  .shell, .topbar-in { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .tabs { border-radius: var(--r-md); }
}

/* ---------- screenshot tools: move + delete ---------- */
.shot-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 6px; align-items: center; opacity: 0; transition: opacity .15s; }
.shot-wrap:hover .shot-tools, .shot-tools:focus-within { opacity: 1; }
@media (hover: none) { .shot-tools { opacity: 1; } }
.shot-tools .shot-del { position: static; opacity: 1; }
.shot-move { width: auto; min-height: 34px; height: 34px; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-1); max-width: 150px; }
.move-selected { width: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: var(--r-pill); }
.lb-move { width: auto; display: inline-block; min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: var(--r-pill); }
.toast-region { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; }
.toast { background: var(--ink); color: var(--text-on-ink); padding: 10px 18px; border-radius: var(--r-pill); font-weight: 600; box-shadow: var(--shadow-2); }

/* UX heuristics */
.sev-4 { border-color: var(--danger); font-weight: 700; }
.heur-table td:first-child { min-width: 280px; max-width: 520px; }
.heur-table td:nth-child(2) { white-space: nowrap; }
.heur-compare summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.danger-text { color: var(--danger); font-weight: 600; }

/* UX heuristics checklist editor */
.heur-item { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.heur-item.is-off { background: var(--surface-2, var(--surface)); border-style: dashed; }
.heur-item.is-off textarea, .heur-item.is-off input:not([type=checkbox]) { color: var(--text-muted); }
.heur-item-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.heur-item-top .grow { flex: 1 1 260px; }
.heur-item-top input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; }
.sev-row { grid-template-columns: minmax(160px, 220px) 1fr; }

/* Run paused after a block (dashboard banner with Continue / Stop) */
.takeover { position: sticky; top: 8px; z-index: 5; margin-bottom: 16px; }

/* Manual uploads */
.dropzone { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 2px dashed var(--border); border-radius: var(--r-md); background: var(--surface-2); cursor: pointer; }
.dropzone.over { border-color: currentColor; }
.dropzone input[type=file] { min-height: 0; }
.upl .upl-video { width: 100%; display: block; border-radius: var(--r-sm, 8px); background: #000; }
.upl .upl-tools { margin-top: 6px; }
.upl .upl-tools select { max-width: 170px; }

/* Airline flow settings and screenshot settings */
.flow-extra { padding: 12px 0; border-top: 1px solid var(--border); }
.flow-extra legend { color: var(--text); padding: 0; margin-bottom: 8px; }
.flow-pick select { max-width: 320px; }
.shots-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.heur-airlines summary { cursor: pointer; }
.heur-airlines .pills { margin-top: 6px; }

.auto-per-step input { max-width: 120px; }

/* Sidebar: one dot per airline for how recently it was updated (details in the tooltip) */
.fresh-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; }
.fresh-dot.week { background: var(--success); }
.fresh-dot.months { background: var(--fresh-yellow); }
.fresh-dot.old { background: var(--danger); }

/* Custom dropdowns (public/dropdown.js) replace the native selects; the select stays hidden. */
select.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; overflow: hidden; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 400; text-align: left; cursor: pointer; }
.dd-btn:hover { background: var(--surface-2); }
.dd-btn[aria-expanded="true"] { border-color: var(--accent); }
.dd-btn:disabled { opacity: .55; cursor: not-allowed; }
.dd-btn .dd-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-btn.is-placeholder .dd-value { color: var(--text-muted); }
.dd-btn svg { flex: 0 0 auto; color: var(--text-muted); transition: transform .15s var(--ease); }
.dd-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.dd-btn.shot-move, .dd-btn.lb-move { width: auto; min-height: 34px; height: 34px; padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); max-width: 170px; }
.dd-btn.shot-move { box-shadow: var(--shadow-1); }
.run-nav .dd-btn { width: auto; max-width: min(460px, 70vw); }
.upl-tools .dd-btn { width: auto; max-width: 190px; min-height: 34px; padding: 4px 10px; font-size: 13px; }
.dd-list, .menu-list { position: fixed; z-index: 2000; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-2); color: var(--text); font-size: 14px; }
.dd-opt, .menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; background: none; border: 0; text-align: left; color: var(--text); font: inherit; }
.dd-opt:hover, .dd-opt:focus, .menu-item:hover, .menu-item:focus { background: var(--surface-2); outline: none; }
.dd-opt:focus-visible, .menu-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.dd-opt[aria-selected="true"] { font-weight: 600; }
.dd-opt[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; }
.dd-check { display: inline-flex; width: 14px; flex: 0 0 auto; color: var(--accent); }

/* Settings menu (top bar) */
.menu-wrap { position: relative; }
.menu-list { position: absolute; top: calc(100% + 6px); right: 0; width: 300px; max-height: none; }
.menu-item { flex-direction: column; align-items: flex-start; gap: 2px; text-decoration: none; }
.menu-item .menu-label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.menu-item .menu-sub { font-size: 12px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.menu-item[aria-current="page"] .menu-label { color: var(--accent); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.dd-btn.move-selected { width: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; font-weight: 600; border-radius: var(--r-pill); }
.settings-btn { gap: 6px; min-height: 44px; } .settings-btn.is-on { border-color: var(--accent); }

/* Dialogs (public/dialog.js): one panel style for every dialog in the product */
dialog.modal { padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); width: min(440px, calc(100vw - 32px)); max-height: min(86vh, 900px); overflow: hidden; }
dialog.modal.modal-md { width: min(560px, calc(100vw - 32px)); }
dialog.modal.modal-lg { width: min(760px, calc(100vw - 32px)); }
dialog.modal::backdrop { background: var(--overlay); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .16s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.modal[open] { animation: none; } }
.modal-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-x { width: 36px; height: 36px; flex: 0 0 auto; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; min-height: 0; }
.modal-text { margin: 0 0 8px; color: var(--text); line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-foot .modal-foot-info { margin-right: auto; align-self: center; }
.modal-error { margin-top: 10px; }
.btn-primary.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn-primary.btn-danger:hover { filter: brightness(.92); }

/* Report dialog: airlines grouped by region, a run per airline */
.rd { display: flex; flex-direction: column; gap: 8px; }
.rd-quick { margin-bottom: 4px; }
.rd-group { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.rd-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 12px 14px; background: none; border: 0; border-radius: var(--r-md); cursor: pointer; color: var(--text); font: inherit; text-align: left; }
.rd-toggle:hover { background: var(--surface-2); }
.rd-toggle .chev { transition: transform .15s var(--ease); color: var(--text-muted); }
.rd-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.rd-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.rd-list[hidden] { display: none; }
.rd-group-actions { padding: 8px 0 2px; }
.rd-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(200px, 1.4fr); align-items: center; gap: 12px; padding: 6px 0; }
.rd-row.is-off { opacity: .7; }
.rd-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rd-name input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
@media (max-width: 560px) { .rd-row { grid-template-columns: 1fr; } }

.airline-login { padding-top: 12px; border-top: 1px solid var(--border); }
.airline-login legend { color: var(--text); padding: 0; margin-bottom: 6px; }

.job-controls { margin-left: auto; }

/* Airline page header: logo plus the name in text */
.airline-h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.airline-h1-logo { display: inline-flex; }
.airline-name { font-size: 15px; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }
/* Sidebar rows with only the logo */
.nav-item.logo-only { min-height: 48px; }

/* Trend settings and the trends report dialog */
.trend-name, .trend-h { margin: 0; font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); }
.trend-item .row-between { flex-wrap: wrap; gap: 8px 12px; }
.trend-item p { margin: 0; }
.trend-h { font-size: 15px; margin-top: 10px; }
.trend-crit { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.trend-crit p { margin: 0; }
.trend-crit-top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.trend-crit-top .grow { flex: 1 1 240px; }
.trend-weight { width: 96px; }
.trend-ux summary { cursor: pointer; padding: 4px 0; }
.trend-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 0 2px; }
.trend-checks > span { flex-basis: 100%; }
.trend-checks input, .td-row input { width: 18px; height: 18px; min-height: 0; padding: 0; flex: none; }
.trend-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.td-list { display: flex; flex-direction: column; gap: 6px; }
.td-row { display: flex; flex-direction: row; align-items: flex-start; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); cursor: pointer; font-weight: 400; font-size: 14px; color: var(--text); }
.td-row:hover { background: var(--surface-2); }
.td-row input { margin-top: 2px; }
.td-desc { display: block; margin-top: 2px; }
.td-period { max-width: 260px; }

/* Header logo: a button back to the All airlines overview */
button.brand { background: none; border: 0; padding: 4px 8px 4px 4px; margin: -4px 0 -4px -4px; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: var(--r-md); }
button.brand:hover .brand-name { text-decoration: underline; text-underline-offset: 3px; }
button.brand:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }

/* Airline flow settings: 1. choose an airline, 2. its flow options */
.flow-step h2 { display: flex; align-items: center; gap: 10px; margin: 0; }
.flow-step p { margin: 0; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--text-on-ink); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.flow-airline-h { display: inline-flex; align-items: center; gap: 10px; }
.flow-pick select { max-width: 420px; }
