/* ============================================================================
   Design-Vorschlag „Datenblatt“
   Eigene, getrennte Optik-Schicht. Wirkt ausschließlich, wenn <html> die Klasse "dx" trägt
   (Einstellungen → Theme & Schrift → Design). Ohne diese Klasse bleibt das bisherige Design unverändert.

   Idee: ein Arbeitswerkzeug wie ein technisches Datenblatt – flach, dicht, mit klaren Linien statt
   Schatten, Glas und runden Kapseln. Farben kommen weiter aus den Theme-Variablen, die Schrift aus --font-ui,
   damit Theme & Schrift pro Benutzer und Chinesisch unverändert funktionieren.
   ============================================================================ */

/* ---- Schrift: IBM Plex Sans (liegt im Projekt, kein fremder Server) ---- */
@font-face { font-family: "DX Plex"; font-weight: 400; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "DX Plex"; font-weight: 500; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "DX Plex"; font-weight: 600 700; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "DX Plex"; font-weight: 400; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "DX Plex"; font-weight: 500; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "DX Plex"; font-weight: 600 700; font-display: swap; src: url("/design/fonts/ibm-plex-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "DX Plex Mono"; font-weight: 400; font-display: swap; src: url("/design/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "DX Plex Mono"; font-weight: 500 700; font-display: swap; src: url("/design/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

/* ---- Grundwerte (Form und Schrift gelten immer, auch mit Terminal-Theme) ---- */
html.dx {
  --radius: 2px; --dx-r: 2px;
  --dx-font: var(--font-ui, "DX Plex", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif);
  --dx-num: var(--font-ui, "DX Plex Mono", ui-monospace, "SF Mono", Consolas, monospace);
  --font: var(--dx-font); --font-display: var(--dx-font); --font-round: var(--dx-font);
  --dx-line: color-mix(in srgb, var(--text) 26%, var(--surface));      /* kräftige Linie: Rahmen von Feldern und Knöpfen */
  --dx-rule: color-mix(in srgb, var(--text) 78%, var(--surface));      /* Abschlusslinie unter Tabellenköpfen */
  --dx-mark: color-mix(in srgb, var(--accent) 55%, var(--side-fg));    /* Markierung des aktiven Menüpunkts */
  --fill: color-mix(in srgb, var(--text) 5%, transparent);
  --shadow: none;
}

/* ---- Farben (nur ohne Terminal-Theme; ein gewähltes Theme setzt seine Farben weiterhin selbst) ---- */
html.dx:not([data-terminal-theme]), html.dx[data-theme="light"]:not([data-terminal-theme]) {
  --bg: #eef0f1; --surface: #ffffff; --surface-2: #f5f6f7; --border: #d3d7db; --text: #15181b; --muted: #5a626a;
  --accent: #1b4f8f; --accent-2: #1b4f8f; --accent-contrast: #fff; --danger: #b3261e; --ok: #1b7a46; --warn: #a15c07;
  --st-B: #1b7a46; --st-mB: #b06d0a; --st-P: #2a66ad; --st-oB: #b3261e;
  --xonox-blue: #1b4f8f; --side-bg: #15181b; --side-fg: #eceef0;
}
@media (prefers-color-scheme: dark) {
  html.dx:not([data-theme="light"]):not([data-terminal-theme]) {
    --bg: #101214; --surface: #171a1d; --surface-2: #1d2125; --border: #2c3238; --text: #e3e6e8; --muted: #969ea6;
    --accent: #78aee8; --accent-2: #78aee8; --accent-contrast: #0c1116; --danger: #f0776c; --ok: #5cc48d; --warn: #e2a84a;
    --st-B: #2f9461; --st-mB: #b97a1c; --st-P: #3a78c2; --st-oB: #c2453c;
    --xonox-blue: #3a78c2; --side-bg: #0b0d0e; --side-fg: #e3e6e8;
  }
}
html.dx[data-theme="dark"]:not([data-terminal-theme]) {
  --bg: #101214; --surface: #171a1d; --surface-2: #1d2125; --border: #2c3238; --text: #e3e6e8; --muted: #969ea6;
  --accent: #78aee8; --accent-2: #78aee8; --accent-contrast: #0c1116; --danger: #f0776c; --ok: #5cc48d; --warn: #e2a84a;
  --st-B: #2f9461; --st-mB: #b97a1c; --st-P: #3a78c2; --st-oB: #c2453c;
  --xonox-blue: #3a78c2; --side-bg: #0b0d0e; --side-fg: #e3e6e8;
}

/* ---- Ruhe: keine Einblend-Animationen, kein Glas ---- */
html.dx .content > *, html.dx .overlay, html.dx .modal, html.dx .dd-list, html.dx .year-menu, html.dx .toast,
html.dx .topbar, html.dx .topbar .title { animation: none; }
html.dx .side, html.dx .topbar, html.dx .overlay, html.dx thead th, html.dx .toast, html.dx .zoom-bar, html.dx .dd-list, html.dx .pcards-sum {
  -webkit-backdrop-filter: none; backdrop-filter: none; }
html.dx button:active, html.dx .btn:active { transform: none; filter: none; }

/* ---- Schrift ---- */
html.dx body { font: 13.5px/1.45 var(--dx-font); letter-spacing: 0; -webkit-font-smoothing: auto; }
html.dx h1, html.dx h2, html.dx h3 { letter-spacing: 0; }
html.dx h1 { font-size: 20px; font-weight: 600; }
html.dx h2 { font-size: 14px; font-weight: 600; }
html.dx h3 { font-size: 13.5px; font-weight: 600; }
/* Zahlen in Tabellen in fester Breite, damit Spalten sauber untereinander stehen */
html.dx td.num, html.dx tfoot td.num, html.dx .zoom-bar .val { font-family: var(--dx-num); font-size: .96em; letter-spacing: -.02em; }
html.dx .kpi .value, html.dx .pcard-nums b { font-family: var(--dx-font); font-feature-settings: "tnum" 1; }
html.dx .hint { font-size: 12.5px; line-height: 1.5; }

/* ---- Seitenleiste: dunkle, flache Leiste mit Wortmarke ---- */
/* :not(#x) hebt nur das Gewicht der Regel an, damit sie auch gegen die Dunkel-Regeln des bisherigen Designs gilt */
html.dx:not(#x) .side, html.dx:not(#x) .side.open { background: var(--side-bg); color: var(--side-fg); border-right: 0; padding: 0 0 10px; gap: 0; }
html.dx[data-terminal-theme] .side { border-right: 1px solid var(--border); }
html.dx .brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 18px 18px 16px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 400; letter-spacing: 0; color: color-mix(in srgb, var(--side-fg) 62%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--side-fg) 14%, transparent); }
html.dx .brand::before { content: "XONOX"; width: auto; height: auto; background: none; box-shadow: none; border-radius: 0;
  font-size: 17px; font-weight: 600; letter-spacing: .2em; line-height: 1.2; color: var(--side-fg); }
html.dx .nav a { gap: 11px; padding: 7px 18px; border-radius: 0; font-weight: 400; opacity: 1; transition: none;
  color: color-mix(in srgb, var(--side-fg) 70%, transparent); }
html.dx .nav a:hover { background: color-mix(in srgb, var(--side-fg) 7%, transparent); color: var(--side-fg); }
html.dx .nav a.active { background: color-mix(in srgb, var(--side-fg) 11%, transparent); color: var(--side-fg); font-weight: 500; box-shadow: inset 3px 0 0 var(--dx-mark); }
html.dx .nav .sep { background: color-mix(in srgb, var(--side-fg) 14%, transparent); margin: 8px 18px; }
html.dx .nav a > span:first-child, html.dx .nav a > span:first-child[data-ap], html.dx .nav a.active > span:first-child[data-ap] {
  width: 17px; height: 17px; border-radius: 0; background: none; box-shadow: none; color: inherit; filter: none; }
html.dx .nav a > span:first-child[data-ap] svg { width: 17px; height: 17px; stroke-width: 1.6; }
html.dx .side-lang { padding: 8px 18px; }
html.dx .side-lang .seg { background: transparent; border-color: color-mix(in srgb, var(--side-fg) 28%, transparent); }
html.dx .side-lang .seg button { color: color-mix(in srgb, var(--side-fg) 70%, transparent) !important; background: transparent !important; padding: 3px 10px; font-size: 12px; }
html.dx .side-lang .seg button + button { border-left-color: color-mix(in srgb, var(--side-fg) 28%, transparent); }
html.dx:not(#x) .side-lang .seg button.on { background: var(--side-fg) !important; color: var(--side-bg) !important; }

/* ---- Kopfzeile ---- */
html.dx .topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 9px 20px; min-height: 50px; }
html.dx .topbar .title { font-size: 16px; font-weight: 600; letter-spacing: 0; }
html.dx .content { padding: 20px; }

/* ---- Knöpfe: rechteckig, mit Rahmen ---- */
html.dx button:where(:not([class^="xch-"]):not([class^="xsw-"])), html.dx .btn { border-radius: var(--dx-r); border: 1px solid var(--dx-line); background: var(--surface); color: var(--text);
  padding: 5px 12px; font-weight: 500; box-shadow: none; transition: none; }
html.dx button:where(:not([class^="xch-"]):not([class^="xsw-"])):hover, html.dx .btn:hover { background: var(--surface-2); border: 1px solid var(--text); }
html.dx button.primary, html.dx .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 500; box-shadow: none; }
html.dx button.primary:hover, html.dx .btn.primary:hover { background: var(--accent); border-color: var(--accent); filter: brightness(1.15); }
html.dx button.danger { background: var(--surface); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--surface)); }
html.dx button.danger:hover { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border: 1px solid var(--danger); }
html.dx button.ghost { background: transparent; border-color: transparent; color: var(--text); }
html.dx button.ghost:hover { background: var(--fill); border-color: transparent; }
html.dx button.sm { padding: 2px 9px; font-size: 12.5px; }
html.dx button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
html.dx .toolbar button:not(.primary):not(.danger):not(.ghost) { background: var(--surface); box-shadow: none; }
html.dx .toolbar button:not(.primary):not(.danger):not(.ghost):hover { background: var(--surface-2); }
html.dx .new-pos { box-shadow: none; }
html.dx button.gear-btn { padding: 4px 9px; }
/* kleine Symbolknöpfe behalten ihre eigene Form */
html.dx button.combo-btn, html.dx button.combo-btn:hover { border: 0; background: transparent; padding: 0 7px; }
html.dx button.group-toggle, html.dx button.cust-chip-x { border: 0; background: transparent; padding: 0; }
html.dx button.cust-chip-x { padding: 0 6px; }
html.dx button.group-toggle:hover, html.dx button.cust-chip-x:hover { border: 0; background: var(--fill); }
html.dx button.theme-tile { padding: 9px 10px; }

