*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


:root {
    /* ── Font stack ──
       Inter as primary sans-serif. JetBrains Mono for numeric/code
       contexts. Noto Sans SC for CJK fallback. */
    --ui-font: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --text-font: var(--ui-font);
    --display-font: var(--ui-font);
    --system-font: var(--ui-font);
    --numeric-font: "JetBrains Mono", "Inter", "Noto Sans SC", ui-monospace, monospace;

    /* ── Cool dark base — desaturated purple-gray ── */
    --bg: #13121d;
    --bg-lighter: #1a1928;
    --panel: rgba(255, 255, 255, 0.03);
    --panel-soft: rgba(255, 255, 255, 0.02);
    --panel-border: rgba(255, 255, 255, 0.06);
    --divider: rgba(255, 255, 255, 0.06);
    --surface-radius: 16px;
    --surface-radius-sm: 12px;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);

    /* ── Typography — cool off-white hierarchy ── */
    --fg: #e0e0e8;
    --fg-soft: rgba(224, 224, 232, 0.92);
    --fg-muted: rgba(224, 224, 232, 0.55);
    --fg-dim: rgba(107, 107, 123, 0.85);
    --text-primary: #e0e0e8;
    --text-secondary: rgba(224, 224, 232, 0.55);
    --text-min: #6b6b7b;
    --text-accent: rgba(232, 146, 58, 0.88);
    --text-meta: rgba(107, 107, 123, 0.78);

    --text-tier-1: #e0e0e8;
    --text-tier-2: rgba(224, 224, 232, 0.6);
    --text-tier-3: #6b6b7b;

    /* ── Accent palette ── */
    --orange: #e8923a;
    --red: #f87171;
    --ok: #4ade80;
    --warn: #e8923a;
    --fail: #f87171;
    --blue: #60a5fa;
    --purple: #8b8bf5;
    --cyan: #67e8f9;
    --silver: #94a3b8;
    --gold: #fbbf24;
    --gray: #6b6b7b;
    --weather-ambient-a: rgba(139, 139, 245, 0.1);
    --weather-ambient-b: rgba(96, 165, 250, 0.08);
    --weather-accent: rgba(139, 139, 245, 0.5);
    --sys-bar-h: 28px;
    --panel-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

html,
body {
    width: 100%;
    min-height: 100%;
    /* Apply the UI font on the html root too — without this, Chrome's
       lang="zh-CN" UA default leaks "Noto Sans SC" onto the html element
       and any child that doesn't explicitly override it. body sets the
       same family below, so visible text is unchanged either way. */
    font-family: var(--ui-font);
    /* Static overlays stay in CSS (browser caches them as GPU textures,
       zero per-frame cost). Only dynamic elements (rain + embers) are
       canvas-drawn. This is cheaper than canvas-redrawing full-screen
       gradients every frame. */
    background:
        radial-gradient(ellipse at 50% 30%, var(--bg-lighter) 0%, var(--bg) 70%);
    background-color: var(--bg);
    color: var(--fg);
    overflow-x: hidden;
}

body {
    font-family: var(--text-font);
    font-weight: 400;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "cv05" 1;
    font-optical-sizing: auto;
    padding-top: var(--sys-bar-h);
}

button,
input {
    font: inherit;
}

[hidden] {
    display: none !important;
}

/* .ambient-glow-layer, .rain-layer, .streak-layer, .droplet-layer
   — all removed from the DOM. Their visual effects are now drawn by
   the canvas-engine's background-glow module in a single canvas pass.
   See src/core/canvas-modules/background-glow.js. */

.sys-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    height: var(--sys-bar-h);
    background: rgba(19, 18, 29, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sys-bar-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    max-width: 100%;
    padding: 0 36px;
}

.sys-bar-id,
.srv-name,
.live-badge {
    font-family: var(--system-font);
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.16em;
}

.sys-bar-id {
    color: rgba(224, 224, 232, 0.3);
}

.sys-bar-div {
    width: 0.5px;
    height: 12px;
    background: var(--divider);
    flex-shrink: 0;
}

.sys-bar-servers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.srv-dot,
.live-dot,
.header-console-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(224, 224, 232, 0.2);
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.srv-dot.ok,
.live-dot.ok,
.header-console-led.ok {
    background: var(--ok);
    box-shadow: 0 0 9px rgba(120, 184, 64, 0.55), 0 0 18px rgba(120, 184, 64, 0.2);
    animation: dotBreath 3s ease-in-out infinite;
}

.srv-dot.warn,
.live-dot.warn,
.header-console-led.warn,
.srv-dot.pending,
.live-dot.pending,
.header-console-led.pending,
.srv-dot.checking,
.live-dot.checking,
.header-console-led.checking {
    background: var(--warn);
    box-shadow: 0 0 8px rgba(176, 140, 56, 0.48);
    animation: dotBreath 4s ease-in-out infinite;
}

.srv-dot.fail,
.live-dot.fail,
.header-console-led.fail {
    background: var(--fail);
    box-shadow: 0 0 8px rgba(122, 40, 40, 0.6), 0 0 16px rgba(122, 40, 40, 0.2);
}

