/* KM-DEV Konto – Gestaltung wie Freeflow (grüne Marke), dunkel und hell. Keine Inline-Styles (CSP). */

/* Schriften liegen auf dem eigenen Server (CSP erlaubt nur 'self'). Lizenz: SIL OFL 1.1, siehe assets/fonts. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  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: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url('fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2-variations');
}

/* ---------- Farben: dunkel ist der Standard, hell folgt dem Gerät oder der Wahl im Menü (data-theme) ---------- */
:root {
  color-scheme: dark;
  --bg: #070A11;
  --bg-elevated: #0D1119;
  --surface: #111620;
  --surface-hover: #1A2030;
  --surface-active: #232C40;
  --field: #0A0E16;
  --btn: #1A2030;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .15);
  --text: #F5F7FA;
  --text-secondary: #A9B1C2;
  --text-tertiary: #858DA2;
  --accent: #00FB85;
  --accent-soft: rgba(0, 251, 133, .12);
  --accent-line: rgba(0, 251, 133, .30);
  --accent-strong: #04994B;
  --accent-bg: #00FB85;
  --accent-bg-hover: #5BFFB2;
  --on-accent: #04110A;
  --danger: #FF8090;
  --danger-soft: rgba(255, 122, 138, .12);
  --danger-line: rgba(255, 122, 138, .32);
  --warning: #FFB46B;
  --warning-soft: rgba(255, 180, 107, .12);
  --warning-line: rgba(255, 180, 107, .30);
  --info: #7AC8FF;
  --info-soft: rgba(122, 200, 255, .08);
  --info-line: rgba(122, 200, 255, .22);
  --discord: #A5ADFF;
  --glow: rgba(0, 251, 133, .07);
  --topbar: rgba(7, 10, 17, .82);
  --backdrop: rgba(3, 5, 9, .62);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .45);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, .40);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #F4F6F9; --bg-elevated: #FFFFFF; --surface: #FFFFFF; --surface-hover: #EEF1F5; --surface-active: #E3E7EE;
    --field: #FFFFFF; --btn: #FFFFFF;
    --border: rgba(11, 18, 32, .10); --border-strong: rgba(11, 18, 32, .20);
    --text: #0B1220; --text-secondary: #465064; --text-tertiary: #626C80;
    --accent: #067A3C; --accent-soft: rgba(6, 122, 60, .10); --accent-line: rgba(6, 122, 60, .30); --accent-strong: #04994B;
    --accent-bg: #067A3C; --accent-bg-hover: #056131; --on-accent: #FFFFFF;
    --danger: #BE2338; --danger-soft: rgba(190, 35, 56, .08); --danger-line: rgba(190, 35, 56, .30);
    --warning: #8F5206; --warning-soft: rgba(214, 134, 24, .13); --warning-line: rgba(160, 96, 10, .32);
    --info: #1B68AD; --info-soft: rgba(27, 104, 173, .07); --info-line: rgba(27, 104, 173, .25);
    --discord: #5865F2; --glow: rgba(6, 122, 60, .07); --topbar: rgba(244, 246, 249, .86); --backdrop: rgba(11, 18, 32, .38);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, .12); --shadow-md: 0 10px 28px rgba(16, 24, 40, .14);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F4F6F9; --bg-elevated: #FFFFFF; --surface: #FFFFFF; --surface-hover: #EEF1F5; --surface-active: #E3E7EE;
  --field: #FFFFFF; --btn: #FFFFFF;
  --border: rgba(11, 18, 32, .10); --border-strong: rgba(11, 18, 32, .20);
  --text: #0B1220; --text-secondary: #465064; --text-tertiary: #626C80;
  --accent: #067A3C; --accent-soft: rgba(6, 122, 60, .10); --accent-line: rgba(6, 122, 60, .30); --accent-strong: #04994B;
  --accent-bg: #067A3C; --accent-bg-hover: #056131; --on-accent: #FFFFFF;
  --danger: #BE2338; --danger-soft: rgba(190, 35, 56, .08); --danger-line: rgba(190, 35, 56, .30);
  --warning: #8F5206; --warning-soft: rgba(214, 134, 24, .13); --warning-line: rgba(160, 96, 10, .32);
  --info: #1B68AD; --info-soft: rgba(27, 104, 173, .07); --info-line: rgba(27, 104, 173, .25);
  --discord: #5865F2; --glow: rgba(6, 122, 60, .07); --topbar: rgba(244, 246, 249, .86); --backdrop: rgba(11, 18, 32, .38);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .12); --shadow-md: 0 10px 28px rgba(16, 24, 40, .14);
}

