/* IT-Tools – gemeinsames Stylesheet (helles und dunkles Design) */
:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F0F3F7;
  --border: #E3E7ED;
  --border-strong: #CBD2DC;
  --text: #16181D;
  --text-2: #3A4250;
  --muted: #5B6472;
  --accent: #0A6FA8;
  --accent-hover: #085C8C;
  --accent-text: #0A5F91;
  --accent-soft: #E6F2F9;
  --warm-soft: #FDEEE7;
  --warm-text: #A8431B;
  --ok-soft: #E8F5EE;
  --ok-text: #18794E;
  --ok-border: #BFE3CF;
  --err-soft: #FDECEC;
  --err-text: #B42318;
  --err-border: #F4C7C3;
  --shadow: 0 12px 32px rgba(22, 24, 29, .14);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --arabic: "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", "Segoe UI", "Times New Roman", serif;
  --sidebar-w: 264px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0F1217;
  --surface: #171B22;
  --surface-2: #1F242D;
  --border: #2A313C;
  --border-strong: #3A4350;
  --text: #E8EBF0;
  --text-2: #C5CCD6;
  --muted: #9AA4B2;
  --accent: #0A6FA8;
  --accent-hover: #0C80C0;
  --accent-text: #6CC3F0;
  --accent-soft: #12303F;
  --warm-soft: #3A2318;
  --warm-text: #F5A886;
  --ok-soft: #12301F;
  --ok-text: #6FD49C;
  --ok-border: #1F5236;
  --err-soft: #3A1917;
  --err-text: #FF9D94;
  --err-border: #6B2A25;
  --shadow: 0 12px 32px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-text); }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: #fff; }
.skip:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mono { font-family: var(--mono); }

