@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap');

/* ═══════════════════════════════════════════════════════
   TOKENS
   ═══════════════════════════════════════════════════════ */
:root {
    /* Warm editorial palette */
    --bg:        #f2ede4;
    --surface:   #ede8de;
    --surface2:  #e6e0d4;
    --border:    #ccc6b8;
    --border2:   #d8d2c4;

    --accent:    #b01a0a;   /* deep vermillion */
    --accent2:   #d42010;
    --accent-dim: rgba(176,26,10,0.08);

    --text:      #1c1814;
    --text-dim:  #5a5248;
    --text-mute: #a09080;

    /* semantic */
    --green:     #1a6b35;
    --red:       #b01a0a;
    --amber:     #8a6200;
    --gold:      #8a6200;
    --orange:    #9a4a00;
    --purple:    #5a2a8a;
    --sky:       #1a4a8a;

    /* canvas compat vars (app.js canvas code uses these for drawing) */
    --blue-hi:       #b01a0a;
    --blue:          #8a1408;
    --blue-mid:      #a01800;
    --chart-line:    #b01a0a;
    --chart-area:    rgba(176,26,10,0.08);
    --chart-avg:     #5a2a8a;
    --bar-base:      #d8d2c4;
    --bar-mid:       #c0b8a8;
    --bar-hi:        #b01a0a;
    --bar-pb:        #8a6200;
    --bar-worst:     #b01a0a;
    --heat-0:        #e6e0d4;
    --heat-1:        #c8dcc8;
    --heat-2:        #a0c8a0;
    --heat-3:        #6aaa6a;
    --heat-4:        #3a9040;
    --heat-5:        #1a7030;
    --dist-fill:     #b01a0a;
    --dist-hi:       #d42010;
}

/* ═══════════════════════════════════════════════════════
   RESET
   ═══════════════════════════════════════════════════════ */
* { margin:0; padding:0; box-sizing:border-box; }

::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background: var(--surface2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius:0; }
::-webkit-scrollbar-thumb:hover { background: var(--text-mute); }
* { scrollbar-width:thin; scrollbar-color: var(--border) var(--surface2); }

/* ═══════════════════════════════════════════════════════
   BODY + TOPBAR
   ═══════════════════════════════════════════════════════ */
body {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top bar ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 40px;
    background: var(--text);
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    overflow: hidden;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.1);
    height: 100%;
}

.topbar-badge {
    background: var(--accent);
    color: #fff;
    font-family: 'Oswald', sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 7px;
}

.topbar-title {
    font-family: 'Oswald', sans-serif;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}

.topbar-ticker-wrap {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.topbar-ticker-track {
    display: flex;
    gap: 80px;
    animation: tickerScroll 36s linear infinite;
    white-space: nowrap;
}

@keyframes tickerScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.topbar-ticker-item {
    font-size: 0.58em;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════════════════
   PAGE BODY — SIDEBAR + MAIN 2-COLUMN LAYOUT
   ═══════════════════════════════════════════════════════ */
.page-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: calc(100vh - 40px);
    position: sticky;
    top: 40px;
}

.sb-block {
    padding: 16px;
    border-bottom: 1px solid var(--border2);
}

.sb-label {
    font-family: 'Oswald', sans-serif;
    font-size: 0.58em;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 10px;
}

/* Session nav */
.sb-date-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7em;
    color: var(--text-dim);
    line-height: 1.5;
    margin-bottom: 8px;
    word-break: break-word;
}

.sb-nav-row {
    display: flex;
    gap: 6px;
}

.sb-nav-btn {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 6px 4px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.sb-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.sb-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Stats vertical in sidebar */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid var(--border2);
}

.stat-card {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border2);
    position: relative;
    overflow: hidden;
    transition: background 0.15s;
}

.stat-card:last-child { border-bottom: none; }
.stat-card:hover { background: var(--bg); }
.stat-shimmer { display: none; }

.stat-card h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52em;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-card .value {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.01em;
}

.stat-card .value.loading { color: var(--text-mute); animation: loadPulse 1.2s ease-in-out infinite; }
@keyframes loadPulse { 0%,100%{opacity:0.3} 50%{opacity:0.9} }

.stat-card .value.improving { color: var(--green); }
.stat-card .value.declining { color: var(--red); }
.stat-card .value.neutral   { color: var(--text); }

.stat-card .label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52em;
    color: var(--text-mute);
    margin-top: 3px;
    letter-spacing: 0.08em;
}

.stat-delta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56em;
    margin-top: 3px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.stat-delta.delta-better { color: var(--green); }
.stat-delta.delta-worse  { color: var(--red); }

/* All-time block */
.sb-alltime {}

.sb-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid var(--border2);
}

.sb-row:last-child { border-bottom: none; }

.sb-key {
    font-size: 0.58em;
    color: var(--text-mute);
    letter-spacing: 0.08em;
}

.sb-val {
    font-family: 'Oswald', sans-serif;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text);
}

/* Action buttons */
.session-toolbar {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.session-toolbar.toolbar-visible { opacity: 1; pointer-events: auto; }

.sb-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sb-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.sb-action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Keyboard hints */
.sb-hints {
    margin-top: auto;
}

.sb-hint-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    font-size: 0.58em;
    color: var(--text-mute);
}

kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1em;
    color: var(--text-dim);
}

/* Cache staleness */
.cache-staleness {
    display: block;
    font-size: 0.56em;
    color: var(--text-mute);
    margin-bottom: 6px;
    letter-spacing: 0.05em;
}

.cache-staleness.fresh { color: var(--green); opacity: 0.8; }
.cache-staleness.stale { color: var(--amber); }

/* ═══════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════ */
.main-content {
    flex: 1;
    overflow-y: auto;
    height: calc(100vh - 40px);
    position: sticky;
    top: 40px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Empty state ── */
.empty-state {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    border: 2px dashed var(--border);
    background: var(--surface);
}

.empty-state-inner {
    text-align: center;
    max-width: 360px;
}

.empty-icon {
    font-size: 3em;
    color: var(--border);
    margin-bottom: 20px;
    display: block;
    font-family: 'Instrument Serif', serif;
}

.empty-state h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.4em;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.empty-state p {
    font-size: 0.75em;
    line-height: 1.8;
    color: var(--text-mute);
    margin-bottom: 20px;
}

.empty-state p strong { color: var(--text-dim); }

.empty-cta {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    font-family: 'Oswald', sans-serif;
    font-size: 0.82em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}

.empty-cta:hover { background: var(--accent2); }

/* ── Section eyebrow (kept for app.js-injected elements) ── */
.section-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.section-eyebrow-line {
    width: 18px;
    height: 2px;
    background: var(--accent);
}

.section-eyebrow-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55em;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
}

