/* =========================================================================
   Contrail — global stylesheet
   Dark theme, vivid blue accents. Uses CSS custom properties throughout.
   ========================================================================= */

:root {
    /* Surfaces & borders */
    --bg:            #0A0E17;
    --surface:       #141B2D;
    --surface-2:     #1A2238;
    --border:        rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* Accents */
    --accent:        #4F8CFF;
    --accent-hover:  #3B7DF5;
    --accent-2:      #22D3EE;
    --accent-grad:   linear-gradient(135deg, #4F8CFF 0%, #22D3EE 100%);

    /* Text */
    --text:          #E6EAF2;
    --text-muted:    #94A0B8;

    /* Feedback */
    --danger:        #F87171;
    --danger-bg:     rgba(248, 113, 113, 0.12);
    --success:       #34D399;
    --success-bg:    rgba(52, 211, 153, 0.12);

    /* Shape & motion */
    --radius:        14px;
    --radius-sm:     10px;
    --radius-lg:     20px;
    --shadow:        0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-soft:   0 4px 16px rgba(0, 0, 0, 0.25);
    --transition:    160ms ease;

    --maxw:          1120px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
            Helvetica, Arial, sans-serif;
}

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

/* Ensure the HTML hidden attribute always wins over display rules on classes. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img, canvas { display: block; max-width: 100%; }

small { font-size: 0.6em; color: var(--text-muted); font-weight: 500; }

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

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */
.btn {
    --btn-pad-y: 0.7rem;
    --btn-pad-x: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--btn-pad-y) var(--btn-pad-x);
    font: inherit;
    font-weight: 600;
    line-height: 1;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform var(--transition), background var(--transition),
                border-color var(--transition), box-shadow var(--transition),
                color var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    color: #06122B;
    background: var(--accent-grad);
    box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}
.btn--primary:hover { color: #06122B; box-shadow: 0 8px 24px rgba(79, 140, 255, 0.5); }

.btn--outline {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.02);
}
.btn--outline:hover { color: var(--text); border-color: var(--accent); }

.btn--ghost {
    color: var(--text-muted);
    border-color: var(--border);
}
.btn--ghost:hover { color: var(--text); border-color: var(--border-strong); }

.btn--lg  { --btn-pad-y: 0.95rem; --btn-pad-x: 1.8rem; font-size: 1.05rem; }
.btn--sm  { --btn-pad-y: 0.5rem;  --btn-pad-x: 0.9rem; font-size: 0.9rem; }
.btn--block { display: flex; width: 100%; }

/* -------------------------------------------------------------------------
   Navbar
   ---------------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.navbar--landing {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(10, 14, 23, 0.28);
    border-bottom-color: transparent;
}
.navbar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.navbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: var(--text);
}
.navbar__brand:hover { color: var(--text); }
.navbar__brand-mark {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-grad);
    box-shadow: 0 0 14px rgba(79, 140, 255, 0.7);
}

.navbar__menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.navbar__links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.navbar__link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: color var(--transition), background var(--transition);
}
.navbar__link:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.navbar__link.is-active { color: var(--text); background: rgba(79, 140, 255, 0.14); }

.navbar__actions { display: flex; align-items: center; gap: 0.85rem; }

.navbar__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 9px 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.navbar__toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
}

/* -------------------------------------------------------------------------
   Landing hero
   ---------------------------------------------------------------------- */
body.landing { overflow-x: hidden; }

.planes-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    min-height: 100vh;
}
.hero__inner { max-width: 640px; }
.hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-2);
    margin: 0 0 1rem;
}
.hero__title {
    font-size: clamp(3rem, 12vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__tagline {
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    color: var(--text-muted);
    margin: 1rem 0 2.25rem;
}
.hero__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Auth pages (login / register)
   ---------------------------------------------------------------------- */
.auth {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.25rem 3rem;
}
.auth__card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2.25rem;
}
.auth__title { font-size: 1.6rem; letter-spacing: -0.02em; }
.auth__subtitle { color: var(--text-muted); margin: 0.5rem 0 1.75rem; }
.auth__alt {
    margin: 1.5rem 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field__label { font-size: 0.9rem; font-weight: 500; color: var(--text); }
.field__label-row { display: flex; justify-content: space-between; align-items: baseline; }
.field__forgot { font-size: 0.8rem; color: var(--accent); text-decoration: none; }
.field__forgot:hover { text-decoration: underline; }
.field__input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field__input::placeholder { color: var(--text-muted); }
.field__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.18);
}
.field__hint { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.field__error { margin: 0; font-size: 0.85rem; color: var(--danger); font-weight: 500; }

/* Auto-fill row (flight number + button) */
.autofill-row { display: flex; gap: 0.5rem; align-items: center; }
.autofill-row .field__input { flex: 1; min-width: 0; }
.autofill-status {
    padding: 0.55rem 0.85rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin: 0;
}
.autofill-status--ok   { background: rgba(79,200,79,0.10); color: #5adb5a; border: 1px solid rgba(79,200,79,0.25); }
.autofill-status--err  { background: rgba(220,60,60,0.10); color: #e06060; border: 1px solid rgba(220,60,60,0.25); }
.autofill-status--info { background: rgba(79,140,255,0.08); color: var(--text-muted); border: 1px solid var(--border); }
.autofill-choices { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.autofill-choice { text-align: left; }

/* -------------------------------------------------------------------------
   Alerts
   ---------------------------------------------------------------------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}
.alert--error   { color: #FECACA; background: var(--danger-bg);  border-color: rgba(248,113,113,0.3); }
.alert--success { color: #BBF7D0; background: var(--success-bg); border-color: rgba(52,211,153,0.3); }
.alert--info    { color: #BFDBFE; background: rgba(79,140,255,0.12); border-color: rgba(79,140,255,0.3); }

/* -------------------------------------------------------------------------
   Generic page layout (dashboard, profile, stubs)
   ---------------------------------------------------------------------- */
.page { flex: 1; padding: 2.5rem 1.25rem 4rem; }
.page__container { max-width: var(--maxw); margin: 0 auto; }
.page__container--narrow { max-width: 640px; }
.page__head { margin-bottom: 2rem; }
.page__title { font-size: 1.9rem; letter-spacing: -0.02em; }
.page__subtitle { color: var(--text-muted); margin: 0.5rem 0 0; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}
.card__title { font-size: 1.15rem; margin-bottom: 1.25rem; }
.card__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.card__title-row .card__title { margin-bottom: 0; }
.card--danger { border-color: #C0392B; }
.card--danger .card__title { color: #C0392B; }

/* Danger zone actions (profile page) */
.danger-action { padding: 1.25rem 0 0; }
.danger-action + .danger-action { border-top: 1px solid rgba(192,57,43,0.25); padding-top: 1.5rem; margin-top: 0.25rem; }
.danger-action__desc { margin: 0 0 1rem; }
.danger-confirm__warning {
    font-size: 0.875rem;
    color: #FECACA;
    background: var(--danger-bg);
    border: 1px solid rgba(248,113,113,0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin: 0 0 0.875rem;
}
.danger-confirm__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }

/* Definition list */
/* View-flight back/edit bar */
.view-flight-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }

/* Prose layout for the privacy page */
.prose h2 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; color: var(--text); }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { margin: 0 0 0.75rem; line-height: 1.65; color: var(--text-muted); }
.prose ul { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.3rem; }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); }

.datalist { margin: 0; display: flex; flex-direction: column; gap: 0.85rem; }
.datalist__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.datalist__row:last-child { border-bottom: 0; padding-bottom: 0; }
.datalist dt { color: var(--text-muted); }
.datalist dd { margin: 0; font-weight: 500; }

/* Dashboard stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.stat-card__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.stat-card__value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }

/* Friend stats-overview comparison (compare.php, §2c) */
.compare-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.compare-grid__header,
.compare-grid__row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: 1rem;
    align-items: center;
}
.compare-grid__header {
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}
.compare-grid__person {
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}
.compare-grid__metric-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.compare-cell {
    display: block;
    text-align: center;
    padding: 0.9rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.compare-cell--empty { color: var(--text-muted); font-weight: 400; }
.compare-grid__notshared { margin: 0.5rem 0 1rem; }
@media (max-width: 560px) {
    .compare-grid__header,
    .compare-grid__row { grid-template-columns: 1fr; gap: 0.35rem; text-align: left; }
    .compare-grid__header .compare-grid__person { text-align: left; }
    .compare-grid__row .compare-grid__metric-label { font-weight: 600; color: var(--text); }
    .compare-cell { text-align: left; }
}

/* Empty / coming-soon state */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(79,140,255,0.08), transparent 60%),
        var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}
