/* Gemeinsames Design-System für Anmeldung (ui/) und Zugriffsverwaltung (appaccess/).
   Quelle ist diese Datei; appaccess/static/ds.css wird mit sync-design.sh kopiert (Test prüft Gleichheit).
   Keine externen Anfragen: Schrift liegt als woff2 daneben. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/static/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #edf0f3;
  --surface: #ffffff;
  --surface-2: #f5f7f9;
  --ink: #0d1a2b;
  --ink-2: #4a586b;
  --line: #d5dbe3;
  --accent: #0a6f7b;
  --accent-hover: #085b65;
  --on-accent: #ffffff;
  --soft: #e1f0f2;
  --spark: #f5a524;
  --danger: #b42318;
  --danger-soft: #fbe9e7;
  --ok: #17744a;
  --ok-soft: #e2f3ea;
  --shadow: 0 1px 2px rgb(13 26 43 / .06), 0 8px 24px -8px rgb(13 26 43 / .12);
  --radius: 14px;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08111b;
    --surface: #0f1b2a;
    --surface-2: #14233a;
    --ink: #e8eef5;
    --ink-2: #9aa9bc;
    --line: #243550;
    --accent: #46c2cf;
    --accent-hover: #6fd3dd;
    --on-accent: #04222a;
    --soft: #112d38;
    --danger: #ff8b7e;
    --danger-soft: #3a1b1a;
    --ok: #5fd39b;
    --ok-soft: #12301f;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -12px rgb(0 0 0 / .6);
  }
}

:root[data-theme="dark"] {
  --bg: #08111b;
  --surface: #0f1b2a;
  --surface-2: #14233a;
  --ink: #e8eef5;
  --ink-2: #9aa9bc;
  --line: #243550;
  --accent: #46c2cf;
  --accent-hover: #6fd3dd;
  --on-accent: #04222a;
  --soft: #112d38;
  --danger: #ff8b7e;
  --danger-soft: #3a1b1a;
  --ok: #5fd39b;
  --ok-soft: #12301f;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 32px -12px rgb(0 0 0 / .6);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.5rem); font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 1rem; max-width: 62ch; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- Bühne für Anmeldeseiten ---------- */
