/* =====================================================================
   Tree Vision Stereo Benchmark
   A KITTI-descended academic theme: dense, legible, no framework.

   Sections
     1. Tokens
     2. Base elements
     3. Site chrome (header / nav / footer)
     4. Layout
     5. Components (cards, stats, tables, buttons, forms, badges)
     6. Dataset & gallery
     7. Member profiles
     8. Admin back office
     9. Responsive
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------- */

:root {
    --bg: #ffffff;
    --fg: #1d2321;
    --muted: #61706a;
    --faint: #8b978f;

    --border: #dfe3df;
    --border-strong: #c3cbc4;
    --panel: #f8faf7;
    --panel-alt: #f1f4ef;

    --link: #14607a;
    --link-hover: #0b4356;

    --accent: #2f7d43;
    --accent-dark: #1e5c2f;
    --accent-soft: #e8f2e9;
    --accent-line: #cfe3d3;

    --ink: #16211b;          /* header background */
    --ink-2: #1f2e26;        /* credit strip */
    --ink-fg: #f3f6f2;

    --success: #2f7d43;
    --warning: #b4690e;
    --danger: #b3261e;
    --info: #14607a;

    --chart-1: #2f7d43;
    --chart-2: #14607a;
    --chart-3: #b4690e;
    --chart-4: #6b4fa0;
    --chart-5: #a03d5d;
    --chart-6: #3f7d7d;

    --shadow-sm: 0 1px 2px rgba(20, 32, 26, 0.06);
    --shadow-md: 0 2px 10px rgba(20, 32, 26, 0.08);
    --radius: 6px;
    --radius-lg: 10px;

    --wrap: 1220px;
    --sans: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", "Consolas", "SF Mono", "Menlo", monospace;

    --space: 8px;
}

* { box-sizing: border-box; }

/* ---------------------------------------------------------------------
   2. Base elements
   --------------------------------------------------------------------- */

html { scroll-behavior: smooth; scroll-padding-top: 20px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.55em; line-height: 1.25; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -0.4px; }
h2 {
    font-size: 20px;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--accent-line);
}
h3 { font-size: 16px; }
h4 { font-size: 14px; color: var(--muted); }

