/* FeuerON Dienstgradrechner – shared styles, visually aligned with hydrantenwart.de */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("fonts/barlow-condensed-800.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
    color-scheme: light;
    --bg: #f6f4ef;
    --fg: #1b1d1f;
    --muted: #55524c;
    --card: #ffffff;
    --line: #e4e1da;
    --soft: #ece9e2;
    --accent: #b32020;
    --brand: #b32020;
    --brand-hover: #8a1818;
    --on-brand: #ffffff;
    --success: #1f7a4d;
    --success-soft: #e3f1e9;
    --warning: #a85a06;
    --warning-soft: #fbefd6;
    --danger-soft: #f8e4e1;
    --shadow: 0 20px 40px -24px rgba(27, 29, 31, 0.25);
    --group-1: #6b6862;
    --group-2: #a85a06;
    --group-3: #b32020;
    --group-4: #1b1d1f;

    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --radius: 12px;
    --radius-sm: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #141517;
        --fg: #f2f0eb;
        --muted: #a9a59e;
        --card: #1e2023;
        --line: #2e3135;
        --soft: #25282c;
        --accent: #ff6b5e;
        --success: #6fcf97;
        --success-soft: rgba(111, 207, 151, 0.12);
        --warning: #f0b04a;
        --warning-soft: rgba(240, 176, 74, 0.12);
        --danger-soft: rgba(255, 107, 94, 0.12);
        --shadow: 0 20px 40px -24px rgba(0, 0, 0, 0.6);
        --group-1: #a9a59e;
        --group-2: #f0b04a;
        --group-3: #ff6b5e;
        --group-4: #f2f0eb;
    }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100svh;
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:hover { color: var(--accent); }
strong { font-weight: 700; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding-left: 1.2rem; }
abbr[title] { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-inline: 24px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.kicker {
    display: block;
    font: 500 0.8rem/1.4 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

/* Top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.topbar .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font: 700 1.35rem/1 var(--font-body);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.brand:hover { color: inherit; }
.brand-name span { color: var(--accent); }
.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--brand);
    color: var(--on-brand);
}
.nav { display: flex; align-items: center; gap: 0.4rem 1.4rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a { text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.nav a[aria-current="page"] { color: var(--accent); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.3rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: 700 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); color: var(--on-brand); }
.btn-outline { background: var(--card); border-color: var(--line); color: var(--fg); font-weight: 600; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.92rem; border-radius: var(--radius-sm); }

/* Hero */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(1.5rem, 4vw, 2.5rem); }
.hero h1 {
    font-size: clamp(2.6rem, 7vw, 4.6rem);
    font-weight: 800;
    line-height: 0.98;
    max-width: 18ch;
}
.hero .lead {
    margin: 1.2rem 0 0;
    max-width: 62ch;
    font-size: 1.15rem;
    color: var(--muted);
    text-wrap: pretty;
}
.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.2rem;
    margin-top: 1.4rem;
    font: 500 0.8rem/1.4 var(--font-mono);
    letter-spacing: 0.04em;
}
.source-links a { color: var(--muted); text-underline-offset: 3px; }
.source-links a:hover { color: var(--accent); }
.hero-teaser {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem 1.4rem;
    margin-top: 1.8rem;
}
.hero-teaser p { margin: 0; max-width: 46ch; color: var(--muted); font-size: 0.98rem; }
.btn-lg { padding: 1rem 1.7rem; font-size: 1.15rem; box-shadow: var(--shadow); }
.btn-lg svg { transition: transform 0.15s ease; }
.btn-lg:hover svg { transform: translateX(3px); }

/* Sections & cards */
.section { margin-top: 3rem; }
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.8rem 1.5rem;
    margin-bottom: 1.2rem;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.1rem, 3vw, 1.8rem);
}
.card + .card { margin-top: 1.2rem; }
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    margin-bottom: 1rem;
}
.card-head h2, .card-head h3 { font-size: 1.6rem; }