.srv-name {
    color: var(--text-min);
    margin-right: 4px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.wrap {
    position: relative;
    z-index: 1;
    max-width: 100%;
    padding: 24px 36px 80px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.panel {
    position: relative;
    overflow: hidden;
    padding: 24px 28px;
    border: 1px solid var(--panel-border);
    border-radius: var(--surface-radius);
    background: var(--panel);
    box-shadow: var(--panel-shadow);
}

/* Panel decorative pseudo-elements removed — HUD style uses
   clean solid backgrounds with thin borders, no gradient overlays. */
.panel::before,
.panel::after {
    display: none;
}

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

.panel.anim {
    opacity: 0;
    transform: translateY(16px);
    transition:
        opacity 0.72s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.72s cubic-bezier(0.19, 1, 0.22, 1);
}

.panel.anim.entered {
    opacity: 1;
    transform: translateY(0);
}

/* Hero + content cards share the same entrance animation */
.hero-row,
.content-panel {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.72s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.72s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-row.entered,
.content-panel.entered {
    opacity: 1;
    transform: translateY(0);
}

.app-header-stack {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
    z-index: 20;
}

.app-header-top {
    position: relative;
    isolation: isolate;
    overflow: visible;
    z-index: 20;
}

/* ── Hero Row: Header + To Do side-by-side ───────────────────────── */
/* ── Hero Row card ──────────────────────────────────────────────── */
.hero-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 22vw, 420px);
    gap: clamp(32px, 3vw, 56px);
    align-items: stretch;
    padding: 24px 28px;
    border: 1px solid var(--panel-border);
    border-radius: var(--surface-radius);
    background: var(--panel);
    box-shadow: var(--panel-shadow);
    overflow: visible;
}

.hero-row > .panel {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

/* ── Content Panel card ────────────────────────────────────────── */
.content-panel {
    padding: 24px 28px;
    border: 1px solid var(--panel-border);
    border-radius: var(--surface-radius);
    background: var(--panel);
    box-shadow: var(--panel-shadow);
    min-height: 400px;
}

.app-header-top-row {
    display: grid;
    grid-template-columns: minmax(240px, 0.6fr) minmax(300px, 1fr) minmax(340px, 0.78fr);
    grid-template-rows: minmax(200px, auto);
    align-items: stretch;
    column-gap: 24px;
}

/* .app-header-top::after decorative dots removed — borderless layout */

.identity-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding-right: 32px;
    min-width: 0;
    /* Stretch with the row so the SUIS title + music console + space are
       balanced against the status/weather columns at the same height.
       max-height pins the identity to the locked row height as well. */
    min-height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.identity-mark {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
}

.identity-title {
    position: relative;
    display: inline-block;
    font-family: var(--display-font);
    font-size: clamp(30px, 4vw, 58px);
    font-weight: 500;
    letter-spacing: 0.07em;
    line-height: 1;
    /* Warm pink-to-purple �?the inner light of a lantern */
    color: rgba(224, 224, 232, 0.3);
    text-shadow:
        0 0 12px rgba(139, 139, 245, 0.12),
        0 0 32px rgba(139, 139, 245, 0.07),
        0 0 60px rgba(96, 165, 250, 0.04);
}

.identity-title-latin {
    font-style: italic;
}

.identity-note {
    align-self: flex-end;
    margin-top: 6px;
    color: rgba(255, 224, 192, 0.64);
    font-family: var(--numeric-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

/* ─────────────────────────────────────────────────────────────────────────
   STREAM LAYER — music console (Windows SMTC / cloudmusic.exe window-title)
   Sits directly under the SUIS identity title. Designed to look alive even
   when the upstream provider cannot report real progress (window-title
   scraper for NetEase desktop), and to react with a satisfying burst when
   a track changes. Mounted ONCE by ui.js renderMusicPanel() — subsequent
   polls only patch text and toggle classes, so the entrance + idle
   animations never reset mid-session.
   ───────────────────────────────────────────────────────────────────────── */

.identity-music-panel {
    min-height: 0;
}

.music-console {
    --m-orange: 255, 122, 26;
    --m-cyan: 0, 229, 255;
    --m-violet: 156, 116, 255;
    --m-warm: 255, 220, 176;
    --m-green: 132, 220, 132;

    position: relative;
    display: grid;
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 8px 10px 10px;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    min-width: 0;
    isolation: isolate;
}

/* Hairline removed — clean edge, no decorative border. */

.music-console::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(255, 255, 255, 0.008) 3px,
            rgba(255, 255, 255, 0.008) 4px);
    mix-blend-mode: overlay;
    opacity: 0.5;
    z-index: 1;
}

.music-console > * {
    position: relative;
    z-index: 3;
}

/* ── Header strip ────────────────────────────────────────────────────── */

.music-console-head {
    display: none;
}

.music-console-head-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tier-2);
}

.music-console-live-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    /* Default: muted gray when there's no track / no live data yet. The
       renderer toggles the .has-track / .music-console-fail classes which
       jump straight to the next colour — no transition, since renderMusicPanel
       removes-and-re-adds these classes on every poll, and a transition
       would visibly flicker each render. */
    background: rgba(255, 255, 255, 0.32);
    box-shadow: none;
}

/* Successfully reading music data → solid green with pulse. Triggered on
   .has-track regardless of playing/paused, since both states mean the
   provider is alive and reporting a real track. */
.music-console.has-track .music-console-live-dot {
    background: rgba(var(--m-green), 0.92);
    box-shadow:
        0 0 6px rgba(var(--m-green), 0.55),
        0 0 14px rgba(var(--m-green), 0.28);
    animation: musicLiveDotPulse 2.2s ease-in-out infinite;
}

.music-console.music-console-fail .music-console-live-dot {
    background: rgba(220, 80, 60, 0.86);
    box-shadow: 0 0 8px rgba(220, 80, 60, 0.5);
    animation: none;
}

.music-console-head-source {
    margin-left: auto;
    color: rgba(224, 224, 232, 0.62);
    font-family: var(--numeric-font);
    font-size: 7.5px;
    letter-spacing: 0.06em;
}

.music-console-head-status {
    color: rgba(var(--m-orange), 0.94);
    font-family: var(--display-font);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-shadow: 0 0 8px rgba(var(--m-orange), 0.28);
}

.music-console-head-status.warn { color: var(--warn); text-shadow: 0 0 8px rgba(176, 140, 56, 0.32); }
.music-console-head-status.fail { color: #d8584a; text-shadow: 0 0 8px rgba(216, 88, 74, 0.32); }
.music-console-head-status.idle { color: rgba(224, 224, 232, 0.4); text-shadow: none; }

/* ── Main row: disc + track block + waveform ────────────────────────── */

.music-console-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    min-width: 0;
}

/* 80×80 wrapper holds both the particles canvas (full size, behind)
   and the 68×68 disc canvas (inset 6px, in front). */
.music-console-disc-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.music-console-particles {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 50%;
}

.music-console-disc {
    position: absolute;
    top: 6px;
    left: 6px;
    border-radius: 50%;
    z-index: 1;
}

.music-console-waveform {
    position: absolute;
    right: 0;
    bottom: 100%;
    margin-bottom: 2px;
}

/* Progress bar canvas wrapper */
.music-console-progress-wrap {
    position: relative;
    flex: 1;
    height: 14px;
    min-width: 0;
}

.music-console-progress-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Track block */
.music-console-track-block {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.music-console-track-wrap {
    position: relative;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 14px), transparent 100%);
}

.music-console-track {
    display: inline-block;
    color: var(--text-primary);
    font-family: 'Space Mono', var(--display-font);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    white-space: nowrap;
    transform: translateZ(0);
}

/* Marquee scroll — only kicks in when ui.js detects overflow and adds the
   .is-marquee class. Translates by --marquee-shift (computed in JS). */
.music-console.is-marquee .music-console-track {
    animation: musicTrackMarquee 18s linear infinite;
    animation-delay: 1.4s;
}

.music-console-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: var(--text-tier-3);
    font-family: var(--text-font);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.025em;
    line-height: 1.2;
}

.music-console-artist {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(224, 224, 232, 0.74);
}

.music-console-meta-sep {
    display: none;
}

.music-console-album {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
    font-size: 9px;
    color: rgba(224, 224, 232, 0.5);
}

.music-console-album:empty {
    display: none;
}

