/* ERD page: console tokens, one header bar with the detail switch, full-height canvas.
   Dark by default; `html[data-theme="light"]` (set by scripts/theme.js) swaps the tokens. */
:root {
    --bg: #0b0f14;
    --panel: #0f1720;
    --text: #dbe7ff;
    --muted: #8aa0b6;
    --brand: #005596;
    --brand-600: #2786B5;
    --accent: #FDB813;
    --line: rgba(255, 255, 255, 0.12);
    --hover: rgba(255, 255, 255, 0.06);
}

:root[data-theme="light"] {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #0f1720;
    --muted: #5b6b7c;
    --line: rgba(15, 23, 32, 0.14);
    --hover: rgba(15, 23, 32, 0.05);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    display: grid;
    grid-template-rows: 64px 1fr;
    background-color: var(--bg);
    color: var(--text);
    font: 14px/1.5 "Poppins", -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
}

.header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.header h1 { margin: 0; font-size: 16px; font-weight: 500; flex: 1; }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.brand-logo { height: 28px; }

.controls { display: flex; align-items: center; gap: 12px; }

.switch {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.switch label {
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--muted);
}

.switch label:hover { background: var(--hover); }

.switch input { display: none; }

.switch label:has(input:checked) { background: var(--brand); color: #fff; }

.check {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    cursor: pointer;
}

.check input { accent-color: var(--brand); margin: 0; }

/* Entity subheader: the class docstring, emitted as `*..*` emphasis under the name. */
.diagram .nodeLabel em, .diagram .label em {
    display: block;
    font-style: normal;
    font-size: 11px;
    font-weight: 300;
    color: var(--muted);
}

.btn {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover { border-color: var(--brand-600); background: var(--hover); }

.main {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    overflow: hidden;
}

.diagram { overflow: hidden; }

.diagram svg { width: 100%; height: 100%; }

.status {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    z-index: 1;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    padding: 8px 20px;
    border-top: 1px solid var(--line);
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
}

.legend b { color: var(--text); font-weight: 500; }

/* The theme toggle is icon-only (see theme.js): keep it square and centered. */
.btn[data-theme-toggle] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: var(--brand-600);
}
