:root {
    --bg: #020303;
    --bg-2: #070807;
    --panel: #0b0c0c;
    --panel-2: #111313;
    --line: #272929;
    --line-strong: #454848;
    --text: #f4f6f5;
    --muted: #9ca4a2;
    --dim: #69706d;
    --cyan: #00ffd0;
    --cyan-soft: rgba(0, 255, 208, .12);
    --gold: #ffcf00;
    --gold-soft: rgba(255, 207, 0, .12);
    --red: #ff4c4c;
    --purple: #b86cff;
    --green: #31ff6a;
    --max: 1180px;
    --mono: "Courier New", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: radial-gradient(circle at 50% 0%, #0a1110 0, var(--bg) 38rem), var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
p { color: #d7dbda; margin: 0 0 1.05rem; }
strong { color: #fff; }
small { color: var(--muted); }

.site-header {
    min-height: 70px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 0, 0, .88);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}
.brand,
.system-state,
.primary-nav a,
.eyebrow,
.panel-meta,
.stat-label,
.chip-top,
.button,
.text-link,
.footer-line,
.mini-kv dt,
.timeline-date,
.form-label {
    font-family: var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.brand { font-weight: 800; font-size: .92rem; }
.system-state { color: var(--cyan); font-size: .78rem; white-space: nowrap; }
.primary-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.1rem;
    color: var(--muted);
    font-size: .72rem;
}
.primary-nav a { padding: .4rem 0; }
.primary-nav a:hover,
.primary-nav a.active { color: var(--cyan); }
.nav-short { display: none; }
.site-main { max-width: var(--max); margin: 0 auto; padding: 54px 28px 80px; }

.hero {
    min-height: 66vh;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 48px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 58px;
}
.hero.compact { min-height: auto; padding-bottom: 38px; }
.eyebrow { color: var(--cyan); font-size: .78rem; margin-bottom: 1rem; display: inline-block; }
h1,
h2,
h3 { margin: 0; line-height: 1.05; }
h1 {
    font-size: clamp(2.7rem, 6vw, 5.8rem);
    letter-spacing: -.045em;
    max-width: 980px;
}
.hero h1 { margin-bottom: 1.45rem; }
.page-title { margin-bottom: 1rem; }
.lede {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    color: #f1f4f3;
    max-width: 740px;
    border-left: 1px solid var(--line-strong);
    padding-left: 22px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 1.4rem;
    border: 1px solid var(--line-strong);
    color: var(--text);
    background: transparent;
    font-size: .75rem;
    font-weight: 700;
}
.button:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 22px rgba(0,255,208,.12); }
.button.gold { border-color: var(--gold); color: var(--gold); }
.button.full { width: 100%; }
.text-link { color: var(--cyan); font-size: .72rem; font-weight: 700; }
.text-link:hover { color: var(--gold); }

.hero-visual,
.panel,
.stat-card,
.project-chip,
.tribe-card,
.protocol-card,
.report-card,
.callout,
.timeline-card,
.data-box {
    background: rgba(9, 10, 10, .82);
    border: 1px solid var(--line);
}
.hero-visual { padding: 22px; }
.hero-visual-header,
.panel-header,
.card-header,
.leader-row,
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.hero-visual-header { margin-bottom: 18px; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.pulse-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 22px var(--cyan); display: inline-block; }
.map-caption { margin-top: 14px; color: var(--muted); font-family: var(--mono); font-size: .7rem; }

.mini-map {
    --cell: min(18px, calc(100% / var(--map-size)));
    display: grid;
    grid-template-columns: repeat(var(--map-size), 1fr);
    gap: 2px;
    background: #000;
    padding: 8px;
    border: 1px solid var(--line);
    aspect-ratio: 1 / 1;
}
.mini-map span { min-width: 0; min-height: 0; }
.mini-map .water { background: #080a0a; }
.mini-map .mountain { background: #222; }
.mini-map .agrarian { background: linear-gradient(135deg, #17421d, #3ab74d); }
.mini-map .industrial { background: linear-gradient(135deg, #1b255f, #6f8cff); }
.mini-map .tech { background: linear-gradient(135deg, #421653, #ff3ff2); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 28px 0;
}
.stat-card { padding: 16px; min-height: 112px; }
.stat-label { display: block; color: var(--muted); font-size: .68rem; margin-bottom: .8rem; }
.stat-value { display: block; font-family: var(--mono); color: #fff; font-size: clamp(1.5rem, 2.4vw, 2.2rem); font-weight: 400; line-height: 1; margin-bottom: .55rem; }
.stat-note { display: block; color: var(--muted); font-size: .82rem; line-height: 1.35; }

.panel { padding: 22px; margin: 34px 0; }
.panel-header { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 18px; }
.panel-header h2 { font-size: 1rem; letter-spacing: .08em; font-family: var(--mono); text-transform: uppercase; }
.panel-meta { color: var(--cyan); font-size: .68rem; }
.section-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.three-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.protocol-card,
.report-card,
.data-box { padding: 22px; }
.protocol-card h3,
.report-card h3,
.project-chip h3,
.tribe-card h3,
.timeline-card h3 { font-size: 1.25rem; margin: .5rem 0 1rem; }
.protocol-card .num { color: var(--gold); font-family: var(--mono); font-weight: 800; }
.callout { padding: 22px; border-left: 2px solid var(--cyan); background: rgba(255,255,255,.02); }
.callout.gold { border-left-color: var(--gold); }

.project-grid { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.project-chip { padding: 18px; min-height: 270px; display: flex; flex-direction: column; }
.project-chip p { font-size: .92rem; }
.project-chip .question { color: #fff; font-weight: 700; }
.project-chip .text-link { margin-top: auto; }
.chip-top { color: var(--muted); font-size: .62rem; display: flex; justify-content: space-between; gap: .7rem; }

.timeline { display: grid; gap: 18px; }
.timeline-card { padding: 24px; display: grid; grid-template-columns: 180px 1fr; gap: 24px; position: relative; }
.timeline-date { color: var(--gold); font-size: .75rem; }
.timeline-card h3 { color: #fff; }
.timeline-card:before { content: ""; position: absolute; top: 24px; bottom: 24px; left: 204px; width: 1px; background: var(--line); }

.tribe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tribe-card { display: grid; grid-template-columns: 10px 1fr; min-height: 250px; }
.tribe-swatch { background: var(--swatch); box-shadow: 0 0 28px var(--swatch); }
.tribe-card-body { padding: 18px; }
.mini-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1rem 0; }
.mini-kv div { border-top: 1px solid var(--line); padding-top: 8px; }
.mini-kv dt { color: var(--muted); font-size: .58rem; margin-bottom: 4px; }
.mini-kv dd { margin: 0; color: #fff; font-family: var(--mono); font-size: .83rem; }
.tag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-row span { border: 1px solid var(--line); color: var(--cyan); padding: 4px 8px; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }

.chart-shell { background: #050606; border: 1px solid var(--line); padding: 18px; overflow: hidden; }
.crucible-chart { width: 100%; display: block; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.leaderboard { display: grid; gap: 8px; }
.leader-row { border-bottom: 1px solid var(--line); padding: 12px 0; font-family: var(--mono); }
.leader-row strong { color: var(--cyan); }
.leader-row span:last-child { color: var(--gold); }

.terminal-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .8rem; }
.terminal-table th,
.terminal-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.terminal-table th { color: var(--cyan); letter-spacing: .1em; text-transform: uppercase; font-size: .68rem; }
.terminal-table tr:nth-child(even) td { background: rgba(255,255,255,.025); }

.report-list { display: grid; gap: 14px; }
.report-card { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.report-card p { margin-bottom: 0; }

.form-shell { display: grid; gap: 16px; }
.form-row { border-bottom: 1px solid var(--line); padding: 16px 0; align-items: flex-start; }
.form-label { color: var(--cyan); font-size: .7rem; width: 220px; flex: 0 0 220px; }
.form-row p { margin: 0; flex: 1; }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 34px 28px 50px;
    max-width: var(--max);
    margin: 0 auto;
    color: var(--muted);
}
.footer-grid { display: flex; justify-content: space-between; gap: 28px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.footer-grid p { margin: .4rem 0 0; color: var(--muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: .75rem; }
.footer-links a:hover { color: var(--cyan); }
.footer-line { margin-top: 24px; color: var(--dim); font-size: .68rem; text-align: center; }

@media (max-width: 980px) {
    .site-header { grid-template-columns: 1fr; padding: 18px 22px; }
    .primary-nav { justify-content: flex-start; }
    .system-state { display: none; }
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .section-grid,
    .three-grid,
    .tribe-grid { grid-template-columns: 1fr; }
    .timeline-card { grid-template-columns: 1fr; }
    .timeline-card:before { display: none; }
    .report-card { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .site-main { padding: 34px 18px 60px; }
    .site-header { position: relative; }
    .nav-long { display: none; }
    .nav-short { display: inline; }
    h1 { font-size: 2.55rem; }
    .stat-grid { grid-template-columns: 1fr; }
    .mini-kv { grid-template-columns: 1fr; }
    .footer-grid { flex-direction: column; }
    .form-row { display: block; }
    .form-label { display: block; width: auto; margin-bottom: 8px; }
}

/* Epoch viewer selector refinements */
.epoch-hero {
    display: block;
    min-height: auto;
    padding-bottom: 18px;
    border-bottom: 0;
}
.epoch-hero .page-title {
    font-size: clamp(1.85rem, 3.4vw, 3.15rem);
    letter-spacing: -.025em;
    margin-bottom: .85rem;
}
.epoch-hero .lede {
    max-width: none;
    font-size: clamp(.94rem, 1.1vw, 1.05rem);
    line-height: 1.48;
    padding-left: 16px;
    color: #dfe4e2;
}
.epoch-selector-panel {
    margin-top: 16px;
    padding: 18px;
}
.compact-panel-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
}
.epoch-selector {
    width: 100%;
}
.epoch-selector-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.15fr) minmax(260px, 1.4fr) minmax(140px, .7fr) auto;
    gap: 12px;
    align-items: end;
}
.selector-field {
    display: grid;
    gap: 7px;
}
.selector-field span,
.selector-context span {
    font-family: var(--mono);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .64rem;
    color: var(--muted);
}
.selector-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-strong);
    background: #040505;
    color: var(--text);
    font-family: var(--mono);
    font-size: .78rem;
    padding: 0 34px 0 12px;
    border-radius: 0;
    outline: none;
}
.selector-field select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 255, 208, .08);
}
.selector-submit {
    min-height: 44px;
    white-space: nowrap;
}
.selector-context {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}
.selector-context span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid var(--line);
    padding: 0 9px;
    color: var(--cyan);
    background: rgba(0, 255, 208, .045);
}
@media (max-width: 980px) {
    .epoch-selector-grid {
        grid-template-columns: 1fr 1fr;
    }
    .selector-submit {
        width: 100%;
    }
}
@media (max-width: 640px) {
    .epoch-selector-grid {
        grid-template-columns: 1fr;
    }
    .epoch-hero .lede {
        border-left: 0;
        padding-left: 0;
    }
}

/* Epoch viewer database stat blocks */
.epoch-stat-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.2fr 1fr 1fr;
    gap: 12px;
    margin: 18px 0 30px;
}
.epoch-stat-card {
    min-height: 150px;
    padding: 16px;
    background: rgba(9, 10, 10, .82);
    border: 1px solid var(--line);
    overflow: hidden;
}
.epoch-phase-card {
    border-color: rgba(0, 255, 208, .35);
    background: linear-gradient(135deg, rgba(0, 255, 208, .08), rgba(9, 10, 10, .82) 48%);
}
.epoch-project-name {
    display: block;
    margin-bottom: 8px;
    font-family: var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-size: .74rem;
    line-height: 1.3;
}
.epoch-phase-name {
    display: block;
    margin-bottom: 10px;
    color: #fff;
    font-size: clamp(1.25rem, 1.7vw, 1.8rem);
    font-weight: 800;
    line-height: 1.08;
}
.epoch-metric-list {
    display: grid;
    gap: 7px;
}
.epoch-metric-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.epoch-metric-row:last-child {
    border-bottom: 0;
}
.epoch-metric-row span {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.25;
}
.epoch-metric-row strong {
    color: #fff;
    font-family: var(--mono);
    font-size: .98rem;
    font-weight: 800;
    white-space: nowrap;
}
.epoch-metric-row.note-row {
    margin-top: -6px;
    padding-bottom: 4px;
    border-bottom: 0;
}
.epoch-metric-row.note-row em {
    font-family: var(--mono);
    color: var(--cyan);
    font-size: .68rem;
    font-style: normal;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.epoch-stat-card > .stat-note {
    display: block;
    margin-top: 10px;
    max-height: 3.7em;
    overflow: hidden;
}
@media (max-width: 1180px) {
    .epoch-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .epoch-stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------
   Epoch population map viewer
   ------------------------------------------------------------------ */
.epoch-map-app {
    display: grid;
    gap: 16px;
}

.epoch-map-toolbar {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto auto;
    gap: 14px;
    align-items: center;
}

.button.subtle {
    min-height: 40px;
    color: var(--muted);
    border-color: var(--line);
}

.epoch-map-toolbar .button {
    min-height: 42px;
    white-space: nowrap;
}

.epoch-map-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 7px;
    background: #161818;
    border: 1px solid var(--line);
    border-radius: 99px;
    outline: none;
}

.epoch-map-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-map-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-map-pulse,
.epoch-map-status,
.epoch-map-legend,
.epoch-map-max {
    font-family: var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-map-pulse {
    color: var(--cyan);
    font-weight: 800;
    min-width: 118px;
    text-align: right;
    font-size: .82rem;
}

.epoch-map-canvas-shell {
    position: relative;
    background: #000;
    border: 1px solid var(--line);
    padding: 10px;
    overflow: hidden;
}

.epoch-map-canvas {
    width: 100%;
    display: block;
    image-rendering: auto;
}

.epoch-map-status {
    position: absolute;
    left: 20px;
    top: 20px;
    padding: 7px 9px;
    background: rgba(0,0,0,.78);
    border: 1px solid var(--line);
    color: var(--cyan);
    font-size: .67rem;
    pointer-events: none;
}

.epoch-map-status[data-state="ready"] {
    display: none;
}

.epoch-map-status[data-state="error"] {
    color: var(--red);
    border-color: rgba(255,76,76,.4);
}

/* Epoch heat map tabs */
.epoch-heatmap-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.epoch-heatmap-tab {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.018);
    color: var(--muted);
    font-family: var(--mono);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
}

.epoch-heatmap-tab:hover {
    color: var(--cyan);
    border-color: rgba(0,255,208,.32);
    box-shadow: 0 0 18px rgba(0,255,208,.08);
}

.epoch-heatmap-tab.active {
    color: var(--cyan);
    border-color: rgba(0,255,208,.52);
    background: rgba(0,255,208,.055);
    box-shadow: inset 0 0 0 1px rgba(0,255,208,.12);
}

.epoch-heatmap-tab:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.epoch-heatmap-panel {
    display: none;
}

.epoch-heatmap-panel.active {
    display: block;
}

.future-heatmap-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.future-heatmap-main {
    min-height: 560px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at 20% 0%, rgba(0,255,208,.07), transparent 36%),
        linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
    padding: 20px;
}

.future-heatmap-main h3 {
    margin: 0 0 12px;
    color: #fff;
    font-family: var(--mono);
    font-size: clamp(1.5rem, 2vw, 2.2rem);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.future-heatmap-main > p {
    max-width: 780px;
    color: #d7dbda;
}

.future-heatmap-placeholder {
    min-height: 300px;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,.08);
    background:
        linear-gradient(90deg, rgba(0,255,208,.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0,255,208,.08) 1px, transparent 1px),
        rgba(0,0,0,.35);
    background-size: 34px 34px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-content: center;
    padding: 20px;
}

.future-heatmap-placeholder span {
    min-height: 72px;
    border: 1px solid rgba(0,255,208,.18);
    background: rgba(0,0,0,.52);
    color: var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: var(--mono);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.future-heatmap-notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.future-heatmap-notes article {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 10px;
}

.future-heatmap-notes strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.future-heatmap-notes p {
    margin: 0;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.45;
}

.future-heatmap-sidebar {
    display: grid;
    gap: 12px;
    align-content: start;
}

@media (max-width: 1180px) {
    .future-heatmap-layout {
        grid-template-columns: 1fr;
    }

    .future-heatmap-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .epoch-heatmap-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .epoch-heatmap-tab {
        width: 100%;
        justify-content: center;
    }

    .future-heatmap-placeholder,
    .future-heatmap-notes,
    .future-heatmap-sidebar {
        grid-template-columns: 1fr;
    }
}


.epoch-map-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: .67rem;
}

.legend-ramp {
    display: inline-block;
    width: 58px;
    height: 12px;
    border: 1px solid var(--line);
}

.legend-ramp.foraging { background: linear-gradient(to right, #321414, #ff0000, #fff); }
.legend-ramp.agrarian { background: linear-gradient(to right, #143214, #00ff00, #fff); }
.legend-ramp.industrial { background: linear-gradient(to right, #141432, #0066ff, #fff); }
.legend-ramp.tech { background: linear-gradient(to right, #321432, #ff00ff, #fff); }

.epoch-map-max {
    color: var(--muted);
    margin-left: 10px;
}

@media (max-width: 760px) {
    .epoch-map-toolbar {
        grid-template-columns: 1fr;
    }
    .epoch-map-pulse {
        text-align: left;
    }
}


/* ------------------------------------------------------------------
   Epoch map side telemetry layout
   ------------------------------------------------------------------ */
body.epoch-wide-page main,
body.epoch-wide-page .site-main,
body.epoch-wide-page .page-shell,
body.epoch-wide-page .content-shell {
    max-width: min(1500px, calc(100vw - 64px));
}

.epoch-map-and-intel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.epoch-map-primary {
    min-width: 0;
}

.epoch-map-and-intel .epoch-map-app {
    gap: 12px;
}

.epoch-map-and-intel .epoch-map-toolbar {
    gap: 12px;
}

.epoch-map-and-intel .epoch-map-canvas-shell {
    padding: 8px;
}

.epoch-map-intel-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.epoch-side-card {
    min-height: 132px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
    padding: 16px;
}

.epoch-side-card .stat-label {
    display: block;
    margin-bottom: 10px;
}

.epoch-side-note {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.45;
}

.epoch-mini-bars {
    display: grid;
    gap: 10px;
}

.epoch-mini-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: var(--muted);
    font-size: .72rem;
}

.epoch-mini-bar-row strong {
    color: rgba(255,255,255,.65);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-mini-bar-row i {
    grid-column: 1 / -1;
    display: block;
    height: 7px;
    border: 1px solid var(--line);
    background:
        linear-gradient(90deg, rgba(0,255,208,.65) var(--bar), rgba(255,255,255,.045) var(--bar));
}

.epoch-mini-readout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid rgba(255,255,255,.06);
    color: var(--muted);
    font-size: .78rem;
}

.epoch-mini-readout strong {
    color: #fff;
    font-family: var(--mono);
    letter-spacing: .05em;
}

@media (max-width: 1180px) {
    .epoch-map-and-intel {
        grid-template-columns: 1fr;
    }

    .epoch-map-intel-panel {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    body.epoch-wide-page main,
    body.epoch-wide-page .site-main,
    body.epoch-wide-page .page-shell,
    body.epoch-wide-page .content-shell {
        max-width: calc(100vw - 32px);
    }

    .epoch-map-intel-panel {
        grid-template-columns: 1fr;
    }
}

/* Population map display-mode controls */
.epoch-map-labels {
    min-width: 156px;
}

.epoch-pop-band-key {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    color: var(--muted);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: -4px;
}

.epoch-pop-band-key span {
    color: var(--cyan);
    margin-right: 3px;
}

.epoch-pop-band-key b {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 2px 6px;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.025);
    color: rgba(255,255,255,.62);
    font-weight: 700;
}

@media (max-width: 760px) {
    .epoch-map-labels {
        min-width: 0;
    }
}

/* ------------------------------------------------------------------
   Epoch population side stats
   ------------------------------------------------------------------ */
.epoch-side-total {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.epoch-side-total span {
    color: var(--muted);
    font-size: .76rem;
}

.epoch-side-total strong {
    color: #fff;
    font-family: var(--mono);
    font-size: 1.08rem;
    letter-spacing: .04em;
}

.epoch-regime-pop-bars {
    display: grid;
    gap: 9px;
}

.epoch-regime-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
}

.epoch-regime-line span,
.epoch-land-breakdown span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.2;
}

.epoch-regime-line span i,
.epoch-land-breakdown span i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: 0 0 10px currentColor;
}

.epoch-regime-line strong,
.epoch-land-breakdown strong {
    color: #fff;
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .04em;
    white-space: nowrap;
}

.epoch-regime-line b {
    grid-column: 1 / -1;
    display: block;
    height: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.035);
}

.epoch-regime-line b em {
    display: block;
    height: 100%;
    width: 0%;
    transition: width .12s linear;
}

.epoch-regime-line.foraging span i,
.epoch-land-breakdown .foraging span i,
.epoch-regime-line.foraging b em { color: #ff4040; background: #ff4040; }
.epoch-regime-line.agrarian span i,
.epoch-land-breakdown .agrarian span i,
.epoch-regime-line.agrarian b em { color: #00ff58; background: #00ff58; }
.epoch-regime-line.industrial span i,
.epoch-land-breakdown .industrial span i,
.epoch-regime-line.industrial b em { color: #3d7dff; background: #3d7dff; }
.epoch-regime-line.technological span i,
.epoch-land-breakdown .technological span i,
.epoch-regime-line.technological b em { color: #ff3cff; background: #ff3cff; }

.epoch-land-distribution {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.epoch-land-pie {
    width: 106px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.04);
    box-shadow: inset 0 0 0 12px rgba(0,0,0,.42), 0 0 20px rgba(0,255,208,.06);
    display: grid;
    place-content: center;
    text-align: center;
    color: #fff;
    font-family: var(--mono);
}

.epoch-land-pie span {
    display: block;
    font-size: 1rem;
    line-height: 1;
    text-shadow: 0 1px 6px #000;
}

.epoch-land-pie em {
    display: block;
    margin-top: 3px;
    color: rgba(255,255,255,.62);
    font-size: .54rem;
    font-style: normal;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-shadow: 0 1px 6px #000;
}

.epoch-land-breakdown {
    display: grid;
    gap: 8px;
}

.epoch-land-breakdown > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.epoch-land-breakdown > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.epoch-settlement-footprint-card .epoch-mini-readout {
    grid-template-columns: minmax(0, 1fr) auto;
}

.epoch-settlement-footprint-card .epoch-mini-readout strong {
    text-align: right;
    white-space: nowrap;
}


/* Urban/rural split card */
.epoch-urban-rural-card {
    min-height: 190px;
}

.epoch-split-group {
    display: grid;
    gap: 7px;
    padding: 9px 0 11px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.epoch-split-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.epoch-split-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
}

.epoch-split-heading span {
    color: var(--muted);
    font-size: .74rem;
}

.epoch-split-heading strong {
    color: #fff;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .06em;
    white-space: nowrap;
}

.epoch-split-bar {
    display: flex;
    height: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.09);
    background: rgba(255,255,255,.035);
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}

.epoch-split-bar i {
    display: block;
    height: 100%;
    width: 0%;
    transition: width .12s linear;
}

.epoch-split-bar i.rural {
    background: linear-gradient(90deg, rgba(0,255,88,.30), rgba(0,255,88,.70));
}

.epoch-split-bar i.urban {
    background: linear-gradient(90deg, rgba(255,208,0,.55), rgba(255,255,255,.86));
    box-shadow: 0 0 12px rgba(255,208,0,.18);
}

.epoch-split-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.epoch-split-values span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .68rem;
    min-width: 0;
}

.epoch-split-values em {
    color: rgba(255,255,255,.82);
    font-family: var(--mono);
    font-style: normal;
    font-size: .66rem;
    letter-spacing: .04em;
    white-space: nowrap;
}

.epoch-split-values b {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.epoch-split-values .rural-dot {
    background: #00ff58;
    box-shadow: 0 0 9px rgba(0,255,88,.55);
}

.epoch-split-values .urban-dot {
    background: #ffd000;
    box-shadow: 0 0 9px rgba(255,208,0,.55);
}

@media (max-width: 1180px) {
    .epoch-land-distribution {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .epoch-land-pie {
        width: 92px;
    }
}

/* ------------------------------------------------------------------
   Epoch population tab lower graphs
   ------------------------------------------------------------------ */
.epoch-population-graphs {
    display: grid;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.epoch-graph-controlbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.018);
}

.epoch-graph-controlbar h3 {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--mono);
    font-size: 1.05rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-graph-controlbar p {
    max-width: 900px;
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
}

.epoch-graph-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    min-width: 250px;
}

.epoch-graph-controls label,
.epoch-graph-controls span,
.epoch-event-rail-heading,
.epoch-graph-summary span,
.epoch-graph-card-header > span {
    font-family: var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
}

.epoch-graph-controls label {
    color: var(--muted);
    font-size: .62rem;
}

.epoch-graph-controls select {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    background: #040505;
    color: var(--text);
    font-family: var(--mono);
    font-size: .72rem;
    padding: 0 10px;
    outline: none;
}

.epoch-graph-controls select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0,255,208,.08);
}

.epoch-graph-controls span {
    color: var(--cyan);
    font-size: .62rem;
    text-align: right;
}

.epoch-graph-controls span[data-state="error"] {
    color: var(--red);
}

.epoch-graph-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.epoch-graph-summary > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,.22);
}

.epoch-graph-summary span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: .57rem;
}

.epoch-graph-summary strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-family: var(--mono);
    font-size: .83rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.epoch-event-rail-shell {
    padding: 12px 14px 14px;
    border: 1px solid rgba(0,255,208,.15);
    background: linear-gradient(90deg, rgba(0,255,208,.035), rgba(255,255,255,.012));
}

.epoch-event-rail-heading {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: .62rem;
}

.epoch-event-rail-heading strong {
    color: var(--cyan);
    font-weight: 800;
}

.epoch-event-rail {
    position: relative;
    height: 48px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.07);
    background: rgba(0,0,0,.32);
}

.epoch-event-rail:before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255,255,255,.08);
}

.epoch-event-chip {
    position: absolute;
    display: block;
    min-width: 7px;
    height: 18px;
    overflow: hidden;
    padding: 0 5px;
    border: 1px solid rgba(0,255,208,.46);
    background: rgba(0,255,208,.12);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: .51rem;
    font-weight: 800;
    line-height: 16px;
    text-align: left;
    text-overflow: clip;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: help;
}

.epoch-event-chip.instant {
    width: 8px !important;
    min-width: 8px;
    padding: 0;
    border-color: rgba(255,207,0,.75);
    background: rgba(255,207,0,.28);
    color: transparent;
}

.epoch-event-empty {
    position: absolute;
    left: 10px;
    top: 16px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: .62rem;
    letter-spacing: .1em;
}

.epoch-graph-stack {
    display: grid;
    gap: 16px;
}

.epoch-graph-card {
    border: 1px solid var(--line);
    background: rgba(7,8,8,.86);
    padding: 14px;
}

.epoch-graph-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .48fr);
    gap: 16px;
    align-items: end;
    margin-bottom: 10px;
}

.epoch-graph-card-header h4 {
    margin: 0;
    color: #fff;
    font-family: var(--mono);
    font-size: .88rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.epoch-graph-card-header > span {
    color: var(--muted);
    font-size: .56rem;
    line-height: 1.35;
    text-align: right;
}

.epoch-trend-canvas {
    display: block;
    width: 100%;
    min-height: 220px;
    border: 1px solid rgba(255,255,255,.05);
    background: #050606;
    cursor: crosshair;
}

@media (max-width: 980px) {
    .epoch-graph-controlbar,
    .epoch-graph-card-header {
        grid-template-columns: 1fr;
    }

    .epoch-graph-controls {
        min-width: 0;
    }

    .epoch-graph-controls span,
    .epoch-graph-card-header > span {
        text-align: left;
    }

    .epoch-graph-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .epoch-graph-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ------------------------------------------------------------------
   Shared sticky lower graph scrubbers
   ------------------------------------------------------------------ */
.epoch-graph-pulse-dock,
.epoch-behaviour-pulse-dock {
    position: sticky;
    top: 78px;
    z-index: 12;
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(0,255,208,.28);
    background: rgba(3, 7, 7, .94);
    box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 18px rgba(0,255,208,.055);
    backdrop-filter: blur(8px);
}

.epoch-graph-scrubber,
.epoch-behaviour-scrubber,
.epoch-behaviour-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 7px;
    background: #161818;
    border: 1px solid var(--line);
    border-radius: 99px;
    outline: none;
}

.epoch-graph-scrubber::-webkit-slider-thumb,
.epoch-behaviour-scrubber::-webkit-slider-thumb,
.epoch-behaviour-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-graph-scrubber::-moz-range-thumb,
.epoch-behaviour-scrubber::-moz-range-thumb,
.epoch-behaviour-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-graph-scrubber-pulse,
.epoch-behaviour-scrubber-pulse {
    min-width: 118px;
    color: var(--cyan);
    font-family: var(--mono);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: right;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Behavioural Psychology tab
   ------------------------------------------------------------------ */
.epoch-behaviour-app {
    display: grid;
    gap: 18px;
}

.epoch-behaviour-map-and-intel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.epoch-behaviour-map-primary {
    min-width: 0;
}

.epoch-behaviour-map-card {
    display: grid;
    gap: 16px;
}

.epoch-behaviour-toolbar {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.epoch-behaviour-pulse,
.epoch-behaviour-status,
.epoch-behaviour-legend,
.epoch-behaviour-method,
.epoch-behaviour-graph-controls label,
.epoch-behaviour-graph-controls span,
.epoch-behaviour-card-header > span {
    font-family: var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-behaviour-pulse {
    min-width: 118px;
    color: var(--cyan);
    font-size: .82rem;
    font-weight: 800;
    text-align: right;
}

.epoch-behaviour-canvas-shell {
    position: relative;
    overflow: hidden;
    padding: 10px;
    border: 1px solid var(--line);
    background: #000;
}

.epoch-behaviour-map-canvas {
    display: block;
    width: 100%;
    background: #000;
    image-rendering: auto;
}

.epoch-behaviour-status {
    position: absolute;
    left: 20px;
    top: 20px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,.78);
    color: var(--cyan);
    font-size: .67rem;
    pointer-events: none;
}

.epoch-behaviour-status[data-state="ready"] {
    display: none;
}

.epoch-behaviour-status[data-state="error"] {
    color: var(--red);
    border-color: rgba(255,76,76,.4);
}

.epoch-behaviour-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    color: var(--muted);
    font-size: .62rem;
}

.epoch-behaviour-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.epoch-behaviour-legend i {
    display: inline-block;
    width: 26px;
    height: 9px;
    border: 1px solid rgba(255,255,255,.25);
    box-shadow: 0 0 10px rgba(255,255,255,.08);
}

.epoch-behaviour-legend .quiet i { background: #101212; }
.epoch-behaviour-legend .coop i { background: #00ffd0; }
.epoch-behaviour-legend .exploit i { background: #ff4c4c; }
.epoch-behaviour-legend .defect i { background: #ffcf00; }
.epoch-behaviour-legend .xeno i { background: #3d7dff; }
.epoch-behaviour-legend .tribal i { background: #ff3cff; }
.epoch-behaviour-legend .civic i { background: #31ff6a; }

.epoch-behaviour-method {
    margin: 0;
    color: var(--muted);
    font-size: .64rem;
    line-height: 1.45;
    text-align: center;
}

.epoch-behaviour-intel-panel {
    display: grid;
    gap: 14px;
}

.epoch-behaviour-pressure-card .epoch-mini-readout,
.epoch-behaviour-pd-card .epoch-mini-readout,
.epoch-behaviour-contact-card .epoch-mini-readout,
.epoch-behaviour-trust-card .epoch-mini-readout,
.epoch-behaviour-outcome-card .epoch-mini-readout {
    grid-template-columns: minmax(0, 1fr) auto;
}

.epoch-behaviour-lower {
    display: grid;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.epoch-behaviour-graph-controlbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.018);
}

.epoch-behaviour-graph-controlbar h3 {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--mono);
    font-size: 1.05rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-behaviour-graph-controlbar p {
    max-width: 900px;
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
}

.epoch-behaviour-graph-controls {
    display: grid;
    gap: 7px;
    min-width: 250px;
}

.epoch-behaviour-graph-controls label {
    color: var(--muted);
    font-size: .62rem;
}

.epoch-behaviour-graph-controls select {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    background: #040505;
    color: var(--text);
    font-family: var(--mono);
    font-size: .72rem;
    padding: 0 10px;
    outline: none;
}

.epoch-behaviour-graph-controls select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0,255,208,.08);
}

.epoch-behaviour-graph-controls span {
    color: var(--cyan);
    font-size: .62rem;
    text-align: right;
}

.epoch-behaviour-graph-stack {
    display: grid;
    gap: 16px;
}

.epoch-behaviour-graph-card {
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(7,8,8,.86);
}

.epoch-behaviour-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .48fr);
    gap: 16px;
    align-items: end;
    margin-bottom: 10px;
}

.epoch-behaviour-card-header h4 {
    margin: 0;
    color: #fff;
    font-family: var(--mono);
    font-size: .88rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.epoch-behaviour-card-header > span {
    color: var(--muted);
    font-size: .56rem;
    line-height: 1.35;
    text-align: right;
}

.epoch-behaviour-chart {
    display: block;
    width: 100%;
    min-height: 220px;
    border: 1px solid rgba(255,255,255,.05);
    background: #050606;
    cursor: crosshair;
}

@media (max-width: 1180px) {
    .epoch-behaviour-map-and-intel {
        grid-template-columns: 1fr;
    }

    .epoch-behaviour-intel-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .epoch-graph-pulse-dock,
    .epoch-behaviour-pulse-dock,
    .epoch-behaviour-toolbar,
    .epoch-behaviour-graph-controlbar,
    .epoch-behaviour-card-header {
        grid-template-columns: 1fr;
    }

    .epoch-graph-scrubber-pulse,
    .epoch-behaviour-scrubber-pulse,
    .epoch-behaviour-pulse,
    .epoch-behaviour-card-header > span,
    .epoch-behaviour-graph-controls span {
        text-align: left;
    }

    .epoch-behaviour-graph-controls {
        min-width: 0;
    }
}

@media (max-width: 680px) {
    .epoch-behaviour-intel-panel {
        grid-template-columns: 1fr;
    }
}


/* ------------------------------------------------------------------
   Life and Death tab
   ------------------------------------------------------------------ */
.epoch-life-app {
    display: grid;
    gap: 18px;
}

.epoch-life-map-and-intel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
}

.epoch-life-map-primary {
    min-width: 0;
}

.epoch-life-map-card {
    display: grid;
    gap: 16px;
    border: 1px solid rgba(0,255,208,.25);
    background: rgba(2,8,8,.78);
}

.epoch-life-toolbar {
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto minmax(190px, 240px);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid rgba(0,255,208,.22);
    background: rgba(0,255,208,.035);
}

.epoch-life-toolbar .button,
.epoch-life-pulse-dock .button {
    min-width: 74px;
}

.epoch-life-slider,
.epoch-life-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 7px;
    background: #161818;
    border: 1px solid var(--line);
    border-radius: 99px;
    outline: none;
}

.epoch-life-slider::-webkit-slider-thumb,
.epoch-life-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-life-slider::-moz-range-thumb,
.epoch-life-scrubber::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--cyan);
    border: 2px solid #000;
    border-radius: 999px;
    box-shadow: 0 0 14px rgba(0,255,208,.5);
    cursor: pointer;
}

.epoch-life-pulse,
.epoch-life-scrubber-pulse,
.epoch-life-status,
.epoch-life-legend,
.epoch-life-method,
.epoch-life-mode-field,
.epoch-life-graph-controls label,
.epoch-life-graph-controls span,
.epoch-life-card-header > span {
    font-family: var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-life-pulse,
.epoch-life-scrubber-pulse {
    min-width: 118px;
    color: var(--cyan);
    font-size: .82rem;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.epoch-life-mode-field,
.epoch-life-graph-controls {
    display: grid;
    gap: 7px;
}

.epoch-life-mode-field span,
.epoch-life-graph-controls label,
.epoch-life-graph-controls span {
    color: var(--muted);
    font-size: .62rem;
}

.epoch-life-mode-field select,
.epoch-life-graph-controls select {
    min-height: 38px;
    border: 1px solid var(--line-strong);
    background: #040505;
    color: var(--text);
    font-family: var(--mono);
    font-size: .72rem;
    padding: 0 10px;
    outline: none;
}

.epoch-life-mode-field select:focus,
.epoch-life-graph-controls select:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0,255,208,.08);
}

.epoch-life-canvas-shell {
    position: relative;
    overflow: hidden;
    margin: 0 12px;
    border: 1px solid var(--line);
    background: #000;
}

.epoch-life-map-canvas {
    display: block;
    width: 100%;
    min-height: 620px;
    background: #000;
    image-rendering: auto;
}

.epoch-life-status {
    position: absolute;
    left: 14px;
    top: 14px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,.78);
    color: var(--cyan);
    font-size: .67rem;
    pointer-events: none;
}

.epoch-life-status[data-state="ready"] {
    display: none;
}

.epoch-life-status[data-state="error"] {
    color: var(--red);
    border-color: rgba(255,76,76,.4);
}

.epoch-life-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: center;
    padding: 0 12px;
    color: var(--muted);
    font-size: .62rem;
}

.epoch-life-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.epoch-life-legend i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-style: normal;
    font-size: 14px;
    filter: drop-shadow(0 0 6px rgba(255,255,255,.12));
}

.epoch-life-legend .growth i { color: #5cc9ff; }
.epoch-life-legend .flow-death i { color: #ff4a4a; }
.epoch-life-legend .hazard i { color: #ff4a4a; }
.epoch-life-legend .starvation i { color: #ffd000; }
.epoch-life-legend .oldage i { color: #8aa0b2; }

.epoch-life-method {
    margin: 0;
    padding: 0 12px 14px;
    color: var(--muted);
    font-size: .64rem;
    line-height: 1.45;
    text-align: center;
}

.epoch-life-intel-panel {
    display: grid;
    gap: 14px;
}

.epoch-life-intel-panel .epoch-mini-readout {
    grid-template-columns: minmax(0, 1fr) auto;
}

.epoch-life-lower {
    display: grid;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.epoch-life-graph-controlbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    padding: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.018);
}

.epoch-life-graph-controlbar h3 {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--mono);
    font-size: 1.05rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.epoch-life-graph-controlbar p {
    max-width: 900px;
    margin: 0;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.45;
}

.epoch-life-graph-controls {
    min-width: 250px;
}

.epoch-life-graph-controls span {
    color: var(--cyan);
    text-align: right;
}

.epoch-life-pulse-dock {
    position: sticky;
    top: 78px;
    z-index: 12;
    display: grid;
    grid-template-columns: auto minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(0,255,208,.28);
    background: rgba(3,7,7,.94);
    box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 18px rgba(0,255,208,.055);
    backdrop-filter: blur(8px);
}

.epoch-life-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.epoch-life-summary > div {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.018);
}

.epoch-life-summary span {
    color: var(--muted);
    font-size: .7rem;
}

.epoch-life-summary strong {
    color: #fff;
    font-family: var(--mono);
    font-size: .86rem;
    text-align: right;
}

.epoch-life-graph-stack {
    display: grid;
    gap: 16px;
}

.epoch-life-graph-card {
    padding: 14px;
    border: 1px solid var(--line);
    background: rgba(7,8,8,.86);
}

.epoch-life-card-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .48fr);
    gap: 16px;
    align-items: end;
    margin-bottom: 10px;
}

.epoch-life-card-header h4 {
    margin: 0;
    color: #fff;
    font-family: var(--mono);
    font-size: .88rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.epoch-life-card-header > span {
    color: var(--muted);
    font-size: .56rem;
    line-height: 1.35;
    text-align: right;
}

.epoch-life-chart {
    display: block;
    width: 100%;
    min-height: 240px;
    border: 1px solid rgba(255,255,255,.05);
    background: #050606;
    cursor: crosshair;
}

@media (max-width: 1180px) {
    .epoch-life-map-and-intel {
        grid-template-columns: 1fr;
    }

    .epoch-life-intel-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .epoch-life-toolbar,
    .epoch-life-graph-controlbar,
    .epoch-life-card-header,
    .epoch-life-pulse-dock {
        grid-template-columns: 1fr;
    }

    .epoch-life-pulse,
    .epoch-life-scrubber-pulse,
    .epoch-life-card-header > span,
    .epoch-life-graph-controls span,
    .epoch-life-summary strong {
        text-align: left;
    }

    .epoch-life-graph-controls,
    .epoch-life-mode-field {
        min-width: 0;
    }

    .epoch-life-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .epoch-life-intel-panel,
    .epoch-life-summary {
        grid-template-columns: 1fr;
    }
}

/* Thermodynamics tab */
.epoch-thermo-app{
    display:flex;
    flex-direction:column;
    gap:18px;
}

.epoch-thermo-map-and-intel{
    display:grid;
    grid-template-columns:minmax(0,1fr) 340px;
    gap:18px;
    align-items:start;
}

.epoch-thermo-map-card,
.epoch-thermo-graph-card{
    background:rgba(5,7,7,.78);
    border:1px solid rgba(127,255,230,.16);
    box-shadow:0 0 0 1px rgba(0,0,0,.55), inset 0 0 22px rgba(0,255,210,.025);
}

.epoch-thermo-toolbar,
.epoch-thermo-pulse-dock{
    display:grid;
    grid-template-columns:auto minmax(180px,1fr) auto auto;
    gap:14px;
    align-items:center;
    padding:12px 14px;
    border-bottom:1px solid rgba(127,255,230,.14);
    background:rgba(0,255,210,.025);
}

.epoch-thermo-toolbar .button,
.epoch-thermo-pulse-dock .button{
    min-width:76px;
}

.epoch-thermo-slider,
.epoch-thermo-scrubber{
    width:100%;
    accent-color:#00f5d4;
}

.epoch-thermo-pulse,
.epoch-thermo-scrubber-pulse{
    color:#00f5d4;
    font-family:'Courier New', monospace;
    font-weight:700;
    letter-spacing:.08em;
    white-space:nowrap;
}

.epoch-thermo-mode-field,
.epoch-thermo-graph-controls{
    display:flex;
    align-items:center;
    gap:8px;
    color:#84918f;
    font-family:'Courier New', monospace;
    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.epoch-thermo-mode-field select,
.epoch-thermo-graph-controls select{
    background:#070909;
    color:#dffef7;
    border:1px solid rgba(127,255,230,.22);
    padding:7px 9px;
    font-family:'Courier New', monospace;
    font-size:11px;
}

.epoch-thermo-canvas-shell{
    position:relative;
    padding:14px;
}

.epoch-thermo-map-canvas{
    display:block;
    width:100%;
    height:720px;
    background:#050606;
}

.epoch-thermo-status{
    position:absolute;
    top:24px;
    left:24px;
    z-index:3;
    padding:7px 10px;
    background:rgba(0,0,0,.82);
    border:1px solid rgba(0,255,210,.24);
    color:#dffef7;
    font-family:'Courier New', monospace;
    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;
    pointer-events:none;
}

.epoch-thermo-legend{
    display:flex;
    flex-wrap:wrap;
    gap:12px 18px;
    align-items:center;
    padding:10px 14px 12px;
    border-top:1px solid rgba(127,255,230,.12);
    color:#aab8b5;
    font-family:'Courier New', monospace;
    font-size:11px;
    letter-spacing:.08em;
    text-transform:uppercase;
}

.epoch-thermo-legend span{
    display:inline-flex;
    gap:6px;
    align-items:center;
}

.epoch-thermo-legend i{
    display:inline-block;
    width:18px;
    height:10px;
    border:1px solid rgba(255,255,255,.25);
    box-shadow:0 0 10px rgba(0,255,210,.12);
}

.epoch-thermo-legend .reserve i{ background:linear-gradient(90deg,#08231f,#00f5d4); }
.epoch-thermo-legend .eroi i{ background:linear-gradient(90deg,#102b18,#27f06a); }
.epoch-thermo-legend .stress i{ background:linear-gradient(90deg,#2a2110,#ff4a4a); }
.epoch-thermo-legend .capacity i{ background:linear-gradient(90deg,#2a2110,#ffd000,#ff4a4a); }
.epoch-thermo-legend .waste i{ background:linear-gradient(90deg,#11151f,#ff3de2); }
.epoch-thermo-legend .empty i{ background:#161716; }

.epoch-thermo-method{
    margin:0;
    padding:0 14px 14px;
    color:#7f908c;
    font-size:12px;
    line-height:1.5;
}

.epoch-thermo-intel-panel{
    display:flex;
    flex-direction:column;
    gap:14px;
}

.epoch-thermo-lower{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.epoch-thermo-graph-controlbar{
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:flex-start;
    padding:16px;
    border:1px solid rgba(127,255,230,.16);
    background:rgba(5,7,7,.78);
}

.epoch-thermo-graph-controlbar h3{
    margin:.15rem 0 .35rem;
    color:#f1fff9;
    font-size:18px;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.epoch-thermo-graph-controlbar p{
    margin:0;
    color:#9aa8a4;
    max-width:860px;
    line-height:1.5;
}

.epoch-thermo-pulse-dock{
    position:sticky;
    top:0;
    z-index:8;
    border:1px solid rgba(127,255,230,.18);
}

.epoch-thermo-graph-stack{
    display:flex;
    flex-direction:column;
    gap:16px;
}

.epoch-thermo-card-header{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-end;
    padding:14px 16px 8px;
}

.epoch-thermo-card-header h4{
    margin:.2rem 0 0;
    color:#f1fff9;
    font-size:16px;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.epoch-thermo-card-header > span{
    max-width:420px;
    color:#8f9d99;
    font-size:11px;
    line-height:1.45;
    text-align:right;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.epoch-thermo-chart{
    display:block;
    width:100%;
    height:260px;
    padding:0 14px 14px;
    box-sizing:border-box;
}

@media (max-width:1100px){
    .epoch-thermo-map-and-intel{
        grid-template-columns:1fr;
    }
    .epoch-thermo-toolbar,
    .epoch-thermo-pulse-dock{
        grid-template-columns:auto minmax(150px,1fr) auto;
    }
    .epoch-thermo-mode-field{
        grid-column:1/-1;
        justify-content:flex-end;
    }
    .epoch-thermo-graph-controlbar{
        flex-direction:column;
    }
}
