/* ==========================================================================
   Homelab Console — Design-System
   Ruhige, monochrome Basis · ein Akzent · Status-Farben nur mit Bedeutung
   Spacing-Raster: 4 / 8 / 12 / 16 / 24 / 32 / 48
   ========================================================================== */

@font-face { font-family: "Geist"; src: url("/static/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-fast: 140ms; --t: 240ms; --t-slow: 480ms;

  --sidebar-w: 248px;
  --header-h: 72px;
  --rail-w: 320px;

  color-scheme: light;
  --bg: #f5f5f3;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(79, 95, 232, .06), transparent 60%);
  --surface: #ffffff;
  --surface-2: #fafaf9;
  --surface-3: #f1f1ef;
  --hover: rgba(18, 20, 24, .04);
  --active: rgba(18, 20, 24, .07);
  --border: rgba(18, 20, 24, .08);
  --border-strong: rgba(18, 20, 24, .14);
  --text: #15171a;
  --text-2: #4a4f57;
  --muted: #7a7f88;
  --faint: #a7abb2;
  --accent: #4f5fe8;
  --accent-soft: rgba(79, 95, 232, .10);
  --accent-text: #3542c9;
  --on-accent: #fff;
  --ok: #1f9d6c;       --ok-soft: rgba(31, 157, 108, .11);
  --warn: #d9822b;     --warn-soft: rgba(217, 130, 43, .13);
  --err: #d9433f;      --err-soft: rgba(217, 67, 63, .11);
  --info: #3b82c4;     --info-soft: rgba(59, 130, 196, .11);
  --c1: #4f5fe8; --c2: #11968e; --c3: #c77a1c; --c4: #d14f76; --c5: #7a8391;
  --shadow-sm: 0 1px 2px rgba(16, 18, 22, .04), 0 1px 1px rgba(16, 18, 22, .03);
  --shadow: 0 1px 2px rgba(16, 18, 22, .04), 0 8px 24px -8px rgba(16, 18, 22, .08);
  --shadow-lg: 0 2px 6px rgba(16, 18, 22, .05), 0 24px 64px -16px rgba(16, 18, 22, .18);
  --glass: rgba(255, 255, 255, .72);
  --scrim: rgba(20, 22, 26, .28);
  /* Pastell-Töne für Website-Kacheln */
  --tint-rose: #fbe7ea; --tint-peach: #fdeadb; --tint-butter: #fcf4d6; --tint-mint: #e0f5ea;
  --tint-sage: #e8efe0; --tint-sky: #e0eefb; --tint-lavender: #e8e8fb; --tint-lilac: #f1e6f8;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0e;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(123, 140, 255, .07), transparent 60%);
  --surface: #121418;
  --surface-2: #15181c;
  --surface-3: #1b1e23;
  --hover: rgba(255, 255, 255, .04);
  --active: rgba(255, 255, 255, .07);
  --border: rgba(255, 255, 255, .07);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #eceef0;
  --text-2: #b9bdc4;
  --muted: #868b94;
  --faint: #595e67;
  --accent: #8394ff;
  --accent-soft: rgba(131, 148, 255, .13);
  --accent-text: #a4b0ff;
  --on-accent: #0b0c0e;
  --ok: #3fc48e;       --ok-soft: rgba(63, 196, 142, .12);
  --warn: #f0a44f;     --warn-soft: rgba(240, 164, 79, .13);
  --err: #f16a64;      --err-soft: rgba(241, 106, 100, .13);
  --info: #6aaef0;     --info-soft: rgba(106, 174, 240, .12);
  --c1: #7384f5; --c2: #22a399; --c3: #c2822e; --c4: #d9658a; --c5: #8e96a3;
  --tint-rose: #2a1c21; --tint-peach: #2b2119; --tint-butter: #28251a; --tint-mint: #182a22;
  --tint-sage: #1f261b; --tint-sky: #18222e; --tint-lavender: #1f1f30; --tint-lilac: #251c2d;
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .02) inset;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 32px 80px -16px rgba(0, 0, 0, .75);
  --glass: rgba(20, 22, 26, .72);
  --scrim: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; letter-spacing: -0.006em;
  color: var(--text); background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.i { flex: none; display: block; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .err { color: var(--err); }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Scrollbars — schmal und unaufdringlich */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   Shell
   ========================================================================== */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.shell.rail-open { grid-template-columns: var(--sidebar-w) 1fr var(--rail-w); }

/* Seitenleiste */
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 55%, transparent);
  backdrop-filter: blur(20px) saturate(1.2); z-index: 40;
}
.brand { display: flex; align-items: center; gap: var(--s3); height: var(--header-h); padding: 0 var(--s5); flex: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; position: relative;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 600; letter-spacing: -0.02em; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--muted); margin-top: -2px; }

