/*
 * thirty Verwaltung – design from Claude Design (docs/design/thirty-verwaltung.dc.html, thirty docs/40):
 * tokens light + dark (prefers-color-scheme), Teris red as accent, Inter self-hosted, Font Awesome (fa_icon).
 * Role-based frame: customers a slim top bar, agency and platform a sidebar (collapsible, a drawer on phones).
 */

/* Inter (SIL Open Font License 1.1), latin incl. „ “ – ß ä ö ü */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-v13-latin-regular-gBeQxxq.woff2") format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-v13-latin-500-sbBKVFz.woff2") format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-v13-latin-600-Pt3Of0T.woff2") format('woff2'); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/inter-v13-latin-700-ZvOTNNB.woff2") format('woff2'); }

/* ── tokens ─────────────────────────────────────────────────────────── */
:root {
    color-scheme: light;
    --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f8f9fb; --field: #ffffff;
    --ink: #1b1f24; --muted: #5c6675; --line: #e3e6eb; --line-strong: #c9cfd8;
    --accent: #af2426; --accent-hover: #951e20; --accent-ink: #8f1c1e; --accent-soft: #fbeaea; --on-accent: #ffffff;
    --focus: #1d4ed8;
    --nav-bg: #1e293b; --nav-ink: #e2e8f0; --nav-muted: #94a3b8; --nav-active: #334155; --nav-line: #2c3a50;
    --ok-bg: #dcfce7; --ok-ink: #166534; --warn-bg: #fef3c7; --warn-ink: #92400e; --err-bg: #fee2e2; --err-ink: #991b1b; --err-line: #f3b4b4;
    --info-bg: #e0e7ff; --info-ink: #3730a3; --neutral-bg: #e2e8f0; --neutral-ink: #334155;
    --r-1: 4px; --r-2: 6px; --r-3: 10px;
    --shadow-1: 0 1px 2px rgba(16, 24, 40, .06); --shadow-2: 0 8px 24px rgba(16, 24, 40, .14);
    --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --side: 240px;
}
/* dark: by the system ("Automatisch") unless light is chosen, or chosen (theme switch, Stimulus "theme", localStorage) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #0f1623; --surface: #1a2232; --surface-2: #202a3c; --field: #111827;
        --ink: #e8ebf0; --muted: #a3adbd; --line: #2b3648; --line-strong: #3b475c;
        --accent: #c42a2c; --accent-hover: #d9393b; --accent-ink: #f08a8d; --accent-soft: #3a1a1c; --on-accent: #ffffff;
        --focus: #60a5fa;
        --nav-bg: #111827; --nav-ink: #e2e8f0; --nav-muted: #94a3b8; --nav-active: #1f2a3d; --nav-line: #1f2a3d;
        --ok-bg: #14532d; --ok-ink: #bbf7d0; --warn-bg: #78350f; --warn-ink: #fde68a; --err-bg: #7f1d1d; --err-ink: #fecaca; --err-line: #9b2c2c;
        --info-bg: #312e81; --info-ink: #c7d2fe; --neutral-bg: #334155; --neutral-ink: #e2e8f0;
        --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0f1623; --surface: #1a2232; --surface-2: #202a3c; --field: #111827;
    --ink: #e8ebf0; --muted: #a3adbd; --line: #2b3648; --line-strong: #3b475c;
    --accent: #c42a2c; --accent-hover: #d9393b; --accent-ink: #f08a8d; --accent-soft: #3a1a1c; --on-accent: #ffffff;
    --focus: #60a5fa;
    --nav-bg: #111827; --nav-ink: #e2e8f0; --nav-muted: #94a3b8; --nav-active: #1f2a3d; --nav-line: #1f2a3d;
    --ok-bg: #14532d; --ok-ink: #bbf7d0; --warn-bg: #78350f; --warn-ink: #fde68a; --err-bg: #7f1d1d; --err-ink: #fecaca; --err-line: #9b2c2c;
    --info-bg: #312e81; --info-ink: #c7d2fe; --neutral-bg: #334155; --neutral-ink: #e2e8f0;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
}

/* ── base ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { margin: 0; font: 600 30px/1.2 var(--font); letter-spacing: -.02em; }
h2 { margin: 0 0 8px; font: 600 16px/1.3 var(--font); color: var(--ink); }
h3 { margin: 0 0 6px; font: 600 14px/1.3 var(--font); }
code, kbd, pre, .mono { font-family: var(--mono); font-size: .92em; }
.hint { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fa-icon { width: 1em; height: 1em; vertical-align: -.125em; flex: none; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 2000; padding: 8px 14px; background: var(--surface); border-radius: var(--r-2); }

/* ── wordmark ───────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: var(--r-2); background: #af2426; color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 11px var(--font); letter-spacing: -.04em; flex: none; }
.brand-name { font: 600 18px/1 var(--font); letter-spacing: -.03em; }
.brand-name b { color: #af2426; font-weight: 600; }

/* ── frame: customers (top bar) ─────────────────────────────────────── */
.top { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 56px; background: var(--nav-bg); color: var(--nav-ink); }
.top a, .top button { color: var(--nav-ink); }
.top-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: var(--r-2); font-weight: 500; text-decoration: none; }
.top-link:hover { background: var(--nav-active); text-decoration: none; }
.top form { margin: 0; }
.top button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: none; font-weight: 500; color: var(--nav-muted); cursor: pointer; }
.top button:hover { background: var(--nav-active); color: var(--nav-ink); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--nav-active); color: var(--nav-ink); display: inline-flex; align-items: center; justify-content: center; font: 600 11px var(--font); flex: none; }
.count { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font: 600 11px/18px var(--font); text-align: center; }
.top-bell { position: relative; }
.top-bell .count { position: absolute; top: 2px; right: 0; }