p { margin: 0 0 0.9em; }
ul, ol { margin: 0 0 0.9em; padding-left: 22px; }
li { margin: 2px 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

code, pre, kbd { font-family: var(--mono); }
code {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 0.88em;
    /* Long paths and URLs must wrap rather than widen the page. */
    overflow-wrap: anywhere;
}
pre {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 13px 15px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

img { max-width: 100%; }

::selection { background: var(--accent-soft); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------------------------------------------------------------------
   3. Site chrome
   --------------------------------------------------------------------- */

.container {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 24px;
}

.site-header {
    background: linear-gradient(135deg, var(--ink) 0%, #223b2c 100%);
    color: var(--ink-fg);
    border-bottom: 3px solid var(--accent);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
}
.site-title { font-size: 23px; font-weight: 600; letter-spacing: -0.3px; }
.site-title a { color: var(--ink-fg); }
.site-title a:hover { color: #fff; text-decoration: none; }
.site-subtitle {
    color: #b9c9bf;
    font-size: 12.5px;
    margin-top: 5px;
    max-width: 72ch;
}
.site-subtitle a { color: #cfe3d3; }

.site-logos { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-badge {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 7px 11px;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #eaf2ec;
    white-space: nowrap;
    transition: background 120ms ease, border-color 120ms ease;
}
a.logo-badge:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    text-decoration: none;
}

.site-creditbar {
    background: var(--ink-2);
    color: #c4d2c9;
    font-size: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}
.site-creditbar .container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 7px;
    padding-bottom: 7px;
}
.site-creditbar a { color: #a9ccb2; }
.site-creditbar .auth-bar { display: flex; gap: 14px; align-items: center; }
.site-creditbar .user-name { color: #fff; font-weight: 500; }

.site-nav {
    background: var(--panel-alt);
    border-bottom: 1px solid var(--border-strong);
    position: sticky;
    top: 0;
    z-index: 20;
}
.site-nav .container { display: flex; align-items: stretch; padding: 0 24px; }
.nav-links { display: flex; flex-wrap: wrap; }
.site-nav a {
    display: block;
    padding: 11px 15px;
    color: #33413a;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
    border-bottom: 3px solid transparent;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.site-nav a:hover {
    background: #fff;
    color: var(--accent-dark);
    text-decoration: none;
}
.site-nav a.active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
    background: #fff;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    align-self: center;
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 6px 11px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    color: #33413a;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--panel);
    margin-top: 56px;
    padding: 26px 24px;
    color: var(--muted);
    font-size: 12.5px;
}
.footer-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    align-items: center;
}
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------------
   4. Layout
   --------------------------------------------------------------------- */

.page {
    max-width: var(--wrap);
    margin: 28px auto 40px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 32px;
}
.page.single { grid-template-columns: minmax(0, 1fr); }
.page.narrow { max-width: 560px; }

aside.sidebar {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 16px;
    align-self: start;
    position: sticky;
    top: 62px;
    font-size: 13px;
}
aside.sidebar h3 {
    font-size: 11px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--faint);
    margin: 0 0 8px;
    font-weight: 600;
}
aside.sidebar h3:not(:first-child) { margin-top: 18px; }
aside.sidebar ul { list-style: none; padding: 0; margin: 0; }
aside.sidebar li { margin: 1px 0; }
aside.sidebar a {
    display: block;
    padding: 5px 9px;
    border-radius: var(--radius);
    color: #2c3a33;
    border-left: 2px solid transparent;
}
aside.sidebar a:hover {
    background: #fff;
    text-decoration: none;
    border-left-color: var(--accent-line);
}
aside.sidebar a.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-left-color: var(--accent);
    font-weight: 600;
}

main.content { min-width: 0; }
section.block { margin-bottom: 34px; }
section.block > h2 { margin-bottom: 14px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }
.grid-2 > .card, .grid-3 > .card, .split > .card { margin-bottom: 0; }

.stack-gap > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

/* ---------------------------------------------------------------------
   5. Components
   --------------------------------------------------------------------- */

.card {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
}
.card > :last-child { margin-bottom: 0; }
.card.plain { background: #fff; }
.card.tight { padding: 13px 15px; }
.card h3:first-child, .card h2:first-child { margin-top: 0; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.card-head h3 { margin: 0; }

.hero {
    background:
        radial-gradient(1200px 300px at 15% -20%, #e3f0e5 0%, transparent 70%),
        linear-gradient(135deg, #f4f9f3 0%, #e9f1e6 100%);
    border-color: var(--accent-line);
}
.hero-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center; }
.hero-figure { margin: 0; }
.hero-figure img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: #101512;
    box-shadow: var(--shadow-md);
}
.hero-figure figcaption {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    font-family: var(--mono);
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.1px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 6px;
}
.lede { font-size: 15.5px; color: #2a3630; }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 12px;
    margin: 0 0 20px;
}
.stat {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
}
.stat .v {
    display: block;
    font-size: 27px;
    font-weight: 600;
    color: var(--accent-dark);
    font-family: var(--mono);
    letter-spacing: -1px;
    line-height: 1.15;
}
.stat .l {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.stat .sub { display: block; font-size: 11.5px; color: var(--faint); margin-top: 4px; }

.kvs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 20px;
    font-size: 13.5px;
    margin: 0;
}
.kvs dt { color: var(--muted); }
.kvs dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-word; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}
.table-scroll { overflow-x: auto; margin: 0 -2px; }
table.data th, table.data td {
    padding: 7px 11px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
table.data thead th {
    background: var(--panel-alt);
    color: #33413a;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
    position: sticky;
    top: 0;
}
table.data tbody tr:hover { background: var(--accent-soft); }
table.data td.num, table.data th.num { font-family: var(--mono); text-align: right; }
table.data td.nowrap { white-space: nowrap; }
table.data tfoot td { font-weight: 600; background: var(--panel-alt); }

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent-dark);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    cursor: pointer;
    text-align: center;
    transition: background 120ms ease, transform 60ms ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--fg); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--panel-alt); color: var(--fg); }
.btn.danger { background: var(--danger); border-color: #8c1c16; }
.btn.danger:hover { background: #8c1c16; }
.btn.large { padding: 12px 24px; font-size: 15px; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

form.stacked label {
    display: block;
    margin: 14px 0 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: #33413a;
}
form.stacked label:first-child { margin-top: 0; }
form.stacked input[type="text"],
form.stacked input[type="email"],
form.stacked input[type="url"],
form.stacked input[type="number"],
form.stacked input[type="password"],
form.stacked input[type="file"],
form.stacked textarea,
form.stacked select,
.input {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--fg);
}
form.stacked textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
form.stacked input:focus, form.stacked textarea:focus, form.stacked select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 125, 67, 0.15);
}
form.stacked .hint { font-size: 11.5px; color: var(--faint); margin: 4px 0 0; }
form.stacked .row-checkbox {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 16px 0;
    font-size: 13px;
    font-weight: 400;
}
form.stacked .row-checkbox input { margin-top: 3px; }
form.stacked .actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }

.filter-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}
.filter-bar select, .filter-bar input {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: var(--fg);
    /* A select sizes itself to its widest option; country names are long. */
    max-width: 100%;
}

