/* Server-Cockpit – Gestaltung nach der Apple-Analyse (DESIGN.md):
   ruhige Flächen, eine Akzentfarbe, SF-Schrift, Pillen-Buttons, 18px-Karten, keine Schatten auf Bedienelementen. */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-elev: #ffffff;
  --bg-elev-2: #fafafc;
  --bg-inset: #f5f5f7;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-2: rgba(118, 118, 128, 0.08);
  --fill-press: rgba(118, 118, 128, 0.18);
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --hair: rgba(0, 0, 0, 0.08);
  --hair-2: rgba(0, 0, 0, 0.14);
  --sep: rgba(60, 60, 67, 0.16);
  --accent: #0066cc;
  --accent-focus: #0071e3;
  --accent-soft: rgba(0, 102, 204, 0.1);
  --on-accent: #ffffff;
  --danger: #d70015;
  --danger-soft: rgba(215, 0, 21, 0.09);
  --material: rgba(245, 245, 247, 0.8);
  --material-elev: rgba(255, 255, 255, 0.82);
  --scrim: rgba(0, 0, 0, 0.3);
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --crit: #d03b3b;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --track: #cde2fb;
  --grid: #ececf0;
  --axis: #d2d2d7;
  --chart-ink: #86868b;
  --user-bubble: #0066cc;
  --term-bg: #1d1d1f;
  --code-bg: #f5f5f7;

  --r-card: 18px;
  --r-md: 11px;
  --r-sm: 8px;
  --r-pill: 999px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Cascadia Mono", "Liberation Mono", monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --tab-h: 50px;
  --nav-h: 52px;
  --side-w: 256px;
  --rail-w: 76px;
  --app-h: 100dvh;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-elev: #1d1d1f;
    --bg-elev-2: #2a2a2c;
    --bg-inset: #111112;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-2: rgba(118, 118, 128, 0.16);
    --fill-press: rgba(118, 118, 128, 0.34);
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --ink-3: #6e6e73;
    --hair: rgba(255, 255, 255, 0.09);
    --hair-2: rgba(255, 255, 255, 0.16);
    --sep: rgba(255, 255, 255, 0.11);
    --accent: #2997ff;
    --accent-focus: #2997ff;
    --accent-soft: rgba(41, 151, 255, 0.16);
    --danger: #ff6961;
    --danger-soft: rgba(255, 105, 97, 0.14);
    --material: rgba(22, 22, 23, 0.8);
    --material-elev: rgba(29, 29, 31, 0.84);
    --scrim: rgba(0, 0, 0, 0.5);
    --series-1: #3987e5;
    --series-2: #d95926;
    --track: #0d366b;
    --grid: #2c2c2e;
    --axis: #3a3a3c;
    --chart-ink: #8e8e93;
    --user-bubble: #0a6fd8;
    --term-bg: #111112;
    --code-bg: #111112;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elev: #1d1d1f;
  --bg-elev-2: #2a2a2c;
  --bg-inset: #111112;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.16);
  --fill-press: rgba(118, 118, 128, 0.34);
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #6e6e73;
  --hair: rgba(255, 255, 255, 0.09);
  --hair-2: rgba(255, 255, 255, 0.16);
  --sep: rgba(255, 255, 255, 0.11);
  --accent: #2997ff;
  --accent-focus: #2997ff;
  --accent-soft: rgba(41, 151, 255, 0.16);
  --danger: #ff6961;
  --danger-soft: rgba(255, 105, 97, 0.14);
  --material: rgba(22, 22, 23, 0.8);
  --material-elev: rgba(29, 29, 31, 0.84);
  --scrim: rgba(0, 0, 0, 0.5);
  --series-1: #3987e5;
  --series-2: #d95926;
  --track: #0d366b;
  --grid: #2c2c2e;
  --axis: #3a3a3c;
  --chart-ink: #8e8e93;
  --user-bubble: #0a6fd8;
  --term-bg: #111112;
  --code-bg: #111112;
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.mono, code, kbd, pre { font-family: var(--mono); letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; line-height: 1.43; letter-spacing: -0.016em; }
.tiny { font-size: 12px; line-height: 1.33; letter-spacing: -0.01em; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.wrap-flex { display: flex; flex-wrap: wrap; gap: 8px; }
.spacer { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

svg.i { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 18px; height: 18px; }
svg.i.xs { width: 15px; height: 15px; stroke-width: 2; }
svg.i.lg { width: 28px; height: 28px; stroke-width: 1.6; }
svg.i.xl { width: 44px; height: 44px; stroke-width: 1.4; }

/* ---------- App-Gerüst ---------- */
.app {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: var(--app-h);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  overflow: hidden;
}
.sidebar { display: none; }
.main { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#layer { position: absolute; inset: 0; pointer-events: none; z-index: 80; }
#layer > * { pointer-events: auto; }
.view.page-view .navbar { position: absolute; top: 0; left: 0; right: 0; }
.view.page-view .scroller { position: absolute; inset: 0; padding-top: calc(var(--nav-h) + var(--safe-t)); }
.view { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scroll-padding-top: calc(var(--nav-h) + var(--safe-t));
}
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 4px calc(16px + var(--safe-r)) calc(var(--tab-h) + var(--safe-b) + 28px) calc(16px + var(--safe-l));
}
.page.narrow { max-width: 980px; }

/* Navigationsleiste (iOS: kleiner Titel erscheint beim Scrollen) */
.navbar {
  position: relative;
  z-index: 20;
  flex: none;
  height: calc(var(--nav-h) + var(--safe-t));
  padding: var(--safe-t) calc(8px + var(--safe-r)) 0 calc(8px + var(--safe-l));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: transparent;
  transition: background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.view.scrolled .navbar, .navbar.solid {
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--sep);
}
.nav-left, .nav-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.nav-right { justify-content: flex-end; }
.nav-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; letter-spacing: -0.024em;
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; text-align: center;
}
.view.scrolled .nav-title, .navbar.solid .nav-title { opacity: 1; transform: none; }
.nav-btn {
  height: 44px; min-width: 44px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  color: var(--accent); border-radius: 22px; font-size: 17px;
  transition: transform 0.12s var(--ease), background-color 0.15s;
}
.nav-btn:active { transform: scale(0.95); background: var(--fill-2); }
.nav-btn.text { font-weight: 400; }
.nav-btn.strong { font-weight: 600; }
.nav-btn:disabled { color: var(--ink-3); }

.lt { padding: 2px 4px 14px; }
.lt-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -0.011em;
}
.lt-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.4; letter-spacing: -0.016em; }
.lt-row { display: flex; align-items: flex-end; gap: 12px; }
.lt-row .lt-actions { margin-left: auto; display: flex; gap: 8px; padding-bottom: 4px; }