.section-eyebrow-cube {
    width: 5px;
    height: 5px;
    background: var(--accent);
    transform: rotate(45deg);
    animation: spinCube 6s linear infinite;
    flex-shrink: 0;
}

@keyframes spinCube {
    from { transform: rotate(45deg); }
    to   { transform: rotate(405deg); }
}

.section-orb { display: none; }

/* ── Progress chart ── */
.progress-chart {
    background: var(--surface);
    padding: 20px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
}

.progress-chart h2,
.progress-overview h2,
.analytics-section h2,
.heatmap-container h2,
.distribution-container h2,
.comparison-container h2,
.success-container h2 {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-chart h2::before,
.progress-overview h2::before,
.analytics-section h2::before,
.heatmap-container h2::before,
.distribution-container h2::before,
.comparison-container h2::before,
.success-container h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 1em;
    background: var(--accent);
    flex-shrink: 0;
}

.chart-container {
    position: relative;
    height: 260px;
    background: var(--bg);
    border: 1px solid var(--border2);
    padding: 16px;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    gap: 4px;
}

.bar {
    flex: 1;
    background: var(--border);
    position: relative;
    min-width: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.bar:hover {
    background: var(--accent);
    transform: scaleY(1.01);
    transform-origin: bottom;
}

.bar--pb {
    background: var(--amber);
    border-top: 2px solid var(--gold);
}

.bar--pb:hover { background: #aa8000; }

.bar-pb-crown {
    position: absolute;
    top: -24px; left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    color: var(--gold);
    line-height: 1;
}

.bar--worst {
    background: #d8c0b8;
}

.bar--worst:hover { background: var(--accent); }

.bar-worst-marker {
    position: absolute;
    top: -22px; left: 50%;
    transform: translateX(-50%);
    font-size: 0.65em;
    color: var(--accent);
    line-height: 1;
}

.bar-label {
    position: absolute;
    bottom: -22px; left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: var(--text-mute);
    white-space: nowrap;
}

.bar-value {
    position: absolute;
    top: -20px; left: 50%;
    transform: translateX(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
}

/* ── Solves table ── */
.solves-table {
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}

.solves-table h2 {
    padding: 12px 18px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
    font-family: 'Oswald', sans-serif;
    font-size: 0.88em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 8px;
    /* Override gradient from app.js-generated styles */
    background-clip: unset !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    background: var(--surface2) !important;
}

.solves-table h2::before {
    content: '';
    display: inline-block;
    width: 3px; height: 1em;
    background: var(--accent);
    flex-shrink: 0;
}

.solves-table h2 span { color: var(--text); }
.solves-table table thead { position: sticky; top: 0; z-index: 2; }

table { width: 100%; border-collapse: collapse; }

th, td {
    padding: 9px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border2);
}

th {
    background: var(--surface2);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-mute);
    font-size: 0.55em;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--border);
}

tbody tr { background: var(--surface); transition: background 0.1s; cursor: pointer; }
tbody tr:hover { background: var(--bg); }
tbody tr:last-child td { border-bottom: none; }

td { font-family: 'JetBrains Mono', monospace; color: var(--text-dim); font-size: 0.8em; }
.time { font-weight: 700; color: var(--text); font-size: 1.05em; }
.penalty { color: var(--red); font-size: 0.85em; }
.scramble { font-size: 0.78em; color: var(--text-mute); word-break: break-all; }
.best-time  { background: rgba(26,107,53,0.06) !important; border-left: 3px solid rgba(26,107,53,0.4) !important; }
.worst-time { background: rgba(176,26,10,0.05) !important; border-left: 3px solid rgba(176,26,10,0.3) !important; }

.overview-loaded-content {
    padding: 0;
}

.overview-loaded-content .progress-chart {
    border: none;
    border-bottom: 1px solid var(--border2);
    border-top: none;
}

/* Empty state inside tab (no fixed height needed) */
#overviewView .empty-state {
    border: none;
    background: transparent;
    padding: 40px 20px;
    font-size: 0.75em;
    color: var(--text-mute);
    padding: 20px 0;
    font-style: italic;
    letter-spacing: 0.04em;
}

/* ── Visualization tabs ── */
.visualization-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--text-mute);
    overflow: hidden;
}

.view-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--surface2);
    padding: 0;
    gap: 0;
}

.tab-button {
    flex: 1;
    padding: 10px 8px;
    border: none;
    border-right: 1px solid var(--border2);
    background: transparent;
    color: var(--text-mute);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58em;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.tab-button:last-child { border-right: none; }
.tab-button:hover { color: var(--text-dim); background: var(--border2); }

.tab-button.active {
    color: var(--accent);
    background: var(--surface);
    font-weight: 700;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent);
}

.view-content { display: none; padding: 22px; }
.view-content.active { display: block; }

/* ── Progress overview ── */
.progress-overview {
    background: var(--surface);
    padding: 22px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--text);
}

.overview-stats { display: none; } /* stats live in sidebar */

.trend-chart {
    height: 230px;
    background: var(--bg);
    border: 1px solid var(--border2);
    padding: 12px;
}

#progressCanvas { width: 100%; height: 100%; }

/* ── Analytics section ── */
.analytics-section {
    background: var(--surface);
    padding: 22px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--text-dim);
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.analytics-card {
    background: var(--bg);
    padding: 16px;
    border: 1px solid var(--border2);
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.analytics-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 3px;
    background: var(--accent);
    transition: width 0.3s;
}

.analytics-card:hover { border-color: var(--border); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.analytics-card:hover::before { width: 100%; }

.analytics-card h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 0.78em;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 4px;
    font-weight: 600;
}

.analytics-desc {
    font-size: 0.68em;
    color: var(--text-mute);
    margin-bottom: 14px;
    line-height: 1.6;
    font-family: 'JetBrains Mono', monospace;
}

.analytics-card--wide { grid-column: 1 / -1; }

.analytics-insight {
    background: var(--surface2);
    padding: 10px 12px;
    border-left: 3px solid var(--accent);
    font-size: 0.68em;
    color: var(--text-dim);
    line-height: 1.7;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    margin-top: 10px;
}

.analytics-insight::before {
    content: '//';
    position: absolute;
    top: 10px; right: 10px;
    color: var(--text-mute);
    font-size: 0.9em;
    font-weight: 700;
}

.analytics-insight strong { color: var(--text); font-weight: 600; }

/* ─────────────────────────────────────────────────────────
   METRIC ROWS, PB LOG, etc. (analytics card contents)
   ───────────────────────────────────────────────────────── */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border2);
    font-size: 0.8em;
}

.metric-row:last-child { border-bottom: none; }
.metric-label { font-family: 'JetBrains Mono', monospace; color: var(--text-dim); font-size: 0.88em; }
.metric-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.metric-value.green  { color: var(--green); }
.metric-value.red    { color: var(--red); }
.metric-value.blue   { color: var(--sky); }
.metric-value.orange { color: var(--orange); }

