/*
 * Fleet Commander - Core Visual System
 * Author: Alexander Gottschalk (Gottschi)
 * Last updated: 2026-08-09
 * Project: fleet-commander.net
 */

@import url('../vendor/fonts/fonts.css');


/* =========================================================
   FLEET COMMANDER
   Core Visual System
   ========================================================= */

:root {
    --fc-bg: #11110d;
    --fc-panel: #181811;
    --fc-panel-soft: #1e1f16;

    --fc-border: rgba(166, 160, 130, 0.16);
    --fc-border-active: rgba(150, 187, 68, 0.36);

    --fc-cyan: rgb(150, 187, 68);
    --fc-cyan-soft: rgba(150, 187, 68, 0.20);

    --fc-text: #e6e3d2;
    --fc-text-muted: #86816a;
}


/* =========================================================
   BASE
   ========================================================= */

html,
body {
    background: var(--fc-bg);
}

body {
    font-family: 'Rajdhani', sans-serif;
    font-size: 16px;
    color: var(--fc-text);
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.font-sci-fi {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.font-mono-custom {
    font-family: 'Share Tech Mono', monospace;
}


/* =========================================================
   MAIN PANELS

   Intentionally more solid and technical than classic
   glassmorphism. The panel should feel integrated into the
   interface instead of floating above it.
   ========================================================= */

.glass-panel {
    background:
        linear-gradient(
            180deg,
            rgba(24, 22, 15, 0.97) 0%,
            rgba(14, 13, 9, 0.97) 100%
        );

    border: 1px solid var(--fc-border);

    /* Small directional shadow instead of a large floating glow */
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.025) inset,
        0 6px 18px rgba(0, 0, 0, 0.22);

    /* Deliberately no backdrop blur */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;

    transition:
        border-color 0.18s ease,
        background-color 0.18s ease;
}


/* Subtle feedback only */
.glass-panel:hover {
    border-color: rgba(150, 187, 68, 0.22);
}


/* =========================================================
   OPTIONAL TECHNICAL PANEL DETAIL

   Adds a very subtle inner line without creating another
   glowing card effect.
   ========================================================= */

.glass-panel::before {
    content: "";
    position: absolute;
    pointer-events: none;
}


/* =========================================================
   TAB SYSTEM
   ========================================================= */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}


/* =========================================================
   FORM ELEMENTS

   Keep browser controls readable but reduce the "pill/card"
   feeling slightly.
   ========================================================= */

input,
select,
button {
    font-family: inherit;
}

input,
select {
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

input:focus,
select:focus {
    border-color: rgba(150, 187, 68, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(150, 187, 68, 0.08);
}


/* =========================================================
   BUTTON BEHAVIOUR

   No generic scaling / exaggerated glow.
   ========================================================= */

button {
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        opacity 0.15s ease;
}

button:active {
    transform: translateY(1px);
}


/* =========================================================
   COLLAPSIBLE INFO / GUIDE
   ========================================================= */

details > summary {
    user-select: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

details[open] > summary {
    border-bottom-color: rgba(150, 187, 68, 0.18);
}


/* =========================================================
   CUSTOM SCROLLBAR
   Main interface
   ========================================================= */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(150, 187, 68, 0.30)
        transparent;
}


/* Chrome / Edge / Safari */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(150, 187, 68, 0.24);

    border-radius: 8px;

    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(150, 187, 68, 0.48);
}

::-webkit-scrollbar-thumb:active {
    background-color: rgba(150, 187, 68, 0.72);
}

::-webkit-scrollbar-corner {
    background: transparent;
}


/* =========================================================
   TERMINAL SCROLLBAR
   Even more subtle
   ========================================================= */

#console-output {
    scrollbar-width: thin;
    scrollbar-color:
        rgba(150, 187, 68, 0.22)
        transparent;
}

#console-output::-webkit-scrollbar {
    width: 5px;
}

#console-output::-webkit-scrollbar-track {
    background: transparent;
}

#console-output::-webkit-scrollbar-thumb {
    background-color: rgba(150, 187, 68, 0.20);
    border-radius: 5px;
    border: none;
}

#console-output::-webkit-scrollbar-thumb:hover {
    background-color: rgba(150, 187, 68, 0.42);
}


/* =========================================================
   TACTICAL TREE

   Treat the fleet tree more like an instrument/display
   instead of another floating dashboard card.
   ========================================================= */

#tactical-tree-display {
    background:
        linear-gradient(
            180deg,
            rgba(13, 12, 8, 0.98),
            rgba(12, 11, 7, 0.98)
        ) !important;

    border-color: rgba(150, 187, 68, 0.08) !important;

    box-shadow:
        inset 0 1px 12px rgba(0, 0, 0, 0.32);

    scrollbar-color:
        rgba(150, 187, 68, 0.30)
        transparent;
}


/* =========================================================
   TEXT SELECTION
   ========================================================= */

::selection {
    background: rgba(150, 187, 68, 0.85);
    color: #0d0c08;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 1px solid rgba(150, 187, 68, 0.7);
    outline-offset: 2px;
}




/* =========================================================
   READABILITY / CONTRAST
   ========================================================= */

/* Neutral reading colors reduce blue-on-blue fatigue. */
#tactical-tree-display {
    color: #d3cead;
}

#console-output {
    color: rgba(211, 206, 173, 0.92);
}

#guide-container {
    color: #d3cead;
}

#guide-container p,
#guide-container li {
    color: #d3cead;
}

/* =========================================================
   LARGE & ULTRAWIDE DISPLAY SCALING
   ========================================================= */

@media (min-width: 1600px) {
    body {
        font-size: 17px;
    }

    .nav-text {
        font-size: 0.95rem;
    }

    [id^="lang-stat-"] {
        font-size: 0.88rem !important;
    }

    .tab-content > h3 {
        font-size: 1.05rem !important;
    }

    .tab-content > p,
    .tab-content p {
        font-size: 0.94rem;
        line-height: 1.55;
    }

    .tab-content label {
        font-size: 0.84rem !important;
    }

    .tab-content input,
    .tab-content select,
    .tab-content button {
        font-size: 0.88rem !important;
    }

    #guide-container,
    #guide-container p,
    #guide-container li {
        font-size: 0.86rem !important;
    }

    #tactical-tree-display {
        font-size: 0.94rem !important;
        line-height: 1.7;
    }

    #console-output {
        font-size: 0.76rem !important;
    }
}

@media (min-width: 2400px) {
    body {
        font-size: 18px;
    }

    .nav-text {
        font-size: 1rem;
    }

    [id^="lang-stat-"] {
        font-size: 0.94rem !important;
    }

    .tab-content > h3 {
        font-size: 1.12rem !important;
    }

    .tab-content p {
        font-size: 1rem;
    }

    .tab-content label,
    .tab-content input,
    .tab-content select,
    .tab-content button {
        font-size: 0.94rem !important;
    }

    #guide-container,
    #guide-container p,
    #guide-container li {
        font-size: 0.92rem !important;
    }

    #tactical-tree-display {
        font-size: 1rem !important;
    }

    #console-output {
        font-size: 0.82rem !important;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* =========================================================
   INTERACTIVE FLEET OVERVIEW
   Clickable squad / ship / crew entries
   ========================================================= */

.fleet-tree-link {
    cursor: pointer;
    border-radius: 3px;
    transition:
        background-color 0.14s ease,
        color 0.14s ease,
        box-shadow 0.14s ease;
}