h2.sec, .sec {
  margin: 28px 4px 10px;
  font-family: var(--font-display);
  font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: 0.011em;
  display: flex; align-items: center; gap: 10px;
}
.sec .sec-aside { margin-left: auto; font-family: var(--font); font-size: 15px; font-weight: 400; letter-spacing: -0.016em; }
.sec-hint { margin: -4px 4px 10px; color: var(--ink-2); font-size: 14px; }

/* Tab-Leiste (Handy) */
.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b));
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--sep);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink-3); font-size: 10px; font-weight: 600; letter-spacing: 0.01em;
  padding-top: 2px;
}
.tab svg.i { width: 25px; height: 25px; stroke-width: 1.7; }
.tab.active { color: var(--accent); }
.tab:active svg { transform: scale(0.92); }
.badge-dot {
  position: absolute; top: 5px; left: calc(50% + 8px);
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--crit); color: #fff; font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.kb-open .tabbar { display: none; }

/* Seitenleiste (iPad quer und PC) und Schiene (iPad hochkant) */
@media (min-width: 744px) {
  .app { grid-template-columns: var(--rail-w) 1fr; }
  .tabbar { display: none; }
  .page { padding-bottom: calc(28px + var(--safe-b)); padding-left: 24px; padding-right: calc(24px + var(--safe-r)); }
  .sidebar {
    display: flex; flex-direction: column; min-height: 0;
    background: var(--bg);
    border-right: 0.5px solid var(--sep);
    padding: calc(var(--safe-t) + 10px) 8px calc(var(--safe-b) + 10px) calc(8px + var(--safe-l));
    overflow-y: auto; overflow-x: hidden;
  }
  .sb-brand { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 4px 14px; }
  .sb-brand img { width: 34px; height: 34px; border-radius: 8px; }
  .sb-brand .sb-name { display: none; }
  .sb-label { display: none; }
  .sb-item {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 2px; margin: 2px 0; border-radius: 12px;
    color: var(--ink-2); font-size: 10.5px; font-weight: 600; letter-spacing: 0;
    transition: background-color 0.15s, color 0.15s;
  }
  .sb-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-item:hover { background: var(--fill-2); }
  .sb-item:active { transform: scale(0.97); }
  .sb-item.active { background: var(--accent-soft); color: var(--accent); }
  .sb-item .badge-dot { top: 2px; left: calc(50% + 6px); }
  .sb-foot { margin-top: auto; padding: 10px 4px 2px; display: flex; justify-content: center; }
  .sb-item .sb-long { display: none; }
  .sb-foot .conn-label { display: none; }
}
@media (min-width: 1024px) {
  .app { grid-template-columns: var(--side-w) 1fr; }
  .sidebar { padding-left: calc(12px + var(--safe-l)); padding-right: 12px; }
  .sb-brand { justify-content: flex-start; padding: 8px 10px 18px; }
  .sb-brand .sb-name { display: block; }
  .sb-brand .sb-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
  .sb-brand .sb-host { font-size: 12px; color: var(--ink-2); line-height: 1.2; }
  .sb-label { display: block; margin: 16px 10px 4px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; text-transform: uppercase; }
  .sb-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; height: 40px; margin: 1px 0; font-size: 15px; font-weight: 400; letter-spacing: -0.016em; border-radius: 10px; color: var(--ink); }
  .sb-item svg.i { width: 21px; height: 21px; color: var(--accent); }
  .sb-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
  .sb-item .badge-dot { position: static; margin-left: auto; box-shadow: none; }
  .sb-foot { justify-content: flex-start; padding: 12px 10px 2px; }
  .sb-item .sb-long { display: inline; }
  .sb-item .sb-short { display: none; }
  .sb-foot .conn-label { display: inline; }
}

.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.conn .st-dot { width: 8px; height: 8px; }

/* ---------- Bausteine ---------- */
.card {
  background: var(--bg-elev);
  border-radius: var(--r-card);
  border: 1px solid var(--hair);
  padding: 16px;
  min-width: 0;
}
:root[data-theme="dark"] .card { border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border-color: transparent; } }
.card.tap { cursor: pointer; transition: transform 0.15s var(--ease), background-color 0.15s; }
.card.tap:active { transform: scale(0.985); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-width: 0; }
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.022em; line-height: 1.25; }
.card-head .aside { margin-left: auto; color: var(--ink-2); font-size: 14px; }
.card-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.card-icon svg.i { width: 18px; height: 18px; stroke-width: 2; }