#pbLogList {
    display: flex; flex-direction: column;
    max-height: 260px; overflow-y: auto;
    scrollbar-width: thin;
}

.pb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border2);
    font-size: 0.85em;
}

.pb-item:last-child { border-bottom: none; }
.pb-item-left { display: flex; flex-direction: column; gap: 1px; }

.pb-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.pb-value {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    color: var(--amber);
    font-size: 1.05em;
    letter-spacing: 0.02em;
}

.pb-item:first-child .pb-value { color: var(--accent); }

.pb-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7em;
    color: var(--text-mute);
}

/* Canvas sizes */
#varianceCanvas, #subXCanvas { width:100%; height:180px; margin-bottom:10px; }
#subXCanvas { height:200px; }
#consistencyCanvas { width:100%; height:220px; margin-bottom:12px; }
#sessionThirdsCanvas { width:100%; height:200px; margin-bottom:12px; }
#distributionCanvas, #successCanvas { width:100%; height:260px; margin-top:16px; }

/* Chart hover tip */
.chart-hover-tip {
    position: fixed;
    display: none;
    z-index: 8000;
    background: var(--text);
    border: none;
    padding: 10px 14px;
    pointer-events: none;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.chart-tip-date {
    font-family: 'Oswald', sans-serif;
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chart-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68em;
    padding: 2px 0;
}

.chart-tip-row span:first-child { color: rgba(255,255,255,0.5); }
.chart-tip-row span:last-child  { color: #fff; font-weight: 600; }

/* ─────────────────────────────────────────────────────────
   TIMELINE VIEW
   ───────────────────────────────────────────────────────── */
.timeline-container { padding: 4px 0; }

.timeline-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.timeline-header h2 { margin-bottom: 4px; }
.timeline-desc { font-size: 0.65em; color: var(--text-mute); letter-spacing: 0.06em; }

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.timeline-control-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.timeline-target-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    font-weight: 700;
    padding: 3px 7px;
    width: 50px;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
    transition: border-color 0.15s;
}

.timeline-target-input::-webkit-outer-spin-button,
.timeline-target-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.timeline-target-input:focus { border-color: var(--accent); }
.timeline-target-unit { font-family: 'JetBrains Mono', monospace; font-size: 0.6em; color: var(--text-mute); }

.timeline-canvas-wrap {
    position: relative;
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border2);
    overflow: hidden;
}

#timelineCanvas { display: block; width: 100%; }

.timeline-tip {
    position: fixed;
    z-index: 9000;
    background: var(--text);
    padding: 10px 14px;
    pointer-events: none;
    min-width: 170px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.tl-tip-date {
    font-family: 'Oswald', sans-serif;
    font-size: 0.8em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    padding-bottom: 7px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tl-tip-pb { font-size: 0.8em; color: #ffd000; margin-left: 4px; }

.tl-tip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68em;
    padding: 2px 0;
}

.tl-tip-row span:first-child { color: rgba(255,255,255,0.45); }
.tl-tip-row span:last-child  { color: #fff; font-weight: 600; }
.tl-tip-muted span:first-child,
.tl-tip-muted span:last-child { color: rgba(255,255,255,0.2) !important; font-weight: 400; }

.tl-tip-click {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: rgba(255,255,255,0.4);
    margin-top: 7px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.timeline-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tl-leg {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: var(--text-mute);
}

.tl-leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-leg-dash { display: inline-block; width: 14px; height: 0; border-top: 2px dashed; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────
   HEATMAP
   ───────────────────────────────────────────────────────── */
.heatmap-desc, .distribution-desc, .success-desc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65em;
    color: var(--text-mute);
    margin-bottom: 16px;
}

#heatmapGrid { margin-top: 16px; }
.heatmap-row { display: flex; align-items: center; margin-bottom: 4px; }

.heatmap-label {
    width: 54px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    color: var(--text-mute);
    letter-spacing: 0.06em;
}

.heatmap-cells { display: flex; gap: 3px; flex: 1; }

.heatmap-cell {
    flex: 1;
    height: 20px;
    background: var(--border2);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    transition: all 0.1s;
}

.heatmap-cell:hover { transform: scale(1.05); border-color: var(--accent); }
.heatmap-cell.level-1 { background: var(--heat-2); border-color: #70aa70; }
.heatmap-cell.level-2 { background: var(--heat-3); border-color: #3a9040; }
.heatmap-cell.level-3 { background: var(--heat-4); border-color: #1a7030; box-shadow: 0 0 4px rgba(26,112,48,0.3); }
.heatmap-cell.level-4 { background: var(--heat-5); border-color: #1a7030; box-shadow: 0 0 6px rgba(26,112,48,0.4); }

.heatmap-tooltip {
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    margin-bottom: 4px;
    z-index: 1000;
    font-family: 'JetBrains Mono', monospace;
}

.heatmap-cell:hover .heatmap-tooltip { opacity: 1; }

/* ─────────────────────────────────────────────────────────
   COMPARISON
   ───────────────────────────────────────────────────────── */
.comparison-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.selector-group { display: flex; flex-direction: column; gap: 5px; }

.selector-group label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: var(--text-mute);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.selector-group select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75em;
    cursor: pointer;
    background: var(--bg);
    color: var(--text);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s;
}

.selector-group select:focus { border-color: var(--accent); }
.selector-group select option { background: var(--bg); color: var(--text); }
#comparisonResults { display: block; }

.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.82em; }

.comparison-table thead th {
    padding: 8px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.65em;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-mute);
    background: var(--surface2);
    border-bottom: 2px solid var(--border);
    text-align: center;
}

.comparison-table thead th.col-left  { text-align: right; width: 35%; }
.comparison-table thead th.col-center { text-align: center; width: 30%; }
.comparison-table thead th.col-right { text-align: left; width: 35%; }

.comparison-table tbody tr { border-bottom: 1px solid var(--border2); transition: background 0.1s; }
.comparison-table tbody tr:hover { background: var(--surface2); }

.comparison-table td {
    padding: 9px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    vertical-align: middle;
    color: var(--text-mute);
}

.comparison-table td.col-left  { text-align: right; }
.comparison-table td.col-right { text-align: left; }

.comparison-table td.col-center {
    text-align: center;
    font-size: 0.65em;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.comparison-table td.winner { color: var(--text); font-weight: 700; }
.comparison-table td.loser  { color: var(--text-mute); }
.comparison-table td.tied   { color: var(--text-dim); }

.comparison-table td.col-left.winner  { border-right: 2px solid var(--accent); }
.comparison-table td.col-right.winner { border-left: 2px solid var(--purple); }
.comparison-table td.col-left.loser   { border-right: 2px solid transparent; }
.comparison-table td.col-right.loser  { border-left: 2px solid transparent; }
.comparison-table td.col-left.tied    { border-right: 2px solid var(--border); }
.comparison-table td.col-right.tied   { border-left: 2px solid var(--border); }

.cmp-bar-wrap { height: 2px; background: var(--border2); margin-top: 4px; overflow: hidden; }
.cmp-bar-left  .cmp-bar-fill { float: right; height: 100%; background: var(--accent); }
.cmp-bar-right .cmp-bar-fill { float: left;  height: 100%; background: var(--purple); }
.cmp-bar-left.loser-bar  .cmp-bar-fill,
.cmp-bar-right.loser-bar .cmp-bar-fill { background: var(--border); }

.comparison-delta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    color: var(--text-mute);
    display: block; margin-top: 1px;
}

.comparison-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--surface2);
    border-left: 3px solid var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68em;
    color: var(--text-dim);
    text-align: center;
}

.comparison-summary-winner { font-weight: 700; color: var(--text); }

/* ─────────────────────────────────────────────────────────
   SUCCESS RATE
   ───────────────────────────────────────────────────────── */
.success-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.success-card {
    background: var(--surface2);
    padding: 12px;
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--border);
    text-align: center;
    transition: border-bottom-color 0.2s;
}

.success-card:hover { border-bottom-color: var(--green); }

.success-threshold {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58em;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 5px;
}

.success-percentage {
    font-family: 'Oswald', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 2px;
}

.success-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58em;
    color: var(--text-mute);
}

/* ─────────────────────────────────────────────────────────
   ANALYTICS CARD DETAIL COMPONENTS
   ───────────────────────────────────────────────────────── */

#milestoneList {
    background: var(--surface2);
    border: 1px solid var(--border2);
    padding: 4px 12px;
    margin-bottom: 10px;
}