/* Forms */
.form-card { box-shadow: var(--shadow); }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem 1.5rem;
}
.form-grid .span-all { grid-column: 1 / -1; }
.field label, .field-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.field .hint { margin: 0.5rem 0 0; font-size: 0.92rem; color: var(--muted); }
input[type="file"],
input[type="date"],
select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--fg);
    font: 500 1rem/1.3 var(--font-body);
}
select:hover, input[type="date"]:hover, input[type="file"]:hover { border-color: var(--muted); }
input[type="file"] { padding: 0.55rem; cursor: pointer; }
input[type="file"]::file-selector-button {
    margin-right: 0.9rem;
    padding: 0.5rem 0.9rem;
    border: 0;
    border-radius: 6px;
    background: var(--fg);
    color: var(--bg);
    font: 600 0.92rem var(--font-body);
    cursor: pointer;
}
input[type="checkbox"] { accent-color: var(--brand); width: 1rem; height: 1rem; }
.check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
}
.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.6rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--line);
}

.org-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.8rem;
}
.org-type-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    background: var(--bg);
}
.org-type-card strong { display: block; line-height: 1.3; }
.org-type-card select { margin: 0.6rem 0 0.5rem; background: var(--card); }
.org-type-card .check { font-weight: 500; color: var(--muted); font-size: 0.9rem; }

/* Disclosures */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.disclosure {
    margin-top: 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
}
.disclosure > summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    font-weight: 600;
    font-size: 0.95rem;
}
.disclosure > summary::before,
.rank-item > summary::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.disclosure[open] > summary::before,
.rank-item[open] > summary::before { transform: rotate(45deg); }
.disclosure-body { padding: 0 0.9rem 0.9rem; color: var(--muted); font-size: 0.95rem; }
.disclosure-body ol { margin: 0.6rem 0 0.8rem; }
.disclosure-body img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0.8rem 0 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
}

/* Notices */
.notice {
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    border: 1px solid transparent;
    margin-top: 1.2rem;
}
.notice strong { display: block; margin-bottom: 0.3rem; }
.notice ul { margin: 0.4rem 0; }
.notice-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.notice-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* Stats */
.stats {
    display: grid;
    grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.2rem;
    min-height: 140px;
    padding: 1.2rem 1.3rem;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
}
.stat-value { font: 800 clamp(2.6rem, 5vw, 3.6rem)/1 var(--font-display); }
.stat-label { font-weight: 700; line-height: 1.3; }
.stat-lead { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.export-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 12px;
}
.export-bar .kicker { margin: 0 0.6rem 0 0; color: var(--muted); }
.export-bar form { margin: 0; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font: 500 0.78rem/1.4 var(--font-mono);
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-muted { background: var(--soft); color: var(--muted); }
.badge-outline { border: 1px solid var(--line); color: var(--muted); }
.badge-accent { border: 1px solid currentColor; color: var(--accent); }

/* Tables */
.table-scroll { overflow-x: auto; }
.data-table, .count-table, .function-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .count-table th, .function-table th {
    text-align: left;
    font: 500 0.75rem/1.4 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 0.8rem 0.6rem 0;
    border-bottom: 1px solid var(--line);
}
.data-table td, .count-table td, .function-table td {
    padding: 0.9rem 0.8rem 0.9rem 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}
.data-table { table-layout: fixed; }
.data-table tr.debug-row td { padding: 0; border-bottom: 0; }
.data-table tr:has(+ .debug-row) td { border-bottom: 1px solid var(--line); }
.person-cell strong { display: block; font-size: 1.05rem; line-height: 1.3; }
.person-cell span { display: block; color: var(--muted); font-size: 0.92rem; }
.cell-label { display: none; }
.cell-value { display: block; font-weight: 600; line-height: 1.35; }
.cell-meta { display: block; margin-top: 0.35rem; font-size: 0.88rem; color: var(--muted); }
.next-rank { color: var(--success); font-weight: 700; }
.pending-critical, .overdue { color: var(--accent); font-weight: 700; }
.requirements-link {
    display: inline-block;
    margin-top: 0.35rem;
    font: 500 0.75rem/1.4 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}
.requirements-link:hover { text-decoration: underline; }
.count-table td:last-child, .count-table th:last-child { text-align: right; padding-right: 0; }
.count-table .count { font: 700 1.4rem/1 var(--font-display); }

.blocked > summary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.blocked > summary h2 { font-size: 1.6rem; }
.blocked > summary::after {
    content: "anzeigen";
    margin-left: auto;
    font: 500 0.75rem/1.4 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.blocked[open] > summary::after { content: "ausblenden"; }
.blocked[open] > summary { margin-bottom: 1rem; }

.debug-info {
    display: none;
    margin: 0 0 0.9rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--soft);
    color: var(--muted);
    font-size: 0.9rem;
}
.debug-info ul { margin-top: 0.4rem; }
body.debug-visible .debug-info { display: block; }

/* CTA band */
.cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    background: var(--soft);
    border-color: transparent;
}
.cta p { margin: 0.4rem 0 0; color: var(--muted); }

