/* AstroForms Designsystem – Dark UI, alle Werte als CSS-Variablen */
:root {
  color-scheme: dark;

  /* Flächen */
  --bg: #09090b;
  --bg-2: #111114;
  --surface: #151519;
  --surface-2: #1b1b21;
  --surface-3: #232329;

  /* Text */
  --text: #fafafa;
  --text-2: #a1a1aa;
  --muted: #71717a;

  /* Linien */
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --border-hover: rgba(255, 255, 255, 0.2);

  /* Akzent (Electric Violet) */
  --accent: #7c6cff;
  --accent-solid: #6a55f5;
  --accent-solid-hover: #7562f6;
  --accent-text: #aaa1ff;
  --accent-soft: rgba(124, 108, 255, 0.12);
  --accent-line: rgba(124, 108, 255, 0.38);

  /* Status */
  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.1);
  --green-line: rgba(74, 222, 128, 0.25);
  --red: #f87171;
  --red-solid: #dc2626;
  --red-solid-hover: #e53e3e;
  --red-soft: rgba(248, 113, 113, 0.1);
  --red-line: rgba(248, 113, 113, 0.28);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.1);
  --amber-line: rgba(251, 191, 36, 0.28);

  /* Typografie (Systemschriften; Inter/Geist werden genutzt, falls lokal installiert) */
  --font: "Inter", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Display", "Inter", "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.625rem;
  --fs-3xl: clamp(1.875rem, 3.4vw, 2.5rem);
  --fs-hero: clamp(2.25rem, 5vw, 3.75rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 5rem;
  --space-9: 7rem;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 64px rgba(0, 0, 0, 0.55);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --t-fast: 120ms;
  --t: 200ms;
  --t-slow: 360ms;

  --container: 1160px;
  --nav-h: 60px;
  --sidebar-w: 248px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.6;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01", "ss03";
}
::selection { background: rgba(124, 108, 255, 0.35); color: #fff; }
img, svg { max-width: 100%; display: block; }
a { color: var(--accent-text); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: #c7c1ff; }
p a:not(.btn), .prose li a, .card :is(ul, ol):not(.list-rows) li a:not(.btn), dd a { text-decoration: underline; text-decoration-color: rgba(170, 161, 255, 0.35); text-underline-offset: 3px; }
p a:not(.btn):hover, .prose li a:hover, .card :is(ul, ol):not(.list-rows) li a:not(.btn):hover, dd a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--space-3); color: var(--text); font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-3xl); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-lg); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-base); letter-spacing: -0.005em; }
p { margin: 0 0 var(--space-4); }
ul, ol { padding-left: 1.2rem; }
li { margin-bottom: 0.3rem; }
li::marker { color: var(--muted); }
code { font-family: var(--font-mono); font-size: 0.85em; background: var(--surface-2); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 4px; }
strong { font-weight: 600; color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
summary { cursor: pointer; }
.muted { color: var(--text-2); }
.subtle { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2.5rem, 720px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--bg); padding: 0.6rem 1rem; z-index: 300; border-radius: 0 0 var(--radius) 0; font-weight: 600; }
.skip-link:focus { left: 0; color: var(--bg); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.text-center { text-align: center; }
.justify-center { justify-content: center; }
.mt-2 { margin-top: var(--space-2); } .mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--space-2); } .mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; gap: var(--space-2); }
.w-auto { width: auto; }
.w-full { width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Marke ---------- */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.025em; line-height: 1; }
.brand:hover { color: var(--text); }
.brand svg { width: 24px; height: 24px; flex: none; transition: transform var(--t-slow) var(--ease); }
.brand:hover svg { transform: rotate(-6deg); }
.brand-mark-lg svg, svg.brand-mark-lg { width: 40px; height: 40px; }
.logo-node { fill: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: inherit; font-weight: 500; font-size: var(--fs-sm); line-height: 1; white-space: nowrap;
  height: 2.25rem; padding: 0 0.95rem; border-radius: var(--radius); border: 1px solid var(--btn-border);
  background: var(--btn-bg); color: var(--btn-fg);
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast);
}
.btn:hover { color: var(--btn-fg); }
.btn:active { transform: scale(0.98); }
.btn-primary { --btn-bg: var(--accent-solid); --btn-fg: #fff; --btn-border: transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 1px 2px rgba(0, 0, 0, 0.4); }
.btn-primary:hover { --btn-bg: var(--accent-solid-hover); }
.btn-secondary { --btn-bg: var(--surface-2); --btn-border: var(--border-strong); }
.btn-secondary:hover { --btn-bg: var(--surface-3); --btn-border: var(--border-hover); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: rgba(255, 255, 255, 0.06); --btn-fg: var(--text); }
.btn-light { --btn-bg: var(--text); --btn-fg: var(--bg); --btn-border: transparent; }
.btn-light:hover { --btn-bg: #e4e4e7; }
.btn-danger { --btn-bg: var(--red-soft); --btn-fg: var(--red); --btn-border: var(--red-line); }
.btn-danger:hover { --btn-bg: var(--red-solid); --btn-fg: #fff; --btn-border: transparent; }
.btn-sm { height: 2rem; padding: 0 0.75rem; font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn-lg { height: 2.75rem; padding: 0 1.35rem; font-size: var(--fs-base); }
.btn-icon { width: 2rem; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn.is-loading::after { content: ""; width: 0.9em; height: 0.9em; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn svg, .badge svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-lg svg { width: 1.15rem; height: 1.15rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.kbd { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 4px; padding: 0.05rem 0.35rem; }

/* ---------- Formularelemente (App-UI) ---------- */
.field { margin-bottom: var(--space-4); }
.field > label:not(.check), .label, .label-row label { display: block; font-weight: 500; margin-bottom: 0.4rem; font-size: var(--fs-sm); color: var(--text); }
.field .hint { color: var(--muted); font-size: var(--fs-sm); margin: 0.4rem 0 0; line-height: 1.5; }
.input, select.input, textarea.input {
  width: 100%; font: inherit; font-size: var(--fs-base); color: var(--text); background: var(--bg-2);
  height: 2.5rem; padding: 0 0.8rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.input::placeholder { color: #52525b; }
textarea.input { height: auto; min-height: 6.5rem; padding: 0.65rem 0.8rem; resize: vertical; line-height: 1.55; }
select.input {
  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='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.6rem center; background-size: 1rem;
}
select.input option { background: var(--surface-2); color: var(--text); }
.input:hover { border-color: var(--border-hover); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg); }
.input[aria-invalid="true"] { border-color: var(--red-line); }
.input[aria-invalid="true"]:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.input:disabled, .input[readonly] { background: var(--surface); color: var(--text-2); cursor: default; }
.input:disabled { cursor: not-allowed; opacity: 0.7; }
input[type="color"].input { padding: 0.3rem; cursor: pointer; }
input[type="color"].input::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].input::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type="color"].input::-moz-color-swatch { border: 0; border-radius: 4px; }
input[type="file"].input { height: auto; padding: 0.4rem; color: var(--text-2); cursor: pointer; }
input[type="file"].input::file-selector-button {
  font: inherit; font-size: var(--fs-sm); font-weight: 500; color: var(--text); background: var(--surface-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.4rem 0.75rem; margin-right: 0.75rem; cursor: pointer;
  transition: background var(--t-fast);
}
input[type="file"].input::file-selector-button:hover { background: #2c2c33; }
input[type="search"].input::-webkit-search-cancel-button { filter: invert(0.6); }
.field-error { color: var(--red); font-size: var(--fs-sm); margin: 0.4rem 0 0; display: flex; gap: 0.35rem; align-items: center; }
.field-error::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex: none; }
.check { display: flex; gap: 0.65rem; align-items: flex-start; font-weight: 400; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; line-height: 1.5; }
.check input {
  appearance: none; flex: none; margin: 0.12rem 0 0; width: 1rem; height: 1rem; border-radius: 4px;
  border: 1px solid var(--border-hover); background: var(--bg-2); cursor: pointer; display: grid; place-items: center;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check input::after { content: ""; width: 0.55rem; height: 0.55rem; transform: scale(0); transition: transform var(--t-fast) var(--ease);
  background: #fff; clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); }
.check input:checked { background: var(--accent-solid); border-color: var(--accent-solid); }
.check input:checked::after { transform: scale(1); }
.check input:disabled { opacity: 0.5; cursor: not-allowed; }
.check:hover input:not(:checked):not(:disabled) { border-color: var(--text-2); }
.check span { color: var(--text-2); }
.grid-2 { display: grid; gap: 0 var(--space-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 0 var(--space-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.input-group { position: relative; }
.input-group > svg { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); width: 1rem; height: 1rem; color: var(--muted); pointer-events: none; }
.input-group > .input { padding-left: 2.25rem; }

/* ---------- Meldungen & Badges ---------- */
.alert {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.75rem 0.95rem; border-radius: var(--radius); border: 1px solid; margin-bottom: var(--space-4);
  font-size: var(--fs-sm); line-height: 1.55; color: var(--text);
  animation: fade-down var(--t-slow) var(--ease) both;
}
.alert::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 0.5rem; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.alert > * { color: var(--text); }
.alert a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.alert ul { margin: 0.4rem 0 0; }
.alert .input { margin-top: 0.5rem; }
.alert-success { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.alert-error { background: var(--red-soft); border-color: var(--red-line); color: var(--red); }
.alert-info { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.alert-warn { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.alert-success, .alert-error, .alert-info, .alert-warn { color: inherit; }
.alert-success::before { background: var(--green); color: var(--green); }
.alert-error::before { background: var(--red); color: var(--red); }
.alert-info::before { background: var(--accent); color: var(--accent); }
.alert-warn::before { background: var(--amber); color: var(--amber); }
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem; vertical-align: middle;
  height: 1.375rem; padding: 0 0.5rem; border-radius: var(--radius-sm); font-size: var(--fs-xs); font-weight: 500; line-height: 1; white-space: nowrap;
  background: rgba(255, 255, 255, 0.05); color: var(--text-2); border: 1px solid var(--border);
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); border-color: var(--green-line); }
.badge-blue { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.badge-red { background: var(--red-soft); color: var(--red); border-color: var(--red-line); }

/* ---------- Karten, Listen, Tabellen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow); }
.card + .card, .card + .card-group, .card-group + .card { margin-top: var(--space-4); }
.card-title { font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--space-1); letter-spacing: -0.01em; }
.card-desc { color: var(--text-2); font-size: var(--fs-sm); margin: 0 0 var(--space-4); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }
.card-head > div { min-width: 0; }
.card-head > .btn, .card-head > form { flex: none; }
.card-head .card-title { margin-bottom: 0.15rem; }
.card-head .card-desc { margin: 0; }
.card-foot { margin: var(--space-5) calc(var(--space-5) * -1) calc(var(--space-5) * -1); padding: 0.85rem var(--space-5); border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: var(--space-4) var(--space-5) 0; }
.card-interactive { transition: border-color var(--t), background var(--t), transform var(--t) var(--ease); }
.card-interactive:hover { border-color: var(--border-strong); background: #17171c; }
.section-title { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 var(--space-3); }

.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; background: transparent; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-weight: 500; font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.02em; background: rgba(255, 255, 255, 0.015); white-space: nowrap; }
.table td { color: var(--text-2); }
.table td strong, .table td a strong { color: var(--text); font-weight: 500; }
.table td a { color: var(--text); }
.table td a:hover { color: var(--accent-text); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.table tr:last-child td { border-bottom: 0; }
.table .num-col { font-variant-numeric: tabular-nums; }
.table .actions-col { text-align: right; width: 1%; white-space: nowrap; }
.table .actions-col .btn-row { justify-content: flex-end; flex-wrap: nowrap; }
.table-check { color: var(--green); }
.table-dash { color: var(--muted); }
.row-title { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
.row-icon { flex: none; width: 2rem; height: 2rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); }
.row-icon svg { width: 1rem; height: 1rem; }

.empty {
  text-align: center; padding: var(--space-7) var(--space-5); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: radial-gradient(400px 160px at 50% 0%, rgba(124, 108, 255, 0.06), transparent 70%), var(--bg-2);
}
.empty-icon { width: 2.75rem; height: 2.75rem; margin: 0 auto var(--space-4); border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-2); box-shadow: var(--shadow); }
.empty-icon svg { width: 1.25rem; height: 1.25rem; }
.empty h3 { margin-bottom: var(--space-1); font-size: var(--fs-md); }
.empty p { max-width: 26rem; margin-inline: auto; font-size: var(--fs-sm); }
.empty .btn { margin-top: var(--space-2); }
.pagination { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: var(--space-4); align-items: center; justify-content: center; }
.pagination a, .pagination span { min-width: 2rem; height: 2rem; padding: 0 0.6rem; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.pagination a:hover { background: var(--surface-2); color: var(--text); }
.pagination .current { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: 0.8rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; margin: 0; }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-rows { list-style: none; margin: 0 calc(var(--space-5) * -1); padding: 0; }
.list-rows > li { margin: 0; border-top: 1px solid var(--border); }
.list-rows > li > a, .list-rows > li > .list-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0.8rem var(--space-5); color: var(--text); transition: background var(--t-fast); }
.list-rows > li > a:hover { background: rgba(255, 255, 255, 0.025); color: var(--text); }
.list-rows .meta { font-size: var(--fs-sm); color: var(--muted); }
.list-rows .chev { width: 1rem; height: 1rem; color: var(--muted); transition: transform var(--t) var(--ease), color var(--t); }
.list-rows > li > a:hover .chev { transform: translateX(2px); color: var(--text-2); }
.list-rows .row-main { display: flex; align-items: center; gap: 0.75rem; min-width: 0; flex: 1; }
.list-rows .row-text { min-width: 0; }
.list-rows .row-text strong { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-rows .row-side { display: flex; align-items: center; gap: 0.75rem; flex: none; }
.card > .list-rows:last-child { margin-bottom: calc(var(--space-5) * -1); }
.card > .list-rows:last-child > li:last-child > a { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

dl { margin: 0; }
.dl-grid { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; margin: 0 calc(var(--space-5) * -1); }
.dl-grid dt, .dl-grid dd { padding: 0.85rem var(--space-5); border-top: 1px solid var(--border); margin: 0; }
.dl-grid dt { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.dl-grid dd { color: var(--text); padding-left: 0; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.inline-form { display: inline; }
.danger-zone { border-color: var(--red-line); background: linear-gradient(180deg, rgba(248, 113, 113, 0.04), transparent 60%), var(--surface); }
.danger-zone .card-title { color: var(--red); }

/* Fortschritt */
.progress { height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 99px; overflow: hidden; margin-top: 0.75rem; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transform-origin: left; animation: grow-x 900ms var(--ease) 200ms both; }
.progress.is-full > span { background: var(--amber); }
.progress > span.w-0 { width: 0%; }
.progress > span.w-10 { width: 10%; }
.progress > span.w-20 { width: 20%; }
.progress > span.w-30 { width: 30%; }
.progress > span.w-40 { width: 40%; }
.progress > span.w-50 { width: 50%; }
.progress > span.w-60 { width: 60%; }
.progress > span.w-70 { width: 70%; }
.progress > span.w-80 { width: 80%; }
.progress > span.w-90 { width: 90%; }
.progress > span.w-100 { width: 100%; }

/* ---------- Tooltip, Dropdown, Dialog, Skeleton ---------- */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 50;
  transform: translate(-50%, 4px); opacity: 0; pointer-events: none; white-space: nowrap;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem; font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; box-shadow: var(--shadow-lg);
  transition: opacity var(--t-fast), transform var(--t-fast) var(--ease);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 350ms; }
@media (hover: none) { [data-tooltip]::after { display: none; } }

.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.menu {
  position: absolute; z-index: 60; min-width: 220px; padding: 0.3rem;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop-in var(--t) var(--ease) both;
}
.menu-up { bottom: calc(100% + 6px); left: 0; right: 0; transform-origin: bottom center; }
.menu a, .menu button { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.5rem 0.6rem; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; text-align: left; text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.menu a:hover, .menu button:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.menu svg { width: 1rem; height: 1rem; flex: none; }
.menu hr { margin: 0.3rem -0.3rem; }
.menu form { margin: 0; }
.menu-head { padding: 0.5rem 0.6rem 0.6rem; font-size: var(--fs-sm); line-height: 1.4; }
.menu-head span { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

dialog.dialog {
  width: min(100% - 2rem, 420px); padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dialog[open] { animation: dialog-in var(--t) var(--ease) both; }
dialog.dialog::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); animation: fade-in var(--t) ease both; }
.dialog-body { padding: var(--space-5) var(--space-5) var(--space-4); display: flex; gap: var(--space-4); align-items: flex-start; }
.dialog-icon { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: var(--red-soft); color: var(--red); border: 1px solid var(--red-line); }
.dialog-icon svg { width: 1.05rem; height: 1.05rem; }
.dialog h2 { font-size: var(--fs-md); margin: 0.2rem 0 0.35rem; }
.dialog p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.dialog .btn-danger { --btn-bg: var(--red-solid); --btn-fg: #fff; --btn-border: transparent; }
.dialog .btn-danger:hover { --btn-bg: var(--red-solid-hover); }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); padding: 0.85rem var(--space-5); border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); animation: shimmer 1.4s ease-in-out infinite; }

/* ---------- Website: Navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(9, 9, 11, 0.72); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--t), background var(--t); view-transition-name: site-header; }
.site-header.is-scrolled { border-color: var(--border); background: rgba(9, 9, 11, 0.86); }
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: var(--space-4); }
.nav-links { display: flex; align-items: center; gap: 0.15rem; list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: 0; }
.nav-links a { display: block; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; padding: 0.4rem 0.75rem; border-radius: var(--radius-sm); transition: color var(--t-fast), background var(--t-fast); }
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-menu { display: contents; }
.flash-wrap { padding-top: 1rem; }
.nav-toggle { display: none; place-items: center; width: 2.25rem; height: 2.25rem; background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; color: var(--text); transition: background var(--t-fast); }
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle svg { width: 18px; height: 18px; }

/* ---------- Website: Sektionen ---------- */
.section { padding: var(--space-8) 0; position: relative; }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--border); }
.section-head { max-width: 620px; margin: 0 auto var(--space-7); text-align: center; }
.section-head h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); letter-spacing: -0.03em; }
.section-head p { color: var(--text-2); font-size: var(--fs-md); margin: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); margin-bottom: var(--space-3); }
.pill { display: inline-flex; align-items: center; gap: 0.5rem; height: 1.85rem; padding: 0 0.8rem 0 0.4rem; border-radius: 99px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, 0.03); font-size: var(--fs-sm); color: var(--text-2); margin-bottom: var(--space-5); }
.pill b { font-weight: 500; font-size: var(--fs-xs); color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 99px; padding: 0.1rem 0.5rem; }

.hero { position: relative; padding: var(--space-9) 0 var(--space-8); overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px; background-position: center top;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 30%, transparent 75%); }
.hero::after { content: ""; position: absolute; z-index: -1; left: 50%; top: -260px; width: 900px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(124, 108, 255, 0.16), transparent); pointer-events: none; }
.hero-copy { max-width: 760px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: var(--fs-hero); line-height: 1.05; letter-spacing: -0.045em; margin-bottom: var(--space-5); font-weight: 600; }
.hero h1 .dim { color: var(--muted); }
.hero .lead { font-size: var(--fs-lg); color: var(--text-2); max-width: 36rem; margin: 0 auto var(--space-6); line-height: 1.6; }
.hero .btn-row { justify-content: center; }
.hero-note { margin-top: var(--space-4); font-size: var(--fs-sm); color: var(--muted); }
.hero-visual { margin-top: var(--space-8); position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: -1px; border-radius: calc(var(--radius-lg) + 4px); background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02) 40%); z-index: -1; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.feature-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.feature-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature { background: var(--bg); padding: var(--space-6) var(--space-5); position: relative; transition: background var(--t); }
.section-alt .feature { background: var(--bg-2); }
.feature:hover { background: var(--surface); }
.feature .icon { width: 2.25rem; height: 2.25rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); display: grid; place-items: center; margin-bottom: var(--space-4); transition: color var(--t), border-color var(--t); }
.feature:hover .icon { color: var(--accent-text); border-color: var(--accent-line); }
.feature .icon svg { width: 1.05rem; height: 1.05rem; }
.feature h3 { font-size: var(--fs-base); font-weight: 600; margin-bottom: var(--space-2); }
.feature p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); counter-reset: step; }
.step { position: relative; padding: var(--space-5); background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border); }
.step::before { counter-increment: step; content: "0" counter(step); display: block; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--accent-text); margin-bottom: var(--space-5); }
.step::after { content: ""; position: absolute; top: calc(var(--space-5) + 0.65rem); left: calc(var(--space-5) + 2rem); right: var(--space-5); height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.step h3 { font-size: var(--fs-md); margin-bottom: var(--space-2); }
.step p { font-size: var(--fs-sm); }

.free-box { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: var(--space-7); display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--space-6); align-items: center; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 0% 0%, rgba(124, 108, 255, 0.12), transparent 70%), var(--surface); }
.free-box h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.03em; }
.free-box p { color: var(--text-2); margin: 0; }
.free-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.free-box li { padding: 0.6rem 0 0.6rem 2rem; position: relative; border-bottom: 1px solid var(--border); margin: 0; color: var(--text); font-size: var(--fs-base); }
.free-box li:last-child { border-bottom: 0; }
.free-box li::before { content: ""; position: absolute; left: 0; top: 50%; width: 1.1rem; height: 1.1rem; transform: translateY(-50%); border-radius: 50%; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.free-box li::after { content: ""; position: absolute; left: 0.32rem; top: 50%; width: 0.45rem; height: 0.25rem; border-left: 1.5px solid var(--accent-text); border-bottom: 1.5px solid var(--accent-text); transform: translateY(-70%) rotate(-45deg); }
.cta-band { text-align: center; padding: var(--space-9) 0; position: relative; overflow: hidden; isolation: isolate; border-top: 1px solid var(--border); }
.cta-band::before { content: ""; position: absolute; z-index: -1; left: 50%; bottom: -320px; width: 900px; height: 520px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(124, 108, 255, 0.14), transparent); }
.cta-band h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.035em; }
.cta-band .brand-mark-lg { margin: 0 auto var(--space-5); }
.cta-band .btn-row { justify-content: center; }
.prose { max-width: 720px; color: var(--text-2); }
.prose h2 { margin-top: var(--space-7); font-size: var(--fs-lg); color: var(--text); }
.prose h2:first-child, .prose .draft-banner + h2 { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose strong { color: var(--text); }
.placeholder { background: var(--amber-soft); border: 1px dashed var(--amber-line); padding: 0.05rem 0.4rem; border-radius: 4px; color: var(--amber); font-weight: 500; }
.placeholder a { color: inherit; }
.draft-banner { background: var(--amber-soft); border: 1px solid var(--amber-line); color: var(--text); padding: var(--space-3) var(--space-4); border-radius: var(--radius); margin-bottom: var(--space-6); font-size: var(--fs-sm); }
.draft-banner strong { color: var(--amber); }
.page-head { padding: var(--space-8) 0 var(--space-6); position: relative; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--border); }
.page-head::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(ellipse 60% 100% at 50% 0%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 60% 100% at 50% 0%, #000 20%, transparent 70%); }
.page-head h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.04em; }
.page-head p { font-size: var(--fs-md); margin: 0; max-width: 44rem; }

