/* =====================================================================
   at0mic Cockpit – Design
   ---------------------------------------------------------------------
   1. Farben & Grössen (Hell / Dunkel)
   2. Grundlagen
   3. Gerüst: Sidebar, Topbar, Inhalt
   4. Bausteine: Knöpfe, Karten, Badges, Hinweise, Formulare …
   5. Seiten-spezifisch (Übersicht)
   6. Protokoll & Toasts
   7. Handy
   ===================================================================== */

/* ---------- 1. Farben & Grössen ---------- */
:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --surface-3: #e7eaef;
    --border: #e1e4ea;
    --border-strong: #cdd2da;
    --text: #151821;
    --muted: #5f6775;
    --faint: #8a919d;

    --accent: #6d5dfc;
    --accent-strong: #5646e8;
    --accent-soft: #eeecff;
    --on-accent: #ffffff;

    --ok: #15803d;
    --ok-soft: #e7f6ec;
    --warn: #b45309;
    --warn-soft: #fdf2e2;
    --error: #c62828;
    --error-soft: #fdecec;
    --info: #1d64d8;
    --info-soft: #e8f0fd;
    --test: #b7791f;
    --test-soft: #fff5dc;

    /* Die drei Rollen */
    --role-black: #1f2328;
    --role-black-bg: #e9eaec;
    --role-red: #d92d3a;
    --role-red-bg: #fde8ea;
    --role-blue: #2563eb;
    --role-blue-bg: #e6eefe;

    /* JSON-Farben */
    --j-key: #7c3aed;
    --j-string: #0f7b45;
    --j-number: #c2410c;
    --j-bool: #1d64d8;
    --j-null: #8a919d;

    --radius: 12px;
    --radius-s: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
    --shadow-l: 0 12px 32px rgba(16, 24, 40, 0.14);
    --sidebar-w: 240px;
    --topbar-h: 60px;

    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;

    color-scheme: light;
}

/* Dunkel: automatisch nach Systemeinstellung … */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg: #0d0f14;
        --surface: #151821;
        --surface-2: #1b1f2a;
        --surface-3: #242938;
        --border: #262b38;
        --border-strong: #353c4d;
        --text: #e7e9ee;
        --muted: #9aa2b1;
        --faint: #6c7485;
        --accent: #8d80ff;
        --accent-strong: #a399ff;
        --accent-soft: #262245;
        --on-accent: #0d0f14;
        --ok: #4ade80;
        --ok-soft: #10281a;
        --warn: #fbbf24;
        --warn-soft: #2b2110;
        --error: #f87171;
        --error-soft: #2d1416;
        --info: #60a5fa;
        --info-soft: #102038;
        --test: #fbbf24;
        --test-soft: #2a220c;
        --role-black: #e7e9ee;
        --role-black-bg: #2a2f3b;
        --role-red: #ff6b75;
        --role-red-bg: #3a1a1f;
        --role-blue: #6ea2ff;
        --role-blue-bg: #17264a;
        --j-key: #c4a5ff;
        --j-string: #7ee2a8;
        --j-number: #fdba74;
        --j-bool: #7cb7ff;
        --j-null: #7d8594;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-l: 0 16px 40px rgba(0, 0, 0, 0.55);
        color-scheme: dark;
    }
}
/* … oder von Hand gewählt (Knopf oben rechts) */
:root[data-theme='dark'] {
    --bg: #0d0f14;
    --surface: #151821;
    --surface-2: #1b1f2a;
    --surface-3: #242938;
    --border: #262b38;
    --border-strong: #353c4d;
    --text: #e7e9ee;
    --muted: #9aa2b1;
    --faint: #6c7485;
    --accent: #8d80ff;
    --accent-strong: #a399ff;
    --accent-soft: #262245;
    --on-accent: #0d0f14;
    --ok: #4ade80;
    --ok-soft: #10281a;
    --warn: #fbbf24;
    --warn-soft: #2b2110;
    --error: #f87171;
    --error-soft: #2d1416;
    --info: #60a5fa;
    --info-soft: #102038;
    --test: #fbbf24;
    --test-soft: #2a220c;
    --role-black: #e7e9ee;
    --role-black-bg: #2a2f3b;
    --role-red: #ff6b75;
    --role-red-bg: #3a1a1f;
    --role-blue: #6ea2ff;
    --role-blue-bg: #17264a;
    --j-key: #c4a5ff;
    --j-string: #7ee2a8;
    --j-number: #fdba74;
    --j-bool: #7cb7ff;
    --j-null: #7d8594;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-l: 0 16px 40px rgba(0, 0, 0, 0.55);
    color-scheme: dark;
}