/* Rank directory (dienstgrade.php) */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem 1.5rem;
    margin-bottom: 1.2rem;
}
.toolbar .field { display: flex; align-items: center; gap: 0.7rem; }
.toolbar .field label { margin: 0; white-space: nowrap; }
.toolbar select { width: auto; }
.rank-list { padding-block: 0.4rem; }
.rank-item + .rank-item { border-top: 1px solid var(--line); }
.rank-item > summary {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.2rem 0.9rem;
    padding: 1rem 0;
}
.rank-item > summary::before { align-self: center; grid-row: 1; }
.rank-item > summary:hover .rank-title { color: var(--accent); }
.rank-title { font: 700 1.35rem/1.15 var(--font-display); overflow-wrap: anywhere; }
.rank-description { grid-column: 2 / -1; color: var(--muted); font-size: 0.95rem; }
.rank-body { padding: 0 0 1.4rem calc(12px + 0.9rem); }
.rank-body .kicker { margin: 1rem 0 0.5rem; }
.rank-body ul { list-style: none; padding: 0; }
.rank-body li { display: flex; gap: 0.6rem; }
.rank-body li::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin-top: 0.6em;
    border-radius: 2px;
    background: var(--brand);
}
.function-table td:first-child { width: 45%; }
.function-table td > span { display: block; }
.function-table td > .badge { margin-top: 0.3rem; }

/* Career planner (laufbahn.php) */
.planner-form .form-actions { justify-content: space-between; flex-wrap: wrap; }
.inline-field { display: flex; align-items: center; gap: 0.7rem; }
.inline-field label { margin: 0; white-space: nowrap; }
.inline-field select { width: auto; }
.section > .notice { margin: 0; }

.career-steps { list-style: none; padding: 0; margin: 0; }
.career-step {
    position: relative;
    padding: 0 0 1.6rem 3.2rem;
}
.career-step::before {
    content: "";
    position: absolute;
    left: calc(1rem - 1px);
    top: 2rem;
    bottom: 0;
    border-left: 2px solid var(--line);
}
.career-step:last-child::before { display: none; }
.step-dot {
    position: absolute;
    left: 0;
    top: 0;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--card);
    font: 700 0.95rem/1 var(--font-display);
}
.career-step.is-current .step-dot { background: var(--soft); }
.career-step.is-target .step-dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; min-height: 2rem; }
.step-head .rank-title { margin-right: 0.2rem; }
.way-list { list-style: none; padding: 0; margin: 0.7rem 0 0; }
.way-list li { display: flex; gap: 0.6rem; align-items: baseline; }
.way-list li + li { margin-top: 0.35rem; }
.step-details { max-width: 820px; }
.step-details .rank-body { padding: 0 0.9rem 0.9rem; }

.way-marker {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 4px;
    font: 500 0.68rem/1 var(--font-mono);
    position: relative;
    top: -1px;
}
.way-course { background: var(--success-soft); color: var(--success); }
.way-function { background: var(--warning-soft); color: var(--warning); }