/* Sanfter Übergang zwischen den Seiten (ohne JavaScript), nur wenn Bewegung erwünscht ist. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(900px 420px at 50% -120px, var(--glow), transparent 70%), var(--bg);
  color: var(--text); font: 15px/1.55 var(--font); font-feature-settings: 'cv11', 'ss03'; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary); word-break: break-all; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-line); }
.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; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 20; padding: 9px 14px; border-radius: var(--radius-sm); background: var(--accent-bg); color: var(--on-accent); font-weight: 600; }
.skip-link:focus { top: 12px; }
.ui-icon { display: inline-block; flex: none; vertical-align: middle; }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; display: block; }
.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.brand-name span { color: var(--accent); }

/* ---------- Anmeldeseiten (ohne Kopfleiste) ---------- */
.auth-page { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px 16px; }
.auth-card {
  width: 100%; max-width: 420px; padding: 40px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.auth-card > .brand { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-title { font-size: 24px; font-weight: 700; letter-spacing: -.025em; text-align: center; margin-bottom: 6px; text-wrap: balance; }
.auth-sub { font-size: 14.5px; color: var(--text-secondary); text-align: center; margin-bottom: 26px; text-wrap: pretty; overflow-wrap: anywhere; }
.auth-sub b { color: var(--text); font-weight: 600; }
.auth-foot { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 20px; }
.auth-icon { width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.auth-icon .ui-icon { width: 24px; height: 24px; }
.auth-icon.warn { background: var(--warning-soft); color: var(--warning); }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-tertiary); font-size: 12.5px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.alt-logins { display: flex; flex-direction: column; gap: 10px; }
.alt-logins .divider { margin-bottom: 4px; }
.resend { margin-top: 10px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--accent); cursor: pointer; }
.link-button:hover { text-decoration: underline; }
.prefs { display: flex; align-items: center; gap: 10px; }
.legal { padding: 18px 16px 22px; text-align: center; font-size: 12.5px; color: var(--text-tertiary); }
.legal a { color: var(--text-secondary); font-weight: 400; }

/* ---------- Umschalter (Sprache, Darstellung) ---------- */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--field); }
.segmented a { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 6px 10px; border-radius: 7px; color: var(--text-secondary); font-size: 12.5px; font-weight: 600; }
.segmented a:hover { color: var(--text); background: var(--surface-hover); text-decoration: none; }
.segmented a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.segmented .ui-icon { width: 16px; height: 16px; }
.segmented.small a { min-width: 32px; padding: 4px 8px; }

