/* ==========================================================================
   Bykring Project Manager — design system
   "Signal" — futuristic, minimal, near-monochrome dark theme with a single
   crisp accent color. Flat surfaces, hairline borders, sharp radii, no
   blur/glass/gradients/grain. One stylesheet for the whole app. Uses CSS
   custom properties so an AI agent can retheme by editing :root only.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg:            #08090c;
    --bg-2:          #0d0f13;
    --surface:       #101318;
    --surface-2:     #161a20;
    --border:        #23272e;
    --border-strong: #343a44;
    --text:          #eef1f4;
    --text-dim:      #9aa0aa;
    --muted:         #5a6169;
    --accent:        #00e5c7;
    --accent-dim:    #00a88f;
    --accent-soft:   rgba(0, 229, 199, 0.12);
    --amber:         #ffb454;
    --amber-soft:    rgba(255, 180, 84, 0.12);
    --success:       #39d98a;
    --success-bg:    rgba(57, 217, 138, 0.12);
    --danger:        #ff5c72;
    --danger-bg:     rgba(255, 92, 114, 0.12);
    --radius:        8px;
    --radius-sm:     6px;
    --radius-pill:   999px;
    --shadow:        0 24px 48px -32px rgba(0, 0, 0, 0.9);
    --glow:          0 0 0 2px var(--accent);
    --font:          'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono:     'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    position: relative;
}

body.landing,
body.auth-body,
body.panel-body { animation: page-enter 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page-transition-veil {
    position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
    pointer-events: none; opacity: 0; visibility: hidden;
    background: var(--bg); transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}
body.is-transitioning .page-transition-veil {
    opacity: 1; visibility: visible; transition-delay: 0s;
}
.panel-loader {
    width: min(320px, calc(100vw - 48px)); display: grid; justify-items: center;
    grid-template-columns: 1fr auto; gap: 12px 16px; color: var(--text);
    opacity: 0; transform: translateY(8px); transition: opacity 0.3s ease 0.28s, transform 0.3s ease 0.28s;
}
body.is-transitioning .panel-loader { opacity: 1; transform: translateY(0); }
.panel-loader-icon {
    grid-column: 1 / -1; position: relative; width: 52px; height: 52px;
    animation: panel-loader-spin 2.4s linear infinite;
}
.panel-loader-icon i {
    position: absolute; left: 50%; top: 50%; width: 7px; height: 7px;
    border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(0, 229, 199, 0.65);
}
.panel-loader-icon i:nth-child(1) { transform: translate(-50%, -50%) translateY(-20px); }
.panel-loader-icon i:nth-child(2) { transform: translate(-50%, -50%) rotate(120deg) translateY(-20px); }
.panel-loader-icon i:nth-child(3) { transform: translate(-50%, -50%) rotate(240deg) translateY(-20px); }
.panel-loader-label, .panel-loader-percent { font-family: var(--font-mono); font-size: 0.78rem; }
.panel-loader-label { justify-self: start; color: var(--text-dim); }
.panel-loader-percent { justify-self: end; color: var(--accent); font-variant-numeric: tabular-nums; }
.panel-loader-dots::after { content: ''; animation: panel-loader-dots 1.2s steps(4, end) infinite; }
.panel-loader-track {
    grid-column: 1 / -1; width: 100%; height: 3px; overflow: hidden;
    background: var(--border); border-radius: 2px;
}
.panel-loader-progress {
    display: block; width: 0%; height: 100%; background: var(--accent);
    box-shadow: 0 0 12px rgba(0, 229, 199, 0.55); will-change: width;
}
@keyframes panel-loader-spin { to { transform: rotate(360deg); } }
@keyframes panel-loader-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75%, 100% { content: '...'; }
}
@keyframes page-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.muted { color: var(--muted); font-size: 0.9rem; }
.right { text-align: right; }

/* ---- Brand --------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-weight: 600; font-size: 1rem; letter-spacing: 0.01em; }
.brand-center { justify-content: center; margin-bottom: 0.5rem; }
.brand-mark {
    display: inline-grid; place-items: center;
    width: 1.9rem; height: 1.9rem; border-radius: var(--radius-sm);
    background: var(--accent); color: #04140f; font-family: var(--font-mono);
    font-size: 0.78rem; font-weight: 700;
}
.brand-name { letter-spacing: 0.01em; }

.ui-icon { display: block; width: 1.1em; height: 1.1em; flex: 0 0 auto; }

/* ==========================================================================
   Background — flat + static technical grid (no motion, no blur, no grain)
   ========================================================================== */
.aurora { position: fixed; inset: 0; overflow: hidden; z-index: -1; background: var(--bg); }
.aurora-blob { display: none; }
.aurora::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(60% 50% at 82% 0%, rgba(0, 229, 199, 0.08), transparent 60%);
}
.grid-overlay {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(0,229,199,0.05) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0,229,199,0.05) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(85% 65% at 50% 0%, #000, transparent);
}

