/* RefurbOS Kundenkonto: gleiches Erscheinungsbild wie Website und App
   (dunkel zuerst, Emerald), hell über die Systemeinstellung. */

:root {
  --paper: #0a0c11; --surface: #12151c; --surface-2: #171b23; --surface-3: #1d222c;
  --ink: #eceff4; --muted: #9aa3b2; --faint: #687182;
  --brand: #10b981; --brand-2: #34d399; --brand-ink: #03140d;
  --line: rgba(255,255,255,.085); --line-strong: rgba(255,255,255,.14);
  --ok: #34d399; --ok-bg: rgba(16,185,129,.12);
  --warn: #fbbf24; --warn-bg: rgba(251,191,36,.12);
  --bad: #f87171; --bad-bg: rgba(248,113,113,.12);
  --info: #60a5fa; --info-bg: rgba(96,165,250,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -24px rgba(0,0,0,.7);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --paper: #f6f7f9; --surface: #ffffff; --surface-2: #f3f5f7; --surface-3: #e9ecf0;
    --ink: #0d1117; --muted: #556070; --faint: #8a93a1;
    --brand: #059669; --brand-2: #047857; --brand-ink: #ffffff;
    --line: rgba(13,17,23,.1); --line-strong: rgba(13,17,23,.18);
    --ok: #047857; --ok-bg: rgba(5,150,105,.1);
    --warn: #b45309; --warn-bg: rgba(217,119,6,.1);
    --bad: #b91c1c; --bad-bg: rgba(220,38,38,.08);
    --info: #1d4ed8; --info-bg: rgba(37,99,235,.08);
    --shadow: 0 1px 2px rgba(13,17,23,.05), 0 14px 30px -20px rgba(13,17,23,.25);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-2); text-underline-offset: 2px; }
a:hover { color: var(--brand); }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-3); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
code.small { font-size: .8em; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .9em; }
:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 6px; }

.wrap { width: min(880px, 100% - 32px); margin-inline: auto; }
.wrap.wide { width: min(1480px, 100% - 32px); }

/* Kopf und Fuß */
.top { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.logo .mark { width: 26px; height: 26px; background: url("/assets/favicon.svg") center / contain no-repeat; }
.logo .os { color: var(--brand-2); }
.logo .sub { font-weight: 500; color: var(--muted); font-size: .9rem; margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line-strong); }
.who { display: flex; align-items: center; gap: 12px; font-size: .9rem; flex-wrap: wrap; }
.who .email { color: var(--muted); overflow-wrap: anywhere; }
.who form { margin: 0; }
.foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 20px 0 32px; color: var(--faint); font-size: .85rem; }
.foot .wrap { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); }

main { padding-top: 28px; }
.hero { margin: 8px 0 22px; }
.hero.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero .lead, .lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--brand-2); margin-bottom: .4em; }
.narrow { max-width: 560px; margin-inline: auto; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; }

