/* ============ Design Tokens ============ */
:root {
  --bg: #f4f6fb;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e8eefc 0%, transparent 60%),
             radial-gradient(1000px 500px at -10% 110%, #eef2fb 0%, transparent 55%),
             #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6e9f0;
  --text: #1e2532;
  --text-muted: #6b7280;
  --text-soft: #9aa3b2;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-soft: #eef2ff;
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #4f46e5 45%, #7c3aed 100%);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f19;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, #1a2138 0%, transparent 60%),
               radial-gradient(1000px 500px at -10% 110%, #161c30 0%, transparent 55%),
               #0b0f19;
    --surface: #131826;
    --surface-2: #0f1420;
    --border: #232b3d;
    --text: #e6e9f2;
    --text-muted: #9aa3b8;
    --text-soft: #8a93a9;
    --primary: #818cf8;
    --primary-600: #6366f1;
    --primary-soft: #1c2438;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  }
}
/* manuell gewaehltes Farbschema (Benutzermenue) */
:root[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #1a2138 0%, transparent 60%),
             radial-gradient(1000px 500px at -10% 110%, #161c30 0%, transparent 55%),
             #0b0f19;
  --surface: #131826;
  --surface-2: #0f1420;
  --border: #232b3d;
  --text: #e6e9f2;
  --text-muted: #9aa3b8;
  --text-soft: #8a93a9;
  --primary: #818cf8;
  --primary-600: #6366f1;
  --primary-soft: #1c2438;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-grad); color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}

/* ============ Auth Screen ============ */
#auth-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; padding: 24px; text-align: center;
}
#auth-container .auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  box-shadow: var(--shadow-lg); padding: 48px 40px; max-width: 420px; width: 100%;
}
#auth-container .auth-logo {
  width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 18px;
  background: var(--accent-grad); display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -1px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}
#auth-container h1 { margin-bottom: 8px; font-size: 26px; font-weight: 700; }
#auth-container p { color: var(--text-muted); margin-bottom: 28px; font-size: 15px; }
#login-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 14px 28px; font-size: 15px; font-weight: 600; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .2s;
}
#login-btn:hover { background: var(--surface); box-shadow: var(--shadow-md); transform: translateY(-1px); }
#login-btn:active { transform: translateY(0); }
#login-btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
#auth-error {
  color: #ef4444; margin-top: 18px; display: none; font-size: 14px;
  background: rgba(239, 68, 68, .1); padding: 10px 14px; border-radius: var(--radius-sm);
}

.hidden { display: none !important; }

/* ============ Sidebar ============ */
:root { --sidebar-w: 248px; --content-w: 2560px; }
#app { padding-left: var(--sidebar-w); min-height: 100vh; }
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 60;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 20px 20px 12px; }
.sidebar-brand h1 {
  font-size: 19px; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px;
}
.sidebar-brand h1::before {
  content: "cl"; width: 30px; height: 30px; border-radius: 9px; background: var(--accent-grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; box-shadow: 0 4px 10px rgba(79, 70, 229, .3);
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group-title {
  padding: 0 12px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-soft);
}
summary.nav-group-title { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; border-radius: 6px; }
summary.nav-group-title::-webkit-details-marker { display: none; }
summary.nav-group-title::after { content: "\25B8"; font-size: 10px; transition: transform .15s; }
.nav-group-fold[open] > summary.nav-group-title::after { transform: rotate(90deg); }
summary.nav-group-title:hover { color: var(--text-muted); }
summary.nav-group-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .2s, color .2s;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
.sidebar-nav a:focus-visible, .menu-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar-resizer {
  position: absolute; top: 0; bottom: 0; right: -4px; width: 8px; z-index: 1;
  cursor: col-resize; touch-action: none; background: transparent; transition: background .15s;
}
.sidebar-resizer:hover, .sidebar-resizer:focus-visible, body.sidebar-resizing .sidebar-resizer {
  background: linear-gradient(to right, transparent 3px, var(--primary) 3px, var(--primary) 5px, transparent 5px); outline: none;
}
body.sidebar-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
.topbar { display: flex; align-items: center; gap: 12px; min-height: 60px; max-width: var(--content-w); margin: 0 auto; padding: 20px 24px 0; }
.topbar .menu-btn, .sidebar-backdrop { display: none; }
.topbar-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar + .content { margin-top: 16px; }
.user-menu { position: relative; margin-left: auto; }
.avatar-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--accent-grad); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 0; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .15s;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-md); }
.avatar-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.user-menu-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.user-menu-list {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 70; min-width: 220px; max-width: 300px;
  display: flex; flex-direction: column; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
}
.user-menu-list[hidden] { display: none; }
.user-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.user-menu-head strong, .user-menu-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-head span { color: var(--text-muted); }
.user-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0;
  border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px;
  font-weight: 500; text-align: left; cursor: pointer;
}
.user-menu-item svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--surface-2); }
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  color: var(--text); cursor: pointer;
}
.menu-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* ============ Content ============ */
.content { max-width: var(--content-w); margin: 32px auto; padding: 0 24px; }
.content h2 {
  font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 20px !important;
}
.page { display: none; animation: fadeIn .35s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Stat Cards ============ */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats-grid > .loading { grid-column: 1 / -1; }
.stat-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent-grad);
  opacity: 0; transition: opacity .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-value {
  font-size: 26px; font-weight: 800; letter-spacing: -0.03em;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 12px; color: var(--text-muted); margin-top: 4px; font-weight: 500;
}

/* ============ Panel / Table ============ */
.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 24px; overflow: hidden;
}
.panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 15px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.panel-body { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 12px 16px;
  font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
}
td {
  padding: 12px 16px; border-bottom: 1px solid var(--border); max-width: 300px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }

