:root {
    --navy: #07346f;
    --blue: #0b5ea8;
    --blue2: #2a80c9;
    --pale: #eaf3fb;
    --line: #c8d8e8;
    --ink: #132438;
    --muted: #5d6f82;
    --green: #1a8b35;
    --red: #c51f1f;
    --amber: #b36a00;
    --surface: #fff;
    --bg: #f5f8fb;

    font-family: Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
}

a, a:visited {color: #fff;}
a:hover {color: #52e1e3;}

footer a, a:visited {color: #666;}

button,
input {
    font: inherit;
}

.app {
    min-width: 1180px;
}


/* =========================================================
   HEADER
   ========================================================= */

.topbar {
    display: flex;
    align-items: stretch;

    background: linear-gradient(
        90deg,
        #0a3a79,
        #062b61
    );

    color: #fff;
    border-bottom: 1px solid #2c5788;
}

.brand {
    max-width: 750px;
    padding: 13px 20px 10px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    
}

.brand strong {
    font-size: 20px;
    letter-spacing: 0.015em;
}

.brand strong small {
    font-size: 15px;
    font-weight: 500;
}

.brand span {
    margin-top: 4px;

    font-size: 15px;
    opacity: 1;
}


/* =========================================================
   NAVIGATION / TABS
   ========================================================= */

.tabs {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.tab {
    padding: 0 18px;

    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.13);

    background: transparent;
    color: #fff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
    white-space: nowrap;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tab.active {
    background: #0e69b7;
}

.tab-panel {
    display: none;
    padding: 10px;
}

.active-panel {
    display: block;
}


/* =========================================================
   WINDKANAL – HAUPTLAYOUT
   ========================================================= */

.tunnel-layout {
    display: grid;

    grid-template-columns:
        168px
        minmax(780px, 1fr)
        225px;

    gap: 10px;
}

.side-card,
.tunnel-card,
.control-panel,
.info-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
}


/* =========================================================
   SEITENKARTEN
   ========================================================= */

.side-card {
    padding: 14px;
}

.side-card h3,
.control-panel h3 {
    margin: 0 0 14px;

    color: var(--navy);
    font-size: 14px;
}

.side-card h3 small,
.control-panel h3 small {
    font-size: 11px;
    font-weight: 500;
}

.airflow-card label {
    font-size: 12px;
}

.big-value {
    margin: 6px 0 5px;

    color: var(--navy);

    font-size: 22px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.speed-kmh {
    margin: -2px 0 5px;

    color: var(--blue);

    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.airflow-card input {
    width: 100%;
    accent-color: var(--blue);
}

.scale {
    display: flex;
    justify-content: space-between;

    color: var(--muted);
    font-size: 10px;
}

.wind-arrow {
    margin: 10px 0 8px;

    color: var(--blue);

    font-size: 64px;
    line-height: 1;
}


/* =========================================================
   KOMPAKTE DATENLISTEN
   ========================================================= */

.compact-dl {
    margin: 0;
}

.compact-dl dt {
    margin-top: 11px;
    font-size: 12px;
}

.compact-dl dd {
    margin: 2px 0 0;

    font-size: 12px;
    font-variant-numeric: tabular-nums;
}


/* =========================================================
   WINDKANAL
   ========================================================= */

.tunnel-card {
    overflow: hidden;
}

.tunnel-status-row {
    height: 42px;
    padding: 0 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #dbe6f0;
}

.flow-badge {
    padding: 5px 10px;

    border: 1px solid #bee1c5;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 700;
}

.flow-badge.ok {
    color: var(--green);
    background: #f7fff8;
}

.flow-badge.warn {
    color: var(--amber);
    background: #fffaf0;
    border-color: #ebd5ad;
}

.flow-badge.danger {
    color: var(--red);
    background: #fff4f4;
    border-color: #efc2c2;
}

.micro-note {
    color: #79899a;
    font-size: 11px;
}


/* =========================================================
   CANVAS
   ========================================================= */

.canvas-wrap {
    height: 390px;
    background: #fbfdff;
}

.canvas-wrap canvas {
    display: block;

    width: 100%;
    height: 100%;
}

.force-card canvas {
    display: block;

    width: 100%;
    height: auto;
}


/* =========================================================
   MESSWERTE
   ========================================================= */

.metrics {
    margin: 10px 172px 0;

    display: grid;
    grid-template-columns: repeat(
        12,
        minmax(92px, 1fr)
    );

    background: #fff;

    border: 1px solid var(--line);
    border-radius: 6px;

    overflow: hidden;
}

.metrics > div {
    padding: 10px 7px;

    text-align: center;
    border-right: 1px solid var(--line);
}

.metrics > div:last-child {
    border-right: 0;
}

.metrics span {
    display: block;

    min-height: 27px;

    color: var(--navy);
    font-size: 11px;
}

.metrics strong {
    display: block;

    margin-top: 3px;

    color: var(--navy);

    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.metrics .negative {
    color: var(--red);
}


/* =========================================================
   BEDIENFELDER
   ========================================================= */

.control-panels {
    display: grid;

    grid-template-columns:
        1.08fr
        0.9fr
        1.05fr
        1.08fr
        1.12fr;

    gap: 10px;
    margin-top: 10px;
}

.control-panel {
    min-height: 315px;
    padding: 14px 14px 12px;
}

.control {
    display: block;
    margin-bottom: 17px;
}

.control > span {
    display: flex;
    justify-content: space-between;
    align-items: baseline;

    gap: 8px;

    font-size: 12px;
}

.control output {
    min-width: 66px;
    padding: 4px 7px;

    background: #fafcff;
    color: #111;

    border: 1px solid var(--line);
    border-radius: 4px;

    text-align: center;

    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.control input[type="range"] {
    width: 100%;
    margin-top: 8px;

    accent-color: var(--blue);
}

.control small {
    display: flex;
    justify-content: space-between;

    color: #3d4b58;

    font-size: 10px;
    font-weight: 400;
}

.control small b {
    font-weight: 400;
}


/* =========================================================
   STATUS- UND HINWEISBOXEN
   ========================================================= */

.state-box,
.hint-box {
    padding: 10px;

    background: #f8fbff;
    color: #0b4383;

    border: 1px solid #d6e2ef;
    border-radius: 5px;

    font-size: 11px;
    line-height: 1.65;
}

.state-box > b {
    display: block;

    margin-bottom: 6px;

    color: var(--navy);
}

.state-box dl {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 3px 10px;
    margin: 0;
}

.state-box dt {
    color: #263749;
}

.state-box dd {
    margin: 0;

    color: var(--green);
    font-weight: 700;
}

.large-indicator {
    margin-top: 20px;
    font-size: 12px;
}

.large-indicator strong {
    display: block;

    margin-top: 8px;

    color: var(--green);

    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.hint-box {
    margin-top: 17px;
}


/* =========================================================
   BERECHNUNGSZEILE
   ========================================================= */

.calc-row {
    display: flex;
    justify-content: space-between;

    gap: 10px;

    margin: -4px 0 16px;
    padding: 7px 8px;

    background: #fbfdff;

    border: 1px solid #e0e8f0;

    font-size: 11px;
}


/* =========================================================
   PROFILAUSWAHL
   ========================================================= */

.profile-options {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.profile-choice {
    display: grid;

    grid-template-columns:
        18px
        76px
        1fr;

    gap: 7px;

    align-items: center;
    cursor: pointer;
}

.profile-choice input {
    accent-color: var(--blue);
}

.profile-choice canvas {
    width: 76px;
    height: 30px;
}

.profile-choice .name {
    color: var(--navy);

    font-size: 12px;
    font-weight: 700;
}

.profile-choice .meta {
    margin-top: 2px;

    color: #333;
    font-size: 10px;
}

.profile-data {
    display: grid;
    grid-template-columns: 1fr auto;

    gap: 7px 12px;

    margin-top: 14px;

    font-size: 11px;
}

.profile-data strong {
    color: var(--green);
}


/* =========================================================
   STATUSLEISTE
   ========================================================= */

.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-top: 10px;
    padding: 7px 10px;

    background: #fff;
    color: #5d6f82;

    border: 1px solid var(--line);
    border-radius: 6px;

    font-size: 11px;
}

.statusbar strong {
    color: var(--green);

    font-size: 12px;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.flat-btn {
    padding: 7px 10px;

    background: #f8fbff;
    color: var(--navy);

    border: 1px solid var(--line);
    border-radius: 4px;

    cursor: pointer;
}


/* =========================================================
   INFO-BEREICHE
   ========================================================= */

.info-panel {
    margin: 10px;
    padding: 24px;

    line-height: 1.6;
}

.info-panel h2 {
    margin-top: 0;
    color: var(--navy);
}


/* =========================================================
   HEADER-LOGO
   ========================================================= */

.header-logo {
    width: 120px;
    min-width: 120px;
    padding: 6px 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: none;
}

.header-logo img {
    display: block;

    width: 100px;
    height: 100px;

    object-fit: contain;
}


/* =========================================================
   RESPONSIVE – MITTLERE DESKTOPBREITE
   ========================================================= */

@media (max-width: 1300px) {

    .app {
        min-width: 1050px;
    }

    .brand {
        width: 600px;
    }

    .tab {
        padding: 0 11px;
        font-size: 12px;
    }

    .tunnel-layout {
        grid-template-columns:
            155px
            minmax(700px, 1fr)
            200px;
    }

    .metrics {
        margin-left: 165px;
        margin-right: 210px;

        grid-template-columns: repeat(6, 1fr);
    }

    .metrics > div:nth-child(6) {
        border-right: 0;
    }

    .control-panels {
        grid-template-columns: repeat(3, 1fr);
    }

    .control-panel {
        min-height: auto;
    }
}


/* =========================================================
   KLEINE BILDSCHIRME
   ========================================================= */

@media (max-width: 800px) {

    body {
        overflow-x: auto;
    }
}