/* Produktvorschau (Hero) – stilisierte Nachbildung des Editors */
.mock { background: var(--bg-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0, 0, 0, 0.5); overflow: hidden; text-align: left; }
.mock-bar { display: flex; gap: 6px; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); align-items: center; background: var(--surface); }
.mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.mock-bar span { margin: 0 auto; font-size: var(--fs-xs); color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); padding: 0.15rem 1.2rem; border-radius: var(--radius-sm); font-family: var(--font-mono); }
.mock-body { display: grid; grid-template-columns: 200px 1fr 1.1fr; min-height: 360px; }
.mock-side { border-right: 1px solid var(--border); padding: var(--space-4); font-size: var(--fs-xs); color: var(--text-2); background: var(--surface); }
.mock-side .chip { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.55rem; border-radius: var(--radius-sm); margin-bottom: 0.2rem; }
.mock-side .chip svg { width: 0.85rem; height: 0.85rem; color: var(--muted); }
.mock-canvas { padding: var(--space-4); border-right: 1px solid var(--border); display: grid; align-content: start; gap: 0.5rem; }
.mock-field { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-xs); color: var(--text); }
.mock-field i { font-style: normal; font-family: var(--font-mono); color: var(--muted); font-size: 0.68rem; }
.mock-field em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 0.68rem; }
.mock-field.active { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.mock-form { padding: var(--space-5); background: #f4f4f5; color: #18181b; display: grid; align-content: start; }
.mock-form .m-title { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; margin-bottom: 0.2rem; }
.mock-form .m-sub { font-size: 0.7rem; color: #71717a; margin-bottom: 0.9rem; }
.mock-form .m-input { height: 28px; border: 1px solid #d4d4d8; border-radius: 6px; margin-bottom: 0.65rem; background: #fff; }
.mock-form .m-input.focus { border-color: var(--accent-solid); box-shadow: 0 0 0 3px rgba(106, 85, 245, 0.2); }
.mock-form .m-label { font-size: 0.68rem; font-weight: 500; margin-bottom: 0.25rem; color: #3f3f46; }
.mock-form .m-btn { justify-self: start; background: var(--accent-solid); color: #fff; padding: 0.45rem 0.9rem; border-radius: 6px; font-size: 0.7rem; font-weight: 500; margin-top: 0.2rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-7) 0 var(--space-5); color: var(--text-2); font-size: var(--fs-sm); }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr); gap: var(--space-6); }
.footer-grid h4 { color: var(--text); font-size: var(--fs-sm); font-weight: 500; margin-bottom: var(--space-3); letter-spacing: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.55rem; }
.footer-grid li a { text-decoration: none; }
.footer-grid .brand { margin-bottom: var(--space-4); }
.footer-grid p { max-width: 22rem; color: var(--muted); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: var(--space-6); padding-top: var(--space-4); font-size: var(--fs-xs); color: var(--muted); display: flex; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.footer-bottom a { color: var(--text-2); }
.status-dot { display: inline-flex; align-items: center; gap: 0.45rem; }
.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- Auth-Seiten ---------- */
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: var(--space-7) 1.25rem; position: relative; isolation: isolate; }
.auth-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 50% 50% at 50% 40%, #000 10%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 40%, #000 10%, transparent 75%); }
.auth-card { width: min(100%, 400px); animation: fade-up var(--t-slow) var(--ease) both; }
.auth-card .auth-mark { display: grid; place-items: center; width: 3rem; height: 3rem; margin: 0 auto var(--space-5); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.auth-card .auth-mark svg { width: 26px; height: 26px; }
.auth-card h1 { font-size: var(--fs-xl); text-align: center; margin-bottom: var(--space-2); letter-spacing: -0.025em; }
.auth-card .auth-sub { text-align: center; color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--space-6); }
.auth-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); box-shadow: var(--shadow-lg); }
.auth-panel .btn { margin-top: var(--space-2); }
.auth-alt { text-align: center; font-size: var(--fs-sm); color: var(--muted); margin: var(--space-5) 0 0; }
.auth-alt a { text-decoration: none; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.label-row label { margin: 0; }
.label-row a { font-size: var(--fs-sm); color: var(--text-2); }
.label-row a:hover { color: var(--text); }

/* ---------- App-Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); position: sticky; top: 0; height: 100vh; overflow-y: auto; view-transition-name: sidebar; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; height: 2.75rem; padding: 0 0.5rem; margin-bottom: var(--space-2); }
.side-cta { margin: 0 0 var(--space-3); justify-content: flex-start; }
.side-cta .kbd { margin-left: auto; }
.side-label { font-size: 0.6875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 0 0.6rem; margin: var(--space-4) 0 var(--space-2); }
.side-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.side-nav li { margin: 0; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 0.65rem; height: 2.1rem; padding: 0 0.6rem; border-radius: var(--radius-sm); color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; transition: background var(--t-fast), color var(--t-fast); }
.side-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }
.side-nav a[aria-current="page"] { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.side-nav a[aria-current="page"]::before { content: ""; position: absolute; left: -0.75rem; top: 0.5rem; bottom: 0.5rem; width: 2px; border-radius: 0 2px 2px 0; background: var(--accent); animation: grow-y var(--t) var(--ease) both; }
.side-nav svg { width: 16px; height: 16px; flex: none; color: var(--muted); transition: color var(--t-fast); }
.side-nav a:hover svg, .side-nav a[aria-current="page"] svg { color: var(--text); }
.side-foot { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.user-btn { display: flex; align-items: center; gap: 0.65rem; width: 100%; padding: 0.45rem 0.5rem; border-radius: var(--radius); color: var(--text); transition: background var(--t-fast); }
.user-btn:hover, .dropdown[open] > .user-btn { background: rgba(255, 255, 255, 0.05); }
.user-btn .who { min-width: 0; flex: 1; line-height: 1.3; }
.user-btn .who strong { display: block; font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .who span { display: block; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.avatar { flex: none; width: 1.875rem; height: 1.875rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; color: #fff; background: linear-gradient(135deg, #7c6cff, #4f46e5); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset; }
.sidebar-backdrop { display: none; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; align-items: center; justify-content: space-between; height: 3.5rem; background: rgba(17, 17, 20, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 0 1rem; position: sticky; top: 0; z-index: 90; border-bottom: 1px solid var(--border); }
.content { padding: var(--space-6) var(--space-7) var(--space-8); width: 100%; max-width: 1240px; overflow-x: clip; view-transition-name: content; }
.content:has(.builder), .content:has(.design-layout) { max-width: 1480px; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.page-title h1 { margin: 0; font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.page-title p { margin: 0.35rem 0 0; color: var(--text-2); font-size: var(--fs-sm); }
.page-title .meta-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; color: var(--muted); font-size: var(--fs-sm); }
.crumbs { display: flex; align-items: center; gap: 0.4rem; font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--space-2); }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 0.85rem; height: 0.85rem; }

/* Seiten-Einblendung (App) */
.content > * { animation: fade-up var(--t-slow) var(--ease) both; }
.content > *:nth-child(2) { animation-delay: 40ms; }
.content > *:nth-child(3) { animation-delay: 80ms; }
.content > *:nth-child(4) { animation-delay: 120ms; }
.content > *:nth-child(5) { animation-delay: 160ms; }
.content > *:nth-child(n+6) { animation-delay: 200ms; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-bottom: var(--space-4); }
.stat { position: relative; overflow: hidden; }
.stat-head { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--space-3); }
.stat-head svg { width: 1rem; height: 1rem; color: var(--muted); }
.stat .num { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--text); line-height: 1; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.stat .num small { font-size: var(--fs-md); color: var(--muted); font-weight: 500; letter-spacing: -0.01em; margin-left: 0.15rem; }
.stat .stat-foot { font-size: var(--fs-xs); color: var(--muted); margin: var(--space-3) 0 0; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.dash-grid > * { min-width: 0; }
.dash-grid > .card + .card { margin-top: 0; }

/* Tabs (Segment-Navigation) */
.tabs { display: flex; gap: var(--space-5); border-bottom: 1px solid var(--border); margin-bottom: var(--space-6); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { position: relative; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.7rem 0.1rem; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; transition: color var(--t-fast); }
.tabs a svg { width: 15px; height: 15px; color: var(--muted); transition: color var(--t-fast); }
.tabs a:hover { color: var(--text); }
.tabs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px 2px 0 0; transform: scaleX(0); transition: transform var(--t) var(--ease); }
.tabs a[aria-current="page"] { color: var(--text); }
.tabs a[aria-current="page"] svg { color: var(--text); }
.tabs a[aria-current="page"]::after { transform: scaleX(1); }
.tabs .count { font-size: var(--fs-xs); color: var(--muted); background: rgba(255, 255, 255, 0.06); border-radius: 99px; padding: 0.05rem 0.45rem; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: var(--space-4); }
.segmented a { height: 1.85rem; padding: 0 0.8rem; display: inline-flex; align-items: center; border-radius: 5px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast); }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current="page"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border) inset; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.toolbar .segmented { margin: 0; }
.search-form { display: flex; gap: var(--space-2); align-items: center; flex: 1 1 360px; max-width: 480px; }
.search-form .input-group { flex: 1; min-width: 0; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row .input { font-family: var(--font-mono); font-size: var(--fs-sm); }

/* ---------- Builder ---------- */
.builder { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.builder > * { min-width: 0; }
.builder > .palette { grid-row: 1 / span 2; }
.builder > .inspector { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); align-items: start; }
.builder-readonly > .inspector { grid-column: 1 / -1; }
.inspector > .card + .card, .inspector > details.card { margin-top: 0; }
@media (min-width: 1440px) {
  .builder { grid-template-columns: 232px minmax(0, 1fr) 320px; }
  .builder > .palette { grid-row: auto; }
  .builder > .inspector { grid-column: auto; display: flex; flex-direction: column; gap: var(--space-4); }
}
.palette { position: sticky; top: var(--space-5); padding: var(--space-3); }
.palette-head { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 0.4rem var(--space-3); }
.palette-head h3 { font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.palette-list { display: grid; gap: 1px; }
.palette form { display: block; margin: 0; }
.palette-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 2.15rem; padding: 0.3rem 0.5rem; line-height: 1.3; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: var(--fs-sm); color: var(--text-2); cursor: pointer; text-align: left; transition: background var(--t-fast), color var(--t-fast); }
.palette-item .pi-icon { width: 1.5rem; height: 1.5rem; border-radius: 5px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none; transition: border-color var(--t-fast), color var(--t-fast); }
.palette-item .pi-icon svg { width: 0.85rem; height: 0.85rem; }
.palette-item .pi-add { margin-left: auto; width: 0.9rem; height: 0.9rem; color: var(--muted); opacity: 0; transform: translateX(-3px); transition: opacity var(--t-fast), transform var(--t-fast) var(--ease); }
.palette-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.palette-item:hover .pi-icon { border-color: var(--accent-line); color: var(--accent-text); }
.palette-item:hover .pi-add { opacity: 1; transform: none; }
.palette-item:active { transform: scale(0.99); }
.palette-foot { padding: var(--space-3) 0.4rem 0.2rem; border-top: 1px solid var(--border); margin-top: var(--space-3); }
.palette-foot .progress { margin-top: 0.45rem; height: 4px; }

.canvas { min-width: 0; }
.canvas-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.canvas-head h2 { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); margin: 0; letter-spacing: 0; font-family: var(--font); }
.field-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); counter-reset: fld; }
.field-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); transition: border-color var(--t), box-shadow var(--t), background var(--t); }
.field-card:hover { border-color: var(--border-strong); }
.field-card[open] { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.field-card:target { animation: flash-ring 1.4s var(--ease) both; }
.field-card summary { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.85rem; cursor: pointer; list-style: none; border-radius: var(--radius-lg); }
.field-card summary::-webkit-details-marker { display: none; }
.field-card .fnum { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); width: 1.4rem; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.field-card .ficon { width: 1.9rem; height: 1.9rem; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none; }
.field-card .ficon svg { width: 0.95rem; height: 0.95rem; }
.field-card[open] .ficon { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.field-card .ftext { flex: 1; min-width: 0; line-height: 1.35; }
.field-card .flabel { display: block; font-weight: 500; font-size: var(--fs-base); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-card .ftype { display: block; font-size: var(--fs-xs); color: var(--muted); }
.field-card .freq { color: var(--accent-text); margin-left: 0.15rem; }
.field-card .fchev { width: 1rem; height: 1rem; color: var(--muted); flex: none; transition: transform var(--t) var(--ease); }
.field-card[open] .fchev { transform: rotate(180deg); }
.field-card[open] summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.field-card .body { padding: var(--space-4) var(--space-5) var(--space-4); animation: fade-in var(--t-slow) var(--ease) both; }
.field-card .body .field { margin-bottom: var(--space-3); }
.field-body-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-4) calc(var(--space-5) * -1) calc(var(--space-4) * -1); padding: 0.7rem var(--space-5); border-top: 1px solid var(--border); background: rgba(255, 255, 255, 0.015); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.field-actions { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.field-actions .sep { width: 1px; height: 1.25rem; background: var(--border-strong); margin: 0 0.25rem; }
.inspector .card { padding: var(--space-4); }
.inspector .card-title { font-size: var(--fs-base); }
.inspector details.card > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; font-weight: 600; font-size: var(--fs-base); }
.inspector details.card > summary::-webkit-details-marker { display: none; }
.inspector details.card > summary svg { width: 1rem; height: 1rem; color: var(--muted); transition: transform var(--t) var(--ease); }
.inspector details.card[open] > summary svg { transform: rotate(180deg); }
.inspector details.card[open] > form { animation: fade-in var(--t-slow) var(--ease) both; }
.status-pill { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.75rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-2); margin-bottom: var(--space-4); font-size: var(--fs-sm); }
.status-pill .badge { margin-left: auto; }
.status-pill > svg { width: 1rem; height: 1rem; color: var(--muted); flex: none; }
.status-pill strong { font-weight: 500; }

/* Design-Editor */
.design-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-5); align-items: start; }
.design-section + .design-section { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.design-section > h2 { font-size: var(--fs-base); margin-bottom: var(--space-4); }
.design-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.color-grid .field { margin: 0; }
.color-field { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-2); transition: border-color var(--t-fast); }
.color-field:hover { border-color: var(--border-hover); }
.color-field input[type="color"].input { width: 2rem; height: 2rem; flex: none; padding: 0; border: 0; box-shadow: none; background: none; border-radius: 6px; }
.color-field input[type="color"].input:focus { box-shadow: var(--focus); }
.color-field label { margin: 0; font-size: var(--fs-xs); color: var(--text-2); font-weight: 500; line-height: 1.3; }
.preview-pane { position: sticky; top: var(--space-5); }
.preview-card { padding: 0; overflow: hidden; }
.preview-chrome { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); }
.preview-chrome .dots { display: flex; gap: 5px; }
.preview-chrome .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.preview-chrome .live { font-size: var(--fs-xs); color: var(--text-2); display: inline-flex; align-items: center; gap: 0.4rem; }
.preview-chrome .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); animation: pulse 2.4s ease-in-out infinite; }
.preview-stage { position: relative; }
.preview-stage.is-loading::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--surface-2); }
.preview-stage.is-loading::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent); transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite; }
.preview-frame { display: block; width: 100%; height: 600px; border: 0; background: #fff; }
.preview-note { padding: 0.65rem 0.9rem; border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--muted); margin: 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; }
.preset { border: 1px solid var(--border-strong); background: var(--bg-2); color: var(--text-2); border-radius: var(--radius); padding: 0.55rem 0.7rem; cursor: pointer; font: inherit; font-size: var(--fs-sm); display: flex; align-items: center; gap: 0.55rem; transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast); }
.preset:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); background: var(--surface-2); }
.preset.is-active { border-color: var(--accent-line); color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.preset:disabled { opacity: 0.5; cursor: not-allowed; }
.preset i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset; }
.sticky-save { position: sticky; bottom: 0; margin: var(--space-5) calc(var(--space-5) * -1) calc(var(--space-5) * -1); padding: 0.8rem var(--space-5); border-top: 1px solid var(--border); background: rgba(21, 21, 25, 0.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); z-index: 5; }