.nav { flex: 1; overflow-y: auto; padding: var(--s2) var(--s3) var(--s4); }
.nav-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: var(--s4) var(--s3) var(--s2); }
.nav a {
  position: relative; display: flex; align-items: center; gap: var(--s3); height: 38px; padding: 0 var(--s3);
  border-radius: 10px; color: var(--text-2); font-weight: 450; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--active); color: var(--text); font-weight: 520; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
  animation: navbar-in var(--t) var(--ease-spring);
}
@keyframes navbar-in { from { transform: scaleY(0); } }
.nav a .i { color: var(--muted); transition: color var(--t-fast); }
.nav a:hover .i, .nav a.active .i { color: var(--text); }
.nav a .badge { margin-left: auto; }
.nav a kbd { margin-left: auto; opacity: 0; transition: opacity var(--t-fast); }
.nav a:hover kbd { opacity: 1; }

.sidebar-foot { padding: var(--s3); border-top: 1px solid var(--border); display: grid; gap: var(--s2); flex: none; }

/* Theme-Schalter (Segmented) */
.theme-switch { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 11px; background: var(--surface-3); position: relative; }
.theme-switch button { position: relative; z-index: 1; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); transition: color var(--t-fast); }
.theme-switch button[aria-pressed="true"] { color: var(--text); }
.theme-switch .thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); transition: transform var(--t) var(--ease-spring); }

.me { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: 10px; transition: background var(--t-fast); width: 100%; text-align: left; }
.me:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; flex: none; }
.me-name { font-weight: 520; font-size: 13px; line-height: 1.2; }
.me-role { font-size: 11.5px; color: var(--muted); }

/* Hauptbereich */
.main { min-width: 0; display: flex; flex-direction: column; container-type: inline-size; container-name: main; }
.header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s6); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid transparent; transition: border-color var(--t);
}
.header.scrolled { border-bottom-color: var(--border); }
.greeting { min-width: 0; }
.greeting h1 { margin: 0; font-size: 19px; font-weight: 560; letter-spacing: -0.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.greeting p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-spacer { flex: 1; }
.clock { text-align: right; line-height: 1.15; }
.clock .t { font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.clock .t .sec { color: var(--faint); }
.clock .d { font-size: 11.5px; color: var(--muted); }
.header .hamburger { display: none; }

.content { padding: var(--s5) var(--s6) var(--s7); flex: 1; min-width: 0; }
.page-enter { animation: page-in var(--t-slow) var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); filter: blur(2px); } }

.page-head { display: flex; align-items: flex-end; gap: var(--s4); margin: var(--s2) 0 var(--s5); flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 26px; font-weight: 580; letter-spacing: -0.035em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* Rechte Leiste */
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-left: 1px solid var(--border); padding: var(--s5) var(--s5) var(--s6); display: none; flex-direction: column; gap: var(--s5); background: color-mix(in srgb, var(--surface) 40%, transparent); }
.shell.rail-open .rail { display: flex; animation: rail-in var(--t-slow) var(--ease); }
@keyframes rail-in { from { opacity: 0; transform: translateX(16px); } }
.rail h3 { font-size: 12px; font-weight: 550; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 var(--s3); display: flex; align-items: center; gap: var(--s2); }
.rail h3 .btn { margin-left: auto; }

/* ==========================================================================
   Buttons & Formulare
   ========================================================================== */
.btn {
  --bh: 36px; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: var(--bh); padding: 0 14px;
  border-radius: 10px; font-weight: 520; font-size: 13.5px; white-space: nowrap; user-select: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 22%, transparent); }
.btn:active { transform: scale(.97); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
.btn.danger { background: var(--err); color: #fff; border-color: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--err) 88%, #000); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { --bh: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { --bh: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 6px; }
.btn.icon { width: var(--bh); padding: 0; }
.btn.lg { --bh: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }
.btn .spin { animation: spin 0.9s linear infinite; }
.btn.loading { pointer-events: none; }
.btn.loading > :not(.btn-loader) { opacity: 0; }
.btn .btn-loader { position: absolute; }
.btn { position: relative; }
.btn.pop { animation: pop 380ms var(--ease-spring); }
@keyframes pop { 40% { transform: scale(.94); } }
@keyframes spin { to { transform: rotate(360deg); } }

kbd { font-family: var(--mono); font-size: 10.5px; padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--muted); background: var(--surface); line-height: 16px; }

/* Refresh-Scan-Button */
.scan-btn { --bh: 40px; padding: 0 16px 0 12px; gap: 10px; border-radius: 12px; }
.scan-btn .ring { width: 20px; height: 20px; position: relative; }
.scan-btn .ring svg { position: absolute; inset: 0; }
.scan-btn .ring .arc, .scan-btn .ring .track-c { opacity: 0; transition: opacity var(--t); }
.scan-btn .ring .ico { position: absolute; inset: 1px; transition: opacity var(--t), transform var(--t-slow) var(--ease-spring); }
.scan-btn:hover .ring .ico { transform: rotate(90deg); }
.scan-btn.scanning .ring .ico { opacity: 0; }
.scan-btn.scanning .ring .arc, .scan-btn.scanning .ring .track-c { opacity: 1; }
.scan-btn.scanning .ring .arc { animation: spin 0.8s linear infinite; transform-origin: 50% 50%; }
.scan-btn .meta { font-size: 11.5px; color: var(--muted); font-weight: 450; border-left: 1px solid var(--border); padding-left: 10px; margin-left: 2px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 520; color: var(--text-2); }
.field small { color: var(--muted); font-size: 12px; }
.input, .select, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong);
  outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid { border-color: var(--err); box-shadow: 0 0 0 4px var(--err-soft); animation: shake 380ms var(--ease); }