/* ── frame: agency and platform (sidebar) ───────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: var(--nav-bg); color: var(--nav-ink); }
.side .brand { padding: 4px 8px 12px; }
.side-group { font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--nav-muted); padding: 14px 8px 6px; }
.side a, .side button.side-link { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border: 0; border-radius: var(--r-2); background: none; font: 500 14px var(--font); color: var(--nav-ink); text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.side a .fa-icon, .side button.side-link .fa-icon { color: var(--nav-muted); }
.side a:hover, .side button.side-link:hover { background: var(--nav-active); text-decoration: none; }
.side a[aria-current] { background: var(--nav-active); box-shadow: inset 3px 0 0 var(--accent); }
.side a[aria-current] .fa-icon { color: var(--nav-ink); }
.side a .count { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--nav-line); padding-top: 12px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 10px 4px; }
.side-user > div { min-width: 0; flex: 1; }
.side-user strong { display: block; font: 500 13px/1.2 var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user span { font-size: 11px; color: var(--nav-muted); }
.side-user form { margin: 0; }
.side-user button { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--r-2); background: none; color: var(--nav-muted); cursor: pointer; }
.side-user button:hover { background: var(--nav-active); color: var(--nav-ink); }
.side .side-collapse { height: 32px; font: 400 12px var(--font); color: var(--nav-muted); }
.side-label { overflow: hidden; white-space: nowrap; }
/* collapsed (64 px, remembered per browser) */
.shell.is-collapsed { --side: 64px; }
.shell.is-collapsed .side { padding: 16px 10px; align-items: center; }
.shell.is-collapsed .side-label, .shell.is-collapsed .side-group, .shell.is-collapsed .brand-name, .shell.is-collapsed .side-user > div, .shell.is-collapsed .side a .count { display: none; }
.shell.is-collapsed .side a, .shell.is-collapsed .side button.side-link { justify-content: center; padding: 0; width: 40px; }
.shell.is-collapsed .side-user { flex-direction: column; padding: 8px 0 0; }
.shell.is-collapsed .side-collapse .fa-icon { transform: rotate(180deg); }
/* phones: the sidebar becomes a drawer behind a menu button */
.mobile-bar { display: none; }
@media (max-width: 900px) {
    .shell, .shell.is-collapsed { display: block; --side: 264px; }
    .mobile-bar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 16px; background: var(--nav-bg); color: var(--nav-ink); position: sticky; top: 0; z-index: 50; }
    .mobile-bar button { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-2); background: none; color: var(--nav-ink); cursor: pointer; }
    .side { position: fixed; z-index: 60; left: 0; top: 0; width: var(--side); transform: translateX(-100%); transition: transform .2s ease; }
    .shell.is-open .side { transform: none; box-shadow: var(--shadow-2); }
    .shell.is-collapsed .side { align-items: stretch; padding: 16px 12px; }
    .shell.is-collapsed .side-label, .shell.is-collapsed .side-group, .shell.is-collapsed .brand-name, .shell.is-collapsed .side-user > div { display: revert; }
    .shell.is-collapsed .side a, .shell.is-collapsed .side button.side-link { justify-content: flex-start; padding: 0 10px; width: 100%; }
    .side .side-collapse { display: none; }
    .side-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(15, 22, 35, .45); }
    .top { padding: 0 12px; gap: 8px; }
    .top .top-label { display: none; }
}