/* ---------- 2. Grundlagen ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}
html,
body {
    margin: 0;
    height: 100%;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a {
    color: var(--accent-strong);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
h1,
h2,
h3,
h4 {
    margin: 0;
    line-height: 1.3;
    font-weight: 650;
}
p {
    margin: 0;
}
code,
.mono {
    font-family: var(--mono);
    font-size: 0.9em;
}
:not(pre) > code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 1px 6px;
    border-radius: 5px;
    word-break: break-word;
}
.muted {
    color: var(--muted);
}
.small {
    font-size: 12.5px;
}
.nowrap {
    white-space: nowrap;
}
.pad {
    padding: 16px;
}
.row {
    display: flex;
    align-items: center;
}
.gap-s {
    gap: 8px;
}
[hidden] {
    display: none !important;
}
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}
.icon {
    flex-shrink: 0;
}

/* ---------- 3. Gerüst ---------- */
.shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 14px 12px;
    overflow-y: auto;
    z-index: 30;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 18px;
    color: var(--text);
    text-decoration: none !important;
}
.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 50%, var(--on-accent) 0 3px, transparent 3.5px),
        conic-gradient(from 200deg, var(--accent), #b25cff, var(--accent));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand-name {
    font-weight: 750;
    font-size: 18px;
    letter-spacing: -0.02em;
}
.brand-zero {
    color: var(--accent);
}
.brand-sub {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 1px 8px;
}
.nav {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}
.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--faint);
    font-weight: 600;
    padding: 0 10px 4px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-s);
    color: var(--muted);
    font-weight: 500;
    text-decoration: none !important;
    transition:
        background 0.12s,
        color 0.12s;
}
.nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}
.nav-link.subtle {
    font-size: 13px;
}
.nav-icon {
    display: inline-flex;
}
.nav-soon {
    margin-left: auto;
    font-size: 10.5px;
    color: var(--faint);
    border: 1px dashed var(--border-strong);
    border-radius: 99px;
    padding: 0 7px;
}
.sidebar-foot {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}
.sidebar-backdrop {
    display: none;
}

/* Hauptbereich */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
body[data-mode='test'] .topbar {
    border-bottom: 2px solid var(--test);
}
.topbar-title {
    flex: 1;
    min-width: 0;
}
.topbar-title h1 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-btn {
    display: none;
}

/* Live/Test-Umschalter */
.mode-switch {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 99px;
}
.mode-switch button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 99px;
    cursor: pointer;
}
.mode-switch button.active[data-mode='live'] {
    background: var(--surface);
    color: var(--ok);
    box-shadow: var(--shadow);
}
.mode-switch button.active[data-mode='test'] {
    background: var(--test);
    color: #1b1400;
}
.mode-switch.pulse {
    animation: pulse 1.2s ease-in-out 3;
}
@keyframes pulse {
    50% {
        box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 35%, transparent);
    }
}

/* Wer bin ich */
.identity {
    display: flex;
    align-items: center;
    gap: 6px;
}
.identity-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 550;
    max-width: 200px;
}
.identity-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.identity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--faint);
}
.identity-dot.ok {
    background: var(--ok);
}
.identity-dot.warn {
    background: var(--warn);
}
.identity-dot.error {
    background: var(--error);
}

.mode-banner {
    padding: 12px 24px 0;
}
.mode-banner .callout {
    margin: 0;
}
.content {
    padding: 22px 24px 60px;
    outline: none;
    max-width: 1320px;
    width: 100%;
}
.page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.page-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.page-intro {
    flex: 1;
    color: var(--muted);
    max-width: 780px;
    font-size: 15px;
}
.page-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---------- 4. Bausteine ---------- */