.milestone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border2);
}

.milestone-item:last-child { border-bottom: none; }
.milestone-target { font-family: 'Oswald', sans-serif; font-size: 0.82em; font-weight: 600; color: var(--accent); letter-spacing: 0.04em; }
.milestone-date   { font-family: 'JetBrains Mono', monospace; font-size: 0.68em; color: var(--text-mute); }
.milestone-achieved { color: var(--green); font-weight: 700; }
.milestone-projected { color: var(--text-dim); }

.milestone-progress { width:100%; height:2px; background: var(--border2); margin-top:4px; overflow:hidden; }
.milestone-progress-bar { height:100%; background: var(--accent); transition: width 0.4s ease; }

.breaking-point-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 160px;
    gap: 2px;
    margin-top: 16px;
}

.bp-bar { flex:1; background: var(--border); position: relative; min-width: 5px; transition: background 0.15s; }
.bp-bar.danger  { background: #e0b8b0; }
.bp-bar.warning { background: #e0d0a0; }
.bp-bar:hover { opacity: 0.7; }

.bp-bar-label {
    position: absolute;
    bottom: -18px; left: 50%;
    transform: translateX(-50%);
    font-size: 0.58em;
    color: var(--text-mute);
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}

.session-grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px; height: 52px;
    font-family: 'Oswald', sans-serif;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.grade-a { background: rgba(26,107,53,0.1);  color: var(--green);  border: 1px solid rgba(26,107,53,0.25); }
.grade-b { background: rgba(26,74,138,0.1);  color: var(--sky);    border: 1px solid rgba(26,74,138,0.25); }
.grade-c { background: rgba(138,98,0,0.1);   color: var(--amber);  border: 1px solid rgba(138,98,0,0.25); }
.grade-d { background: rgba(176,26,10,0.1);  color: var(--red);    border: 1px solid rgba(176,26,10,0.25); }

.grade-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.grade-desc { font-family: 'JetBrains Mono', monospace; font-size: 0.65em; color: var(--text-mute); margin-top: 3px; }

.confidence-index { margin-bottom: 8px; }

.confidence-bar-track { height: 6px; background: var(--border2); border: 1px solid var(--border); overflow: hidden; margin: 7px 0 4px; }
.confidence-bar-fill  { height: 100%; transition: width 0.4s ease; }

.confidence-value { font-family: 'Oswald', sans-serif; font-size: 2.4em; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 3px; }

.streak-display { text-align: center; padding: 10px 0; }
.streak-number  { font-family: 'Oswald', sans-serif; font-size: 2.8em; font-weight: 700; color: var(--accent); line-height: 1; }
.streak-unit    { font-family: 'JetBrains Mono', monospace; font-size: 0.58em; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.18em; }
.streak-row     { display: flex; gap: 20px; justify-content: center; margin-top: 12px; }
.streak-item    { text-align: center; }
.streak-item .streak-number { font-size: 1.8em; }

.plateau-indicator { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 10px; }
.plateau-dot    { width: 8px; height: 8px; flex-shrink: 0; }
.plateau-active { background: rgba(138,98,0,0.08);  border: 1px solid rgba(138,98,0,0.25); }
.plateau-active .plateau-dot { background: var(--amber); }
.plateau-clear  { background: rgba(26,107,53,0.08); border: 1px solid rgba(26,107,53,0.25); }
.plateau-clear  .plateau-dot { background: var(--green); }

.improvement-speed-bar { height: 3px; background: var(--border2); margin: 7px 0; overflow: hidden; }
.improvement-speed-fill { height: 100%; background: var(--accent); }

.days-since-pb     { text-align: center; padding: 10px 0; }
.days-since-number { font-family: 'Oswald', sans-serif; font-size: 2.8em; font-weight: 700; color: var(--accent); line-height: 1; }
.days-since-label  { font-family: 'JetBrains Mono', monospace; font-size: 0.58em; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.18em; }

.tod-row {
    display: grid;
    grid-template-columns: 74px 1fr 78px;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border2);
    opacity: 0.45;
    transition: opacity 0.2s;
}

.tod-row:last-child { border-bottom: none; }
.tod-row--best      { opacity: 1; }

.tod-label  { display: flex; flex-direction: column; gap: 1px; }
.tod-period { font-family: 'Oswald', sans-serif; font-size: 0.82em; font-weight: 600; color: var(--text); letter-spacing: 0.04em; }
.tod-range  { font-family: 'JetBrains Mono', monospace; font-size: 0.56em; color: var(--text-mute); }

.tod-bar-wrap { height: 4px; background: var(--border2); overflow: hidden; }
.tod-bar      { height: 100%; transition: width 0.4s ease; }

.tod-stats  { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.tod-avg    { font-family: 'JetBrains Mono', monospace; font-size: 0.75em; font-weight: 700; color: var(--text); }
.tod-count  { font-family: 'JetBrains Mono', monospace; font-size: 0.56em; color: var(--text-mute); }

.isr-bars  { margin-top: 10px; }

.isr-row {
    display: grid;
    grid-template-columns: 48px 1fr 62px;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid var(--border2);
}

.isr-row:last-child { border-bottom: none; }
.isr-label   { font-family: 'JetBrains Mono', monospace; font-size: 0.62em; color: var(--text-dim); white-space: nowrap; }
.isr-bar-wrap { height: 4px; background: var(--border2); overflow: hidden; }
.isr-bar      { height: 100%; background: var(--accent); opacity: 0.5; transition: width 0.4s ease; }
.isr-avg      { font-family: 'JetBrains Mono', monospace; font-size: 0.7em; font-weight: 700; color: var(--text); text-align: right; }

/* Distribution toggle */
.dist-toggle { display: flex; gap: 5px; margin-bottom: 10px; }
.dist-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-mute);
    padding: 4px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62em;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.12s;
    text-transform: uppercase;
}