.grid { display: grid; gap: 12px; }
.grid-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-charts { grid-template-columns: minmax(0, 1fr); }
.grid-cards { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .grid { gap: 16px; }
  .grid-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1280px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Kennzahl-Kachel */
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 13px; position: relative; overflow: hidden; }
.tile-top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; letter-spacing: -0.016em; }
.tile-top svg.i { width: 17px; height: 17px; stroke-width: 2; color: var(--accent); }
.tile-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.14; letter-spacing: 0.004em; margin-top: 6px; white-space: nowrap; }
.tile-value small { font-size: 17px; font-weight: 600; color: var(--ink-2); margin-left: 2px; letter-spacing: 0; }
.tile-sub { color: var(--ink-2); font-size: 13px; line-height: 1.35; letter-spacing: -0.01em; }
.tile .meter { margin-top: 10px; }
.meter { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--series-1); transition: width 0.6s var(--ease), background-color 0.3s; }
.meter.warn > i { background: var(--warn); }
.meter.crit > i { background: var(--crit); }
.meter.thin { height: 4px; }

/* Ring */
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-track { stroke: var(--track); }
.ring .ring-fill { stroke: var(--series-1); transition: stroke-dashoffset 0.6s var(--ease), stroke 0.3s; }
.ring.warn .ring-fill { stroke: var(--warn); }
.ring.crit .ring-fill { stroke: var(--crit); }

/* Status */
.st { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--ink); white-space: nowrap; letter-spacing: -0.016em; }
.st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.st.good .st-dot, .st-dot.good { background: var(--good); }
.st.warn .st-dot, .st-dot.warn { background: var(--warn); }
.st.serious .st-dot, .st-dot.serious { background: var(--serious); }
.st.crit .st-dot, .st-dot.crit { background: var(--crit); }
.st.live .st-dot, .st-dot.live { background: var(--crit); animation: pulse 1.6s infinite; }
.st-dot.busy { background: var(--series-1); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--fill-2); color: var(--ink);
  font-size: 13px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
}
.pill svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.banner {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-card); background: var(--bg-elev); border: 1px solid var(--hair);
}
.banner .b-icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; background: var(--fill-2); }
.banner .b-icon svg.i { width: 19px; height: 19px; stroke-width: 2.1; }
.banner.good .b-icon { color: var(--good); }
.banner.warn .b-icon { color: #b97a00; }
.banner.crit .b-icon { color: var(--crit); }
.banner .b-title { font-weight: 600; font-size: 17px; line-height: 1.3; }
.banner .b-text { color: var(--ink-2); font-size: 14px; line-height: 1.35; }

/* Listen (iOS gruppiert) */
.list {
  background: var(--bg-elev);
  border-radius: var(--r-card);
  border: 1px solid var(--hair);
  overflow: hidden;
}
:root[data-theme="dark"] .list { border-color: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .list { border-color: transparent; } }
.list + .list { margin-top: 12px; }
.row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 52px; padding: 9px 16px;
  min-width: 0;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 0.5px; background: var(--sep);
}
.row.has-icon + .row::before, .list.icons .row + .row::before { left: 58px; }
.row.tap { cursor: pointer; transition: background-color 0.12s; }
.row.tap:active, .row.tap.pressed { background: var(--fill-press); }
@media (hover: hover) { .row.tap:hover { background: var(--fill-2); } }
.row-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.row-icon svg.i { width: 18px; height: 18px; stroke-width: 2; }
.row-icon.plain { background: none; color: var(--ink-2); }
.row-icon.gray { background: var(--fill); color: var(--ink-2); }
.row-icon.folder { background: none; color: var(--accent); }
.row-icon.folder svg.i { width: 26px; height: 26px; stroke-width: 1.6; fill: var(--accent-soft); }
.row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.row-title { font-size: 17px; line-height: 1.3; letter-spacing: -0.022em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-title.wrap { white-space: normal; word-break: break-word; }
.row-sub { font-size: 14px; line-height: 1.35; color: var(--ink-2); letter-spacing: -0.016em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap { white-space: normal; word-break: break-word; }
.row-trail { flex: none; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 15px; text-align: right; }
.row-trail .chev { color: var(--ink-3); width: 16px; height: 16px; stroke-width: 2.4; }
.row-value { font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-value strong { color: var(--ink); font-weight: 600; }
.row.selected { background: var(--accent-soft); }
.row .check-mark { color: var(--accent); }
.row.danger .row-title { color: var(--danger); }
.row.accent .row-title { color: var(--accent); }
.row.center { justify-content: center; }

.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 0; }
.kv > div { padding: 10px 0; border-top: 0.5px solid var(--sep); font-size: 15px; min-width: 0; word-break: break-word; }
.kv > div:nth-child(-n+2) { border-top: 0; }
.kv .k { color: var(--ink-2); padding-right: 12px; }
.kv .v { text-align: right; }
.kv .v.mono { font-size: 13px; text-align: left; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 400; letter-spacing: -0.016em; white-space: nowrap;
  transition: transform 0.12s var(--ease), opacity 0.15s, background-color 0.15s;
  -webkit-user-select: none; user-select: none;
}
.btn svg.i { width: 18px; height: 18px; stroke-width: 2; }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.big { min-height: 48px; font-size: 17px; padding: 0 26px; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.gray { background: var(--fill); color: var(--ink); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 10px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-ghost { background: var(--danger-soft); color: var(--danger); }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 14px; }
.btn.utility { border-radius: var(--r-sm); background: var(--ink); color: var(--bg-elev); min-height: 34px; padding: 0 15px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  transition: transform 0.12s var(--ease), background-color 0.15s;
}
.icon-btn:active { transform: scale(0.92); background: var(--fill-2); }
.icon-btn.filled { background: var(--fill); color: var(--ink); width: 36px; height: 36px; }
.icon-btn.filled svg.i { width: 19px; height: 19px; stroke-width: 2; }
.icon-btn.accent { background: var(--accent); color: #fff; }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }

/* Segment-Schalter */
.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 2px; border-radius: 9px; background: var(--fill);
  min-width: 0; max-width: 100%;
}
.seg button {
  height: 30px; padding: 0 12px; border-radius: 7px;
  font-size: 13px; font-weight: 600; letter-spacing: -0.006em; color: var(--ink);
  white-space: nowrap; transition: background-color 0.18s var(--ease);
}
.seg button.on { background: var(--bg-elev); box-shadow: 0 0 0 0.5px var(--hair-2); }
:root[data-theme="dark"] .seg button.on { background: #636366; box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; box-shadow: none; } }
.seg.block { display: grid; width: 100%; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 2px 0 14px; }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--bg-elev); border: 1px solid var(--hair);
  font-size: 14px; color: var(--ink); white-space: nowrap; letter-spacing: -0.016em;
  transition: transform 0.12s, background-color 0.15s;
}
.chip svg.i { width: 16px; height: 16px; stroke-width: 2; color: var(--accent); }
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--accent); color: #fff; border-color: transparent; }
.chip.on svg.i { color: #fff; }
.chip .x { margin-right: -6px; width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.chip .x:hover { background: var(--fill); }

/* Formulare */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .field .label { font-size: 14px; color: var(--ink-2); padding: 0 4px; }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 11px 14px;
  border-radius: 12px; border: 1px solid var(--hair-2); background: var(--bg-elev);
  font-size: 17px; line-height: 1.3; outline: none; letter-spacing: -0.022em;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.textarea { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: 14px; letter-spacing: 0; }
.search {
  position: relative; display: flex; align-items: center; min-width: 0;
}
.search svg.i { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--ink-3); pointer-events: none; stroke-width: 2; }
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 10px; border: 0;
  background: var(--fill); font-size: 17px; outline: none; letter-spacing: -0.022em;
}
.search input:focus { box-shadow: 0 0 0 2px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); cursor: pointer; -webkit-user-select: none; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background-color 0.2s; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 0.5px rgba(0,0,0,0.04), 0 3px 1px rgba(0,0,0,0.06);
  transition: transform 0.22s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.form-error { color: var(--danger); font-size: 14px; min-height: 20px; padding: 0 4px; }

/* Leerzustand und Laden */
.empty { text-align: center; color: var(--ink-2); padding: 36px 20px; font-size: 15px; }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.4; color: var(--ink-3); margin-bottom: 8px; }
.empty .e-title { color: var(--ink); font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-2); padding: 28px; font-size: 15px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.2px solid var(--fill); border-top-color: var(--ink-2); animation: spin 0.8s linear infinite; flex: none; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.stale { opacity: 0.55; transition: opacity 0.2s; }