.empty-state__badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent-2);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 999px;
}
.empty-state__text { color: var(--text-muted); margin: 0 0 1.5rem; }

/* -------------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */
.site-footer {
    position: relative;
    z-index: 10;
    border-top: 1px solid var(--border);
    background: rgba(10, 14, 23, 0.6);
}
body.landing .site-footer { background: transparent; border-top-color: transparent; }
.site-footer__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.site-footer__muted { color: var(--text-muted); }
.site-footer__link { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.site-footer__link:hover { color: var(--text); }

/* -------------------------------------------------------------------------
   Responsive — collapse member nav into a toggle menu
   ---------------------------------------------------------------------- */
@media (max-width: 860px) {
    .navbar__toggle { display: flex; }

    .navbar__links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem 1.25rem 1.5rem;
        background: rgba(10, 14, 23, 0.97);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        display: none;
    }
    .navbar__links.is-open { display: flex; }
    .navbar__menu { flex-direction: column; align-items: stretch; gap: 0.25rem; }
    .navbar__actions { justify-content: space-between; }
}

@media (max-width: 480px) {
    .auth__card { padding: 1.75rem 1.4rem; }
    .hero__actions .btn { width: 100%; }
}

/* -------------------------------------------------------------------------
   Reduced motion — hide the canvas animation entirely
   ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .planes-bg { display: none; }
    .btn:hover { transform: none; }
    * { scroll-behavior: auto !important; }
}

/* =========================================================================
   Iteration 2 — data, map, charts & statistics
   ========================================================================= */

.muted { color: var(--text-muted); }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    padding: 0.1rem 0.35rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: var(--text);
    cursor: pointer;
}
.checkbox input { margin-top: 0.2rem; flex: 0 0 auto; }
.checkbox code { font-size: 0.82em; }

/* ---- Unit toggle (navbar) -------------------------------------------- */
.unit-toggle {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    overflow: hidden;
}
.unit-toggle__btn {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    padding: 0.35rem 0.7rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.unit-toggle__btn.is-active { color: #06122B; background: var(--accent); }

/* ---- Form grid & autocomplete ---------------------------------------- */
.form--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem;
}
.form--grid .field--full { grid-column: 1 / -1; }
.field--autocomplete { position: relative; }

select.field__input { appearance: none; cursor: pointer; }
textarea.field__input { resize: vertical; min-height: 3rem; font-family: inherit; }

.autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    max-height: 280px;
    overflow-y: auto;
}
.autocomplete__item {
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
}
.autocomplete__item:hover,
.autocomplete__item.is-active { background: rgba(79, 140, 255, 0.16); }

/* ---- Tables ----------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.table th, .table td {
    padding: 0.65rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table td.num, .table th.num { text-align: right; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table--sortable th.is-sortable { cursor: pointer; user-select: none; }
.table--sortable th.is-sortable:hover { color: var(--text); }
.table--sortable th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
.table--sortable th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }

.route-chip {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(79, 140, 255, 0.12);
    border: 1px solid rgba(79, 140, 255, 0.2);
    border-radius: 7px;
}

/* ---- Layout helpers --------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.chart-box { position: relative; height: 300px; }
.chart-box--tall { height: 380px; }
.stat-card__value--sm { font-size: 1.25rem; }
.stat-card__sub { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Dashboard map + summary ----------------------------------------- */
.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: stretch;   /* map matches the summary panel's height */
}
/* Let the map fill the full height of its (stretched) grid cell. */
.dashboard-map { display: flex; }
.dashboard-map .map-module { flex: 1 1 auto; display: flex; flex-direction: column; }
.dashboard-map .contrail-map--dashboard { flex: 1 1 auto; }
.dashboard-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
}
.panel__title { font-size: 1.1rem; margin-bottom: 1rem; }
.summary { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.summary__item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}
.summary__item:last-child { border-bottom: 0; }
.summary__label { color: var(--text-muted); font-size: 0.92rem; }
.summary__value { font-weight: 700; font-size: 1.1rem; }
.panel__actions { display: flex; flex-direction: column; gap: 0.6rem; }

@media (max-width: 900px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .form--grid { grid-template-columns: 1fr; }
}

/* ---- Map module ------------------------------------------------------- */
.map-module { position: relative; }
.contrail-map {
    width: 100%;
    border-radius: var(--radius);
    background: #0A0E17;
    z-index: 1;
}
.contrail-map--dashboard { height: 440px; min-height: 440px; }
.contrail-map--full { height: min(64vh, 620px); }
.contrail-map--flight { height: 280px; min-height: 280px; }

.leaflet-container {
    background: #070B12;
    font-family: var(--font);
    border-radius: var(--radius);
}
.leaflet-tooltip {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-soft);
    border-radius: 8px;
    font-size: 0.82rem;
}
.leaflet-tooltip::before { display: none; }
.leaflet-bar a {
    background: var(--surface-2);
    color: var(--text);
    border-bottom-color: var(--border);
}
.leaflet-bar a:hover { background: var(--surface); }

.card--map { padding: 1rem; }
.page--map .page__container { max-width: 1280px; }

