/*
 * FiBL KI Portal – Stylesheet.
 * Tokens und Komponenten aus Voice2Text (assets/app.css), die dem Privacy Gateway folgen
 * (web/src/styles/index.css): Jost, Petrol #2f6c86, Gelb #ffc032, Slate-Neutraltöne.
 * Portal-spezifisch: Kacheln, Tabellen, Verwaltung (am Ende).
 */

@font-face { font-family: "Jost"; font-weight: 400; font-display: swap; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 500; font-display: swap; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 600; font-display: swap; src: url("../fonts/jost-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 700; font-display: swap; src: url("../fonts/jost-latin-700-normal.woff2") format("woff2"); }

:root {
  --font-sans: "Jost", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --brand-50: #e8f6ff;  --brand-100: #cfe9f7; --brand-200: #a8d4eb; --brand-300: #77b3da;
  --brand-400: #4f93bd; --brand-500: #3a7fa0; --brand-600: #2f6c86; --brand-700: #285d74;
  --brand-800: #224e60; --brand-900: #1b3e4d; --brand-950: #12293a;
  --accent-50: #fff6de; --accent-100: #fff1cc; --accent-200: #ffe399; --accent-300: #ffd979;
  --accent-400: #ffc951; --accent-500: #ffc032; --accent-600: #e6a91f; --accent-700: #b98514;

  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1;
  --slate-400: #94a3b8; --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155;
  --slate-800: #1e293b; --slate-900: #0f172a; --slate-950: #020617;
  --emerald-50: #ecfdf5; --emerald-500: #10b981; --emerald-600: #059669; --emerald-700: #047857;
  --red-50: #fef2f2; --red-200: #fecaca; --red-400: #f87171; --red-600: #dc2626; --red-700: #b91c1c;
  --amber-50: #fffbeb; --amber-200: #fde68a; --amber-700: #b45309;

  /* semantische Farben (hell) */
  --bg: var(--slate-50);
  --surface: #fff;
  --surface-muted: var(--slate-50);
  --tint: rgb(232 246 255 / .7);
  --text: var(--slate-900);
  --text-soft: var(--slate-700);
  --muted: var(--slate-500);
  --line: var(--slate-200);
  --line-strong: var(--slate-300);
  --ring: var(--brand-200);
  --title: var(--brand-800);
  --logo-title: var(--brand-600);
  --logo-sub: #707070;
  --wave-pending: var(--brand-100);
  --wave-done: var(--brand-600);
  --wave-active: var(--accent-500);
  --wave-failed: var(--red-400);

  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
}

.dark {
  --bg: var(--slate-950);
  --surface: var(--slate-900);
  --surface-muted: rgb(30 41 59 / .5);
  --tint: rgb(18 41 58 / .65);
  --text: var(--slate-100);
  --text-soft: var(--slate-300);
  --muted: var(--slate-400);
  --line: var(--slate-800);
  --line-strong: var(--slate-700);
  --ring: rgb(58 127 160 / .45);
  --title: var(--brand-100);
  --logo-title: var(--brand-200);
  --logo-sub: var(--slate-400);
  --wave-pending: rgb(58 127 160 / .28);
  --wave-done: var(--brand-300);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 112.5%; } /* Grundschrift 18 px statt 16 px */
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font-sans); font-size: 1rem; line-height: 1.55;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--title); }
p { margin: 0; }
a { color: var(--brand-600); }
.dark a { color: var(--brand-300); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.icon { width: 1.15em; height: 1.15em; flex: none; }
.icon-muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgb(255 255 255 / .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.dark .topbar { background: rgb(15 23 42 / .8); }
.topbar-inner { max-width: 56rem; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; }
.logo { height: 40px; width: auto; display: block; }
.logo-lg { height: 60px; }
.logo-title { fill: var(--logo-title); }
.logo-sub { fill: var(--logo-sub); }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-xl); background: var(--slate-100); border: 1px solid var(--line); }
.dark .seg { background: var(--slate-800); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: .3rem .45rem; border-radius: 9px; cursor: pointer; display: inline-flex; }
.seg button:hover { color: var(--text); }
.seg button.is-active { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-xs); }