.input.valid { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.input::placeholder { color: var(--faint); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23888' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .i.lead { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.input-group .input { padding-left: 36px; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* Switch */
.switch { --w: 38px; --h: 22px; position: relative; width: var(--w); height: var(--h); flex: none; border-radius: 99px; background: var(--border-strong); transition: background var(--t) var(--ease); cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(var(--h) - 6px); height: calc(var(--h) - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t) var(--ease-spring), width var(--t-fast) var(--ease); }
.switch:active::after { width: calc(var(--h) - 2px); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(calc(var(--w) - var(--h))); }
.switch[aria-checked="true"]:active::after { transform: translateX(calc(var(--w) - var(--h) - 4px)); }
.switch.busy { opacity: .6; pointer-events: none; }
.switch.busy::after { animation: pulse 900ms ease-in-out infinite; }
.switch[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* Chips, Badges, Status */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 520; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; position: relative; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.dot.live::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--ok); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
.dot.err.live::after { color: var(--err); }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 80%, 100% { transform: scale(1.8); opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
.lock { color: var(--warn); display: inline-flex; }

/* Tabs / Segmented */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-3); }
.tabs button { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

/* ==========================================================================
   Karten & Widgets
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: var(--s5); }
.card h3 { margin: 0; font-size: 14px; font-weight: 560; letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); grid-auto-flow: row dense; align-items: stretch; }
.w { grid-column: span 3; min-height: 196px; }
.w[data-size="m"] { grid-column: span 6; }
.w[data-size="l"] { grid-column: span 9; }
.w[data-size="xl"] { grid-column: span 12; }
@container main (max-width: 1180px) {
  .w { grid-column: span 4; } .w[data-size="m"] { grid-column: span 8; } .w[data-size="l"], .w[data-size="xl"] { grid-column: span 12; }
}
@container main (max-width: 900px) {
  .w { grid-column: span 6; } .w[data-size="m"], .w[data-size="l"], .w[data-size="xl"] { grid-column: span 12; }
}
@container main (max-width: 560px) {
  .w, .w[data-size] { grid-column: span 12; }
}

.w {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; isolation: isolate;
  transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease), opacity var(--t);
  animation: w-in var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms);
}
@keyframes w-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.w:hover { border-color: var(--border-strong); }
.w-head { display: flex; align-items: center; gap: var(--s2); padding: 14px 16px 0 18px; height: 44px; flex: none; }
.w-head .i { color: var(--muted); }
.w-title { font-size: 12.5px; font-weight: 540; color: var(--text-2); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-actions { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.w:hover .w-actions, .w:focus-within .w-actions, .editing .w-actions { opacity: 1; }
.w-body { padding: 10px 18px 18px; flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.w-foot { margin-top: auto; padding-top: var(--s3); display: flex; align-items: center; gap: var(--s2); font-size: 12px; color: var(--muted); }
.w-foot a:hover { color: var(--text); }
.w.changed::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
  box-shadow: inset 0 0 0 1.5px var(--accent); opacity: 0; animation: changed 1.6s var(--ease);
}
@keyframes changed { 15% { opacity: .9; } 100% { opacity: 0; } }
.w .changed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity var(--t); }
.w.changed .changed-dot { opacity: 1; }
.w-error { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; color: var(--muted); font-size: 12.5px; }
.w-error strong { color: var(--text-2); font-weight: 520; }

/* Bearbeitungsmodus */
.editing .w { cursor: grab; }
.editing .w:active { cursor: grabbing; }
.editing .w::before { content: ""; position: absolute; inset: 0; border: 1.5px dashed var(--border-strong); border-radius: inherit; pointer-events: none; z-index: 4; }
.editing .w.hidden-w { opacity: .42; }
.editing .w-body { pointer-events: none; }
.w.dragging { opacity: .0; }
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; box-shadow: var(--shadow-lg); transform: rotate(1.2deg) scale(1.02); border-color: var(--accent) !important; transition: none !important; animation: none !important; }
.drop-slot { border: 1.5px dashed var(--accent); background: var(--accent-soft); border-radius: var(--r-lg); animation: none; }
.w-resize { position: absolute; right: 4px; bottom: 4px; width: 18px; height: 18px; cursor: ew-resize; color: var(--faint); display: none; z-index: 6; }
.editing .w-resize { display: grid; place-items: center; }
.w-resize:hover { color: var(--accent); }

/* Metrik-Darstellungen */
.metric { display: flex; align-items: baseline; gap: 6px; }
.metric .v { font-size: 34px; font-weight: 500; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric .u { font-size: 14px; color: var(--muted); font-weight: 450; }
.metric.sm .v { font-size: 22px; letter-spacing: -0.035em; }
.sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--text); width: 0; transition: width 900ms var(--ease); }
.bar.ok > i { background: var(--ok); } .bar.warn > i { background: var(--warn); } .bar.err > i { background: var(--err); } .bar.accent > i { background: var(--accent); }
.bar.thin { height: 4px; }
.gauge-wrap { display: flex; align-items: center; gap: var(--s4); }
.gauge { position: relative; flex: none; }
.gauge svg { display: block; transform: rotate(-90deg); }
.gauge .track { stroke: var(--surface-3); }
.gauge .val { transition: stroke-dashoffset 1000ms var(--ease), stroke var(--t); }
.gauge .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }

/* Listen */
.list { display: flex; flex-direction: column; margin: 0 -8px; }
.row { display: flex; align-items: center; gap: var(--s3); padding: 8px; border-radius: 9px; min-height: 40px; transition: background var(--t-fast); }
.row:hover { background: var(--hover); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .right { margin-left: auto; display: flex; align-items: center; gap: var(--s2); flex: none; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; margin-right: -10px; padding-right: 10px; mask-image: linear-gradient(to bottom, #000 calc(100% - 20px), transparent); }
.w .scroll { max-height: 300px; }
.w[data-size="l"] .scroll, .w[data-size="xl"] .scroll { max-height: 380px; }

.log { font-family: var(--mono); font-size: 12px; line-height: 1.55; letter-spacing: -0.01em; }
.log-line { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; padding: 5px 8px; border-radius: 7px; align-items: baseline; cursor: default; }
.log-line:hover { background: var(--hover); }
.log-line .t { color: var(--faint); white-space: nowrap; }
.log-line .src { color: var(--muted); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line .msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.log-line.expanded .msg { white-space: pre-wrap; word-break: break-word; }
.log-line.error { box-shadow: inset 2px 0 0 var(--err); } .log-line.error .msg { color: var(--err); }
.log-line.warning { box-shadow: inset 2px 0 0 var(--warn); } .log-line.warning .msg { color: var(--warn); }
.log-line.debug .msg { color: var(--faint); }

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.table td.num { white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 2px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: var(--s6) var(--s4); color: var(--muted); font-size: 13px; }
.empty .i { color: var(--faint); }
.empty strong { color: var(--text-2); font-weight: 540; }

/* Skeleton */
.sk { background: linear-gradient(90deg, var(--surface-3) 0%, color-mix(in srgb, var(--surface-3) 40%, var(--surface)) 50%, var(--surface-3) 100%); background-size: 200% 100%; border-radius: 6px; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* Charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--faint); font-size: 10.5px; font-family: var(--mono); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1100ms var(--ease) forwards; }
.chart .fade { opacity: 0; animation: fadein 900ms var(--ease) 250ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadein { to { opacity: .1; } }
.chart .cursor { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .pt { stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; z-index: 10; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--border-strong); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); transition: opacity var(--t-fast); }
.tip .tt { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.tip .tv { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tip .sw { width: 8px; height: 8px; border-radius: 2px; }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }
.spark { display: block; overflow: visible; }

/* ==========================================================================
   Overlays: Modal, Menü, Toast, Command-Palette
   ========================================================================== */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); z-index: 90; animation: fade var(--t) var(--ease); }
.scrim.out { animation: fade var(--t-fast) var(--ease) reverse forwards; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: fixed; left: 50%; top: 50%; z-index: 91; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%); animation: modal-in var(--t-slow) var(--ease-spring);
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }
.modal.out { animation: modal-out var(--t-fast) var(--ease) forwards; }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@keyframes modal-out { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s5) 0; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 580; letter-spacing: -0.02em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: var(--s5); overflow-y: auto; display: grid; gap: var(--s4); }
.modal-foot { display: flex; gap: var(--s2); justify-content: flex-end; padding: var(--s4) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-3); }
.modal-icon.err { background: var(--err-soft); color: var(--err); }
.modal-icon.warn { background: var(--warn-soft); color: var(--warn); }
.protect-banner { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: 12px; background: var(--warn-soft); color: var(--text); font-size: 13px; }
.protect-banner .i { color: var(--warn); margin-top: 1px; }
.pin-input { display: flex; gap: 8px; justify-content: center; }
.pin-input input { width: 44px; height: 52px; text-align: center; font-family: var(--mono); font-size: 20px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); outline: none; transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.pin-input input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); transform: translateY(-1px); }
.pin-input.invalid input { border-color: var(--err); animation: shake 380ms var(--ease); }