/* Toasts */
.toasts { position: absolute; z-index: 200; top: calc(var(--safe-t) + 10px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: min(92vw, 420px); }
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 11px 16px; border-radius: 22px;
  background: var(--material-elev); border: 0.5px solid var(--hair-2);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  font-size: 15px; line-height: 1.3; letter-spacing: -0.016em;
  animation: toast-in 0.35s var(--spring);
}
.toast svg.i { width: 19px; height: 19px; stroke-width: 2.1; }
.toast.good svg.i { color: var(--good); }
.toast.crit svg.i { color: var(--crit); }
.toast.warn svg.i { color: #b97a00; }
.toast.out { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(0.97); } }

/* Sheets (Handy: von unten, iPad/PC: mittig) */
.scrim { position: absolute; inset: 0; z-index: 90; background: var(--scrim); animation: fade-in 0.22s var(--ease); }
.scrim.out { animation: fade-out 0.2s var(--ease) forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: absolute; z-index: 100; left: 0; right: 0; bottom: 0;
  max-height: calc(var(--app-h) - var(--safe-t) - 12px);
  display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 14px 14px 0 0;
  animation: sheet-up 0.36s var(--spring);
  padding-bottom: var(--safe-b);
  outline: none;
}
.sheet.inset { background: var(--bg); }
.sheet.full { height: calc(var(--app-h) - var(--safe-t) - 12px); }
.sheet.out { animation: sheet-down 0.24s var(--ease) forwards; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
.sheet-grab { flex: none; height: 18px; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-press); }
.sheet-head { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px 4px; min-height: 48px; }
.sheet-head .s-title { font-weight: 600; font-size: 17px; text-align: center; letter-spacing: -0.024em; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-head .s-left { display: flex; justify-content: flex-start; }
.sheet-head .s-right { display: flex; justify-content: flex-end; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 20px; overscroll-behavior: contain; }
.sheet-body.flush { padding: 0; display: flex; flex-direction: column; }
@media (min-width: 744px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%;
    width: min(620px, calc(100vw - 48px));
    max-height: min(820px, calc(var(--app-h) - 64px));
    transform: translate(-50%, -50%);
    border-radius: 18px; padding-bottom: 0;
    animation: modal-in 0.3s var(--spring);
  }
  .sheet.wide { width: min(980px, calc(100vw - 48px)); }
  .sheet.full { height: min(900px, calc(var(--app-h) - 48px)); }
  .sheet.out { animation: modal-out 0.2s var(--ease) forwards; }
  .sheet-grab { display: none; }
  .sheet-head { padding-top: 8px; }
  @keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.98); } }
  @keyframes modal-out { to { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } }
}
/* Seitenpanel für Claude auf iPad/PC */
.panel {
  position: absolute; z-index: 100; top: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  background: var(--bg); display: flex; flex-direction: column;
  animation: panel-in 0.34s var(--spring);
  border-left: 0.5px solid var(--sep);
}
.panel.out { animation: panel-out 0.22s var(--ease) forwards; }
@keyframes panel-in { from { transform: translateX(100%); } }
@keyframes panel-out { to { transform: translateX(100%); } }
@media (min-width: 744px) { .panel { width: min(480px, 92vw); } }