.dist-toggle-btn:hover { border-color: var(--accent); color: var(--text-dim); }
.dist-toggle-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ═══════════════════════════════════════════════════════
   CALENDAR MODAL
   ═══════════════════════════════════════════════════════ */
.floating-calendar-btn {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 46px; height: 46px;
    background: var(--text);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    display: none;   /* hidden on desktop — visible only <768px */
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.floating-calendar-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(176,26,10,0.3);
}

#calendarModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(28,24,20,0.7);
    backdrop-filter: blur(3px);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#calendarModal.active { display: flex; }

.calendar-modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.calendar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border2);
}

.calendar-modal-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    color: var(--text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.session-nav-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 30px; height: 30px;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}

.session-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.session-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.close-modal {
    background: none;
    border: 1px solid var(--border);
    font-size: 1.2em;
    color: var(--text-mute);
    cursor: pointer;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}

.close-modal:hover { color: var(--accent); border-color: var(--accent); }

.date-selector {
    background: var(--surface);
    padding: 16px;
    border: 1px solid var(--border2);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 14px);
    gap: 3px;
    margin-top: 8px;
}

.calendar-day {
    width: 14px; height: 14px;
    background: var(--border2);
    cursor: pointer;
    position: relative;
    border: 1px solid var(--border);
    transition: all 0.1s ease;
}

.calendar-day:hover { border-color: var(--accent); transform: scale(1.25); }
.calendar-day.has-data         { background: var(--heat-2); border-color: #70aa70; }
.calendar-day.has-data.level-1 { background: var(--heat-2); }
.calendar-day.has-data.level-2 { background: var(--heat-3); border-color: #3a9040; }
.calendar-day.has-data.level-3 { background: var(--heat-4); border-color: #1a7030; }

.calendar-day.selected {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    z-index: 10;
    animation: selPulse 2s ease-in-out infinite;
}

@keyframes selPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(176,26,10,0.5); }
    50%      { box-shadow: 0 0 0 3px rgba(176,26,10,0.1); }
}

.calendar-tooltip {
    position: absolute;
    bottom: 100%; left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    margin-bottom: 4px;
    z-index: 1000;
    font-family: 'JetBrains Mono', monospace;
}

.calendar-day:hover .calendar-tooltip { opacity: 1; }

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 10px;
    color: var(--text-mute);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
}

.calendar-legend-item { width: 11px; height: 11px; border: 1px solid var(--border2); }
.calendar-legend-item:nth-child(2) { background: var(--border2) !important; }
.calendar-legend-item:nth-child(3) { background: var(--heat-2)  !important; }
.calendar-legend-item:nth-child(4) { background: var(--heat-3)  !important; }
.calendar-legend-item:nth-child(5) { background: var(--heat-4)  !important; }
.calendar-legend-item:nth-child(6) { background: var(--heat-5)  !important; }

.calendar-loading {
    color: var(--text-mute);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75em;
    padding: 20px;
    text-align: center;
    letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════════════════
   SHARE MODAL
   ═══════════════════════════════════════════════════════ */
#shareModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(28,24,20,0.75);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#shareModal.active { display: flex; }

.share-modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 24px;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border2);
}