.segmented {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.map-switcher { margin-bottom: 0.85rem; }
.segmented__btn {
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active { color: #06122B; background: var(--accent); }

.map-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.map-legend__title { font-weight: 600; color: var(--text); }
.map-legend__item { display: inline-flex; align-items: center; gap: 0.4rem; }
.map-legend__item i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.map-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    pointer-events: none;
}
.map-empty a { pointer-events: auto; }

/* ---- Extremes (airports page) ---------------------------------------- */
.extremes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.extremes__item { display: flex; gap: 0.9rem; align-items: flex-start; }
.extremes__icon {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    background: rgba(79, 140, 255, 0.12);
    border: 1px solid rgba(79, 140, 255, 0.2);
    border-radius: 10px;
}
.extremes__item > div { display: flex; flex-direction: column; gap: 0.15rem; }
.extremes__label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.extremes__value { font-weight: 600; }
.extremes__sub { font-size: 0.85rem; color: var(--text-muted); }

/* ---- Time page -------------------------------------------------------- */
.time-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    padding: 2.5rem 1.5rem;
    margin-bottom: 1.5rem;
    background:
        radial-gradient(120% 120% at 50% 0%, rgba(79,140,255,0.1), transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.time-hero__block { text-align: center; }
.time-hero__value {
    display: block;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.time-hero__unit { color: var(--text-muted); }
.time-hero__divider { width: 1px; height: 60px; background: var(--border-strong); }

.equiv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}
.equiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    padding: 1.25rem 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.equiv__icon { font-size: 1.8rem; }
.equiv__value { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.equiv__label { font-weight: 600; font-size: 0.92rem; }
.equiv__note { font-size: 0.78rem; color: var(--text-muted); }

/* ---- Distances: around the Earth ------------------------------------- */
.earth-laps__stage {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}
.earth-laps__globe {
    position: relative;
    width: 130px; height: 130px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 30%, #4F8CFF 0%, #1e3a8a 55%, #0b1c45 100%);
    box-shadow: inset -10px -10px 30px rgba(0,0,0,0.5), 0 0 40px rgba(79,140,255,0.3);
    flex: 0 0 auto;
}
.earth-laps__orbit {
    position: absolute;
    inset: -18px;
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: 50%;
}
.earth-laps__plane {
    position: absolute;
    top: -10px; left: 50%;
    transform: translateX(-50%) rotate(90deg);
    font-size: 1.2rem;
}
.earth-laps.is-spinning .earth-laps__orbit { animation: contrail-spin 9s linear infinite; }
@keyframes contrail-spin { to { transform: rotate(360deg); } }
.earth-laps__readout { display: flex; flex-direction: column; gap: 0.2rem; }
.earth-laps__count {
    font-size: clamp(2.5rem, 8vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--accent);
}
.earth-laps__unit { font-size: 1.1rem; color: var(--text); }
.earth-laps__note { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Distances: rocket to the bodies --------------------------------- */
.space-journey__stage {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0 2.5rem;
}
.space-journey__earth {
    flex: 0 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.space-journey__earth-icon { font-size: 2.6rem; }
.space-journey__earth-label { font-size: 0.8rem; color: var(--text-muted); }
.space-journey__track {
    position: relative;
    flex: 1 1 auto;
    height: 140px;
    min-width: 0;
}
/* The horizontal travel line sits near the bottom; bodies + their percentage
   labels are stacked ABOVE it, and the plane travels along the line itself. */
.space-journey__track::before {
    content: "";
    position: absolute;
    top: 82%; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, rgba(79,140,255,0.5), rgba(255,255,255,0.08));
    transform: translateY(-50%);
}
.space-journey__rocket {
    position: absolute;
    top: 82%; left: 0;
    transform: translate(-50%, -50%);
    font-size: 1.7rem;
    transition: left 2.2s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 2;
}
.milestone {
    position: absolute;
    top: 82%;
    transform: translate(-50%, calc(-100% - 12px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-align: center;
}
.milestone__body {
    font-size: 2rem;
    transition: transform 0.6s ease, opacity 0.6s ease;
}
.milestone.is-reached .milestone__body { transform: scale(0.4); opacity: 0.5; }
.milestone__name { font-size: 0.78rem; color: var(--text-muted); }
.milestone__pct { font-size: 0.92rem; font-weight: 700; color: var(--accent); }

@media (max-width: 560px) {
    .space-journey__track { height: 120px; }
    .milestone__body { font-size: 1.5rem; }
    .time-hero { gap: 1.25rem; }
    .time-hero__divider { display: none; }
}

/* ---- Reduced motion for iteration-2 animations ----------------------- */
@media (prefers-reduced-motion: reduce) {
    .earth-laps.is-spinning .earth-laps__orbit { animation: none; }
    .space-journey__rocket { transition: none; }
    .milestone__body { transition: none; }
}

/* =========================================================================
   Iteration 5 — shared plane vector, time model, My-Flights, seats, polish
   ========================================================================= */

/* ---- Navbar: brand plane icon + Add-flight CTA ----------------------- */
.navbar__brand-icon {
    width: 22px;
    height: 22px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(79, 140, 255, 0.6));
}
.navbar__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    background: rgba(79, 140, 255, 0.08);
    transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.navbar__cta:hover { color: var(--text); background: rgba(79, 140, 255, 0.18); }
.navbar__cta.is-active { color: #06122B; background: var(--accent); border-color: var(--accent); }
.navbar__cta-plus { font-weight: 800; font-size: 1.05em; line-height: 1; }

/* ---- Landing tweaks -------------------------------------------------- */
body.landing .hero__tagline { color: #fff; }
body.landing .btn--outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}
body.landing .btn--outline:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, 0.14); }

/* ---- Flights tabs ---------------------------------------------------- */
.flights-tabs { margin-bottom: 1.25rem; }
a.segmented__btn { text-decoration: none; }

/* ---- Import flights form --------------------------------------------- */
.import-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
}
.import-form .field__input[type="file"] {
    flex: 1 1 260px;
    width: auto;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
}

/* ---- Add-flight: time model ------------------------------------------ */
.time-group { margin-top: 0.25rem; }
.time-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}
.time-computed {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.7rem;
    font-size: 0.92rem;
    color: var(--text-muted);
}
.time-computed strong { color: var(--accent); }
.form__actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }

/* ---- Seat-position selector ------------------------------------------ */
.seat-select { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.seat-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 86px;
    padding: 0.7rem 0.4rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.seat-option:hover { color: var(--text); border-color: var(--border-strong); }
.seat-option.is-active { color: var(--accent); border-color: var(--accent); background: rgba(79, 140, 255, 0.12); }
.seat-option__icon {
    width: 30px;
    height: 30px;
    display: block;
    background: currentColor;          /* tints the masked silhouette */
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
}
.seat-option__label { font-size: 0.8rem; font-weight: 600; }

/* ---- My Flights: toolbar, search, table ------------------------------ */
.flights-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}
.field--search { margin: 0; flex: 1 1 280px; max-width: 420px; }
.field--search .field__input { width: 100%; }
.status-tabs {
    display: flex;
    gap: 0.35rem;
    background: var(--bg-inset, rgba(255,255,255,0.04));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.2rem;
}
.status-tabs__btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.status-tabs__btn:hover { color: var(--text); }
.status-tabs__btn.is-active { background: var(--accent); color: #06122B; }
.btn--danger {
    color: #fff;
    border-color: #C0392B;
    background: rgba(192, 57, 43, 0.85);
}
.btn--danger:hover { color: #fff; background: #C0392B; border-color: #C0392B; }
.table__empty td { text-align: center; color: var(--text-muted); padding: 1.25rem; }

/* ---- Time page: block / flight / taxi totals ------------------------- */
.time-totals {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.time-total {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    text-align: center;
}
.time-total__label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.time-total__value {
    display: block;
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.02em;
    margin: 0.3rem 0 0.2rem;
}
.time-total__value small { font-size: 1rem; color: var(--text-muted); margin-left: 0.15rem; }
.time-total__sub { display: block; font-size: 0.9rem; color: var(--text); }
.time-total__note { display: block; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ---- Distances: image-based bodies & shared plane -------------------- */
.earth-laps__globe { background: none; box-shadow: 0 0 40px rgba(79, 140, 255, 0.3); }
.earth-laps__earth { width: 100%; height: 100%; display: block; }
.earth-laps__plane { width: 24px; height: auto; transform: translateX(-50%) rotate(0deg); }
.space-journey__earth-icon img { width: 2.6rem; height: 2.6rem; display: block; }
.space-journey__rocket { font-size: 0; }
.space-journey__rocket img { width: 2rem; height: 2rem; display: block; }
.milestone__body { font-size: 0; }
.milestone__body img { width: 2rem; height: 2rem; display: block; }

@media (max-width: 680px) {
    .time-totals { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .time-grid { grid-template-columns: 1fr; }
    .milestone__body img { width: 1.5rem; height: 1.5rem; }
}

/* =========================================================================
   Iteration 7 — Airlines page, map breakdowns, distances/time polish
   ========================================================================= */

/* ---- Generic stat "blocks" (Time-page top-block visual style) --------- */
.blocks { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.blocks--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blocks--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.block {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.4rem 1.3rem;
}
.block--center { align-items: center; text-align: center; }
.block__label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.block__value {
    font-size: clamp(1.7rem, 5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent);
}
.block__value small { font-size: 1rem; color: var(--text-muted); margin-left: 0.15rem; }
.block__value--name { font-size: clamp(1.1rem, 3vw, 1.4rem); color: var(--text); }
.block__sub { font-size: 0.88rem; color: var(--text-muted); }
.block__logo { margin: 0.1rem 0; }
.block__seat-icon {
    width: 42px; height: 42px;
    background: var(--accent);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
}

/* ---- Airline logo with safe text fallback ----------------------------- */
.airline-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.airline-logo__img { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.airline-logo__fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}
.airline-logo--lg .airline-logo__img { width: 48px; height: 48px; }
.airline-logo--lg .airline-logo__fallback { height: 34px; font-size: 1rem; }
.airline-logo__plane {
    display: inline-block;
    width: 28px;
    height: 28px;
    -webkit-mask-image: url(../img/plane.svg);
    mask-image: url(../img/plane.svg);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    opacity: 0.6;
}
.airline-logo--lg .airline-logo__plane { width: 48px; height: 48px; }

/* ---- Full all-airlines list ------------------------------------------- */
.airline-list { display: flex; flex-direction: column; }
.airline-list__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}
.airline-list__row:last-child { border-bottom: none; }
.airline-list__logo { flex: 0 0 28px; }
.airline-list__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.airline-list__flights { flex: 0 0 auto; color: var(--text-muted); font-size: 0.85rem; }
.airline-list__pct { flex: 0 0 3.5rem; text-align: right; color: var(--text-muted); font-size: 0.85rem; }

/* ---- Top-N flight ranking list (distances + time pages) --------------- */
.flight-rank-list { display: flex; flex-direction: column; }
.flight-rank-row {
    display: grid;
    grid-template-columns: 2rem 1fr 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}
.flight-rank-row:last-child { border-bottom: none; padding-bottom: 0; }
.flight-rank-row__num {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.flight-rank-row__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.flight-rank-row__route {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}
.flight-rank-row__meta {
    font-size: 0.775rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.flight-rank-row__bar {
    background: var(--border);
    border-radius: 99px;
    height: 4px;
    overflow: hidden;
    align-self: center;
}
.flight-rank-row__bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent);
    min-width: 2px;
}
.flight-rank-row__stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    white-space: nowrap;
}
.flight-rank-row__value {
    font-weight: 600;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
}
.flight-rank-row__pct {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
    .flight-rank-row { grid-template-columns: 2rem 1fr auto; }
    .flight-rank-row__bar { display: none; }
}

/* ---- Horizontal airline bar chart (logo + brand-coloured bar) --------- */
.airline-bars { display: flex; flex-direction: column; gap: 0.85rem; }
.airline-bar { display: flex; align-items: center; gap: 0.85rem; }
.airline-bar__logo { flex: 0 0 auto; width: 28px; }
.airline-bar__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.airline-bar__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.airline-bar__track {
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.airline-bar__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 4px;
    transition: width 0.6s ease;
}
.airline-bar__value {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.chart-box--sm { height: 220px; }

/* ---- Map breakdowns: donut charts ------------------------------------- */
.donut-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}
.donut-card { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.7rem; }
.donut {
    width: 168px;
    height: 168px;
    border-radius: 50%;
    background: conic-gradient(
        var(--donut-color) calc(var(--frac) * 360deg),
        rgba(255, 255, 255, 0.07) 0
    );
    display: grid;
    place-items: center;
}
.donut__hole {
    width: 68%;
    height: 68%;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}
.donut__main { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.donut__sub { font-size: 0.95rem; font-weight: 600; color: var(--donut-color, var(--accent)); }
.donut-card__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Map breakdowns: plain horizontal bar list (airports) ------------- */
.bar-list { display: flex; flex-direction: column; gap: 0.7rem; }
.bar-row { display: flex; align-items: center; gap: 0.85rem; }
.bar-row__label {
    flex: 0 0 auto;
    width: 56px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}
.bar-row__track {
    flex: 1 1 auto;
    min-width: 0;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.bar-row__fill {
    height: 100%;
    border-radius: 999px;
    min-width: 4px;
    background: var(--accent);
    transition: width 0.6s ease;
}
.bar-row__value {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 680px) {
    .blocks--2, .blocks--3 { grid-template-columns: 1fr; }
}

/* ---- Clickable stat card (stretched-link pattern) --------------------- */
.stat-card--link { position: relative; cursor: pointer; transition: background var(--transition); }
.stat-card--link:hover { background: var(--surface-2); }
.stat-card__link {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    z-index: 1;
}

/* ---- Clickable flight-rank rows --------------------------------------- */
a.flight-rank-row {
    display: grid;
    grid-template-columns: 2rem 1fr 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    transition: background var(--transition);
    border-radius: var(--radius-sm);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
a.flight-rank-row:hover { background: rgba(255,255,255,0.04); }
a.flight-rank-row:last-child { border-bottom: none; padding-bottom: 0; }
@media (max-width: 480px) {
    a.flight-rank-row { grid-template-columns: 2rem 1fr auto; }
    a.flight-rank-row .flight-rank-row__bar { display: none; }
}

/* ---- Airline detail drawer (centered modal on desktop) ---------------- */
.airline-drawer {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.airline-drawer.airline-drawer--open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}
.airline-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}
.airline-drawer__panel {
    position: relative;
    width: min(700px, 100%);
    max-height: min(88vh, 860px);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.55);
    transform: scale(0.96) translateY(12px);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
}
.airline-drawer--open .airline-drawer__panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}
@media (max-width: 600px) {
    .airline-drawer {
        padding: 0;
        align-items: flex-end;
    }
    .airline-drawer__panel {
        width: 100%;
        max-height: 96vh;
        border-radius: var(--radius) var(--radius) 0 0;
        border-bottom: none;
        transform: translateY(100%);
        opacity: 1;
    }
    .airline-drawer--open .airline-drawer__panel {
        transform: translateY(0);
    }
}
.airline-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.airline-drawer__header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.airport-home-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #F59E0B;
    flex-shrink: 0;
}
.airline-drawer__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.airline-drawer__close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.airline-drawer__close:hover { background: var(--border); color: var(--text); }
.airline-drawer__body {
    flex: 1;
    overflow-y: auto;
}
.airline-drawer__map {
    height: 210px;
    background: var(--surface);
    flex-shrink: 0;
}
#airline-map { height: 100%; width: 100%; }
.airline-drawer__stats-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--border);
}
.airline-drawer__stat {
    padding: 0.9rem 1.25rem;
    border-right: 1px solid var(--border);
}
.airline-drawer__stat:last-child { border-right: none; }
.airline-drawer__stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.airline-drawer__stat-value {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.airline-drawer__cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border);
}
.airline-drawer__card {
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: background var(--transition);
}
.airline-drawer__card:last-child { border-right: none; }
a.airline-drawer__card:hover { background: var(--surface); }
.airline-drawer__card-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}
.airline-drawer__card-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.2rem;
}
.airline-drawer__card-sub {
    display: block;
    font-size: 0.775rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 480px) {
    .airline-drawer__stats-3 { grid-template-columns: 1fr 1fr; }
    .airline-drawer__stat:nth-child(2) { border-right: none; }
    .airline-drawer__stat:nth-child(3) {
        grid-column: 1 / -1;
        border-right: none;
        border-top: 1px solid var(--border);
    }
    .airline-drawer__cards { grid-template-columns: 1fr; }
    .airline-drawer__card { border-right: none; border-bottom: 1px solid var(--border); }
    .airline-drawer__card:last-child { border-bottom: none; }
}