.fleet-tree-link:hover {
    background: rgba(150, 187, 68, 0.08);
    box-shadow: inset 2px 0 0 rgba(150, 187, 68, 0.45);
}

.fleet-tree-link:focus-visible {
    outline: 1px solid rgba(150, 187, 68, 0.65);
    outline-offset: 2px;
}

.fleet-tree-squad:hover {
    color: rgb(178, 204, 103);
}

.fleet-tree-ship:hover {
    color: #f6f4e8;
}

.fleet-tree-crew:hover {
    color: rgb(110, 231, 183);
}


/* =========================================================
   v0.9.4 READABILITY UPDATE
   Neutral reading palette — cyan is an accent, not body text.
   ========================================================= */

:root {
    --fc-read-primary: #ded9bd;
    --fc-read-strong: #ebe8d8;
    --fc-read-secondary: #b6b092;
    --fc-read-muted: #948e73;
    --fc-border-neutral: rgba(160, 154, 125, 0.18);
    --fc-border-neutral-soft: rgba(160, 154, 125, 0.11);
}

/* Main descriptive/body copy */
.tab-content > p,
.tab-content p,
#guide-container,
#guide-container p,
#guide-container li,
#changelog-content,
#changelog-content li {
    color: var(--fc-read-primary) !important;
    font-weight: 500;
}

/* Form labels and secondary interface text */
.tab-content label,
.tab-content h4,
#lang-nav-header,
.nav-text {
    color: var(--fc-read-secondary) !important;
}

/* Keep active navigation visibly active */
.nav-btn.bg-sky-500\/10 .nav-text,
.nav-btn.text-sky-300 .nav-text {
    color: #cbdd94 !important;
}

/* Inputs should be easy to read instead of cyan-on-navy */
input,
select,
textarea {
    color: var(--fc-read-strong) !important;
    border-color: var(--fc-border-neutral) !important;
}

input::placeholder,
textarea::placeholder {
    color: #756f58 !important;
    opacity: 1;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(160, 154, 125, 0.30) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(150, 187, 68, 0.60) !important;
}

/* Reduce permanent blue outlines across content modules */
.glass-panel,
details,
#guide-container > div > div,
.tab-content .bg-slate-900\/60,
.tab-content .bg-slate-900\/40 {
    border-color: var(--fc-border-neutral-soft) !important;
}

/* Fleet display: neutral information, semantic status colors remain */
#tactical-tree-display {
    color: #dcd7ba !important;
    border-color: rgba(160, 154, 125, 0.12) !important;
}

#tactical-tree-display .text-slate-200 {
    color: #ebe8d8 !important;
}

#tactical-tree-display .text-slate-400 {
    color: #b6b092 !important;
}

#tactical-tree-display .text-slate-500,
#tactical-tree-display .text-slate-600 {
    color: #8a8469 !important;
}

/* Console is data, not an accent surface */
#console-output {
    color: #c3bd9c !important;
    font-weight: 500;
}

/* Guide cards are deliberately neutral */
#guide-container .text-slate-300,
#guide-container .text-slate-400 {
    color: var(--fc-read-primary) !important;
}

/* Cyan remains intentional on real headings/interactive accents */
.tab-content > h3,
#lang-tree-title,
#guide-container .text-sky-300,
#guide-container .text-sky-400 {
    color: #b2cc67 !important;
}

/* Large screens: improve stroke weight as well as size */
@media (min-width: 1600px) {
    body {
        font-weight: 500;
    }

    .tab-content > p,
    .tab-content p,
    #guide-container,
    #guide-container p,
    #guide-container li,
    #tactical-tree-display {
        font-weight: 500;
    }

    .tab-content label,
    .nav-text {
        font-weight: 600;
    }
}

@media (min-width: 2400px) {
    .tab-content > p,
    .tab-content p,
    #guide-container,
    #guide-container p,
    #guide-container li {
        line-height: 1.65;
    }
}


/* =========================================================
   v0.9.5 NEUTRAL CONTRAST UPDATE
   Strong correction after beta feedback:
   no more blue text on blue surfaces.
   ========================================================= */

:root {
    --fc-neutral-strong: #ece9da;
    --fc-neutral-primary: #ded9bd;
    --fc-neutral-secondary: #b6b092;
    --fc-neutral-muted: #8a8469;
    --fc-surface-main: #0b0a07;
    --fc-surface-panel: #100e0a;
}

/* Make the work surfaces slightly more graphite / less blue */
.glass-panel {
    background: linear-gradient(
        180deg,
        rgba(17, 16, 11, 0.985) 0%,
        rgba(13, 12, 8, 0.985) 100%
    ) !important;
}

/* Main application headings: OFF-WHITE, not cyan */
.tab-content > h3,
.tab-content h3,
.tab-content h4,
#lang-tree-title,
details > summary,
#guide-container .text-sky-300,
#guide-container .text-sky-400,
#changelog-content .text-sky-300,
#changelog-content .text-sky-400 {
    color: var(--fc-neutral-strong) !important;
}

/* Icons may keep a restrained cool tint, but text does not */
details > summary i,
#lang-tree-title i {
    color: #a09a7d !important;
}

/* Normal content */
.tab-content p,
.tab-content li,
#guide-container,
#guide-container p,
#guide-container li,
#changelog-content,
#changelog-content p,
#changelog-content li {
    color: var(--fc-neutral-primary) !important;
}

/* All form labels become neutral grey */
.tab-content label,
.tab-content .text-slate-400,
.tab-content .text-slate-500 {
    color: var(--fc-neutral-secondary) !important;
}

/* Inputs: white data on neutral dark field */
input,
select,
textarea {
    color: var(--fc-neutral-strong) !important;
    background-color: rgba(12, 11, 7, 0.88) !important;
}

input::placeholder,
textarea::placeholder {
    color: #7d775f !important;
}

/* Guide cards: no blue-tinted text or borders */
#guide-container > div,
#guide-container > div > div,
#guide-container .bg-slate-900\/40 {
    border-color: rgba(160, 154, 125, 0.13) !important;
}

/* Fleet Overview: neutral by default */
#tactical-tree-display {
    color: var(--fc-neutral-primary) !important;
    background: #060503 !important;
}

#tactical-tree-display .fleet-tree-squad,
#tactical-tree-display .fleet-tree-ship,
#tactical-tree-display .fleet-tree-crew,
#tactical-tree-display .text-sky-300,
#tactical-tree-display .text-sky-400,
#tactical-tree-display .text-slate-200 {
    color: var(--fc-neutral-strong) !important;
}

#tactical-tree-display .text-slate-400 {
    color: var(--fc-neutral-secondary) !important;
}

#tactical-tree-display .text-slate-500,
#tactical-tree-display .text-slate-600 {
    color: var(--fc-neutral-muted) !important;
}

/* Preserve semantic state colors explicitly */
#tactical-tree-display .text-emerald-400 {
    color: #34d399 !important;
}

#tactical-tree-display .text-amber-400 {
    color: #fbbf24 !important;
}

#tactical-tree-display .text-rose-500,
#tactical-tree-display .text-rose-400 {
    color: #fb7185 !important;
}

/* Hover remains interactive but not neon */
.fleet-tree-link:hover {
    background: rgba(255, 255, 255, 0.045) !important;
    box-shadow: inset 2px 0 0 rgba(160, 154, 125, 0.55) !important;
    color: #ffffff !important;
}

.fleet-tree-squad:hover,
.fleet-tree-crew:hover,
.fleet-tree-ship:hover {
    color: #ffffff !important;
}