.share-modal-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    color: var(--text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.share-card-type-switcher {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.share-card-type-btn {
    flex: 1;
    padding: 7px 0;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-mute);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65em;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}

.share-card-type-btn:hover { border-color: var(--accent); color: var(--text-dim); }
.share-card-type-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

#shareCardPreview { margin: 16px 0; border: 1px solid var(--border); overflow: hidden; }

/* Share card itself */
.share-card {
    background: #1a1612;
    color: #e8e0d4;
    padding: 36px 30px 30px;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    overflow: hidden;
}

.share-card > * { position: relative; z-index: 1; }

.share-card-bg-grid {
    position: absolute; inset: 0; z-index: 0;
    background-image:
        linear-gradient(rgba(176,26,10,0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(176,26,10,0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

.share-card-bg-orb {
    position: absolute;
    top: -50px; right: -30px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(176,26,10,0.15) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

.share-card--overall .share-card-bg-orb {
    background: radial-gradient(circle, rgba(90,42,138,0.15) 0%, transparent 70%);
}

.share-card--overall .share-card-title { color: #c084fc; }

.share-card-header { margin-bottom: 20px; }

.share-card-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 0.6em;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.share-card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: #f0e8e0;
    line-height: 1;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.share-card-date { font-size: 0.68em; color: #3a3028; }

.share-card-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-bottom: 20px;
    opacity: 0.4;
}

.share-card-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #2a2018;
    border: 1px solid #2a2018;
    margin-bottom: 6px;
}

.share-card-hero-block { background: #161210; padding: 12px; }

.share-card-hero-label {
    font-size: 0.52em; font-weight: 600;
    letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 4px;
}

.share-card-hero-value {
    font-family: 'Oswald', sans-serif;
    font-size: 2.4em; font-weight: 700;
    color: #f0e8e0; letter-spacing: -0.01em; line-height: 1;
}

.share-card-grid4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1px;
    background: #201810;
    border: 1px solid #201810;
    margin-bottom: 6px;
    overflow: hidden;
}

.share-card-cell { background: #0e0c0a; padding: 9px 7px; }

.share-card-cell-label {
    font-size: 0.5em; font-weight: 600;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: #2a2018; margin-bottom: 3px; white-space: nowrap;
}

.share-card-cell-value {
    font-size: 0.8em; font-weight: 600; color: #c8b8a8; white-space: nowrap;
}

.share-card-cell-value--dim { color: #3a2a1a; }

.share-card-row2 { display: flex; gap: 5px; margin-bottom: 16px; }

.share-card-pill {
    flex: 1;
    background: rgba(176,26,10,0.06);
    border: 1px solid #1a1410;
    padding: 7px 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.share-card-pill-label { font-size: 0.5em; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: #2a2018; white-space: nowrap; }
.share-card-pill-value { font-size: 0.72em; font-weight: 700; white-space: nowrap; }
.share-card-pill-value.positive { color: #3a9040; }
.share-card-pill-value.negative { color: #b01a0a; }
.share-card-pill-value.neutral  { color: #3a2a1a; }

.share-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #1a1410;
    padding-top: 12px;
}

.share-card-footer-solves { font-size: 0.6em; color: #2a2018; }

.share-card-footer-brand {
    font-family: 'Oswald', sans-serif;
    font-size: 0.55em; font-weight: 600;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent);
}

.share-actions { display: flex; gap: 8px; justify-content: center; }

.share-action-btn {
    background: var(--text);
    color: #fff;
    border: none;
    padding: 9px 18px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.75em;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
    font-weight: 600;
}

.share-action-btn:hover { background: var(--accent); }

.share-action-btn.secondary {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.share-action-btn.secondary:hover { border-color: var(--text-dim); color: var(--text); }

/* ═══════════════════════════════════════════════════════
   SOLVE DETAIL MODAL
   ═══════════════════════════════════════════════════════ */
#solveDetailModal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(28,24,20,0.75);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#solveDetailModal.active { display: flex; }

.solve-modal-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 24px;
    max-width: 520px;
    width: 100%;
}

.solve-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border2);
}

.solve-modal-header h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    color: var(--text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.solve-modal-time {
    font-family: 'Oswald', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    color: var(--accent);
    text-align: center;
    margin: 16px 0 14px;
    letter-spacing: -0.01em;
    line-height: 1;
}

.solve-modal-label {
    font-size: 0.6em;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.solve-modal-scramble {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border2);
    padding: 12px;
    line-height: 1.7;
    word-break: break-word;
}

.cube-visualizer {
    background: var(--surface);
    border: 1px solid var(--border2);
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
}

scramble-display {
    width: 100%;
    height: 200px;
    --background-color: transparent;
}

/* ═══════════════════════════════════════════════════════
   ENTRANCE ANIMATIONS
   ═══════════════════════════════════════════════════════ */
.sidebar     { animation: slideIn  0.4s ease both; }
.main-content { animation: fadeUp  0.4s ease both 0.08s; }

@keyframes slideIn {
    from { transform: translateX(-16px); opacity: 0; }
    to   { transform: translateX(0);     opacity: 1; }
}

@keyframes fadeUp {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .analytics-grid { grid-template-columns: 1fr; }
    .analytics-card--wide { grid-column: 1; }
}

@media (max-width: 768px) {
    .page-body { flex-direction: column; overflow: visible; }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid var(--border);
        overflow: visible;
    }

    .sb-block {
        flex: 1;
        min-width: 160px;
        border-right: 1px solid var(--border2);
        border-bottom: none;
    }

    .sb-block:last-child { border-right: none; }

    #statsGrid.stats-grid {
        flex-direction: row;
        flex-wrap: wrap;
        border: none;
        padding: 0;
        width: 100%;
        border-top: 1px solid var(--border2);
        border-bottom: 1px solid var(--border);
        border-right: none !important;
    }

    .stat-card {
        flex: 1;
        min-width: 120px;
        border-right: 1px solid var(--border2);
        border-bottom: none;
    }

    .stat-card:last-child { border-right: none; }

    .main-content {
        height: auto;
        position: static;
        overflow: visible;
    }

    .view-tabs { flex-wrap: wrap; }
    .tab-button { flex: 1 1 33.33%; }

    .solves-table table thead tr th:nth-child(3),
    .solves-table table tbody tr td:nth-child(3) { display: none; }

    .bar-value { display: none; }

    .floating-calendar-btn { display: flex; }

    .sb-hints { display: none; }

    .heatmap-label { width: 30px; font-size: 0.6em; }
    .heatmap-cells { gap: 2px; }
    .heatmap-cell { height: 16px; }

    #distributionCanvas, #successCanvas { height: 200px; }
    .success-grid { grid-template-columns: repeat(2, 1fr); }
    .comparison-table { font-size: 0.75em; }
    .comparison-table td { padding: 7px 6px; }
    .comparison-selectors { grid-template-columns: 1fr 1fr; gap: 10px; }

    .timeline-header { flex-direction: column; }
    .timeline-controls { width: 100%; }
}

@media (max-width: 480px) {
    .sidebar { flex-direction: column; }
    .sb-block { border-right: none; border-bottom: 1px solid var(--border2); }
    #statsGrid.stats-grid { flex-direction: column; }
    .stat-card { border-right: none; border-bottom: 1px solid var(--border2); }
    .tab-button { flex: 1 1 50%; }
    .comparison-delta { display: none; }
}

/* ═══════════════════════════════════════════════════════
   TRAINER PAGE (unchanged)
   ═══════════════════════════════════════════════════════ */
.trainer-layout {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 60px 1fr;
    height: 100vh;
    gap: 0;
}

.trainer-layout > header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-height: 0;
    border-radius: 0;
    margin-bottom: 0;
    box-shadow: none;
    overflow: visible;
    animation: none;
}

.trainer-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 13px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--accent);
}

.trainer-logo span { color: var(--text-dim); font-weight: 400; }

.trainer-header-stats {
    display: flex; gap: 24px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em;
}

.trainer-header-stats b { color: var(--text); }

.trainer-sidebar {
    border-right: 1px solid var(--border);
    background: var(--surface);
    display: flex; flex-direction: column; overflow: hidden;
}

.trainer-sidebar-section { padding: 16px; border-bottom: 1px solid var(--border); }

.trainer-section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--text-mute); margin-bottom: 12px;
}

.trainer-filter-row { display: flex; gap: 6px; margin-bottom: 8px; }

.trainer-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; letter-spacing: 0.08em;
    padding: 6px 10px; border: 1px solid var(--border);
    background: transparent; color: var(--text-dim);
    cursor: pointer; transition: all 0.15s; text-transform: uppercase; border-radius: 4px;
}

.trainer-btn:hover { border-color: var(--accent); color: var(--accent); }
.trainer-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.trainer-btn.danger { border-color: var(--red); color: var(--red); }
.trainer-btn.danger:hover { background: var(--red); color: #fff; }

.trainer-select {
    font-family: 'JetBrains Mono', monospace; font-size: 11px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); padding: 6px 10px; width: 100%;
    margin-bottom: 8px; outline: none; cursor: pointer; border-radius: 4px;
}

.trainer-select:focus { border-color: var(--accent); }

.trainer-scramble-list { flex: 1; overflow-y: auto; padding: 8px; }

.trainer-scramble-item {
    padding: 10px 12px; margin-bottom: 4px;
    border: 1px solid transparent; cursor: pointer;
    transition: all 0.12s; position: relative; border-radius: 6px;
}

.trainer-scramble-item:hover { border-color: var(--border); background: var(--surface2); }
.trainer-scramble-item.selected { border-color: var(--accent); background: var(--accent-dim); }
.trainer-scramble-item.current-active { border-color: var(--sky); background: rgba(26,74,138,0.06); }

.si-time { font-size: 13px; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.si-time.fast { color: var(--green); }
.si-time.mid  { color: var(--sky); }
.si-time.slow { color: var(--red); }

.si-scramble { font-size: 9px; color: var(--text-dim); line-height: 1.5; letter-spacing: 0.05em; word-break: break-all; font-family: 'JetBrains Mono', monospace; }
.si-meta     { font-size: 9px; color: var(--text-mute); margin-top: 4px; display: flex; gap: 8px; font-family: 'JetBrains Mono', monospace; }
.si-rank     { position: absolute; top: 8px; right: 8px; font-size: 9px; color: var(--text-mute); font-family: 'JetBrains Mono', monospace; }
.si-attempts { font-size: 9px; margin-top: 4px; font-family: 'JetBrains Mono', monospace; }

.trainer-main {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 0; position: relative; padding: 40px;
}

.trainer-scramble-display { text-align: center; margin-bottom: 40px; max-width: 640px; }

.trainer-scramble-moves {
    font-family: 'JetBrains Mono', monospace; font-size: 18px;
    font-weight: 700; letter-spacing: 0.15em; line-height: 1.6;
    color: var(--text); margin-bottom: 12px;
}

.trainer-scramble-moves .move { display: inline-block; padding: 2px 4px; transition: color 0.1s; }
.trainer-scramble-moves .move.highlight { color: var(--accent); }

.trainer-scramble-info { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); letter-spacing: 0.1em; }

.trainer-pb-banner {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--amber); margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}

.trainer-pb-banner::before,
.trainer-pb-banner::after { content: ''; height: 1px; width: 40px; background: var(--amber); opacity: 0.4; }
.trainer-pb-banner.hidden { display: none; }

.trainer-timer-wrap { position: relative; margin-bottom: 32px; }

.timer {
    font-family: 'Oswald', sans-serif;
    font-size: 96px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text); text-align: center; transition: color 0.1s;
    line-height: 1; min-width: 500px;
}

.timer.ready      { color: var(--accent); }
.timer.running    { color: var(--text); }
.timer.done-fast  { color: var(--green); }
.timer.done-slow  { color: var(--orange); }
.timer.done-normal { color: var(--sky); }

.trainer-timer-hint {
    text-align: center; font-family: 'JetBrains Mono', monospace;
    font-size: 11px; color: var(--text-dim); letter-spacing: 0.15em; text-transform: uppercase; margin-top: 8px;
}

.trainer-compare-bar { width: 480px; margin-bottom: 32px; }

.trainer-compare-label {
    display: flex; justify-content: space-between;
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    color: var(--text-dim); letter-spacing: 0.1em; margin-bottom: 6px;
}

.trainer-compare-label span { color: var(--text); font-weight: 700; }

.trainer-bar-track { height: 4px; background: var(--surface2); border: 1px solid var(--border); position: relative; overflow: hidden; }
.trainer-bar-fill  { height: 100%; background: var(--sky); transition: width 0.3s ease; position: relative; }
.trainer-bar-pb-marker { position: absolute; top: -4px; width: 2px; height: 12px; background: var(--amber); }

.trainer-result-panel {
    background: var(--surface2); border: 1px solid var(--border);
    padding: 20px 28px; width: 480px; display: none; border-radius: 8px;
    max-height: 220px; overflow-y: auto;
}

.trainer-result-panel.visible { display: block; }

.trainer-result-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; font-size: 12px; font-family: 'JetBrains Mono', monospace;
}