/* Hide the bullet separator when there is no album to follow it. Uses
   :has() (supported in modern Chromium) since the separator sits before
   the album element in source order. */
.music-console-meta:has(.music-console-album:empty) .music-console-meta-sep {
    display: none;
}

.music-console.no-track .music-console-track {
    color: rgba(255, 220, 180, 0.32);
    font-style: italic;
    text-shadow: none;
}

.music-console.no-track .music-console-artist {
    color: rgba(255, 220, 180, 0.32);
}

/* ── Footer: minimal hairline progress bar ──────────────────────────
   Single inline row: [current time] ──── progress rail ──── [total time].
   No more FETCH/SYNC chips, no gold gradient, no glow shadows. The
   rail is a 1px hairline in cool-white and the fill is a slightly
   brighter cool-white sweep — pure wireframe to match the rest of
   the line-art icon family. */
.music-console-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 14px;
}

.music-console-progress-time {
    font-family: 'Space Mono', var(--numeric-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--text-tier-3);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
    flex-shrink: 0;
    line-height: 1;
}

.music-console-progress-rail {
    position: relative;
    flex: 1;
    height: 1px;
    background: rgba(220, 232, 248, 0.12);
    border-radius: 999px;
    overflow: visible;
    min-width: 0;
}

.music-console-progress-fill {
    position: relative;
    display: block;
    height: 100%;
    width: 0%;
    background: rgba(220, 232, 248, 0.78);
    transition: width 0.18s linear;
    border-radius: 999px;
}

/* Leading edge — a small bright dot at the right tip of the fill,
   no glow halo, just a clean wireframe marker so the playback head
   is visible even when the fill is very narrow. */
.music-console-progress-fill::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1px;
    width: 4px;
    height: 4px;
    margin-top: -2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
}

/* When the upstream provider can't report real duration, drive the
   fill via a CSS keyframe loop so the bar still looks alive. */
.music-console.no-progress .music-console-progress-fill {
    animation: musicProgressLoop 168s linear infinite;
}

.music-console.is-paused.no-progress .music-console-progress-fill {
    animation-play-state: paused;
}

/* Slightly dim the whole footer when paused so the still bar reads
   as "not playing" without removing the visual structure. */
.music-console.is-paused .music-console-progress-fill,
.music-console.is-paused .music-console-progress-fill::after {
    opacity: 0.55;
}

/* ── Track-change burst ──────────────────────────────────────────────── */