/* ---------- Layout ---------- */
.shell { width: 100%; max-width: 48rem; margin: 0 auto; padding: 2rem 1rem 3rem; flex: 1; display: flex; flex-direction: column; gap: 1.25rem; }
.view-settings .shell { max-width: 56rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem 1rem; text-align: center; font-size: .75rem; color: var(--muted); padding: 1.5rem 1rem 2rem; }

.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; padding-top: .5rem; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.15; }
.lead { color: var(--muted); font-size: 1.05rem; }
.kicker {
  display: inline-flex; align-items: center; gap: .35rem; align-self: center;
  padding: .2rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em;
  background: var(--accent-500); color: var(--brand-950);
}
.kicker .icon { width: 1em; height: 1em; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.page-head .kicker { margin-bottom: .5rem; }
.page-head h1 { font-size: 1.8rem; }

/* ---------- Karten ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-2xl); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .8rem 1.25rem; border-bottom: 1px solid var(--line); }
.card-title { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--slate-600); }
.dark .card-title { color: var(--slate-400); }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card-body { padding: 1.25rem; }
.stack { display: flex; flex-direction: column; gap: .6rem; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.label { font-size: .85rem; font-weight: 500; color: var(--text-soft); display: flex; align-items: center; gap: .4rem; }
.hint { font-size: .78rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background-color: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-xl);
  padding: .55rem .75rem; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
.dark .input, .dark .select, .dark .textarea { background-color: var(--slate-950); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--ring); }
.select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .7rem center; background-size: 1rem;
}
.select:disabled, .input:disabled { opacity: .6; cursor: not-allowed; }
.select-sm { width: auto; padding: .3rem 2rem .3rem .6rem; font-size: .85rem; border-radius: 10px; background-position: right .5rem center; }
.textarea { resize: vertical; line-height: 1.6; }
.input-sm { padding: .35rem .6rem; font-size: .85rem; }
.input-row { display: flex; gap: .5rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.form-error { color: var(--red-600); font-size: .88rem; }
.dark .form-error { color: var(--red-400); }
.checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text-soft); }
.link-btn { border: 0; background: none; padding: 0; margin-left: auto; font: inherit; font-size: .78rem; color: var(--brand-600); cursor: pointer; text-decoration: underline; }

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .92rem; color: var(--text-soft); user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--slate-300); transition: background .2s; flex: none; }
.dark .switch-track { background: var(--slate-700); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--brand-600); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-size: .9rem; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap;
  padding: .55rem 1rem; border-radius: var(--radius-xl); border: 1px solid transparent; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--brand-700); }
.btn-primary:active:not(:disabled) { background: var(--brand-800); }
.btn-accent { background: var(--accent-500); color: var(--brand-950); box-shadow: var(--shadow-xs); }
.btn-accent:hover:not(:disabled) { background: var(--accent-400); }
.btn-secondary { background: var(--surface); color: var(--text-soft); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn-secondary:hover:not(:disabled) { background: var(--slate-50); color: var(--text); }
.dark .btn-secondary { background: var(--slate-800); }
.dark .btn-secondary:hover:not(:disabled) { background: var(--slate-700); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover:not(:disabled) { background: var(--slate-100); color: var(--text); }
.dark .btn-ghost:hover:not(:disabled) { background: var(--slate-800); }
.btn-danger { background: var(--surface); color: var(--red-600); border-color: var(--red-200); }
.btn-danger:hover:not(:disabled) { background: var(--red-50); }
.dark .btn-danger { background: transparent; border-color: rgb(248 113 113 / .35); color: var(--red-400); }
.btn-lg { padding: .8rem 1.35rem; font-size: 1rem; border-radius: var(--radius-2xl); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; border-radius: 10px; }
.btn-icon { padding: .45rem; }
.btn-block { width: 100%; }
.btn.is-success { background: var(--emerald-600); color: #fff; }
.btn .spin { animation: spin .9s linear infinite; }

/* ---------- Login ---------- */
.auth { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-inline { padding: 1rem 0; }
.auth-inner { width: 100%; max-width: 26rem; display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.auth-tagline { color: var(--muted); text-align: center; }
.auth-card { width: 100%; }
.auth-card .card-body { display: flex; flex-direction: column; gap: 1rem; padding: 1.6rem; }
.auth-card .kicker { align-self: flex-start; }
.auth-title { font-size: 1.3rem; display: flex; align-items: center; gap: .5rem; }
.auth-foot { font-size: .75rem; color: var(--muted); }
.shake { animation: shake .4s ease-in-out; }

/* ---------- Hinweise ---------- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-xl); border: 1px solid; font-size: .92rem; }
.alert .icon { margin-top: .12rem; }
.alert-body { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; }
.alert-error { background: var(--red-50); border-color: var(--red-200); color: var(--red-700); }
.alert-warning { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-700); margin-bottom: 1rem; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-800); }
.dark .alert-error { background: rgb(127 29 29 / .25); border-color: rgb(248 113 113 / .3); color: #fecaca; }
.dark .alert-warning { background: rgb(120 53 15 / .25); border-color: rgb(251 191 36 / .3); color: #fde68a; }
.dark .alert-info { background: rgb(18 41 58 / .6); border-color: var(--brand-800); color: var(--brand-100); }

.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 500; padding: .1rem .5rem; border-radius: 999px; background: var(--slate-100); color: var(--slate-600); }
.dark .badge { background: var(--slate-800); color: var(--slate-300); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); }
.badge-accent { background: var(--accent-100); color: var(--accent-700); }
.badge-ok { background: var(--emerald-50); color: var(--emerald-700); }
.dark .badge-brand { background: rgb(47 108 134 / .3); color: var(--brand-100); }
.dark .badge-accent { background: rgb(255 192 50 / .18); color: var(--accent-300); }
.dark .badge-ok { background: rgb(16 185 129 / .18); color: #6ee7b7; }
.badge .icon { width: .9em; height: .9em; }

/* ---------- Animationen ---------- */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes check-in { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

@keyframes shake { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ======================================================================
 * Portal-spezifisch
 * ====================================================================== */

.topbar-inner { max-width: 72rem; }
.shell-wide { max-width: 72rem; }
.shell-portal { max-width: 64rem; gap: 2rem; }
.topbar-user { font-size: .85rem; color: var(--muted); margin-right: .35rem; white-space: nowrap; }
.btn .icon { width: 1.1em; height: 1.1em; }

/* ---------- Kacheln ---------- */
.section { display: flex; flex-direction: column; gap: .9rem; }
.section-title { display: flex; align-items: center; justify-content: center; gap: 1rem; text-align: center; }
.section-title::before, .section-title::after { content: ""; flex: 1; max-width: 12rem; height: 1px; background: var(--line); }
/* Raster geht immer auf: Spaltenzahl nach Anzahl der Kacheln, gleich breite Kacheln, zentriert */
.shell-portal { max-width: 74rem; }
.tiles { --cols: 3; display: grid; gap: 1.25rem; justify-content: center; grid-template-columns: repeat(var(--cols), minmax(0, 16.5rem)); }
.tiles-1 { --cols: 1; } .tiles-2 { --cols: 2; } .tiles-3 { --cols: 3; } .tiles-4 { --cols: 4; } .tiles-5, .tiles-6 { --cols: 3; }
@media (max-width: 1300px) { .tiles-4 { --cols: 2; } }
@media (max-width: 980px)  { .tiles-3, .tiles-5, .tiles-6 { --cols: 2; } }
.tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem;
  padding: 2.2rem 1.5rem 1.9rem; text-decoration: none; color: var(--text);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tile:hover, .tile:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-300); }
.dark .tile:hover, .dark .tile:focus-visible { border-color: var(--brand-700); }
.tile { position: relative; overflow: hidden; --c1: var(--brand-400); --c2: var(--brand-800); --glow: 47 108 134; }
.tile::before {
  content: ""; position: absolute; left: 50%; top: -90px; width: 320px; height: 220px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgb(var(--glow) / .16), transparent); pointer-events: none;
  transition: opacity .25s; opacity: .8;
}
.tile:hover::before, .tile:focus-visible::before { opacity: 1; }
.tile:hover, .tile:focus-visible { border-color: rgb(var(--glow) / .45); }
.tile-icon {
  position: relative; display: grid; place-items: center; width: 100px; height: 100px; border-radius: 30px; margin-bottom: 1.1rem;
  background: linear-gradient(135deg, var(--c1) 0%, var(--c2) 100%); color: #fff;
  box-shadow: 0 14px 30px -12px rgb(var(--glow) / .75), inset 0 0 0 1px rgb(255 255 255 / .22);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tile-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 20% 10%, rgb(255 255 255 / .38), transparent 55%);
}
.tile-icon .icon { position: relative; z-index: 1; width: 48px; height: 48px; stroke-width: 1.8; filter: drop-shadow(0 2px 3px rgb(0 0 0 / .18)); }
.tile:hover .tile-icon, .tile:focus-visible .tile-icon { transform: translateY(-2px) scale(1.06) rotate(-2deg); box-shadow: 0 18px 36px -12px rgb(var(--glow) / .85), inset 0 0 0 1px rgb(255 255 255 / .25); }

/* Farbe je Dienst */
.tile--privacy, .svc--privacy { --c1: #34d399; --c2: #0f766e; --glow: 16 185 129; }
.tile--voice,   .svc--voice   { --c1: #fbbf24; --c2: #ea580c; --glow: 245 158 11; }
.tile--search,  .svc--search  { --c1: #38bdf8; --c2: #4338ca; --glow: 59 130 246; }
.tile--archiv,  .svc--archiv  { --c1: #4f93bd; --c2: #1b3e4d; --glow: 47 108 134; }
.tile--chat,    .svc--chat    { --c1: #e879f9; --c2: #7c3aed; --glow: 139 92 246; }
.tile--chatgpt, .svc--chatgpt { --c1: #64748b; --c2: #0f172a; --glow: 71 85 105; }
.tile-go { color: rgb(var(--glow)); }
.dark .tile-go { color: rgb(var(--glow)); filter: brightness(1.3); }
.tile-title { font-size: 1.2rem; font-weight: 600; color: var(--title); }
.tile-sub { color: var(--muted); font-size: .95rem; }
.tile-go {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .8rem;
  font-size: .85rem; font-weight: 500; opacity: 0; transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}
.tile-go .icon { width: 1em; height: 1em; }
.tile:hover .tile-go, .tile:focus-visible .tile-go { opacity: 1; transform: none; }
.empty { text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.empty .icon { width: 28px; height: 28px; color: var(--brand-500); }

/* ---------- Verwaltung ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; white-space: nowrap; padding: .6rem 1.25rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--slate-500); background: var(--surface-muted); border-bottom: 1px solid var(--line);
}
.table td { padding: .75rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-muted); }
.cell-actions { text-align: right; white-space: nowrap; }
.user-name { font-weight: 500; }
.user-mail { font-size: .82rem; color: var(--muted); }
.svc-icons { display: flex; gap: .35rem; }
.svc-icons .svc { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); }
.svc-icons .icon { width: 15px; height: 15px; }
.svc-icons .off { background: var(--slate-100); color: var(--slate-300); }
.dark .svc-icons .off { background: var(--slate-800); color: var(--slate-600); }
.badge-danger { background: var(--red-50); color: var(--red-700); }
.badge-warn { background: var(--amber-50); color: var(--amber-700); }
.dark .badge-danger { background: rgb(127 29 29 / .3); color: #fecaca; }
.dark .badge-warn { background: rgb(120 53 15 / .3); color: #fde68a; }
.search { max-width: 16rem; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.choice {
  display: flex; align-items: center; gap: .6rem; padding: .7rem .85rem; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-xl); background: var(--surface);
  font-size: .92rem; color: var(--text-soft); transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--brand-400); }
.choice input { width: 17px; height: 17px; accent-color: var(--brand-600); margin: 0; }
.choice .svc { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); flex: none; }
.choice .svc .icon { width: 16px; height: 16px; }
.choice:has(input:checked) { border-color: var(--brand-500); background: var(--tint); }
.choice-grid.is-disabled { opacity: .5; pointer-events: none; }

.link-box { display: flex; gap: .5rem; margin-top: .6rem; }
.link-box .input { font-family: var(--font-mono); font-size: .8rem; }
.meta-line { font-size: .85rem; color: var(--muted); }
.danger-zone { border-color: var(--red-200); }
.dark .danger-zone { border-color: rgb(248 113 113 / .3); }

/* Turnstile-Widget in voller Breite */
.turnstile { min-height: 65px; }

@media (max-width: 640px) {
  .topbar-user { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); }
  .tile { padding: 1.6rem 1.25rem; }
  .tile-go { opacity: 1; transform: none; }
  .search { max-width: none; flex: 1; }
  .table th, .table td { padding-left: .75rem; padding-right: .75rem; }
  .hide-sm { display: none; }
}
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }

/* ---------- Kopfzeile: größeres Logo ---------- */
.topbar-inner { padding-top: .75rem; padding-bottom: .75rem; }
.topbar .logo { height: 60px; }

/* ---------- Mein Konto / 2FA ---------- */
.card-title .icon { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: .2rem; color: var(--brand-600); }
.dark .card-title .icon { color: var(--brand-300); }
.card-accent { border-color: var(--accent-400); box-shadow: 0 0 0 3px rgb(255 192 50 / .18), var(--shadow-sm); }
.input-code { font-family: var(--font-mono); font-size: 1.15rem; letter-spacing: .25em; text-align: center; max-width: 12rem; }
.input-row .input-code { flex: 0 1 12rem; }
.input-row-center { align-items: center; flex-wrap: wrap; justify-content: space-between; }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.recovery-codes {
  list-style: none; margin: 0; padding: 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem;
  border-radius: var(--radius-xl); background: var(--surface-muted); border: 1px dashed var(--line-strong);
  font-family: var(--font-mono); font-size: 1rem; letter-spacing: .06em; text-align: center;
}
.setup-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 1.25rem; }
.setup-steps > li { counter-increment: step; position: relative; padding-left: 2.6rem; display: flex; flex-direction: column; gap: .5rem; }
.setup-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -.1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: .9rem; background: var(--brand-600); color: #fff;
}
.qr-wrap { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.qr { width: 220px; height: 220px; padding: 10px; background: #fff; border-radius: var(--radius-xl); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.qr-manual { display: flex; flex-direction: column; gap: .4rem; flex: 1 1 14rem; }
.secret { font-family: var(--font-mono); font-size: 1rem; letter-spacing: .08em; padding: .5rem .75rem; border-radius: 10px; background: var(--surface-muted); border: 1px solid var(--line); word-break: break-all; }

@media (max-width: 640px) {
  .topbar .logo { height: 48px; }
  .tile-icon { width: 80px; height: 80px; border-radius: 24px; }
  .tile-icon .icon { width: 38px; height: 38px; }
}

@media print {
  body * { visibility: hidden; }
  .recovery-codes, .recovery-codes * { visibility: visible; }
  .recovery-codes { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
}