/* Knöpfe */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: var(--radius-s);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 550;
    font-size: 13.5px;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition:
        background 0.12s,
        border-color 0.12s,
        transform 0.05s;
}
.btn:hover {
    background: var(--surface-2);
}
.btn:active {
    transform: translateY(1px);
}
.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}
.btn.primary:hover {
    background: var(--accent-strong);
}
.btn.danger {
    color: var(--error);
    border-color: color-mix(in srgb, var(--error) 40%, var(--border));
}
.btn.danger:hover {
    background: var(--error-soft);
}
.btn.ghost {
    border-color: transparent;
    background: transparent;
}
.btn.ghost:hover {
    background: var(--surface-2);
}
.btn.small {
    padding: 5px 10px;
    font-size: 12.5px;
}
.btn:disabled {
    opacity: 0.55;
    cursor: default;
}
.btn.is-busy .icon {
    animation: spin 0.8s linear infinite;
}
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}
.icon-btn.small {
    width: 28px;
    height: 28px;
}
.dot-count {
    position: absolute;
    top: 3px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 99px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* Karten */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px 0;
}
.card-title {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.card-title h2 {
    font-size: 15px;
}
.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    flex-shrink: 0;
}
.card-actions {
    display: flex;
    gap: 6px;
}
.card-body {
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 18px;
}

/* Badges & Rollen */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--muted);
    border: 1px solid var(--border);
}
.badge.ok {
    background: var(--ok-soft);
    color: var(--ok);
    border-color: transparent;
}
.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: transparent;
}
.badge.error {
    background: var(--error-soft);
    color: var(--error);
    border-color: transparent;
}
.badge.test {
    background: var(--test-soft);
    color: var(--test);
    border-color: transparent;
}
.badge.accent {
    background: var(--accent-soft);
    color: var(--accent-strong);
    border-color: transparent;
}
.role {
    display: inline-block;
    padding: 0 7px;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
}
.role.black {
    color: var(--role-black);
    background: var(--role-black-bg);
}
.role.red {
    color: var(--role-red);
    background: var(--role-red-bg);
}
.role.blue {
    color: var(--role-blue);
    background: var(--role-blue-bg);
}

/* Hinweis-Kästen */
.callout {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 14px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    font-size: 13.5px;
}
.callout .icon {
    margin-top: 2px;
}
.callout.info {
    background: var(--info-soft);
    color: var(--text);
}
.callout.info .icon {
    color: var(--info);
}
.callout.ok {
    background: var(--ok-soft);
}
.callout.ok .icon {
    color: var(--ok);
}
.callout.warn {
    background: var(--warn-soft);
}
.callout.warn .icon {
    color: var(--warn);
}
.callout.error {
    background: var(--error-soft);
}
.callout.error .icon {
    color: var(--error);
}
.callout.test {
    background: var(--test-soft);
    border-color: color-mix(in srgb, var(--test) 35%, transparent);
}
.callout.test .icon {
    color: var(--test);
}

/* Laden & Leer */
.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    padding: 14px 2px;
}
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 26px 16px;
}
.empty p {
    max-width: 420px;
}
.empty-icon {
    display: inline-flex;
    padding: 12px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--muted);
}