/* Kontextmenü */
.menu {
  position: absolute; z-index: 150; min-width: 230px; max-width: min(300px, calc(100vw - 24px));
  padding: 6px 0; border-radius: 14px;
  background: var(--material-elev); border: 0.5px solid var(--hair-2);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  animation: menu-in 0.2s var(--spring); transform-origin: top left;
  max-height: calc(var(--app-h) - 24px); overflow-y: auto;
}
.menu.out { animation: fade-out 0.14s forwards; }
@keyframes menu-in { from { opacity: 0; transform: scale(0.92); } }
.menu-title { padding: 6px 16px 6px; font-size: 13px; color: var(--ink-2); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: 0 16px; text-align: left;
  font-size: 16px; letter-spacing: -0.02em; color: var(--ink);
}
.menu-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item svg.i { width: 19px; height: 19px; color: var(--ink); stroke-width: 1.9; }
.menu-item:hover, .menu-item:focus-visible { background: var(--fill-2); outline: none; }
.menu-item:active { background: var(--fill-press); }
.menu-item.danger, .menu-item.danger svg.i { color: var(--danger); }
.menu-item.accent, .menu-item.accent svg.i { color: var(--accent); }
.menu-item:disabled { opacity: 0.4; }
.menu-sep { height: 6px; background: var(--fill-2); margin: 4px 0; }

/* Dialog */
.dialog {
  position: absolute; z-index: 160; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 48px)); border-radius: 16px; overflow: hidden;
  background: var(--material-elev); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  border: 0.5px solid var(--hair-2); text-align: center;
  animation: dialog-in 0.25s var(--spring);
}
.dialog.out { animation: fade-out 0.15s forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -50%) scale(1.08); } }
.dialog-body { padding: 20px 18px 16px; }
.dialog-title { font-weight: 600; font-size: 17px; line-height: 1.3; letter-spacing: -0.022em; }
.dialog-text { font-size: 14px; color: var(--ink-2); margin-top: 6px; line-height: 1.4; word-break: break-word; }
.dialog .input { margin-top: 12px; min-height: 40px; font-size: 16px; padding: 8px 12px; text-align: left; }
.dialog-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 0.5px solid var(--sep); }
.dialog-actions button { min-height: 46px; font-size: 17px; color: var(--accent); }
.dialog-actions button + button { border-left: 0.5px solid var(--sep); }
.dialog-actions button.strong { font-weight: 600; }
.dialog-actions button.danger { color: var(--danger); font-weight: 600; }
.dialog-actions button:active { background: var(--fill-2); }