.flash-list { margin: 0 0 18px; }
.flash {
    padding: 11px 15px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-left-width: 4px;
}
.flash.info { background: #e6f2f6; color: #0b4356; border-color: #b8dbe6; border-left-color: var(--info); }
.flash.success { background: #e9f4ea; color: #1e5c2f; border-color: #c3e2c8; border-left-color: var(--success); }
.flash.warning { background: #fdf2e2; color: #7d4906; border-color: #f3ddb6; border-left-color: var(--warning); }
.flash.danger { background: #fdeceb; color: #8c1c16; border-color: #f4c9c6; border-left-color: var(--danger); }

.badge {
    display: inline-block;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    color: var(--accent-dark);
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-family: var(--mono);
    white-space: nowrap;
}
.badge.admin { background: #fdf2e2; border-color: #f3ddb6; color: #7d4906; }
.badge.neutral { background: var(--panel-alt); border-color: var(--border); color: var(--muted); }
.badge.danger { background: #fdeceb; border-color: #f4c9c6; color: #8c1c16; }
.badge.info { background: #e6f2f6; border-color: #b8dbe6; color: #0b4356; }

.chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 12.5px;
    color: #33413a;
}

.pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
    flex-wrap: wrap;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.empty {
    text-align: center;
    padding: 34px 20px;
    color: var(--faint);
    font-size: 13.5px;
}
.empty strong { display: block; color: var(--muted); font-size: 15px; margin-bottom: 4px; }

/* Inline proportion bar used inside analytics tables. */
.bar {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: var(--accent);
    min-width: 2px;
}
.bar-track { background: var(--panel-alt); border-radius: 3px; width: 100%; min-width: 60px; }

/* ---------------------------------------------------------------------
   6. Dataset & gallery
   --------------------------------------------------------------------- */

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.thumb {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}
.thumb:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
.thumb img {
    display: block;
    width: 100%;
    height: 116px;
    object-fit: cover;
    background: #101512;
}
.thumb .meta {
    padding: 6px 9px;
    font-size: 11px;
    color: #4a574f;
    font-family: var(--mono);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modality {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.modality h3 {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.modality h3 .count {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--faint);
    font-weight: 400;
}
.modality .desc { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.modality details { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; }
.modality details summary { cursor: pointer; color: var(--link); font-size: 12.5px; }
.modality .files {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    columns: 2;
    column-gap: 20px;
    font-family: var(--mono);
    font-size: 12px;
}
.modality .files li { break-inside: avoid; padding: 1px 0; }

/* The /example showcase */
.gallery { display: grid; gap: 20px; }
.gallery-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}
.gallery-panel:nth-child(even) .gallery-media { order: 2; }
.gallery-media { margin: 0; }
.gallery-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: #101512;
}
.gallery-body h3 { margin-bottom: 6px; }
.gallery-body .desc { color: var(--muted); font-size: 13.5px; }
.file-list { list-style: none; padding: 0; margin: 12px 0 0; font-family: var(--mono); font-size: 12px; }
.file-list li { padding: 3px 0; border-top: 1px dashed var(--border); }

/* Side-by-side stereo pair */
.stereo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stereo-pair figure { margin: 0; }
.stereo-pair img {
    width: 100%;
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    background: #101512;
}
.stereo-pair figcaption {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 5px;
}

/* ---------------------------------------------------------------------
   7. Member profiles
   --------------------------------------------------------------------- */

.contact-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.contact-card img.avatar,
.contact-card .avatar {
    width: 190px;
    height: 190px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-strong);
    background: #eee;
}
.avatar.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 54px;
    font-weight: 600;
    color: var(--accent-dark);
    background: linear-gradient(135deg, #eaf3ea 0%, #cfe3d3 100%);
    letter-spacing: 3px;
    user-select: none;
}
.contact-card h2 { margin-top: 0; border-bottom: 0; padding-bottom: 0; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.team-card {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}
.team-card h3 { margin: 0 0 4px; font-size: 15px; }
.team-card p { margin: 4px 0 0; font-size: 13px; }

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.member-card {
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.member-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); text-decoration: none; }
.member-card .avatar, .member-card img.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 19px;
    letter-spacing: 1px;
    object-fit: cover;
    border: 1px solid var(--border-strong);
}
.member-card .name { font-weight: 600; color: var(--fg); }
.member-card .sub { font-size: 12.5px; color: var(--muted); }

.resume-section { margin-bottom: 22px; }
.resume-section h3 {
    font-size: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--faint);
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
    margin-bottom: 10px;
}
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
    position: relative;
    padding: 0 0 12px 18px;
    border-left: 2px solid var(--accent-line);
    margin-left: 4px;
}
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
}

/* ---------------------------------------------------------------------
   8. Admin back office
   --------------------------------------------------------------------- */

body.admin { background: #eef1ee; }

.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }

.admin-side {
    background: linear-gradient(180deg, #16211b 0%, #1d3026 100%);
    color: #cfe0d5;
    padding: 20px 0 30px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    /* A column so the "signed in as" panel can sit against the bottom. */
    display: flex;
    flex-direction: column;
}
.admin-brand { padding: 0 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.admin-brand .mark {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.2px;
    display: block;
}
.admin-brand .sub {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f9d8b;
    margin-top: 3px;
}
.admin-nav { padding: 14px 12px; }
.admin-nav .group {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6d8a79;
    padding: 14px 10px 6px;
    font-weight: 700;
}
.admin-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 11px;
    border-radius: var(--radius);
    color: #cfe0d5;
    font-size: 13.5px;
    margin-bottom: 2px;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; text-decoration: none; }
.admin-nav a.active { background: var(--accent); color: #fff; font-weight: 500; }
.admin-nav .ico { width: 17px; text-align: center; font-size: 14px; opacity: 0.9; }

.admin-main { min-width: 0; padding: 0 0 40px; }
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-topbar h1 { margin: 0; font-size: 19px; }
.admin-topbar .crumb { font-size: 12px; color: var(--faint); }
.admin-body { padding: 22px 28px 0; }

.range-picker { display: flex; gap: 2px; background: var(--panel-alt); padding: 3px; border-radius: var(--radius); }
.range-picker a {
    padding: 4px 11px;
    border-radius: 4px;
    font-size: 12.5px;
    color: var(--muted);
}
.range-picker a:hover { background: #fff; text-decoration: none; }
.range-picker a.active { background: var(--accent); color: #fff; font-weight: 500; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 13px;
    margin-bottom: 20px;
}
.kpi {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px 17px;
    box-shadow: var(--shadow-sm);
}
.kpi .label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--faint);
    font-weight: 700;
}
.kpi .value {
    font-size: 28px;
    font-weight: 600;
    font-family: var(--mono);
    letter-spacing: -1.2px;
    margin-top: 5px;
    line-height: 1.1;
    color: var(--ink);
}
.kpi .note { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.kpi.accent .value { color: var(--accent-dark); }
.kpi.blue .value { color: var(--link); }
.kpi.amber .value { color: var(--warning); }

/* minmax(0, …) rather than a bare fr: grid items default to min-width:auto,
   so a wide table inside one would otherwise push the column — and the whole
   page — past the viewport. */
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}
.dash-grid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dash-grid > .card { margin-bottom: 0; }

.chart-wrap { position: relative; height: 262px; }
.chart-wrap.short { height: 210px; }

/* World map */
.map-card { background: #fff; }
.worldmap { width: 100%; display: block; background: #f6f9f7; border-radius: var(--radius); }
.worldmap .land { fill: #dfe6e0; stroke: #fff; stroke-width: 0.4; transition: fill 120ms ease; }
.worldmap .land.has-data { fill: var(--accent); }
.worldmap .land:hover { fill: var(--accent-dark); cursor: pointer; }
.worldmap .bubble { fill: rgba(20, 96, 122, 0.55); stroke: #0b4356; stroke-width: 0.7; }
.map-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 10px;
    flex-wrap: wrap;
}
.map-legend .scale { display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 132px; }
.map-legend .scale i { flex: 1; }
.map-tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--ink);
    color: #fff;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    line-height: 1.45;
    z-index: 60;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 90ms ease;
    white-space: nowrap;
}
.map-tooltip.on { opacity: 1; }
.map-tooltip b { color: #a9e0b8; }

/* Country league table */
.country-row { display: flex; align-items: center; gap: 9px; }
.country-row .flag { font-size: 16px; line-height: 1; }

/* Hour x weekday heat map */
.heat { display: grid; grid-template-columns: 34px repeat(24, minmax(0, 1fr)); gap: 2px; font-size: 9.5px; }
.heat .hlabel { color: var(--faint); font-size: 9.5px; text-align: center; align-self: end; }
.heat .dlabel { color: var(--muted); font-size: 10.5px; text-align: right; padding-right: 5px; align-self: center; }
.heat .cell {
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    background: var(--panel-alt);
    min-height: 11px;
}

.credential-box {
    background: var(--ink);
    color: #d8e6dc;
    border-radius: var(--radius);
    padding: 13px 15px;
    font-family: var(--mono);
    font-size: 12px;
    overflow-x: auto;
    word-break: break-all;
}
.credential-box .k { color: #7f9d8b; display: inline-block; min-width: 118px; }
.credential-box .v { color: #fff; }

.notice {
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    background: #f2f8fa;
    border-radius: var(--radius);
    padding: 12px 15px;
    font-size: 13px;
    color: #33413a;
}
.notice.warn { border-left-color: var(--warning); background: #fdf8ef; }
.notice.danger { border-left-color: var(--danger); background: #fdf3f2; }
.notice > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   9. Responsive
   --------------------------------------------------------------------- */

@media (max-width: 1080px) {
    .dash-grid, .dash-grid.even { grid-template-columns: minmax(0, 1fr); }
    .admin-shell { grid-template-columns: 200px minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .page { grid-template-columns: minmax(0, 1fr); gap: 22px; }
    aside.sidebar { position: static; }
    .hero-split, .split, .grid-2, .grid-3, .field-grid { grid-template-columns: minmax(0, 1fr); }
    .gallery-panel { grid-template-columns: minmax(0, 1fr); }
    .gallery-panel:nth-child(even) .gallery-media { order: 0; }
    .contact-card { grid-template-columns: minmax(0, 1fr); }
    .contact-card img.avatar, .contact-card .avatar { width: 150px; height: 150px; }
    .avatar.avatar-placeholder { font-size: 42px; }
    .site-header .container { flex-direction: column; align-items: flex-start; gap: 14px; }
    .modality .files { columns: 1; }

    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-bottom: 8px;
    }
    .nav-links.open { display: flex; }
    .site-nav .container { flex-wrap: wrap; padding: 6px 24px; }
    .site-nav a { border-bottom: 0; border-left: 3px solid transparent; }
    .site-nav a.active { border-left-color: var(--accent); }

    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .admin-side { position: static; height: auto; }
    .admin-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .admin-nav .group { grid-column: 1 / -1; }
    .admin-body, .admin-topbar { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 620px) {
    body { font-size: 14px; }
    h1 { font-size: 23px; }
    .container, .page { padding-left: 16px; padding-right: 16px; }
    .stereo-pair { grid-template-columns: 1fr; }
    .heat { grid-template-columns: 28px repeat(24, minmax(0, 1fr)); }
    .heat .hlabel { display: none; }
    form.stacked .actions { flex-direction: column-reverse; align-items: stretch; }
}

/* --- Control panel: who you are, and what you may do ------------------- */

.admin-whoami {
    margin-top: auto;
    padding: 14px 16px 18px;
    border-top: 1px solid var(--admin-rule, rgba(255, 255, 255, 0.12));
    font-size: 12px;
}
.admin-whoami .whoami-role { margin: 6px 0 8px; }
.admin-whoami .whoami-caps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.admin-whoami .whoami-caps li {
    padding: 2px 7px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    letter-spacing: 0.01em;
}
.admin-whoami .whoami-caps li.faint { background: none; padding-left: 0; }

.role-choices {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 20px;
    margin: 6px 0 4px;
}
.capability-grid .row-checkbox {
    align-items: flex-start;
    gap: 8px;
    line-height: 1.45;
}
.capability-grid code { font-size: 12px; }

@media (max-width: 1080px) {
    .admin-whoami { display: none; }
}

/* --- Fly-through video ------------------------------------------------ */

.hero-video-figure { position: relative; }
.hero-video-figure video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: #0d140f;
}
.video-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    font: inherit;
    font-size: 12px;
    line-height: 1.4;
    color: #eef4ef;
    background: rgba(13, 20, 15, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    cursor: pointer;
}
.video-toggle:hover { background: rgba(13, 20, 15, 0.9); }
.video-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The four panes of the quad, described beside the video. */
.pane-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px 22px;
    margin-top: 16px;
}
.pane-note h4 { margin: 2px 0 4px; font-size: 14px; }
.pane-note p { font-size: 13px; line-height: 1.5; }
.pane-where {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    font-weight: 700;
}

.flight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
    margin-top: 18px;
}
.flight-clip { margin: 0; }
.flight-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.flight-head h3 { margin: 0; font-size: 15px; }
.flight-video {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    background: #0d140f;
    border: 1px solid var(--rule, #d8e2da);
}

@media (max-width: 620px) {
    .flight-grid { grid-template-columns: 1fr; }
    .pane-grid { grid-template-columns: 1fr; }
}

@media print {
    .site-nav, .site-creditbar, aside.sidebar, .admin-side, .btn, .filter-bar,
    .video-toggle, .flight-video, .hero-video-figure video { display: none; }
    .page { grid-template-columns: 1fr; }
    body { font-size: 11pt; }
    .card { break-inside: avoid; box-shadow: none; }
}
