/*
 * hans.agentmarketindex.com — Gestaltung.
 *
 * Dieselbe Haltung wie die Hauptseite: Papier und Tinte, Haarlinien, ein einziges Grün,
 * Zahlen in Monospace. Kein Schatten, keine Karte mit Radius, keine Animation — eine
 * Bilanz soll ruhig aussehen, nicht lebendig. Die Typo trägt die Hierarchie, nicht die Farbe.
 */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/fonts/inter-latin-var.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/plex-latin-400.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/plex-latin-500.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --paper: #ffffff;
    --paper-2: #fafbf9;
    --soft: #f6f8f5;
    --ink: #17221e;
    --ink-2: #3c4a43;
    --muted: #67716a;
    --line: #dce2dc;
    --line-soft: #edf0eb;
    --accent: #176343;
    --accent-soft: #e8f1ea;
    --loss: #9c4630;
    --loss-soft: #f8ece7;

    --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

a:hover {
    border-bottom-color: var(--accent);
}

.wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Kopf: Wortmarke links, Rubrik rechts. Eine Zeile, mehr braucht die Seite nicht. */
.masthead {
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.masthead-inner {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    font-family: var(--mono);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: -0.01em;
    color: var(--ink);
    border-bottom: 0;
}

.brand span {
    color: var(--muted);
}

.crawl {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Intro */
.intro {
    padding: 56px 0 34px;
    border-bottom: 1px solid var(--line);
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 5vw, 3rem);
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.lede {
    margin: 14px 0 0;
    max-width: 62ch;
    color: var(--ink-2);
    font-size: 15.5px;
}

.status {
    margin: 20px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line);
    flex: none;
}

.dot.live {
    background: var(--accent);
}

/* Kennzahlen: vier Spalten mit Haarlinien, keine Karten. */
.kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-bottom: 1px solid var(--line);
}

.kpi {
    padding: 22px 20px 20px;
    border-left: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.kpi:first-child {
    border-left: 0;
    padding-left: 0;
}

.kpi-label {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.kpi-value {
    font-family: var(--mono);
    font-weight: 500;
    font-size: clamp(1.35rem, 2.6vw, 1.75rem);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.kpi-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.kpi-sub b {
    font-weight: 500;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.neg {
    color: var(--loss);
}

/* Abschnitte */
.panel {
    margin-top: 44px;
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.panel-head h2 {
    margin: 0;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--ink);
}

.panel-note {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.legend {
    display: flex;
    gap: 14px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--muted);
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sw {
    width: 8px;
    height: 8px;
    display: inline-block;
}

.sw.rev {
    background: var(--accent);
}

.sw.cost {
    background: #c08a76;
}

/* Chart: DOM-Säulen. Die Achsenschrift bleibt dadurch in echten Pixeln, auch auf 380 px. */
.chartwrap {
    display: flex;
    gap: 10px;
    margin: 22px 0 0;
}

.yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 190px;
    flex: none;
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1;
    color: var(--muted);
    text-align: right;
    transform: translateY(-4px);
}

.yaxis span:last-child {
    transform: translateY(4px);
}

.plot {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 190px;
    border-bottom: 1px solid var(--line);
}

.gridlines i {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--line-soft);
}

.gridlines i:nth-child(1) {
    top: 0;
}

.gridlines i:nth-child(2) {
    top: 50%;
}

.bars {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: end;
}

.bar-day {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    height: 100%;
}

.bar {
    display: block;
    width: 46%;
    min-width: 2px;
    max-width: 11px;
}

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

.bar.cost {
    background: #c08a76;
}

.bar-day:hover .bar {
    opacity: 0.75;
}

.xaxis {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-top: 6px;
    padding-left: 52px;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted);
}

.xaxis-mid b {
    font-weight: 500;
    color: var(--ink-2);
}

/* Tabellen */
.grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.grid th {
    padding: 9px 10px;
    text-align: left;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.grid td {
    padding: 10px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: baseline;
}

.grid tbody tr:hover {
    background: var(--soft);
}

.grid .num {
    text-align: right;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
}

.grid .muted {
    color: var(--muted);
}

.stream {
    font-weight: 500;
    color: var(--ink);
}

.ledger .when {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--ink-2);
    white-space: nowrap;
}

.ledger .when .t {
    color: var(--muted);
    margin-left: 6px;
}

.ledger .note {
    color: var(--ink-2);
    max-width: 46ch;
}

.tag {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 6px;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid transparent;
    vertical-align: 1px;
}

.tag.in {
    color: var(--accent);
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 18%, transparent);
}

.tag.out {
    color: var(--loss);
    background: var(--loss-soft);
    border-color: color-mix(in srgb, var(--loss) 16%, transparent);
}

.empty {
    margin: 18px 0 4px;
    color: var(--muted);
    font-size: 14px;
}

/* Fuß */
.foot {
    margin: 60px 0 72px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    max-width: 76ch;
}

.foot p {
    margin: 0 0 8px;
}

.foot-meta {
    font-family: var(--mono);
    font-size: 11px;
}

@media (max-width: 780px) {
    .intro {
        padding-top: 40px;
    }

    .kpis {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi {
        padding: 18px 0;
        border-left: 0;
        border-top: 1px solid var(--line-soft);
    }

    .kpi:nth-child(odd) {
        padding-right: 16px;
        border-right: 1px solid var(--line-soft);
    }

    .kpi:nth-child(even) {
        padding-left: 16px;
    }

    .kpi:nth-child(-n + 2) {
        border-top: 0;
    }

    .panel {
        margin-top: 34px;
    }

    .yaxis,
    .plot {
        height: 150px;
    }

    /* Schmale Geräte: Neben-Spalten fallen weg, statt die Tabelle seitlich abzuschneiden.
       Was bleibt, ist die Aussage (Stream, Betrag, Profit) — nicht die Belegdichte. */
    .grid {
        font-size: 12.5px;
    }

    .grid th,
    .grid td {
        padding: 9px 6px;
    }

    .grid .col-opt {
        display: none;
    }

    .xaxis {
        padding-left: 46px;
    }

    .ledger .when .t {
        display: none;
    }
}