/* Code & JSON */
pre {
    margin: 0;
}
.json,
.code-block pre {
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    padding: 10px 12px;
    overflow: auto;
    white-space: pre;
}
.j-key {
    color: var(--j-key);
}
.j-string {
    color: var(--j-string);
}
.j-number {
    color: var(--j-number);
}
.j-bool {
    color: var(--j-bool);
}
.j-null {
    color: var(--j-null);
}
.code-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.result-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.result-line.ok .icon {
    color: var(--ok);
}
.result-line.error .icon {
    color: var(--error);
}
.id-line {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.checklist li {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.checklist .icon {
    color: var(--accent);
    margin-top: 3px;
}

/* ---------- 5. Übersicht ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--border-strong);
    min-width: 0;
}
.stat.ok {
    border-top-color: var(--ok);
}
.stat.warn {
    border-top-color: var(--warn);
}
.stat.error {
    border-top-color: var(--error);
}
.stat.test {
    border-top-color: var(--test);
}
.stat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 550;
}
.stat-icon {
    display: inline-flex;
}
.stat-value {
    font-size: 21px;
    font-weight: 700;
    margin: 6px 0 2px;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.stat-detail {
    color: var(--muted);
    font-size: 12.5px;
}
/* Kachel "Dein Kontingent": eine Zeile pro Deckel mit kleinem Balken */
.quota-line {
    display: block;
    margin-top: 4px;
}
.quota-bar {
    display: block;
    height: 4px;
    margin-top: 3px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.quota-bar > span {
    display: block;
    height: 100%;
    background: var(--ok);
}
.quota-bar.warn > span {
    background: var(--warn);
}
.quota-bar.error > span {
    background: var(--error);
}

.mini-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.mini-stats strong {
    font-size: 18px;
}
.object-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.object-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    margin: 0 -8px;
    border-radius: var(--radius-s);
    color: var(--text);
    text-decoration: none !important;
}
.object-list a:hover {
    background: var(--surface-2);
}
.obj-icon {
    display: inline-flex;
    color: var(--accent);
}
.obj-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.obj-domain {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.obj-path {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.more-link {
    font-size: 13px;
    font-weight: 550;
}

.concepts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.concept {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    color: var(--text);
    text-decoration: none !important;
    transition:
        border-color 0.12s,
        transform 0.12s;
}
.concept:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}
.concept p {
    color: var(--muted);
    font-size: 13px;
}
.concept-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.stages {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.stages li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.stage-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.stages li.done .stage-n {
    background: var(--ok);
    border-color: var(--ok);
    color: #fff;
}

/* ---------- 6. Protokoll & Toasts ---------- */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(520px, 100vw);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-l);
    z-index: 50;
    display: flex;
    flex-direction: column;
}
.drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
}
.drawer-head h2 {
    font-size: 16px;
}
.drawer-body {
    overflow-y: auto;
    flex: 1;
}
.log-entry {
    border-bottom: 1px solid var(--border);
}
.log-entry summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
}
.log-entry summary::-webkit-details-marker {
    display: none;
}
.log-entry summary:hover {
    background: var(--surface-2);
}
.log-path {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12.5px;
}
.method {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    width: 52px;
    flex-shrink: 0;
}
.m-get {
    color: var(--ok);
}
.m-post {
    color: var(--info);
}
.m-put {
    color: var(--warn);
}
.m-delete {
    color: var(--error);
}
.log-status {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 12px;
}
.log-status.ok {
    color: var(--ok);
}
.log-status.warn {
    color: var(--warn);
}
.log-status.error {
    color: var(--error);
}
.log-detail {
    padding: 4px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    word-break: break-all;
}
.log-detail h4 {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 60;
}
.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-s);
    box-shadow: var(--shadow-l);
    font-size: 13.5px;
    max-width: 380px;
    animation: toast-in 0.2s ease-out;
    transition:
        opacity 0.25s,
        transform 0.25s;
}
.toast.ok .icon {
    color: var(--ok);
}
.toast.error .icon {
    color: var(--error);
}
.toast.info .icon {
    color: var(--info);
}
.toast.leaving {
    opacity: 0;
    transform: translateY(6px);
}
@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* ---------- 7. Handy & kleinere Bildschirme ---------- */
@media (max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
    .concepts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-l);
    }
    body.nav-open .sidebar {
        transform: none;
    }
    body.nav-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.35);
        z-index: 25;
    }
    .menu-btn {
        display: inline-flex;
    }
    .topbar {
        padding: 0 12px;
        gap: 6px;
    }
    .content {
        padding: 16px 16px 60px;
    }
    .mode-banner {
        padding: 10px 16px 0;
    }
    .hide-s {
        display: none;
    }
    .identity-chip {
        max-width: 110px;
    }
    .page-head {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .stats,
    .concepts {
        grid-template-columns: minmax(0, 1fr);
    }
    .topbar-title h1 {
        font-size: 16px;
    }
    #themeBtn {
        display: none;
    }
    .identity-chip {
        display: none;
    }
    .toasts {
        left: 16px;
        right: 16px;
    }
}

/* Sichtbarkeit (Objekt-Seite): drei Stufen als Auswahl */
.obj-vis {
    font-size: 12px;
    margin-left: 4px;
}
.vis-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px;
}
.vis-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}
.vis-option.current {
    border-color: var(--border-strong);
}
.vis-option input {
    margin-top: 3px;
}
.block {
    display: block;
}