.loading { text-align: center; padding: 48px; color: var(--text-soft); font-size: 14px; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-blue { background: var(--primary-soft); color: var(--primary); }
.badge-green { background: rgba(16, 185, 129, .12); color: #10b981; }
.badge-gray { background: var(--surface-2); color: var(--text-muted); }

.collection-select {
  padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 14px; background: var(--surface); color: var(--text); min-width: 240px;
  cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.collection-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.refresh-btn {
  background: var(--accent-grad); color: #fff; border: none; padding: 10px 20px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .28); transition: transform .15s, box-shadow .15s, filter .15s;
}
.refresh-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 6px 16px rgba(79, 70, 229, .38); }
.refresh-btn:active { transform: translateY(0); }

/* ============ Sizing Stats ============ */
.sizing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.sizing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.sizing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sizing-card h3 {
  font-size: 14px; color: var(--text); margin-bottom: 14px; padding-bottom: 10px; font-weight: 700;
  border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px;
}
.sizing-card h3::before {
  content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--accent-grad); flex-shrink: 0;
}
.sizing-card .metric { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.sizing-card .metric .label { color: var(--text-muted); }
.sizing-card .metric .value { font-weight: 700; color: var(--text); }
.bar-chart { margin-top: 10px; }
.srv-chart svg { display: block; width: 100%; height: auto; margin-top: 10px; }
.srv-chart .srv-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.srv-chart .srv-axis { fill: var(--text-soft); font-size: 9px; }
.srv-chart .srv-mem { stroke: #4f46e5; stroke-width: 1.6; fill: none; }
.srv-chart .srv-disk { stroke: #f59e0b; stroke-width: 1.6; fill: none; }
.srv-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.srv-legend i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.srv-legend a { margin-left: auto; color: var(--primary); font-weight: 600; text-decoration: none; }
.srv-legend a:hover { text-decoration: underline; }
.srv-warn { color: #d97706 !important; -webkit-text-fill-color: #d97706; }
.srv-crit { color: #dc2626 !important; -webkit-text-fill-color: #dc2626; }
.badge-red { background: rgba(220, 38, 38, .12); color: #dc2626; }
.badge-amber { background: rgba(217, 119, 6, .12); color: #d97706; }
.cfg-btn { padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 12px; cursor: pointer; }
.cfg-btn:hover { filter: brightness(1.05); }
.cfg-btn:disabled { opacity: .5; cursor: default; }
#cfg-catalog td { white-space: normal; overflow-wrap: break-word; }
tr[data-cfg-row], tr[data-cfg-cat] { cursor: pointer; }
.cfg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.cfg-tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 16px;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.cfg-tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.cfg-stat { font: inherit; text-align: left; color: inherit; width: 100%; cursor: pointer; }
.cfg-stat.cfg-active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary), var(--shadow-sm); }
.cfg-stat.cfg-active::before { opacity: 1; }
.cfg-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }
#cfg-dialog, #sz-dialog, #sz-resize-dialog, #ss-dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-lg); padding: 0; margin: auto; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
}
#cfg-dialog::backdrop, #sz-dialog::backdrop, #sz-resize-dialog::backdrop, #ss-dialog::backdrop { background: rgba(15, 18, 30, .45); }
.sz-server > summary { cursor: pointer; list-style: none; }
.sz-server > summary::-webkit-details-marker { display: none; }
.sz-server > summary::before { content: "\25B8"; color: var(--text-soft); transition: transform .15s; }
.sz-server[open] > summary::before { transform: rotate(90deg); }
.sz-server:not([open]) > summary { border-bottom: 0; }
.sz-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; flex: 1; }
.sz-title { font-size: 16px; margin-right: 4px; }
.sz-head-rds { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sz-head-rds .dash-bar-track { flex: none; width: 80px; height: 6px; }
.sz-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
.sz-rds { display: flex; align-items: center; gap: 10px; flex: 1 1 280px; }
.sz-meta .sz-status { color: var(--text-muted); flex: 1 1 240px; }
.sz-resize { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: 1 1 100%; }
.sz-resize-detail { color: var(--text-muted); overflow-wrap: anywhere; }
.sz-resize-log { flex: 1 1 100%; }
.sz-resize-log summary { cursor: pointer; color: var(--primary); width: fit-content; }
.sz-resize-log ol { margin: 6px 0 0; padding-left: 20px; color: var(--text-muted); }
.sz-resize-log li span { font-variant-numeric: tabular-nums; color: var(--text-soft); }
.sz-resize-hint p, .sz-resize-hint ol { margin: 0 0 6px; font-size: 13px; }
.sz-resize-hint ol { padding-left: 20px; }
#sz-resize-dialog { overflow: auto; }
.sz-table th.num, .sz-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sz-table td.sz-share { width: 140px; }
.sz-table .dash-bar-track { display: block; width: 120px; }
.sz-table tr.sz-inactive td { color: var(--text-soft); }
.sz-table td.sz-mand { max-width: 320px; }
.sz-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; white-space: nowrap; }
.sz-sort:hover { color: var(--text); }
.sz-table .sz-opt { margin-left: 8px; }
.sz-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sz-table th[aria-sort="ascending"], .sz-table th[aria-sort="descending"] { color: var(--primary); }
.sz-table th[aria-sort="ascending"] .sz-sort::after { content: " \25B2"; }
.sz-table th[aria-sort="descending"] .sz-sort::after { content: " \25BC"; }
#sz-dialog { overflow: auto; }
#sz-usage-dialog, #sz-schema-dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); overflow: auto;
  box-shadow: var(--shadow-lg); padding: 0; margin: auto; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
}
#sz-usage-dialog::backdrop, #sz-schema-dialog::backdrop { background: rgba(15, 18, 30, .45); }
.sz-schema-link { text-decoration: none; }
.szs-table td, .szs-table th { padding: 5px 8px; font-size: 12px; vertical-align: top; }
.szs-table td { overflow-wrap: anywhere; }
.szs-table td:first-child { white-space: nowrap; }
.szs-obj, .szs-table td:nth-child(3), .szs-table td:nth-child(4) { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.szs-none, .szs-hash { color: var(--text-soft); }
.sz-dblink { font-weight: 700; text-decoration: none; }
.sz-dblink:hover, .sz-dblink:focus-visible { text-decoration: underline; }
.szu-body { padding: 16px 22px 20px; display: grid; gap: 14px; font-size: 13px; }
.szu-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.szu-head .cfg-btn { margin-left: auto; }
.szu-stack { display: flex; height: 18px; border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-2); }
.szu-stack span { display: block; height: 100%; min-width: 2px; }
.szu-row { display: grid; grid-template-columns: 12px minmax(150px, 1fr) 90px 170px 90px 60px; align-items: center; gap: 10px; padding: 8px 10px; }
.szu-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.szu-cols { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.szu-area { border-bottom: 1px solid var(--border); }
.szu-area > summary { cursor: pointer; list-style: none; }
.szu-area > summary::-webkit-details-marker { display: none; }
.szu-area > summary:hover { background: var(--surface-2); }
.szu-area[open] > summary { font-weight: 700; }
.szu-dot { width: 12px; height: 12px; border-radius: 3px; }
.szu-share { display: flex; align-items: center; gap: 8px; }
.szu-share .dash-bar-track { flex: 1; }
.szu-share .num { width: 46px; }
.szu-tables { margin: 0 10px 12px 32px; width: calc(100% - 42px); }
.szu-tables td, .szu-tables th { padding: 5px 8px; font-size: 12px; }
.szu-tables td:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 640px) { .szu-row { grid-template-columns: 12px 1fr 80px; } .szu-row > :nth-child(n+4) { display: none; } }
.sz-settings { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 16px; }
.sz-settings legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.sz-settings label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sz-settings .collection-select { min-width: 0; cursor: text; }
.sz-settings select.collection-select { cursor: pointer; }
.sz-settings textarea { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; min-height: 110px; resize: vertical; }
.sz-settings .sz-wide { grid-column: 1 / -1; }
.cfg-dlg-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.cfg-dlg-head h3 { flex: 1; margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.cfg-dlg-close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--text-muted); padding: 0 4px; }
.cfg-dlg-body { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; padding: 18px 22px; margin: 0; }
.cfg-dlg-body dt { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.cfg-dlg-body dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cfg-dlg-body dd.mono { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.cfg-dlg-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 22px 18px; }
.cfg-dlg-actions:empty { display: none; }
.srv-log {
  max-height: 480px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap; word-break: break-all; color: var(--text);
}
.srv-log:empty { display: none; }
/* Syslog-Seite fuellt die Fensterhoehe: Panel als Spalte bis zum unteren Rand (Platz darueber/darunter misst srvLogFit),
   das Log nimmt den Rest unter Werkzeugleiste und Statuszeile */
#srv-log-panel {
  display: flex; flex-direction: column; min-height: 420px;
  height: calc(100vh - var(--srv-log-reserve, 320px)); height: calc(100dvh - var(--srv-log-reserve, 320px));
}
#srv-log-panel > .u-p-16-20 { flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Festbreitenschrift ausdruecklich benannt (ui-monospace/Menlo gibt es unter Windows nicht, sonst entscheidet die Browser-Einstellung) */
#srv-log {
  flex: 1; min-height: 0; max-height: none;
  font-family: "Cascadia Mono", Consolas, "SF Mono", SFMono-Regular, Menlo, "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;
  font-variant-ligatures: none;
}
/* Syslog-Zeilen (config.js srvLogHtml): Zeit, Server, Programm, Meldung; Einstufung sl-err/sl-warn/sl-dim */
.srv-log .sl { display: block; padding: 0 6px; border-radius: 3px; }
.srv-log .sl-t { color: var(--text-soft); }
.srv-log .sl-s { display: inline-block; min-width: var(--sl-sw, 0); color: var(--text-muted); font-weight: 600; }
.srv-log .sl-p { display: inline-block; min-width: var(--sl-pw, 0); font-weight: 600; }
.srv-log .sl-p0 { color: #6366f1; } .srv-log .sl-p1 { color: #0891b2; } .srv-log .sl-p2 { color: #059669; } .srv-log .sl-p3 { color: #d97706; }
.srv-log .sl-p4 { color: #db2777; } .srv-log .sl-p5 { color: #7c3aed; } .srv-log .sl-p6 { color: #2563eb; } .srv-log .sl-p7 { color: #65a30d; }
.srv-log .sl-err { background: rgba(239, 68, 68, .12); box-shadow: inset 3px 0 #ef4444; }
.srv-log .sl-warn { background: rgba(245, 158, 11, .13); box-shadow: inset 3px 0 #f59e0b; }
.srv-log .sl-dim { opacity: .6; }
.srv-log mark { background: rgba(250, 204, 21, .5); color: inherit; border-radius: 2px; }
.srv-log[data-min="warn"] .sl:not(.sl-warn):not(.sl-err), .srv-log[data-min="err"] .sl:not(.sl-err) { display: none; }
.refresh-btn.srv-live-btn[aria-pressed="true"] { background: #059669; color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, .3); }
.srv-live-btn[aria-pressed="true"]::before {
  content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #fff;
  vertical-align: 1px; animation: livePulse 2s infinite;
}
.srv-log-live { color: #059669; font-weight: 600; }
#srv-log-pause[aria-pressed="true"] { background: #d97706; color: #fff; box-shadow: 0 4px 12px rgba(217, 119, 6, .3); }
.dbc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; padding: 16px 20px; }
.dbc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.dbc-form .collection-select { min-width: 0; cursor: text; }
.dbc-form .dbc-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--text); }
.dbc-size { min-height: 16px; font-size: 12px; font-weight: 400; }
.dbc-wide, .dbc-form .dbc-check { grid-column: 1 / -1; }
.dbc-job { border-bottom: 1px solid var(--border); }
.dbc-job:last-child { border-bottom: none; }
.dbc-job summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; }
.dbc-job-body { padding: 0 20px 16px; display: grid; gap: 8px; }
.dbc-error { color: #dc2626; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.dbc-progress { display: flex; align-items: center; gap: 10px; }
.dbc-progress .dash-bar-fill { transition: width .5s; }
.dbd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dbc-form[hidden] { display: none; }
.lt-cfg-excluded { border: 0; margin: 0; padding: 0; min-width: 0; }
.lt-cfg-excluded legend { padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
#lt-cfg-instances { display: flex; flex-wrap: wrap; gap: 6px 20px; }
#lt-stats .stat-label { text-transform: none; }
.lt-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px 20px; margin-bottom: 20px; }
.lt-groups > .loading { grid-column: 1 / -1; }
.lt-group h3 { margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.lt-group .stats-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin-bottom: 0; }
.lt-health { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid; border-radius: var(--radius-sm); font-size: 14px; }
.lt-health > span:last-child { color: var(--text-muted); }
.lt-health-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.lt-health-ok { background: rgba(16, 185, 129, .08); border-color: rgba(16, 185, 129, .35); }
.lt-health-ok .lt-health-dot { background: #10b981; }
.lt-health-warn { background: rgba(217, 119, 6, .08); border-color: rgba(217, 119, 6, .35); }
.lt-health-warn .lt-health-dot { background: #d97706; }
.lt-health-crit { background: rgba(220, 38, 38, .08); border-color: rgba(220, 38, 38, .35); }
.lt-health-crit .lt-health-dot { background: #dc2626; }
.lt-last > summary { cursor: pointer; list-style: none; justify-content: flex-start; }
.lt-last > summary::-webkit-details-marker { display: none; }
.lt-last > summary::before { content: "\25B8"; color: var(--text-soft); }
.lt-last[open] > summary::before { content: "\25BE"; }
.lt-last:not([open]) > summary { border-bottom: 0; }
.lt-last > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
tr.lt-hl > td { background: var(--primary-soft) !important; }
.lt-tab-dot { display: inline-block; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: #dc2626; vertical-align: 2px; }
#lt-tabs { scroll-margin-top: 72px; }
.lt-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 13px; }
.lt-filter label { display: inline-flex; align-items: center; gap: 8px; }
.lt-filter .collection-select { min-width: 150px; padding: 6px 10px; font-size: 13px; }
.lt-tl { padding: 12px 20px 16px; }
.lt-tl-row { display: flex; align-items: center; gap: 12px; min-height: 26px; }
.lt-tl-name { flex: 0 0 150px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.lt-tl-name { cursor: pointer; }
button.lt-tl-name:hover { color: var(--primary); text-decoration: underline; }
.lt-tl-track { position: relative; flex: 1; height: 22px; border-bottom: 1px dashed var(--border); }
.lt-tl-future { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--text-soft) 10%, transparent) 4px 8px); }
.lt-tl-auto { position: absolute; top: 8px; height: 6px; min-width: 3px; border-radius: 3px; background: color-mix(in srgb, var(--text-soft) 35%, transparent); }
.lt-tl-pt { position: absolute; top: 5px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; border: 2px solid var(--surface); box-sizing: border-box; }
.lt-tl-pt[role="button"] { cursor: pointer; }
.lt-tl-pt[role="button"]:hover, .lt-tl-pt:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; z-index: 2; }
.lt-tl-weekly { top: 7px; width: 8px; height: 8px; margin-left: -4px; border-width: 1px; background: #93c5fd; }
.lt-tl-monthly { background: #3b82f6; }
.lt-tl-yearly { top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 2px; transform: rotate(45deg) scale(.85); background: #7c3aed; }
.lt-tl-manual { background: #f59e0b; border-radius: 2px; }
.lt-tl-final { background: #64748b; border-radius: 2px; }
.lt-tl-busy { background: var(--surface); border: 2px dashed #3b82f6; }
.lt-tl-soon { box-shadow: 0 0 0 2px #d97706; }
.lt-tl-next { top: 4px; width: 14px; height: 14px; margin-left: -7px; border: 2px dashed #10b981; border-radius: 2px; transform: rotate(45deg) scale(.8); background: transparent; }
.lt-tl-del { top: 3px; width: 2px; height: 16px; margin-left: -1px; border: 0; border-radius: 1px; background: #dc2626; opacity: .55; }
.lt-tl-more { position: absolute; left: 0; top: 3px; font-size: 11px; color: var(--text-soft); }
.lt-tl-autokey { width: 16px; height: 6px; border-radius: 3px; border: 0; background: color-mix(in srgb, var(--text-soft) 35%, transparent); }
.lt-tl-key { position: static; display: inline-block; margin: 0 5px 0 0; vertical-align: middle; }
.lt-tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.lt-tl-ranges { display: inline-flex; gap: 6px; }
.lt-tl-ranges .cfg-btn[aria-pressed="false"] { background: transparent; border-color: var(--border); color: var(--text-muted); }
.lt-tl-axis { position: relative; flex: 1; height: 18px; font-size: 11px; color: var(--text-soft); }
.lt-tl-tick { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.lt-tl-now { font-weight: 700; color: var(--text-muted); }
@media (max-width: 600px) { .lt-tl-name { flex-basis: 90px; } }
.refresh-btn.dbd-danger { background: #dc2626; box-shadow: 0 4px 12px rgba(220, 38, 38, .28); }
.refresh-btn.dbd-secondary { background: var(--surface-2); color: var(--text); box-shadow: none; }
#dbd-info { display: grid; gap: 4px; }
.bar-row { display: flex; align-items: center; margin-bottom: 8px; font-size: 13px; }
.bar-row .bar-label { width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); flex-shrink: 0; }
.bar-row .bar-track { flex: 1; height: 22px; background: var(--surface-2); border-radius: var(--radius-pill); margin: 0 10px; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: var(--accent-grad); border-radius: var(--radius-pill); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar-row .bar-count { width: 40px; text-align: right; font-weight: 700; color: var(--text); flex-shrink: 0; }

/* ============ Erweiterungen (features.js) ============ */
.md-search { position: relative; padding: 0 12px 10px; }
.md-search .collection-select { width: 100%; min-width: 0; cursor: text; padding: 8px 12px; }
.md-results { position: absolute; left: 12px; right: 12px; top: calc(100% - 6px); z-index: 70; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; }
.md-results button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--border); padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.md-results button:last-child { border-bottom: 0; }
.md-results button:hover, .md-results button.md-active { background: var(--primary-soft); }
.md-results small { display: block; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.md-empty { padding: 10px 12px; font-size: 13px; color: var(--text-muted); }
.md-badges, .md-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.md-actions { margin-bottom: 24px; }
tr.md-row, tr.pe-row { cursor: pointer; }
.sz-trend { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; }
.sz-trend svg { width: 140px; height: 30px; flex-shrink: 0; }
.sz-trend polyline { fill: none; stroke: var(--primary); stroke-width: 1.6; }
.metric .value.srv-up { margin-left: 12px; text-align: right; }
.srv-up-spark { margin: 2px 0 6px; }
.srv-up-spark span { font-size: 12px; color: var(--text-muted); }
.metric .value.srv-cron { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.srv-cron .badge { padding: 1px 6px; font-size: 10px; }
.metric .value.srv-svc { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; }
.srv-svc .badge { padding: 1px 6px; font-size: 10px; }
.srv-cron-at { font-variant-numeric: tabular-nums; }
.srv-phased { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.srv-cron-in { font-size: 12px; font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.metric:has(> .srv-cron) > .label { white-space: nowrap; }
.srv-cron-tl { flex-shrink: 0; overflow: visible; }
.srv-cron-track { fill: var(--border); }
.srv-cron-fill { fill: color-mix(in srgb, var(--primary) 35%, transparent); }
.srv-cron-grid { stroke: var(--surface); stroke-width: 1.5; }
.srv-cron-tick { stroke: var(--text-muted); stroke-width: 1.5; stroke-linecap: round; }
.srv-cron-tick.srv-cron-first { stroke: var(--primary); stroke-width: 2.5; }
.sz-sim { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 8px; }
.sz-sim:empty { display: none; }
.sz-sim-head { font-size: 13px; font-weight: 700; }
.sz-sim th, .sz-sim td { padding: 6px 10px; font-size: 13px; }
.sz-sim .sz-sim-sum td { font-weight: 700; }
.sim-up { color: #059669; font-weight: 600; }
.sim-down { color: #dc2626; font-weight: 600; }
.php-err td.php-msg, #au-list td.php-msg { white-space: normal; min-width: 16em; max-width: 460px; overflow-wrap: anywhere; }
td.mono { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
#sz-idle td { white-space: normal; }

/* ============ Fee / Lizenzeinnahmen ============ */
.fee-chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 24px;
}
.fee-chart-card h3 {
  font-size: 15px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px;
}
.fee-chart-card .subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.fee-chart-scroll { overflow-x: auto; padding-bottom: 8px; }
.fee-chart-scroll svg { display: block; }
.fee-chart-scroll svg rect.fee-seg { transition: opacity .15s; cursor: default; }
.fee-chart-scroll svg rect.fee-seg:hover { opacity: .8; }
.fee-axis { stroke: var(--border); stroke-width: 1; }
.fee-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; opacity: .6; }
.fee-axis-label { fill: var(--text-soft); font-size: 11px; }
.fee-month-label { fill: var(--text-muted); font-size: 11px; }
.fee-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fee-legend .item {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none; transition: opacity .15s, background .15s;
}
.fee-legend .item:hover { background: var(--surface); }
.fee-legend .item.off { opacity: .4; }
.fee-legend .item .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.fee-legend .item .amt { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }

/* ============ Portale ============ */
.portal-server-group { margin-bottom: 28px; }
.portal-server-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-size: 16px; font-weight: 700;
}
.portal-server-head::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent-grad); flex-shrink: 0;
}
.portal-server-head .count { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.portal-grid { columns: 300px; column-gap: 16px; }
.portal-grid > .portal-card { break-inside: avoid; -webkit-column-break-inside: avoid; margin: 0 0 16px; }
.portal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.portal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.portal-card.changed { animation: portalPulse 1.8s ease-out; }
@keyframes portalPulse {
  0%   { box-shadow: 0 0 0 0 rgba(79,70,229,.55); border-color: var(--primary); }
  70%  { box-shadow: 0 0 0 10px rgba(79,70,229,0); border-color: var(--primary); }
  100% { box-shadow: var(--shadow-sm); border-color: var(--border); }
}
.portal-shots { display: flex; gap: 2px; background: var(--surface-2); }
.portal-shot { flex: 1; position: relative; min-height: 100px; display: flex; align-items: center; justify-content: center; }
.portal-shot:has(> .shot-empty) { min-height: 0; }
.portal-shot img { width: 100%; height: auto; display: block; cursor: zoom-in; }
.portal-shot .shot-tag {
  position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-pill);
}
.portal-shot .shot-empty {
  color: var(--text-soft); font-size: 11px; padding: 10px 8px; text-align: center; width: 100%;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); margin: 8px; background: var(--surface-2);
}
.portal-site + .portal-site { border-top: 2px solid var(--border); margin-top: 4px; }
.portal-site-url {
  font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface-2);
  padding: 7px 12px; word-break: break-all; display: flex; align-items: center; gap: 6px;
  border-bottom: 1px solid var(--border);
}
.portal-site-url::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #10b981; flex-shrink: 0;
}
.portal-card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.portal-card-title { font-weight: 700; font-size: 15px; word-break: break-word; }
.portal-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.portal-card-foot { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.badge-purple { background: rgba(124,58,237,.12); color: #7c3aed; }

/* Live-Indikator */
.live-indicator {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 8px 14px;
}
.live-indicator .live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #10b981; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16,185,129,.6); animation: livePulse 2s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}
.live-sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; opacity: .45; margin: 0 7px; vertical-align: middle; }

/* Portale Toolbar */
.portal-toolbar { margin-bottom: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.portal-toolbar .live-indicator { margin-left: auto; }
.portal-count { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.fee-range-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.fee-range-sep { font-size: 13px; color: var(--text-soft); }
.fee-preset {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: var(--radius-pill); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.fee-preset:hover { background: var(--surface); border-color: var(--text-soft); }
.fee-trend { stroke: #e11d48; stroke-width: 2.5; stroke-dasharray: 6 4; fill: none; opacity: .95; }
.fee-trend-dot { fill: #e11d48; }
.fee-cost { stroke: #f59e0b; stroke-width: 2.5; fill: none; }
.fee-cost-dot { fill: #f59e0b; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast .t { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 14px; color: var(--text); max-width: 360px; animation: toastIn .2s ease; }
.toast .t.ok { border-left-color: #10b981; }
.toast .t.err { border-left-color: #ef4444; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); margin-left: 10px; vertical-align: middle; font-variant-numeric: tabular-nums; }
.stat-trend.up { color: #dc2626; background: rgba(220, 38, 38, .12); }
.stat-trend.down { color: #059669; background: rgba(5, 150, 105, .12); }
.stat-trend.flat { color: var(--text-soft); background: var(--surface-2); }
.fee-preset.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.fee-legend .item { cursor: pointer; }
.fee-legend .item.off { text-decoration: line-through; }
.btn-spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(127, 127, 127, .35); border-top-color: currentColor; border-radius: 50%; vertical-align: -2px; margin-right: 8px; animation: btnspin .7s linear infinite; }
@keyframes btnspin { to { transform: rotate(360deg); } }
.cost-tip { position: fixed; z-index: 400; display: none; pointer-events: none; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--text); min-width: 180px; max-width: 300px; }
.cost-tip .ct-h { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.cost-tip .ct-est { font-size: 11px; font-weight: 600; color: var(--text-soft); }
.cost-tip .ct-r, .cost-tip .ct-t { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.cost-tip .ct-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.cost-tip .ct-n { flex: 1; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-tip .ct-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-tip .ct-t { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--border); }
.cost-tip .ct-t .ct-n { color: var(--text); font-weight: 700; }
.cost-tip .ct-d { margin-top: 4px; font-size: 12px; color: var(--text-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stat-card-link { cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.stat-card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.dash-widgets { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 20px; }
.dash-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.dash-row:last-child { border-bottom: none; }
.dash-row-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-row-val { color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: 12px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.dash-bar-label { width: 120px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dash-bar-track { flex: 1; height: 8px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--accent-grad); border-radius: var(--radius-pill); }
.dash-bar-val { width: 34px; text-align: right; color: var(--text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-empty { color: var(--text-soft); font-size: 13px; padding: 12px 0; }
.dash-section { font-size: 16px; font-weight: 700; margin: 32px 0 12px; }
.dx-widgets { margin: -8px 0 8px; }
.dx-widgets .panel-body { padding: 8px 20px; }
.dx-widgets .dash-row-name { min-width: 35%; }
.dx-widgets .dash-row-val { white-space: normal; text-align: right; }
.dx-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
#dash-extra .stat-label { text-transform: none; }
.dx-ok { color: #10b981 !important; -webkit-text-fill-color: #10b981; }
/* Verlaufsschrift der Kennzahl ueberdeckt sonst die Warnfarbe */
.stat-card .stat-value.srv-warn { -webkit-text-fill-color: #d97706; }
.stat-card .stat-value.srv-crit { -webkit-text-fill-color: #dc2626; }
.stat-card .stat-value.dx-ok { -webkit-text-fill-color: #10b981; }

/* Skeleton-Ladeanimation */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.skel-card { height: 220px; border-radius: var(--radius); border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: skelShimmer 1.3s ease-in-out infinite; }
@keyframes skelShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Lightbox */
#portal-lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.8);
  display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
#portal-lightbox.open { display: flex; }
#portal-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: var(--shadow-lg); }
#portal-lightbox .lb-nav, #portal-lightbox .lb-close {
  position: absolute; z-index: 2; cursor: pointer; border: none; color: #fff;
  background: rgba(0,0,0,.45); border-radius: 50%; display: flex; align-items: center;
  justify-content: center; line-height: 1; transition: background .15s, transform .15s;
}
#portal-lightbox .lb-nav:hover, #portal-lightbox .lb-close:hover { background: rgba(0,0,0,.7); transform: scale(1.06); }
#portal-lightbox .lb-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 30px; }
#portal-lightbox .lb-nav:hover { transform: translateY(-50%) scale(1.06); }
#portal-lightbox .lb-prev { left: 20px; }
#portal-lightbox .lb-next { right: 20px; }
#portal-lightbox .lb-close { top: 20px; right: 20px; width: 42px; height: 42px; font-size: 26px; }
#portal-lightbox .lb-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 2;
  color: #fff; background: rgba(0,0,0,.5); font-size: 13px; font-weight: 600;
  padding: 5px 12px; border-radius: var(--radius-pill);
}

/* ============ UI-Erweiterungen (features.js: Titel, Status, Dialog, Tabellen) ============ */
.sr-only, .page > h2 { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 500; padding: 8px 14px; border: 0; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.skip-link:focus { top: 12px; }
button:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.topbar-heading { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-meta { display: flex; align-items: center; gap: 6px; min-height: 16px; font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.page-meta:empty { display: none; }
.page-meta .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; animation: livePulse 2s infinite; }
.page-meta .live-sep { margin: 0 2px; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; background: var(--primary-soft); color: var(--primary); }
.nav-badge-warn { background: rgba(217, 119, 6, .14); color: #d97706; }
.nav-badge-crit { background: #dc2626; color: #fff; }
.ui-todo { margin-bottom: 20px; }
.ui-todo .panel-body { padding: 6px 8px; }
.ui-todo-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; }
button.ui-todo-row { cursor: pointer; }
button.ui-todo-row:hover { background: var(--surface-2); }
.ui-todo-row > span:nth-child(2) { flex: 1; min-width: 0; }
.ui-todo-row .btn-spin { margin-right: 0; }
.ui-todo-go { color: var(--text-soft); font-size: 18px; line-height: 1; }
.ui-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--text-soft); }
.ui-dot-crit { background: #dc2626; }
.ui-dot-warn { background: #d97706; }
.ui-dot-info { background: var(--primary); }
.ui-dot-ok { background: #10b981; }
.loading.ui-busy::before { content: ""; display: inline-block; width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px; border: 2px solid rgba(127, 127, 127, .35); border-top-color: currentColor; border-radius: 50%; animation: btnspin .7s linear infinite; }
.ui-elapsed { font-variant-numeric: tabular-nums; opacity: .75; }
.loading.ui-error { color: #dc2626; }
.loading.ui-error .cfg-btn { margin-left: 8px; }
.panel-body:has(> table) { max-height: min(75vh, 900px); overflow: auto; }
th.ui-sortable { cursor: pointer; user-select: none; }
th.ui-sortable:hover { color: var(--text); }
th.ui-sortable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 4px; }
th.ui-sortable[aria-sort="ascending"], th.ui-sortable[aria-sort="descending"] { color: var(--primary); }
th.ui-sortable[aria-sort="ascending"]::after { content: " \25B2"; }
th.ui-sortable[aria-sort="descending"]::after { content: " \25BC"; }
.ui-csv { flex-shrink: 0; }
.ui-tools { display: flex; justify-content: flex-end; padding: 8px 12px 0; }
.ui-dlg { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); padding: 0; margin: auto; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto; }
.ui-dlg::backdrop { background: rgba(15, 18, 30, .45); }
.ui-dlg-body { display: grid; gap: 14px; padding: 18px 22px; font-size: 14px; }
.ui-dlg-body .cfg-dlg-body { padding: 0; }
.ui-dlg-text { color: var(--text-muted); white-space: pre-wrap; line-height: 1.5; }
.ui-warn { padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(220, 38, 38, .1); color: #dc2626; font-weight: 600; white-space: pre-wrap; }
.ui-type { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.ui-type .collection-select { min-width: 0; cursor: text; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ui-chip { border: 0; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ui-chip:hover { text-decoration: underline; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  #app { padding-left: 0; }
  .sidebar-resizer { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; background: var(--surface); box-shadow: var(--shadow-lg); visibility: hidden; }
  #app.nav-open .sidebar { transform: none; visibility: visible; }
  #app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .45); }
  .topbar {
    position: sticky; top: 0; z-index: 50; height: 58px; min-height: 0; max-width: none; margin: 0; padding: 0 16px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  .topbar .menu-btn { display: inline-flex; }
  .topbar-title { display: block; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar + .content { margin-top: 20px; }
}
@media (max-width: 720px) {
  .content { margin: 20px auto; padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card .stat-value { font-size: 20px; }
}

/* ============ Hilfsklassen (ersetzen Inline-Styles; !important = Vorrang wie style-Attribut) ============ */
[hidden] { display: none !important; }
.u-mb-8 { margin-bottom: 8px !important; }
.u-mb-12 { margin-bottom: 12px !important; }
.u-mb-16 { margin-bottom: 16px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-m-0 { margin: 0 !important; }
.u-ml-auto { margin-left: auto !important; }
.u-minw-0 { min-width: 0 !important; }
.u-minw-140 { min-width: 140px !important; }
.u-minw-160 { min-width: 160px !important; }
.u-minw-170 { min-width: 170px !important; }
.u-minw-180 { min-width: 180px !important; }
.u-minw-190 { min-width: 190px !important; }
.u-minw-200 { min-width: 200px !important; }
.u-minw-220 { min-width: 220px !important; }
.u-minw-240 { min-width: 240px !important; }
.u-minw-260 { min-width: 260px !important; }
.u-minw-280 { min-width: 280px !important; }
.u-maxw-320 { max-width: 320px !important; }
.u-grow { flex: 1 1 300px !important; min-width: 0 !important; }
.u-p-8-20 { padding: 8px 20px !important; }
.u-p-12-16 { padding: 12px 16px !important; }
.u-p-12-20 { padding: 12px 20px !important; }
.u-p-16-20 { padding: 16px 20px !important; }
.u-pl-28 { padding-left: 28px !important; }
.u-w-1pct { width: 1% !important; }
.u-nowrap { white-space: nowrap !important; }
.u-text { color: var(--text) !important; }
.u-muted { color: var(--text-muted) !important; }
.u-soft { color: var(--text-soft) !important; }
.u-ok { color: #10b981 !important; }
.u-fs-26 { font-size: 26px !important; }
.u-lead { font-size: 1.1em !important; line-height: 1.6 !important; }
.u-pointer { cursor: pointer !important; }
.u-bg-indigo { background: #4f46e5 !important; }
.u-bg-amber { background: #f59e0b !important; }
/* display ohne !important, damit Skripte per style.display weiterhin umschalten koennen */
.u-row { display: flex; gap: 8px !important; align-items: center !important; }
.u-check-inline { display: inline-flex; align-items: center !important; gap: 6px !important; cursor: pointer !important; margin-left: 8px !important; }
.u-meter { flex: 1 !important; height: 10px !important; background: var(--surface-2) !important; border-radius: 5px !important; overflow: hidden !important; }
.u-spark { width: 100% !important; height: 90px !important; }
.u-axis { display: flex; justify-content: space-between !important; font-size: 11px !important; color: var(--text-soft) !important; margin-top: 4px !important; }
.u-more { text-align: center !important; color: var(--text-soft) !important; padding: 12px !important; }

/* ============ Live-Auftraege (#live) ============ */
.lv-b-done { background: linear-gradient(180deg, #34d399, #10b981); }
.lv-b-billed { background: linear-gradient(180deg, #818cf8, #4f46e5); }
/* 6 Kacheln: 3 x 2, breit in einer Zeile, schmal 2 x 3 (keine halb leere Zeile) */
.lv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (min-width: 1500px) { .lv-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lv-kpis > .loading { grid-column: 1 / -1; }
.lv-kpi {
  position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.lv-kpi::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--accent-grad); opacity: .75;
}
#lv-k-done::after { background: linear-gradient(90deg, #34d399, #10b981); }
.lv-kpi-value { font-size: clamp(26px, 2.2vw, 34px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
#lv-k-done .lv-kpi-value { color: #10b981; }
#lv-k-billed .lv-kpi-value, #lv-k-fee .lv-kpi-value { color: var(--primary); }
.lv-kpi-label { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.lv-kpi-sub { margin-top: 2px; font-size: 12px; color: var(--text-soft); }
.lv-kpi-sub span { white-space: nowrap; }
.lv-kpi-prog { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.lv-kpi-prog[hidden] { display: none; }
.lv-kpi-prog i { display: block; width: 0; height: 100%; border-radius: 2px; background: currentColor; opacity: .7; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
#lv-k-done .lv-kpi-prog { color: #10b981; }
#lv-k-billed .lv-kpi-prog, #lv-k-fee .lv-kpi-prog { color: var(--primary); }
#lv-k-created .lv-kpi-prog { color: #d97706; }
.lv-kpi-prog.lv-over i { opacity: 1; background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24); background-size: 200% 100%; animation: lvShine 2.4s linear infinite; }
@keyframes lvShine { from { background-position: 200% 0; } to { background-position: 0 0; } }
.lv-roll { display: inline-block; animation: lvRoll .5s cubic-bezier(.2, .8, .2, 1) both; }
/* rollende Ziffern sind einzelne inline-blocks: ohne nowrap bricht die Zahl waehrend der Animation um */
[data-num] { white-space: nowrap; }
@keyframes lvRoll { from { transform: translateY(.7em); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-kpi-cmp { margin-top: 2px; font-size: 12px; color: var(--text-soft); min-height: 16px; }
.lv-kpi-cmp span { white-space: nowrap; }
.lv-up { color: #059669; font-weight: 600; }
.lv-down { color: #dc2626; font-weight: 600; }
#lv-k-created .lv-kpi-value { color: #d97706; }
#lv-k-created::after { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
/* Anmeldungen: immer eine eigene ganze Zeile unter den 6 Kacheln, links Zahlen, rechts Stundenverlauf */
.lv-kpi-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); gap: 24px; align-items: center; }
@media (max-width: 560px) { .lv-kpi-wide { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
#lv-k-login .lv-kpi-value { color: #0284c7; }
#lv-k-login::after { background: linear-gradient(90deg, #38bdf8, #0284c7); }
#lv-login-hours .lv-mk { height: 64px; }
.lv-mk.lv-mk-login rect { fill: #0ea5e9; }
.lv-mk.lv-mk-login rect.lv-mk-fail { fill: #ef4444; }
.lv-mk.lv-mk-login rect.lv-mk-hit { fill: transparent; }
.lv-dr-bar.lv-login-key { background: #0ea5e9; }
.lv-dr-bar.lv-loginfail-key { margin-left: 8px; background: #ef4444; }
.lv-alerts { display: flex; flex-direction: column; gap: 8px; }
.lv-alerts:not(:empty) { margin-bottom: 16px; }
.lv-alert { padding: 10px 14px; border: 1px solid #f59e0b; border-left-width: 4px; border-radius: var(--radius-sm); background: rgba(245, 158, 11, .1); font-size: 13px; }
.lv-kpi.lv-bump { animation: lvBump 1.2s ease-out; }
.lv-kpi.lv-bump .lv-kpi-value { animation: lvValFlash 1.2s ease-out; }
@keyframes lvBump {
  0%, 35% { border-color: color-mix(in srgb, #10b981 70%, var(--border)); }
  100% { border-color: var(--border); }
}
@keyframes lvValFlash { 0% { filter: brightness(1.35) saturate(1.2); } 100% { filter: none; } }
.lv-spark { display: flex; align-items: flex-end; gap: 1px; height: 30px; margin-top: 8px; }
.lv-spark span { flex: 1; height: 4%; border-radius: 1px; background: var(--border); transition: height .5s ease; }
.lv-spark span.on { background: linear-gradient(180deg, #818cf8, #10b981); }
.lv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.lv-main { min-width: 0; }
.lv-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
/* Mauerwerk: Zeilenhoehe 4px, Spanne je Kachel setzt lvMasonry (live.js); Spaltenabstand = LV_TILE_GAP */
.lv-main.lv-masonry { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 4px; gap: 0 20px; align-items: start; }
.lv-main.lv-masonry .lv-row2 { display: contents; }
.lv-main.lv-masonry .panel { margin-bottom: 0; }
.lv-main.lv-masonry > .panel:first-child { grid-column: 1 / -1; }
.lv-note { font-size: 12px; font-weight: 500; color: var(--text-soft); margin-left: 6px; }
.lv-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-muted); }
.lv-dot { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; }
.lv-chart { padding: 16px 20px 12px; }
.lv-bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; border-bottom: 1px solid var(--border); }
.lv-chart-sm .lv-bars { height: 140px; }
.lv-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 6px 6px 0 0; transition: background .2s; }
.lv-col:hover { background: var(--surface-2); }
.lv-col.lv-now { background: color-mix(in srgb, var(--primary) 8%, transparent); }
/* laufende Stunde: wandernde Streifen im Balken und Strich fuer die aktuelle Minute */
.lv-col.lv-now .lv-bar { overflow: hidden; }
.lv-col.lv-now .lv-bar::after {
  content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .28) 0 5px, transparent 5px 10px);
  background-size: 14.14px 14.14px; animation: lvStripes 1.2s linear infinite;
}
@keyframes lvStripes { to { background-position: 14.14px 0; } }
.lv-col.lv-now::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--lv-min, 0%); width: 0; border-left: 1.5px dashed var(--primary); opacity: .6; pointer-events: none;
}
.lv-col.lv-future .lv-bar { opacity: .35; }
.lv-col.lv-future .lv-avg { opacity: .3; }
.lv-slot { position: relative; width: 42%; max-width: 18px; height: 100%; }
.lv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border-radius: 4px 4px 0 0; transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.lv-ghost { position: absolute; left: 0; right: 0; bottom: 0; height: 0; border: 1.5px dashed; border-bottom: 0; border-radius: 4px 4px 0 0; opacity: .7; transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.lv-g-done { border-color: #10b981; }
.lv-g-billed { border-color: #4f46e5; }
.lv-avg { position: absolute; left: -3px; right: -3px; height: 2px; margin-bottom: -1px; border-radius: 1px; background: var(--text); opacity: .55; transition: bottom .8s cubic-bezier(.2, .8, .2, 1); }
.lv-avg[hidden], .lv-ghost[hidden] { display: none; }
.lv-key-avg { width: 12px; height: 2px; margin-left: 8px; background: var(--text); opacity: .55; }
.lv-key-ghost { width: 10px; height: 10px; margin-left: 8px; border: 1.5px dashed #10b981; border-bottom: 0; border-radius: 3px 3px 0 0; }
.lv-axis { display: flex; gap: 4px; margin-top: 6px; font-size: 11px; color: var(--text-soft); }
.lv-axis span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.lv-top { padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 10px; }
.lv-top-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px; grid-template-areas: "name num" "track num"; column-gap: 10px; row-gap: 4px; align-items: center; }
.lv-top-name { grid-area: name; display: flex; gap: 6px; align-items: baseline; font-size: 13px; font-weight: 600; min-width: 0; }
.lv-top-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-top-server { font-size: 11px; font-weight: 500; color: var(--text-soft); }
.lv-top-track { grid-area: track; display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.lv-top-track span { height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.lv-top-num { grid-area: num; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-move { flex: none; font-size: 10px; line-height: 1; animation: lvMoveIn .5s cubic-bezier(.3, 1.4, .5, 1) both; }
.lv-move-up { color: #059669; }
.lv-move-down { color: #dc2626; }
@keyframes lvMoveIn { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-top-row.lv-lead-new { border-radius: 6px; animation: lvLead 3s ease-out; }
@keyframes lvLead {
  0%, 30% { background: color-mix(in srgb, #f59e0b 18%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, #f59e0b 18%, transparent); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}
.lv-feed-panel { position: sticky; top: 16px; display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.lv-feed { list-style: none; overflow-y: auto; flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.lv-item {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--surface-2);
}
.lv-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.lv-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lv-done .lv-ico { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 4px 10px rgba(16, 185, 129, .3); }
.lv-billed .lv-ico { background: var(--accent-grad); box-shadow: 0 4px 10px rgba(79, 70, 229, .3); }
.lv-created .lv-ico { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 4px 10px rgba(217, 119, 6, .3); }
.lv-appt .lv-ico { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 4px 10px rgba(8, 145, 178, .3); }
.lv-deferred .lv-ico { background: linear-gradient(135deg, #94a3b8, #64748b); box-shadow: 0 4px 10px rgba(100, 116, 139, .3); }
.lv-login .lv-ico { background: linear-gradient(135deg, #38bdf8, #0284c7); box-shadow: 0 4px 10px rgba(2, 132, 199, .3); }
.lv-loginfail .lv-ico { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 4px 10px rgba(220, 38, 38, .3); }
.lv-item.lv-portal { border: 1px dashed #a855f7; border-left: 4px solid #a855f7; background: color-mix(in srgb, #a855f7 8%, var(--surface-2)); }
.lv-portal .lv-ico { outline: 2px solid #a855f7; outline-offset: 2px; }
.lv-src { margin-left: 4px; font-size: 10px; vertical-align: 1px; }
.lv-more { margin-left: 4px; font-size: 11px; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.lv-item.lv-group { box-shadow: 3px 3px 0 -1px var(--surface-2), 3px 3px 0 0 var(--border); }
.lv-item.lv-group.lv-open { box-shadow: none; border-color: var(--border); }
.lv-item.lv-grouped { margin-left: 18px; padding-top: 6px; padding-bottom: 6px; }
.lv-lat-warn { color: #d97706; }
.lv-lat-bad { color: #dc2626; font-weight: 600; }
.lv-srv-silent { color: #d97706; font-weight: 600; }
.lv-map { --lv-c: #10b981; padding: 8px 12px 0; }
.lv-map svg { display: block; width: 100%; height: 340px; }
.lv-map-land { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; stroke-linejoin: round; }
.lv-z { fill: color-mix(in srgb, var(--lv-c) 35%, transparent); stroke: var(--lv-c); stroke-width: 1.5; }
.lv-z:hover { fill: color-mix(in srgb, var(--lv-c) 60%, transparent); }
.lv-ping { fill: none; stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: lvPing 2.4s ease-out .35s both; pointer-events: none; }
@keyframes lvPing { from { transform: scale(.3); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }
.lv-drop { transform-box: fill-box; transform-origin: center; animation: lvDrop .9s cubic-bezier(.3, 1.3, .5, 1) both; pointer-events: none; }
@keyframes lvDrop { 0% { transform: translateY(-70px) scale(.6); opacity: 0; } 40% { transform: none; opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.lv-map-fade #lv-map-heat, .lv-map-fade #lv-map-dots, .lv-map-fade #lv-map-labels { animation: lvFade .45s ease-out; }
@keyframes lvFade { from { opacity: 0; } to { opacity: 1; } }
.lv-map-note { padding: 6px 8px 14px; font-size: 12px; color: var(--text-soft); }
.lv-bd { padding: 14px 20px 16px; }
.lv-bd-title { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.lv-stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); }
.lv-stack span { height: 100%; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.lv-bd-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 16px; font-size: 12px; color: var(--text-muted); }
.lv-bd-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.lv-top.lv-top-flat { padding: 0; }
.lv-hl { list-style: none; margin: 0; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.lv-hl li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.lv-hl li.lv-empty { display: block; background: none; }
.lv-hl svg { flex: none; width: 18px; height: 18px; fill: none; stroke: #f59e0b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lv-hl li.lv-hl-new { animation: lvGlowY 3s ease-out; }
@keyframes lvGlowY { 0%, 30% { background: rgba(245, 158, 11, .22); } 100% { background: var(--surface-2); } }
.lv-hl li { position: relative; }
.lv-burst { position: absolute; left: 19px; top: 17px; width: 0; height: 0; pointer-events: none; }
.lv-burst i { position: absolute; width: 6px; height: 9px; margin: -4px 0 0 -3px; border-radius: 1px; animation: lvBurst 1.2s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes lvBurst {
  0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 26px)) rotate(var(--r)) scale(1); opacity: 0; }
}
.lv-brief { min-height: 72px; padding: 14px 20px 6px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.lv-brief.lv-brief-busy { color: var(--text-soft); }
.lv-brief-meta { padding: 0 20px 14px; font-size: 11px; color: var(--text-soft); }
#lv-brief-btn { padding: 6px 12px; font-size: 13px; }
#lv-brief-btn:disabled { opacity: .6; cursor: wait; }
.lv-alert.lv-info { border-color: var(--primary); background: var(--primary-soft); }
.lv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-chips:not(:empty) { margin-bottom: 14px; }
.lv-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--primary); border-radius: 999px; background: var(--primary-soft); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.lv-chip:hover { filter: brightness(.97); }
.lv-click, #lv-hours .lv-col, .lv-z { cursor: pointer; }
.lv-click:focus-visible, #lv-hours .lv-col:focus-visible, .lv-z:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.lv-top-row.lv-sel, .lv-dur-row.lv-sel { border-radius: 6px; box-shadow: 0 0 0 2px var(--primary); }
.lv-bd-legend .lv-sel, .lv-servers .lv-sel { text-decoration: underline; font-weight: 700; color: var(--text); }
.lv-col.lv-sel { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.lv-z.lv-sel { stroke-width: 4; fill: color-mix(in srgb, var(--lv-c) 70%, transparent); }
.lv-col.lv-hol .lv-bar { opacity: .5; }
.lv-net { display: flex; gap: 4px; height: 36px; margin-top: 6px; position: relative; }
.lv-net::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--border); }
.lv-net span { flex: 1; position: relative; }
.lv-net i { position: absolute; left: 30%; right: 30%; height: 0; border-radius: 2px; transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.lv-net i.lv-net-up { bottom: 50%; background: #f59e0b; }
.lv-net i.lv-net-down { top: 50%; background: #10b981; }
.lv-net-txt-up { color: #d97706; }
.lv-net-txt-down { color: #059669; }
.lv-field { padding: 14px 20px 16px; }
.lv-field-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.lv-field-kpis div { display: flex; flex-direction: column; gap: 2px; }
.lv-field-kpis strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-field-kpis strong small { margin-left: 6px; font-size: 13px; font-weight: 600; color: var(--text-soft); }
.lv-field-kpis span { font-size: 11px; color: var(--text-soft); line-height: 1.3; }
.lv-mini { display: flex; align-items: flex-end; gap: 2px; height: 70px; border-bottom: 1px solid var(--border); }
.lv-mini span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.lv-mini i { flex: none; width: 100%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #22d3ee, #0891b2); transition: height .8s cubic-bezier(.2, .8, .2, 1); }
.lv-mini i.lv-mini-p, .lv-mini-legend i.lv-mini-p { background: repeating-linear-gradient(135deg, #f59e0b 0 3px, rgba(245, 158, 11, .45) 3px 6px); }
.lv-mini span.lv-now { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.lv-mini-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--text-soft); }
.lv-mini-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 11px; color: var(--text-soft); }
.lv-mini-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; background: linear-gradient(180deg, #22d3ee, #0891b2); }
.lv-heat { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 3px; }
.lv-heat-row { display: grid; grid-template-columns: 26px repeat(24, minmax(0, 1fr)); gap: 2px; align-items: center; }
.lv-heat-row i { display: block; height: 18px; border-radius: 3px; border: 1px solid var(--border); }
.lv-heat-row i.lv-now { outline: 2px solid var(--text); outline-offset: -1px; }
.lv-heat-head span { font-size: 10px; color: var(--text-soft); text-align: left; }
.lv-heat-wd { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.lv-dur-head { margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }
.lv-dur-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.4fr) 80px; gap: 10px; align-items: center; padding: 3px 0; font-size: 13px; }
.lv-dur-row .lv-stack { height: 10px; }
.lv-dur-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lv-dur-med { font-size: 12px; color: var(--text-muted); text-align: right; white-space: nowrap; }
@media (max-width: 720px) {
  .lv-field-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lv-body { min-width: 0; }
.lv-title { font-size: 14px; font-weight: 700; }
.lv-fee { color: var(--primary); font-variant-numeric: tabular-nums; margin-left: 4px; }
.lv-sub { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-sub .badge { padding: 1px 6px; font-size: 10px; }
.lv-time { font-size: 11px; color: var(--text-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-item.lv-new { animation: lvIn .6s cubic-bezier(.2, .8, .2, 1), lvGlow 2.4s ease-out; }
.lv-billed.lv-new { animation: lvIn .6s cubic-bezier(.2, .8, .2, 1), lvGlowB 2.4s ease-out; }
@keyframes lvIn { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lvGlow { 0%, 30% { border-color: #10b981; background: rgba(16, 185, 129, .14); } 100% { border-color: transparent; background: var(--surface-2); } }
@keyframes lvGlowB { 0%, 30% { border-color: var(--primary); background: var(--primary-soft); } 100% { border-color: transparent; background: var(--surface-2); } }
.lv-empty { padding: 24px 12px; text-align: center; font-size: 13px; color: var(--text-soft); list-style: none; }
.lv-servers { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-soft); }
.lv-tv-btn { margin-left: auto; }
.lv-tv-bar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; margin: 0 -20px 14px; padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.lv-tv-bar[hidden] { display: none; }
.lv-tv-bar .refresh-btn { padding: 6px 12px; font-size: 13px; }
.lv-tv-bar .refresh-btn[hidden] { display: none; }
.lv-tv-clock { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lv-tv-step { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 700; }
.lv-tv-lock { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
body.lv-tv-on #app { padding-left: 0; }
body.lv-tv-on .sidebar, body.lv-tv-on .sidebar-backdrop, body.lv-tv-on .topbar, body.lv-tv-on .skip-link,
body.lv-tv-on #page-live > h2, body.lv-tv-on #page-live > .portal-toolbar { display: none; }
body.lv-tv-on .content { max-width: none; margin: 0; padding: 0 20px 12px; }
body.lv-tv-on .lv-kpi-value { font-size: clamp(30px, 3vw, 52px); }
body.lv-tv-on .lv-grid { grid-template-columns: minmax(0, 1fr) 420px; }
body.lv-tv-on .lv-feed-panel { top: 72px; max-height: calc(100vh - 88px); }
@media (min-width: 1500px) {
  /* Paare aufloesen: alle Kacheln fliessen in so viele Spalten wie Platz ist, der Stundenverlauf bleibt ganz oben */
  .lv-main { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
  .lv-main .lv-row2 { display: contents; }
  .lv-main .panel { margin-bottom: 0; }
  .lv-main > .panel:first-child { grid-column: 1 / -1; }
  .lv-main.lv-masonry { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
}
@media (min-width: 1700px) {
  .lv-grid { grid-template-columns: minmax(0, 1fr) 440px; }
}
@media (max-width: 1100px) {
  .lv-grid, body.lv-tv-on .lv-grid { grid-template-columns: minmax(0, 1fr); }
  .lv-feed-panel { position: static; max-height: 560px; }
}
@media (max-width: 720px) {
  .lv-row2, .lv-main.lv-masonry { grid-template-columns: minmax(0, 1fr); }
  .lv-bars { gap: 2px; height: 160px; }
  .lv-axis { gap: 2px; }
  .lv-kpi-value { font-size: 28px; }
}
/* Stundenauswahl per Ziehen */
#lv-hours .lv-bars { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.lv-col.lv-brush { background: color-mix(in srgb, var(--primary) 24%, transparent); }
/* Ticker: Anhalten, Suche, Hinweis auf neue Meldungen, Klick auf Eintrag */
.lv-feed-panel .panel-header { padding: 12px 16px; }
.lv-feed-pause { padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.lv-feed-pause[aria-pressed="true"], .lv-feed-panel.lv-held .lv-feed-pause { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.lv-feed-tools { padding: 8px 8px 0; }
.lv-feed-tools input { width: 100%; min-width: 0; padding: 8px 12px; font-size: 13px; }
.lv-feed-new {
  margin: 8px 8px 0; padding: 7px 12px; border: 0; border-radius: var(--radius-pill); background: var(--accent-grad); color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 12px rgba(79, 70, 229, .3); animation: lvIn .3s ease-out;
}
.lv-feed-new[hidden] { display: none; }
.lv-feed-panel.lv-held .lv-feed { box-shadow: inset 0 2px 0 var(--primary-soft); }
.lv-item { cursor: pointer; transition: border-color .15s, transform .15s; }
.lv-item:hover { border-color: var(--border); transform: translateX(-2px); }
.lv-item:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.lv-item.lv-active, .lv-top-row.lv-active { border-radius: 6px; box-shadow: 0 0 0 2px var(--primary); }
/* Detailleiste (Meldung, Mandant) */
.lv-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(420px, 100vw); display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: lvDrawerIn .25s cubic-bezier(.2, .8, .2, 1);
}
.lv-drawer[hidden] { display: none; }
@keyframes lvDrawerIn { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.lv-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.lv-drawer-head h3 { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.lv-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.lv-drawer-body .lv-bd-title { margin: 6px 0 -4px; }
.lv-drawer-body .lv-empty { padding: 12px 0; text-align: left; }
.lv-dr-head { display: flex; align-items: center; gap: 12px; }
.lv-dr-head strong { display: block; font-size: 16px; }
.lv-dr-head div span { display: block; font-size: 12px; color: var(--text-soft); }
.lv-dr-open { align-self: flex-start; text-decoration: none; }
.lv-dr-dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 13px; }
.lv-dr-dl dt { color: var(--text-soft); }
.lv-dr-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lv-dr-dl small, .lv-dr-line small { color: var(--text-soft); }
.lv-dr-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-dr-acts .refresh-btn { padding: 8px 14px; font-size: 13px; text-decoration: none; }
.lv-act {
  max-width: 100%; padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text);
  font-size: 12px; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lv-act:hover { border-color: var(--primary); }
.lv-act.lv-sel { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.lv-linkbtn { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.lv-linkbtn:hover { text-decoration: underline; }
.lv-dr-sub { font-size: 12px; color: var(--text-soft); }
.lv-dr-line { font-size: 13px; color: var(--text-muted); }
.lv-dr-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lv-dr-kpi { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.lv-dr-kpi strong { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-dr-kpi span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.lv-dr-kpi em { font-size: 11px; font-style: normal; color: var(--text-soft); }
.lv-mk { display: block; width: 100%; height: 72px; }
.lv-mk rect { fill: #10b981; opacity: .8; }
.lv-mk rect:hover { opacity: 1; }
.lv-mk rect.lv-mk-now { fill: var(--primary); opacity: 1; }
.lv-mk-avg { fill: none; stroke: var(--text); stroke-width: 1.5; stroke-linejoin: round; opacity: .5; vector-effect: non-scaling-stroke; }
.lv-mk-base { stroke: var(--border); vector-effect: non-scaling-stroke; }
.lv-dr-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-soft); }
.lv-dr-bar { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: #10b981; }
.lv-dr-avg { display: inline-block; width: 14px; height: 2px; margin-left: 8px; background: var(--text); opacity: .5; }
/* Karte: Ebenen, Zoom, Beschriftung */
.lv-map { position: relative; }
.lv-map.lv-zoomed svg { cursor: grab; touch-action: none; }
.lv-map.lv-dragging svg { cursor: grabbing; }
.lv-map-land, .lv-z, .lv-ping { vector-effect: non-scaling-stroke; }
#lv-map-heat circle { fill: var(--lv-c); }
.lv-z.lv-z-hit { fill: var(--lv-c); stroke: var(--surface); stroke-width: 1; }
#lv-map-labels text { fill: var(--text); font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; pointer-events: none; }
.lv-st { cursor: pointer; }
.lv-st:focus { outline: none; }
.lv-st circle { fill: color-mix(in srgb, var(--lv-c) 30%, transparent); stroke: var(--lv-c); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.lv-st:hover circle, .lv-st:focus-visible circle { fill: color-mix(in srgb, var(--lv-c) 55%, transparent); stroke-width: 3; }
.lv-st text { fill: var(--text); font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.lv-st text.lv-st-k { fill: var(--text-muted); font-weight: 600; }
.lv-map-ctl { position: absolute; top: 12px; right: 16px; display: flex; flex-direction: column; gap: 4px; }
.lv-map-ctl button {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: color-mix(in srgb, var(--surface) 90%, transparent);
  color: var(--text); font-size: 16px; font-weight: 700; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
}
.lv-map-ctl button:hover { border-color: var(--primary); color: var(--primary); }
.lv-seg { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-2); }
.lv-seg button { padding: 4px 10px; border: 0; border-radius: var(--radius-pill); background: none; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.lv-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
/* Tagesverlauf der Karte */
.lv-replay { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.lv-replay select { min-width: 0; padding: 6px 10px; font-size: 13px; }
.lv-rp-play {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--accent-grad); color: #fff; font-size: 12px; cursor: pointer;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .3);
}
.lv-rp-play:disabled { opacity: .4; cursor: default; box-shadow: none; }
.lv-rp-at { flex: 1; min-width: 60px; accent-color: var(--primary); }
.lv-rp-label { min-width: 84px; font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lv-rp-label.lv-live { color: #059669; }
.lv-rp-label.lv-live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #10b981; vertical-align: 1px; animation: lvLiveDot 1.6s infinite; }
@keyframes lvLiveDot { from { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } to { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } }
/* Live-Punkt im Kopf folgt der Verbindung zur Live-Datenbank */
body.lv-connecting .page-meta .live-dot { background: #94a3b8; animation: none; }
body.lv-offline .page-meta .live-dot { background: #dc2626; animation: none; }
body.lv-offline .page-meta .live-dot + span { color: #dc2626; }
body.lv-offline .page-meta .live-dot + span::after { content: " \2013  keine Verbindung"; }
/* Platzhalter mit Schimmer bis zum ersten Zeichnen */
.lv-wait .lv-kpi-value, .lv-wait .lv-kpi-label, .lv-wait .lv-bars, .lv-wait #lv-feed .loading, .lv-wait .lv-bd > .lv-empty, .lv-wait .lv-field > .lv-empty {
  color: transparent; border-radius: 6px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: skelShimmer 1.3s ease-in-out infinite;
}
.lv-wait .lv-kpi-value { width: 60%; }
.lv-wait .lv-kpi-label { width: 80%; }
.lv-wait .lv-bd > .lv-empty, .lv-wait .lv-field > .lv-empty, .lv-wait #lv-feed .loading { min-height: 96px; }
.lv-rp-live { padding: 4px 10px; border: 1px solid #10b981; border-radius: var(--radius-pill); background: rgba(16, 185, 129, .1); color: #059669; font-size: 12px; font-weight: 700; cursor: pointer; }
.lv-rp-live[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .lv-bar, .lv-ghost, .lv-avg, .lv-top-track span, .lv-spark span, .lv-stack span, .lv-net i, .lv-mini i { transition: none; }
  .lv-item.lv-new, .lv-billed.lv-new, .lv-kpi.lv-bump, .lv-hl li.lv-hl-new, .lv-ping { animation: none; }
  .lv-drawer, .lv-feed-new, .lv-rp-label.lv-live::before { animation: none; }
  .lv-kpi.lv-bump .lv-kpi-value, .lv-roll, .lv-col.lv-now .lv-bar::after, .lv-kpi-prog.lv-over i, .lv-burst, .lv-drop, .lv-map-fade g { animation: none; }
  .lv-move, .lv-top-row.lv-lead-new { animation: none; }
  .lv-wait .lv-kpi-value, .lv-wait .lv-kpi-label, .lv-wait .lv-bars, .lv-wait #lv-feed .loading, .lv-wait .lv-bd > .lv-empty, .lv-wait .lv-field > .lv-empty { animation: none; }
  .lv-kpi-prog i { transition: none; }
  .lv-item { transition: none; }
}

/* Systemstatus (#systemstate): Matrix Pruefung x Server */
.ss-matrix th, .ss-matrix td { padding: 7px 12px; font-size: 12.5px; }
.ss-matrix thead th:first-child { left: 0; z-index: 3; }
.ss-matrix th.ss-srv { text-transform: none; letter-spacing: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.ss-matrix td.ss-name { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 180px; max-width: 280px; white-space: normal; font-weight: 600; }
.ss-matrix tbody tr { cursor: pointer; }
.ss-matrix tbody tr:hover td.ss-name { background: var(--surface-2); }
.ss-matrix tbody tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.ss-matrix td.ss-cell { max-width: 180px; }
.ss-matrix.ss-single { table-layout: fixed; }
.ss-matrix.ss-single th:first-child { width: 32%; }
.ss-matrix.ss-single td.ss-cell { max-width: none; white-space: pre-line; }
.ss-bg-error { background: rgba(220, 38, 38, .07); }
.ss-bg-warn { background: rgba(217, 119, 6, .07); }
.ss-bg-unknown { background: rgba(124, 58, 237, .06); }
.ss-v { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; }
.ss-single .ss-v, .ss-full .ss-v { display: inline; }
.ss-v::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-soft); }
.ss-single .ss-v::before { margin-right: 6px; }
.ss-v.ss-error::before { background: #dc2626; }
.ss-v.ss-warn::before { background: #d97706; }
.ss-v.ss-unknown::before { background: #7c3aed; }
.ss-v.ss-ok::before { background: #10b981; }
.ss-v.ss-none { color: var(--text-soft); }
.ss-v.ss-none::before { display: none; }
.ss-badge-error { background: rgba(220, 38, 38, .12); color: #dc2626; }
.ss-badge-warn { background: rgba(217, 119, 6, .12); color: #d97706; }
.ss-badge-unknown { background: rgba(124, 58, 237, .12); color: #7c3aed; }
.ss-badge-ok { background: rgba(16, 185, 129, .12); color: #10b981; }
.ss-badge-info { background: var(--surface-2); color: var(--text-muted); }
.ss-full .ss-v::before { display: none; }
#ss-dialog { width: min(900px, calc(100vw - 32px)); overflow: auto; }
.ss-srv-link, .srv-title-link { font-weight: 600; text-decoration: none; color: inherit; }
.ss-srv-link:hover, .srv-title-link:hover { color: var(--primary); text-decoration: underline; }

/* Server-Details (#server) */
.sv-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(560px, 100%), 1fr)); gap: 16px; align-items: start; }
.sv-grid > .panel { margin-bottom: 0; }
.sv-head-r { display: inline-flex; gap: 8px; align-items: center; }
.sv-card .sizing-card { border: 0; box-shadow: none; margin: 0; background: transparent; }
.sv-table td { padding: 8px 20px; vertical-align: top; }
.sv-table td.sv-name { width: 38%; max-width: 260px; white-space: normal; color: var(--text-muted); font-weight: 600; }
.sv-table td.sv-val { max-width: none; white-space: normal; overflow-wrap: anywhere; }

/* ============ Systemuebersicht (#sysmap, sysmap.js) ============ */
.sm-z-clients { --zc: #8b5cf6; }
.sm-z-aws { --zc: #f97316; }
.sm-z-gcp { --zc: #0ea5e9; }
.sm-z-ops { --zc: #10b981; }
.sm-z-ext { --zc: #64748b; }
.sm-k-data { --kc: var(--primary); }
.sm-k-ops { --kc: #d97706; }
.sm-k-geo { --kc: #16a34a; }
.sm-k-dev { --kc: #64748b; }
.sm-kinds { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
.sm-kind { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer; }
.sm-kind input { margin: 0; accent-color: var(--primary); }
.sm-kind:has(input:not(:checked)) { opacity: .55; }
.sm-zoom { display: inline-flex; gap: 6px; }
.sm-zoom .refresh-btn { min-width: 38px; padding-left: 12px; padding-right: 12px; }
.sm-all { margin-left: 4px; }
.sm-kind.sm-all:has(input:not(:checked)) { opacity: 1; }
.sm-status-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.sm-status-bar:empty { display: none; }
.sm-st { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.sm-st b { color: var(--text); font-weight: 700; }
.sm-st:hover, .sm-st:focus-visible, .sm-st.is-sel { border-color: var(--primary); }
.sm-st-warn { border-color: color-mix(in srgb, #d97706 55%, var(--border)); }
.sm-st-crit { border-color: #dc2626; background: color-mix(in srgb, #dc2626 8%, var(--surface)); }
.sm-st-none { opacity: .7; }
/* Ruhemodus: Verbindungen nur zur hervorgehobenen Komponente bzw. zu Suchtreffern */
.sm-quiet .sm-edge:not(.is-hl) { display: none; }
.sm-wrap { position: relative; }
.sm-canvas { margin: 0; padding: 8px; overflow: hidden; }
.sm-detail { position: absolute; top: 12px; right: 12px; width: 340px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); margin: 0; overflow: auto; box-shadow: var(--shadow-lg); z-index: 2; }
.sm-detail.sm-detail-left { right: auto; left: 12px; }
.sm-svg { display: block; width: 100%; height: auto; cursor: grab; user-select: none; -webkit-user-select: none; font-family: inherit; }
.sm-svg.sm-zoomed { touch-action: none; }
.sm-svg.sm-panning { cursor: grabbing; }
.sm-zone { fill: color-mix(in srgb, var(--zc) 6%, transparent); stroke: color-mix(in srgb, var(--zc) 35%, transparent); stroke-width: 1.5; }
.sm-zone-title { fill: var(--zc); font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.sm-group-box { fill: color-mix(in srgb, var(--zc) 8%, var(--surface-2)); stroke: color-mix(in srgb, var(--zc) 45%, transparent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.sm-group-stack { fill: var(--surface-2); stroke: color-mix(in srgb, var(--zc) 30%, transparent); }
.sm-group-hit { fill: transparent; }
.sm-group-head { cursor: pointer; outline: none; }
.sm-group-title { fill: var(--text); font-size: 13px; font-weight: 700; }
.sm-group-head:hover .sm-group-title, .sm-group-head:focus-visible .sm-group-title { fill: var(--primary); text-decoration: underline; }
.sm-group.is-sel .sm-group-box { stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: none; }
.sm-node { cursor: pointer; outline: none; transition: opacity .15s; }
.sm-node-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.2; filter: drop-shadow(0 1px 2px rgba(16, 24, 40, .08)); transition: stroke .15s; }
.sm-node-accent { fill: var(--zc); }
.sm-node-title { fill: var(--text); font-size: 15px; font-weight: 700; }
.sm-node-sub { fill: var(--text-muted); font-size: 12.5px; }
.sm-node-line { fill: var(--text-soft); font-size: 12px; }
.sm-node:hover .sm-node-box, .sm-node.is-hl .sm-node-box { stroke: var(--zc); stroke-width: 1.8; }
.sm-node:focus-visible .sm-node-box { stroke: var(--primary); stroke-width: 3; }
.sm-node.is-sel .sm-node-box { stroke: var(--primary); stroke-width: 3; fill: var(--primary-soft); }
.sm-dot { display: none; }
.sm-dot-ok, .sm-dot-warn, .sm-dot-crit, .sm-dot-info { display: inline; stroke: var(--surface); stroke-width: 2; }
.sm-dot-ok { fill: #10b981; }
.sm-dot-warn { fill: #d97706; }
.sm-dot-crit { fill: #dc2626; }
.sm-dot-info { fill: var(--primary); }
.sm-edge { transition: opacity .15s; }
.sm-edge-hit { fill: none; stroke: transparent; stroke-width: 12; }
.sm-edge-line { fill: none; stroke: var(--kc); stroke-width: 1.4; opacity: .55; }
.sm-k-dev .sm-edge-line { stroke-dasharray: 6 4; }
.sm-arrow path { fill: var(--kc); }
.sm-edge.is-hl .sm-edge-line { stroke-width: 2.4; opacity: 1; stroke-dasharray: 7 5; animation: sm-flow .9s linear infinite; }
@keyframes sm-flow { to { stroke-dashoffset: -12; } }
.sm-focus .sm-node:not(.is-hl), .sm-focus .sm-edge:not(.is-hl) { opacity: .16; }
.sm-label { display: none; pointer-events: none; }
.sm-label.is-hl { display: inline; }
.sm-label rect { fill: var(--surface); stroke: var(--border); }
.sm-label text { fill: var(--text); font-size: 10.5px; font-weight: 600; text-anchor: middle; }
.sm-hide-data .sm-k-data, .sm-hide-ops .sm-k-ops, .sm-hide-geo .sm-k-geo, .sm-hide-dev .sm-k-dev { display: none; }
.sm-legend-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; margin-top: 12px; }
.sm-legend-bar .sm-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; font-size: 12.5px; }
.sm-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: color-mix(in srgb, var(--zc) 25%, transparent); border: 2px solid var(--zc); flex-shrink: 0; }
.sm-line { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--kc); flex-shrink: 0; vertical-align: middle; }
.sm-line.sm-k-dev { border-top-style: dashed; }
.sm-d-body { padding: 16px 20px 20px; }
.sm-d-zone { display: inline-flex; align-items: center; gap: 8px; }
.sm-d-title { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.sm-d-status { display: flex; gap: 8px; align-items: center; margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.sm-d-text { margin-top: 12px; font-size: 13.5px; line-height: 1.55; }
.sm-d-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sm-d-links .refresh-btn { padding: 6px 12px; font-size: 12.5px; }
.sm-d-h { margin-top: 18px; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.sm-d-conn, .sm-d-repo, .sm-legend { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.sm-d-conn li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sm-d-conn .sm-line { align-self: center; }
.sm-d-conn li.sm-d-off { opacity: .5; }
.sm-d-repo code { font-size: 12px; overflow-wrap: anywhere; }
.sm-legend { margin-top: 12px; }
.sm-legend li { display: flex; align-items: center; gap: 8px; }
@media (prefers-reduced-motion: reduce) {
  .sm-edge.is-hl .sm-edge-line { animation: none; stroke-dasharray: none; }
  .sm-node, .sm-edge, .sm-node-box { transition: none; }
}

/* ============ Dokus (docs.js) ============ */
.dc-list td { vertical-align: middle; }
.dc-list td.dc-list-name { white-space: normal; max-width: 520px; }
.dc-list-name .cfg-link { font-weight: 700; font-size: 14px; }
.dc-list-name small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 12px; }
.dc-list td.dc-list-act { text-align: right; white-space: nowrap; }
.dc-list-act .refresh-btn + .refresh-btn { margin-left: 8px; }
.dc-doc { max-width: 1040px; padding: 28px 32px; line-height: 1.6; font-size: 14px; }
.dc-head { padding-bottom: 18px; border-bottom: 2px solid var(--primary); }
.dc-sub { margin: 10px 0 14px; color: var(--text-muted); font-size: 16px; }
.dc-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 20px; margin: 0; font-size: 13px; }
.dc-meta dt { font-weight: 600; color: var(--text-muted); }
.dc-meta dd { margin: 0; }
.dc-summary { margin: 14px 0 0; }
.dc-toc { margin: 20px 0 8px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.dc-toc ol { list-style: none; margin: 8px 0 0; padding: 0; columns: 2 260px; }
.dc-toc li { padding: 2px 0; break-inside: avoid; }
.dc-sec { scroll-margin-top: 80px; }
.dc-sec h3 { margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--primary); font-size: 18px; }
.dc-sec h4 { margin: 18px 0 6px; font-size: 15px; }
.dc-sec p { margin: 0 0 10px; }
.dc-sec ul { margin: 0 0 12px; padding-left: 22px; }
.dc-sec li { margin-bottom: 4px; }
.dc-note { margin: 12px 0; padding: 10px 14px; border-left: 3px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-soft); }
.dc-table-wrap { overflow-x: auto; margin: 6px 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dc-table { font-size: 13px; }
.dc-table th { position: static; white-space: normal; padding: 8px 10px; }
.dc-table td { max-width: none; white-space: normal; overflow: visible; padding: 8px 10px; vertical-align: top; overflow-wrap: anywhere; }
@media (max-width: 700px) { .dc-doc { padding: 18px 16px; } }.lv-user { font-weight: 600; color: var(--text); }
.dc-todo { padding: 0 3px; border-radius: 3px; background: rgba(217, 119, 6, .18); color: inherit; }
.dc-ask-body { padding: 16px 20px; }
.dc-ask-thread { display: flex; flex-direction: column; gap: 10px; max-height: min(60vh, 640px); overflow-y: auto; margin-bottom: 14px; padding-right: 4px; }
.dc-ask-q { align-self: flex-end; max-width: 80%; padding: 8px 14px; border-radius: 14px 14px 4px 14px; background: var(--primary); color: #fff; font-size: 14px; white-space: pre-wrap; }
.dc-ask-a { align-self: flex-start; max-width: 92%; padding: 10px 16px; border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; background: var(--surface-2); font-size: 14px; line-height: 1.55; }
.dc-ask-a p { margin: 0 0 6px; }
.dc-ask-a ul { margin: 0 0 6px; padding-left: 20px; }
.dc-ask-a .badge { margin-bottom: 6px; }
.dc-ask-wait { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.dc-ask-err { color: #dc2626; }
.dc-ask-src { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 13px; }
.dc-ask-src > span { font-weight: 600; color: var(--text-muted); }
.dc-ask-meta { margin-top: 6px; font-size: 11px; color: var(--text-soft); }
.dc-ask-form { display: flex; gap: 10px; align-items: flex-end; }
.dc-ask-form textarea { flex: 1; min-width: 0; resize: vertical; font: inherit; font-size: 14px; }
.dc-ask-actions { display: flex; flex-direction: column; gap: 6px; }
.dc-sec h3.dc-hl, .dc-sec h4.dc-hl, .dc-sec.dc-hl > h3 { background: var(--primary-soft); border-radius: 4px; transition: background .4s; }
@media (max-width: 700px) { .dc-ask-form { flex-direction: column; align-items: stretch; } .dc-ask-actions { flex-direction: row; } }
/* KI-Assistent (assistant.js): Antworten mit Tabellen/Code, ausgefuehrte Abfragen aufklappbar */
.as-layout { display: grid; grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 16px; align-items: start; }
.as-chats .panel-header { padding: 12px 16px; }
.as-new { padding: 4px 12px; font-size: 13px; }
.as-chat-list { max-height: min(72vh, 900px); overflow-y: auto; }
.as-chat-list ul { margin: 0; padding: 6px; list-style: none; }
.as-chat { display: flex; align-items: stretch; border-radius: var(--radius-sm); }
.as-chat + .as-chat { margin-top: 2px; }
.as-chat:hover, .as-chat:focus-within { background: var(--surface-2); }
.as-chat.is-cur { background: var(--primary-soft); }
.as-chat-open { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.as-chat-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; }
.as-chat.is-cur .as-chat-title { color: var(--primary); }
.as-chat-title .btn-spin { width: 10px; height: 10px; margin-right: 6px; }
.as-chat-meta { font-size: 11.5px; color: var(--text-soft); }
.as-chat-del { flex-shrink: 0; width: 34px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-soft); cursor: pointer; opacity: 0; }
.as-chat-del svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.as-chat:hover .as-chat-del, .as-chat:focus-within .as-chat-del, .as-chat.is-cur .as-chat-del { opacity: 1; }
.as-chat-del:hover:not(:disabled), .as-chat-del:focus-visible { color: #dc2626; }
.as-chat-open:disabled, .as-chat-del:disabled { cursor: default; }
.as-chat-empty { padding: 14px 16px; font-size: 13px; color: var(--text-soft); }
.as-chat-empty .btn-spin { width: 10px; height: 10px; margin-right: 6px; }
@media (hover: none) { .as-chat-del { opacity: 1; } }
@media (max-width: 1000px) { .as-layout { grid-template-columns: minmax(0, 1fr); } .as-chat-list { max-height: 240px; } }
.as-thread { max-height: min(68vh, 820px); }
.as-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.as-examples[hidden] { display: none; }
.as-chip { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.as-chip:hover, .as-chip:focus-visible { border-color: var(--primary); color: var(--primary); }
.as-q-scope { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .22); font-size: 12px; }
.dc-ask-a ol { margin: 0 0 6px; padding-left: 22px; }
.dc-ask-a code { padding: 0 4px; border-radius: 4px; background: var(--surface); font-size: 12.5px; overflow-wrap: anywhere; }
.dc-ask-a pre { margin: 4px 0 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow-x: auto; }
.dc-ask-a pre code { padding: 0; white-space: pre; }
.as-table-wrap { overflow-x: auto; margin: 4px 0 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.as-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.as-table th, .as-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; white-space: normal; }
.as-table th { position: static; font-weight: 600; color: var(--text-muted); }
.as-table tr:last-child td { border-bottom: 0; }
.as-steps { margin-top: 8px; font-size: 13px; }
.as-steps summary { cursor: pointer; color: var(--text-muted); }
.as-steps ul { margin: 6px 0 0; padding-left: 20px; }
.as-steps li { margin-bottom: 6px; }
.as-step-args, .as-step-ms { color: var(--text-soft); font-size: 12px; }
/* Live-Status waehrend der Antwort: Phase, Sekunden, laufende und fertige Abfragen */
.as-live { min-width: min(420px, 92%); }
.as-live .dc-ask-wait .as-step-ms { margin-left: auto; font-variant-numeric: tabular-nums; }
.as-live-steps { margin: 8px 0 0; padding-left: 0; list-style: none; font-size: 13px; }
.as-live-steps li { position: relative; margin-bottom: 6px; padding-left: 20px; }
.as-live-steps li::before { position: absolute; left: 2px; top: 0; font-weight: 700; }
.as-live-steps li.as-step-ok::before { content: "\2713"; color: #16a34a; }
.as-live-steps li.as-step-fail::before { content: "!"; color: #dc2626; }
.as-live-steps li.as-step-run::before { content: "\2022"; color: var(--primary); }
.as-live-steps .btn-spin { width: 10px; height: 10px; margin-right: 4px; }
.dc-dlg { width: min(920px, calc(100vw - 32px)); }
.dc-fact-group { display: grid; gap: 10px; margin: 0; padding: 12px 14px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dc-fact-group legend { padding: 0 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.dc-fact { display: grid; gap: 4px; }
.dc-fact-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.dc-fact textarea { width: 100%; min-width: 0; resize: vertical; font: inherit; font-size: 14px; }
.dc-fact-custom { display: flex; gap: 10px; align-items: center; }
.dc-fact-custom input { flex: 1; min-width: 0; font-weight: 600; }
.dc-dlg-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dc-gen-list { display: grid; gap: 6px; }
.dc-gen-row { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: start; font-size: 14px; cursor: pointer; }
.dc-gen-title small { color: var(--text-soft); }
.dc-gen-state { grid-column: 2; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.dc-gen-new { color: #10b981; }
.dc-gen-err { color: #dc2626; }
.dc-ver { min-width: 0; padding: 4px 8px; font-size: 13px; }
.dc-old { margin-top: 12px; }
.dc-gen-note { margin: 12px 0 0; }
.dc-gen-note ul { margin: 6px 0 0; padding-left: 20px; }
.dc-dlg-actions { position: sticky; bottom: 0; margin: 0 -22px -18px; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--surface); }