/* Console */
#console-output {
    color: #c3bd9c !important;
}

/* Inactive sidebar labels: readable neutral grey */
#main-sidebar .nav-btn.text-slate-400 .nav-text {
    color: #b6b092 !important;
}

/* Active sidebar is one of the few places where cyan remains intentional */
#main-sidebar .nav-btn.text-sky-300 .nav-text {
    color: #b2cc67 !important;
}

/* Info / guide toggle helper text should be subdued, not blue */
#lang-guide-toggle {
    color: #948e73 !important;
}

/* Larger displays: slightly stronger reading weight */
@media (min-width: 1600px) {
    .tab-content p,
    .tab-content label,
    #guide-container,
    #guide-container p,
    #guide-container li,
    #tactical-tree-display {
        font-weight: 600;
    }
}


/* =========================================================
   v0.9.6 FLEET TREE HIERARCHY
   Visual separation: squad > ship > player > role > status
   ========================================================= */

/* Squadron = cyan identity / grouping */
#tactical-tree-display .fleet-tree-squad {
    color: #96bb44 !important;
    font-weight: 700;
}

/* Ship = bright neutral, strongest content level */
#tactical-tree-display .fleet-tree-ship-name {
    color: #eeecdd !important;
    font-weight: 700;
}

#tactical-tree-display .fleet-tree-ship-icon {
    color: #96bb44 !important;
}

/* Player = violet, clearly distinct from ship names */
#tactical-tree-display .fleet-tree-player-name {
    color: #dfc98c !important;
    font-weight: 600;
}

#tactical-tree-display .fleet-tree-player-icon {
    color: #c8ae68 !important;
}

/* Role identity: label + symbol carry the role color */
#tactical-tree-display .fleet-tree-role,
#tactical-tree-display .fleet-tree-role-icon {
    font-weight: 700;
}

#tactical-tree-display .fleet-tree-role-icon {
    display: inline-block;
    min-width: 1.35em;
    text-align: center;
    margin-right: 0.12rem;
}

/* Pilot = cyan / flight command */
#tactical-tree-display .role-pilot {
    color: #96bb44 !important;
}

/* Co-Pilot = violet / secondary flight command */
#tactical-tree-display .role-copilot {
    color: #c8ae68 !important;
}

/* Gunner = amber / weapons */
#tactical-tree-display .role-gunner {
    color: #f59e0b !important;
}

/* General Crew = neutral */
#tactical-tree-display .role-crew {
    color: #d3cead !important;
}

/* Engineer = teal / technical */
#tactical-tree-display .role-engineer {
    color: #2dd4bf !important;
}

/* Medic = rose / medical */
#tactical-tree-display .role-medic {
    color: #fb7185 !important;
}

/* Ground Force = green / ground operations */
#tactical-tree-display .role-ground {
    color: #4ade80 !important;
}

/* Command / leadership = gold */
#tactical-tree-display .role-command {
    color: #fde047 !important;
}

/* Recon / marksmanship = violet */
#tactical-tree-display .role-recon {
    color: #a78bfa !important;
}

#tactical-tree-display .role-unknown {
    color: #a09a7d !important;
}

/* Location remains subdued so it does not compete with the hierarchy */
#tactical-tree-display .fleet-tree-squad + .text-slate-400 {
    color: #a09a7d !important;
}

/* Keep hover readable without flattening hierarchy */
#tactical-tree-display .fleet-tree-squad:hover { color: #b2cc67 !important; }
#tactical-tree-display .fleet-tree-ship:hover .fleet-tree-ship-name { color: #ffffff !important; }
#tactical-tree-display .fleet-tree-crew:hover .fleet-tree-player-name { color: #dfc98c !important; }
#tactical-tree-display .fleet-tree-crew:hover .fleet-tree-role,
#tactical-tree-display .fleet-tree-crew:hover .fleet-tree-role-icon {
    filter: brightness(1.18);
}


/* =========================================================
   UWQHD / ULTRAWIDE OPTIMIZATION
   Only affects very wide desktop viewports.
   WQHD, smaller windows, tablets and mobile stay unchanged.
   ========================================================= */

@media (min-width: 2560px) {

    body {
        font-size: 17px;
    }

    main {
        max-width: none;
        width: auto;
        margin-left: 0;
        margin-right: 0;
        padding-left: 2rem;
        padding-right: 2rem;
    }

    #tactical-tree-display {
        font-size: 15px !important;
        line-height: 1.65;
    }

    .tab-content p,
    .tab-content label,
    #guide-container,
    #guide-container p,
    #guide-container li {
        line-height: 1.6;
    }
}


/* =========================================================
   v0.9.7 ROLE IDENTITY
   Native <option> elements cannot be reliably colorized per
   entry in every browser, so the dropdown uses role emojis
   while the Fleet Tree provides the full color hierarchy.
   ========================================================= */

#select-deploy-role {
    font-weight: 600;
    letter-spacing: 0.01em;
}

#select-deploy-role option {
    background: #17150f;
    color: #eeecdd;
}


/* v0.10.7 - central ship DB in tactical tree */
#tactical-tree-display .fleet-tree-db-badge {
    color: #b2cc67;
    font-size: 0.85em;
    font-weight: 700;
}
#tactical-tree-display .fleet-tree-db-missing {
    color: #6b6552;
    font-size: 0.85em;
    font-weight: 700;
}
#tactical-tree-display .fleet-tree-capacity {
    color: #a09a7d;
    font-size: 0.85em;
    font-weight: 700;
}
#tactical-tree-display .fleet-tree-station-line {
    color: #a9a488;
    font-size: 0.9em;
}
#tactical-tree-display .fleet-tree-station-label {
    color: #b2cc67;
    font-weight: 700;
    letter-spacing: 0.04em;
}


/* =========================================================
   v0.10.8 - Compact inline station display in Fleet Tree
   ========================================================= */

#tactical-tree-display .fleet-tree-db-badge,
#tactical-tree-display .fleet-tree-db-missing,
#tactical-tree-display .fleet-tree-station-line,
#tactical-tree-display .fleet-tree-station-label {
    display: none !important;
}

#tactical-tree-display .fleet-tree-stations-inline {
    color: #a9a488;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
}

#tactical-tree-display .fleet-tree-stations-title {
    color: #b2cc67;
    font-weight: 700;
    letter-spacing: 0.04em;
}

#tactical-tree-display .fleet-tree-capacity {
    color: #a09a7d;
    font-size: 0.85em;
    font-weight: 700;
    white-space: nowrap;
}

/* Let the wide Fleet Tree actually use its available horizontal space. */
#tactical-tree-display {
    overflow-x: auto;
}

#tactical-tree-display .fleet-tree-ship {
    white-space: nowrap;
}


/* =========================================================
   v0.10.9 - Adaptive Fleet Tree stations
   ========================================================= */

#tactical-tree-display .fleet-tree-stations-detail {
    color: #a9a488;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
}

#tactical-tree-display .fleet-tree-stations-detail .fleet-tree-stations-title {
    color: #b2cc67;
    font-weight: 700;
}


/* v0.10.10 - station-specific role identities reuse the established palette */
.role-unknown {
    color: #d3cead;
}


/* v0.10.11 - Hybrid role selector */
#select-deploy-role option.role-group-label {
    color: #6b6552;
    font-weight: 700;
}


/* =========================================================
   v0.10.13 - Responsive workspace / tablet landscape polish
   ========================================================= */