.menu { position: fixed; z-index: 95; min-width: 200px; padding: 5px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); transform-origin: var(--origin, top right); animation: menu-in 200ms var(--ease-spring); }
@keyframes menu-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.menu.out { animation: menu-in 120ms var(--ease) reverse forwards; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; font-size: 13px; color: var(--text-2); text-align: left; }
.menu button:hover, .menu a:hover, .menu .focus { background: var(--hover); color: var(--text); }
.menu .danger { color: var(--err); }
.menu .danger:hover { background: var(--err-soft); color: var(--err); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.menu .label { padding: 6px 10px 4px; font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column-reverse; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); animation: toast-in var(--t-slow) var(--ease-spring); touch-action: pan-y; user-select: none; position: relative; overflow: hidden; }
.toast.out { animation: toast-out 260ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(var(--dx, 60px)); } }
.toast .ti { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); }
.toast.ok .ti { background: var(--ok-soft); color: var(--ok); } .toast.err .ti { background: var(--err-soft); color: var(--err); } .toast.warn .ti { background: var(--warn-soft); color: var(--warn); }
.toast .tb { flex: 1; min-width: 0; font-size: 13px; }
.toast .tb strong { display: block; font-weight: 550; }
.toast .tb span { color: var(--muted); display: block; word-break: break-word; }
.toast .progress { position: absolute; left: 0; bottom: 0; height: 2px; background: currentColor; opacity: .25; animation: toast-life linear forwards; }
@keyframes toast-life { from { width: 100%; } to { width: 0; } }

.palette { position: fixed; left: 50%; top: 14vh; z-index: 110; width: min(620px, calc(100vw - 32px)); transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: palette-in 260ms var(--ease-spring); }
@keyframes palette-in { from { opacity: 0; transform: translateX(-50%) scale(.97) translateY(-6px); } }
.palette input { width: 100%; height: 56px; border: 0; outline: 0; background: transparent; padding: 0 20px 0 50px; font-size: 16px; }
.palette .pi { position: absolute; left: 18px; top: 19px; color: var(--muted); }
.palette .results { max-height: 380px; overflow-y: auto; border-top: 1px solid var(--border); padding: 6px; }
.palette .res { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px; color: var(--text-2); cursor: pointer; }
.palette .res.sel { background: var(--hover); color: var(--text); }
.palette .res .hint { margin-left: auto; font-size: 12px; color: var(--faint); }
.palette .group { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .07em; padding: 10px 12px 4px; }