/* Karten */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.accent { background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.grid.two > .card { margin-bottom: 0; }
.grid.two + * { margin-top: 18px; }
.instance-url { font-size: 1.2rem; font-weight: 600; margin: 4px 0 14px; overflow-wrap: anywhere; }
.actions { margin: 14px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); color: var(--brand-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-danger:hover { background: var(--bad-bg); }
.who .btn { min-height: 34px; padding: 0 12px; font-size: .85rem; }

/* Formulare */
form { margin: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.input-row { display: flex; align-items: stretch; }
.field input[type="text"], .field input[type="email"], .field input[type="number"], .field input[type="date"], .field input:not([type]), .field select {
  width: 100%; min-height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 10px;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.input-row .suffix { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 10px 10px 0; color: var(--muted); white-space: nowrap; font-size: .92rem; }
.input-row:has(.suffix) input { border-radius: 10px 0 0 10px; }
.field.has-error input { border-color: var(--bad); }
.field .error { color: var(--bad); font-size: .88rem; margin: 6px 0 0; }
.field .hint { margin: 6px 0 0; }
.field.check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.field.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin-bottom: 0; flex: 1 1 200px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Hinweise und Abzeichen */
.callout { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; background: var(--surface-2); }
.callout strong { display: block; margin-bottom: 2px; }
.callout ul { margin: 6px 0 0; padding-left: 20px; }
.callout-ok { border-left-color: var(--ok); background: var(--ok-bg); }
.callout-warn { border-left-color: var(--warn); background: var(--warn-bg); }
.callout-bad { border-left-color: var(--bad); background: var(--bad-bg); }
.callout-info { border-left-color: var(--info); background: var(--info-bg); }
.callout-muted { border-left-color: var(--faint); }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2em .6em; border-radius: 999px; white-space: nowrap; vertical-align: middle; border: 1px solid transparent; }
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-muted { color: var(--muted); background: var(--surface-3); }

/* Schlüssel-Wert-Listen */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 18px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.secret { border: 1px dashed color-mix(in srgb, var(--brand) 50%, var(--line)); border-radius: 12px; padding: 14px 16px; margin: 12px 0 16px; background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.copyable { cursor: copy; }
.copied { outline: 2px solid var(--brand); }
.pw { font-size: 1.05em; }

/* Tarife */
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 12px; padding: 4px; gap: 4px; margin: 4px 0 16px; background: var(--surface-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: inline-block; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: .92rem; }
.segmented small { color: var(--brand-2); font-weight: 600; margin-left: 4px; }
.segmented input:checked + span { background: var(--surface); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--brand-2); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; background: var(--surface-2); }
.plan.featured { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); background: linear-gradient(170deg, color-mix(in srgb, var(--brand) 10%, var(--surface-2)), var(--surface-2) 70%); }
.plan p.muted { font-size: .9rem; flex: 1; }
.plan .price { font-size: .95rem; }
.plan .btn { width: 100%; margin-top: 6px; }
.card > .hint { margin-top: 14px; }

/* Listen, Tabellen */
.list { list-style: none; margin: 10px 0 14px; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.steps { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 10px 0; background: var(--surface-2); }
table { border-collapse: collapse; width: 100%; }
table.dns { margin: 8px 0 12px; font-size: .92rem; }
table.dns th, table.dns td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.data { font-size: .9rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data a { text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat strong { font-size: 1.6rem; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chip.active { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.actions-grid { display: grid; gap: 14px; }
.actions-grid > form { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
details.danger { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); border-radius: 12px; padding: 12px 16px; }
details.danger summary { cursor: pointer; font-weight: 600; color: var(--bad); }
details.danger[open] summary { margin-bottom: 10px; }

/* ---- Schaltzentrale (Betreiber) ---- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
.detail { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.back { margin: 0 0 4px; font-size: .92rem; }
.back a { text-decoration: none; }

/* Unterleiste mit den Bereichen */
.top .subnav { border-top: 1px solid var(--line); }
.top .subnav .wrap { min-height: 0; padding-block: 0; justify-content: flex-start; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: 10px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a:first-child { padding-left: 0; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }

/* Geschäftszahlen */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { color: var(--muted); font-size: .82rem; }
.kpi strong { font-size: 1.55rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi strong .muted { font-size: .7em; font-weight: 600; }
.kpi small { color: var(--faint); font-size: .8rem; line-height: 1.35; }
.kpi-main { grid-column: 1 / -1; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.kpi-main strong { font-size: 2rem; }
.kpi-warn { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
@media (min-width: 761px) { .kpis { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); } }
@media (min-width: 1100px) { .kpi-main { grid-column: span 2; } }

.dash { display: grid; gap: 18px; margin-bottom: 8px; }
.dash > .card { margin-bottom: 0; }
@media (min-width: 1100px) { .dash { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }

/* Braucht dich heute */
.today .card-head { margin-bottom: 12px; }
.todo-group + .todo-group { margin-top: 16px; }
.todo-group h3 { font-size: .95rem; display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.todo li:last-child { border-bottom: 0; }
.todo a { text-decoration: none; color: var(--ink); min-width: 0; }
.todo a:hover strong { color: var(--brand-2); }
.todo code { font-size: .8em; }
.todo .muted { font-size: .86rem; overflow-wrap: anywhere; }
.more { margin: 6px 0 0; font-size: .88rem; }

/* kleine Tabellen in Karten */
table.mini { font-size: .92rem; margin: 6px 0 12px; }
table.mini th, table.mini td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini th:first-child, table.mini td:first-child { padding-left: 0; }
table.mini thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
table.mini tfoot th { border-bottom: 0; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv.compact { font-size: .9rem; margin-bottom: 0; }
details.ids summary { cursor: pointer; color: var(--muted); font-size: .8rem; }
details.ids p { font-size: .82rem; color: var(--muted); margin: 4px 0 0; overflow-wrap: anywhere; }
progress { appearance: none; -webkit-appearance: none; width: 100%; max-width: 140px; height: 8px; border: 0; border-radius: 999px; background: var(--surface-3); overflow: hidden; vertical-align: middle; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.running progress { max-width: none; height: 10px; margin: 4px 0 8px; }
table.versions progress { max-width: 72px; }
details.callout summary { cursor: pointer; }
details.callout summary strong { display: inline; }

/* Kundentabelle */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; font-size: 1.3rem; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input[type="search"], .toolbar select { min-height: 42px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; }
.toolbar input[type="search"] { flex: 1 1 260px; min-width: 0; max-width: 520px; }
.toolbar input:focus, .toolbar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.sort-select { display: flex; gap: 8px; flex: 1 1 100%; }
.sort-select select { flex: 1; min-width: 0; }
.btn-link { background: none; color: var(--muted); border: 0; padding: 0 8px; }
.btn-link:hover { color: var(--ink); }
.chip-count { opacity: .65; font-variant-numeric: tabular-nums; margin-left: 2px; }
.chip.active .chip-count { opacity: .85; }
.chip-warn { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
table.data th a.sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
table.data th a.sort .arrow { opacity: .35; font-size: .8em; }
table.data th a.sort:hover { color: var(--ink); }
table.data th a.sort.active { color: var(--ink); }
table.data th a.sort.active .arrow { opacity: 1; color: var(--brand-2); }
table.data tr.needs td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.customers-table td:first-child { min-width: 240px; max-width: 380px; }
.who-line { display: block; font-size: .88rem; overflow-wrap: break-word; }
.who-line code { margin-right: 4px; }
.who-line .muted { display: block; }
.customers-table td:first-child > .badge { margin-top: 4px; }
.customers-table th, .customers-table td { padding-inline: 9px; }
.customers-table th:first-child, .customers-table td:first-child { padding-left: 14px; }
.customers-table td { font-variant-numeric: tabular-nums; }
.customers-table td code { font-size: .82em; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); text-decoration: none; }
.tag:hover { color: var(--ink); }
.hero .tags { margin-top: -4px; }
@media (min-width: 761px) { .sort-select { display: none; } }

/* Kundenakte */
.akte { display: grid; gap: 18px; }
.akte-main, .akte-side { min-width: 0; }
.akte-main > .grid.two { margin-bottom: 18px; }
@media (min-width: 1100px) { .akte { grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); align-items: start; } }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-grid > .action-row { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.actions-grid details.danger { margin-top: 0; }
.field textarea { width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 10px; resize: vertical; min-height: 110px; }
.field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.timeline.rich li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 2px 12px; }
.timeline .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.timeline .what .badge { margin-right: 4px; }

/* Sicherheit */
.narrow-card { max-width: 680px; }
.setup-grid { display: grid; gap: 22px; margin-bottom: 16px; }
@media (min-width: 900px) { .setup-grid { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.qr { width: 240px; max-width: 100%; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 12px; }
.steps-list { margin: 0; padding-left: 20px; }
.steps-list li { margin-bottom: 16px; }
.steps-list .inline-form { margin-top: 8px; }
.secret-key { margin: 8px 0 4px; }
.secret-key code { font-size: 1.02rem; letter-spacing: .04em; padding: 6px 10px; display: inline-block; }
.codes { columns: 2; padding-left: 26px; margin: 8px 0 12px; }
.codes li { margin: 4px 0; break-inside: avoid; }
.codes code { font-size: 1rem; }
.code-input { font-family: var(--mono); letter-spacing: .18em; font-size: 1.1rem !important; }
.field:has(.code-input) { max-width: 300px; }
.mfa .field:has(.code-input) { max-width: none; }
table.data td code, table.mini td code { white-space: nowrap; }
.actions-grid .hint { margin: 6px 0 0; }

/* Kundenakte schmaler als 1100 px: Aktionen gleich nach dem Stand, dann die Zeitleiste */
@media (max-width: 1099px) {
  .akte { display: flex; flex-direction: column; gap: 0; }
  .akte-main, .akte-side { display: contents; }
  .akte .grid.two { order: 1; margin-bottom: 18px; }
  .akte #aktionen { order: 2; }
  .akte .timeline-card { order: 3; }
  .akte #notizen { order: 4; }
  .akte .log-card { order: 5; }
}
.mfa form { text-align: left; }
details.help { margin-top: 16px; text-align: left; }
details.help summary { cursor: pointer; color: var(--muted); }
details.help p { margin: 8px 0 0; color: var(--muted); }

/* Handy: Tabellen als Karten */
@media (max-width: 760px) {
  .logo .sub { display: none; }
  .card { padding: 18px; border-radius: 14px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .table-wrap { border: 0; background: none; overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px; margin-bottom: 12px; }
  table.data td { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); text-align: right; }
  table.data td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; flex: none; }
  table.data td:first-child { display: block; text-align: left; }
  table.data td:first-child::before { content: none; }
  table.data tr td:last-child { border-bottom: 0; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  /* Kundentabelle am Handy: kompakte Karten mit zwei Spalten, Beschriftung über dem Wert */
  table.data.customers-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 14px; padding: 10px 14px; }
  table.data.customers-table td { display: block; text-align: left; border-bottom: 0; padding: 4px 0; min-width: 0; max-width: none; overflow-wrap: anywhere; }
  table.data.customers-table td::before { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
  table.data.customers-table td:first-child { grid-column: 1 / -1; padding: 0 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .subnav a { padding: 10px 8px; font-size: .9rem; }
  .subnav a:first-child { padding-left: 0; }
  .chip { white-space: nowrap; }
  table.data tr.needs { border-left: 3px solid var(--warn); }
  table.data tr.needs td:first-child { box-shadow: none; }
  table.data td .muted.nowrap { white-space: normal; }
  .timeline.rich li { grid-template-columns: 1fr; }
  .kv.compact { grid-template-columns: max-content 1fr; gap: 4px 14px; }
  .kv.compact dd { margin-bottom: 0; }
  .hero.row > .row-actions { width: 100%; }
  .codes { columns: 1; }
  .segmented { display: flex; }
  .segmented label { flex: 1; }
  .segmented span { display: block; text-align: center; }
  .segmented small { display: block; margin-left: 0; }
}