/* -- Airline drawer: per-year chart ---------------------------------------- */
.airline-drawer__chart-section {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
}
.airline-chart-tabs {
    display: flex;
    gap: 0.375rem;
    margin-bottom: 0.875rem;
}
.airline-chart-tab {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.airline-chart-tab:hover {
    background: var(--surface-2);
    color: var(--text);
}
.airline-chart-tab--active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.airline-drawer__chart-box {
    position: relative;
    height: 160px;
}
.airline-drawer__chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}


/* -- Routes: extreme-airport blocks (4-up) --------------------------------- */
.blocks--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 880px) {
    .blocks--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
    .blocks--4 { grid-template-columns: 1fr; }
}

/* -- Map: clickable top-airport rows --------------------------------------- */
.bar-row--link {
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.bar-row--link:hover,
.bar-row--link:focus-visible {
    background: var(--surface-2, rgba(255, 255, 255, 0.05));
    outline: none;
}

/* -- Airport detail drawer (reuses .airline-drawer shell) ------------------ */
#airport-map { height: 100%; width: 100%; }
.airline-drawer__stats-2 { grid-template-columns: repeat(2, 1fr); }
.airport-detail__note {
    margin: 0;
    padding: 0.5rem 1.25rem;
    font-size: 0.775rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.airport-score--good { color: var(--success); }
.airport-score--ok   { color: #F59E0B; }
.airport-score--poor { color: var(--danger); }
.airport-detail {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.airport-detail__codes {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.airport-detail__badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 5px;
    background: var(--accent);
    color: #fff;
}
.airport-detail__badge--icao {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.airport-detail__name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.airport-detail__place {
    margin: 0.2rem 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.airport-detail__chart-title {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
}


/* =========================================================================
   Aircraft page — type cards, type list, detail view
   ========================================================================= */

/* Reusable aircraft image box (fallback chain handled in aircraft-image.js) */
.aircraft-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.aircraft-img__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.aircraft-img--card {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 0.25rem 0 0.4rem;
}
.aircraft-img--lg {
    width: 100%;
    aspect-ratio: 16 / 9;
}
.aircraft-img--thumb {
    flex: 0 0 auto;
    width: 72px;
    height: 46px;
}
/* Generic placeholder (grey box + plane glyph) injected on total image failure */
.aircraft-img--placeholder { background: var(--surface-2); }
.aircraft-img__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.aircraft-img__placeholder svg {
    width: 42%;
    max-width: 64px;
    height: auto;
    fill: var(--text-muted);
    opacity: 0.45;
}

/* Centered stat card + big uppercase registration */
.stat-card--center { align-items: center; text-align: center; }
.aircraft-card .aircraft-img { width: 100%; }
.aircraft-reg {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Row-3 type list */
.aircraft-list { display: flex; flex-direction: column; }
.aircraft-list__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
.aircraft-list__row:last-child { border-bottom: none; }
.aircraft-list__row:hover { background: var(--surface-2); }
.aircraft-list__name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aircraft-list__icao {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}
.aircraft-list__flights {
    flex: 0 0 auto;
    width: 92px;
    text-align: right;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Detail view */
.aircraft-detail__back { align-self: flex-start; margin-bottom: 0.75rem; }
.aircraft-detail__image { display: flex; align-items: center; justify-content: center; }
.aircraft-detail__image .aircraft-img { width: 100%; }

.spec-list { display: flex; flex-direction: column; gap: 0; margin: 0; }
.spec-list__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
}
.spec-list__row:last-child { border-bottom: none; }
.spec-list__row dt { color: var(--text-muted); font-size: 0.9rem; }
.spec-list__row dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.spec-list__row dd small { font-weight: 400; }

.reg-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}
.reg-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.reg-list__reg {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.reg-list__flights { color: var(--text-muted); font-size: 0.85rem; }

@media (max-width: 560px) {
    .aircraft-list__icao { display: none; }
}


/* Record stat cards (Aircraft page) — Routes-style: bold grey title, blue
   record value, thin grey detail below. */
.stat-card--record .stat-card__label { font-weight: 700; color: var(--text-muted); }
.stat-card--record .stat-card__value { color: var(--accent); }
.stat-card--record .stat-card__sub   { font-weight: 400; color: var(--text-muted); }

/* Oversized value so the box reads as a single big figure (types count + reg). */
.stat-card__value--xl {
    font-size: clamp(2.2rem, 6.5vw, 3.2rem);
    line-height: 1.05;
}
.aircraft-reg {
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}


/* Timezone hint shown inline in the add-flight time-field labels */
.field__tz {
    font-weight: 400;
    font-size: 0.78rem;
    color: var(--accent);
    margin-left: 0.35rem;
    letter-spacing: 0.01em;
}
.field__tz:empty { display: none; }


/* =========================================================================
   Flight ratings — collapsible add-flight section + reusable star control
   ========================================================================= */
.rating-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.rating-section__summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    -webkit-user-select: none;
    user-select: none;
}
.rating-section__summary::-webkit-details-marker { display: none; }
.rating-section__title { font-weight: 700; }
.rating-section__hint { color: var(--text-muted); font-size: 0.8rem; }
.rating-section__chevron {
    width: 18px; height: 18px; margin-left: auto;
    fill: none; stroke: var(--text-muted); stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    transition: transform 0.2s ease;
}
.rating-section[open] .rating-section__chevron { transform: rotate(180deg); }
.rating-section__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.25rem 1.5rem;
    padding: 0.25rem 1.25rem 1.25rem;
}

.star-rating {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
}
.star-rating__label { color: var(--text-muted); font-size: 0.9rem; }
.star-rating__control { display: inline-flex; align-items: center; gap: 0.05rem; }
.star-rating__star {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    line-height: 0;
    border-radius: 4px;
    color: inherit;
}
.star-rating__svg {
    width: 22px;
    height: 22px;
    fill: rgba(255, 255, 255, 0.16);
    transition: fill 0.12s ease;
}
.star-rating__star.is-on .star-rating__svg { fill: var(--accent); }
.star-rating__star.is-hover .star-rating__svg { fill: #7FA9FF; }
.star-rating__star:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.star-rating__clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1;
    margin-left: 0.35rem;
    padding: 0 0.25rem;
}
.star-rating__clear:hover { color: var(--text); }
.star-rating__num {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.4rem;
    font-variant-numeric: tabular-nums;
}

/* Read-only stars (flight detail view) use spans, not buttons. */
span.star-rating__star { cursor: default; display: inline-block; }

/* ==========================================================================
   Flight sharing — dialog, share table, attribution
   ========================================================================== */

/* view-flight-bar: group Share + Edit together on the right */
.view-flight-bar { justify-content: space-between; }
.view-flight-bar__right { display: flex; gap: 0.5rem; align-items: center; }

/* Native <dialog> share modal */
.share-dialog {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: min(480px, calc(100vw - 2rem));
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    /* Centre on viewport */
    position: fixed;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    margin: 0;
}
.share-dialog::backdrop {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
}
.share-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.share-dialog__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}
.share-dialog__close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.share-dialog__close:hover { color: var(--text); }
.share-dialog__hint {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0 0 1rem;
}
.share-dialog__expiry {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
}
.share-dialog__legend {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    padding: 0 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.share-radio {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1.25rem;
    cursor: pointer;
    font-size: 0.95rem;
}
.share-dialog__create { width: 100%; justify-content: center; margin-bottom: 0; }
.share-dialog__result { margin-top: 1.25rem; }
.share-dialog__url-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}
.share-dialog__url-row {
    display: flex;
    gap: 0.5rem;
}
.share-dialog__url-input { flex: 1; min-width: 0; font-size: 0.875rem; }
.share-dialog__copy { flex-shrink: 0; }
.share-dialog__expires-note {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.5rem 0 0;
}
.share-dialog__error { margin-top: 0.75rem; }

/* Profile page — shared links table */
.share-table-wrap { overflow-x: auto; }
.share-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.share-table th,
.share-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.share-table th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.share-table tbody tr:last-child td { border-bottom: none; }
.share-table__link { color: var(--accent); text-decoration: none; }
.share-table__link:hover { text-decoration: underline; }
.share-table__expired { color: var(--text-muted); font-style: italic; }
.share-table__row--expired td { opacity: 0.55; }
.share-table__revoke-form { margin: 0; }
.share-table__revoke { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

/* Public share page — attribution footer */
.share-attribution {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.share-attribution__link { color: var(--accent); text-decoration: none; }
.share-attribution__link:hover { text-decoration: underline; }

/* =========================================================================
   Ecology page
   ========================================================================= */
.ecology-toggle-row {
    margin-bottom: 1.25rem;
}
.ecology-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
}
.ecology-toggle__input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
.ecology-toggle__hint {
    margin: 0.65rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 58rem;
    line-height: 1.5;
}
.ecology-impact-line {
    color: var(--accent);
}
.ecology-coverage {
    margin: -0.5rem 0 1.25rem;
    font-size: 0.85rem;
}
.ecology-disclaimer {
    margin-top: 0.5rem;
}
.ecology-disclaimer p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.65;
}
.ecology-disclaimer p:last-child { margin-bottom: 0; }

/* Widen the logo slot in the aircraft-type bars to fit the thumbnail image. */
#co2-aircraft-bars .airline-bar__logo {
    width: 80px;
}
#co2-aircraft-bars .airline-bar__logo a {
    display: block;
    line-height: 0;
}
#co2-aircraft-bars .airline-bar__logo a:hover {
    opacity: 0.8;
}

/* Route CO2 bars: no logo column, main block fills full width. */
#co2-route-bars .airline-bar__main {
    padding-left: 0;
}