/* Umschalter: verbundene Felder, aktive Auswahl invertiert */
html.dx .seg { border-radius: var(--dx-r); padding: 0; gap: 0; background: var(--surface); border: 1px solid var(--dx-line); overflow: hidden; }
html.dx .seg-thumb { display: none; }
html.dx .seg button, html.dx .seg button:hover { border: 0; border-radius: 0; padding: 5px 12px; font-weight: 500; color: var(--text); background: transparent; }
html.dx .seg button + button, html.dx .seg button + button:hover { border-left: 1px solid var(--dx-line); }
html.dx .seg button:hover { background: var(--fill); }
html.dx:not(#x) .seg button.on, html.dx:not(#x) .seg.has-thumb button.on { background: var(--text) !important; color: var(--surface) !important; font-weight: 500; box-shadow: none !important; }
html.dx .entity-seg { border-color: var(--dx-line); }

/* ---- Formularfelder ---- */
html.dx input, html.dx select, html.dx textarea { border-radius: var(--dx-r); border: 1px solid var(--dx-line); box-shadow: none; padding: 5px 9px; background-color: var(--surface); transition: none; }
html.dx input:focus, html.dx select:focus, html.dx textarea:focus { border: 1px solid var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
html.dx input[type=search] { border-radius: var(--dx-r); background-color: var(--surface); background-position: 9px center; padding-left: 30px; box-shadow: none; }
html.dx .topbar select, html.dx .toolbar select, html.dx .form-grid select, html.dx label.field select, html.dx .modal select, html.dx .pcard-foot select { padding-right: 28px; background-position: right 9px center; }
html.dx td select:not(.st) { border-color: transparent; background-color: transparent; padding: 2px 4px; border-radius: var(--dx-r); }
html.dx td select:not(.st):hover { border-color: var(--dx-line); background: var(--surface); }
html.dx .year-picker > summary { border-radius: var(--dx-r); box-shadow: none; border: 1px solid var(--dx-line); padding: 5px 28px 5px 10px; font-weight: 500; }
html.dx label.field { font-size: 12px; font-weight: 500; gap: 4px; }
html.dx label.field > input, html.dx label.field > select, html.dx label.field > textarea { font-size: 13.5px; }
html.dx input[type=checkbox] { width: 15px; height: 15px; padding: 0; border: 1px solid var(--dx-line); border-radius: var(--dx-r); box-shadow: none; background-size: 11px; }
html.dx input[type=checkbox]:checked { background-color: var(--accent); border-color: var(--accent); box-shadow: none; }
html.dx input[type=checkbox]:focus, html.dx input[type=checkbox]:checked:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
html.dx input[type=color] { padding: 1px; }
/* Ein/Aus-Felder: kleiner, eckiger Schalter */
html.dx .field.check input[type=checkbox] { width: 32px; height: 18px; border-radius: var(--dx-r); border: 0; background: color-mix(in srgb, var(--text) 30%, var(--surface)) !important; }
html.dx .field.check input[type=checkbox]::after { top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 1px; box-shadow: none; transition: none; }
html.dx .field.check input[type=checkbox]:checked { background: var(--accent) !important; }
html.dx .field.check input[type=checkbox]:checked::after { transform: translateX(14px); }
html.dx .field.check { font-size: 13.5px; gap: 9px; }
html.dx input[type=range] { border: 0; padding: 0; height: 2px; border-radius: 0; background: var(--dx-line) !important; }
html.dx input[type=range]:focus { box-shadow: none; border: 0; }
html.dx input[type=range]::-webkit-slider-thumb { width: 9px; height: 16px; border-radius: 1px; background: var(--text); box-shadow: none; }
html.dx input[type=range]::-moz-range-thumb { width: 9px; height: 16px; border-radius: 1px; background: var(--text); box-shadow: none; }

/* ---- Karten: Rahmen statt Schatten, Titel als Kopfzeile ---- */
html.dx .card { border: 1px solid var(--border); border-radius: var(--dx-r); padding: 16px; box-shadow: none !important; background-image: none !important; }
html.dx .card > h2:first-child { margin: -16px -16px 14px; padding: 9px 16px; min-height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
html.dx .grid { gap: 14px; }
html.dx .g-kpi, html.dx .g-2 { margin-bottom: 14px; }
html.dx .chart-box { border-radius: 0; }

/* Kennzahlen: eine zusammenhängende Leiste mit Trennlinien statt einzelner Kacheln */
html.dx .grid.g-kpi { gap: 0; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--dx-r); overflow: hidden; }
html.dx .grid.g-kpi > .card { border: 0; border-radius: 0; padding: 14px 16px 13px; margin: 0 -1px -1px 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transition: none; }
html.dx .kpi .label { font-size: 11.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
html.dx .kpi .label .badge { letter-spacing: 0; margin-right: 2px; }
html.dx .kpi .value { font-size: 24px; font-weight: 600; letter-spacing: -.015em; margin: 4px 0 3px; }
html.dx .kpi .sub { font-size: 12px; }
html.dx a.kpi-link:hover, html.dx a.kpi-link:hover .kpi { transform: none; }
html.dx .grid.g-kpi > a.kpi-link:hover { box-shadow: none !important; background: var(--surface-2); border-color: var(--border); }
html.dx .bar { height: 3px; border-radius: 0; background: color-mix(in srgb, var(--text) 12%, transparent); }
html.dx .bar > span { border-radius: 0; background: var(--text); }

/* ---- Tabellen: dicht, mit Linien wie ein Kontenblatt ---- */
html.dx .table-wrap { border: 1px solid var(--border); border-radius: var(--dx-r); box-shadow: none !important; background: var(--surface); }
html.dx .card > .table-wrap { background: var(--surface); }
html.dx table { font-size: 13px; }
html.dx th, html.dx td { padding: 6px 10px; border-bottom: 1px solid var(--border); }
html.dx thead th { padding-top: 7px; padding-bottom: 7px; background: var(--surface-2); color: color-mix(in srgb, var(--text) 78%, var(--surface)); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--dx-rule); }
html.dx tbody td { border-bottom: 1px solid var(--border); }
html.dx tbody tr:last-child td { border-bottom: 0; }
html.dx tbody tr { transition: none; }
html.dx tbody tr:hover td, html.dx tbody tr.clickable:hover td { background: color-mix(in srgb, var(--text) 4%, transparent); }
html.dx tbody tr.clickable:active td { background: color-mix(in srgb, var(--text) 7%, transparent); }
html.dx tbody tr.selected td, html.dx tbody tr.selected:hover td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
html.dx tfoot td { background: var(--surface); border-top: 1px solid var(--dx-rule); font-weight: 500; }
html.dx tr.subtotal td { background: var(--surface-2); font-weight: 600; }
html.dx td.total, html.dx th.total { font-weight: 600; }
html.dx tr.key td { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
/* Status am Zeilenanfang: schmaler Farbstreifen über die ganze Zeilenhöhe */
html.dx tr.row-B td:first-child::before, html.dx tr.row-mB td:first-child::before, html.dx tr.row-P td:first-child::before, html.dx tr.row-oB td:first-child::before {
  left: 0; top: 0; bottom: 0; width: 4px; height: auto; margin: 0; border-radius: 0; }
html.dx tr.row-B td:first-child, html.dx tr.row-mB td:first-child, html.dx tr.row-P td:first-child, html.dx tr.row-oB td:first-child { padding-left: 14px; }
/* Positionsliste */
html.dx .items-box th, html.dx .items-box td { padding: .36em .65em; }
html.dx .grid-table th, html.dx .grid-table td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
html.dx .grid-table thead th { border-bottom: 1px solid var(--dx-rule); }
html.dx .grid-table th:last-child, html.dx .grid-table td:last-child { border-right: 0; }
html.dx td.pick:hover { box-shadow: inset 0 0 0 1px var(--accent); border-radius: 0; }
html.dx tbody tr.group-gap td, html.dx tbody tr.group-gap:hover td { height: 12px; background: var(--bg); border-right: 0; }
html.dx tbody tr.group-head td, html.dx tbody tr.group-head:hover td { background: var(--bg); padding: .8em .65em .4em; border-right: 0; border-bottom: 1px solid var(--dx-rule); }
html.dx tbody tr.group-head.sub td, html.dx tbody tr.group-head.sub:hover td { padding: .55em .65em .3em 1.3em; border-bottom: 1px solid var(--border); }
html.dx .section-title { font-size: 1.05em; font-weight: 600; letter-spacing: 0; }
html.dx .section-title.sub { font-size: .95em; }
html.dx .section-title.editable { border-radius: var(--dx-r); }
html.dx input.section-edit { font-size: 1.05em; font-weight: 600; padding: 3px 8px; }
html.dx .items-box thead th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
html.dx .items-box thead th.drop-after { box-shadow: inset -3px 0 0 var(--accent); }

/* ---- Marken, Chips ---- */
html.dx .badge { border-radius: var(--dx-r); padding: 1px 6px; font-size: 11.5px; font-weight: 600; }
html.dx .badge.mB, html.dx td select.st.mB { color: #fff; }
html.dx td select.st { border-radius: var(--dx-r); padding: 2px 5px; border: 1px solid var(--c); background-color: var(--c); color: #fff; box-shadow: none; font-size: .92em; }
html.dx td select.st:hover { background-color: var(--c); border-color: var(--c); }
html.dx td select.st:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
html.dx .chip { border-radius: var(--dx-r); border-color: var(--dx-line); padding: 3px 9px; font-size: 12.5px; transition: none; }
html.dx .chip .dot { width: 8px; height: 8px; border-radius: 0; }
html.dx .chip.on { border-color: var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--surface)); }
html.dx .pill { border-radius: var(--dx-r); padding: 0 6px; border: 1px solid var(--border); background: transparent; font-size: 11.5px; font-weight: 500; }
html.dx .pill.type-pill { background: var(--xonox-blue); border-color: var(--xonox-blue); color: #fff; font-weight: 600; letter-spacing: .02em; }
html.dx .chip-toggle { border-radius: var(--dx-r); border: 1px solid var(--dx-line); padding: 5px 12px; }
html.dx .chip-toggle.on { background: var(--text); color: var(--surface); border-color: var(--text); }
html.dx .cust-chip { border-radius: var(--dx-r); background: var(--surface-2); box-shadow: 0 0 0 1px var(--dx-line) inset; }
html.dx .status-legend { font-size: 12px; }
html.dx .issue { padding: 9px 0; gap: 12px; }
html.dx .issue:hover { background: transparent; margin: 0; padding-left: 0; padding-right: 0; border-radius: 0; }
html.dx .issue .count { border-radius: var(--dx-r); background: transparent; border: 1px solid var(--dx-line); color: var(--text); font-family: var(--dx-num); font-size: 12.5px; padding: 0 8px; }

/* ---- Dialoge, Menüs, Hinweise ---- */
html.dx .overlay { background: rgba(12,14,16,.55); }
html.dx .modal { border-radius: 3px; border: 1px solid var(--dx-line); box-shadow: 0 16px 48px rgba(0,0,0,.28); background: var(--surface) !important; transition: none; }
html.dx .modal header { padding: 11px 18px; background: var(--surface-2); border-radius: 3px 3px 0 0; }
html.dx .modal header h2, html.dx .modal header h3 { font-size: 14.5px; font-weight: 600; }
html.dx .modal .body { padding: 18px; }
html.dx .modal footer { padding: 10px 18px; background: var(--surface-2); border-radius: 0 0 3px 3px; }
html.dx .calc-box { border: 1px solid var(--border); border-radius: var(--dx-r); }
html.dx .dd-list, html.dx .year-picker .year-menu { border: 1px solid var(--dx-line); border-radius: var(--dx-r); box-shadow: 0 6px 20px rgba(0,0,0,.16); padding: 3px; background: var(--surface) !important; }
html.dx .dd-item { border-radius: 1px; padding: 5px 9px; }
html.dx .dd-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
html.dx .year-picker .year-menu label { border-radius: 1px; padding: 5px 8px; }
html.dx .toast { border-radius: var(--dx-r); background: var(--text); color: var(--surface); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
html.dx .toast.error { background: var(--danger); color: #fff; }
html.dx .zoom-bar { border: 1px solid var(--dx-line); border-radius: var(--dx-r); box-shadow: none; background: var(--surface); padding: 3px 8px; }
html.dx .zoom-bar button { border-radius: var(--dx-r); padding: 0 7px; background: var(--surface); }
html.dx .live-banner { border-radius: var(--dx-r); border-color: var(--dx-line); box-shadow: 0 6px 20px rgba(0,0,0,.16); }
html.dx .live-note { border-radius: var(--dx-r); }
html.dx .theme-tile { border-radius: var(--dx-r); }
html.dx .theme-tile:hover { filter: none; }
html.dx .theme-tile.on { outline: 2px solid var(--text); outline-offset: 1px; }
html.dx .theme-dots i { border-radius: 0; }
html.dx .font-sample { border-radius: var(--dx-r); }
html.dx ::-webkit-scrollbar-thumb { border-radius: 0; }

/* ---- Anmeldung ---- */
html.dx .login-card { padding: 0 24px 24px; border-radius: var(--dx-r); gap: 14px; }
html.dx .login-card .brand { margin: 0 -24px 6px; padding: 18px 24px 16px; align-self: stretch; background: var(--side-bg); color: color-mix(in srgb, var(--side-fg) 62%, transparent);
  border-bottom: 0; font-size: 12.5px; }
html.dx .login-card .brand::before { width: auto; height: auto; border-radius: 0; font-size: 19px; }
html.dx .login-card > .row:first-child { margin: 0 -24px 6px; padding: 0 16px 0 0; background: var(--side-bg); }
html.dx .login-card > .row:first-child .brand { margin: 0; }
html.dx .login-card > .row:first-child .seg { background: transparent; border-color: color-mix(in srgb, var(--side-fg) 28%, transparent); }
html.dx .login-card > .row:first-child .seg button { color: color-mix(in srgb, var(--side-fg) 70%, transparent) !important; background: transparent !important; padding: 3px 10px; font-size: 12px; }
html.dx .login-card > .row:first-child .seg button + button { border-left-color: color-mix(in srgb, var(--side-fg) 28%, transparent); }
html.dx:not(#x) .login-card > .row:first-child .seg button.on { background: var(--side-fg) !important; color: var(--side-bg) !important; }
html.dx .login-card button.primary { justify-content: center; padding: 8px 12px; }

/* ---- Smartphone-Karten ---- */
html.dx .pcard { border: 1px solid var(--border); border-left: 4px solid var(--c, var(--border)); border-radius: var(--dx-r); box-shadow: none; }
html.dx .pcards-sum { border: 1px solid var(--dx-line); border-radius: var(--dx-r); box-shadow: none; background: var(--surface); }

@media (max-width: 900px) {
  html.dx .content { padding: 14px; }
}
@media (max-width: 700px) {
  html.dx .content { padding: 10px 10px calc(110px + env(safe-area-inset-bottom)); }
  html.dx .topbar { padding: 10px 12px; }
  html.dx .topbar .title { font-size: 17px; }
  /* Leiste unten */
  html.dx:not(#x) .side, html.dx:not(#x) .side.open { padding: 0 4px env(safe-area-inset-bottom); border-top: 0; -webkit-mask-image: none; mask-image: none; }
  html.dx .side .nav a { padding: 8px 4px 6px; border-radius: 0; gap: 4px; }
  html.dx .side .nav a.active { background: transparent; color: var(--side-fg); box-shadow: inset 0 3px 0 var(--dx-mark); }
  html.dx .side .nav a > span:first-child[data-ap] { width: 20px; height: 20px; border-radius: 0; }
  html.dx .side .nav a > span:first-child[data-ap] svg { width: 20px; height: 20px; }
  /* Dialoge von unten, ohne Rundung */
  html.dx .modal, html.dx .modal.wide { border-radius: 0; border-width: 1px 0 0; }
  html.dx .modal header { border-radius: 0; }
  html.dx .modal footer { border-radius: 0; }
  html.dx .modal footer button { padding-top: 9px; padding-bottom: 9px; }
  html.dx button.new-pos { border-radius: var(--dx-r); box-shadow: 0 4px 14px rgba(0,0,0,.3); padding: 0; }
  html.dx .pcard select.st { border-radius: var(--dx-r); }
  html.dx .pcard-foot select { border-radius: var(--dx-r); background-color: var(--surface); }
  html.dx .grid.g-kpi { grid-template-columns: 1fr 1fr; }
  html.dx .kpi .value { font-size: 19px; }
  html.dx .card { padding: 12px; }
  html.dx .card > h2:first-child { margin: -12px -12px 12px; padding: 9px 12px; }
}
@media (pointer: coarse) {
  html.dx button, html.dx .btn { padding-top: 8px; padding-bottom: 8px; }
  html.dx .nav a { padding-top: 11px; padding-bottom: 11px; }
}
@media print {
  html.dx .card > h2:first-child { background: none; }
}