/* ---------- Seitenmodule ---------- */
.form-narrow { max-width: 640px; }
.d-block { display: block; }
.pt-0 { padding-top: 0; }
.card-group { gap: var(--space-4); margin-top: var(--space-4); }
.card-group > .card + .card { margin-top: 0; }
.builder-readonly { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1440px) { .builder-readonly { grid-template-columns: minmax(0, 1fr) 320px; } }
.settings-section { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: var(--space-6); padding: var(--space-6) 0; border-top: 1px solid var(--border); }
.page-title + .settings-section { border-top: 0; padding-top: 0; }
.settings-intro h2 { font-size: var(--fs-base); margin-bottom: var(--space-2); }
.settings-intro p { color: var(--text-2); font-size: var(--fs-sm); margin: 0; line-height: 1.55; }
.settings-section > .card + .card { margin-top: 0; }
.card-flush > .card-head { padding: var(--space-4) var(--space-5); margin: 0; align-items: center; border-bottom: 1px solid var(--border); }
.table-plain { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.card-flush .table-wrap.table-plain { border-radius: 0; }
.input-sm { height: 2rem; font-size: var(--fs-sm); }
select.input-sm { padding-right: 2rem; }
.disclosure { border-top: 1px solid var(--border); }
.disclosure > summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.85rem var(--space-5); list-style: none; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: color var(--t-fast), background var(--t-fast); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--text); background: rgba(255, 255, 255, 0.02); }
.disclosure > summary svg { width: 0.95rem; height: 0.95rem; transition: transform var(--t) var(--ease); }
.disclosure[open] > summary svg { transform: rotate(90deg); }
.disclosure[open] > .table-wrap { border-top: 1px solid var(--border); animation: fade-in var(--t-slow) var(--ease) both; }
.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.steps-list li { counter-increment: s; margin: 0; padding-top: var(--space-4); border-top: 1px solid var(--border-strong); font-size: var(--fs-sm); color: var(--text-2); position: relative; }
.steps-list li::before { content: "0" counter(s); display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent-text); margin-bottom: var(--space-2); }
.steps-list li strong { display: block; color: var(--text); font-weight: 500; margin-bottom: 0.2rem; font-size: var(--fs-base); }
.mock-label { display: block; font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
@media (max-width: 880px) {
  .settings-section { grid-template-columns: 1fr; gap: var(--space-4); }
  .steps-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) { .steps-list { grid-template-columns: 1fr; } .card-flush > .card-head { padding-inline: var(--space-4); } }

/* Inhaltsverzeichnis in Rechtstexten */
.toc { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-7); }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2; column-gap: var(--space-6); font-size: var(--fs-sm); }
.toc li { break-inside: avoid; }
.toc a { text-decoration: none; color: var(--text-2); }
.toc a:hover { color: var(--text); }
.prose h2[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.prose h3 { margin-top: var(--space-5); font-size: var(--fs-base); color: var(--text); }
.prose .table-wrap { margin: var(--space-4) 0; }
@media (max-width: 600px) { .toc ol { columns: 1; } }

/* Status-Schalter (Builder) */
.status-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); }
.status-switch form { margin: 0; }
.status-opt { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.55rem 0.25rem; border: 0; border-radius: 5px; background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-xs); font-weight: 500; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.status-opt svg { width: 1rem; height: 1rem; }
.status-opt:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.status-opt[aria-pressed="true"] { cursor: default; color: var(--text); background: var(--surface-3); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border) inset; }
.status-opt.status-published[aria-pressed="true"] { color: var(--green); }
.status-opt.status-closed[aria-pressed="true"] { color: var(--amber); }
.status-opt.is-loading::after { display: none; }
.action-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.field.logic-field > label:not(.check) { display: flex; align-items: center; gap: 0.4rem; }
.logic-field > label svg { width: 0.95rem; height: 0.95rem; color: var(--accent-text); }

