/* Kiliverse – Komponenten (aus Claude Design, 2026-09-20). Benötigt tokens.css. Reines CSS.
   Responsiv über @media (max-width: 720px). */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; margin: 0; text-wrap: pretty; }
h1 { font-size: var(--fs-h1); } h2 { font-size: var(--fs-h2); } h3 { font-size: var(--fs-h3); } h4 { font-size: var(--fs-base); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
svg { display: block; flex: none; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-sm); }
.kicker { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* — Layout — */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: var(--sp-8) var(--sp-6) var(--sp-12); display: grid; gap: var(--sp-8); align-content: start; flex: 1; }
.hr { height: 2px; border: 0; margin: 0; background: var(--divider); }
.stack { display: grid; gap: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.between { display: flex; gap: var(--sp-3); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--sp-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { display: grid; gap: var(--sp-5); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-head { display: flex; flex-direction: column; gap: var(--sp-1); padding-bottom: var(--sp-4); border-bottom: 2px solid var(--divider); }
.section-head.head-row { flex-direction: row; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font-weight: 800; font-size: 24px; flex: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }

/* — Kopfzeile — */
.nav { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 2px solid var(--divider); }
.nav-inner { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-6); min-height: var(--nav-h); display: flex; align-items: center; gap: var(--sp-6); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 15px; font-weight: 800; }
.nav-links { display: flex; gap: var(--sp-1); flex: 1; align-items: center; }
.nav-sep { width: 2px; height: 28px; background: var(--border); margin: 0 6px; }
.nav-link { text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--fs-base); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-link.admin { color: var(--text-muted); }
.nav-right { display: flex; align-items: center; gap: var(--sp-3); margin-left: auto; }
.nav-user { font-weight: 600; }
.nav .burger { display: none; }
.nav-mobile { display: none; }
.nav-mobile hr { margin: 8px 0; }
@media (max-width: 720px) {
  .nav-inner { gap: var(--sp-3); padding: 0 var(--sp-4); }
  .nav-links, .nav-user, .nav-right .btn-logout { display: none; }
  .nav .burger { display: inline-flex; }
  .nav-mobile[data-open="true"] { display: grid; gap: var(--sp-1); padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 2px solid var(--divider); background: var(--surface); }
  .nav-mobile .nav-link { display: block; padding: var(--sp-3); font-size: var(--fs-lg); }
  .nav-mobile .btn { margin-top: var(--sp-2); }
  .container { padding: var(--sp-6) var(--sp-4) var(--sp-10); gap: var(--sp-6); }
  .grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .btn:not(.btn-icon):not(.btn-inline) { width: 100%; }
  .card-actions { flex-direction: column; }
  h1 { font-size: 28px; } h2 { font-size: 22px; }
}
@media (min-width: 721px) and (max-width: 1040px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* — Buttons — */
.btn { display: inline-flex; align-items: center; justify-content: flex-start; gap: var(--sp-2); cursor: pointer; text-decoration: none; font-family: inherit; font-weight: 600; font-size: var(--fs-base); line-height: 1.2; color: var(--text); background: transparent; border: 2px solid transparent; padding: 10px var(--sp-4); min-height: 44px; border-radius: var(--r-md); text-align: left; transition: background .12s; }
.btn:hover { color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary, .btn-primary:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-active); border-color: var(--accent-active); }
.btn-secondary { border-color: var(--border); background: var(--surface); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-secondary:active { background: var(--border); }
.btn-ghost, .btn-ghost:hover { color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-danger, .btn-danger:hover { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-danger.solid, .btn-danger.solid:hover { background: var(--danger); color: #fff; }
.btn-danger.solid:hover { background: var(--danger-hover); }
.btn-sm { min-height: 36px; padding: 6px var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-icon { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: var(--r-md); border-color: var(--border); background: var(--surface); }
.btn-icon:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-xl { min-height: 56px; font-size: var(--fs-lg); padding: 14px var(--sp-5); }

/* — Tags / Chips — */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); white-space: nowrap; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.tag-neutral::before { display: none; }
.tag-ok { background: var(--ok-bg); color: var(--ok-text); } .tag-ok::before { background: var(--ok-dot); }
.tag-warn { background: var(--warn-bg); color: var(--warn-text); } .tag-warn::before { background: var(--warn-dot); }
.tag-bad { background: var(--bad-bg); color: var(--bad-text); } .tag-bad::before { background: var(--bad-dot); }
.tag-accent { background: var(--accent-soft); color: var(--accent-text); } .tag-accent::before { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: var(--r-pill); border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: var(--fs-sm); text-decoration: none; cursor: pointer; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* — Karten — */
.card { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); border: 1px solid var(--border); }
.card-muted { background: var(--surface-2); box-shadow: none; }
.card-row { flex-direction: row; align-items: center; flex-wrap: wrap; gap: var(--sp-4); }
.card-actions { display: flex; gap: var(--sp-3); margin-top: auto; }
.card-title { font-size: var(--fs-h3); font-weight: 800; }
.card h2.h3, .h3 { font-size: var(--fs-h3); }
.svc-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; font-size: 26px; }
.svc-icon svg { width: 28px; height: 28px; }
.svc-icon.sm { width: 40px; height: 40px; font-size: 18px; } .svc-icon.sm svg { width: 20px; height: 20px; }
.svc-icon.dim { opacity: .6; }
.inline-list { display: grid; gap: var(--sp-2); padding: 0; margin: 0; list-style: none; }
.sub-item { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); }

/* — Formulare — */
.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-size: var(--fs-sm); font-weight: 600; }
.hint { font-size: var(--fs-sm); color: var(--text-muted); }
.input, .select, .textarea { width: 100%; font: inherit; font-size: var(--fs-base); color: var(--text); background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-md); padding: 10px var(--sp-3); min-height: 44px; }
.select { appearance: auto; }
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-muted); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { border-color: var(--accent); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input-sm { min-height: 36px; padding: 6px var(--sp-2); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.error { font-size: var(--fs-sm); color: var(--danger); font-weight: 600; }
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.prefix-input { display: flex; align-items: center; gap: 8px; }
.prefix-input .muted { white-space: nowrap; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.seg { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
.seg-opt { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 2px solid var(--border); border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; background: var(--surface); }
.seg-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.seg-opt input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* — Flash — */
.flash { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r-md); border: 2px solid; font-weight: 600; word-break: break-word; }
.flash svg { width: 22px; height: 22px; margin-top: 1px; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-dot); }
.flash-bad { background: var(--bad-bg); color: var(--bad-text); border-color: var(--bad-dot); }
.flash-warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-dot); }
.flash .close { margin-left: auto; background: none; border: 0; color: inherit; cursor: pointer; padding: 0; display: grid; place-items: center; width: 24px; height: 24px; flex: none; }

/* — Tabelle (Desktop) / Karten-Liste (Mobil) — */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th { text-align: left; font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: var(--sp-3) var(--sp-3); border-bottom: 2px solid var(--divider); white-space: nowrap; }
.table td { padding: var(--sp-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .actions { display: flex; gap: var(--sp-2); justify-content: flex-end; white-space: nowrap; flex-wrap: wrap; }
.table .actions form { display: inline; }
.table td[data-label]::before { display: none; }
.table a.strong { font-weight: 800; text-decoration: none; }
@media (max-width: 720px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); box-shadow: var(--shadow-sm); }
  .table td { border: 0; padding: 6px 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--sp-3); align-items: center; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
  .table td.ellipsis { max-width: none; white-space: normal; overflow: visible; word-break: break-all; }
  .table td.no-label { grid-template-columns: minmax(0, 1fr); }
  .table .actions { justify-content: flex-start; padding-top: var(--sp-2); }
  .table .actions .btn { width: auto; }
}

/* — Dialog (natives <dialog>) — */
dialog.dialog { background: var(--surface); color: var(--text); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: min(100%, 520px); max-height: calc(100vh - 32px); overflow: auto; padding: var(--sp-6); margin: auto; }
dialog.dialog::backdrop { background: rgba(20,20,20,.55); }
dialog.dialog > form, dialog.dialog > .dialog-body { display: grid; gap: var(--sp-5); }
.dialog-title { font-size: var(--fs-h3); font-weight: 800; }
.dialog-actions { display: flex; gap: var(--sp-3); justify-content: flex-start; flex-wrap: wrap; border-top: 2px solid var(--divider); padding-top: var(--sp-4); }
.qr-box { display: grid; place-items: center; padding: 24px; background: #fff; border-radius: var(--r-md); border: 1px solid var(--border); }
.qr-box img { width: 220px; max-width: 100%; height: auto; }
@media (max-width: 720px) { .dialog-actions { flex-direction: column; } dialog.dialog { padding: var(--sp-5); } }

/* — Theme-Umschalter — */
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

/* — Listen — */
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; display: grid; gap: var(--sp-2); }
.steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: var(--fs-sm); display: grid; place-items: center; }
.bullets { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.kv-list { display: grid; margin: 0; }
.kv-list > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.kv-list > div:last-child { border-bottom: 0; }
.kv-list dt { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; margin: 0; }
.kv-list dd { margin: 0; }

/* — Hilfe — */
.help-section { scroll-margin-top: 140px; }
.help-section .help-cols { display: grid; gap: var(--sp-6); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help-section .help-cols.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.help-section h3 { font-size: var(--fs-base); margin-bottom: 6px; }
.help-section .help-cols p, .help-section .help-cols li { color: var(--text-muted); overflow-wrap: anywhere; }
.help-section kbd { white-space: normal; }
.help-section .help-cols strong, .help-section .help-cols kbd, .help-section .help-cols a { color: var(--text); }
.help-section .help-cols a { color: var(--accent-text); }
.help-toc { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 10; padding: 8px 0; background: var(--bg); }
@media (max-width: 720px) { .help-section .help-cols, .help-section .help-cols.cols-2 { grid-template-columns: minmax(0, 1fr); } .help-toc { position: static; } }

/* — Login / Gast — */
.guest-top { display: flex; justify-content: flex-end; padding: 16px 24px; }
.guest-main { display: grid; place-items: center; padding: 24px 16px; flex: 1; }
.guest-card { width: min(100%, 440px); padding: 40px 32px; gap: 24px; box-shadow: var(--shadow-md); }
.brand-lg { display: flex; align-items: center; gap: 12px; }
.brand-lg .brand-mark { width: 44px; height: 44px; font-size: 24px; border-radius: var(--r-md); }
.brand-lg span:last-child { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.footer { padding: 16px 24px; display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-muted); font-size: var(--fs-sm); }