/* ---- Pointer-reactive particle network layer (canvas, JS-driven) -------- */
.aurora-particles {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
    pointer-events: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 0.88rem; cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #04140f; }
.btn-primary:hover { background: var(--accent-dim); box-shadow: var(--glow); }
.btn-success { background: var(--amber); color: #241200; }
.btn-success:hover { box-shadow: 0 0 0 2px var(--amber); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: rgba(255,92,114,0.3); }
.btn-danger:hover { background: rgba(255,92,114,0.2); }
.btn-block { width: 100%; }
.btn-lg { padding: 0.8rem 1.4rem; font-size: 0.95rem; }
.btn.is-button-detonating { visibility: hidden; pointer-events: none; }
.button-fragment {
    position: fixed; z-index: 6; display: block; pointer-events: none;
    border-radius: 1px; box-shadow: 0 0 5px currentColor;
    transform: translate(-50%, -50%); will-change: transform, opacity;
}

/* ==========================================================================
   Toolbar (page-level actions)
   ========================================================================== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.toolbar .toolbar-title { display: flex; flex-direction: column; gap: 0.2rem; }
.toolbar .toolbar-title h2 { font-size: 1.1rem; }
.toolbar .toolbar-title .muted { font-size: 0.85rem; }
.toolbar .toolbar-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ==========================================================================
   Modal dialog
   ========================================================================== */
dialog.modal {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: var(--radius); padding: 0; width: min(600px, 94vw); box-shadow: var(--shadow);
}
dialog.modal::backdrop { background: rgba(4, 5, 7, 0.7); }
dialog.modal[open] { animation: modal-in 0.15s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.5rem 1.75rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 1.15rem; }
.modal-body { padding: 1.75rem; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1.25rem 1.75rem; border-top: 1px solid var(--border); }
.modal-close { background: transparent; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0.15rem 0.4rem; border-radius: var(--radius-sm); }
.modal-close:hover { color: var(--text); background: var(--surface-2); }

/* Segmented toggle (existing client vs new client) */
.seg { display: flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.2rem; gap: 0.2rem; }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: block; text-align: center; padding: 0.5rem 0.75rem; border-radius: 4px; font-size: 0.85rem; color: var(--text-dim); cursor: pointer; font-weight: 600; transition: background 0.15s ease, color 0.15s ease; }
.seg input:checked + span { background: var(--accent); color: #04140f; }
.seg input:focus-visible + span { box-shadow: var(--glow); }

.icon-btn { display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer; padding: 0.4rem; border-radius: var(--radius-sm); transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease; }
.icon-btn .ui-icon { width: 1rem; height: 1rem; }
.icon-btn:hover { color: var(--danger); background: var(--danger-bg); border-color: rgba(255,92,114,0.35); }

/* ==========================================================================
   Public site header + hero
   ========================================================================== */
.site-header {
    position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem clamp(1.25rem, 5vw, 4rem);
}
.landing { display: flex; flex-direction: column; min-height: 100vh; overflow: clip; }
.hero { flex: 1; display: grid; place-items: center; padding: 2rem; text-align: center; }
.hero-inner { max-width: 680px; }
.eyebrow { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 1.1rem; padding: 0.3rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.hero-title { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; color: var(--text); }
.hero-sub { color: var(--text-dim); font-size: clamp(1rem, 2.5vw, 1.2rem); margin: 1.25rem auto 2rem; max-width: 540px; }
.hero-actions { position: relative; display: flex; width: min(680px, 92vw); min-height: 7rem; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 0; }
.hero-actions .btn { position: relative; z-index: 3; }
.space-map { position: relative; width: min(760px, 92vw); height: 210px; margin: 1.1rem auto 0; }
.space-target {
    --target-color: var(--accent);
    position: absolute; z-index: 3; display: grid; grid-template-columns: 8.5rem auto; align-items: center; gap: 1rem;
    color: var(--text); text-align: left; padding: 0.7rem 1rem; border: 0; background: transparent;
    cursor: crosshair; transition: filter 0.25s ease, transform 0.25s ease; isolation: isolate;
}
.space-target:hover, .space-target:focus-visible { filter: brightness(1.25); transform: translateY(-5px) scale(1.04); outline: none; }
.target-projects { left: 4%; top: 19%; }
.target-contact { right: 4%; top: 0; --target-color: var(--amber); }
.target-contact:hover, .target-contact:focus-visible { transform: translateY(-5px) scale(1.04); }
.celestial { position: relative; display: block; width: 8rem; height: 8rem; flex: 0 0 auto; }
.celestial-blackhole { filter: drop-shadow(0 0 12px rgba(255, 111, 27, 0.48)); }
.blackhole-lensing { position: absolute; inset: 0.55rem; border: 1px solid rgba(255, 188, 91, 0.5); border-radius: 50%; box-shadow: 0 0 10px rgba(255, 117, 30, 0.7), inset 0 0 8px rgba(255, 221, 146, 0.35); animation: lens-pulse 3.8s ease-in-out infinite; }
.blackhole-disc { position: absolute; inset: 1.05rem -0.1rem; border-radius: 50%; background: conic-gradient(from 12deg, transparent 0 7%, #ffcf72 13%, #ff6a1a 25%, #6d1023 39%, transparent 47% 57%, #ff9d32 68%, #ffe8a5 75%, #5c0d22 88%, transparent 94%); transform: rotate(-18deg) scaleY(0.32); filter: blur(0.8px); animation: accretion-spin 2.2s linear infinite; }
.blackhole-disc::after { content: ''; position: absolute; inset: 0.65rem; border-radius: 50%; background: conic-gradient(from 195deg, transparent, rgba(255, 243, 186, 0.9), transparent 22% 67%, rgba(255, 89, 19, 0.8), transparent); filter: blur(2px); }
.blackhole-core { position: absolute; inset: 2.18rem; z-index: 2; border-radius: 50%; background: #010103; box-shadow: 0 0 0 3px rgba(14, 5, 7, 0.8), 0 0 15px 5px rgba(255, 104, 21, 0.52), 0 0 30px 8px rgba(113, 27, 18, 0.36); }
.blackhole-glint { position: absolute; inset: 0.2rem; border-radius: 50%; border: 1px solid rgba(255, 228, 171, 0.55); border-left-color: transparent; border-bottom-color: transparent; transform: rotate(-35deg) scaleY(0.36); animation: lens-spin 5s linear infinite; }
.celestial-planet { filter: drop-shadow(0 0 14px rgba(54, 170, 255, 0.45)); }
.planet-body { position: absolute; inset: 1rem; z-index: 2; overflow: hidden; border-radius: 50%; background: linear-gradient(125deg, #70d6ff 0%, #236dba 33%, #0b2758 72%, #020818 100%); box-shadow: inset -14px -10px 18px rgba(0, 0, 20, 0.72), inset 8px 5px 13px rgba(185, 241, 255, 0.35), 0 0 12px 2px rgba(73, 185, 255, 0.5); }
.planet-land { position: absolute; inset: -8%; background: radial-gradient(ellipse at 28% 27%, #a9ea8d 0 8%, transparent 9%), radial-gradient(ellipse at 67% 60%, #53b66d 0 11%, transparent 12%), radial-gradient(ellipse at 55% 23%, #d8f098 0 5%, transparent 6%), radial-gradient(ellipse at 20% 75%, #2d8159 0 10%, transparent 11%); opacity: 0.75; transform: scaleX(1.45); animation: planet-land-shift 9s linear infinite; }
.planet-clouds { position: absolute; inset: -10%; background: repeating-linear-gradient(165deg, transparent 0 17px, rgba(228, 252, 255, 0.3) 18px 20px, transparent 21px 33px); mix-blend-mode: screen; opacity: 0.5; transform: rotate(-14deg); animation: planet-cloud-drift 7s linear infinite; }
.planet-lights { position: absolute; inset: 0; background: radial-gradient(circle at 28% 28%, rgba(255, 247, 174, 0.9) 0 1px, transparent 2px), radial-gradient(circle at 61% 63%, rgba(255, 228, 124, 0.8) 0 1px, transparent 2px); background-size: 25px 21px, 19px 25px; mix-blend-mode: screen; opacity: 0.7; }
.planet-atmosphere { position: absolute; inset: 0.35rem; z-index: 3; border: 2px solid rgba(151, 231, 255, 0.7); border-left-color: rgba(255, 255, 255, 0.85); border-radius: 50%; box-shadow: inset -4px 0 8px rgba(83, 197, 255, 0.7), 0 0 9px rgba(80, 194, 255, 0.75); animation: atmosphere-pulse 3s ease-in-out infinite; }
.planet-ring { position: absolute; left: -0.55rem; z-index: 4; width: 9.1rem; height: 2.6rem; border: 5px solid rgba(173, 222, 255, 0.7); border-left-color: rgba(68, 122, 190, 0.5); border-right-color: rgba(255, 237, 167, 0.74); border-radius: 50%; transform: rotate(-17deg) scaleY(0.42); box-shadow: 0 0 5px rgba(166, 225, 255, 0.6); }
.planet-ring-back { top: 2.25rem; z-index: 1; opacity: 0.7; }
.planet-ring-front { top: 4.95rem; clip-path: inset(50% 0 0); }
.space-target-copy { display: grid; gap: 0.1rem; min-width: 0; }
.space-target-copy strong { font-size: 0.92rem; }
.space-target-copy small { color: var(--text-dim); font-size: 0.68rem; white-space: nowrap; }
.space-target.is-button-detonating { visibility: hidden; pointer-events: none; }
@keyframes accretion-spin { to { transform: rotate(342deg) scaleY(0.32); } }
@keyframes lens-spin { to { transform: rotate(325deg) scaleY(0.36); } }
@keyframes lens-pulse { 0%, 100% { opacity: 0.62; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes planet-land-shift { to { transform: translateX(-22px) scaleX(1.45); } }
@keyframes planet-cloud-drift { to { transform: translateX(18px) rotate(-14deg); } }
@keyframes atmosphere-pulse { 0%, 100% { opacity: 0.72; transform: scale(0.98); } 50% { opacity: 1; transform: scale(1.02); } }
.hero-spaceship {
    --counter-thrust: 0;
    position: absolute; left: 50%; top: 50%; z-index: 2;
    width: 3.2rem; height: 3.8rem; pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 5px rgba(0, 229, 199, 0.28));
    transform: translate(-50%, -50%) translate(96px, -34px) rotate(102deg);
    will-change: transform;
}
.hero-spaceship.is-cursor-driven { position: fixed; left: 0; top: 0; touch-action: none; }
.enemy-ship {
    position: fixed; left: 0; top: 0; z-index: 2; width: 2.9rem; height: 3.45rem;
    pointer-events: none; will-change: transform; transition: opacity 0.35s ease, filter 0.35s ease;
    filter: drop-shadow(0 0 5px rgba(255, 54, 72, 0.7));
}
.enemy-ship svg { display: block; width: 100%; height: 100%; overflow: visible; }
.enemy-ship .fighter-wing,
.enemy-ship .fighter-body { fill: rgba(42, 3, 8, 0.52); stroke: #ffb2b9; }
.enemy-ship .fighter-cannon,
.enemy-ship .fighter-canopy,
.enemy-ship .fighter-engine { stroke: #ff3347; }
.enemy-ship .fighter-canopy { fill: rgba(255, 30, 54, 0.24); }
.enemy-ship .fighter-thrust { fill: #ff263f; opacity: 0.9; transform: scaleY(0.9); }
.enemy-ship .fighter-thrust-core { fill: #fff0d4; opacity: 1; transform: scaleY(0.78); }
.enemy-ship.is-boosting { filter: drop-shadow(0 0 9px rgba(255, 38, 63, 0.85)); }
.enemy-ship.is-boosting .fighter-thrust { fill: #ff6b24; transform: scaleY(1.75); filter: drop-shadow(0 0 6px #ff263f); animation: hero-thruster-boost 0.18s ease-out infinite alternate; }
.enemy-ship.is-boosting .fighter-thrust-core { fill: #fff4d2; transform: scaleY(1.5); animation: hero-thruster-core-boost 0.12s ease-out infinite alternate-reverse; }
.enemy-ship.is-hit { animation: enemy-hit 0.24s ease-out; }
.enemy-ship.is-leaving { opacity: 0; }
.enemy-ship.is-destroyed { opacity: 0; filter: brightness(4) drop-shadow(0 0 18px #ff263f); transform: scale(0.25); }
.enemy-health {
    position: fixed; left: 0; top: 0; z-index: 4; width: 38px; height: 3px; opacity: 0.62;
    border: 1px solid rgba(255, 185, 190, 0.45); background: rgba(20, 0, 3, 0.65);
    pointer-events: none; will-change: transform; transition: opacity 0.3s ease;
}
.enemy-health i { display: block; width: 100%; height: 100%; background: #ff3347; transform-origin: left center; transition: transform 0.2s ease; box-shadow: 0 0 3px #ff263f; }
.enemy-health b { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); color: rgba(255, 156, 166, 0.68); font: 700 7px/1 var(--font-mono); white-space: nowrap; }
.enemy-health.is-leaving,
.enemy-health.is-destroyed { opacity: 0; }
.enemy-shot {
    --accent: #ff3347;
}
.enemy-shot .rocket-shot-body { background: #ffd9dc; box-shadow: 0 0 4px #ff3347, 0 0 10px #ff263f; }
.enemy-shot .rocket-shot-flame { background: linear-gradient(90deg, transparent, #7d0713 30%, #ff263f 72%, #fff0d4); filter: drop-shadow(0 0 3px #ff263f); }
.missile-exhaust-particle.is-enemy { background: linear-gradient(90deg, transparent, #7d0713 34%, #ff263f 72%, #fff0d4); box-shadow: 0 0 4px #ff3347, 0 0 9px rgba(255, 25, 52, 0.82); }
.engine-particle.is-enemy { background: #fff0d4; box-shadow: 0 0 5px #fff0d4, 0 0 12px #ff6b24, 0 0 18px rgba(255, 38, 63, 0.9); }
.enemy-explosion {
    position: fixed; z-index: 7; width: 1px; height: 1px; pointer-events: none;
    transform: translate(-50%, -50%);
}
.enemy-explosion i,
.enemy-explosion b { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.enemy-explosion i { width: 22px; height: 22px; background: #fff7e8; box-shadow: 0 0 12px #ffdd9d, 0 0 30px #ff3347, 0 0 58px rgba(255, 18, 48, 0.88); animation: enemy-explosion-core 0.72s ease-out forwards; }
.enemy-explosion b { width: 18px; height: 18px; border: 2px solid #ff9ca6; box-shadow: 0 0 9px #ff263f; animation: enemy-explosion-ring 0.9s cubic-bezier(0.08, 0.65, 0.2, 1) forwards; }
@keyframes enemy-explosion-core { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); } 45% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); } }
@keyframes enemy-explosion-ring { 0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.35); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(5.5); } }
.player-health {
    position: fixed; left: 50%; bottom: 14px; z-index: 6; width: 42px; height: 3px;
    transform: translateX(-50%); opacity: 0; pointer-events: none;
    border: 1px solid rgba(183, 255, 245, 0.3); background: rgba(0, 12, 15, 0.58);
    transition: opacity 0.25s ease;
}
.player-health.is-visible { opacity: 0.58; }
.player-health i { display: block; width: 100%; height: 100%; background: #00e5c7; box-shadow: 0 0 3px #00e5c7; transform-origin: left center; transition: transform 0.2s ease; }
.enemy-fragment { position: fixed; z-index: 7; width: 3px; height: 6px; background: #ff3347; box-shadow: 0 0 6px #ff263f; pointer-events: none; }
@keyframes enemy-hit { 50% { filter: brightness(4) drop-shadow(0 0 14px #ff263f); } }
.hero-spaceship.is-arriving { opacity: 0; visibility: hidden; }
.hero-spaceship.is-emerging { animation: ship-emerge 0.76s cubic-bezier(0.16, 0.75, 0.25, 1) both; }
.hero-spaceship.is-ship-destroyed { visibility: hidden; }
.hero-spaceship.is-dormant { filter: none; }
.hero-spaceship .fighter-marking,
.hero-spaceship .fighter-cannon,
.hero-spaceship .fighter-nose,
.hero-spaceship .fighter-stripe,
.hero-spaceship .fighter-canopy,
.hero-spaceship .fighter-power-light { transition: fill 0.2s ease, stroke 0.2s ease, opacity 0.2s ease, filter 0.2s ease; }
.hero-spaceship.is-dormant .fighter-marking { fill: transparent; stroke: #53616b; }
.hero-spaceship.is-dormant .fighter-cannon { stroke: #53616b; }
.hero-spaceship.is-dormant .fighter-nose,
.hero-spaceship.is-dormant .fighter-stripe { fill: transparent; stroke: #53616b; }
.hero-spaceship.is-dormant .fighter-canopy { fill: rgba(8, 9, 12, 0.5); stroke: #3d5159; }
.hero-spaceship.is-dormant .fighter-power-light { opacity: 0; }
.hero-spaceship.is-dormant .fighter-canopy-shine { stroke: #26343f; opacity: 0.25; }
.fighter-fragment {
    position: fixed; z-index: 7; display: block; pointer-events: none;
    border-radius: 1px; box-shadow: 0 0 5px currentColor;
    transform: translate(-50%, -50%); will-change: transform, opacity;
}
.ship-arrival-portal {
    position: fixed; z-index: 1; width: 76px; height: 76px; pointer-events: none;
    transform: translate(-50%, -50%); border-radius: 50%; opacity: 0;
    animation: fabric-wobble 0.82s ease-out both;
}
.ship-arrival-portal i {
    position: absolute; inset: 20px; border: 1px solid rgba(117, 255, 236, 0.28);
    border-radius: 50%; box-shadow: inset 4px 0 7px rgba(0, 229, 199, 0.08), 0 0 6px rgba(8, 126, 197, 0.1);
    animation: fabric-ripple 0.78s cubic-bezier(0.12, 0.55, 0.25, 1) both;
}
.ship-arrival-portal i:nth-child(2) {
    border-color: rgba(8, 126, 197, 0.2); animation-delay: 0.1s; animation-duration: 0.68s;
}
@keyframes fabric-wobble {
    0% { opacity: 0; transform: translate(-50%, -50%) scaleX(0.82) scaleY(1.08); }
    22% { opacity: 0.65; transform: translate(-50%, -50%) scaleX(1.06) scaleY(0.94); }
    52% { opacity: 0.42; transform: translate(-50%, -50%) scaleX(0.97) scaleY(1.03); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes fabric-ripple {
    0% { opacity: 0; transform: scale(0.35); }
    24% { opacity: 0.7; }
    100% { opacity: 0; transform: scale(2.15); }
}
@keyframes ship-emerge {
    0% { opacity: 0; filter: blur(2px); }
    28% { opacity: 0.62; filter: blur(0.8px); }
    62%, 100% { opacity: 1; filter: blur(0); }
}
.hero-spaceship svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fighter-underwing { fill: rgba(4, 12, 17, 0.42); stroke: #27505a; stroke-width: 2; stroke-linejoin: bevel; }
.fighter-wing { fill: rgba(7, 20, 27, 0.26); stroke: #d9fff9; stroke-width: 2.4; stroke-linejoin: bevel; filter: drop-shadow(0 0 1.5px rgba(0, 229, 199, 0.45)); }
.fighter-marking { fill: transparent; stroke: #00e5c7; stroke-width: 1.5; stroke-linejoin: bevel; opacity: 0.82; }
.fighter-cannon { fill: none; stroke: #aafff4; stroke-width: 2.4; stroke-linecap: square; filter: drop-shadow(0 0 1.5px rgba(0, 229, 199, 0.7)); }
.fighter-body { fill: rgba(5, 17, 23, 0.34); stroke: #edfffc; stroke-width: 2.8; stroke-linejoin: bevel; filter: drop-shadow(0 0 2px rgba(0, 229, 199, 0.42)); }
.fighter-nose,
.fighter-stripe { fill: transparent; stroke: #00e5c7; stroke-width: 1.6; stroke-linejoin: bevel; filter: url(#fighter-powered-glow); }
.fighter-canopy { fill: rgba(4, 19, 27, 0.62); stroke: #68ffe9; stroke-width: 2; filter: drop-shadow(0 0 2px rgba(0, 229, 199, 0.62)); }
.fighter-canopy-shine { fill: none; stroke: rgba(230, 255, 252, 0.9); stroke-width: 1.4; stroke-linecap: round; opacity: 0.75; }
.fighter-engine { fill: rgba(3, 10, 14, 0.48); stroke: #79b8bc; stroke-width: 2.2; }
.fighter-panel-lines { fill: none; stroke: rgba(97, 211, 208, 0.58); stroke-width: 1.05; stroke-linecap: square; stroke-linejoin: bevel; }
.fighter-power-light { fill: none; stroke: #8ffff0; stroke-width: 1.5; stroke-linecap: square; filter: url(#fighter-powered-glow); }
.fighter-thrust,
.fighter-thrust-core { transform-box: fill-box; transform-origin: center top; }
.fighter-thrust { fill: #087ec5; opacity: 0; transform: scaleY(0); }
.fighter-thrust-core { fill: #d9fffa; opacity: 0; transform: scaleY(0); }
.hero-spaceship.is-thrusting .fighter-thrust { filter: drop-shadow(0 0 3px #087ec5); animation: hero-thruster 0.32s ease-out infinite alternate; }
.hero-spaceship.is-thrusting .fighter-thrust-core { filter: drop-shadow(0 0 2px #d9fffa); animation: hero-thruster-core 0.23s ease-out infinite alternate-reverse; }
.hero-spaceship.is-counter-thrusting .fighter-thrust { filter: drop-shadow(0 0 calc(3px + var(--counter-thrust) * 7px) #00e5c7) drop-shadow(0 0 calc(var(--counter-thrust) * 10px) #087ec5); }
.hero-spaceship.is-counter-thrusting .fighter-thrust-core { filter: drop-shadow(0 0 calc(2px + var(--counter-thrust) * 5px) #fff); }
.hero-spaceship.is-boosting { filter: drop-shadow(0 0 8px rgba(0, 229, 199, 0.7)); }
.hero-spaceship.is-boosting.is-thrusting .fighter-thrust { fill: #ff4b2e; filter: drop-shadow(0 0 4px #ff3d24) drop-shadow(0 0 10px rgba(255, 126, 35, 0.85)); animation: hero-thruster-boost 0.18s ease-out infinite alternate; }
.hero-spaceship.is-boosting.is-thrusting .fighter-thrust-core { fill: #fff2c7; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 8px #ff8a24); animation: hero-thruster-core-boost 0.12s ease-out infinite alternate-reverse; }
.engine-particle {
    position: fixed; left: 0; top: 0; z-index: 1; width: 3px; height: 7px;
    border-radius: 50%; pointer-events: none; transform-origin: center;
    background: #87fff1; box-shadow: 0 0 4px #00e5c7, 0 0 8px rgba(8, 126, 197, 0.75);
}
.engine-particle.is-boost { width: 4px; height: 11px; background: #fff4d2; box-shadow: 0 0 5px #fff, 0 0 12px #ff8a24, 0 0 18px rgba(255, 55, 32, 0.9); }
.engine-particle.is-counter-thrust { width: calc(3px + var(--counter-thrust) * 2px); height: calc(7px + var(--counter-thrust) * 8px); background: #fff; box-shadow: 0 0 calc(4px + var(--counter-thrust) * 5px) #d9fffa, 0 0 calc(8px + var(--counter-thrust) * 10px) #00e5c7, 0 0 calc(var(--counter-thrust) * 22px) #087ec5; }
.rocket-shot {
    position: fixed; left: 0; top: 0; z-index: 3; width: 0; height: 0;
    pointer-events: none; transform-origin: center;
}
.rocket-shot-body {
    position: absolute; right: 0; top: 0; width: 1.1rem; height: 2px;
    border-radius: var(--radius-pill); transform: translateY(-50%);
    background: #b7fff5; box-shadow: 0 0 4px var(--accent), 0 0 10px var(--accent);
}
.rocket-shot-flame {
    position: absolute; right: calc(100% - 1px); top: 50%; width: 0.9rem; height: 5px;
    border-radius: 50% 0 0 50%; pointer-events: none; transform-origin: right center;
    background: linear-gradient(90deg, transparent 0%, rgba(8, 126, 197, 0.82) 32%, #00e5c7 72%, #d9fffa 100%);
    filter: drop-shadow(0 0 3px #00e5c7);
    animation: missile-flame 0.09s ease-in-out infinite alternate;
}
.rocket-shot-flame::after {
    content: ""; position: absolute; right: 0; top: 50%; width: 58%; height: 2px;
    border-radius: 50%; background: #fff; box-shadow: 0 0 4px #d9fffa;
    transform: translateY(-50%);
}
.missile-exhaust-particle {
    position: fixed; left: 0; top: 0; z-index: 2; width: 12px; height: 2px;
    border-radius: 50%; pointer-events: none; transform-origin: center;
    background: linear-gradient(90deg, transparent, #087ec5 34%, #00e5c7 72%, #eafffb);
    box-shadow: 0 0 4px #00e5c7, 0 0 9px rgba(8, 126, 197, 0.8);
}
.rocket-impact-burst { position: fixed; left: 0; top: 0; z-index: 3; width: 1px; height: 1px; pointer-events: none; transform: translate3d(var(--impact-x), var(--impact-y), 0); }
.rocket-impact-burst.is-enemy-impact .rocket-impact-core { box-shadow: 0 0 8px #fff0d4, 0 0 22px #ff3347, 0 0 42px rgba(255, 38, 63, 0.92); }
.rocket-impact-burst.is-enemy-impact .rocket-impact-ring { border-color: #ff9ca6; box-shadow: 0 0 8px #ff263f, inset 0 0 7px rgba(255, 38, 63, 0.72); }
.rocket-impact-burst.is-enemy-impact .rocket-impact-spark { background: linear-gradient(90deg, #fff0d4, #ff3347 55%, transparent); box-shadow: 0 0 5px #ff263f; }
.rocket-impact-core,
.rocket-impact-ring { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.rocket-impact-core { width: 1.1rem; height: 1.1rem; background: #fff; box-shadow: 0 0 8px #d9fffa, 0 0 22px #00e5c7, 0 0 42px rgba(8, 126, 197, 0.9); animation: impact-core 0.52s ease-out forwards; }
.rocket-impact-ring { width: 1rem; height: 1rem; border: 2px solid #b7fff5; box-shadow: 0 0 8px #00e5c7, inset 0 0 7px rgba(0, 229, 199, 0.75); animation: impact-ring 0.72s cubic-bezier(0.08, 0.65, 0.2, 1) forwards; }
.rocket-impact-ring.is-second { animation-delay: 0.08s; border-color: rgba(8, 126, 197, 0.85); }
.rocket-impact-spark { position: absolute; left: 0; top: 0; width: var(--spark-length); height: 2px; border-radius: 50%; transform-origin: left center; pointer-events: none; background: linear-gradient(90deg, #fff, #00e5c7 55%, transparent); box-shadow: 0 0 5px #00e5c7; animation: impact-spark 0.62s var(--spark-delay) ease-out forwards; }
@keyframes hero-thruster {
    from { transform: scaleY(calc(0.72 + var(--counter-thrust) * 0.58)); opacity: calc(0.52 + var(--counter-thrust) * 0.28); }
    to { transform: scaleY(calc(1 + var(--counter-thrust) * 0.8)); opacity: calc(0.82 + var(--counter-thrust) * 0.18); }
}
@keyframes hero-thruster-core {
    from { transform: scaleY(calc(0.78 + var(--counter-thrust) * 0.42)); opacity: calc(0.72 + var(--counter-thrust) * 0.2); }
    to { transform: scaleY(calc(1 + var(--counter-thrust) * 0.62)); opacity: 1; }
}
@keyframes hero-thruster-boost {
    from { transform: scaleY(calc(1.35 + var(--counter-thrust) * 0.45)); opacity: 0.8; }
    to { transform: scaleY(calc(1.85 + var(--counter-thrust) * 0.65)); opacity: 1; }
}
@keyframes hero-thruster-core-boost {
    from { transform: scaleY(calc(1.2 + var(--counter-thrust) * 0.35)); opacity: 0.88; }
    to { transform: scaleY(calc(1.65 + var(--counter-thrust) * 0.5)); opacity: 1; }
}
@keyframes impact-core {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.35); }
    42% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); }
}
@keyframes impact-ring {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(5.8); }
}
@keyframes impact-spark {
    0% { opacity: 1; transform: rotate(var(--spark-angle)) translateX(3px) scaleX(0.35); }
    100% { opacity: 0; transform: rotate(var(--spark-angle)) translateX(var(--spark-distance)) scaleX(0.05); }
}
@keyframes missile-flame {
    from { opacity: 0.72; transform: translateY(-50%) scaleX(0.68) scaleY(0.72); }
    to { opacity: 1; transform: translateY(-50%) scaleX(1.08) scaleY(1); }
}
.site-foot { text-align: center; padding: 1.5rem; color: var(--muted); font-size: 0.85rem; }

/* ---- Public pages -------------------------------------------------------- */
.public-page { min-height: 100vh; overflow-x: hidden; }
.public-main { width: min(1120px, calc(100% - 2.5rem)); margin: 0 auto; padding: clamp(4rem, 10vw, 8rem) 0 5rem; }
.public-kicker { color: var(--accent); font: 600 0.72rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; }
.public-title { max-width: 760px; margin-top: 1rem; font-size: clamp(2.4rem, 7vw, 5.7rem); line-height: 1.02; }
.public-intro { max-width: 620px; margin: 1.5rem 0 3.5rem; color: var(--text-dim); font-size: 1.1rem; }
.public-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.public-project { position: relative; min-height: 230px; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.public-project::before { content: ''; position: absolute; top: 0; right: 0; width: 42%; height: 3px; background: var(--project-accent, var(--accent)); box-shadow: 0 0 18px var(--project-accent, var(--accent)); }
.public-project-index { color: var(--project-accent, var(--accent)); font: 0.72rem/1 var(--font-mono); }
.public-project h2 { margin-top: 3rem; font-size: 1.25rem; }
.public-project p { margin: 0.55rem 0 0; color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; }
.public-project-meta { position: absolute; right: 1.5rem; bottom: 1.4rem; left: 1.5rem; padding-top: 0.8rem; border-top: 1px solid var(--border); color: var(--muted); font: 0.68rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.public-empty { padding: 2rem; color: var(--text-dim); border: 1px dashed var(--border-strong); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr); gap: 4rem; align-items: start; }
.contact-card { border-top: 1px solid var(--accent); padding-top: 1.2rem; }
.contact-card h2 { font-size: 1rem; }
.contact-card p { color: var(--text-dim); }
.contact-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--accent); font-family: var(--font-mono); border-bottom: 1px solid rgba(0, 229, 199, 0.35); padding-bottom: 0.2rem; }
.contact-link:hover { color: var(--text); border-color: var(--text); }
.public-back { display: inline-flex; margin-top: 4rem; color: var(--text-dim); font: 0.78rem/1 var(--font-mono); }
.public-back:hover { color: var(--text); }

/* ==========================================================================
   Auth cards (login / install)
   ========================================================================== */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.auth-card {
    width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 2.25rem; box-shadow: var(--shadow); text-align: center;
}
.auth-card h1 { font-size: 1.4rem; margin-top: 0.75rem; }
.auth-card form { text-align: left; margin-top: 1.25rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem; color: var(--text-dim); font-size: 0.9rem; }
.back-link .ui-icon { width: 1rem; height: 1rem; }
.back-link:hover { color: var(--text); }

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 0.85rem; border: 1px solid transparent; }
.alert-error { background: var(--danger-bg); color: #ffb0bb; border-color: rgba(255,92,114,0.3); }
.alert-success { background: var(--success-bg); color: #9ff0c4; border-color: rgba(57,217,138,0.3); }
.alert code { background: var(--surface-2); padding: 0.05rem 0.35rem; border-radius: 4px; }

/* ==========================================================================
   Forms
   ========================================================================== */
.stack { display: flex; flex-direction: column; gap: 1.15rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.75rem; }
.row { display: flex; gap: 1.15rem; flex-wrap: wrap; }
.row > label { flex: 1; min-width: 120px; }
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--text-dim); font-weight: 500; }
input, select, textarea {
    font: inherit; font-size: 0.95rem; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem; width: 100%; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
textarea { resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa0aa' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2rem; }

/* ==========================================================================
   Panel layout
   ========================================================================== */
.panel { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
    background: var(--bg-2); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 1.5rem 1.15rem; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 0 0.6rem 1.5rem; }
.side-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.side-link { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); color: var(--text-dim); font-weight: 500; font-size: 0.9rem; border-left: 2px solid transparent; }
.side-link:hover { background: var(--surface-2); color: var(--text); }
.side-link.is-active { background: var(--surface-2); color: var(--text); border-left-color: var(--accent); }
.side-ico { display: inline-grid; place-items: center; width: 1.2rem; height: 1.2rem; color: var(--muted); }
.side-link:hover .side-ico, .side-link.is-active .side-ico { color: var(--accent); }
.side-foot { border-top: 1px solid var(--border); padding-top: 1rem; }
.who { display: flex; flex-direction: column; padding: 0 0.6rem 0.6rem; }
.who-name { font-weight: 600; font-size: 0.9rem; }
.who-mail { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; }
.side-logout { display: block; padding: 0.5rem 0.6rem; color: var(--text-dim); font-size: 0.9rem; border-radius: var(--radius-sm); }
.side-logout:hover { background: var(--surface-2); color: var(--danger); }

.content { min-width: 0; }
.content-head { padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.content-head h1 { font-size: 1.4rem; max-width: 1180px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
.content-body { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem); max-width: 1180px; margin: 0 auto; }

/* ---- Stat tiles ---------------------------------------------------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.4rem; }
.stat-label { color: var(--text-dim); font-size: 0.82rem; }
.stat-value { font-family: var(--font-mono); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
.stat-accent { border-color: rgba(255,180,84,0.3); }
.stat-accent .stat-value { color: var(--amber); }
.stat-success { border-color: rgba(57,217,138,0.3); }
.stat-success .stat-value { color: var(--success); }

/* ---- Cards & split ------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; }
.card + .card { margin-top: 1.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; }
.card-head h2 { font-size: 1.05rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.empty { color: var(--muted); text-align: center; padding: 1.5rem 0; }

/* ---- Dashboard sections & card grids ------------------------------------ */
.section + .section { margin-top: 2.25rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.section-head h2 { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.mini-card { display: flex; flex-direction: column; gap: 0.9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; cursor: pointer; min-height: 140px; transition: border-color 0.15s ease; }
.mini-card:hover { border-color: var(--accent); }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.mc-title { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.mc-sub { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.15rem; }
.mc-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; border-top: 1px solid var(--border); padding-top: 0.8rem; margin-top: auto; }
.mc-total { font-family: var(--font-mono); font-weight: 600; font-size: 1rem; color: var(--amber); }
.mc-count { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 0.5rem; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-dim); font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; border: 1px solid var(--border); }

/* ---- Company intelligence dashboard ------------------------------------- */
.dashboard-intelligence { margin-top: 0.5rem; }
.section-head > div .muted { margin: 0.25rem 0 0; }
.company-stats { margin-bottom: 1.25rem; }
.company-stats .stat { min-height: 150px; }
.company-stats .muted { margin-top: auto; font-size: 0.78rem; }
.finance-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr); align-items: start; gap: 1.25rem; }
.finance-grid .card + .card { margin-top: 0; }
.finance-grid .health-card { min-width: 0; }
.chart-card .card-head { align-items: flex-start; }
.chart-card .card-head h2, .health-card .card-head h2 { font-size: 1.05rem; }
.chart-card .card-head .muted { margin: 0.25rem 0 0; font-size: 0.8rem; }
.chart-key { display: flex; align-items: center; gap: 0.35rem; color: var(--text-dim); font-size: 0.76rem; white-space: nowrap; }
.chart-key span { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; margin-left: 0.45rem; }
.chart-key span:first-child { margin-left: 0; }
.key-income { background: var(--success); }
.key-expense { background: var(--danger); }
.trend-chart { position: relative; height: 270px; padding-top: 0.5rem; overflow: hidden; }
.trend-chart svg { width: 100%; height: 230px; overflow: visible; }
.is-expandable { cursor: zoom-in; outline: none; }
.chart-summary, .chart-detail { position: absolute; inset: 0; transform-origin: center; }
.chart-summary { transition: transform 0.52s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0.52s; }
.chart-detail { visibility: hidden; clip-path: inset(0 50% 0 50%); transform: scale(0.12); transition: clip-path 0.52s cubic-bezier(.2,.8,.2,1), transform 0.52s cubic-bezier(.2,.8,.2,1), visibility 0s linear 0.52s; }
.chart-detail-inner { height: 100%; overflow: hidden; padding: 0 0.25rem; }
.is-expandable:hover, .is-expandable:focus-visible { cursor: default; }
.is-expandable:hover .chart-summary, .is-expandable:focus-visible .chart-summary { transform: scale(0.1); visibility: hidden; }
.is-expandable:hover .chart-detail, .is-expandable:focus-visible .chart-detail { visibility: visible; clip-path: inset(0 0 0 0); transform: scale(1); transition-delay: 0s; }
.dated-bar-chart { display: grid; grid-template-columns: repeat(var(--date-count), minmax(0, 1fr)); gap: 0; align-items: end; width: 100%; height: 224px; padding: 0.75rem 0.4rem 0; border-bottom: 1px solid var(--border); }
.dated-bar-group { display: grid; grid-template-rows: 190px auto; gap: 0.35rem; min-width: 0; }
.dated-bars { position: relative; display: block; height: 190px; border-bottom: 1px solid var(--border); background: repeating-linear-gradient(to top, transparent 0 62px, rgba(255,255,255,0.04) 63px 64px); }
.dated-bar { position: absolute; right: 0; bottom: 0; left: 0; display: block; width: 100%; height: var(--bar-height); min-height: 0; border-radius: 1px 1px 0 0; transition: filter 0.15s ease, width 0.2s ease; }
.dated-bar:hover { filter: brightness(1.25); }
.dated-income-bar { background: var(--success); color: var(--success); }
.dated-expense-bar { background: var(--danger); color: var(--danger); opacity: 0.85; }
.dated-bar-group time { display: none; color: var(--muted); font-size: 0.62rem; line-height: 1.2; text-align: center; text-transform: uppercase; white-space: nowrap; }
.dated-bar-group.is-month-marker time { display: block; }
.chart-detail-note { margin: 0.55rem 0.4rem 0; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.chart-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 4 5; opacity: 0.8; }
.income-bar { fill: rgba(57,217,138,0.5); stroke: var(--success); stroke-width: 1; }
.expense-bar { fill: rgba(255,92,114,0.5); stroke: var(--danger); stroke-width: 1; }
.chart-value { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.chart-value-income { fill: var(--success); }
.chart-value-expense { fill: var(--danger); }
.chart-labels { display: grid; grid-template-columns: repeat(6, 1fr); padding: 0 2.8%; color: var(--muted); font-size: 0.74rem; text-align: center; text-transform: uppercase; letter-spacing: 0.06em; }
.total-chart-labels { grid-template-columns: repeat(2, 1fr); padding: 0 19%; }
.health-card { display: flex; flex-direction: column; }
.health-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); color: var(--text-dim); font-size: 0.85rem; }
.health-row strong { color: var(--text); text-align: right; font-size: 0.95rem; }
.health-note { color: var(--muted); font-size: 0.78rem; line-height: 1.5; margin: auto 0 0; padding-top: 1rem; }

/* ---- Tables -------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th { text-align: left; color: var(--text-dim); font-family: var(--font-mono); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); }
.table td { padding: 1rem 0.9rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.table tbody tr[onclick] { cursor: pointer; transition: background 0.12s ease; }
.table tbody tr[onclick]:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }

/* ---- Pills --------------------------------------------------------------- */
.pill { display: inline-block; padding: 0.2rem 0.55rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid currentColor; }
.pill-open { background: var(--success-bg); color: var(--success); }
.pill-closed { background: var(--amber-soft); color: var(--amber); }
.pill-archived { background: var(--surface-2); color: var(--muted); }
.pill-unpaid { background: var(--amber-soft); color: var(--amber); }
.pill-paid { background: var(--success-bg); color: var(--success); }

/* ---- Project header + summary ------------------------------------------- */
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0 1.75rem; flex-wrap: wrap; }
.proj-head .muted { margin-left: 0.6rem; }
.proj-actions { display: flex; gap: 0.5rem; }
.invoice-panel { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.75rem; background: var(--surface); }
.invoice-panel h2 { font-size: 1.1rem; }
.invoice-panel .muted { margin: 0.3rem 0 0; }
.invoice-eyebrow { display: block; margin-bottom: 0.35rem; color: var(--accent); font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.invoice-title-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.invoice-panel-actions { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.payment-switch { flex-direction: row; align-items: center; gap: 0.5rem; cursor: pointer; color: var(--text); white-space: nowrap; }
.payment-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 2.35rem; height: 1.3rem; padding: 0.15rem; display: flex; align-items: center; border-radius: var(--radius-pill); background: var(--border); transition: background 0.2s ease; }
.switch-track span { width: 1rem; height: 1rem; border-radius: 50%; background: var(--text); transition: transform 0.2s ease; }
.payment-switch input:checked + .switch-track { background: var(--success); }
.payment-switch input:checked + .switch-track span { transform: translateX(1.05rem); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.sum-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.sum-label { color: var(--text-dim); font-size: 0.82rem; }
.sum-value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
.sum-total { background: var(--bg-2); border: 1px solid var(--accent); color: var(--text); box-shadow: none; }
.sum-total .sum-value { color: var(--accent); }

/* ---- Danger zone --------------------------------------------------------- */
.danger-zone { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; }
    .invoice-panel { align-items: flex-start; flex-direction: column; }
    .finance-grid { grid-template-columns: 1fr; }
    .panel { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
    .sidebar .brand { padding: 0 0.6rem; }
    .side-nav { flex-direction: row; flex: 1 1 100%; overflow-x: auto; }
    .side-foot { border-top: 0; padding-top: 0; display: flex; align-items: center; gap: 0.75rem; }
    .who { display: none; }
}

@media (max-width: 600px) {
    .space-map { height: 300px; }
    .target-projects { left: 2%; top: 14%; }
    .target-contact { right: 2%; top: 55%; }
    .space-target { grid-template-columns: 7rem auto; gap: 0.65rem; padding: 0.4rem; }
    .celestial { width: 6.8rem; height: 6.8rem; }
    .blackhole-disc { inset: 0.92rem -0.1rem; }
    .blackhole-core { inset: 1.86rem; }
    .blackhole-lensing { inset: 0.45rem; }
    .planet-body { inset: 0.86rem; }
    .planet-atmosphere { inset: 0.28rem; }
    .planet-ring { left: -0.48rem; width: 7.75rem; }
    .planet-ring-back { top: 1.92rem; }
    .planet-ring-front { top: 4.18rem; }
    .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-spaceship { width: 2.75rem; height: 3.3rem; }
    .enemy-ship { width: 2.55rem; height: 3.05rem; }
    .chart-card .card-head { flex-direction: column; }
    .chart-key { white-space: normal; }
    .stat-value { font-size: 1.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    .blackhole-lensing, .blackhole-disc, .blackhole-glint, .planet-land, .planet-clouds, .planet-atmosphere { animation: none; }
    .fighter-thrust,
    .fighter-thrust-core { animation: none; }
    .hero-spaceship.is-thrusting .fighter-thrust { animation: none; transform: scaleY(0.9); opacity: 0.82; }
    .hero-spaceship.is-thrusting .fighter-thrust-core { animation: none; transform: scaleY(0.82); opacity: 1; }
    .hero-spaceship.is-boosting.is-thrusting .fighter-thrust { transform: scaleY(1.65); opacity: 1; }
    .hero-spaceship.is-boosting.is-thrusting .fighter-thrust-core { transform: scaleY(1.45); opacity: 1; }
    .rocket-impact-core,
    .rocket-impact-ring,
    .rocket-impact-spark { animation-duration: 0.18s; }
    .rocket-shot-flame { animation: none; transform: translateY(-50%) scaleX(0.78); }
    .chart-summary, .chart-detail { transition: none; }
}

/* Landing art direction lives in landing.css, loaded only by index.php. */