/* ---- Annual budget comparison meter ------------------------------------ */
.ecology-budget {
    margin-bottom: 1.5rem;
}
.ecology-budget__intro {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.ecology-budget-meter {
    margin-bottom: 1rem;
}
.ecology-budget-track {
    position: relative;
    height: 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: visible;
}
.ecology-budget-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--accent, #4F8CFF);
    min-width: 4px;
    max-width: calc(100% - 2px);
    transition: width 0.5s ease;
}
.ecology-budget-mark {
    position: absolute;
    top: -5px;
    bottom: -5px;
    width: 2px;
    border-radius: 2px;
    transform: translateX(-50%);
    pointer-events: none;
}
.ecology-budget-mark--climate  { background: rgba(255, 255, 255, 0.55); }
.ecology-budget-mark--national { background: rgba(255, 200, 60, 0.75); }
.ecology-budget-legend {
    position: relative;
    height: 1.4em;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-muted);
}
.ecology-budget-legend span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}
.ecology-budget__stats {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ---- Day / night split ------------------------------------------------- */
.ecology-daynight-split {
    margin: 0.5rem 0 0.75rem;
}
.ecology-daynight-bar {
    display: flex;
    height: 20px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}
.ecology-daynight-bar__day {
    background: var(--accent, #4F8CFF);
    transition: width 0.4s ease;
    min-width: 0;
}
.ecology-daynight-bar__night {
    background: #6B3FA0;
    transition: width 0.4s ease;
    min-width: 0;
}
.ecology-daynight-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.ecology-daynight-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 0.25rem;
    vertical-align: middle;
}
.ecology-daynight-dot--day   { background: var(--accent, #4F8CFF); }
.ecology-daynight-dot--night { background: #6B3FA0; }
.ecology-daynight__note {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* =========================================================================
   Flight-length histogram (distances.php)
   ========================================================================= */
.dist-hist-label {
    margin-bottom: 1.25rem;
}
.dist-histogram {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.dist-histogram__row {
    display: grid;
    grid-template-columns: 12rem 1fr 3.5rem 3.5rem;
    align-items: center;
    gap: 0.75rem;
}
.dist-histogram__label {
    font-size: 0.88rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dist-histogram__bar-wrap {
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
}
.dist-histogram__bar {
    height: 100%;
    background: var(--accent-grad);
    border-radius: 4px;
    min-width: 0;
    transition: width 0.4s ease;
}
.dist-histogram__count {
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}
.dist-histogram__pct {
    text-align: right;
    font-size: 0.82rem;
    color: var(--text-muted);
}
@media (max-width: 560px) {
    .dist-histogram__row {
        grid-template-columns: 1fr 2.5rem 2.5rem;
        grid-template-rows: auto auto;
    }
    .dist-histogram__label { grid-column: 1 / -1; }
    .dist-histogram__bar-wrap { display: none; }
}

/* =========================================================================
   Calendar heatmap (routes.php)
   ========================================================================= */
.heatmap-card {
    padding: 1.5rem 1.75rem;
    overflow: hidden;
}
.heatmap-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.heatmap-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.heatmap-year-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.heatmap-year-label {
    font-weight: 700;
    font-size: 1rem;
    min-width: 3rem;
    text-align: center;
    color: var(--text);
}
.heatmap-year-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.55rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background var(--transition);
}
.heatmap-year-btn:hover:not(:disabled) { background: rgba(255,255,255,0.12); }
.heatmap-year-btn:disabled { opacity: 0.35; cursor: default; }
.heatmap-mode-toggle,
.heatmap-view-toggle {
    display: flex;
    gap: 0.3rem;
}
.heatmap-mode-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 0.2rem 0.75rem;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background var(--transition), color var(--transition);
}
.heatmap-mode-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.heatmap-mode-btn--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.heatmap-wrap {
    position: relative;
    overflow-x: auto;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}
.heatmap-months {
    display: grid;
    grid-auto-columns: 14px;
    grid-auto-flow: column;
    gap: 2px;
    margin-left: 30px;
    margin-bottom: 4px;
}
.heatmap-month-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}
.heatmap-grid {
    display: flex;
    gap: 2px;
    align-items: flex-start;
}
.heatmap-dow-labels {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 28px;
    margin-right: 2px;
}
.heatmap-dow-labels span {
    font-size: 0.62rem;
    color: var(--text-muted);
    height: 14px;
    line-height: 14px;
    user-select: none;
}
.heatmap-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.heatmap-cell {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    cursor: default;
    transition: opacity 0.15s;
}
.heatmap-cell--empty { opacity: 0; cursor: default; }
.heatmap-cell[role="button"] { cursor: pointer; }
.heatmap-cell[role="button"]:hover { opacity: 0.8; outline: 1px solid rgba(255,255,255,0.4); }
.heatmap-cell--0 { background: rgba(255,255,255,0.06); }
.heatmap-cell--1 { background: #1a4e8f; }
.heatmap-cell--2 { background: #2a72cc; }
.heatmap-cell--3 { background: #4F8CFF; }
.heatmap-cell--4 { background: #22D3EE; }

/* Single-month view: fewer columns, so cells can be larger/easier to hit. */
.heatmap-grid--month .heatmap-cell { width: 26px; height: 26px; border-radius: 4px; }
.heatmap-grid--month .heatmap-dow-labels span { height: 26px; line-height: 26px; font-size: 0.68rem; }
.heatmap-grid--month .heatmap-col { gap: 3px; }
.heatmap-grid--month.heatmap-grid { gap: 3px; }
.heatmap-popover {
    position: absolute;
    z-index: 200;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    min-width: 160px;
    max-width: 260px;
    box-shadow: var(--shadow);
    color: var(--text);
}
.heatmap-pop-flight {
    display: block;
    padding: 0.2rem 0;
    color: var(--accent);
    text-decoration: none;
}
.heatmap-pop-flight:hover { text-decoration: underline; }
.heatmap-pop-flight small { color: var(--text-muted); font-size: 0.8em; }
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.heatmap-legend__cells {
    display: flex;
    gap: 3px;
    align-items: center;
}

/* =========================================================================
   Year in Review page (year-review.php)
   ========================================================================= */
/* =========================================================================
   Year in Review — slide-based layout
   ========================================================================= */

/* Page shell: fills remaining viewport below the sticky navbar */
.yr-page {
    padding: 0;
    min-height: calc(100dvh - 56px);
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* Top bar: year selector + progress bar */
.yr-top {
    flex: 0 0 auto;
    padding: 0.65rem 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.yr-year-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.yr-year-label {
    font-weight: 700;
    font-size: 1rem;
}
.yr-nav__btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background var(--transition);
    text-decoration: none;
    display: inline-block;
    line-height: 1.6;
}
.yr-nav__btn:hover:not([aria-disabled]) { background: rgba(255,255,255,0.13); }
.yr-nav__btn[aria-disabled] { opacity: 0.28; pointer-events: none; }
.yr-nav__sel {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.65rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

/* Thin progress bar */
.yr-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.09);
    border-radius: 2px;
    overflow: hidden;
}
.yr-progress-fill {
    height: 100%;
    background: var(--accent-grad);
    border-radius: 2px;
    transition: width 0.35s ease;
    width: 0%;
}

/* Slide track: clips horizontal slide transitions */
.yr-slider {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

/* Individual slide */
.yr-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem 4.5rem;
    overflow-y: auto;
    pointer-events: none;
    transform: translateX(100%);
    opacity: 1;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.yr-slide.is-active { pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
    .yr-slide {
        transform: none;
        transition: opacity 0.2s ease;
    }
}

/* Slide content wrapper */
.yr-slide__inner {
    max-width: 580px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    position: relative;
    z-index: 1;
}

/* Slide text elements */
.yr-slide__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}
.yr-slide__headline {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.1rem 0 0;
}
.yr-slide__headline--sm { font-size: 2rem; }
.yr-slide__value {
    font-size: 4.8rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--text);
}
.yr-slide__value--grad {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.yr-slide__value--route { font-size: 3.4rem; letter-spacing: 0.02em; }
.yr-slide__value--name  { font-size: 2.2rem; font-weight: 800; }
.yr-slide__value--al {
    font-size: 2.2rem;
    font-weight: 800;
    /* color set via inline style; no -webkit-text-fill-color override here */
}
.yr-slide__sub {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}
.yr-slide__compare {
    font-size: 0.9rem;
    color: var(--accent-2);
    margin-top: 0.15rem;
}
.yr-small {
    font-size: 0.42em;
    font-weight: 600;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted);
}

/* Per-slide background accents */
.yr-slide--opening {
    background: radial-gradient(ellipse at 50% 115%, rgba(79,140,255,0.16) 0%, transparent 58%);
}
.yr-slide--achievements {
    background: radial-gradient(ellipse at 50% 115%, rgba(251,191,36,0.14) 0%, transparent 55%);
    overflow: hidden;
}
.yr-slide--recap {
    background: radial-gradient(ellipse at 50% 110%, rgba(79,140,255,0.11) 0%, transparent 55%);
}

/* Flying plane decoration (opening + airline slides) */
.yr-slide__deco-plane {
    position: absolute;
    top: 12%;
    left: -8%;
    font-size: 1.6rem;
    opacity: 0.12;
    pointer-events: none;
    user-select: none;
    animation: yr-plane-fly 7s ease-in-out infinite;
}
.yr-slide__deco-plane::after { content: '✈'; }
@keyframes yr-plane-fly {
    0%   { left: -8%;  transform: translateY(0)     rotate(0deg);  }
    50%  {             transform: translateY(-14px)  rotate(-3deg); }
    100% { left: 108%; transform: translateY(0)     rotate(0deg);  }
}
@media (prefers-reduced-motion: reduce) {
    .yr-slide__deco-plane { animation: none; left: 50%; transform: translateX(-50%); }
}

/* Slide navigation arrows (sit inside the slider) */
.yr-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}
.yr-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.yr-nav-btn:disabled             { opacity: 0.22; cursor: default; }
.yr-nav-btn--prev { left:  0.75rem; }
.yr-nav-btn--next { right: 0.75rem; }

/* Progress dots */
.yr-dots {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 0.55rem 0 0.9rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.yr-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}
.yr-dot.is-active {
    background: var(--accent);
    transform: scale(1.45);
}

/* Airline logo wrapper */
.yr-slide__logo-wrap { margin-bottom: 0.5rem; }

/* Aircraft image */
.yr-slide__aircraft-img  { margin-bottom: 0.5rem; }
.yr-aircraft-img         { max-width: 280px; }
.yr-aircraft-img .aircraft-img__img {
    max-height: 110px;
    max-width: 280px;
    object-fit: contain;
}

/* Confetti canvas (achievements slide) */
.yr-confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Countries chip list */
.yr-countries-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.4rem;
}
.yr-country-chip {
    background: rgba(255,255,255,0.07);
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.yr-country-chip--new {
    background: rgba(79,140,255,0.18);
    color: var(--accent);
}

/* Companions list */
.yr-companions-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 420px;
}
.yr-companion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
}
.yr-companion__name  { font-weight: 600; color: var(--text); }
.yr-companion__count { font-size: 0.85rem; color: var(--text-muted); }

/* Achievement badge grid */
.yr-ach-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
}
.yr-ach-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    min-width: 68px;
}
.yr-ach-badge__name {
    font-size: 0.68rem;
    color: var(--text-muted);
    max-width: 80px;
    line-height: 1.3;
    text-align: center;
    word-break: break-word;
}

/* Recap grid on closing slide */
.yr-recap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    width: 100%;
    margin: 0.65rem 0 1.1rem;
}
.yr-recap-item {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.9rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.yr-recap-item__value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}
.yr-recap-item__label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Share panel on closing slide */
.yr-share-wrap {
    text-align: center;
    width: 100%;
}
.yr-share-panel {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-top: 0.75rem;
    text-align: left;
}
.yr-share-panel__label { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.5rem; }
.yr-share-opts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.yr-share-result {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.yr-share-result input { flex: 1; min-width: 0; }

/* Responsive */
@media (max-width: 640px) {
    .yr-slide__headline  { font-size: 2.5rem; }
    .yr-slide__value     { font-size: 3.4rem; }
    .yr-slide__value--route { font-size: 2.4rem; }
    .yr-slide__value--name, .yr-slide__value--al { font-size: 1.7rem; }
    .yr-nav-btn          { width: 40px; height: 40px; font-size: 1.05rem; }
    .yr-nav-btn--prev    { left:  0.3rem; }
    .yr-nav-btn--next    { right: 0.3rem; }
    .yr-recap-grid       { gap: 0.55rem; }
}

/* =========================================================================
   Dashboard — seasonal Year in Review banner
   ========================================================================= */
.db-yr-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(79,140,255,0.18) 0%, rgba(34,211,238,0.14) 100%);
    border: 1px solid rgba(79,140,255,0.3);
    text-decoration: none;
    color: var(--text);
    transition: background var(--transition), border-color var(--transition);
}
.db-yr-banner:hover {
    background: linear-gradient(135deg, rgba(79,140,255,0.28) 0%, rgba(34,211,238,0.22) 100%);
    border-color: rgba(79,140,255,0.5);
    color: var(--text);
}
.db-yr-banner__icon {
    font-size: 1.6rem;
    flex: 0 0 auto;
    line-height: 1;
}
.db-yr-banner__text {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.45;
}
.db-yr-banner__cta {
    flex: 0 0 auto;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
}
@media (max-width: 480px) {
    .db-yr-banner { flex-wrap: wrap; }
    .db-yr-banner__cta { width: 100%; }
}