.trainer-result-row:last-child { margin-bottom: 0; }
.trainer-result-key { color: var(--text-dim); letter-spacing: 0.1em; }
.trainer-result-val { font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.trainer-result-val.positive { color: var(--green); }
.trainer-result-val.negative { color: var(--red); }
.trainer-result-val.neutral  { color: var(--sky); }

.trainer-controls { display: flex; gap: 10px; margin-top: 20px; }

.trainer-ctrl-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
    padding: 10px 20px; border: 1px solid var(--border);
    background: transparent; color: var(--text-dim); cursor: pointer;
    transition: all 0.15s; border-radius: 6px;
}

.trainer-ctrl-btn:hover { border-color: var(--text-dim); color: var(--text); }
.trainer-ctrl-btn.primary { border-color: var(--accent); color: var(--accent); }
.trainer-ctrl-btn.primary:hover { background: var(--accent); color: #fff; }

.trainer-state-msg {
    text-align: center; font-family: 'JetBrains Mono', monospace;
    color: var(--text-dim); font-size: 13px; letter-spacing: 0.1em; line-height: 2;
}

.trainer-state-msg b { color: var(--accent); display: block; font-size: 11px; margin-bottom: 8px; letter-spacing: 0.2em; text-transform: uppercase; }

.trainer-toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--surface2); border: 1px solid var(--accent);
    color: var(--accent); font-family: 'JetBrains Mono', monospace;
    font-size: 11px; letter-spacing: 0.12em; padding: 10px 18px;
    z-index: 999; opacity: 0; transform: translateY(8px);
    transition: all 0.2s; pointer-events: none; border-radius: 6px;
}

.trainer-toast.show { opacity: 1; transform: translateY(0); }

.trainer-load-status {
    padding: 10px 16px; border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px; letter-spacing: 0.12em; color: var(--text-dim);
    display: flex; justify-content: space-between; align-items: center;
}

.trainer-load-status .load-ok   { color: var(--green); }
.trainer-load-status .load-skip { color: var(--text-mute); }
.trainer-load-bar { height: 2px; background: var(--surface2); overflow: hidden; }
.trainer-load-bar-fill { height: 100%; background: var(--sky); width: 0%; transition: width 0.2s; }

body.trainer-page { padding: 0; background: var(--bg); }
body.trainer-page::before, body.trainer-page::after { display: none; }

/* ═══════════════════════════════════════════════════════
   OLL REFERENCE PAGE
   ═══════════════════════════════════════════════════════ */

body.oll-page {
    padding: 0;
    background: var(--bg);
}

/* ── Header ── */
.oll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 52px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.oll-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.oll-header-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.18em;
    background: var(--accent);
    color: #fff;
    padding: 3px 8px;
}

.oll-header-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text);
}

.oll-header-title span {
    color: var(--text-dim);
    font-weight: 400;
}

.oll-header-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6em;
    color: var(--text-mute);
    letter-spacing: 0.12em;
}

.oll-header-nav { display: flex; align-items: center; gap: 20px; }

.oll-nav-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: color 0.12s, border-color 0.12s;
}