.stage { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.stage-brand { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; }
.wordmark { display: inline-flex; align-items: center; gap: .6rem; font-weight: 750; letter-spacing: -.02em; color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.wordmark:hover { color: var(--ink); }
.wordmark svg { width: 1.6rem; height: 1.6rem; flex: none; }
.stage-main { display: grid; align-content: start; padding: clamp(1rem, 6vh, 4rem) 1.25rem 3rem; }
.panel { width: 100%; max-width: 26rem; margin-inline: auto; animation: rise .35s var(--ease) both; }
.panel.wide { max-width: 34rem; }
.panel-foot { margin-top: 2rem; display: flex; gap: 1rem; flex-wrap: wrap; font-size: .9rem; color: var(--ink-2); }
/* Weitere Anmeldewege (Föderation): klein unten rechts, der Passkey bleibt der Hauptweg */
.alt-login { margin-top: 1rem; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 1.25rem; }
.alt-login .btn.link { min-height: 3rem; font-size: .875rem; font-weight: 500; color: var(--ink-2); text-align: right; }
.alt-login .btn.link:hover { color: var(--accent); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (min-width: 56rem) {
  .stage { grid-template-rows: 1fr; grid-template-columns: minmax(20rem, 5fr) 7fr; }
  .stage-brand {
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 2rem 2.5rem; position: relative; overflow: hidden;
    background: #0a1522; color: #e8eef5; border-right: 1px solid #1b2a40;
    position: sticky; top: 0; height: 100dvh; align-self: start;
  }
  .stage-brand .wordmark, .stage-brand .wordmark:hover { color: #e8eef5; }
  .stage-brand p { color: #9fb2c8; font-size: 1.05rem; max-width: 24ch; position: relative; }
  .stage-brand .rings { position: absolute; inset: auto -35% -25% auto; width: 130%; aspect-ratio: 1; color: #46c2cf; pointer-events: none; }
  .topbar-brand { display: none; }
  .stage-right { display: grid; grid-template-rows: auto 1fr; }
  .topbar { justify-content: flex-end; }
}
@media (max-width: 55.99rem) {
  .stage-right { display: contents; }
  /* Auf dem Handy statt Markenfläche: Ringe als Hintergrund unten rechts */
  .stage::before { content: ""; position: fixed; z-index: -1; right: -30vmax; bottom: -30vmax; width: 80vmax; height: 80vmax; border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent 0 3.2rem, color-mix(in srgb, var(--accent) 22%, transparent) 3.2rem calc(3.2rem + 1px)); pointer-events: none; }
}

.rings circle { fill: none; stroke: currentColor; stroke-width: 1; opacity: .22; }
.rings circle:nth-child(1) { opacity: .5; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.6s .2s var(--ease) forwards; }
.rings .spark { fill: var(--spark); stroke: none; opacity: 1; animation: pop .4s 1.6s var(--ease) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } }
.rings .spark { transform-box: fill-box; transform-origin: center; }

/* ---------- Theme-Schalter ---------- */
.theme-toggle { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 2.5rem; height: 2.5rem; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; transition: color .15s, border-color .15s, transform .15s var(--ease); }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle .i-sun, .theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
:root:not([data-theme]) .theme-toggle .i-auto { display: block; }
:root[data-theme] .theme-toggle .i-auto { display: none; }

/* ---------- Buttons ---------- */
.btn, button.btn {
  appearance: none; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3rem; padding: .7rem 1.25rem; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  transition: background .15s, transform .15s var(--ease), box-shadow .15s, border-color .15s, color .15s;
  touch-action: manipulation;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); box-shadow: 0 6px 16px -8px var(--accent); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--ink-2); color: var(--ink); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.btn.danger.armed { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.btn.small { min-height: 2.5rem; padding: .45rem .9rem; font-size: .9rem; border-radius: 10px; }
.btn.link { background: none; border: 0; color: var(--accent); min-height: 0; padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: .18em; }
.btn.link:hover { background: none; box-shadow: none; transform: none; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"]::after { content: ""; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Passkey-Schaltfläche: Ring als Zustandsanzeige */
.btn-passkey { min-height: 3.5rem; font-size: 1.05rem; width: 100%; }
.pk-ring { width: 1.6rem; height: 1.6rem; flex: none; overflow: visible; }
.pk-ring .track { fill: none; stroke: currentColor; stroke-width: 2; opacity: .35; }
.pk-ring .arc { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 18 100; transform-origin: 12px 12px; opacity: 0; }
.pk-ring .dot { fill: currentColor; transition: transform .25s var(--ease); transform-origin: 12px 12px; }
.pk-ring .check { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; }
.btn-passkey:hover .pk-ring .dot { transform: scale(1.25); }
.btn-passkey[data-state="waiting"] .arc { opacity: 1; animation: spin 1s linear infinite; }
.btn-passkey[data-state="waiting"] { pointer-events: none; }
.btn-passkey[data-state="success"] { background: var(--ok); color: var(--surface); pointer-events: none; }
.btn-passkey[data-state="success"] .dot { transform: scale(0); }
.btn-passkey[data-state="success"] .check { animation: tick .4s .05s var(--ease) forwards; }
.btn-passkey[data-state="error"] { animation: shake .4s; }
@keyframes tick { to { stroke-dashoffset: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 1.1rem; }
.form .or { display: flex; align-items: center; gap: .75rem; margin: .4rem 0 0; max-width: none; color: var(--ink-2); font-size: .85rem; }
.form .or::before, .form .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { display: grid; gap: .35rem; }
.field > label, .field > .label { font-weight: 600; font-size: .92rem; }
.field .hint { font-size: .85rem; color: var(--ink-2); }
.input, input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"], textarea, select {
  font: inherit; color: var(--ink); background: var(--surface); width: 100%;
  min-height: 3rem; padding: .65rem .9rem; border-radius: 12px; border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 1.15rem) 1.35rem, calc(100% - .8rem) 1.35rem; background-size: .35rem .35rem; background-repeat: no-repeat; padding-right: 2.2rem; }
textarea { min-height: 5.5rem; resize: vertical; }
input:hover:not(:disabled), textarea:hover, select:hover { border-color: var(--ink-2); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
input:disabled { background: var(--surface-2); color: var(--ink-2); }
.field.invalid input { border-color: var(--danger); }
.field .err { color: var(--danger); font-size: .88rem; font-weight: 550; }
input.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .25em; text-align: center; }
.check-row { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.check-row:hover { border-color: var(--ink-2); }
.check-row:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.check-row input { margin-top: .2rem; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); flex: none; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.cols { display: grid; gap: 1rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* Schalter für Freigaben */
.switch { position: relative; display: inline-block; width: 2.75rem; height: 1.6rem; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(1.15rem); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 3px; }
.switch input:disabled + i { opacity: .45; }

/* ---------- Meldungen ---------- */
.alert { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); margin: 0 0 1.1rem; font-size: .95rem; }
.alert::before { content: ""; width: .5rem; flex: none; border-radius: 4px; background: var(--ink-2); align-self: stretch; }
.alert p { margin: 0; }
.alert.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.alert.error::before { background: var(--danger); }
.alert.success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.alert.success::before { background: var(--ok); }
.alert.info::before { background: var(--accent); }
.alert { animation: rise .3s var(--ease) both; }

/* ---------- Passkey-Liste ---------- */
.keys { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.key { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.key svg { width: 1.5rem; height: 1.5rem; color: var(--accent); flex: none; }
.key .meta { flex: 1; min-width: 0; }
.key .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key .meta span { color: var(--ink-2); font-size: .85rem; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.25rem; color: var(--ink-2); margin-bottom: 1rem; }

/* ---------- Abschnitte ---------- */
.section { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.1rem, 4vw, 1.75rem); margin: 0 0 1.25rem; box-shadow: var(--shadow); }
.section > h2 { margin-bottom: .25rem; }
.section > h2 + .form, .section > h2 + dl, .section > h2 + .row { margin-top: .9rem; }
.section > .muted:first-of-type { margin-bottom: 1.1rem; }
.tabs { display: flex; gap: .25rem; padding: .25rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 1.5rem; }
.tabs a { padding: .45rem 1rem; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--bg); }

/* ---------- Verwaltung (appaccess) ---------- */
.app-bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.app-bar-in { max-width: 72rem; margin: 0 auto; padding: .6rem 1.25rem; display: flex; align-items: center; gap: .5rem 1.25rem; flex-wrap: wrap; }
.app-nav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a { padding: .5rem .85rem; border-radius: 10px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .94rem; white-space: nowrap; transition: background .15s, color .15s; }
.app-nav a:hover { background: var(--surface-2); color: var(--ink); }
.app-nav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.app-nav .scope { align-self: center; padding: 0 .5rem; color: var(--ink-2); font-size: .9rem; white-space: nowrap; }
.app-me { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: var(--ink-2); margin-left: auto; }
.app-main { max-width: 72rem; margin: 0 auto; padding: clamp(1.25rem, 4vw, 2.5rem) 1.25rem 4rem; animation: rise .3s var(--ease) both; }
.page-head { display: flex; gap: 1rem 2rem; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); vertical-align: middle; margin-left: .35rem; white-space: nowrap; }
.badge.warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .85rem; font-weight: 650; color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
th.c, td.c { text-align: center; }
td.nowrap { white-space: nowrap; }

/* Tabellen mit Freigaben werden auf dem Handy zu Karten */
@media (max-width: 42rem) {
  .table-wrap.stack { border: 0; background: none; box-shadow: none; overflow: visible; }
  .stack table, .stack tbody, .stack tr, .stack td { display: block; }
  .stack thead { display: none; }
  .stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .25rem; margin-bottom: .75rem; }
  .stack tbody tr:hover { background: var(--surface); }
  .stack td { border: 0; padding: .4rem .9rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right; }
  .stack td::before { content: attr(data-label); color: var(--ink-2); font-size: .88rem; text-align: left; }
  .stack td.who { display: block; text-align: left; font-weight: 600; padding-top: .7rem; }
  .stack td.who::before { content: none; }
}

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0 0 1.25rem; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; }
@media (max-width: 30rem) { dl.facts { grid-template-columns: 1fr; gap: 0; } dl.facts dd { margin-bottom: .6rem; } }

.code-block { font-family: var(--mono); font-size: clamp(1.5rem, 6vw, 2.25rem); font-weight: 600; letter-spacing: .12em; background: var(--soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: var(--radius); padding: 1rem 1.25rem; text-align: center; word-break: break-all; user-select: all; }
pre.share { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; font: .9rem/1.55 var(--mono); margin: 0 0 1rem; }
.link-out { overflow-wrap: anywhere; }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.field.grow { flex: 1; min-width: 14rem; }
.field.narrow { max-width: 16rem; }
.spaced { margin-top: 1.25rem; }
.section.spaced { margin-top: 1.5rem; }
.row .field { margin: 0; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); padding: .05em .4em; border-radius: 6px; overflow-wrap: anywhere; }
td.uris span { display: block; overflow-wrap: anywhere; }
td.links { white-space: nowrap; }
td.links a { margin-right: 1rem; }
@media (max-width: 42rem) { .stack td.links { justify-content: flex-start; flex-wrap: wrap; } }

@media (max-width: 48rem) {
  .app-bar-in { padding-block: .5rem; gap: .25rem 1rem; }
  .app-nav { order: 3; flex: 1 0 100%; margin-inline: -.25rem; }
  .app-me { margin-left: auto; }
  .app-me span { display: none; }
}

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .7rem 1.1rem; border-radius: 999px; font-weight: 600; font-size: .92rem; box-shadow: var(--shadow); animation: toast 4.5s var(--ease) both; z-index: 20; max-width: calc(100vw - 2rem); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 12px); visibility: hidden; } }