.music-console.is-track-changed .music-console-track,
.music-console.is-track-changed .music-console-artist,
.music-console.is-track-changed .music-console-album {
    animation: musicTrackBurst 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.music-console.is-track-changed .music-console-artist { animation-delay: 0.07s; }
.music-console.is-track-changed .music-console-album { animation-delay: 0.13s; }

.music-console.is-track-changed .music-console-vinyl {
    animation: musicVinylSpin 9s linear infinite, musicVinylKick 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* hairline removed — no flash animation needed */

/* Mount entrance — each section rises in sequence on first paint. */
.music-console-row,
.music-console-foot {
    opacity: 0;
    transform: translateY(6px);
    animation: musicMountResolve 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.music-console-row  { animation-delay: 0.08s; }
.music-console-foot { animation-delay: 0.22s; }

/* ── Keyframes ───────────────────────────────────────────────────────── */

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

@keyframes musicLiveDotPulse {
    0%, 100% { transform: scale(1);   box-shadow: 0 0 6px rgba(132, 220, 132, 0.55), 0 0 14px rgba(132, 220, 132, 0.26); }
    50%      { transform: scale(1.4); box-shadow: 0 0 10px rgba(132, 220, 132, 0.78), 0 0 22px rgba(132, 220, 132, 0.42); }
}

@keyframes musicVinylSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes musicVinylKick {
    0%   { filter: brightness(1)   saturate(1); }
    35%  { filter: brightness(1.6) saturate(1.4); }
    100% { filter: brightness(1)   saturate(1); }
}

@keyframes musicTrackMarquee {
    0%        { transform: translateX(0); }
    8%        { transform: translateX(0); }
    50%       { transform: translateX(var(--marquee-shift, -40%)); }
    58%       { transform: translateX(var(--marquee-shift, -40%)); }
    100%      { transform: translateX(0); }
}

@keyframes musicProgressLoop {
    0%   { width: 0%; }
    100% { width: 100%; }
}

@keyframes musicTrackBurst {
    0%   { opacity: 0; transform: translateY(8px); filter: blur(3px); }
    60%  { opacity: 1; transform: translateY(0);   filter: blur(0); }
    100% { opacity: 1; transform: translateY(0);   filter: blur(0); }
}

@keyframes musicHairlineFlash {
    0%   { opacity: 0.4; }
    35%  { opacity: 1;   filter: blur(0.5px) brightness(1.6); }
    100% { opacity: 1;   filter: none; }
}


.identity-title::before,
.identity-title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    pointer-events: none;
    font: inherit;
    letter-spacing: inherit;
}

.identity-title::before {
    color: rgba(255, 185, 120, 0.14);  /* warm rose */
    transform: translateX(1px);
    clip-path: inset(0 0 46% 0);
}

.identity-title::after {
    color: rgba(190, 148, 255, 0.12);  /* warm violet */
    transform: translateX(-1px);
    clip-path: inset(52% 0 0 0);
}

.identity-title.go::before {
    animation: headerGlitchA 0.26s steps(1);
}

.identity-title.go::after {
    animation: headerGlitchB 0.26s steps(1);
}

@keyframes headerGlitchA {
    0% { transform: translateX(2px); opacity: 0.62; clip-path: inset(0 0 82% 0); }
    48% { transform: translateX(-1px); opacity: 0.34; clip-path: inset(48% 0 18% 0); }
    100% { transform: translateX(1px); opacity: 0.72; clip-path: inset(0 0 46% 0); }
}

@keyframes headerGlitchB {
    0% { transform: translateX(-2px); opacity: 0.54; clip-path: inset(64% 0 8% 0); }
    52% { transform: translateX(1px); opacity: 0.28; clip-path: inset(18% 0 58% 0); }
    100% { transform: translateX(-1px); opacity: 0.64; clip-path: inset(52% 0 0 0); }
}

.identity-timebox {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-align: left;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 6px;
}

.header-console {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    max-height: 100%;
    padding: 0 4px 0 0;
    overflow: visible;
    z-index: 40;
}

.header-micro-panel {
    position: relative;
    min-width: 0;
    padding: 8px 0 9px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.header-micro-panel::before {
    display: none;
}

.header-micro-panel::after {
    display: none;
}

.header-micro-panel > * {
    position: relative;
    z-index: 1;
}

.header-status-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    /* Both clamps come from the locked .app-header-top-row height. The
       min pins the panel to the full row; the max stops the compact
       summary from pushing the panel taller than the locked row. Inner
       scroll regions (activity list) already have their own caps. */
    min-height: 100%;
    max-height: 100%;
    padding-bottom: 8px;
    overflow: hidden;
}

.header-panel-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.header-panel-meta-slim {
    margin-bottom: 10px;
}

.header-panel-tag,
.header-panel-code,
.header-wave-readout,
.header-wave-axis {
    font-family: var(--system-font);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-panel-tag {
    /* Tier 2 — micro-panel title (STATUS / CHRONO / WEATHER). */
    color: var(--text-tier-2);
}

.header-panel-code,
.header-wave-axis {
    /* Tier 3 — panel code / hash tag, sits beside the title but
       shouldn't compete with it. Was 0.56 → dropped to ~0.34. */
    color: var(--text-tier-3);
}

.terminal-block {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    /* Was 220px — the terminal block was the tallest thing in the header
       row and forced .app-header-top to ~330px, dwarfing the SUIS logo and
       making the panel below feel cramped. 150px keeps 6 status lines
       visible without dominating the page. */
    max-height: 150px;
    transition: opacity 0.28s ease, max-height 0.32s ease, transform 0.32s ease;
}

.header-console.is-compact .terminal-block {
    position: absolute;
    inset: 34px 12px auto 12px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-6px);
    pointer-events: none;
}

.t-line,
.header-summary-line {
    position: relative;
    display: grid;
    /* 4-column grid: spinner / label / dots / led. The status text
       column (OK / WARN / ERROR) was removed — the LED dot alone
       carries the status now. The spinner column is auto-sized and
       collapses to 0 when the row is in resolved state. */
    grid-template-columns: auto fit-content(280px) minmax(0, 1fr) 10px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-family: var(--system-font);
    /* Bumped from 9px/400 → 11px/500 so the pinned summary rows are
       actually readable on the header glass. Letter-spacing tightened
       a hair to keep the row compact at the new size. */
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.32;
}

/* Loading spinner — only visible while a row has never received real
   data. Once a row's sticky entry is populated, .is-loading is removed
   and the spinner collapses to zero width without a layout shift. */
.header-summary-spinner {
    width: 0;
    height: 8px;
    margin: 0;
    overflow: hidden;
    transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
                margin 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-summary-line.is-loading .header-summary-spinner {
    width: 9px;
    margin-right: 2px;
}

.header-summary-spinner-arc {
    display: block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-top-color: rgba(255, 255, 255, 0.78);
    border-right-color: rgba(255, 255, 255, 0.5);
    animation: headerSummarySpin 0.95s linear infinite;
}

@keyframes headerSummarySpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Loading-state styling — text and indicator are dimmed because they're
   placeholder labels, and the LED is held at the muted "pending" tone. */
.header-summary-line.is-loading .header-summary-text {
    color: rgba(255, 220, 180, 0.4);
}

.header-summary-line.is-loading .header-summary-status {
    color: rgba(255, 255, 255, 0.42);
    animation: headerSummarySyncPulse 1.4s ease-in-out infinite;
}

@keyframes headerSummarySyncPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 0.95; }
}

/* ── Generic loading spinner ─────────────────────────────────────────
   Reused across the hero (rank / RP / cutoff anchor) and anywhere else
   that used to print "暂无" while waiting on the backend. Four size
   variants: sm (10px, anchor text inline), base (14px), lg (28px, rank
   block) and xl (56px, hero RP). The parent element sets its own color
   via CSS vars; the arc borders inherit currentColor-ish tones. */
.suis-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.suis-spinner-sm { width: 10px; height: 10px; }
.suis-spinner-lg { width: 28px; height: 28px; }
.suis-spinner-xl { width: 56px; height: 56px; }

.suis-spinner-arc {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    border-top-color: rgba(255, 255, 255, 0.8);
    border-right-color: rgba(255, 255, 255, 0.5);
    animation: headerSummarySpin 0.95s linear infinite;
}

.suis-spinner-xl .suis-spinner-arc {
    border-width: 3px;
    border-top-color: rgba(255, 182, 96, 0.88);
    border-right-color: rgba(255, 182, 96, 0.54);
    box-shadow: 0 0 18px rgba(255, 150, 70, 0.22);
}

.suis-spinner-lg .suis-spinner-arc {
    border-width: 2px;
    border-top-color: rgba(255, 210, 140, 0.82);
    border-right-color: rgba(255, 210, 140, 0.48);
}

/* Hero loading states — center the spinner inside the container the
   text would normally occupy and dim any leftover siblings. */
.hero-rank.is-loading,
.hero-rp-value.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 1em;
}

.hero-rp-value.is-loading {
    padding: 10px 0;
}

/* .comparison-vector-unknown is no longer used for the loading state —
   the traveling-light animation on .comparison-vector-segments (see
   components.css) replaces the spinner the user asked to remove. */

.t-line {
    opacity: 0;
}

.t-line.on {
    opacity: 1;
}

/* Boot-only per-element reveal — scoped to pre-compact state so live updates don't re-animate */
.header-console:not(.is-compact) .t-line.on .t-label {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(4px);
    animation: readoutTextResolve 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.header-console:not(.is-compact) .t-line.on .t-dots {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    animation: readoutLineResolve 0.26s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.header-console:not(.is-compact) .t-line.on .t-status {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(4px);
    animation: readoutTextResolve 0.30s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
}

.header-console:not(.is-compact) .t-line.on .t-led {
    opacity: 0;
    transform: scale(0.72);
    animation: statusLedResolve 0.26s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.header-console:not(.is-compact) .t-line.on::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.065), transparent);
    opacity: 0;
    transform: translateX(-120%);
    animation: statusRowSweep 0.50s cubic-bezier(0.22, 1, 0.36, 1) 0.02s forwards;
    pointer-events: none;
}

.t-label,
.header-summary-text {
    width: 100%;
    max-width: 280px;
    /* Bumped from --text-secondary (0.68α) → --text-primary (0.88α) so
       the text is actually readable against the panel glass. */
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-summary-text-api {
    color: var(--text-min);
}

.t-dots,
.header-summary-dots {
    overflow: hidden;
    height: 1px;
    align-self: center;
    color: transparent;
    font-size: 0;
    line-height: 0;
    background-image: radial-gradient(circle, rgba(224, 224, 232, 0.18) 0.7px, transparent 0.9px);
    background-size: 6px 1px;
    background-repeat: repeat-x;
    background-position: left center;
}

.t-status,
.header-summary-status {
    /* Removed from the visible layout — the LED dot in the next cell
       is the only indicator now. We still render the text in the DOM
       for the accessible name / sticky patcher logic, but it's hidden
       from sight. */
    display: none;
}

.t-status.ok,
.header-summary-status.ok {
    color: var(--ok);
}

.t-status.warn,
.header-summary-status.warn {
    color: var(--warn);
}

.t-status.fail,
.header-summary-status.fail {
    color: var(--fail);
}

.t-status.pending,
.t-status.checking,
.header-summary-status.pending,
.header-summary-status.checking {
    color: rgba(255, 210, 74, 0.84);
}

.t-led,
.header-summary-led {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    justify-self: end;
    background: rgba(255, 255, 255, 0.16);
}

.t-led.ok,
.header-summary-led.ok {
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.55), 0 0 14px rgba(74, 222, 128, 0.18);
}