.oll-nav-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Keyboard jump HUD ── */
.oll-jump-hud {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--text);
    color: #fff;
    padding: 10px 18px;
    border: 1px solid var(--accent);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.15s, transform 0.15s;
    pointer-events: none;
}

.oll-jump-hud.active {
    opacity: 1;
    transform: translateY(0);
}

.oll-jump-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.52em;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.45);
}

.oll-jump-num {
    font-family: 'Oswald', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: var(--accent2);
    min-width: 32px;
    letter-spacing: 0.06em;
}

/* ── Main list area ── */
.oll-list-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 32px 100px;
}

.oll-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
}

/* ── Row ── */
.oll-row {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid var(--border2);
    background: var(--bg);
    transition: background 0.1s;
    scroll-margin-top: 72px;
}

.oll-row:last-child { border-bottom: none; }
.oll-row:hover { background: var(--surface); }

.oll-row.highlighted {
    background: var(--accent-dim);
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* Row number column */
.oll-row-num {
    flex-shrink: 0;
    width: 72px;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-mute);
    letter-spacing: 0.06em;
    border-right: 1px solid var(--border2);
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oll-row.highlighted .oll-row-num { color: var(--accent); }

/* Sprite column */
.oll-row-sprite-wrap {
    flex-shrink: 0;
    width: 140px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border2);
    background: var(--surface2);
}

.oll-row-sprite {
    width: 90px;
    height: 90px;
    object-fit: contain;
    image-rendering: pixelated;
}

.oll-row-sprite-fallback {
    width: 90px; height: 90px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Oswald', sans-serif;
    font-size: 1.6em;
    font-weight: 700;
    color: var(--text-mute);
}

/* Info column */
.oll-row-info {
    flex: 1;
    padding: 20px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.oll-row-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.oll-row-name {
    font-family: 'Oswald', sans-serif;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text);
}

.oll-row-group {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65em;
    color: var(--text-mute);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Algorithm tokens */
.oll-row-alg {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.alg-tok {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    line-height: 1.6;
    border: 1px solid transparent;
    transition: filter 0.1s;
}

.oll-row:hover .alg-tok { filter: brightness(0.93); }
.oll-row.highlighted .alg-tok { filter: brightness(0.88); }

/* ── Move family colors ──────────────────────────
   Base moves  → vivid color, solid bg
   Prime (')   → same hue, lighter bg, border shows
   Double (2)  → same hue, muted/desaturated
   Wide (r,l…) → shifted hue of parent face
   Slice (M,S,E)→ neutral warm tones
   ─────────────────────────────────────────────── */

/* U — sky blue */
.tok-U    { color: #0f4c8a; background: #d6e8f7; border-color: #a8cceb; }
.tok-Up   { color: #1a6ab5; background: #eaf3fb; border-color: #a8cceb; }
.tok-U2   { color: #3a7abf; background: #ddedf9; border-color: #b8d4ee; }

/* R — vermillion (matches your accent) */
.tok-R    { color: #fff;    background: #b01a0a; border-color: #8a1408; }
.tok-Rp   { color: #b01a0a; background: #fce8e6; border-color: #f0b8b2; }
.tok-R2   { color: #c04030; background: #f9d8d4; border-color: #eaada8; }

/* F — forest green */
.tok-F    { color: #fff;    background: #1a6b35; border-color: #145228; }
.tok-Fp   { color: #1a6b35; background: #e0f2e8; border-color: #a8d8ba; }
.tok-F2   { color: #2a7a45; background: #d4edde; border-color: #9ecfb2; }

/* L — amber/gold */
.tok-L    { color: #fff;    background: #8a6200; border-color: #6a4c00; }
.tok-Lp   { color: #7a5400; background: #fdf0d0; border-color: #e8d090; }
.tok-L2   { color: #8a6a10; background: #faecd8; border-color: #e0c880; }

/* B — purple */
.tok-B    { color: #fff;    background: #5a2a8a; border-color: #3e1a68; }
.tok-Bp   { color: #5a2a8a; background: #ede0f8; border-color: #c8a8e8; }
.tok-B2   { color: #6a3a9a; background: #e8d8f5; border-color: #c0a0e0; }

/* D — slate/dark neutral */
.tok-D    { color: #fff;    background: #3a3530; border-color: #1c1814; }
.tok-Dp   { color: #3a3530; background: #e4e0dc; border-color: #bab4ae; }
.tok-D2   { color: #4a4540; background: #dcd8d4; border-color: #b0aaa4; }

/* Wide moves — lighter tint of parent face */
/* r (wide R) */
.tok-r    { color: #b01a0a; background: #fce8e6; border-color: #f0b8b2; border-style: dashed; }
.tok-rp   { color: #b01a0a; background: #fdf3f2; border-color: #f0c8c4; border-style: dashed; }
.tok-r2   { color: #b01a0a; background: #fdf6f5; border-color: #f0cfc9; border-style: dashed; }
/* l (wide L) */
.tok-l    { color: #7a5400; background: #fdf0d0; border-color: #e8d090; border-style: dashed; }
.tok-lp   { color: #7a5400; background: #fef6e4; border-color: #ecd8a8; border-style: dashed; }
/* f (wide F) */
.tok-f    { color: #1a6b35; background: #e0f2e8; border-color: #a8d8ba; border-style: dashed; }
.tok-fp   { color: #1a6b35; background: #eef8f2; border-color: #b8e0c8; border-style: dashed; }
/* b (wide B) */
.tok-b    { color: #5a2a8a; background: #ede0f8; border-color: #c8a8e8; border-style: dashed; }
.tok-bp   { color: #5a2a8a; background: #f5eefb; border-color: #d4bcee; border-style: dashed; }

/* Slice moves — warm neutrals */
.tok-M    { color: #fff;    background: #6a4a3a; border-color: #4a3028; }
.tok-Mp   { color: #6a4a3a; background: #ede6e0; border-color: #c8b8ae; }
.tok-M2   { color: #7a5a4a; background: #e8e0d8; border-color: #c0b0a8; }
.tok-S    { color: #fff;    background: #4a5a6a; border-color: #2a3a4a; }
.tok-Sp   { color: #4a5a6a; background: #dce4ec; border-color: #a8b8c8; }
.tok-E    { color: #fff;    background: #5a4a6a; border-color: #3a2a4a; }
.tok-Ep   { color: #5a4a6a; background: #e4dced; border-color: #b8a8c8; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .oll-header { padding: 0 16px; }
    .oll-header-count { display: none; }
    .oll-list-main { padding: 16px 0 60px; }
    .oll-row-num { width: 48px; font-size: 1.2em; }
    .oll-row-sprite-wrap { width: 90px; height: 80px; }
    .oll-row-sprite { width: 64px; height: 64px; }
    .oll-row-info { padding: 14px 16px; }
    .alg-tok { font-size: 0.82em; }
    .oll-row-name { font-size: 0.9em; }
}