/* ==========================================================================
   Seiten-spezifisch
   ========================================================================== */
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
@container main (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: var(--s4) var(--s5); }
.stat .label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 26px; font-weight: 500; letter-spacing: -0.04em; margin-top: 6px; font-variant-numeric: tabular-nums; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s4); }
@container main (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

/* Website-Karten */
.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.site-card { display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5); position: relative; transition: border-color var(--t), box-shadow var(--t), transform var(--t) var(--ease); animation: w-in var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
.site-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.site-card .top { display: flex; align-items: flex-start; gap: var(--s3); }
.site-favicon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); }
.site-card h4 { overflow-wrap: anywhere; margin: 0; font-size: 15px; font-weight: 570; letter-spacing: -0.015em; display: flex; align-items: center; gap: 6px; }
.site-card .link { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow: hidden; }
.site-card .link:hover { color: var(--accent-text); }
.site-card .res { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.site-card .res div { display: grid; gap: 6px; }
.site-card .res small { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
.site-card .foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); margin: 0 calc(-1 * var(--s5)) calc(-1 * var(--s5)); padding: 10px var(--s4); }
.site-card .foot .grow { flex: 1; }
.site-card[data-tint] { background: var(--tint); }
.site-card[data-tint] .site-favicon { background: color-mix(in srgb, var(--surface) 55%, transparent); }
[data-tint="rose"] { --tint: var(--tint-rose); }        [data-tint="peach"] { --tint: var(--tint-peach); }
[data-tint="butter"] { --tint: var(--tint-butter); }    [data-tint="mint"] { --tint: var(--tint-mint); }
[data-tint="sage"] { --tint: var(--tint-sage); }        [data-tint="sky"] { --tint: var(--tint-sky); }
[data-tint="lavender"] { --tint: var(--tint-lavender); } [data-tint="lilac"] { --tint: var(--tint-lilac); }
/* Domains-Übersicht (Websites → Domains) */
.dmap-card { padding: var(--s5); margin-bottom: var(--s4); }
.dmap-flow { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; padding-bottom: var(--s4); margin-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.dmap-node { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.dmap-node.ok { border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.dmap-node.err { border-color: var(--err); background: var(--err-soft); }
.dmap-node div { display: grid; line-height: 1.25; }
.dmap-node strong { font-size: 13px; font-weight: 570; color: var(--text); display: flex; align-items: center; gap: 6px; }
.dmap-node span { font-size: 11.5px; color: var(--muted); }
.dmap-arrow { color: var(--faint); }
.dmap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(40px, .32fr) minmax(0, 1fr) minmax(40px, .32fr) minmax(0, 1fr); row-gap: 6px; align-items: stretch; }
.dmap-col-h { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 10px 4px; }
.dmap-col { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.dmap-col.packed { justify-content: flex-start; }
.dmap-grp { flex: 1 1 0; display: flex; align-items: center; min-height: 38px; }
.dmap-grp > * { width: 100%; }
.dmap-lines { width: 100%; height: 100%; overflow: visible; }
.dmap-lines path { fill: none; stroke: var(--border-strong); stroke-width: 1.5; transition: stroke var(--t), stroke-width var(--t), opacity var(--t); }
.dmap-lines path.down { stroke: var(--err); stroke-dasharray: 4 4; }
.dmap-lines circle { fill: var(--faint); }
.dmap-base, .dmap-dom, .dmap-svc { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color var(--t), background var(--t), opacity var(--t); }
.dmap-base { border-color: var(--border-strong); background: var(--surface-2); padding: 10px 12px; color: var(--accent-text); }
.dmap-base .t { font-size: 13px; font-weight: 560; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmap-base .m { font-size: 11px; color: var(--muted); }
.dmap-dom { color: var(--text); }
.dmap-dom:hover, .dmap-base:hover, .dmap-svc:hover { border-color: var(--accent); }
.dmap-name { font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmap-full, .dmap-inline { display: none; font-size: 12px; }
.dmap-svc .t { font-size: 13px; font-weight: 540; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmap-svc .m { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dmap-svc.down { border-color: var(--err); background: var(--err-soft); }
.dmap.focus .dmap-base:not(.hl), .dmap.focus .dmap-dom:not(.hl), .dmap.focus .dmap-svc:not(.hl) { opacity: .4; }
.dmap.focus .dmap-lines path:not(.hl) { opacity: .2; }
.dmap .hl { border-color: var(--accent); background: var(--accent-soft); }
.dmap-lines path.hl { stroke: var(--accent); stroke-width: 2.2; }
.dmap-bottom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@container main (max-width: 760px) {
  .dmap { grid-template-columns: 1fr; }
  .dmap-lines, .dmap-col-h, #dm-svcs, #dm-bases { display: none; }
  .dmap-inline, .dmap-full { display: inline; }
  .dmap-sub { display: none; }
  .dmap-bottom { grid-template-columns: 1fr; }
}
.tabs.lg { padding: 4px; border-radius: 12px; }
.tabs.lg button { height: 38px; padding: 0 18px; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; border-radius: 9px; }
.dom-rows { display: grid; gap: 8px; }
.dom-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1.3fr) auto; gap: 6px; align-items: center; }
@media (max-width: 560px) { .dom-row { grid-template-columns: auto minmax(0, 1fr) auto; } .dom-row > span { display: none; } .dom-row select { order: 5; grid-column: 1 / -1; } }
.tint-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tint-swatch { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--tint, var(--surface)); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; transition: transform var(--t) var(--ease-spring), box-shadow var(--t); }
.tint-swatch:hover { transform: scale(1.08); }
.tint-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.site-card.new { border-style: dashed; align-items: center; justify-content: center; min-height: 240px; color: var(--muted); cursor: pointer; background: transparent; box-shadow: none; }
.site-card.new:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.site-card.new .plus { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); transition: transform var(--t) var(--ease-spring); }
.site-card.new:hover .plus { transform: rotate(90deg) scale(1.06); }

/* Builder / Chat */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s4); height: calc(100vh - var(--header-h) - 150px); min-height: 560px; }
@container main (max-width: 1100px) { .builder { grid-template-columns: 1fr; height: auto; } }
.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); scroll-behavior: smooth; }
.msg { max-width: 82%; animation: msg-in 360ms var(--ease-spring) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.msg.user { align-self: flex-end; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; line-height: 1.6; color: var(--text); }
.msg.assistant p { margin: 0 0 8px; } .msg.assistant p:last-child { margin: 0; }
.msg.assistant code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.msg.assistant pre { background: var(--surface-3); padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: 12px; }
.msg.assistant ul { margin: 4px 0 8px; padding-left: 20px; }
.op { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); font-family: var(--mono); animation: msg-in 300ms var(--ease) both; }
.op.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.op.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); white-space: pre-wrap; border-radius: 12px; max-width: 100%; }
.op .spin { animation: spin 0.9s linear infinite; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: typing 1.2s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { transform: translateY(-4px); background: var(--muted); } }
.composer { border-top: 1px solid var(--border); padding: var(--s3); display: flex; gap: var(--s2); align-items: flex-end; background: var(--surface-2); }
.composer textarea { flex: 1; border: 0; outline: 0; background: transparent; resize: none; max-height: 200px; min-height: 40px; padding: 10px; line-height: 1.5; }
.mic.rec { color: var(--err); background: var(--err-soft); }
.mic.rec .i { animation: pulse 1s ease-in-out infinite; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions button { font-size: 12.5px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text-2); transition: all var(--t-fast); background: var(--surface); }
.suggestions button:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.preview-frame { width: 100%; flex: 1; border: 0; background: #fff; border-radius: 0 0 var(--r-lg) var(--r-lg); min-height: 300px; }

.create-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
.create-options button { display: grid; gap: 8px; justify-items: start; text-align: left; padding: var(--s4); border-radius: 14px; border: 1px solid var(--border-strong); transition: border-color var(--t-fast), background var(--t-fast), transform var(--t) var(--ease); }
.create-options button:hover { border-color: var(--text); transform: translateY(-2px); }
.create-options button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.create-options strong { font-size: 13.5px; font-weight: 560; }
.create-options span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .create-options { grid-template-columns: 1fr; } }