.t-led.warn,
.t-led.pending,
.t-led.checking,
.header-summary-led.warn,
.header-summary-led.pending,
.header-summary-led.checking {
    background: #e8923a;
    box-shadow: 0 0 7px rgba(232, 146, 58, 0.6), 0 0 14px rgba(232, 146, 58, 0.25);
}

.t-led.fail,
.header-summary-led.fail {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.55), 0 0 14px rgba(248, 113, 113, 0.18);
}

.t-status.state-ok,
.header-summary-status.state-ok {
    color: var(--ok);
}

.t-status.state-warn,
.header-summary-status.state-warn {
    color: var(--warn);
}

.t-status.state-error,
.header-summary-status.state-error,
.t-status.state-offline,
.header-summary-status.state-offline {
    color: var(--fail);
}

.t-led.state-ok,
.header-summary-led.state-ok {
    background: #4ade80;
    box-shadow: 0 0 6px rgba(138, 170, 112, 0.5), 0 0 12px rgba(138, 170, 112, 0.15);
}

.t-led.state-warn,
.header-summary-led.state-warn {
    background: #e8923a;
    box-shadow: 0 0 7px rgba(232, 146, 58, 0.6), 0 0 14px rgba(232, 146, 58, 0.25);
}

.t-led.state-error,
.header-summary-led.state-error {
    background: #c85040;
    box-shadow: 0 0 6px rgba(200, 80, 64, 0.5), 0 0 12px rgba(200, 80, 64, 0.15);
}

.t-led.state-offline,
.header-summary-led.state-offline {
    background: rgba(168, 78, 78, 0.82);
    box-shadow: 0 0 5px rgba(168, 78, 78, 0.32), 0 0 10px rgba(168, 78, 78, 0.1);
}

.t-status.state-idle,
.header-summary-status.state-idle {
    color: rgba(224, 224, 232, 0.44);
}

.t-led.state-idle,
.header-summary-led.state-idle {
    background: rgba(224, 224, 232, 0.28);
    box-shadow: 0 0 4px rgba(224, 224, 232, 0.12);
}