/* The lower status row uses the branding panel as its natural row height.
   The system log now stretches to exactly the same height instead of being
   capped independently with max-h-28. */
#right-lower-bar {
    align-items: stretch;
}

#system-log-panel,
#branding-panel {
    height: 100%;
}

#system-log-panel {
    max-height: none !important;
}

#console-output {
    min-height: 0;
    max-height: none !important;
}

/* Keep scrolling inside the actual information surfaces instead of chaining
   into the whole application shell. This is especially important on touch. */
#tactical-tree-display,
#console-output,
#left-workspace {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#tactical-tree-display {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    touch-action: pan-x pan-y;
}

/* At desktop breakpoints the right side must be allowed to shrink internally,
   otherwise a long Tree can force the entire page to move. */
@media (min-width: 1024px) {
    #workspace-grid,
    #right-workspace,
    #left-workspace {
        min-height: 0;
    }

    #right-workspace > .glass-panel:first-child {
        min-height: 0 !important;
    }
}

/* Landscape tablets:
   - reclaim the 256px desktop sidebar on touch devices
   - keep the hamburger navigation available
   - place log + branding next to each other
   - contain all scrolling inside the left panel / Fleet Tree / log
   - reduce spacing slightly so the Fleet Tree retains useful height */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) and (pointer: coarse) {
    body {
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    #main-sidebar {
        display: none !important;
    }

    #mobile-tablet-nav {
        display: block !important;
    }

    main {
        padding: 0.75rem !important;
    }

    #workspace-grid {
        gap: 0.75rem !important;
        overflow: hidden !important;
    }

    #right-workspace {
        gap: 0.75rem !important;
        overflow: hidden !important;
    }

    #right-lower-bar {
        gap: 0.75rem !important;
    }

    #system-log-panel,
    #branding-panel {
        min-height: 6.75rem;
    }

    #branding-panel {
        padding: 0.5rem 0.75rem !important;
        gap: 0.25rem !important;
    }

    #branding-panel img[alt="Community"],
    #branding-panel img[alt="Star Citizen"] {
        max-height: 1.6rem;
    }

    #branding-panel img[alt="Signature"] {
        max-height: 2rem;
    }

    #tactical-tree-display {
        overflow: auto !important;
        overscroll-behavior: contain;
    }

    #left-workspace {
        overflow-y: auto !important;
        overscroll-behavior: contain;
    }
}


/* =========================================================
   v0.10.14 - Tablet root scroll lock
   ========================================================= */

/*
 * Android/Opera can still scroll the document even when child panels have
 * overflow:auto if a flex item keeps its default min-content height.
 * The app shell is therefore explicitly constrained all the way down:
 * html/body -> app body -> main -> workspace -> columns -> scroll surfaces.
 */
@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) and (pointer: coarse) {
    html {
        width: 100%;
        height: var(--fc-visual-viewport-height, 100dvh);
        min-height: 0 !important;
        max-height: var(--fc-visual-viewport-height, 100dvh);
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    #app-shell {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: var(--fc-visual-viewport-height, 100dvh) !important;
        min-height: 0 !important;
        max-height: var(--fc-visual-viewport-height, 100dvh) !important;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    #app-body {
        flex: 1 1 0% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    #app-main {
        flex: 1 1 0% !important;
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    #workspace-grid {
        flex: 1 1 0% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    #left-workspace,
    #right-workspace {
        height: 100% !important;
        min-height: 0 !important;
        max-height: 100% !important;
    }

    #right-workspace > .glass-panel:first-child {
        flex: 1 1 0% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    #tactical-tree-display {
        flex: 1 1 0% !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: auto !important;
        overscroll-behavior: contain !important;
        touch-action: pan-x pan-y;
    }

    #left-workspace,
    #console-output {
        overscroll-behavior: contain !important;
    }

    /* Prevent accidental text-selection drag from turning into document pan. */
    #workspace-grid {
        touch-action: manipulation;
    }

    #tactical-tree-display,
    #left-workspace,
    #console-output,
    input,
    select,
    textarea,
    button,
    a {
        touch-action: auto;
    }
}


/* =========================================================
   v0.10.16 - Mobile log containment
   ========================================================= */

#system-log-panel {
    min-height: 0;
    overflow: hidden;
}

#console-output,
.fc-console-output {
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

/* Phones: fixed console viewport; content scrolls internally. */
@media (max-width: 767px) {
    #system-log-panel {
        height: 10rem !important;
        min-height: 10rem !important;
        max-height: 10rem !important;
        flex: 0 0 10rem !important;
        overflow: hidden !important;
    }

    #console-output,
    .fc-console-output {
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
        touch-action: pan-y;
    }
}

/* Portrait tablet / large phone. */
@media (min-width: 768px) and (max-width: 1023px) {
    #system-log-panel {
        height: 8.5rem !important;
        min-height: 8.5rem !important;
        max-height: 8.5rem !important;
        flex: 0 0 8.5rem !important;
        overflow: hidden !important;
    }

    #console-output,
    .fc-console-output {
        height: 100% !important;
        max-height: 100% !important;
        overflow-y: auto !important;
    }
}

/* Desktop/tablet landscape: preserve equal lower-row height, scroll text inside. */
@media (min-width: 1024px) {
    #system-log-panel {
        overflow: hidden !important;
    }

    #console-output,
    .fc-console-output {
        flex: 1 1 auto;
        height: 0;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
    }
}


/* =========================================================
   v0.10.19 - Operations Readiness
   ========================================================= */

.ops-metric {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.2rem;
    border: 1px solid rgb(72 69 54 / 0.55);
    border-radius: 0.25rem;
    background: rgb(17 17 13 / 0.48);
    padding: 0.55rem 0.65rem;
}

.ops-metric-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgb(134 128 101);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.625rem;
    line-height: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ops-metric-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1rem;
}

.ops-person-chip {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    gap: 0.3rem;
    border: 1px solid rgb(100 96 76 / 0.65);
    border-radius: 0.25rem;
    background: rgb(32 31 24 / 0.7);
    padding: 0.15rem 0.4rem;
    color: rgb(204 199 167);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    line-height: 1rem;
}

.ops-person-chip > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 639px) {
    #operations-readiness-panel {
        font-size: 0.95rem;
    }
}


/* =========================================================
   v0.10.23 - UI Consistency / Readiness Polish
   ========================================================= */

/*
 * Unified action control system.
 * The visual reference is the solid, compact action button used in
 * Player Registration. Semantic colors remain, but geometry/typography
 * are identical across Crew, Squads, Deployment and Configuration.
 */
.fc-action-btn {
    min-height: 2.5rem !important;
    height: 2.5rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem;

    border-radius: 0.375rem !important;

    font-family: 'Rajdhani', sans-serif !important;
    font-size: 0.75rem !important;
    line-height: 1 !important;
    font-weight: 700 !important;
    letter-spacing: 0.045em !important;
    text-transform: uppercase !important;
}

/* Destructive secondary actions stay recognizable without becoming
   visually louder than the primary deployment action. */
#lang-deploy-btn-delsquad,
#lang-deploy-btn-delveh {
    background: rgba(159, 18, 57, 0.18) !important;
    border: 1px solid rgba(244, 63, 94, 0.38) !important;
    color: rgb(253 164 175) !important;
}

#lang-deploy-btn-delsquad:hover,
#lang-deploy-btn-delveh:hover {
    background: rgba(159, 18, 57, 0.30) !important;
    border-color: rgba(251, 113, 133, 0.52) !important;
    color: rgb(254 205 211) !important;
}