.path-tree { margin-top: 1.2rem; overflow-x: auto; padding-bottom: 0.4rem; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; list-style: none; padding: 0; margin: 0; }
.chip-row li { display: flex; align-items: center; gap: 0.35rem; }
.chip-row li + li::before { content: "→"; color: var(--muted); }
.rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--chip-group, var(--line));
    border-radius: var(--radius-sm);
    background: var(--card);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}
.rank-chip.is-target { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.group-1 { --chip-group: var(--group-1); }
.group-2 { --chip-group: var(--group-2); }
.group-3 { --chip-group: var(--group-3); }
.group-4 { --chip-group: var(--group-4); }
.path-branches { list-style: none; margin: 0.5rem 0 0 0.9rem; padding: 0; }
.path-branches > li {
    position: relative;
    padding: 0.5rem 0 0.2rem 1.4rem;
    border-left: 2px solid var(--line);
}
.path-branches > li:last-child { border-left-color: transparent; }
.path-branches > li::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 0;
    width: 1rem;
    height: 1.35rem;
    border-left: 2px solid var(--line);
    border-bottom: 2px solid var(--line);
    border-bottom-left-radius: 8px;
}
.branch-label {
    display: block;
    margin-bottom: 0.35rem;
    font: 500 0.72rem/1.4 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.tree-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 1.2rem 0 0; }
.tree-legend > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend-swatch { width: 4px; height: 1rem; border-radius: 2px; background: var(--chip-group); }

.faq-item > summary h3 { font: 600 1.05rem/1.35 var(--font-body); }
.faq-item .disclosure-body p { margin: 0; font-size: 1rem; }

.rank-link-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.rank-link-grid .card + .card { margin-top: 0; }
.rank-link-group h3 { margin-bottom: 0.6rem; }
.rank-link-group ul { list-style: none; padding: 0; }
.rank-link-group li + li { margin-top: 0.4rem; }
.rank-link-group a { text-underline-offset: 3px; line-height: 1.3; }
.rank-link-group a.is-active { color: var(--accent); font-weight: 700; }

/* Legal pages */
.prose h2 { margin: 0 0 0.8rem; }
.prose ul { color: var(--muted); margin-bottom: 1rem; }
.prose li + li { margin-top: 0.3rem; }
.prose p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding-block: 2rem 3rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.92rem;
}
.site-footer .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.site-footer .version { font: 500 0.78rem/1.4 var(--font-mono); letter-spacing: 0.04em; }

/* Responsive */
@media (max-width: 900px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-lead { grid-column: 1 / -1; }
    .rank-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .wrap { padding-inline: 16px; }
    .topbar .wrap { flex-wrap: wrap; padding-block: 0.7rem; min-height: 0; }
    .nav { gap: 0.3rem 1rem; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .stat { min-height: 110px; }

    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table thead { display: none; }
    .data-table tr:not(.debug-row) { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
    .data-table td { padding: 0.25rem 0; border: 0; }
    .data-table tr:has(+ .debug-row) td { border-bottom: 0; }
    .data-table td.person-cell { margin-bottom: 0.4rem; }
    .cell-label {
        display: block;
        font: 500 0.7rem/1.4 var(--font-mono);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--muted);
    }

    .count-table th:nth-child(2), .count-table td:nth-child(2) { display: none; }
    .function-table thead { display: none; }
    .function-table tr { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
    .function-table td { display: block; width: 100% !important; padding: 0.1rem 0; border: 0; }
    .function-table td:last-child { color: var(--muted); }
    .rank-body { padding-left: 0; }
    .rank-link-grid { grid-template-columns: minmax(0, 1fr); }
    .career-step { padding-left: 2.7rem; }
    .path-branches { margin-left: 0.4rem; }
    .path-branches > li { padding-left: 1rem; }
}

.rank-item { scroll-margin-top: 80px; }
.prose .export-bar { margin-top: 1.2rem; }