/* theme switch (Automatisch / Hell / Dunkel) */
.theme-switch { display: flex; align-items: center; gap: 8px; padding: 4px 10px; color: var(--nav-muted); font-size: 12px; }
.theme-switch select { height: 30px; font-size: 13px; background-color: var(--nav-active); border-color: var(--nav-line); color: var(--nav-ink); }
.top .theme-switch { padding: 0; }
.top .theme-switch select { width: auto; }
.shell.is-collapsed .theme-switch { display: none; }
@media (max-width: 900px) { .shell.is-collapsed .theme-switch { display: flex; } }

/* ── content ────────────────────────────────────────────────────────── */
main { width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 900px) { main { padding: 24px 16px; } h1 { font-size: 24px; } }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head > h1 + .hint, .page-sub { flex-basis: 100%; margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.narrow { max-width: 420px; margin: 8vh auto 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-1); padding: 16px 20px; }
.card > h2:first-child { margin-top: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush > .card-head { padding: 14px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.card-flush > .card-head h2 { margin: 0; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--r-3); padding: 24px; text-align: center; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 20px; }
.search { position: relative; display: inline-flex; align-items: center; width: 240px; }
.search .fa-icon { position: absolute; left: 10px; color: var(--muted); font-size: 13px; }
.search input { padding-left: 32px; }
@media (max-width: 900px) { .search { width: 100%; } }
.job-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.empty .fa-icon { font-size: 22px; color: var(--muted); }
.empty p { margin: 8px 0 0; }

.grid-2 { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.card-foot .hint { margin: 0; }
.card-pad { padding: 10px 20px 0; margin: 0; }
.head-title { min-width: 0; }
.head-title .page-sub { margin: 4px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.avatar-light { width: 44px; height: 44px; font-size: 14px; background: var(--neutral-bg); color: var(--neutral-ink); }
td .avatar-light, th .avatar-light { width: 30px; height: 30px; font-size: 11px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .sub { margin-top: 2px; }
.crumbs a { color: var(--accent-ink); }
select.select-sm { width: auto; min-width: 140px; height: 32px; }
.inline-fields .invite-owner { flex-basis: 100%; display: inline-flex; gap: 8px; align-items: center; font-size: 13px; }
.card-foot .inline-fields + .hint { margin-top: 8px; }
.menu-list form { margin: 0; }

/* ── buttons ────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-2);
    background: var(--surface); color: var(--ink); font: 500 14px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn .fa-icon { font-size: 13px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { border-color: var(--err-line); color: var(--err-ink); }
.btn-danger:hover { background: var(--err-bg); }
.btn-icon { width: 36px; padding: 0; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-sm.btn-icon { width: 30px; padding: 0; }
.btn:disabled, .btn[aria-disabled=true] { background: var(--surface-2); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
form.inline { display: inline; margin: 0; }

/* ── badges (colour + icon + text) ──────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-ink); font: 500 12px/1 var(--font); white-space: nowrap; vertical-align: middle; }
.badge .fa-icon { font-size: 11px; }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }
.badge-info { background: var(--info-bg); color: var(--info-ink); }
.badge-warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge-err { background: var(--err-bg); color: var(--err-ink); }
.badge-version { font-family: var(--mono); }

/* ── forms ──────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, label.label { font: 500 13px var(--font); color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=tel], input[type=date], input:not([type]), select, textarea {
    height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-2); background: var(--field); color: var(--ink); font: 400 14px var(--font); width: 100%; }
textarea { height: auto; min-height: 96px; padding: 8px 10px; line-height: 1.5; }
select { appearance: none; padding-right: 32px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%235c6675' d='M233 375c13 13 33 13 46 0L471 183c13-13 13-33 0-46s-33-13-46 0L256 307 87 137c-13-13-33-13-46 0s-13 33 0 46l192 192z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center; background-size: 11px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.field .hint, .field-help { font-size: 12px; color: var(--muted); }
.form-errors, .field .errors { color: var(--err-ink); font: 500 12px var(--font); margin: 0; padding: 0; list-style: none; }
.field:has(.errors) input, .field:has(.errors) select, .field:has(.errors) textarea { border-color: var(--err-ink); box-shadow: 0 0 0 3px var(--err-bg); }
.field-check { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.field-check .hint { flex-basis: 100%; }
.inline-fields { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-fields > select, .inline-fields > input { width: auto; flex: 1 1 160px; }

/* ── tables ─────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th[scope=col] { font: 600 12px var(--font); color: var(--muted); background: var(--surface-2); }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
tr.is-selected, tr:has(> td > input[type=checkbox]:checked) { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; width: 1%; }
tr.warn td { background: var(--warn-bg); }
.sub { display: block; font-size: 12px; color: var(--muted); }

/* phones: rows as cards, the most important first (design docs/40); checkbox left, gear right */
@media (max-width: 700px) {
    table.table-cards thead { display: none; }
    table.table-cards, table.table-cards tbody { display: block; }
    table.table-cards tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
    table.table-cards tr > * { grid-column: 2; border: 0; padding: 0; }
    table.table-cards tr > td:has(> input[type=checkbox]) { grid-column: 1; grid-row: 1; }
    table.table-cards tr > th[scope=row] { grid-row: 1; }
    table.table-cards tr > td.actions { grid-column: 3; grid-row: 1; width: auto; }
    table.table-cards select { max-width: 100%; }
    .card-flush > .card-head { padding: 12px 16px; }
    .card-foot { padding: 12px 16px; }
}

/* ── flash messages ─────────────────────────────────────────────────── */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-2); font: 400 14px/1.4 var(--font); overflow-wrap: anywhere; }
.flash .fa-icon { font-size: 15px; margin-top: 2px; }
.flash > span { flex: 1; }
.flash-success { background: var(--ok-bg); color: var(--ok-ink); }
.flash-error { background: var(--err-bg); color: var(--err-ink); }
.flash-warning { background: var(--warn-bg); color: var(--warn-ink); }
.flash-news { background: var(--info-bg); color: var(--info-ink); }
.flash-news a { color: inherit; text-decoration: underline; }
.flash-close { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.tile-warn { padding: 6px 10px; border-radius: var(--r-2); background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; }

/* ── tiles (Meine Sites) ────────────────────────────────────────────────
 * Every tile has the same seven rows (title, meta, state, numbers, published, hints, actions); with subgrid the rows of all
 * tiles in a line share their heights: equal tiles, everything on one line (Nutzer 2026-11-11). Long texts end with "…".
 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; }
.tile { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 8px; padding: 16px 20px; min-width: 0; }
.tile > *, .tile-overview > * { min-width: 0; margin: 0; }
.tile-overview { display: contents; }
.tile-title { font: 600 16px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-meta, .tile-published { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-state { display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; }
.tile-numbers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); align-content: start; }
.tile-numbers div { display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; }
.tile-numbers dt { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-numbers dd { margin: 0; font: 600 20px/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile-numbers .unread { font: 500 11px var(--font); color: var(--info-ink); }
.tile-numbers .tile-numbers-wide { grid-column: 1 / -1; }
.tile-hints { display: flex; flex-direction: column; gap: 6px; align-content: start; }
.tile-hints:empty { display: block; }
.tile-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-self: end; padding-top: 4px; }
.tile-actions .btn { padding: 0 10px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tile-actions .btn-primary { flex: none; }
.system-release { display: flex; align-items: center; gap: 8px; }

/* ── steps (progress of a job) ──────────────────────────────────────── */
.steps { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 11px var(--font); flex: none; border: 1px solid var(--line-strong); color: var(--muted); }
.step-done .step-mark, .step-skipped .step-mark { background: var(--ok-bg); border-color: transparent; color: var(--ok-ink); }
.step-running .step-mark { background: var(--info-bg); border-color: transparent; color: var(--info-ink); }
.step-failed .step-mark { background: var(--err-bg); border-color: transparent; color: var(--err-ink); }
.step-open { color: var(--muted); }
.step-message { font-size: 12px; color: var(--muted); }
.step-failed .step-message { color: var(--err-ink); }
.jobs { margin-bottom: 0; }
.job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ── gear menu (details + Stimulus "menu") ──────────────────────────── */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; z-index: 30; min-width: 220px; margin-top: 4px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2); text-align: left; }
.menu-list button, .menu-list a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; font: 400 14px var(--font); color: var(--ink); text-align: left; border-radius: var(--r-2); cursor: pointer; text-decoration: none; }
.menu-list button:hover, .menu-list button:focus-visible, .menu-list a:hover { background: var(--surface-2); text-decoration: none; }
.menu-list .is-danger { color: var(--err-ink); }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.menu-list p { margin: 6px 10px 4px; }