/* Readiness uses the same reading scale as the User Guide rather than
   tiny telemetry text. */
#operations-readiness-panel {
    font-size: 0.75rem;
}

#ops-summary-line,
#ops-alerts-list,
#ops-available-list {
    font-size: 0.75rem !important;
    line-height: 1.25rem !important;
}

.ops-metric {
    gap: 0.3rem;
    padding: 0.65rem 0.75rem;
}

.ops-metric-label {
    font-size: 0.75rem;
    line-height: 1rem;
    letter-spacing: 0.045em;
    color: rgb(166 160 130);
}

.ops-metric-value {
    font-size: 1rem;
    line-height: 1.25rem;
}

.ops-person-chip {
    font-size: 0.75rem;
    line-height: 1rem;
    padding: 0.2rem 0.45rem;
}
/* =========================================================
   v0.10.46 - USER GUIDE READABILITY
   Keep help content comfortably readable at 100% browser zoom.
   This is deliberately scoped to the guide and does not enlarge
   the compact planning controls or Fleet Tree.
   ========================================================= */

#guide-container {
    font-size: 1rem !important;
    line-height: 1.7 !important;
}

#guide-container p,
#guide-container li {
    font-size: 1rem !important;
    line-height: 1.7 !important;
}

#guide-container section > div:first-child {
    font-size: 1.0625rem !important;
    line-height: 1.4 !important;
}

#guide-container .bg-slate-900\/40 > .font-bold,
#guide-container .bg-slate-900\/40 > b {
    font-size: 1rem !important;
    line-height: 1.45 !important;
}

#guide-container > div > div:last-child {
    font-size: 0.9375rem !important;
    line-height: 1.6 !important;
}

@media (max-width: 639px) {
    #guide-container,
    #guide-container p,
    #guide-container li {
        font-size: 0.975rem !important;
        line-height: 1.65 !important;
    }

    #guide-container section > div:first-child {
        font-size: 1rem !important;
    }
}
/* Logo visibility must win over icon-library display declarations. */
.fc-logo-asset[hidden],
#top-left-icon[hidden],
#header-orga-logo-fallback[hidden] {
    display: none !important;
}

/* =========================================================
   Mobile header / topbar responsive layout
   ========================================================= */

@media (max-width: 639px) {
    #top-header {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        align-items: start;
        gap: 0.5rem 0.75rem;
        padding-top: max(0.625rem, env(safe-area-inset-top));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-left: max(0.75rem, env(safe-area-inset-left));
    }

    #top-header-primary {
        display: contents;
    }

    #mobile-tablet-nav {
        grid-column: 1;
        grid-row: 1;
    }

    #top-header-primary > .group:not(#mobile-tablet-nav) {
        grid-column: 2;
        grid-row: 1;
    }

    #top-header-copy {
        display: contents;
    }

    #top-header-copy h1 {
        grid-column: 3 / -1;
        grid-row: 1;
        align-self: center;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #top-header-meta {
        grid-column: 1 / 4;
        grid-row: 2;
        display: flex;
        flex-wrap: wrap;
        max-width: none;
        min-width: 0;
        align-items: center;
        gap: 0.35rem;
        overflow: visible;
        white-space: nowrap;
    }

    .top-header-user {
        display: inline-flex;
        min-width: 0;
        flex: 1 1 0;
        align-items: center;
        gap: 0.25rem;
    }

    .top-header-divider {
        display: none;
    }

    .top-header-status {
        flex: 0 0 100%;
    }

    #display-deck-id {
        display: inline-block;
        min-width: 3.5rem;
        max-width: min(42vw, 10rem);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #top-header-controls {
        grid-column: 4;
        grid-row: 2;
        align-self: start;
    }

    #top-header-controls label {
        min-height: 2.25rem;
    }

    #language-select {
        width: 5.5rem;
        max-width: 5.5rem;
        min-height: 1.75rem;
    }
}

@media (max-width: 430px) {
    #top-header {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    #top-header-primary > .group:not(#mobile-tablet-nav) {
        display: none;
    }

    #top-header-copy h1 {
        grid-column: 2 / -1;
    }

    #top-header-meta {
        grid-column: 1 / 3;
        padding-top: 0.1rem;
    }

    #display-deck-id {
        max-width: calc(100vw - 13rem);
    }

    #top-header-controls {
        grid-column: 3;
    }
}

/* =========================================================
   Phone bottom navigation
   ========================================================= */

.finance-participant-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) auto minmax(6rem, auto);
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(58, 54, 41, 0.6);
    border-radius: 0.375rem;
    background: rgba(13, 12, 8, 0.28);
}

.finance-participant-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.finance-short-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    color: #a09a7d;
    font-size: 0.7rem;
    white-space: nowrap;
    user-select: none;
}

.finance-short-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.finance-short-toggle-box {
    width: 1.15rem;
    height: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(150, 187, 68, 0.42);
    border-radius: 0.25rem;
    background: rgba(24, 23, 17, 0.92);
    color: transparent;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.finance-short-toggle input:checked + .finance-short-toggle-box {
    border-color: #96bb44;
    background: rgba(94, 160, 36, 0.22);
    color: #b2cc67;
    box-shadow: 0 0 0.65rem rgba(94, 160, 36, 0.18);
}

.finance-short-toggle input:focus-visible + .finance-short-toggle-box {
    outline: 2px solid #b2cc67;
    outline-offset: 2px;
}

.finance-participant-payout {
    text-align: right;
    color: #b2cc67;
    font-family: "Share Tech Mono", monospace;
    font-size: 0.75rem;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .finance-participant-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.4rem 0.75rem;
    }

    .finance-short-toggle {
        grid-column: 1;
    }

    .finance-participant-payout {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

#mobile-bottom-nav {
    display: none;
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.35rem max(0.35rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.35rem, env(safe-area-inset-left));
    border-top: 1px solid rgba(150, 187, 68, 0.28);
    background: rgba(13, 12, 8, 0.97);
    box-shadow: 0 -0.75rem 2rem rgba(13, 12, 8, 0.72);
    backdrop-filter: blur(14px);
}

.mobile-bottom-nav-btn {
    min-width: 0;
    min-height: 3.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: 1px solid transparent;
    border-radius: 0.4rem;
    color: #a09a7d;
    font-family: "Rajdhani", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.mobile-bottom-nav-btn i {
    font-size: 0.9rem;
}

.mobile-bottom-nav-btn span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bottom-nav-btn.is-active {
    border-color: rgba(150, 187, 68, 0.22);
    background: rgba(94, 160, 36, 0.12);
    color: #b2cc67;
}

@media (max-width: 639px) {
    #mobile-bottom-nav {
        display: grid;
    }

    #app-body {
        padding-bottom: calc(4rem + env(safe-area-inset-bottom));
    }
}

/* =========================================================
   CUSTOM MODAL SYSTEM
   Replaces native alert()/confirm()/prompt(). Deliberately
   avoids backdrop blur and glassmorphism, consistent with
   .glass-panel further up in this file. Title, message,
   buttons and the input field reuse existing Tailwind
   utility classes and the global input/button rules above;
   the only new visual device is the four corner brackets,
   an intentional nod to a tactical HUD/targeting reticle.
   ========================================================= */

.fc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(13, 12, 8, 0.78);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.fc-modal-overlay--visible {
    opacity: 1;
}

.fc-modal-overlay--closing {
    opacity: 0;
}