/* ---------- Diagramme ---------- */
.chart-card { padding: 16px 16px 10px; }
.chart-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.chart-head .ch-title { font-size: 15px; color: var(--ink-2); letter-spacing: -0.016em; display: flex; align-items: center; gap: 7px; }
.chart-head .ch-title svg.i { width: 17px; height: 17px; stroke-width: 2; color: var(--accent); }
.chart-head .ch-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: 0.004em; margin-top: 2px; white-space: nowrap; }
.chart-head .ch-value small { font-size: 15px; color: var(--ink-2); font-weight: 600; margin-left: 3px; }
.chart-head .ch-aside { margin-left: auto; text-align: right; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--ink-2); margin: 4px 0 2px; }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .lg i { width: 14px; height: 2.5px; border-radius: 2px; background: var(--series-1); }
.legend .lg strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 150px; touch-action: pan-y; cursor: crosshair; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (min-width: 1024px) { .chart { height: 180px; } }
.chart-tip {
  position: absolute; z-index: 5; top: 0; pointer-events: none;
  min-width: 128px; padding: 8px 10px; border-radius: 10px;
  background: var(--material-elev); border: 0.5px solid var(--hair-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  font-size: 12px; line-height: 1.45; color: var(--ink-2); white-space: nowrap;
}
.chart-tip .tt-time { margin-bottom: 3px; }
.chart-tip .tt-row { display: flex; align-items: center; gap: 7px; }
.chart-tip .tt-row i { width: 12px; height: 2.5px; border-radius: 2px; flex: none; }
.chart-tip .tt-row strong { color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.chart-table th, .chart-table td { padding: 6px 4px; border-top: 0.5px solid var(--sep); text-align: right; font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; color: var(--ink-2); font-weight: 400; }
.chart-table th { color: var(--ink-2); font-weight: 400; }
.chart-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.link-btn { color: var(--accent); font-size: 13px; padding: 6px 0; }
.cores { display: grid; grid-template-columns: repeat(auto-fit, minmax(14px, 1fr)); gap: 4px; height: 40px; margin-top: 12px; }
.cores b { position: relative; display: block; height: 100%; background: var(--track); border-radius: 4px; overflow: hidden; }
.cores i { position: absolute; left: 0; right: 0; bottom: 0; display: block; background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 2px; transition: height 0.5s var(--ease); }
.cores-wrap { position: relative; }
.cores-label { font-size: 12px; color: var(--ink-3); margin-top: 4px; display: flex; justify-content: space-between; }
.spark { width: 100%; height: 34px; display: block; }

/* ---------- Konsole ---------- */
.term-view .navbar { background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0.5px 0 var(--sep); }
.term-tabs { flex: none; display: flex; gap: 8px; align-items: center; padding: 8px calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l)); overflow-x: auto; scrollbar-width: none; }
.term-tabs::-webkit-scrollbar { display: none; }
.term-tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px;
  border-radius: var(--r-pill); background: var(--bg-elev); border: 1px solid var(--hair);
  font-size: 14px; color: var(--ink); max-width: 220px; letter-spacing: -0.016em;
}
.term-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-tab.on { background: var(--accent); color: #fff; border-color: transparent; }
.term-tab .st-dot { width: 7px; height: 7px; }
.term-tab .x { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; opacity: 0.7; }
.term-tab .x:hover { background: rgba(127,127,127,0.25); opacity: 1; }
.term-tab .x svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.term-area { flex: 1 1 auto; min-height: 0; position: relative; margin: 0 calc(12px + var(--safe-r)) 0 calc(12px + var(--safe-l)); border-radius: 14px; overflow: hidden; background: var(--term-bg); }
.term-host { position: absolute; inset: 10px 4px 6px 10px; }
.term-host .xterm { height: 100%; }
.term-host .xterm-viewport { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.term-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #a1a1a6; text-align: center; padding: 20px; background: var(--term-bg); }
.term-overlay .e-title { color: #f5f5f7; font-weight: 600; }
.term-status { position: absolute; right: 12px; top: 10px; z-index: 4; }
.keybar {
  flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 8px calc(10px + var(--safe-r)) 8px calc(10px + var(--safe-l));
}
.keybar::-webkit-scrollbar { display: none; }
.key {
  flex: none; min-width: 42px; height: 38px; padding: 0 10px; border-radius: 9px;
  background: var(--bg-elev); border: 1px solid var(--hair);
  font-family: var(--mono); font-size: 14px; color: var(--ink); letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.key svg.i { width: 17px; height: 17px; stroke-width: 2; }
.key:active { background: var(--fill-press); transform: scale(0.95); }
.key.on { background: var(--accent); color: #fff; border-color: transparent; }
.key.claude { color: var(--accent); }
.term-pad { flex: none; height: calc(var(--tab-h) + var(--safe-b) + 6px); }
@media (min-width: 744px) { .term-pad { height: calc(12px + var(--safe-b)); } }
.kb-open .term-pad { height: 2px; }
.text-view { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; background: var(--term-bg); color: #e5e5ea; border-radius: 12px; padding: 12px; -webkit-user-select: text; user-select: text; letter-spacing: 0; }

/* ---------- Dateien ---------- */
.crumbs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 10px; }
.crumbs::-webkit-scrollbar { display: none; }
.crumb { flex: none; height: 30px; padding: 0 9px; border-radius: 8px; font-size: 15px; color: var(--accent); display: inline-flex; align-items: center; letter-spacing: -0.016em; }
.crumb:active { background: var(--fill-2); }
.crumb.last { color: var(--ink); font-weight: 600; }
.crumb-sep { color: var(--ink-3); flex: none; }
.crumb-sep svg.i { width: 13px; height: 13px; stroke-width: 2.4; }
.files-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.files-bar .search { flex: 1; }
.file-meta { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sel-bar {
  position: absolute; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 22px;
  background: var(--material-elev); border: 0.5px solid var(--hair-2);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  animation: toast-in 0.3s var(--spring);
  max-width: calc(100vw - 24px); overflow-x: auto;
}
@media (min-width: 744px) { .sel-bar { bottom: calc(20px + var(--safe-b)); } }
.sel-bar .btn { min-height: 36px; padding: 0 12px; font-size: 14px; }
.sel-count { font-size: 14px; font-weight: 600; padding: 0 10px 0 8px; white-space: nowrap; }
.drop-overlay { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 18px; margin: 8px; color: var(--accent); font-weight: 600; font-size: 19px; pointer-events: none; }
.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ed-wrap { flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; background: var(--bg-elev); position: relative; }
.ed-gutter { flex: none; padding: 12px 8px 40px 12px; text-align: right; color: var(--ink-3); font-family: var(--mono); font-size: 13px; line-height: 20px; -webkit-user-select: none; user-select: none; white-space: pre; background: var(--bg-elev); position: sticky; left: 0; z-index: 1; border-right: 0.5px solid var(--sep); min-height: 100%; }
.ed-text { flex: 1 1 auto; min-width: 0; border: 0; outline: none; resize: none; padding: 12px 12px 40px; font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre; overflow: hidden; background: transparent; tab-size: 4; letter-spacing: 0; color: var(--ink); min-height: 100%; }
.ed-text.wrap { white-space: pre-wrap; word-break: break-all; }
.ed-status { flex: none; display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 0.5px solid var(--sep); font-size: 13px; color: var(--ink-2); background: var(--bg); }
.ed-status .dirty { color: var(--accent); font-weight: 600; }
.img-preview { display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--bg-inset); min-height: 240px; border-radius: 12px; }
.img-preview img { max-width: 100%; max-height: 70vh; border-radius: 8px; }
.warn-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--fill-2); font-size: 14px; color: var(--ink); line-height: 1.4; margin-bottom: 12px; }
.warn-note svg.i { color: #b97a00; width: 19px; height: 19px; flex: none; margin-top: 1px; }

/* ---------- Logs ---------- */
.log { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; letter-spacing: 0; }
.log-line { display: flex; gap: 10px; padding: 3px 14px; border-top: 0.5px solid var(--sep); min-width: 0; }
.log-line:first-child { border-top: 0; }
.log-line .lt-time { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.log-line .lt-src { flex: none; color: var(--ink-2); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-line .lt-msg { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }
.log-line.p3 .lt-msg, .log-line.p2 .lt-msg, .log-line.p1 .lt-msg, .log-line.p0 .lt-msg, .log-line.err .lt-msg { color: var(--danger); }
.log-line.p4 .lt-msg { color: #a86b00; }
:root[data-theme="dark"] .log-line.p4 .lt-msg { color: var(--warn); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .log-line.p4 .lt-msg { color: var(--warn); } }
.log-box { background: var(--bg-elev); border-radius: var(--r-card); border: 1px solid var(--hair); overflow: hidden; }
.log-scroll { max-height: 60vh; overflow: auto; overscroll-behavior: contain; }
@media (max-width: 743px) { .log-line .lt-src { display: none; } .log-line { flex-wrap: wrap; gap: 0 8px; } .log-line .lt-msg { flex-basis: 100%; } }

/* ---------- Claude-Chat ---------- */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg); }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l)); }
.chat-inner { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.msg-user { align-self: flex-end; max-width: 86%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bubble { background: var(--user-bubble); color: #fff; padding: 9px 14px; border-radius: 19px 19px 5px 19px; font-size: 16px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; letter-spacing: -0.02em; }
.msg-ctx { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.msg-ctx .pill { background: var(--bg-elev); border: 1px solid var(--hair); font-weight: 400; }
.msg-asst { align-self: stretch; min-width: 0; }
.md { font-size: 16px; line-height: 1.5; letter-spacing: -0.02em; word-break: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 10px; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 16px 0 8px; letter-spacing: -0.01em; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3, .md h4 { font-size: 17px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md code { font-size: 0.86em; background: var(--fill-2); padding: 1.5px 5px; border-radius: 5px; overflow-wrap: anywhere; word-break: normal; }
.md pre { position: relative; margin: 8px 0 12px; background: var(--code-bg); border: 1px solid var(--hair); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.md pre code { background: none; padding: 0; font-size: inherit; word-break: normal; white-space: pre; }
.md pre .copy { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); background: var(--bg-elev); border: 1px solid var(--hair); opacity: 0.85; }
.md pre .copy svg.i { width: 15px; height: 15px; stroke-width: 2; }
.md blockquote { margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--hair-2); color: var(--ink-2); }
.md table { border-collapse: collapse; margin: 6px 0 12px; font-size: 14px; display: block; overflow-x: auto; max-width: 100%; }
.md th, .md td { border: 1px solid var(--hair-2); padding: 6px 10px; text-align: left; vertical-align: top; }
.md th { background: var(--fill-2); font-weight: 600; }
.md a { text-decoration: underline; text-underline-offset: 2px; }
.md hr { border: 0; border-top: 1px solid var(--sep); margin: 14px 0; }
.cursor-blink::after { content: ""; display: inline-block; width: 8px; height: 17px; margin-left: 2px; vertical-align: -3px; border-radius: 2px; background: var(--ink-2); animation: pulse 1s infinite; }
.tool {
  display: flex; flex-direction: column; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--hair);
  font-size: 14px; overflow: hidden; margin: 4px 0;
}
.tool-head { display: flex; align-items: center; gap: 9px; padding: 8px 12px; min-height: 40px; cursor: pointer; }
.tool-head svg.i { width: 16px; height: 16px; stroke-width: 2; color: var(--ink-2); }
.tool-name { font-weight: 600; flex: none; }
.tool-sum { color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; letter-spacing: 0; }
.tool-body { border-top: 0.5px solid var(--sep); padding: 10px 12px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; color: var(--ink-2); letter-spacing: 0; }
.tool.err .tool-head svg.i:first-child { color: var(--crit); }
.approval {
  border-radius: 16px; background: var(--bg-elev); border: 1.5px solid var(--accent);
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.approval .ap-title { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 16px; }
.approval .ap-title svg.i { color: var(--accent); width: 20px; height: 20px; stroke-width: 2; }
.approval pre { margin: 0; background: var(--code-bg); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; letter-spacing: 0; }
.approval .ap-desc { font-size: 14px; color: var(--ink-2); }
.approval .btn-row .btn { flex: 1; }
.approval.done { border-color: var(--hair); opacity: 0.75; }
.thinking { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.meta-line { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.chat-note { text-align: center; font-size: 13px; color: var(--ink-3); }
.chat-error { border-radius: 12px; background: var(--danger-soft); color: var(--danger); padding: 10px 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.composer {
  flex: none; padding: 8px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--sep);
}
.in-tabs .composer { padding-bottom: calc(10px + var(--tab-h) + var(--safe-b)); }
@media (min-width: 744px) { .in-tabs .composer { padding-bottom: calc(10px + var(--safe-b)); } }
.kb-open .in-tabs .composer { padding-bottom: 10px; }
.composer-inner { max-width: 820px; margin: 0 auto; }
.ctx-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ctx-chips .chip { height: 28px; font-size: 13px; padding: 0 8px 0 10px; }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea {
  flex: 1; min-height: 40px; max-height: 180px; resize: none; border-radius: 20px;
  border: 1px solid var(--hair-2); background: var(--bg-elev); padding: 9px 14px; font-size: 17px; line-height: 1.3; outline: none;
  letter-spacing: -0.022em;
}
.composer textarea:focus { border-color: var(--accent); }
.send-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform 0.12s, opacity 0.15s; }
.send-btn svg.i { width: 20px; height: 20px; stroke-width: 2.4; }
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { opacity: 0.35; }
.send-btn.stop { background: var(--ink); color: var(--bg-elev); }
.composer-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.composer-meta button { color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 6px; border-radius: 8px; }
.composer-meta button:active { background: var(--fill-2); }
.composer-meta svg.i { width: 14px; height: 14px; stroke-width: 2.2; }
.suggest { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.suggest button { text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--bg-elev); border: 1px solid var(--hair); font-size: 15px; color: var(--ink); display: flex; gap: 10px; align-items: center; }
.suggest button svg.i { color: var(--accent); width: 18px; height: 18px; stroke-width: 2; }
.suggest button:active { transform: scale(0.98); }
.chat-hero { text-align: center; padding: 26px 10px 8px; }
.chat-hero .ch-icon { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.chat-hero .ch-icon svg.i { width: 30px; height: 30px; stroke-width: 1.7; }
.chat-hero h3 { margin: 0; font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.chat-hero p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; }
.usage-bars { display: grid; gap: 10px; }
.usage-row .u-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; }
.usage-row .u-top span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Claude-Ansicht: zweispaltig auf großen Bildschirmen */
.claude-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pane-live { font-family: var(--mono); font-size: 11.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-all; background: var(--term-bg); color: #e5e5ea; border-radius: 12px; padding: 12px; max-height: 50vh; overflow: auto; letter-spacing: 0; }

/* Login */
.auth {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 24px); overflow-y: auto; background: var(--bg);
}
.auth-card { width: min(380px, 100%); text-align: center; }
.auth-icon { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 18px; display: block; }
.auth h1 { margin: 0; font-family: var(--font-display); font-size: 32px; line-height: 1.12; font-weight: 600; letter-spacing: -0.011em; }
.auth .auth-sub { margin: 8px 0 28px; color: var(--ink-2); font-size: 15px; }
.auth form { text-align: left; }
.auth .btn { margin-top: 6px; }
.auth .auth-foot { margin-top: 22px; font-size: 13px; color: var(--ink-3); line-height: 1.5; text-align: center; }
.strength { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin: 2px 4px 0; }
.strength i { display: block; height: 100%; width: 0; background: var(--crit); transition: width 0.3s, background-color 0.3s; }

.install-hint { display: flex; gap: 12px; align-items: center; }
.install-hint svg.i { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 380px) {
  .lt-title { font-size: 30px; }
  .tile-value { font-size: 24px; }
  .page { padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
}

/* ---------- Claude-Bereich ---------- */
#layer > .toasts { pointer-events: none; }
#layer > .toasts > * { pointer-events: auto; }
.claude-view .claude-seg { flex: none; padding: 6px calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l)); background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 0.5px 0 var(--sep); position: relative; z-index: 5; }
.claude-body { flex: 1 1 auto; min-height: 0; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.claude-side { min-height: 0; height: 100%; overflow-y: auto; }
.claude-main { min-height: 0; height: 100%; display: flex; flex-direction: column; }
.claude-main > .chat { flex: 1 1 auto; }
.claude-body[data-tab="chat"] .claude-side { display: none; }
.claude-body:not([data-tab="chat"]) .claude-main { display: none; }
.claude-body[data-tab="status"] .claude-part.history { display: none; }
.claude-body[data-tab="history"] .claude-part.status { display: none; }
.claude-side .page { padding-top: 12px; }
@media (min-width: 1024px) {
  .claude-view .claude-seg { display: none; }
  .claude-body { grid-template-columns: 380px minmax(0, 1fr); }
  .claude-body .claude-side { display: block !important; border-right: 0.5px solid var(--sep); }
  .claude-body .claude-main { display: flex !important; }
  .claude-body .claude-part { display: block !important; }
  .claude-side .page { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 1440px) { .claude-body { grid-template-columns: 420px minmax(0, 1fr); } }
.menu.out, .sheet.out, .dialog.out, .scrim.out, .panel.out, .toast.out { pointer-events: none !important; }
.card-head > svg.chev { margin-left: auto; }
.term-host .xterm .xterm-viewport { background-color: transparent !important; }
.term-host .xterm { padding: 0; }
.card .st { white-space: normal; align-items: flex-start; }
.card .st .st-dot { margin-top: 6px; }
.row-trail .st, .card-head .st { white-space: nowrap; align-items: center; }
.row-trail .st .st-dot, .card-head .st .st-dot { margin-top: 0; }
.cores b { background: var(--fill); }