/* ── dialog (Stimulus "confirm") ────────────────────────────────────── */
dialog.confirm { border: 0; border-radius: var(--r-3); padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
dialog.confirm::backdrop { background: rgba(15, 22, 35, .45); }
.confirm-body { display: flex; gap: 14px; padding: 20px; }
.confirm-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.confirm-body h2 { margin: 0 0 6px; font-size: 16px; }
.confirm-body p { margin: 0; color: var(--muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 20px; }

/* ── login ──────────────────────────────────────────────────────────── */
body.page-login { background: linear-gradient(var(--nav-bg) 0 40vh, var(--bg) 40vh); }
.login { width: min(400px, 100%); margin: 0 auto; padding: 12vh 16px 40px; display: flex; flex-direction: column; gap: 20px; }
.login .brand { justify-content: center; color: #fff; }
.login .card { padding: 24px; box-shadow: var(--shadow-2); }
.login .card h1 { font-size: 20px; margin-bottom: 12px; }
.login .btn { width: 100%; }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.login-or::before, .login-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; }
.login .label-row { display: flex; justify-content: space-between; align-items: baseline; }
.login .label-row a { font-size: 13px; }
.login .passkey-login p { margin: 6px 0 0; }
.login .login-back { margin: 14px 0 0; text-align: center; }
.login .code-input { font: 600 20px var(--mono); letter-spacing: .3em; text-align: center; height: 44px; }

/* ── feature switches, choices, misc (existing pages) ───────────────── */
fieldset.feature { border: 1px solid var(--line); border-radius: var(--r-3); padding: 12px 16px; margin: 0 0 14px; background: var(--surface); }
fieldset.feature legend { font-weight: 600; padding: 0 4px; }
fieldset.feature .errors { color: var(--err-ink); font-size: 13px; margin: 6px 0; padding: 0; list-style: none; font-weight: 600; }
.choices { display: grid; grid-template-columns: max-content 1fr; gap: 6px 8px; align-items: start; max-height: 420px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--field); }
.choices input { margin-top: 3px; }
.choices-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; }
pre.env { background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: var(--r-2); overflow-x: auto; font-size: 13px; }
pre.trace { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; font-size: 13px; }