.header-summary {
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    min-height: 128px;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.header-console.is-compact .header-summary {
    opacity: 1;
    transform: translateY(0);
}

.header-summary-list {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 4px;
}

.header-summary-activity {
    margin-top: 0;
    padding-top: 6px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 5px;
    min-height: 0;
    overflow: hidden;
}

.header-summary-activity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.header-summary-activity-title {
    color: var(--text-secondary);
    font-family: var(--system-font);
    /* Shrunk 10.5/600 → 9/500 so the heading stays in sync with
       the smaller body rows below. Color stays bright — only font
       size/weight are tuned down. */
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-summary-activity-list {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 2px;
    min-height: 0;
    /* Cap activity list height so the status panel doesn't shoot up
       from a busy event window. 8 rows × (14px row + 2px gap) ≈ 126px.
       Tighter than the 6-row layout so we can show 2 more events
       without touching the locked .app-header-top-row height. */
    max-height: 128px;
    overflow: hidden;
}

.header-summary-activity-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
    /* Shrunk from 11/500 → 9.5/400 so the activity log reads as
       supporting context instead of competing with the STATUS summary
       above it. Color stays at the bright --text-primary so the text
       is still readable — only the TYPOGRAPHY is de-emphasized, not
       the contrast. */
    min-height: 13px;
    padding: 0;
    color: var(--text-primary);
    font-family: var(--system-font);
    font-size: 9.5px;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.3;
    transition:
        transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-summary-activity-row.is-entering {
    animation: activityLogEnter 0.36s cubic-bezier(0.22, 1, 0.36, 1) both;
    box-shadow: none !important;
}

.header-summary-activity-row.is-entering .header-summary-activity-time {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(3px);
    animation: readoutTextResolve 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.04s forwards;
}

.header-summary-activity-row.is-entering .header-summary-activity-copy {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(3px);
    animation: readoutTextResolve 0.32s cubic-bezier(0.22, 1, 0.36, 1) 0.11s forwards;
}


/* Per-module colour theme for the pinned STATUS summary rows. The 4 pinned
   rows (weather / apex / kvk / music) each carry a `data-module` attribute
   that we tint here so the user can instantly tell which module is active
   without reading the label. Colours match the activity-row palette below
   so a status row and its downstream activity rows share the same hue. */
.header-summary-line[data-module="weather"] .header-summary-text {
    color: rgba(140, 206, 244, 0.92);
}
.header-summary-line[data-module="weather"] {
    box-shadow: inset 2px 0 0 rgba(96, 178, 232, 0.65);
    padding-left: 4px;
}

.header-summary-line[data-module="apex"] .header-summary-text {
    color: rgba(255, 140, 140, 0.92);
}
.header-summary-line[data-module="apex"] {
    box-shadow: inset 2px 0 0 rgba(232, 88, 88, 0.65);
    padding-left: 4px;
}

.header-summary-line[data-module="kvk"] .header-summary-text {
    color: rgba(140, 230, 200, 0.92);
}
.header-summary-line[data-module="kvk"] {
    box-shadow: inset 2px 0 0 rgba(72, 208, 168, 0.65);
    padding-left: 4px;
}

.header-summary-line[data-module="music"] .header-summary-text {
    color: rgba(255, 188, 112, 0.92);
}
.header-summary-line[data-module="music"] {
    box-shadow: inset 2px 0 0 rgba(255, 158, 64, 0.65);
    padding-left: 4px;
}

/* Per-module colour theme. Each backend module (music/weather/atmos/apex/
   kvk/...) tags its events with a `source` field. The activity row binds
   that field to a `data-source` attribute, which we use here to tint BOTH
   the timestamp column AND the message copy so a row visually matches its
   source module. Colours are identical to the pinned STATUS row palette
   above so rows carry the same hue saturation — the size/weight is what
   distinguishes context (smaller) from primary readouts (bigger). Tone
   overrides (.warn / .err / .fail) come after this block and re-tint
   the copy for problematic rows so warnings/errors still pop. */
.header-summary-activity-row[data-source="music"] .header-summary-activity-time,
.header-summary-activity-row[data-source="music"] .header-summary-activity-copy {
    color: rgba(255, 188, 112, 0.92);
}
.header-summary-activity-row[data-source="music"] {
    box-shadow: inset 2px 0 0 rgba(255, 158, 64, 0.65);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="weather"] .header-summary-activity-time,
.header-summary-activity-row[data-source="weather"] .header-summary-activity-copy {
    color: rgba(140, 206, 244, 0.92);
}
.header-summary-activity-row[data-source="weather"] {
    box-shadow: inset 2px 0 0 rgba(96, 178, 232, 0.65);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="atmos"] .header-summary-activity-time,
.header-summary-activity-row[data-source="atmos"] .header-summary-activity-copy {
    color: rgba(196, 158, 240, 0.92);
}
.header-summary-activity-row[data-source="atmos"] {
    box-shadow: inset 2px 0 0 rgba(168, 132, 232, 0.65);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="apex"] .header-summary-activity-time,
.header-summary-activity-row[data-source="apex"] .header-summary-activity-copy {
    color: rgba(255, 140, 140, 0.92);
}
.header-summary-activity-row[data-source="apex"] {
    box-shadow: inset 2px 0 0 rgba(232, 88, 88, 0.65);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="kvk"] .header-summary-activity-time,
.header-summary-activity-row[data-source="kvk"] .header-summary-activity-copy {
    color: rgba(140, 230, 200, 0.92);
}
.header-summary-activity-row[data-source="kvk"] {
    box-shadow: inset 2px 0 0 rgba(72, 208, 168, 0.65);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="status"] .header-summary-activity-time,
.header-summary-activity-row[data-source="engine"] .header-summary-activity-time,
.header-summary-activity-row[data-source="system"] .header-summary-activity-time,
.header-summary-activity-row[data-source="status"] .header-summary-activity-copy,
.header-summary-activity-row[data-source="engine"] .header-summary-activity-copy,
.header-summary-activity-row[data-source="system"] .header-summary-activity-copy {
    color: rgba(190, 206, 226, 0.78);
}
.header-summary-activity-row[data-source="status"],
.header-summary-activity-row[data-source="engine"],
.header-summary-activity-row[data-source="system"] {
    box-shadow: inset 2px 0 0 rgba(150, 168, 196, 0.45);
    padding-left: 4px;
}

.header-summary-activity-row[data-source="network"] .header-summary-activity-time,
.header-summary-activity-row[data-source="network"] .header-summary-activity-copy {
    color: rgba(220, 160, 240, 0.92);
}
.header-summary-activity-row[data-source="network"] {
    box-shadow: inset 2px 0 0 rgba(196, 132, 224, 0.65);
    padding-left: 4px;
}

/* Tone overrides — placed AFTER the per-source palette so that warn/err
   rows always override the module colour on the copy text. This keeps
   problems visually distinct as amber/red regardless of the source module.
   The left-edge stripe + the timestamp still carry the module colour so the
   user can still tell which module produced the warning. */
.header-summary-activity-row.warn .header-summary-activity-copy {
    color: rgba(255, 214, 138, 0.92);
}
.header-summary-activity-row.err .header-summary-activity-copy,
.header-summary-activity-row.fail .header-summary-activity-copy {
    color: rgba(255, 156, 156, 0.92);
}

.header-summary-activity-time {
    color: var(--text-min);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.header-summary-activity-copy {
    min-width: 0;
    /* Tiny vertical padding to clear CJK descenders at 9.5px font. */
    padding: 0 0 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.header-summary.summary-entering .header-summary-text,
.header-summary.summary-entering .header-summary-status,
.header-summary.summary-entering .header-summary-activity-title,
.header-summary.summary-entering .header-summary-activity-time,
.header-summary.summary-entering .header-summary-activity-copy,
.header-detail-trigger.summary-entering,
.header-console.summary-entering .header-console-state {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(4px);
    animation: readoutTextResolve 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.header-summary.summary-entering .header-summary-dots {
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    animation: readoutLineResolve 0.34s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.header-summary.summary-entering .header-summary-line::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.075), transparent);
    opacity: 0;
    transform: translateX(-120%);
    animation: statusRowSweep 0.54s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: none;
}

.header-summary.summary-entering .header-summary-led {
    transform: scale(0.72);
    animation: statusLedResolve 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.header-summary.summary-entering .header-summary-line:nth-child(1) { --readout-delay: 0.06s; }
.header-summary.summary-entering .header-summary-line:nth-child(2) { --readout-delay: 0.14s; }
.header-summary.summary-entering .header-summary-line:nth-child(3) { --readout-delay: 0.22s; }
.header-summary.summary-entering .header-summary-line:nth-child(4) { --readout-delay: 0.3s; }
.header-summary.summary-entering .header-summary-line:nth-child(5) { --readout-delay: 0.38s; }
.header-summary.summary-entering .header-summary-line:nth-child(6) { --readout-delay: 0.46s; }
.header-summary.summary-entering .header-summary-text { animation-delay: var(--readout-delay); }
.header-summary.summary-entering .header-summary-dots { animation-delay: calc(var(--readout-delay) + 0.08s); }
.header-summary.summary-entering .header-summary-status { animation-delay: calc(var(--readout-delay) + 0.17s); }
.header-summary.summary-entering .header-summary-line:nth-child(1)::before { animation-delay: 0.03s; }
.header-summary.summary-entering .header-summary-line:nth-child(2)::before { animation-delay: 0.11s; }
.header-summary.summary-entering .header-summary-line:nth-child(3)::before { animation-delay: 0.19s; }
.header-summary.summary-entering .header-summary-line:nth-child(4)::before { animation-delay: 0.27s; }
.header-summary.summary-entering .header-summary-line:nth-child(5)::before { animation-delay: 0.35s; }
.header-summary.summary-entering .header-summary-line:nth-child(6)::before { animation-delay: 0.43s; }
.header-summary.summary-entering .header-summary-line:nth-child(1) .header-summary-led { animation-delay: 0.25s; }
.header-summary.summary-entering .header-summary-line:nth-child(2) .header-summary-led { animation-delay: 0.33s; }
.header-summary.summary-entering .header-summary-line:nth-child(3) .header-summary-led { animation-delay: 0.41s; }
.header-summary.summary-entering .header-summary-line:nth-child(4) .header-summary-led { animation-delay: 0.49s; }
.header-summary.summary-entering .header-summary-line:nth-child(5) .header-summary-led { animation-delay: 0.57s; }
.header-summary.summary-entering .header-summary-line:nth-child(6) .header-summary-led { animation-delay: 0.65s; }
.header-summary.summary-entering .header-summary-activity-title { animation-delay: 0.76s; }
.header-detail-trigger.summary-entering { animation-delay: 1.16s; }
.header-console.summary-entering .header-console-state { animation-delay: 1.22s; }

.header-detail-trigger {
    /* Overlaid on the bottom-right of the status panel so it sits at
       the same baseline as the last visible activity row — no
       dedicated footer strip, no trailing LED. The `bottom` offset
       cancels the panel's inherent bottom padding so the trigger
       rides on the same y as the last row's text baseline. */
    position: absolute;
    right: 12px;
    bottom: 9px;
    border: none;
    background: transparent;
    color: var(--text-min);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        color 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
        text-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.header-detail-trigger:hover {
    color: rgba(224, 224, 232, 0.54);
}

.header-wave-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-wave-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    min-height: 30px;
}

.header-wave-svg {
    width: 100%;
    height: 30px;
    overflow: visible;
}

.header-wave-grid {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 1;
}

.header-wave-trace {
    fill: none;
    stroke: rgba(75, 120, 255, 0.62);
    stroke-width: 1.15;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(75, 120, 255, 0.08));
    stroke-dasharray: 220;
    stroke-dashoffset: 0;
    animation: waveDrift 14s linear infinite;
}

.header-wave-trace-back {
    stroke: rgba(139, 139, 245, 0.12);
    stroke-width: 0.85;
    animation-duration: 22s;
}

.header-wave-readout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 0.5px solid rgba(255, 255, 255, 0.045);
    color: var(--text-min);
}

.header-overlay-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: -1px;
    right: -1px;
    z-index: 80;
    overflow: hidden;
    max-height: 0;
    padding: 0 14px;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-top: 0.5px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 9, 22, 0.92);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.46),
        0 0 0 1px rgba(255, 255, 255, 0.015);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transform-origin: top center;
    transition:
        max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-overlay-panel.is-visible {
    max-height: 680px;
    opacity: 1;
    padding: 12px 14px;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        max-height 0.54s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
        padding 0.44s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.header-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.05);
}