/* Kalender */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .dow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); text-align: center; padding: 4px 0; }
.cal .day { aspect-ratio: 1; display: grid; place-items: center; font-size: 12.5px; border-radius: 9px; position: relative; color: var(--text-2); font-variant-numeric: tabular-nums; cursor: pointer; transition: background var(--t-fast); }
.cal .day:hover { background: var(--hover); }
.cal .day.other { color: var(--faint); }
.cal .day.today { background: var(--text); color: var(--bg); font-weight: 600; }
.cal .day.has::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal .day.today.has::after { background: var(--bg); }
.cal-big { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-big .dow { padding: 10px; font-size: 11.5px; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); text-transform: uppercase; letter-spacing: .06em; }
.cal-big .cell { min-height: 116px; padding: 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; cursor: pointer; transition: background var(--t-fast); min-width: 0; }
.cal-big .cell:hover { background: var(--surface-2); }
.cal-big .cell.other { background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.cal-big .cell .n { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-2); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-big .cell.today .n { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.cal-big .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid currentColor; }
@container main (max-width: 700px) { .cal-big .cell { min-height: 64px; } .cal-big .ev { font-size: 0; height: 5px; padding: 0; border: 0; } }

.task { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border-radius: 9px; transition: background var(--t-fast); }
.task:hover { background: var(--hover); }
.check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; margin-top: 1px; transition: all var(--t) var(--ease-spring); color: transparent; }
.check:hover { border-color: var(--accent); }
.task.done .check { background: var(--ok); border-color: var(--ok); color: #fff; transform: scale(1.05); }
.task .tt { flex: 1; min-width: 0; font-size: 13px; transition: color var(--t); }
.task.done .tt { color: var(--faint); text-decoration: line-through; }
.task .due { font-size: 11.5px; color: var(--muted); }
.task .due.late { color: var(--err); }
.prio { width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex: none; }
.prio.p3 { background: var(--err); } .prio.p2 { background: var(--warn); } .prio.p1 { background: var(--faint); } .prio.p0 { background: transparent; }

/* Einstellungen */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s6); align-items: start; }
@container main (max-width: 800px) { .settings { grid-template-columns: 1fr; } }
.settings-nav { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 2px; }
@container main (max-width: 800px) { .settings-nav { position: static; display: flex; overflow-x: auto; } }
.settings-nav button { text-align: left; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 480; white-space: nowrap; }
.settings-nav button:hover { color: var(--text); background: var(--hover); }
.settings-nav button[aria-selected="true"] { color: var(--text); background: var(--active); font-weight: 530; }
.set-section { display: grid; gap: var(--s4); }
.set-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-row .t { font-weight: 520; }
.set-row .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
@container main (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 10px 12px; border-radius: 10px; overflow-x: auto; white-space: pre; line-height: 1.6; }
.secret-reveal { display: flex; gap: 8px; align-items: center; padding: 12px; border-radius: 12px; background: var(--ok-soft); font-family: var(--mono); font-size: 12.5px; word-break: break-all; }

.progress-line { height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; position: relative; }
.progress-line i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; transition: width 600ms var(--ease); }
.progress-line.indet i { width: 35% !important; animation: indet 1.2s var(--ease) infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }

.top-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; }
.top-progress i { display: block; height: 100%; width: 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); transition: width 400ms var(--ease), opacity 400ms; }

/* ==========================================================================
   Responsive: Mobile
   ========================================================================== */