/* =========================================================================
   Dashboard — pending companion-flight notification banner (§3)
   ========================================================================= */
.companion-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    flex-wrap: wrap;
}
.companion-banner__icon { font-size: 1.6rem; flex: 0 0 auto; line-height: 1; }
.companion-banner__text { flex: 1 1 240px; font-size: 0.95rem; line-height: 1.45; }
.companion-banner__actions { display: flex; gap: 0.5rem; flex: 0 0 auto; }

/* =========================================================================
   Year picker row on profile.php
   ========================================================================= */
.yr-picker-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.yr-year-sel {
    flex: 0 0 auto;
    width: auto;
}

/* =========================================================================
   Achievements (profile.php)
   ========================================================================= */
.ach-card { }
.ach-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
}
.ach-row {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.ach-row--wrap {
    flex-wrap: wrap;
    overflow-x: visible;
}
.ach-category {
    margin-bottom: 1.5rem;
}
.ach-category:last-child { margin-bottom: 0; }
.ach-category__title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}
.ach-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 88px;
    max-width: 96px;
    flex: 0 0 88px;
    gap: 0.25rem;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.ach-badge:hover { background: rgba(255,255,255,0.05); }
.ach-badge--locked { opacity: 0.45; filter: grayscale(0.7); }
.ach-badge--unlocked { opacity: 1; filter: none; }
.ach-badge__img-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
}
.ach-badge__placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79,140,255,0.2), rgba(34,211,238,0.2));
    border-radius: 50%;
}
.ach-badge__name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}
.ach-badge__date {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.ach-badge__progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.25rem;
}
.ach-badge__progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}
.ach-badge__progress-label {
    font-size: 0.62rem;
    color: var(--text-muted);
}
.ach-all {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

/* =========================================================================
   Achievements full page (achievements.php)
   ========================================================================= */
.ach-page-back {
    display: inline-block;
    margin-bottom: 0.75rem;
}
.ach-overall-progress {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.ach-overall-progress__bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}
.ach-cat-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}
.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.ach-badge--page {
    min-width: 0;
    max-width: none;
    flex: none;
    width: 100%;
}
.ach-badge__img-wrap--lg {
    width: 68px;
    height: 68px;
}
.ach-badge__desc {
    font-size: 0.63rem;
    color: var(--text-muted);
    line-height: 1.35;
    text-align: center;
}