/* changelog ("Neuigkeiten") */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; }
.chip:hover { text-decoration: none; background: var(--surface-2); }
.chip[aria-current] { background: var(--nav-bg); border-color: var(--nav-bg); color: #fff; }
.changelog-entry { margin: 0; }
.changelog-head { display: flex; gap: 14px; align-items: flex-start; }
.changelog-head h2 { margin: 0 0 4px; font-size: 18px; }
.changelog-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-3); font-size: 18px; }
.changelog-feature, .badge-cat-feature { background: #ede9fe; color: #5b21b6; }
.changelog-improvement, .badge-cat-improvement { background: #e0f2fe; color: #075985; }
.changelog-bugfix, .badge-cat-bugfix { background: var(--err-bg); color: var(--err-ink); }
.changelog-update, .badge-cat-update { background: var(--ok-bg); color: var(--ok-ink); }
.changelog-security, .badge-cat-security { background: var(--warn-bg); color: var(--warn-ink); }
.changelog-info, .badge-cat-info { background: var(--neutral-bg); color: var(--neutral-ink); }
.changelog-body { margin: 10px 0 0 54px; line-height: 1.55; }
.changelog-body p:first-child { margin-top: 0; }
.changelog-images { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0 54px; padding: 0; list-style: none; }
.changelog-images img { display: block; max-width: 260px; max-height: 180px; border: 1px solid var(--line); border-radius: var(--r-2); }
@media (max-width: 640px) { .changelog-body, .changelog-images { margin-left: 0; } }

/* ── "Versionen" (thirty E-150/151) ─────────────────────────────────── */
.versions-system { display: grid; grid-template-columns: auto auto 1fr auto; gap: 16px 32px; align-items: center; padding: 20px 24px; }
.versions-system .version-big { font: 600 28px/1.1 var(--mono); letter-spacing: -.02em; }
.versions-system .label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.versions-system .releases { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.versions-system .build { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.versions-system .flash, .versions-system .versions-failed, .versions-system .versions-note { grid-column: 1 / -1; margin: 0; }
@media (max-width: 900px) { .versions-system { grid-template-columns: 1fr; } .versions-system .build { justify-content: flex-start; } }
.versions-failed summary { cursor: pointer; display: flex; gap: 10px; align-items: center; }
.versions-failed pre { white-space: pre-wrap; max-height: 240px; overflow: auto; font-size: 12px; margin: 8px 0 0; }
.versions-bar label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.versions-bar select { width: auto; }
.versions-table select.versions-policy { width: auto; min-width: 160px; height: 32px; }
.versions-table select.is-limited { border-color: var(--warn-ink); color: var(--warn-ink); }
.versions-error { color: var(--err-ink); }
.versions-help summary { cursor: pointer; color: var(--muted); }

/* local instance (Nutzer 2026-11-11): unmistakable, never on the server */
.dev-bar { position: sticky; top: 0; z-index: 1000; padding: 6px 16px; text-align: center; font-weight: 700; font-size: 14px;
    color: #fff; background: #af2426; letter-spacing: .12em; }