.header-overlay-title,
.header-overlay-code {
    color: rgba(224, 224, 232, 0.3);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-overlay-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.header-overlay-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-overlay-section-span {
    grid-column: 1 / -1;
}

.header-overlay-section-title {
    color: var(--text-min);
}

.header-overlay-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 3px;
    border-bottom: 0.5px dotted rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.35;
}

.header-overlay-value {
    color: rgba(224, 224, 232, 0.68);
    text-align: right;
    font-family: var(--numeric-font);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.header-overlay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.header-overlay-action-btn {
    padding: 7px 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.02);
    color: rgba(224, 224, 232, 0.72);
    font-family: var(--system-font);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.header-overlay-action-btn.primary {
    border-color: rgba(75, 120, 255, 0.18);
    color: rgba(75, 120, 255, 0.82);
}

.header-overlay-action-btn.danger {
    border-color: rgba(255, 92, 92, 0.18);
    color: rgba(255, 132, 132, 0.78);
}

.header-overlay-action-btn:hover:not(:disabled) {
    border-color: var(--text-min);
    color: rgba(224, 224, 232, 0.92);
    background: rgba(255, 255, 255, 0.04);
}

.header-overlay-action-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.header-overlay-note {
    color: var(--text-min);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.header-activity-log {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-top: 2px;
}

.header-activity-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    color: var(--text-secondary);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.32;
}

.header-activity-row.ok .header-activity-copy {
    color: rgba(160, 220, 168, 0.76);
}

.header-activity-row.warn .header-activity-copy {
    color: rgba(255, 209, 120, 0.76);
}

.header-activity-row.err .header-activity-copy,
.header-activity-row.fail .header-activity-copy {
    color: rgba(255, 144, 144, 0.78);
}

.header-activity-time {
    color: var(--text-min);
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.header-activity-copy {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-console-foot {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    min-height: 16px;
    margin-top: 0;
}

.header-console-status-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.header-console-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-family: var(--system-font);
    font-size: 8px;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.trace-toggle-btn {
    padding: 4px 11px;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: rgba(224, 224, 232, 0.52);
    font-family: var(--system-font);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.08em;
    transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.trace-toggle-btn:hover {
    border-color: rgba(139, 139, 245, 0.3);
    color: rgba(224, 224, 232, 0.84);
    box-shadow: 0 0 18px rgba(139, 139, 245, 0.1);
}

.header-log-item {
    color: rgba(224, 224, 232, 0.46);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.header-log-item.ok {
    color: rgba(120, 184, 64, 0.72);
}

.header-log-item.warn {
    color: rgba(255, 210, 74, 0.76);
}

.header-log-item.err {
    color: rgba(139, 139, 245, 0.8);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: rgba(224, 224, 232, 0.62);
    font-family: var(--system-font);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.06em;
}

.section-tag {
    padding: 3px 8px;
    border: 0.5px solid rgba(139, 139, 245, 0.28);
    color: rgba(139, 139, 245, 0.82);
    background: rgba(139, 139, 245, 0.06);
}

.section-divider {
    flex: 1;
    height: 0.5px;
    background: linear-gradient(90deg, rgba(139, 139, 245, 0.16), transparent);
}

.news-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(6, 5, 14, 0.82);
}

.news-overlay-card {
    width: min(680px, 100%);
    padding: 22px 24px;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 9, 22, 0.96);
    box-shadow: var(--panel-shadow);
}

.news-overlay-close {
    margin-left: auto;
    margin-bottom: 18px;
    display: inline-flex;
    padding: 4px 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: rgba(224, 224, 232, 0.54);
    font-family: var(--system-font);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.news-detail-title {
    margin-bottom: 12px;
    color: var(--fg);
    font-family: var(--ui-font);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.news-detail-body {
    color: rgba(224, 224, 232, 0.72);
    line-height: 1.7;
    font-size: 14px;
}

.loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(224, 224, 232, 0.4);
    font-family: var(--system-font);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.spin {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top-color: rgba(139, 139, 245, 0.8);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes waveDrift {
    from {
        stroke-dashoffset: 0;
    }
    to {
        stroke-dashoffset: -220;
    }
}

/* ── Status dot breathing animation ─────────────────────────────────────── */
@keyframes dotBreath {
    0%, 100% { opacity: 0.78; filter: brightness(0.9); }
    50%       { opacity: 1;    filter: brightness(1.18); }
}

/* ── Rain texture layer (wet-glass simulation) ──────────────────────────── */
.rain-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.62;
}

/* Fast streaks �?primary rain */
.rain-layer::before {
    content: "";
    position: absolute;
    inset: -45% -8% 0 -8%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='260' viewBox='0 0 180 260'%3E%3Cg stroke='%23ffe2c2' stroke-width='0.75' stroke-linecap='round' opacity='0.58'%3E%3Cpath d='M18 -12 L9 52'/%3E%3Cpath d='M72 20 L63 98' opacity='0.72'/%3E%3Cpath d='M132 -4 L122 70' opacity='0.48'/%3E%3Cpath d='M168 92 L158 168' opacity='0.38'/%3E%3C/g%3E%3Cg stroke='%23e1e8ff' stroke-width='0.55' stroke-linecap='round' opacity='0.32'%3E%3Cpath d='M44 118 L37 182'/%3E%3Cpath d='M108 146 L101 218'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 180px 260px;
    background-position: 0 0;
    animation: rainFallFast 2.9s linear infinite;
    filter: blur(0.15px);
    transform: skewX(-1.2deg);
    transform-origin: center top;
}

/* Slow streaks �?heavy droplets on glass */
.rain-layer::after {
    content: "";
    position: absolute;
    inset: -45% -10% 0 -10%;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='520' viewBox='0 0 260 520'%3E%3Cg stroke='%23ffe6ca' stroke-width='1.1' stroke-linecap='round' opacity='0.42'%3E%3Cpath d='M48 -30 L35 118'/%3E%3Cpath d='M184 78 L169 248' opacity='0.62'/%3E%3Cpath d='M112 292 L98 456' opacity='0.42'/%3E%3C/g%3E%3Cg stroke='%23ffb870' stroke-width='0.75' stroke-linecap='round' opacity='0.32'%3E%3Cpath d='M226 220 L214 356'/%3E%3Cpath d='M18 350 L8 496' opacity='0.46'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 260px 520px;
    background-position: 18px 0;
    animation: rainFallSlow 6.8s linear infinite;
    filter: blur(0.25px);
    transform: skewX(-0.7deg);
    transform-origin: center top;
}

@keyframes rainFallFast {
    from { transform: skewX(-1.2deg) translateY(0); }
    to   { transform: skewX(-1.2deg) translateY(34%); }
}

@keyframes rainFallSlow {
    from { transform: skewX(-0.7deg) translateY(0); }
    to   { transform: skewX(-0.7deg) translateY(28%); }
}


/* Rain / streak / droplet CSS layers + keyframes removed.
   All rain effects are now canvas-drawn by the background-glow module. */

/* ── First-load staged entrance system ─────────────────────────────────── */

.sys-bar {
    opacity: 0;
    transform: translateY(-100%);
    transition:
        opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.sys-bar.entered {
    opacity: 1;
    transform: translateY(0);
}

.identity-title {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(7px) scale(0.985);
    transition:
        opacity 0.82s cubic-bezier(0.19, 1, 0.22, 1),
        filter 0.9s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}

.identity-title.entered {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.identity-note {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.identity-note.entered {
    opacity: 1;
}

.identity-music-panel {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity 0.68s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.68s cubic-bezier(0.19, 1, 0.22, 1);
}

.identity-music-panel.entered {
    opacity: 1;
    transform: translateY(0);
}

.header-micro-panel {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.66s cubic-bezier(0.19, 1, 0.22, 1),
        transform 0.66s cubic-bezier(0.19, 1, 0.22, 1);
}

.header-micro-panel.entered {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered content reveal inside section panels */
.panel.anim > .section-label {
    opacity: 0;
    transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1) 0.14s;
}

.panel.anim.entered > .section-label {
    opacity: 1;
}

.panel.anim > .rp-core-grid,
.panel.anim > .kvk-overview {
    opacity: 0;
    transform: translateY(5px);
    transition:
        opacity 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.24s,
        transform 0.58s cubic-bezier(0.22, 1, 0.36, 1) 0.24s;
}

.panel.anim.entered > .rp-core-grid,
.panel.anim.entered > .kvk-overview {
    opacity: 1;
    transform: translateY(0);
}

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

@keyframes readoutTextResolve {
    from {
        opacity: 0;
        clip-path: inset(0 100% 0 0);
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
        transform: translateY(0);
    }
}

@keyframes readoutLineResolve {
    from {
        opacity: 0;
        transform: scaleX(0);
    }
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes statusRowSweep {
    0% {
        opacity: 0;
        transform: translateX(-120%);
    }
    24% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(270%);
    }
}

@keyframes statusLedResolve {
    from {
        opacity: 0;
        transform: scale(0.72);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


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

/* ── 4K scaling ────────────────────────────────────────────────── */
@media (min-width: 2560px) {
    .wrap {
        padding: 32px 48px 100px;
        gap: 36px;
    }
}

@media (max-width: 1100px) {
    .hero-row {
        grid-template-columns: 1fr;
    }

    .todo-panel {
        max-height: 320px;
    }

    .app-header-top-row {
        grid-template-columns: 1fr;
    }

    .identity-block {
        padding-right: 0;
        padding-bottom: 20px;
    }

    .header-console {
        padding-left: 0;
    }

    .header-console-foot {
        align-items: flex-start;
        justify-content: flex-start;
    }

    .header-console-status-group {
        align-items: flex-start;
    }

    .header-overlay-sections {
        grid-template-columns: 1fr;
    }

    .music-console-row {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 12px;
    }

    .music-console-vinyl {
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 760px) {
    .wrap {
        padding: 16px 14px 56px;
    }

    .panel {
        padding: 18px 16px;
    }

    .sys-bar-inner {
        padding: 0 14px;
        gap: 10px;
    }

    .section-label {
        gap: 8px;
        font-size: 9px;
        letter-spacing: 2px;
    }

    .identity-title {
        font-size: clamp(34px, 12vw, 56px);
        letter-spacing: 0.06em;
    }

    .identity-note {
        align-self: flex-start;
    }

    .music-console {
        min-height: 0;
        padding: 11px 12px 10px;
    }

    .music-console-row {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: 11px;
    }

    .music-console-vinyl {
        width: 56px;
        height: 56px;
    }

    .music-console-vinyl-label {
        width: 14px;
        height: 14px;
        margin: -7px 0 0 -7px;
    }

    .music-console-track {
        font-size: 13px;
    }

    .music-console-meta {
        font-size: 9px;
    }

    .news-overlay {
        padding: 14px;
    }
}

.sys-bar-id,
.srv-name,
.live-badge,
.t-line,
.header-console-state,
.header-detail-trigger,
.section-label,
.news-overlay-close,
.loading {
    font-family: var(--system-font);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* .header-summary-line was intentionally removed from the blanket 400
   rule above — its own rule (see :root → .header-summary-line up at
   line ~1219) sets font-weight: 500 for the boosted legibility the
   user asked for, and the cascade was overriding that back to 400. */

.sys-bar-id,
.srv-name,
.live-badge,
.header-console-state,
.header-detail-trigger,
.section-label,
.news-overlay-close,
.loading {
    text-transform: uppercase;
}
