/* Layout: Werkbank-Oberfläche – oben Projektleiste, darunter Arbeitsfläche (Bild/3D links, Abteilungen rechts).
   Farben: Tiefenschiefer-Neutraltöne mit Moos-Akzent, Laternen-Bernstein für „In Arbeit“. */
:root {
  --bg: #eef0ea;
  --surface: #ffffff;
  --surface-2: #e3e7dd;
  --surface-3: #d5dbcd;
  --fg: #1c221b;
  --muted: #5b6558;
  --line: #ccd3c4;
  --accent: #3f7d2c;
  --accent-strong: #2f6420;
  --accent-fg: #ffffff;
  --amber: #a86d12;
  --amber-bg: #fbedd3;
  --done: #2d8048;
  --done-bg: #dcf0e1;
  --open-bg: #e4e6e2;
  --danger: #b3402e;
  --sky: #a9cde9;
  --grid: #5f6f5a;
  --shadow: 0 1px 2px rgb(20 30 20 / 0.08), 0 4px 14px rgb(20 30 20 / 0.06);
  --font-display: "Pixelify Sans", "Courier New", monospace;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141714; --surface: #1d211d; --surface-2: #262b25; --surface-3: #30362f;
    --fg: #e5e9e1; --muted: #9aa495; --line: #343b32;
    --accent: #7dbb5c; --accent-strong: #95cf75; --accent-fg: #0e150b;
    --amber: #e8aa4c; --amber-bg: #3a2c14; --done: #63c584; --done-bg: #163322; --open-bg: #2a2e29;
    --danger: #e3735f; --sky: #1d2a38; --grid: #6f8a66;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 18px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141714; --surface: #1d211d; --surface-2: #262b25; --surface-3: #30362f;
  --fg: #e5e9e1; --muted: #9aa495; --line: #343b32;
  --accent: #7dbb5c; --accent-strong: #95cf75; --accent-fg: #0e150b;
  --amber: #e8aa4c; --amber-bg: #3a2c14; --done: #63c584; --done-bg: #163322; --open-bg: #2a2e29;
  --danger: #e3735f; --sky: #1d2a38; --grid: #6f8a66;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 18px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: 0.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-strong); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--font-mono); font-size: 0.85em; }
.num { font-variant-numeric: tabular-nums; }
.boot { padding: 3rem; text-align: center; color: var(--muted); }
.label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- Grundgerüst */
.wrap { max-width: 1320px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page { padding-block: 1.5rem 4rem; display: grid; gap: 1.5rem; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .wrap { display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--fg); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.brand-block { width: 22px; height: 22px; display: grid; grid-template: repeat(4, 1fr) / repeat(4, 1fr); border-radius: 2px; overflow: hidden; flex: none; }
.brand-block i { display: block; }
.crumbs { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; min-width: 0; flex: 1; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { opacity: 0.5; }
.crumbs strong { color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.me { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }

/* ---------- Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 1.1rem 1.2rem; }
.stack { display: grid; gap: 0.75rem; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); padding: 0.45rem 0.85rem; border-radius: var(--radius); cursor: pointer; font-weight: 550; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 0.25rem 0.6rem; font-size: 0.82rem; }
.btn.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent-strong); cursor: pointer; text-decoration: underline; font: inherit; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.seg button { border: 0; background: transparent; padding: 0.35rem 0.75rem; cursor: pointer; font-size: 0.85rem; font-weight: 550; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }

input[type="text"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem 0.6rem; min-width: 0;
}
textarea { resize: vertical; min-height: 4.5rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type="color"] { width: 2.6rem; height: 2.2rem; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.field { display: grid; gap: 0.25rem; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.form-error { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.inline-form > input { flex: 1; min-width: 10rem; }

.pill { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 650; padding: 0.1rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.pill.offen { background: var(--open-bg); color: var(--muted); }
.pill.arbeit { background: var(--amber-bg); color: var(--amber); }
.pill.fertig { background: var(--done-bg); color: var(--done); }
.dot { width: 0.7rem; height: 0.7rem; border-radius: 2px; flex: none; background: var(--c, #888); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.2); }

.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar.done > i { background: var(--done); }
.bar.big { height: 10px; border-radius: 5px; }

.avatar { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 0.68rem; font-weight: 700; flex: none; background: var(--c, #567); border: 2px solid var(--surface); }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -0.45rem; }

.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 1.5rem; text-align: center; color: var(--muted); display: grid; gap: 0.75rem; justify-items: center; }

#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100; display: grid; gap: 0.5rem; pointer-events: none; width: min(92vw, 460px); }
.toast { background: var(--fg); color: var(--bg); padding: 0.6rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow); font-size: 0.9rem; animation: pop 0.18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(6px); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* ---------- Anmeldung */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #1b2418; color: #eef3e8; display: grid; align-content: end; padding: 2.5rem max(24px, env(safe-area-inset-left, 0px)); min-height: 320px; }
.auth-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.auth-art .copy { position: relative; display: grid; gap: 0.8rem; max-width: 30rem; background: rgb(15 20 14 / 0.72); padding: 1.2rem 1.4rem; border-radius: var(--radius); }
.auth-art h1 { font-size: 2.4rem; }
.auth-art p { color: #cfd9c6; }
.auth-side { display: grid; place-items: center; padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 2rem max(16px, env(safe-area-inset-left, 0px)); }
.auth-card { width: min(100%, 380px); padding: 1.6rem; display: grid; gap: 0.9rem; }
@media (max-width: 820px) { .auth { grid-template-columns: 1fr; } .auth-art { min-height: 260px; } }

/* ---------- Übersicht / Gruppen */
.hero-line { display: grid; gap: 0.35rem; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.group-card { padding: 1rem 1.1rem; text-decoration: none; color: inherit; display: grid; gap: 0.35rem; }
.group-card:hover { border-color: var(--accent); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.group-layout { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .group-layout { grid-template-columns: 1fr; } }
.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.project-card { overflow: hidden; text-decoration: none; color: inherit; display: grid; grid-template-rows: auto 1fr; }
.project-card:hover { border-color: var(--accent); }
.project-card .cover { aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; max-width: 100%; }
.project-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card .body { padding: 0.9rem 1rem; display: grid; gap: 0.5rem; align-content: start; }
.invite { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.invite code { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600; letter-spacing: 0.08em; background: var(--surface-2); padding: 0.3rem 0.7rem; border-radius: var(--radius); border: 1px dashed var(--line); user-select: all; }
.members { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.member { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--surface-2); border-radius: 999px; padding: 0.15rem 0.7rem 0.15rem 0.15rem; font-size: 0.88rem; }
.feed { display: grid; gap: 0.55rem; font-size: 0.88rem; }
.feed li { list-style: none; display: grid; gap: 0.05rem; }
.feed ul { margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.feed time { font-size: 0.75rem; color: var(--muted); }

/* ---------- Projekt */
.project-head { display: grid; gap: 0.9rem; }
.stats { display: flex; gap: 1.6rem; flex-wrap: wrap; align-items: end; }
.stat { display: grid; gap: 0.1rem; min-width: 8rem; }
.stat b { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat .bar { width: 100%; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 0.55rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--fg); }
.tabs a.on { color: var(--fg); border-bottom-color: var(--accent); }

.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr); gap: 1.25rem; align-items: start; }
@media (max-width: 960px) { .plan-grid { grid-template-columns: 1fr; } }
.image-panel { position: sticky; top: 72px; display: grid; gap: 0.7rem; padding: 0.9rem; }
@media (max-width: 960px) { .image-panel { position: static; } }
.thumbs { display: flex; gap: 0.45rem; overflow-x: auto; padding-bottom: 2px; align-items: center; }
.thumb { flex: none; width: 64px; height: 48px; border-radius: 4px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.on { border-color: var(--accent); }
.upload { flex: none; height: 48px; padding: 0 0.8rem; border: 1px dashed var(--line); border-radius: 4px; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; color: var(--muted); font-size: 0.85rem; font-weight: 600; background: transparent; }
.upload:hover { border-color: var(--accent); color: var(--fg); }
.upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.viewer { display: grid; place-items: center; background: var(--surface-2); border-radius: var(--radius); overflow: hidden; min-height: 200px; }
.viewer.drop { outline: 2px dashed var(--accent); outline-offset: -6px; }
.imgwrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; user-select: none; }
.imgwrap img { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; }
.markers { position: absolute; inset: 0; }
.marker { position: absolute; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 3px; cursor: pointer; padding: 0; line-height: 1.2; }
.marker:hover, .marker.sel { background: color-mix(in srgb, var(--c) 28%, transparent); border-width: 3px; z-index: 2; }
.marker.fertig { border-style: solid; background: color-mix(in srgb, var(--c) 30%, transparent); }
.marker.offen { border-style: dashed; }
.marker-label { position: absolute; left: -2px; top: -2px; transform: translateY(-100%); background: var(--c); color: #fff; font-size: 0.68rem; font-weight: 700; padding: 0.05rem 0.35rem; border-radius: 3px 3px 3px 0; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgb(0 0 0 / 0.4); }
.marker.sel .marker-label, .marker:hover .marker-label { z-index: 3; }
.markers.hide-labels .marker:not(.sel):not(:hover) .marker-label { display: none; }
.drawing { cursor: crosshair; }
.drawing .marker { pointer-events: none; opacity: 0.45; }
.draft { position: absolute; border: 2px dashed #fff; background: rgb(255 255 255 / 0.15); box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5); pointer-events: none; }
.mark-hint { background: var(--amber-bg); color: var(--amber); padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.88rem; font-weight: 600; }

.sections { display: grid; gap: 0.7rem; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--muted); }
.chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.section { overflow: hidden; }
.section.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow); }
.section-head { display: grid; grid-template-columns: auto 1fr auto; gap: 0.35rem 0.7rem; align-items: center; padding: 0.8rem 1rem; cursor: pointer; width: 100%; background: none; border: 0; text-align: left; }
.section-head:hover { background: var(--surface-2); }
.section-head .dot { width: 0.95rem; height: 0.95rem; }
.section-head h3 { overflow-wrap: anywhere; }
.section-meta { grid-column: 2 / 4; display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); }
.section-meta .bar { width: 90px; }
.section-body { border-top: 1px solid var(--line); padding: 1rem; display: grid; gap: 1.1rem; }
.section-body h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 0.4rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem; }
.done-box { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; padding: 0.7rem 0.8rem; border-radius: var(--radius); background: var(--surface-2); }
.done-box.fertig { background: var(--done-bg); color: var(--done); }
.btn.finish { background: var(--done); border-color: var(--done); color: #fff; }
.who { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.who button { display: inline-flex; align-items: center; gap: 0.35rem; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0.12rem 0.65rem 0.12rem 0.12rem; cursor: pointer; font-size: 0.85rem; }
.who button .avatar { width: 1.45rem; height: 1.45rem; border: 0; }
.who button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); font-weight: 600; }
.steps { display: grid; gap: 0.25rem; }
.step { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.step input[type="text"] { border-color: transparent; background: transparent; padding: 0.3rem 0.4rem; }
.step input[type="text"]:hover { border-color: var(--line); }
.step.done input[type="text"] { text-decoration: line-through; color: var(--muted); }
.step .by { grid-column: 2 / 3; font-size: 0.72rem; color: var(--muted); margin: -0.3rem 0 0.2rem 0.45rem; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0.2rem 0.4rem; border-radius: 4px; }
.x:hover { color: var(--danger); background: var(--surface-2); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
th, td { padding: 0.45rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td input[type="number"] { width: 5.5rem; text-align: right; }
td input[type="text"] { min-width: 9rem; }
td select { min-width: 7rem; }
td.secs { min-width: 16rem; }
tr.complete td { color: var(--muted); }
tr.complete td:first-child { color: var(--done); }
.mat-table td { white-space: nowrap; }
.have-cell { display: flex; gap: 0.25rem; align-items: center; }

/* ---------- 3D */
.v3-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1000px) { .v3-layout { grid-template-columns: 1fr; } }
.v3-main { display: grid; gap: 0.7rem; min-width: 0; }
.v3-toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.v3-viewport { position: relative; height: min(68vh, 640px); min-height: 320px; border-radius: var(--radius); overflow: hidden; background: var(--sky); border: 1px solid var(--line); }
.v3-host { position: absolute; inset: 0; }
.v3-canvas { display: block; touch-action: none; }
.v3-overlay { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; justify-content: space-between; gap: 0.5rem; pointer-events: none; flex-wrap: wrap; }
.v3-overlay > span { background: rgb(10 14 10 / 0.72); color: #eef3e8; padding: 0.25rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-family: var(--font-mono); }
.v3-message { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: var(--fg); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 0.3rem; max-height: 220px; overflow-y: auto; overflow-x: hidden; padding: 2px; }
.pblock { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.4rem; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; cursor: pointer; font-size: 0.76rem; text-align: left; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.pblock canvas { width: 22px; height: 22px; image-rendering: pixelated; flex: none; border-radius: 2px; }
.pblock.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); font-weight: 650; }
.edit-panel { padding: 0.8rem; display: grid; gap: 0.6rem; border-color: var(--accent); }
.side-panel { display: grid; gap: 0.9rem; padding: 0.9rem; }
.layer-ctl { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.layer-num { font-family: var(--font-mono); font-weight: 600; font-size: 1.4rem; }
.layer-canvas-wrap { background: var(--surface-2); border-radius: var(--radius); overflow: auto; max-height: 520px; }
.layer-canvas-wrap canvas { display: block; image-rendering: pixelated; touch-action: none; }
.legend { display: grid; gap: 0.2rem; font-size: 0.82rem; max-height: 220px; overflow-y: auto; }
.legend div { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.legend canvas { width: 16px; height: 16px; image-rendering: pixelated; border-radius: 2px; }
.vis-list { display: grid; gap: 0.2rem; }
.vis { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 0.5rem; align-items: center; padding: 0.25rem 0.35rem; border-radius: 4px; font-size: 0.86rem; }
.vis:hover { background: var(--surface-2); }
.vis.focus { background: color-mix(in srgb, var(--c) 18%, transparent); }
.vis .name { cursor: pointer; overflow-wrap: anywhere; }
.vis.hidden .name { opacity: 0.45; text-decoration: line-through; }
.save-state { font-size: 0.8rem; color: var(--muted); }
.kbd { font-family: var(--font-mono); font-size: 0.75rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 0 0.3rem; background: var(--surface); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