.welcome-card { display: grid; gap: .75rem; margin: 1.5rem 0; }
.link-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s var(--ease), box-shadow .15s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.link-card span { flex: 1; }
.link-card strong { display: block; }
.link-card small { color: var(--ink-2); }
.link-card svg { width: 1.2rem; height: 1.2rem; color: var(--ink-2); flex: none; }
fieldset.form { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem 1rem; margin: 0; min-width: 0; }
fieldset.form legend { font-size: .85rem; font-weight: 600; color: var(--ink-2); padding: 0 .4rem; }
.launcher-title { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin: 1.75rem 0 .6rem; }
.launcher { list-style: none; padding: 0; margin: 0 -.35rem .5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .25rem; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .7rem .3rem .6rem; border-radius: var(--radius); text-decoration: none; color: var(--ink); text-align: center; transition: background .15s, transform .15s var(--ease); }
.app-tile:hover { background: var(--surface); color: var(--ink); transform: translateY(-1px); }
.app-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.app-mark { position: relative; width: 3.5rem; height: 3.5rem; border-radius: 1rem; display: grid; place-items: center; font-weight: 700; font-size: 1.35rem; color: var(--accent); background: var(--soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.app-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; background: #fff; }
.app-tile:hover .app-mark { box-shadow: var(--shadow); }
.app-name { font-size: .8rem; font-weight: 500; line-height: 1.2; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-vpn { position: absolute; right: -.35rem; bottom: -.35rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); }
.app-vpn svg { width: .75rem; height: .75rem; }
.app-vpn.inline { position: static; display: inline-grid; vertical-align: -.35rem; margin-right: .2rem; }
/* Konsole: Icons der Anwendungen */
.app-name-link { display: inline-flex; align-items: center; gap: .55rem; }
.app-icon-sm { width: 1.5rem; height: 1.5rem; border-radius: .4rem; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.icon-row { display: flex; gap: 1.25rem; align-items: flex-start; flex-wrap: wrap; }
.icon-row > div { flex: 1; min-width: 14rem; display: grid; gap: .75rem; }
.app-icon-lg { width: 4rem; height: 4rem; border-radius: 1.1rem; display: grid; place-items: center; font-weight: 700; font-size: 1.6rem; color: var(--accent); background: var(--soft); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); overflow: hidden; flex: none; }
.app-icon-lg img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.launcher-note { margin-top: .25rem; }
.big-icon { width: 4rem; height: 4rem; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--accent); margin-bottom: 1.25rem; }
.big-icon.bad { background: var(--danger-soft); color: var(--danger); }
.big-icon svg { width: 2rem; height: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rings circle:nth-child(1) { stroke-dashoffset: 0; }
  @view-transition { navigation: none; }
}
@media (forced-colors: active) {
  .btn { border-color: ButtonText; }
  .switch i { border: 1px solid ButtonText; }
}
@media print { .app-bar, .theme-toggle, .toast { display: none; } }