/* ---------- Konto & Verwaltung (mit Kopfleiste) ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 28px; background: var(--topbar); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.topnav a { color: var(--text-secondary); font-size: 14px; padding: 7px 12px; border-radius: var(--radius-sm); }
.topnav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.topnav a[aria-current] { background: var(--accent-soft); color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #00FB85 0%, #04994B 100%); color: #04110A; font-size: 13.5px; font-weight: 700; cursor: pointer; user-select: none; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] .avatar { box-shadow: 0 0 0 3px var(--accent-line); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 272px; padding: 8px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.menu-head { display: flex; flex-direction: column; padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-name { font-weight: 600; overflow-wrap: anywhere; }
.menu-mail { font-size: 12.5px; color: var(--text-tertiary); overflow-wrap: anywhere; }
.menu-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; }
.menu-label { font-size: 13px; color: var(--text-secondary); }
.menu-item { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: var(--text-secondary); font-size: 14px; }
.menu-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }

.content { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 32px 20px 48px; }
.content.wide { max-width: 1120px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.page-head p { color: var(--text-secondary); margin-top: 4px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }
.card-sub { font-size: 13.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.55; overflow-wrap: anywhere; }
.card-sub b { color: var(--text); font-weight: 600; }
.icon-title { display: flex; align-items: center; gap: 10px; }
.icon-title > .ui-icon { color: var(--accent); }
.icon-title > .discord-icon, .btn .discord-icon { color: var(--discord); }
.icon-title > .discord-icon { width: 24px; height: 24px; }

.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { color: var(--text-secondary); padding: 9px 14px; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); }
.explain { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); background: var(--info-soft); border: 1px solid var(--info-line); color: var(--text-secondary); font-size: 13.5px; }
.explain b { color: var(--text); }
.explain-icon { color: var(--info); font-weight: 700; }

/* ---------- Formulare ---------- */
form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.stack { max-width: 440px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.optional { color: var(--text-tertiary); font-weight: 400; }
.hint { font-size: 12.5px; color: var(--text-tertiary); }
.field-link { font-size: 13px; }
.row { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.row > .input, .row > .input-wrap { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; gap: 8px 10px; }
.row.wrap > .input, .row.wrap > .input-wrap { flex: 1 1 170px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid2 .span { grid-column: 1 / -1; }

.input, select.input, textarea.input {
  width: 100%; min-height: 42px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--field); border: 1px solid var(--border-strong); color: var(--text);
  font: inherit; font-size: 14.5px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; font-family: var(--mono); font-size: 13px; }
textarea.input.text { font-family: inherit; font-size: 14.5px; }
.input:hover { border-color: var(--text-tertiary); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-tertiary); }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 44px; }
.input-action { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--text-tertiary); cursor: pointer; }
.input-action:hover { color: var(--text); background: var(--surface-hover); }
.input-action .when-on, .input-action[aria-pressed="true"] .when-off { display: none; }
.input-action[aria-pressed="true"] .when-on { display: inline-block; }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-secondary); cursor: pointer; user-select: none; }
.check input { accent-color: var(--accent-bg); width: 16px; height: 16px; margin: 0; cursor: pointer; flex: none; }
.check input:disabled { cursor: default; }
.consent { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
legend { font-size: 12.5px; color: var(--text-tertiary); padding: 0 4px; }

/* Passwortstärke: drei Segmente, die sich mit der Stärke füllen */
.strength { display: flex; align-items: center; gap: 10px; }
.strength-bar { display: flex; gap: 4px; flex: 1; }
.strength-bar i { height: 4px; flex: 1; border-radius: 2px; background: var(--border-strong); transition: background .15s; }
.strength-text { font-size: 12.5px; color: var(--text-secondary); min-width: 74px; text-align: right; }
.strength[data-level="1"] i:nth-child(1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] i { background: var(--accent); }

/* Bestätigungscode: sechs Kästchen (app.js baut sie aus dem einen Feld) */
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-box { min-height: 54px; padding: 0; text-align: center; font: 600 22px/1 var(--mono); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--btn); color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, opacity .12s;
}
.btn:hover { background: var(--surface-active); text-decoration: none; }
.btn .ui-icon { width: 18px; height: 18px; }
.btn-primary { background: var(--accent-bg); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn-primary:hover { background: var(--accent-bg-hover); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-block { width: 100%; min-height: 44px; }
.btn-sm { min-height: 32px; padding: 4px 11px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
/* Abgeschickt: der Knopf zeigt, dass etwas passiert, und nimmt keinen zweiten Klick an. */
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.alert { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; border: 1px solid; overflow-wrap: anywhere; }
.alert .ui-icon { width: 18px; height: 18px; margin-top: 2px; }
.alert-ok { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.alert-ok .ui-icon { color: var(--accent); }
.alert-error { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

/* Rückfrage vor heiklen Aktionen */
.dialog { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.dialog form { gap: 0; }
.dialog-title { font-size: 18px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 8px; }
.dialog-text { color: var(--text-secondary); font-size: 14.5px; margin-bottom: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Listen, Tabellen, Abzeichen ---------- */
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag, .badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.muted { background: var(--surface-hover); color: var(--text-secondary); }
.muted { color: var(--text-tertiary); font-size: 13.5px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list li:last-child { padding-bottom: 0; }
.list .name { font-weight: 500; overflow-wrap: anywhere; }
.row-main { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.row-icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-hover); color: var(--text-secondary); }
.row-icon .discord-icon { color: var(--discord); }
.pill { display: inline-flex; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--text-tertiary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 10px; border-bottom: 1px solid var(--border); }
td { padding: 13px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.sub, td .sub { display: block; font-size: 12.5px; color: var(--text-tertiary); margin-top: 2px; overflow-wrap: anywhere; }

/* ---------- Verwaltung ---------- */
.strong { font-weight: 600; color: var(--text); }
.nowrap { white-space: nowrap; }
.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.back { margin-bottom: 12px; font-size: 13.5px; }
.card-title.big { font-size: 17px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; word-break: break-all; }
table.compact td { padding: 9px 10px; }
table.compact th { padding: 0 10px 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 400; }
a.stat:hover { background: var(--surface-hover); text-decoration: none; }
.stat-label { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--text-tertiary); }

/* Balken: dunkleres Grün (besser lesbar auf der Fläche), beim Zeigen die helle Marke. Höhen stehen als SVG-Attribute (CSP). */
.chart { display: block; width: 100%; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .baseline { stroke: var(--border-strong); stroke-width: 1; }
.chart text { fill: var(--text-tertiary); font: 11.5px var(--font); font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--text-secondary); font-weight: 600; }
.chart .bar { fill: var(--accent-strong); }
.chart .hit { fill: transparent; pointer-events: all; }
.chart .slot:hover .bar { fill: var(--accent); }
.chart .slot:hover .hit { fill: var(--border); }
details.more { margin-top: 10px; }
details.more summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; }
details.more table { margin-top: 10px; max-width: 360px; }

.filters { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 150px; }
.filters input[type=search] { flex: 1 1 220px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--surface-hover); color: var(--text-secondary); border: 1px solid var(--border); white-space: nowrap; }
.chip-admin { color: var(--warning); border-color: var(--warning-line); }
.notice-bar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--radius); background: var(--warning-soft); border: 1px solid var(--warning-line); font-size: 13.5px; color: var(--text-secondary); }
.notice-bar > span { flex: 1 1 320px; }
.notice-bar b { color: var(--text); }

.cards { margin-top: 14px; align-items: start; }
.cards .card + .card { margin-top: 0; }
.cards + .card, .cards + .grid2 { margin-top: 14px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-tertiary); }
.facts dd { margin: 0; }
.perms { gap: 0; }
.perm { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); cursor: pointer; font-size: 13.5px; }
.perm:first-of-type { border-top: 0; padding-top: 0; }
.perm input { accent-color: var(--accent-bg); width: 15px; height: 15px; margin: 3px 0 0; flex: none; cursor: pointer; }
.perm code { margin-left: 4px; }
.perm .hint { display: block; margin-top: 3px; line-height: 1.45; }
.perms > div { padding-top: 12px; }
.action { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.actions > .action:first-child { border-top: 0; padding-top: 0; }
.action .text { flex: 1 1 300px; font-size: 13.5px; color: var(--text-secondary); }
.action .text b { color: var(--text); }
.action .text .hint { display: block; margin-top: 2px; }
.action .input { flex: 1 1 220px; width: auto; }
.list.events li { align-items: flex-start; }
.app-edit { padding: 16px 0; border-top: 1px solid var(--border); }
.app-edit:first-of-type { border-top: 0; padding-top: 0; }
.app-edit-head { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; border-radius: var(--radius-sm); }
.app-edit-head::-webkit-details-marker { display: none; }
.app-edit[open] > .app-edit-head { margin-bottom: 14px; }
.app-edit-head .name { font-weight: 600; }

/* ---------- Discord (Verwaltung) ---------- */
.swatch { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.list.roles li { padding: 8px 0; }
.list.roles code.sub { margin: 0; }
.channel-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; margin-bottom: 18px; }
.channel-group { display: flex; flex-direction: column; gap: 2px; }
.channel-cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--text-tertiary); padding: 4px 8px; }
a.channel-cat:hover { color: var(--text); text-decoration: none; }
.channel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 400; font-size: 14px; }
.channel:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.add-channel { padding-top: 16px; border-top: 1px solid var(--border); }
.add-role { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.input.color { width: 56px; min-width: 56px; flex: none; padding: 3px; height: 42px; cursor: pointer; }
details.embed { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
details.embed summary { cursor: pointer; font-size: 13.5px; color: var(--text-secondary); }
details.embed[open] summary { margin-bottom: 12px; }
.overwrite { padding: 16px 0 6px; border-top: 1px solid var(--border); }
.overwrite:first-of-type { border-top: 0; padding-top: 0; }
.overwrite-remove { margin: 0 0 10px; align-items: flex-start; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.perm-grid .label { font-size: 12.5px; }
select.state-allow { border-color: var(--accent-line); color: var(--accent); }
select.state-deny { border-color: var(--danger-line); color: var(--danger); }
.card-title.small { font-size: 13.5px; margin: 18px 0 10px; color: var(--text-secondary); }

/* ---------- Zwei-Faktor: QR-Code auf weißem Grund (Scanner brauchen Kontrast), Wiederherstellungscodes im Raster ---------- */
.mfa-setup { display: flex; gap: 22px; align-items: flex-start; }
.mfa-setup > div:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.mfa-setup .row { align-self: stretch; }
.qr { flex: none; background: #fff; padding: 8px; border-radius: var(--radius-sm); line-height: 0; }
.qr svg { width: 180px; height: 180px; }
.codes { list-style: none; padding: 16px; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--field); }
.codes code { font-size: 15px; color: var(--text); letter-spacing: .04em; }
.code-actions { margin-top: 14px; }

/* ---------- Kontoseite ---------- */
.account-content { max-width: 1120px; padding-top: 36px; }
.account-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 40px; align-items: start; }
.account-sidebar { position: sticky; top: 92px; }
.account-nav { display: grid; gap: 4px; }
.account-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; color: var(--text-secondary); border: 1px solid transparent; border-radius: 10px; font-size: 14.5px; }
.account-nav a:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.account-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.account-nav .nav-short { display: none; }
.account-panels { min-width: 0; max-width: 820px; }
[data-account-panel] { scroll-margin-top: 90px; }
[data-account-panel] + [data-account-panel] { margin-top: 44px; }
.account-workspace.is-enhanced [data-account-panel] { margin-top: 0; }
[data-account-panel] [id] { scroll-margin-top: 90px; }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.hero h1 { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.04em; line-height: 1.15; overflow-wrap: anywhere; }
.hero-dot { color: var(--accent); }
.hero p { color: var(--text-secondary); margin-top: 8px; font-size: 16px; }
.section-heading { margin-bottom: 22px; }
.section-heading h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.section-heading p { color: var(--text-secondary); margin-top: 6px; }
.hero h1:focus, .section-heading h1:focus { outline: none; }

/* Sicherheitsstatus */
.status-card { background: linear-gradient(125deg, var(--glow), transparent 55%), var(--surface); border-color: var(--border-strong); }
.meter { display: flex; gap: 4px; flex: none; margin-top: 6px; }
.meter i { width: 26px; height: 6px; border-radius: 3px; background: var(--border-strong); }
.meter i.on { background: var(--accent); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { border-top: 1px solid var(--border); }
.checklist a { display: flex; align-items: center; gap: 14px; padding: 13px 8px; margin: 0 -8px; border-radius: var(--radius-sm); color: var(--text); font-weight: 400; }
.checklist a:hover { background: var(--surface-hover); text-decoration: none; }
.check-mark { width: 22px; height: 22px; color: var(--text-tertiary); }
.checklist .done .check-mark { color: var(--accent); }
.check-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.check-title { font-weight: 550; }
.check-text { font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.check-action { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-tertiary); white-space: nowrap; }
.check-action .ui-icon { width: 16px; height: 16px; }
.checklist .todo .check-action { color: var(--accent); }

/* Apps */
.app-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.app-logo { display: block; flex: none; width: 36px; height: 36px; object-fit: contain; border-radius: 8px; }
.app-icon.large, .app-logo.large { width: 48px; height: 48px; border-radius: 12px; }
.app-icon.large .ui-icon { width: 26px; height: 26px; }
.launcher { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.launcher a { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elevated); color: var(--text); font-weight: 400; transition: border-color .12s, background .12s; }
.launcher a:hover { border-color: var(--accent-line); background: var(--surface-hover); text-decoration: none; }
.launcher .app-icon, .launcher .app-logo { grid-row: 1 / 3; }
.launcher-name { font-weight: 600; overflow-wrap: anywhere; align-self: end; }
.launcher-kind { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-tertiary); align-self: start; }
.launcher-kind .ui-icon { width: 14px; height: 14px; }
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.app-grid li { display: flex; align-items: flex-start; flex-direction: column; gap: 8px; padding: 20px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.app-name { font-weight: 650; font-size: 16.5px; overflow-wrap: anywhere; margin-top: 6px; }
.app-description { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.app-meta { font-size: 12.5px; color: var(--text-tertiary); }
.app-button { margin-top: auto; width: 100%; }
.app-grid li > .app-meta { margin-bottom: 6px; }
.empty-state { color: var(--text-secondary); padding: 8px 0 16px; }

/* Aufklappbare Karten (Passwort, E-Mail, Konto löschen) */
.disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; margin: -22px; padding: 22px; border-radius: var(--radius); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { background: var(--surface-hover); }
.disclosure[open] > summary { margin-bottom: 0; padding-bottom: 14px; border-radius: var(--radius) var(--radius) 0 0; }
.disclosure[open] > summary:hover { background: none; }
.disclosure .chevron { color: var(--text-tertiary); transition: transform .15s; }
.disclosure[open] .chevron { transform: rotate(180deg); }
.disclosure > .card-sub { margin: 0 0 18px; }
.summary-value { display: block; font-size: 13px; font-weight: 400; color: var(--text-secondary); overflow-wrap: anywhere; }
.danger-card { border-color: var(--danger-line); }
.danger-card > summary .ui-icon:first-child { color: var(--danger); }
.sub-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.inline-confirm { position: relative; flex: none; }
.inline-confirm > summary { list-style: none; }
.inline-confirm > summary::-webkit-details-marker { display: none; }
.inline-confirm[open] { flex: 1 1 100%; }
.inline-confirm[open] > summary { margin-bottom: 10px; }
.list li:has(.inline-confirm[open]) { flex-wrap: wrap; }
.passkey-add { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.card > .list + .muted, .card > .alert { margin-top: 14px; margin-bottom: 0; }
.timeline .row-icon { width: 32px; height: 32px; border-radius: 50%; }
.timeline .row-icon .ui-icon { width: 16px; height: 16px; }
.timeline li { align-items: center; }

/* ---------- Nutzungsbedingungen ---------- */
.terms-check { align-items: flex-start; margin: 2px 0; line-height: 1.45; }
.terms-check input { margin-top: 2px; }
.auth-card-wide { max-width: 720px; }
.prose { font-size: 14.5px; line-height: 1.65; color: var(--text-secondary); }
.prose h2 { font-size: 16px; font-weight: 650; color: var(--text); margin: 26px 0 8px; letter-spacing: -.01em; }
.prose p, .prose ul { margin: 0 0 10px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose .stand { font-size: 13px; color: var(--text-tertiary); text-align: center; margin: -16px 0 22px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Schmal ---------- */
@media (max-width: 960px) {
  .account-shell { grid-template-columns: 190px minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 760px) {
  .auth-card { padding: 28px 22px; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topnav a { padding: 7px 9px; }
  .grid2 { grid-template-columns: 1fr; }
  .mfa-setup { flex-direction: column; align-items: center; }
  table, thead, tbody, tr, th, td { display: block; }
  thead { display: none; }
  td { border: 0; padding: 5px 0; }
  tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .filters .input { flex: 1 1 100%; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  td.num { text-align: left; }

  /* Kontoseite: die Bereiche wandern als Leiste an den unteren Rand, gleich breit und mit dem Daumen erreichbar. */
  .account-content { padding-top: 22px; padding-bottom: 96px; }
  .account-shell { display: block; }
  .account-sidebar { position: fixed; left: 0; right: 0; top: auto; bottom: 0; z-index: 9; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--topbar); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border-strong); }
  .account-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .account-nav a { flex-direction: column; gap: 3px; padding: 7px 2px; font-size: 11.5px; font-weight: 500; text-align: center; line-height: 1.2; }
  .account-nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .account-nav .nav-long { display: none; }
  .account-nav .nav-short { display: block; }
  .account-nav a[aria-current="page"] { border-color: transparent; }
  .hero { margin-bottom: 20px; }
  .hero .pill { display: none; }
  .card { padding: 18px; }
  .disclosure > summary { margin: -18px; padding: 18px; }
  .card-head { flex-wrap: wrap; }
  .meter { display: none; }
  .check-action { font-size: 0; gap: 0; }
  .list li { flex-wrap: wrap; }
  .between { flex-wrap: wrap; }
  .codes { grid-template-columns: 1fr 1fr; padding: 12px; }
  body:has(.account-sidebar) .legal { padding-bottom: 92px; }
}
@media (max-width: 380px) {
  .brand-name { font-size: 15px; }
  .otp-boxes { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Drucken: nur die Wiederherstellungscodes (app.js setzt die Klasse vor dem Druck) ---------- */
@media print {
  html.print-only body * { visibility: hidden; }
  html.print-only .print-target, html.print-only .print-target * { visibility: visible; }
  html.print-only .print-target { position: absolute; inset: 0 auto auto 0; width: 100%; border: 0; background: #fff; color: #000; }
  html.print-only .print-target .code-actions { display: none; }
  html.print-only .print-target code, html.print-only .print-target .card-sub, html.print-only .print-target .card-title { color: #000; }
}