@media (max-width: 1439px) { .shell.rail-open { grid-template-columns: var(--sidebar-w) 1fr; } .shell.rail-open .rail { position: fixed; right: 0; top: 0; width: var(--rail-w); z-index: 60; background: var(--surface); box-shadow: var(--shadow-lg); } }
@media (max-width: 960px) {
  .shell, .shell.rail-open { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform var(--t-slow) var(--ease); background: var(--surface); box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .header .hamburger { display: inline-flex; }
  .header { padding: 0 var(--s4); gap: var(--s3); }
  .content { padding: var(--s4) var(--s4) var(--s7); }
  .clock .d { display: none; }
  .greeting h1 { font-size: 16px; }
  .greeting p { display: none; }
  .scan-btn .meta, .scan-btn .lbl { display: none; }
  .scan-btn { padding: 0; width: 40px; }
  .nav a { height: 44px; }
  .btn { --bh: 40px; }
  .btn.sm { --bh: 34px; }
  .w-actions { opacity: 1; }
  .toasts { left: 16px; right: 16px; width: auto; bottom: 16px; }
  .page-head h2 { font-size: 22px; }
}
@media (max-width: 560px) { .clock { display: none; } .header .hide-sm { display: none; } }
.nav-scrim { display: none; }
@media (max-width: 960px) { .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 35; animation: fade var(--t); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.theme-anim, .theme-anim * { transition: background-color var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease) !important; }
.claude-toggle { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: 13px; transition: border-color var(--t), background var(--t), color var(--t); }
.claude-toggle.on { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border-strong)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.claude-toggle.on .i { color: var(--accent-text); }
.claude-toggle .ct-l { font-weight: 540; }
.claude-toggle .ct-m { font-size: 12px; color: var(--muted); padding-right: 4px; }
.claude-toggle .switch[aria-checked="true"] { background: var(--accent); }
.claude-off-banner { display: flex; align-items: center; gap: 12px; margin: 0 16px 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-3); font-size: 13px; }
.claude-off-banner .grow { flex: 1; }
.site-card.new:disabled { cursor: not-allowed; opacity: .6; }
.site-card.new:disabled:hover { color: var(--muted); border-color: var(--border); background: transparent; }
.site-card.new:disabled:hover .plus { transform: none; }
@container main (min-width: 901px) { #ai-grid .w[data-size="m"] { grid-column: span 6; } }

/* Skills nach Bereich */
.skill-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.skill-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; animation: w-in var(--t-slow) var(--ease) both; }
.sg-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 560; padding: 2px 4px 8px; color: var(--text-2); }
.sg-head .i { color: var(--muted); }
.sg-item { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 8px; transition: background var(--t-fast); }
.sg-item:hover { background: var(--hover); }
.sg-item.on { background: var(--accent-soft); }
.sg-item .mono { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-item .sg-sum { grid-column: 2; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-card { margin-top: 12px; padding: 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); font-size: 13px; animation: msg-in 300ms var(--ease-spring); }

.live-btn .dot { background: var(--faint); }
.live-btn.on { color: var(--text); }
.live-btn.on .dot { background: var(--ok); }
.live-btn .dot.blink { animation: live-blink 900ms var(--ease); }
@keyframes live-blink { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 70%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

/* Home Assistant */
.ha-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.ha-sum { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.ha-sum > span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; }
.ha-sum strong { font-size: 18px; font-weight: 520; letter-spacing: -0.03em; }
.ha-sum small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-sum.alert { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: var(--warn-soft); }
.ha-groups { display: grid; gap: 6px; }
.ha-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ha-gh { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; font-size: 13px; font-weight: 550; text-align: left; transition: background var(--t-fast); }
.ha-gh:hover { background: var(--hover); }
.ha-gh .i:first-child { color: var(--muted); }
.ha-gh .muted { margin-left: auto; }
.ha-gh .chev { color: var(--faint); transition: transform var(--t) var(--ease); }
.ha-group.open .chev { transform: rotate(180deg); }
.ha-gb { display: none; padding: 2px 10px 10px; }
.ha-group.open .ha-gb { display: block; animation: msg-in 260ms var(--ease); }
.ha-lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.ha-light { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.ha-light .bulb { grid-row: span 2; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); transition: all var(--t); }
.ha-light.on { border-color: color-mix(in srgb, var(--c3) 45%, var(--border)); background: color-mix(in srgb, var(--c3) 9%, var(--surface)); }
.ha-light.on .bulb { background: var(--c3); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--c3) 55%, transparent); }
.ha-light.na { opacity: .5; }
.ha-light .nm { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-light .st { font-size: 11.5px; color: var(--muted); }
.ha-climate { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.ha-climate:last-child { border-bottom: 0; }
.ha-climate .grow { flex: 1; min-width: 0; }
.ha-climate .title { font-weight: 530; font-size: 13px; }
.ha-climate .meta { font-size: 12px; color: var(--muted); }
.ha-climate.on .meta { color: var(--c3); }
.ha-climate.na { opacity: .5; }
.ha-temp { display: grid; justify-items: center; line-height: 1.1; }
.ha-temp .num { font-size: 17px; font-weight: 500; }
.ha-temp .muted { font-size: 10.5px; }
.ha-state { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ha-state.on { background: var(--ok-soft); color: var(--ok); }
.ha-state.alert { background: var(--warn-soft); color: var(--warn); }
.ha-state.na { color: var(--faint); background: transparent; }
@container main (max-width: 560px) { .ha-summary { grid-template-columns: 1fr; } }

.create-preview { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; }
.create-preview > div { display: flex; align-items: center; gap: 8px; }
.create-preview a { text-decoration: underline; }

/* Arbeitsanzeige */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; display: inline-block; }
.spinner.sm { width: 11px; height: 11px; border-width: 1.6px; }
.work-bar { display: flex; align-items: center; gap: 10px; margin: 0 16px 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--accent) 3%, transparent), var(--accent-soft)); background-size: 200% 100%;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); animation: work-sheen 2.4s linear infinite; }
@keyframes work-sheen { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.work-bar .wb-t { font-weight: 560; color: var(--accent-text); }
.work-bar .wb-step { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; font-family: var(--mono); font-size: 12px; }
.work-bar .wb-time { color: var(--muted); font-size: 12px; }