/* ---------- Grundlayout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 24px 16px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 12px; }
.brand-name { font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--muted); text-decoration: none; }
.brand-name:hover { color: var(--text); }
/* Animiertes UDSYS-Logo wie auf udsys.net: Bögen drehen sich, ein Komet läuft die Linie entlang */
.alogo { --h: 62px; position: relative; display: block; height: var(--h); aspect-ratio: 810 / 365; border-radius: 6px; }
.alogo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; max-width: none; }
[data-theme="dark"] .alogo .al-base { filter: invert(1); }
.alogo .al-arcs { transform-origin: 32% 51.67%; animation: alspin 9s linear infinite; }
.alogo:hover .al-arcs { animation-duration: 3s; }
.alogo .al-head { position: absolute; left: 4.5%; top: 103%; width: 0; height: 0; opacity: 0; pointer-events: none; animation: alcomet 5s cubic-bezier(.35, .05, .65, 1) infinite; }
.alogo .al-head i { position: absolute; right: calc(var(--h) * -.035); top: calc(var(--h) * -.035); width: calc(var(--h) * .07); height: calc(var(--h) * .07); border-radius: 50%; background: #1E9BD7; box-shadow: 0 0 6px 2px rgba(56, 189, 248, .8), 0 0 14px 4px rgba(56, 189, 248, .45); }
.alogo .al-head b { position: absolute; right: 0; top: calc(var(--h) * -.012); width: calc(var(--h) * .95); height: calc(var(--h) * .024); transform-origin: 100% 50%; transform: rotate(-39.4deg); border-radius: 99px; background: linear-gradient(90deg, rgba(30, 155, 215, 0), rgba(30, 155, 215, .7) 60%, #1E9BD7); }
[data-theme="dark"] .alogo .al-head i { background: #fff; box-shadow: 0 0 6px 2px #7DD3FC, 0 0 16px 5px #38BDF8, 0 0 30px 8px rgba(91, 140, 255, .55); }
[data-theme="dark"] .alogo .al-head b { background: linear-gradient(90deg, rgba(56, 189, 248, 0), rgba(125, 211, 252, .7) 60%, #fff); filter: drop-shadow(0 0 3px #38BDF8); }
@keyframes alspin { to { transform: rotate(360deg); } }
@keyframes alcomet {
  0% { left: 4.5%; top: 103%; opacity: 0; }
  4%, 30% { opacity: 1; }
  34%, 100% { left: 62%; top: -3%; opacity: 0; }
}
.sidebar nav { display: flex; flex-direction: column; gap: 20px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 0 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; text-decoration: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; font-size: 12px; color: var(--muted); }
.sidebar-foot a { font-weight: 600; text-decoration: none; }
.sidebar-foot a:hover { text-decoration: underline; }
.content { min-width: 0; display: flex; flex-direction: column; }
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); }

/* ---------- Obere Leiste ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 16px 40px; background: var(--bg); }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn.menu-toggle { display: none; }
.search { position: relative; flex: 1 1 240px; max-width: 440px; }
.search-box { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { flex: 1; min-width: 0; height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-box input::-webkit-search-cancel-button { display: none; }
kbd { font: 12px var(--mono); padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--muted); white-space: nowrap; }
.popover, .menu-list { position: absolute; z-index: 50; top: calc(100% + 8px); padding: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); }
.popover { left: 0; right: 0; max-height: 60vh; overflow-y: auto; }
.popover a { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.popover a small { display: block; color: var(--muted); }
.popover a:hover, .popover a.is-active { background: var(--accent-soft); }
.popover .empty { padding: 12px; color: var(--muted); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { right: 0; width: 220px; display: flex; flex-direction: column; gap: 2px; }
.menu-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--text); font-weight: 500; text-decoration: none; }
.menu-list a:hover { background: var(--surface-2); }
.menu-list a[aria-current] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.menu-list .code { width: 24px; font: 12px var(--mono); color: var(--muted); }
.menu-list .icon { margin-left: auto; }
.when-light, .when-dark { display: inline-flex; align-items: center; gap: 8px; }
[data-theme="light"] .when-dark, [data-theme="dark"] .when-light { display: none; }

/* ---------- Inhalt ---------- */
main { flex: 1; width: 100%; max-width: 1240px; padding: 12px 40px 56px; display: flex; flex-direction: column; gap: 28px; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.page-head p { font-size: 16px; color: var(--muted); max-width: 70ch; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .icon { width: 14px; height: 14px; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }
h2 { font-size: 18px; font-weight: 600; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 24px; }
.cols > * { flex: 1 1 340px; }
.cols > .wide { flex: 2 1 440px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.hint { font-size: 13px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; }
.sec { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-2); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.primary { border-color: transparent; background: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); color: #fff; }
.btn.icon-only { width: 44px; padding: 0; flex: none; }
.btn.is-copied { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok-text); }
.btn[disabled] { opacity: .6; cursor: default; }

.input, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); }
.input:focus, .textarea:focus { outline: 0; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 14px; }
.input.is-invalid { border-color: var(--err-text); }
.textarea { display: block; min-height: 160px; resize: vertical; line-height: 1.5; }
.textarea[readonly] { background: var(--surface-2); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 44px; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text-2); cursor: pointer; }

/* Ergebniszeilen: Bezeichnung, Wert, Kopieren */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 16px; padding: 8px 0; border-top: 1px solid var(--border); min-width: 0; }
.row-label { flex: none; width: 132px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.row-value { flex: 1; min-width: 0; font: 14px/1.5 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.row .input { flex: 1; }
.row.is-error .row-value { color: var(--err-text); }

.note { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.note.error { border-color: var(--err-border); background: var(--err-soft); color: var(--err-text); }
.note.ok { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok-text); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.stat b { font-family: var(--mono); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font-weight: 500; cursor: pointer; }
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* Übersicht */
.tool-section { display: flex; flex-direction: column; gap: 14px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tool-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--accent-text); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(22, 24, 29, .08); }
.tool-card .badge { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
.tool-card.warm .badge { background: var(--warm-soft); color: var(--warm-text); }
.tool-card.neutral .badge { background: var(--surface-2); color: var(--text-2); }
.tool-card strong { display: block; font-size: 15px; font-weight: 600; }
.tool-card span.desc { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Werkzeug-spezifisch ---------- */
.swatch { position: relative; display: flex; align-items: flex-end; width: 100%; height: 220px; padding: 20px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font: 500 28px var(--mono); text-align: left; }
.swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.qr-box { display: flex; align-items: center; justify-content: center; min-height: 300px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.qr-box canvas { width: 100%; max-width: 280px; height: auto; image-rendering: pixelated; border-radius: 4px; }
.color-field { display: flex; gap: 10px; }
.color-field input[type="color"] { width: 56px; height: 44px; flex: none; padding: 3px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
select.input { appearance: auto; }
.param-head, .param-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; align-items: center; }
.param-head { padding-bottom: 6px; }
.param-row { padding: 8px 0; border-top: 1px solid var(--border); }
.param-row .num { font: 12px var(--mono); color: var(--muted); }
.param-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.param-cell .row-value { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-height: 44px; }
@media (max-width: 640px) {
  .param-head { display: none; }
  .param-row { grid-template-columns: 28px minmax(0, 1fr); }
  .param-row .param-cell:last-child { grid-column: 2; }
}
.status-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.status-card { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.status-card .code { flex: none; min-width: 52px; padding: 4px 8px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font: 600 15px var(--mono); text-align: center; cursor: pointer; }
.status-card .code:hover { outline: 2px solid var(--accent-text); }
.status-card.c2 .code { background: var(--ok-soft); color: var(--ok-text); }
.status-card.c3 .code { background: var(--accent-soft); color: var(--accent-text); }
.status-card.c4 .code { background: var(--warm-soft); color: var(--warm-text); }
.status-card.c5 .code { background: var(--err-soft); color: var(--err-text); }
.status-card strong { display: block; font-size: 15px; font-weight: 600; }
.status-card p { margin-top: 4px; font-size: 13px; color: var(--muted); }
.search-field { position: relative; max-width: 520px; }
.search-field .icon { position: absolute; left: 14px; top: 12px; color: var(--muted); pointer-events: none; }
.search-field .input { padding-left: 44px; }
.big-input { font-size: 18px; letter-spacing: .04em; }
.examples { display: flex; flex-direction: column; }
.examples .row-label { width: 150px; }
.examples button.row-value { border: 0; background: none; padding: 6px 0; color: var(--accent-text); text-align: left; cursor: pointer; }
.examples button.row-value:hover { text-decoration: underline; }
.tr-text { min-height: 150px; font-size: 20px; line-height: 1.6; }
.kb { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.kb-row { display: flex; gap: 6px; min-width: 640px; }
.kb .k { flex: 1 1 0; min-width: 0; height: 50px; padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 500 18px var(--font); cursor: pointer; }
.kb .k:hover { background: var(--accent-soft); border-color: var(--accent-text); }
.kb .k.is-down, .kb .k:active { background: var(--accent); border-color: var(--accent); color: #fff; }
.kb .k.fn { flex: 1.6 1 0; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); }
.kb .k.fn[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.kb .k.space { flex: 7 1 0; }
.checks .row-label { width: 260px; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--text-2); }
.checks .row-value.pass { color: var(--ok-text); }
.checks .row-value.fail { color: var(--err-text); }
.code-area { min-height: 420px; font-size: 13px; tab-size: 4; white-space: pre; overflow: auto; }
.issue { display: block; width: 100%; padding: 10px 12px; border: 1px solid var(--err-border); border-radius: 10px; background: var(--err-soft); color: var(--err-text); text-align: left; font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.issue b { display: block; font: 600 12px var(--mono); margin-bottom: 2px; }
.issue:hover { border-color: var(--err-text); }
.token-out { padding: 16px 18px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font: 18px/1.5 var(--mono); overflow-wrap: anywhere; min-height: 60px; }
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th, .perm-table td { padding: 6px 8px; text-align: center; border-top: 1px solid var(--border); }
.perm-table thead th { border-top: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.perm-table tbody th { text-align: left; font-weight: 600; }
.perm-table label { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.cron-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.runs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.runs li { padding: 10px 0; border-top: 1px solid var(--border); font-family: var(--mono); }
.output-frame { width: 100%; min-height: 260px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.output-pre { margin: 0; min-height: 260px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: 13px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.emoji-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.emoji-card button { border: 0; background: none; padding: 2px 6px; margin-left: -6px; border-radius: 6px; cursor: pointer; text-align: left; }
.emoji-card button:hover { background: var(--accent-soft); }
.emoji-card .glyph { font-size: 32px; line-height: 1.2; min-height: 44px; }
.emoji-card .code { font: 12px var(--mono); color: var(--muted); }
.osm-text { min-height: 170px; font: 28px/1.7 var(--arabic); }
.keys { display: flex; flex-wrap: wrap; gap: 8px; }
.key { min-width: 48px; height: 48px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: 24px/1 var(--arabic); cursor: pointer; }
.key:hover { background: var(--accent-soft); border-color: var(--accent-text); }
.key:active { transform: translateY(1px); }
.key.small { font: 600 12px var(--font); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
dialog { width: min(640px, calc(100vw - 32px)); max-height: 85vh; padding: 0; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.map-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; }
.map-item kbd { border: 0; padding: 0; font-size: 13px; color: var(--text-2); }
.map-item span { font: 22px/1.3 var(--arabic); }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: min(86vw, 300px); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; gap: 8px; }
  .search { flex: 1 1 0; min-width: 0; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .btn { padding: 0 12px; }
  main { padding: 8px 16px 40px; }
  .page-head h1 { font-size: 26px; }
  .card { padding: 16px; }
  kbd { display: none; }
  .topbar-actions summary > span, .when-light > span, .when-dark > span { display: none; }
  .topbar-actions summary .icon:last-child { display: none; }
  .row { flex-wrap: wrap; gap: 6px 12px; }
  .row-label { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .alogo .al-arcs, .alogo .al-head { animation: none; }
  .alogo .al-head { display: none; }
}

/* ---------- Statistik ---------- */
.viz-root { --series-1: #2a78d6; --series-2: #eb6834; --grid: #E8ECF1; --bar-track: #EEF1F5; }
[data-theme="dark"] .viz-root { --series-1: #3987e5; --series-2: #d95926; --grid: #262D37; --bar-track: #222832; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filter-select select { min-width: 220px; }
.chip-link { display: inline-flex; align-items: center; text-decoration: none; }
.chip-link[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.kpi .kpi-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .kpi-value { font-size: 34px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .kpi-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.kpi .kpi-delta b { font-weight: 600; }
.kpi .kpi-delta.up b { color: var(--ok-text); }
.kpi .kpi-delta.down b { color: var(--err-text); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart { position: relative; width: 100%; height: 300px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font: 12px var(--font); fill: var(--muted); }
.chart .end-label { font-weight: 600; fill: var(--text-2); }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 150px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: 13px; }
.chart-tip b { display: block; margin-bottom: 4px; }
.chart-tip .tip-note { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.chart-tip div { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.chart-tip div span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tip div i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chart-tip div em { font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 24px; align-items: start; }
.bars { display: flex; flex-direction: column; }
.bar-head, .bar-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(48px, 1fr) 92px 56px; align-items: center; gap: 10px; }
.bars.with-copies .bar-head, .bars.with-copies .bar-row { grid-template-columns: minmax(0, 1.25fr) minmax(48px, 1fr) 92px 92px 56px; }
.bar-head { padding: 0 8px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bar-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-head span:not(:first-child), .bar-row .num { text-align: right; }
.bar-row { min-height: 40px; padding: 4px 8px; border-radius: 8px; border-top: 1px solid var(--border); }
.bar-row:hover { background: var(--surface-2); }
.bar-row a, .bar-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.bar-row a:hover { text-decoration: underline; color: var(--accent-text); }
.bar-row .track { height: 10px; border-radius: 4px; background: var(--bar-track); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.bar-row .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-row .pct { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars .empty { padding: 16px 8px; color: var(--muted); }
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-head, .bar-row, .bars.with-copies .bar-head, .bars.with-copies .bar-row { grid-template-columns: minmax(0, 1fr) 84px 52px; }
  .bar-row .track, .bar-head .h-track { display: none; }
  .bars.with-copies .bar-row .copies, .bars.with-copies .bar-head .h-copies { display: none; }
  .chart { height: 240px; }
  .filter-select, .filter-select select { width: 100%; }
}