.fc-modal-panel {
    position: relative;
    width: 100%;
    max-width: 26rem;
    max-height: 90vh;
    overflow: visible;

    background: linear-gradient(
        180deg,
        rgba(17, 16, 11, 0.985) 0%,
        rgba(13, 12, 8, 0.985) 100%
    );
    border: 1px solid var(--fc-border);
    border-radius: 0.5rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.025) inset,
        0 12px 32px rgba(0, 0, 0, 0.45);

    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.fc-modal-body {
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.fc-modal-panel--visible {
    opacity: 1;
    transform: translateY(0);
}

.fc-modal-panel--closing {
    opacity: 0;
    transform: translateY(4px);
}

.fc-modal-corner {
    position: absolute;
    width: 0.9rem;
    height: 0.9rem;
    pointer-events: none;
    border-color: var(--fc-modal-accent, rgba(150, 187, 68, 0.9));
}

.fc-modal-corner--tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; border-top-left-radius: 0.375rem; }
.fc-modal-corner--tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; border-top-right-radius: 0.375rem; }
.fc-modal-corner--bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; border-bottom-left-radius: 0.375rem; }
.fc-modal-corner--br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; border-bottom-right-radius: 0.375rem; }

.fc-modal-kicker {
    font-size: 0.625rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fc-modal-accent, #96bb44);
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.fc-modal-icon {
    color: var(--fc-modal-accent, #96bb44);
}

.fc-modal-panel--info { --fc-modal-accent: #96bb44; }
.fc-modal-panel--prompt { --fc-modal-accent: #96bb44; }
.fc-modal-panel--warning { --fc-modal-accent: #fbbf24; }
.fc-modal-panel--danger { --fc-modal-accent: #fb7185; }

.fc-modal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.fc-modal-header .fc-modal-icon {
    font-size: 1.05rem;
    flex: none;
}

.fc-modal-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ece9da;
    margin: 0;
}

.fc-modal-message {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 500;
    color: #ded9bd;
    white-space: pre-line;
    margin: 0 0 1.15rem;
}

.fc-modal-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: rgba(12, 11, 7, 0.88);
    border: 1px solid rgba(150, 187, 68, 0.20);
    border-radius: 0.375rem;
    padding: 0.55rem 0.75rem;
    color: #ece9da;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    margin-bottom: 1.15rem;
}

.fc-modal-input:focus {
    outline: none;
    border-color: rgba(150, 187, 68, 0.6);
    box-shadow: 0 0 0 1px rgba(150, 187, 68, 0.12);
}

.fc-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.fc-modal-btn {
    border: 1px solid transparent;
    cursor: pointer;
}

.fc-modal-btn--secondary {
    background-color: #262319;
    border-color: rgba(107, 101, 82, 0.5);
    color: #eeecdd;
}

.fc-modal-btn--secondary:hover {
    background-color: #3a3629;
    border-color: rgba(160, 154, 125, 0.6);
}

.fc-modal-btn--info,
.fc-modal-btn--prompt {
    background-color: #496b18;
    color: #0d0c08;
}

.fc-modal-btn--info:hover,
.fc-modal-btn--prompt:hover {
    background-color: #5ea024;
}

.fc-modal-btn--warning {
    background-color: #f59e0b;
    color: #0d0c08;
}

.fc-modal-btn--warning:hover {
    background-color: #fbbf24;
}

.fc-modal-btn--danger {
    background-color: #be123c;
    color: #fff1f2;
}

.fc-modal-btn--danger:hover {
    background-color: #e11d48;
}

/* =========================================================
   ACCENT THEME SYSTEM
   User-selectable "brand" accent color: buttons, active nav,
   focus rings, header chrome, scrollbars, text selection.

   Deliberately does NOT touch #tactical-tree-display or
   #console-output: crew role colors (Pilot/Engineer/Medic/...)
   and squadron identity encode meaning and stay fixed no
   matter which theme is chosen (DEVELOPER_HANDBOOK.md,
   Kapitel 5 "Rollenmodell").

   Technique: tailwind.min.css wraps its generated utilities in
   @layer, so any plain (unlayered) rule here automatically wins
   over a Tailwind utility of the same class name, regardless of
   selector order/specificity - no !important needed except where
   we are also overriding an existing !important rule further up
   in this same file.

   Applied via html[data-fc-theme="..."], set by js/modules/theme.js.
   Default "sky" needs no attribute; it is simply the :root value.
   ========================================================= */

:root {
    --fc-accent: #96bb44;
    --fc-accent-rgb: 150 187 68;
}

html[data-fc-theme="red"]      { --fc-accent: #f87171; --fc-accent-rgb: 248 113 113; }
html[data-fc-theme="orange"]   { --fc-accent: #fb923c; --fc-accent-rgb: 251 146 60; }
html[data-fc-theme="amber"]    { --fc-accent: #fbbf24; --fc-accent-rgb: 251 191 36; }
html[data-fc-theme="lime"]     { --fc-accent: #a3e635; --fc-accent-rgb: 163 230 53; }
html[data-fc-theme="green"]    { --fc-accent: #4ade80; --fc-accent-rgb: 74 222 128; }
html[data-fc-theme="emerald"]  { --fc-accent: #34d399; --fc-accent-rgb: 52 211 153; }
html[data-fc-theme="teal"]     { --fc-accent: #2dd4bf; --fc-accent-rgb: 45 212 191; }
html[data-fc-theme="blue"]     { --fc-accent: #60a5fa; --fc-accent-rgb: 96 165 250; }
html[data-fc-theme="indigo"]   { --fc-accent: #818cf8; --fc-accent-rgb: 129 140 248; }
html[data-fc-theme="violet"]   { --fc-accent: #a78bfa; --fc-accent-rgb: 167 139 250; }
html[data-fc-theme="purple"]   { --fc-accent: #c084fc; --fc-accent-rgb: 192 132 252; }
html[data-fc-theme="pink"]     { --fc-accent: #f472b6; --fc-accent-rgb: 244 114 182; }
html[data-fc-theme="rose"]     { --fc-accent: #fb7185; --fc-accent-rgb: 251 113 133; }
html[data-fc-theme="silver"]   { --fc-accent: #e2e8f0; --fc-accent-rgb: 226 232 240; }
html[data-fc-theme="graphite"] { --fc-accent: #94a3b8; --fc-accent-rgb: 148 163 184; }

/* Derived shades so buttons keep a base/hover contrast instead of one flat tone */
:root {
    --fc-accent-dark: color-mix(in srgb, var(--fc-accent) 78%, black);
    --fc-accent-darker: color-mix(in srgb, var(--fc-accent) 62%, black);
    --fc-accent-darkest: color-mix(in srgb, var(--fc-accent) 35%, black);
    --fc-accent-light: color-mix(in srgb, var(--fc-accent) 78%, white);
    --fc-accent-lighter: color-mix(in srgb, var(--fc-accent) 55%, white);
}

/* --- Buttons --- */
.bg-sky-600 { background-color: var(--fc-accent-dark); }
.hover\:bg-sky-500:hover { background-color: var(--fc-accent); }
.bg-sky-700 { background-color: var(--fc-accent-darker); }
.hover\:bg-sky-600:hover { background-color: var(--fc-accent-dark); }
.bg-sky-950 { background-color: var(--fc-accent-darkest); }
.hover\:bg-sky-900:hover { background-color: color-mix(in srgb, var(--fc-accent) 45%, black); }

/* --- Text / icon accents --- */
.text-sky-400 { color: var(--fc-accent); }
.text-sky-300 { color: var(--fc-accent-light); }

/* --- Borders (opacity variants used across the app) ---
   /10 stays neutral (matches .glass-panel's fixed --fc-border) instead
   of following the theme: at that thinness/opacity a themed tint just
   reads as a stray colored line rather than a deliberate accent, and
   it should look like the same quiet frame as the surrounding panels. */
.border-sky-500\/10 { border-color: var(--fc-border); }
.border-sky-500\/20 { border-color: rgb(var(--fc-accent-rgb) / 0.20); }
.border-sky-500\/30 { border-color: rgb(var(--fc-accent-rgb) / 0.30); }
.border-sky-500\/40 { border-color: rgb(var(--fc-accent-rgb) / 0.40); }
.hover\:border-sky-400:hover { border-color: var(--fc-accent); }
.focus\:border-sky-400:focus { border-color: var(--fc-accent); }
.focus\:border-sky-300:focus { border-color: var(--fc-accent-light); }

/* --- Background tints --- */
.bg-sky-500\/10 { background-color: rgb(var(--fc-accent-rgb) / 0.10); }
.bg-sky-950\/30 { background-color: rgb(var(--fc-accent-rgb) / 0.12); }
.bg-sky-950\/40 { background-color: rgb(var(--fc-accent-rgb) / 0.10); }
.hover\:bg-sky-500\/10:hover { background-color: rgb(var(--fc-accent-rgb) / 0.10); }
.hover\:bg-sky-500\/20:hover { background-color: rgb(var(--fc-accent-rgb) / 0.20); }

/* --- Active navigation (desktop sidebar + mobile bottom nav) ---
   These specific selectors already carry !important further up in
   this file (v0.9.4/v0.9.5 contrast passes), so the override needs
   matching specificity + !important to win. */
.nav-btn.bg-sky-500\/10 .nav-text,
.nav-btn.text-sky-300 .nav-text {
    color: var(--fc-accent-light) !important;
}

#main-sidebar .nav-btn.text-sky-300 .nav-text {
    color: var(--fc-accent-light) !important;
}

.mobile-bottom-nav-btn.is-active {
    border-color: rgb(var(--fc-accent-rgb) / 0.22);
    background: rgb(var(--fc-accent-rgb) / 0.12);
    color: var(--fc-accent-light);
}

/* --- Remaining sky-* utilities not covered above, added so the
   accent picker reaches every last tinted element instead of just
   the most common ones. --- */
.text-sky-200 { color: var(--fc-accent-lighter); }
.text-sky-500 { color: var(--fc-accent); }
.text-sky-500\/40 { color: rgb(var(--fc-accent-rgb) / 0.40); }
.text-sky-500\/60 { color: rgb(var(--fc-accent-rgb) / 0.60); }
.hover\:text-sky-300:hover { color: var(--fc-accent-light); }
.hover\:text-sky-400:hover { color: var(--fc-accent); }
.border-sky-500\/5 { border-color: rgb(var(--fc-accent-rgb) / 0.05); }
.border-sky-500\/25 { border-color: rgb(var(--fc-accent-rgb) / 0.25); }
.hover\:bg-sky-500\/5:hover { background-color: rgb(var(--fc-accent-rgb) / 0.05); }
.placeholder-sky-900\/60::placeholder { color: rgb(var(--fc-accent-rgb) / 0.45); }
.selection\:bg-sky-500::selection,
.selection\:bg-sky-500 ::selection {
    background-color: var(--fc-accent);
}

/* --- Global focus rings / input focus (outside the Fleet Tree) --- */
input:focus,
select:focus {
    border-color: rgb(var(--fc-accent-rgb) / 0.5) !important;
    box-shadow: 0 0 0 1px rgb(var(--fc-accent-rgb) / 0.08);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 1px solid rgb(var(--fc-accent-rgb) / 0.7);
    outline-offset: 2px;
}

/* --- Scrollbars and text selection (main app only, not the tree/console) --- */
* {
    scrollbar-color: rgb(var(--fc-accent-rgb) / 0.30) transparent;
}

::-webkit-scrollbar-thumb {
    background-color: rgb(var(--fc-accent-rgb) / 0.24);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgb(var(--fc-accent-rgb) / 0.48);
}

::-webkit-scrollbar-thumb:active {
    background-color: rgb(var(--fc-accent-rgb) / 0.72);
}

::selection {
    background: rgb(var(--fc-accent-rgb) / 0.85);
    color: #0d0c08;
}

/* --- App switch slider (Fleet-Commander <-> Squad-Commander) ---
   Layout: [Fleet logo] (track) [Squad logo] - identical in both apps.
   The logos sit OUTSIDE the track so they can be large enough to
   actually recognise. The app you are on (.is-fleet / .is-squad) gets
   full colour plus an accent glow; the other logo is dimmed and lights
   up on hover as the target. The thumb slides across on click
   (.is-navigating, set by js/modules/app-switch.js). */
.app-switch-slider {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.375rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.app-switch-slider:hover,
.app-switch-slider:focus-visible {
    border-color: rgb(var(--fc-accent-rgb) / 0.30);
    background: rgb(var(--fc-accent-rgb) / 0.06);
}

.app-switch-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgb(var(--fc-accent-rgb) / 0.15);
    background: rgba(24, 23, 17, 0.9);
    opacity: 0.45;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-switch-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    filter: grayscale(0.85);
    transition: filter 0.2s ease;
}

/* Active app: full colour + rounded accent glow (box-shadow follows the
   border-radius, unlike drop-shadow which would trace the square PNG) */
.app-switch-slider.is-fleet .app-switch-logo-fleet,
.app-switch-slider.is-squad .app-switch-logo-squad {
    opacity: 1;
    border-color: rgb(var(--fc-accent-rgb) / 0.55);
    box-shadow: 0 0 8px rgb(var(--fc-accent-rgb) / 0.45);
}

.app-switch-slider.is-fleet .app-switch-logo-fleet img,
.app-switch-slider.is-squad .app-switch-logo-squad img {
    filter: none;
}

/* Hover: the target app lights up */
.app-switch-slider.is-fleet:hover .app-switch-logo-squad,
.app-switch-slider.is-fleet:focus-visible .app-switch-logo-squad,
.app-switch-slider.is-squad:hover .app-switch-logo-fleet,
.app-switch-slider.is-squad:focus-visible .app-switch-logo-fleet {
    opacity: 0.9;
    border-color: rgb(var(--fc-accent-rgb) / 0.35);
    transform: scale(1.06);
}

.app-switch-slider.is-fleet:hover .app-switch-logo-squad img,
.app-switch-slider.is-fleet:focus-visible .app-switch-logo-squad img,
.app-switch-slider.is-squad:hover .app-switch-logo-fleet img,
.app-switch-slider.is-squad:focus-visible .app-switch-logo-fleet img {
    filter: none;
}

.app-switch-track {
    position: relative;
    display: block;
    width: 2.75rem;
    height: 1.375rem;
    flex: 0 0 2.75rem;
    border-radius: 999px;
    border: 1px solid rgb(var(--fc-accent-rgb) / 0.30);
    background: rgba(24, 23, 17, 0.85);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.app-switch-slider:hover .app-switch-track {
    border-color: rgb(var(--fc-accent-rgb) / 0.55);
    background: rgb(var(--fc-accent-rgb) / 0.12);
}

.app-switch-thumb {
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 999px;
    background: var(--fc-accent);
    box-shadow: 0 0 8px rgb(var(--fc-accent-rgb) / 0.6);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.app-switch-slider.is-squad .app-switch-thumb {
    transform: translateX(1.375rem);
}

/* Slide the thumb (and the highlight) to the other side right before
   navigating away, for a brief tactile "flip" instead of a hard jump. */
.app-switch-slider.is-fleet.is-navigating .app-switch-thumb {
    transform: translateX(1.375rem);
}

.app-switch-slider.is-squad.is-navigating .app-switch-thumb {
    transform: translateX(0);
}

.app-switch-slider.is-fleet.is-navigating .app-switch-logo-fleet,
.app-switch-slider.is-squad.is-navigating .app-switch-logo-squad {
    opacity: 0.45;
    border-color: rgb(var(--fc-accent-rgb) / 0.15);
    box-shadow: none;
}

.app-switch-slider.is-fleet.is-navigating .app-switch-logo-fleet img,
.app-switch-slider.is-squad.is-navigating .app-switch-logo-squad img {
    filter: grayscale(0.85);
}

.app-switch-slider.is-fleet.is-navigating .app-switch-logo-squad,
.app-switch-slider.is-squad.is-navigating .app-switch-logo-fleet {
    opacity: 1;
    border-color: rgb(var(--fc-accent-rgb) / 0.55);
    box-shadow: 0 0 8px rgb(var(--fc-accent-rgb) / 0.45);
}

.app-switch-slider.is-fleet.is-navigating .app-switch-logo-squad img,
.app-switch-slider.is-squad.is-navigating .app-switch-logo-fleet img {
    filter: none;
}

/* Smaller phones: keep the header from wrapping too early */
@media (max-width: 640px) {
    .app-switch-slider {
        gap: 0.375rem;
        padding: 0.125rem 0.25rem;
    }

    .app-switch-logo {
        width: 1.75rem;
        height: 1.75rem;
        flex-basis: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-switch-slider,
    .app-switch-logo,
    .app-switch-logo img,
    .app-switch-track,
    .app-switch-thumb {
        transition: none;
    }
}

/* --- Theme picker widget --- */
#theme-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.25rem;
    border: 1px solid rgb(var(--fc-accent-rgb) / 0.20);
    background: rgba(24, 23, 17, 0.8);
    color: var(--fc-accent);
    font-size: 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

#theme-picker-btn:hover {
    background: rgb(var(--fc-accent-rgb) / 0.12);
}

#theme-picker-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 60;
    width: 12.5rem;
    padding: 0.65rem;
    background: linear-gradient(180deg, rgba(17, 16, 11, 0.985) 0%, rgba(13, 12, 8, 0.985) 100%);
    border: 1px solid var(--fc-border);
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.theme-swatch-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.theme-swatch {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease;
}

.theme-swatch:hover {
    transform: scale(1.1);
}

.theme-swatch--active {
    border-color: #f6f4e8;
    box-shadow: 0 0 0 2px rgba(13, 12, 8, 0.9), 0 0 0 3px rgba(255, 255, 255, 0.45);
}

/* --- Tie the modal system's info/prompt tone into the theme too --- */
.fc-modal-panel--info,
.fc-modal-panel--prompt {
    --fc-modal-accent: var(--fc-accent);
}

.fc-modal-btn--info,
.fc-modal-btn--prompt {
    background-color: var(--fc-accent-dark);
}

.fc-modal-btn--info:hover,
.fc-modal-btn--prompt:hover {
    background-color: var(--fc-accent);
}

@media (max-width: 480px) {
    .fc-modal-actions {
        flex-direction: column-reverse;
    }

    .fc-modal-actions .fc-action-btn {
        width: 100%;
    }
}

/* =========================================================
   v0.10.69 – Fehlende Tailwind-Utilities ergänzt
   Diese Klassen stehen im Markup, fehlen aber im Prebuilt
   vendor/tailwind/tailwind.min.css. Ohne sie greift der
   Tailwind-Preflight-Standardrahmen (#e5e7eb) und die Rahmen
   erscheinen weiß. Farben entsprechen den Tailwind-Originalen,
   damit jeder Rahmen zur Farbe seines Bereichs passt.
   ========================================================= */
.border-amber-500\/25 { border-color: rgba(245, 158, 11, 0.25); }
.border-emerald-500\/25 { border-color: rgba(16, 185, 129, 0.25); }
.border-rose-500\/30 { border-color: rgba(244, 63, 94, 0.30); }
.bg-emerald-800 { background-color: #065f46; }
.hover\:bg-emerald-700:hover { background-color: #047857; }
.hover\:bg-rose-500\/10:hover { background-color: rgba(244, 63, 94, 0.10); }
.text-emerald-100 { color: #d1fae5; }

/* Operationsarchiv-Einträge und „Laden“-Button (js/modules/operation-archive.js):
   Klassen fehlten ebenfalls im Prebuilt – Button war transparent. */
.bg-sky-800 { background-color: color-mix(in srgb, var(--fc-accent) 50%, black); }
.hover\:bg-sky-700:hover { background-color: var(--fc-accent-darker); }
.text-sky-100 { color: color-mix(in srgb, var(--fc-accent) 25%, white); }
.bg-slate-950\/65 { background-color: rgba(17, 17, 13, 0.65); }

/* =========================================================
   v0.10.75 – Kopfzeile auf Smartphones und im Querformat
   Hochformat (bis 639 px): zwei kompakte Zeilen
     Zeile 1: Menü · Titel · App-Wechsel
     Zeile 2: User-ID + Status · Sprache · Farbwahl
   Das Produktlogo entfällt dort, weil der App-Wechsel-Schieber
   die Logos bereits zeigt. Querformat/Tablet (640–1023 px):
   Uhr und Produktlogo ausgeblendet, damit Titel, User-ID und
   Status nicht mehr abgeschnitten werden.
   ========================================================= */
@media (max-width: 639px) {
    #top-header {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0.5rem 0.625rem;
        padding-bottom: 0.625rem;
    }

    #mobile-tablet-nav + div {
        display: none;
    }

    #top-header-copy h1 {
        grid-column: 2 / 4;
        grid-row: 1;
        font-size: clamp(0.72rem, 3.4vw, 0.95rem);
        letter-spacing: 0.08em;
    }

    #top-header-controls {
        display: contents;
    }

    #app-switch-btn {
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
    }

    #top-header-controls > label {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        align-self: center;
    }

    #theme-picker {
        grid-column: 4;
        grid-row: 2;
        align-self: center;
        justify-self: end;
    }

    #top-header-meta {
        grid-column: 1 / 3;
        grid-row: 2;
        min-width: 0;
        overflow: hidden;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.25rem 0.75rem;
        padding-top: 0;
        white-space: nowrap;
    }

    .top-header-user,
    .top-header-status {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        flex: 0 1 auto;
        min-width: 0;
    }

    #display-deck-id {
        max-width: min(40vw, 11rem);
    }

    #top-header-controls > label {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }

    #top-header-controls > label > i {
        display: none;
    }
}


@media (min-width: 640px) and (max-width: 1023px) {
    #mobile-tablet-nav + div {
        display: none;
    }

    #top-header-controls > div:has(#live-clock) {
        display: none !important;
    }

    #top-header-copy h1 {
        font-size: clamp(0.9rem, 1.6vw, 1.1rem);
        letter-spacing: 0.1em;
    }

    #top-header-meta {
        max-width: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.15rem 0.5rem;
        white-space: nowrap;
    }

    #top-header-meta .top-header-divider {
        display: none;
    }
}