/* Vorlagen beim Erstellen */
.template-picker { border: 0; padding: 0; margin: 0 0 var(--space-4); min-width: 0; }
.template-picker legend { padding: 0; }
.template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.template-opt { position: relative; display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.8rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.template-opt:hover { border-color: var(--border-hover); background: var(--surface-2); }
.template-opt input { position: absolute; opacity: 0; pointer-events: none; }
.template-opt:has(input:checked) { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface-2); }
.template-opt:has(input:focus-visible) { box-shadow: var(--focus); }
.template-opt .t-icon { flex: none; width: 2rem; height: 2rem; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border); color: var(--text-2); }
.template-opt:has(input:checked) .t-icon { color: var(--accent-text); border-color: var(--accent-line); }
.template-opt .t-icon svg { width: 1rem; height: 1rem; }
.template-opt .t-text { min-width: 0; line-height: 1.35; }
.template-opt strong { display: block; font-size: var(--fs-sm); font-weight: 500; }
.template-opt .t-text span { font-size: var(--fs-xs); color: var(--muted); }

/* Auswertung */
.day-chart, .dist { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.4rem; align-items: end; height: 170px; }
.dist { height: 110px; margin-top: var(--space-4); }
.dist .day { grid-template-rows: minmax(0, 1fr) auto; }
.day { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-width: 0; min-height: 0; text-align: center; }
.day svg { width: 100%; height: 100%; display: block; }
.day .bar { fill: var(--accent); transform-box: fill-box; transform-origin: bottom; animation: grow-y 700ms var(--ease) both; }
.day .bar-empty { fill: rgba(255, 255, 255, 0.06); }
.day-val { font-size: 0.68rem; color: var(--text-2); min-height: 1rem; font-variant-numeric: tabular-nums; }
.day-label { font-size: 0.68rem; color: var(--muted); padding-top: 0.35rem; font-variant-numeric: tabular-nums; }
.day:hover .bar { fill: var(--accent-text); }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.insight-grid > .card + .card { margin-top: 0; }
.insight-head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: var(--space-4); }
.insight-head .ficon { width: 1.9rem; height: 1.9rem; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none; }
.insight-head .ficon svg { width: 0.95rem; height: 0.95rem; }
.insight-head h3 { font-size: var(--fs-base); margin: 0 0 0.1rem; line-height: 1.35; }
.insight-head p { margin: 0; font-size: var(--fs-xs); color: var(--muted); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.bars li { margin: 0; }
.bar-label { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-sm); margin-bottom: 0.3rem; }
.bar-label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label .subtle { flex: none; font-variant-numeric: tabular-nums; }
.bar-track { width: 100%; height: 6px; display: block; }
.bar-track .track { fill: rgba(255, 255, 255, 0.06); }
.bar-track .bar { fill: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: var(--space-3); }
.kpis > div { padding: 0.7rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.kpis span { display: block; font-size: var(--fs-xs); color: var(--muted); margin-bottom: 0.2rem; }
.kpis strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis strong small { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.kpis .pos { color: var(--green); }
.kpis .neg { color: var(--red); }
.latest { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.latest li { margin: 0; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .template-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .day-chart { gap: 0.2rem; height: 140px; }
  .day-val { display: none; }
}

/* ---------- Administration ---------- */
.admin-note { display: flex; gap: 0.6rem; align-items: flex-start; margin: calc(var(--space-4) * -0.5) 0 var(--space-5); padding: 0.65rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); color: var(--text-2); font-size: var(--fs-xs); line-height: 1.55; }
.admin-note svg { width: 1rem; height: 1rem; flex: none; margin-top: 0.1rem; color: var(--accent-text); }
.admin-note strong { color: var(--text); font-weight: 500; }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.h1-like { margin: 0; font-size: var(--fs-2xl); letter-spacing: -0.03em; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-4); align-items: start; }
.stack { display: grid; gap: var(--space-4); min-width: 0; }
.stack > .card + .card { margin-top: 0; }
.pad-x { padding-inline: var(--space-5); }
.dl-compact { grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); }
.dl-compact dt, .dl-compact dd { padding-block: 0.65rem; font-size: var(--fs-sm); overflow-wrap: anywhere; }
.cell-stack { display: grid; min-width: 0; line-height: 1.35; }
.cell-stack strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.table-admin td { vertical-align: middle; }
.table-admin .row-title:hover strong { color: var(--accent-text); }
.table-admin tr.is-done td { opacity: 0.6; }
.th-sort { display: inline-flex; align-items: center; gap: 0.25rem; color: inherit; }
.th-sort:hover { color: var(--text); }
.th-sort.is-active { color: var(--text); }
.th-sort span { font-size: 0.6rem; color: var(--accent-text); }
.table .num-col .th-sort { justify-content: flex-end; }
.msg summary { cursor: pointer; color: var(--text-2); list-style: none; }
.msg summary::-webkit-details-marker { display: none; }
.msg summary:hover { color: var(--text); }
.msg[open] summary { color: var(--text); font-weight: 500; margin-bottom: 0.4rem; }
.msg-full { padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); color: var(--text); max-height: 18rem; overflow: auto; }
.action-block { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.action-block:first-of-type { border-top: 0; padding-top: 0; }
.action-block h3 { font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 var(--space-3); font-family: var(--font); }
.action-block .field { margin-bottom: var(--space-3); }
.action-block .hint { margin-top: var(--space-2); }
.attention { border-color: var(--amber-line); background: linear-gradient(180deg, rgba(251, 191, 36, 0.05), transparent 70%), var(--surface); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; }
.check-list li { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0; border-top: 1px solid var(--border); margin: 0; }
.check-list li:first-child { border-top: 0; padding-top: 0; }
.check-list li:last-child { padding-bottom: 0; }
.check-list .dot { flex: none; width: 8px; height: 8px; margin-top: 0.5rem; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05); }
.check-list .is-ok .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.check-list .is-warn .dot { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.check-list strong { display: block; font-weight: 500; font-size: var(--fs-sm); }
.check-list span:not(.dot) { display: block; font-size: var(--fs-sm); color: var(--text-2); }
@media (max-width: 1180px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .admin-split { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .stats-4 { grid-template-columns: 1fr 1fr; } .pad-x { padding-inline: var(--space-4); } .dl-compact { grid-template-columns: 1fr; } }

/* ---------- Animationen ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.97) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes flash-ring { 0% { box-shadow: 0 0 0 0 var(--accent-line); } 30% { box-shadow: 0 0 0 4px var(--accent-line); } 100% { box-shadow: 0 0 0 3px var(--accent-soft); } }
.reveal { animation: fade-up 600ms var(--ease) both; }
.reveal-2 { animation-delay: 80ms; }
.reveal-3 { animation-delay: 160ms; }
.reveal-4 { animation-delay: 260ms; }

/* Seitenübergänge (Cross-Document View Transitions, wo unterstützt) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; animation-timing-function: var(--ease); }
::view-transition-old(content) { animation: 140ms var(--ease) both vt-out; }
::view-transition-new(content) { animation: 220ms var(--ease) both vt-in; }
::view-transition-group(sidebar), ::view-transition-group(site-header) { animation: none; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .content { padding: var(--space-6) var(--space-5) var(--space-7); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) { .table .hide-md { display: none; } }
@media (max-width: 1000px) {
  .builder { grid-template-columns: 1fr; }
  .builder > .palette { grid-row: auto; }
  .builder > .inspector { grid-column: 1; }
  .palette, .preview-pane { position: static; }
  .palette-list { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.2rem; scrollbar-width: thin; }
  .palette-list form { flex: none; }
  .palette-item { border: 1px solid var(--border); padding-right: 0.7rem; }
  .palette-item .pi-add { display: none; }
  .design-layout { grid-template-columns: 1fr; }
  .preview-frame { height: 520px; }
  .feature-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mock-body { grid-template-columns: 1fr 1fr; }
  .mock-side { display: none; }
}
@media (max-width: 880px) {
  .nav-toggle { display: inline-grid; }
  .nav-menu { display: none; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: var(--space-4) 1.25rem var(--space-5); flex-direction: column; align-items: stretch; gap: var(--space-4); box-shadow: var(--shadow-lg); }
  .nav-menu.is-open { display: flex; animation: fade-down var(--t) var(--ease) both; }
  .nav-links { flex-direction: column; align-items: stretch; }
  .nav-links a { padding: 0.65rem 0.75rem; font-size: var(--fs-base); }
  .nav-actions { flex-direction: column; align-items: stretch; }
  .nav-actions .btn { height: 2.5rem; }
  .free-box, .footer-grid { grid-template-columns: 1fr; }
  .feature-grid, .steps { grid-template-columns: 1fr 1fr; }
  .free-box { padding: var(--space-6) var(--space-5); }
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .sidebar { position: fixed; z-index: 120; inset: 0 auto 0 0; width: 272px; height: 100dvh; transform: translateX(-100%); transition: transform 280ms var(--ease); box-shadow: none; view-transition-name: none; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease); }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .content { padding: var(--space-5) 1rem var(--space-7); }
  .stats { grid-template-columns: 1fr; }
  .page-title { align-items: flex-start; }
  .page-title h1 { font-size: var(--fs-xl); }
}
@media (max-width: 600px) {
  .feature-grid, .feature-grid.cols-2, .feature-grid.cols-4, .steps, .grid-2, .grid-3, .design-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: var(--space-3); }
  .stats > .stat:first-child { grid-column: 1 / -1; }
  .stat .num { font-size: 1.625rem; }
  .section { padding: var(--space-7) 0; }
  .hero { padding: var(--space-8) 0 var(--space-7); }
  .hero-visual { margin-top: var(--space-7); }
  .mock-body { grid-template-columns: 1fr; min-height: 0; }
  .mock-canvas { border-right: 0; border-bottom: 1px solid var(--border); }
  .card { padding: var(--space-4); }
  .card-foot, .sticky-save { margin-inline: calc(var(--space-4) * -1); margin-bottom: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
  .list-rows, .dl-grid { margin-inline: calc(var(--space-4) * -1); }
  .list-rows > li > a, .list-rows > li > .list-row { padding-inline: var(--space-4); }
  .card > .list-rows:last-child { margin-bottom: calc(var(--space-4) * -1); }
  .dl-grid { grid-template-columns: 1fr; }
  .dl-grid dt { padding: 0.75rem var(--space-4) 0.2rem; }
  .dl-grid dd { border-top: 0; padding: 0 var(--space-4) 0.75rem; }
  .field-card .body { padding: var(--space-4); }
  .field-body-foot { margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
  .field-card .fnum { display: none; }
  .table th, .table td { padding: 0.65rem 0.75rem; }
  .table .hide-sm { display: none; }
  .search-form { max-width: none; }
  .copy-row { flex-wrap: wrap; }
  .preview-frame { height: 480px; }
  .footer-bottom { flex-direction: column; }
  .step::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* Zwei-Faktor: Wiederherstellungscodes */
.recovery-codes { list-style: none; margin: var(--space-4) 0; padding: var(--space-4); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-5); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-md); letter-spacing: 0.04em; user-select: all; }
@media (max-width: 480px) { .recovery-codes { grid-template-columns: 1fr; } }

.qr-box { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); margin: var(--space-4) 0; }
.qr-box svg { width: 200px; height: 200px; border-radius: var(--radius); }