/* =========================================================================
   Friends (profile.php + accept-friend.php)
   ========================================================================= */

/* Friend list within profile card */
.friend-list__heading {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 0.75rem;
}
.friend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.friend-row:last-child { border-bottom: none; }
.friend-row__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}
.friend-row__name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}
.friend-row__since {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.friend-row__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
}
.friend-row__share-form { margin: 0; }
.friend-row__share-toggle {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.friend-row__invite-url {
    font-size: 0.78rem;
    padding: 0.3rem 0.6rem;
}

/* Invite generation form */
.invite-form__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.radio-inline {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.88rem;
    color: var(--text);
    cursor: pointer;
}
.radio-inline input { cursor: pointer; accent-color: var(--accent); }

/* Generated invite result */
.invite-result {
    background: rgba(79,140,255,0.07);
    border: 1px solid rgba(79,140,255,0.25);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.invite-result__row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.invite-result__row .field__input {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
}

/* =========================================================================
   Companion indicator in flight rows (flights.php / my flights)
   ========================================================================= */
.companions-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    margin-left: 0.45rem;
    vertical-align: middle;
    white-space: nowrap;
}
.companions-badge svg {
    flex-shrink: 0;
    stroke: var(--accent);
}

/* =========================================================================
   Generic small status badge (upcoming flights, etc.)
   ========================================================================= */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    vertical-align: middle;
    margin-left: 0.4rem;
    white-space: nowrap;
}
.badge--upcoming {
    color: #FDE68A;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* =========================================================================
   Traveled-with field on add-flight.php
   ========================================================================= */
.companions-check-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
    margin-bottom: 0.5rem;
}
.companion-check {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    font-size: 0.88rem;
}
.companion-check:hover { background: rgba(255,255,255,0.09); }
.companion-check input[type=checkbox] {
    accent-color: var(--accent);
    cursor: pointer;
}
.companion-check input:checked ~ .companion-check__name { color: var(--accent); }
.companion-check__name {
    font-weight: 500;
    color: var(--text);
    transition: color var(--transition);
}
