/* ==========================================================================
   svg.giit.ch - styles for the editor and the text pages
   Light theme, dark theme by system setting or by choice.
   ========================================================================== */

:root {
    --bg: #f3f4f7;
    --flaeche: #ffffff;
    --flaeche-2: #f7f8fa;
    --text: #1a1d26;
    --leise: #5d6475;
    --linie: #e1e3ea;
    --linie-stark: #c9ccd6;
    --marke: #0f8f6f;
    --marke-hell: #e3f4ee;
    --marke-text: #ffffff;
    --gefahr: #c62f2f;
    --fehler-bg: #fdecec;
    --auswahl: #1a73e8;
    --buehne: #e8eaef;
    --karo-a: #ffffff;
    --karo-b: #e6e8ee;
    --raster: rgba(26, 115, 232, 0.16);
    --raster-stark: rgba(26, 115, 232, 0.34);
    --schatten: 0 1px 2px rgba(20, 22, 40, 0.06), 0 10px 30px -16px rgba(20, 22, 40, 0.28);
    --code-bg: #fbfbfd;
    --c-tag: #7a3dd8;
    --c-attr: #b25b00;
    --c-wert: #0b7a4b;
    --c-punkt: #8a8fa0;
    --c-komm: #8a8fa0;
    --c-ent: #c2185b;
    --c-sonder: #2b6cb0;
    --mark-sel: rgba(26, 115, 232, 0.14);
    --mark-err: rgba(198, 47, 47, 0.16);
    --r: 10px;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light dark;
}
/* Dark theme: by system setting while no choice has been made
   (no data-theme), or fixed with data-theme="dark". */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1116;
        --flaeche: #171a21;
        --flaeche-2: #1c2029;
        --text: #e9ebf1;
        --leise: #9ba2b4;
        --linie: #282c37;
        --linie-stark: #3a3f4d;
        --marke: #3cc99f;
        --marke-hell: #173a30;
        --marke-text: #08130f;
        --gefahr: #ff6b6b;
        --fehler-bg: #3a1c1f;
        --auswahl: #5aa2ff;
        --buehne: #0b0d11;
        --karo-a: #2a2e38;
        --karo-b: #22262f;
        --raster: rgba(90, 162, 255, 0.18);
        --raster-stark: rgba(90, 162, 255, 0.36);
        --schatten: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 36px -18px rgba(0, 0, 0, 0.8);
        --code-bg: #12151b;
        --c-tag: #c39bff;
        --c-attr: #ffb86b;
        --c-wert: #6fdca5;
        --c-punkt: #7d8394;
        --c-komm: #6d7385;
        --c-ent: #ff7fb0;
        --c-sonder: #7cb7ff;
        --mark-sel: rgba(90, 162, 255, 0.2);
        --mark-err: rgba(255, 107, 107, 0.22);
    }
}
:root[data-theme="dark"] {
    --bg: #0f1116;
    --flaeche: #171a21;
    --flaeche-2: #1c2029;
    --text: #e9ebf1;
    --leise: #9ba2b4;
    --linie: #282c37;
    --linie-stark: #3a3f4d;
    --marke: #3cc99f;
    --marke-hell: #173a30;
    --marke-text: #08130f;
    --gefahr: #ff6b6b;
    --fehler-bg: #3a1c1f;
    --auswahl: #5aa2ff;
    --buehne: #0b0d11;
    --karo-a: #2a2e38;
    --karo-b: #22262f;
    --raster: rgba(90, 162, 255, 0.18);
    --raster-stark: rgba(90, 162, 255, 0.36);
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.35), 0 14px 36px -18px rgba(0, 0, 0, 0.8);
    --code-bg: #12151b;
    --c-tag: #c39bff;
    --c-attr: #ffb86b;
    --c-wert: #6fdca5;
    --c-punkt: #7d8394;
    --c-komm: #6d7385;
    --c-ent: #ff7fb0;
    --c-sonder: #7cb7ff;
    --mark-sel: rgba(90, 162, 255, 0.2);
    --mark-err: rgba(255, 107, 107, 0.22);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--marke); }
button, input, select, textarea { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.leise { color: var(--leise); }
:focus-visible { outline: 2px solid var(--auswahl); outline-offset: 1px; }

/* ---------- Buttons and fields ---------- */

.knopf {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 12px;
    background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 8px;
    cursor: pointer; white-space: nowrap; font-weight: 500;
    transition: background .12s, border-color .12s;
}
.knopf:hover { background: var(--flaeche-2); border-color: var(--leise); }
.knopf.haupt { background: var(--marke); border-color: var(--marke); color: var(--marke-text); font-weight: 600; }
.knopf.haupt:hover { filter: brightness(1.08); }
.knopf.klein { height: 28px; padding: 0 9px; font-size: 13px; border-radius: 7px; }
.knopf.an { background: var(--marke-hell); border-color: var(--marke); color: var(--marke); }
.knopf.gefahr { color: var(--gefahr); }
.knopf.symbol { width: 34px; padding: 0; font-weight: 700; }
.knopf.mit-symbol { padding: 0 11px 0 9px; }
.knopf:disabled, .wz:disabled { opacity: .4; cursor: not-allowed; }
.knopf:disabled:hover { background: var(--flaeche); border-color: var(--linie-stark); }
.knopf svg, .wz svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
select.knopf { padding-right: 6px; }

input:not([type=checkbox]):not([type=color]):not([type=range]), select:not(.knopf), textarea {
    width: 100%; min-width: 0; height: 30px; padding: 4px 8px;
    background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 7px;
}
textarea { height: auto; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--auswahl); box-shadow: 0 0 0 3px var(--mark-sel); }
input[type=color] { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--linie-stark); border-radius: 7px; background: var(--flaeche); cursor: pointer; }

/* ---------- Header ---------- */

.kopf {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 9px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
    position: relative; z-index: 3;
}
.marke { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); margin-right: auto; }
.marke h1 { font-size: 17px; margin: 0; font-weight: 750; letter-spacing: -0.01em; }
.marke h1 span { color: var(--leise); font-weight: 500; }
.leiste { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.schema { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--linie-stark); border-radius: 8px; background: var(--flaeche); }
.schema button {
    width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0;
    border: 0; border-radius: 6px; background: transparent; color: var(--leise); cursor: pointer;
}
.schema button:hover { color: var(--text); background: var(--flaeche-2); }
.schema button[aria-checked="true"] { background: var(--marke-hell); color: var(--marke); }
.schema svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.trenn { width: 1px; height: 22px; background: var(--linie); margin: 0 4px; }

/* ---------- Work area ---------- */

.ansichten { display: none; }
.arbeit {
    --code-fr: 1fr;
    --view-fr: 1fr;
    display: grid;
    grid-template-columns: minmax(0, var(--code-fr)) 6px minmax(0, var(--view-fr)) 290px;
    height: calc(100vh - 53px);
    height: calc(100dvh - 53px);
    min-height: 520px;
}
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--flaeche); }
.pane-kopf {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    min-height: 44px; padding: 6px 10px; border-bottom: 1px solid var(--linie);
}
.pane-kopf .rechts { margin-left: auto; display: flex; gap: 6px; }

.splitter { background: var(--linie); cursor: col-resize; position: relative; touch-action: none; }
.splitter::after { content: ""; position: absolute; inset: 50% 1px auto; height: 36px; transform: translateY(-50%); border-left: 2px dotted var(--leise); left: 2px; opacity: .6; }
.splitter:hover, .splitter:focus-visible { background: var(--linie-stark); }

/* ---------- Code ---------- */

.fehler { padding: 8px 12px; background: var(--fehler-bg); color: var(--text); border-bottom: 1px solid var(--linie); font-size: 13px; }
.fehler b { color: var(--gefahr); }
.editor { position: relative; flex: 1; display: flex; min-height: 0; background: var(--code-bg); overflow: hidden; }
.gutter {
    flex: none; width: 46px; overflow: hidden; padding: 10px 8px 10px 0; text-align: right;
    font: 13px/20px var(--mono); color: var(--c-punkt); border-right: 1px solid var(--linie); user-select: none;
}
#gutter { white-space: pre; will-change: transform; }
.code-feld { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.schicht, #code {
    margin: 0; padding: 10px 14px; border: 0;
    font: 13px/20px var(--mono); tab-size: 2; white-space: pre; letter-spacing: 0;
    font-variant-ligatures: none;
}
.schicht { position: absolute; inset: 0 auto auto 0; min-width: 100%; pointer-events: none; will-change: transform; overflow: visible; }
.marks { color: transparent; }
.marks mark { color: transparent; border-radius: 3px; }
.marks mark.sel { background: var(--mark-sel); box-shadow: 0 0 0 1px var(--mark-sel); }
.marks mark.err { background: var(--mark-err); }
#code {
    position: absolute; inset: 0; width: 100%; height: 100%; resize: none; outline: none;
    background: transparent; color: transparent; caret-color: var(--text);
    overflow: auto; border-radius: 0; box-shadow: none !important;
}
#code::selection { background: rgba(26, 115, 232, 0.28); color: transparent; }
.hl { color: var(--text); }
.hl .k { color: var(--c-tag); }
.hl .a { color: var(--c-attr); }
.hl .s { color: var(--c-wert); }
.hl .p { color: var(--c-punkt); }
.hl .c { color: var(--c-komm); font-style: italic; }
.hl .e { color: var(--c-ent); }
.hl .d { color: var(--c-sonder); }

/* ---------- Tools ---------- */

.werkzeuge { justify-content: space-between; gap: 6px 8px; padding: 6px 8px; }
.gruppe { display: flex; align-items: center; gap: 2px; }
.werkzeuge .trenn { margin: 0 3px; }
.wz {
    width: 30px; height: 30px; display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; color: var(--text);
}
.wz:hover { background: var(--flaeche-2); border-color: var(--linie); }
.wz[aria-pressed="true"] { background: var(--marke-hell); border-color: var(--marke); color: var(--marke); }
.rasterweite input { width: 58px !important; height: 30px; text-align: center; }
.zoomwert { min-width: 52px; padding: 0 4px !important; font-variant-numeric: tabular-nums; }
.rasterweite { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--leise); }
.rasterweite input { width: 50px !important; padding: 4px !important; text-align: center; }
.wz.mit-text { width: auto; display: inline-flex; gap: 5px; padding: 0 8px; font-size: 13px; font-weight: 600; }
.snap {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 8px;
    border: 1px solid var(--linie-stark); border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; user-select: none;
}
.snap input { width: 16px; height: 16px; margin: 0; accent-color: var(--marke); cursor: pointer; }
.snap.aus { opacity: .45; cursor: not-allowed; }
.snap.aus input { cursor: not-allowed; }
.raster-gruppe { gap: 6px; }
.hinweiszeile {
    position: absolute; left: 12px; bottom: 12px; right: 390px; z-index: 1; pointer-events: none;
    font-size: 12.5px; line-height: 1.4; color: var(--leise);
}
.hinweiszeile { text-shadow: 0 0 6px var(--buehne), 0 0 2px var(--buehne); }
.zoom #bg { width: auto; }
.werkzeuge { padding: 6px; }

/* ---------- Stage ---------- */

.buehne {
    position: relative; flex: 1; overflow: hidden; background: var(--buehne);
    touch-action: none; outline: none; cursor: default; user-select: none;
}
.buehne[data-tool="hand"], .buehne.hand { cursor: grab; }
.buehne.ziehen { cursor: grabbing; }
.buehne[data-tool="rect"], .buehne[data-tool="ellipse"], .buehne[data-tool="line"], .buehne[data-tool="pen"] { cursor: crosshair; }
.buehne[data-tool="text"] { cursor: text; }
.papier { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: var(--schatten); }
.papier[data-bg="karo"] {
    background-color: var(--karo-a);
    background-image: linear-gradient(45deg, var(--karo-b) 25%, transparent 25%, transparent 75%, var(--karo-b) 75%),
                      linear-gradient(45deg, var(--karo-b) 25%, transparent 25%, transparent 75%, var(--karo-b) 75%);
    background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.papier[data-bg="hell"] { background: #ffffff; }
.papier[data-bg="dunkel"] { background: #1b1e25; }
.papier[data-bg="keiner"] { background: transparent; box-shadow: 0 0 0 1px var(--linie-stark); }
#host { width: 100%; height: 100%; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.overlay .hover { fill: none; stroke: var(--auswahl); stroke-width: 1; stroke-dasharray: 4 3; }
.overlay .rahmen { fill: none; stroke: var(--auswahl); stroke-width: 1.5; }
.overlay .griff { fill: #ffffff; stroke: var(--auswahl); stroke-width: 1.5; pointer-events: all; }
.overlay .griff[data-h="nw"], .overlay .griff[data-h="se"] { cursor: nwse-resize; }
.overlay .griff[data-h="ne"], .overlay .griff[data-h="sw"] { cursor: nesw-resize; }
.overlay .griff[data-h="n"], .overlay .griff[data-h="s"] { cursor: ns-resize; }
.overlay .griff[data-h="e"], .overlay .griff[data-h="w"] { cursor: ew-resize; }
.overlay .griff[data-h^="p"] { cursor: move; }
.overlay .marquee { display: none; }
.buehne .zoom {
    position: absolute; right: 12px; bottom: 12px; z-index: 2; padding: 3px;
    background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; box-shadow: var(--schatten);
}
.veraltet-hinweis {
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: none;
    padding: 4px 12px; border-radius: 99px; background: var(--fehler-bg); color: var(--gefahr); font-size: 12px; font-weight: 600;
    box-shadow: var(--schatten);
}
.buehne.veraltet .veraltet-hinweis { display: block; }
.buehne.veraltet .papier { opacity: .55; }

/* ---------- Properties ---------- */

.inspector { border-left: 1px solid var(--linie); }
.reiter { gap: 4px; padding: 6px; }
.reiter button, .ansichten button {
    flex: 1; height: 30px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-weight: 600; color: var(--leise);
}
.reiter button[aria-selected="true"], .ansichten button[aria-selected="true"] { background: var(--flaeche-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--linie); }
.inspector-body { flex: 1; overflow: auto; padding: 4px 14px 18px; }
.inspector-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); margin: 18px 0 8px; font-weight: 700; }
.inspector-body h3 code { text-transform: none; letter-spacing: 0; font: 12px var(--mono); color: var(--c-tag); margin-left: 4px; }
.pfad { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding-top: 10px; font: 12px var(--mono); color: var(--leise); }
.pfad button { border: 0; background: none; padding: 1px 3px; border-radius: 4px; color: var(--marke); cursor: pointer; font: inherit; }
.pfad button:hover { background: var(--marke-hell); }
.pfad b { color: var(--text); }
.hinweis { font-size: 12.5px; color: var(--leise); margin: 8px 0; }
.feld { display: grid; grid-template-rows: subgrid; grid-row: span 2; gap: 3px; font-size: 12.5px; min-width: 0; }
.feld > span:first-child { align-self: end; color: var(--leise); font-weight: 500; }
.feld small { font-weight: 400; opacity: .8; }
label.feld + label.feld { margin-top: 0; }
.inspector-body > .feld { margin-top: 10px; grid-template-rows: auto auto; }
.zeile3 { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 3px 10px; margin-top: 10px; }
.geo { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; gap: 3px 6px; }
.geo input { padding: 4px 5px !important; font-variant-numeric: tabular-nums; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.knopfreihe .knopf { flex: 1 1 auto; }
.knopfreihe.zwei { display: grid; grid-template-columns: 1fr 1fr; }
.vorgaben { display: grid; grid-template-columns: auto 34px 1fr; align-items: center; gap: 8px 10px; font-size: 12.5px; color: var(--leise); }
.vorgaben input[type=number] { grid-column: 2 / -1; max-width: 120px; }
.mit-keine { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.kasten { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }

.farbe {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; align-items: center;
    margin-top: 12px; padding: 10px; border: 1px solid var(--linie); border-radius: var(--r); background: var(--flaeche-2);
}
.farbe .feld-titel { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; }
.farbfeld { position: relative; width: 34px; height: 30px; border-radius: 7px; overflow: hidden; cursor: pointer; box-shadow: inset 0 0 0 1px var(--linie-stark); }
.farbfeld input { position: absolute; inset: -6px; width: 46px !important; height: 42px !important; border: 0; padding: 0; cursor: pointer; }
.farbfeld.keine::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: var(--flaeche) linear-gradient(to top right, transparent calc(50% - 1.5px), var(--gefahr) calc(50% - 1px), var(--gefahr) calc(50% + 1px), transparent calc(50% + 1.5px));
}
.hexwert { font: 12.5px var(--mono) !important; }
.farbe .hinweis, .farbe .regler { grid-column: 1 / -1; margin: 0; }
.regler { display: grid; grid-template-columns: auto 1fr 44px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--leise); }
.regler input { width: 100%; accent-color: var(--marke); }
.regler output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.regler.gesamt { margin-top: 12px; }
#f-text { min-height: 52px; }

.attribute { margin-top: 18px; border-top: 1px solid var(--linie); padding-top: 8px; }
.attribute summary { cursor: pointer; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); font-weight: 700; padding: 6px 0; }
.attr-liste { display: grid; gap: 4px; }
.attr { display: grid; grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 26px; gap: 4px; align-items: center; }
.attr > span { font: 12px var(--mono); color: var(--c-attr); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr input { font: 12px var(--mono) !important; height: 28px !important; }
.attr.neu { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 26px; margin-top: 4px; }
.weg { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; color: var(--leise); }
.weg:hover { background: var(--flaeche-2); color: var(--text); }

.baum { list-style: none; margin: 8px 0 0; padding: 0; font: 12.5px var(--mono); }
.baum button {
    display: flex; gap: 6px; width: 100%; padding: 4px 8px 4px calc(8px + var(--t) * 14px);
    border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text);
}
.baum button b { color: var(--text); font: 600 13px system-ui, sans-serif; }
.tupfer { flex: none; width: 12px; height: 12px; margin-top: 3px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.tupfer.leer { box-shadow: none; }
.baum button span { color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.baum button:hover, .baum button.hover { background: var(--flaeche-2); }
.baum button.aktiv { background: var(--mark-sel); box-shadow: inset 2px 0 0 var(--auswahl); }

/* ---------- Dialogs, messages ---------- */

.dialog {
    width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0;
    border: 1px solid var(--linie); border-radius: 14px; background: var(--flaeche); color: var(--text); box-shadow: var(--schatten);
}
.dialog::backdrop { background: rgba(10, 12, 18, 0.45); }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--linie); margin: 0; }
.dialog-kopf h2 { margin: 0; font-size: 17px; }
.schliessen { width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 16px; }
.schliessen:hover { background: var(--flaeche-2); }
.dialog-inhalt { padding: 16px 18px 18px; }
.ex-zeile { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; gap: 3px 12px; margin-bottom: 14px; }
.ex-zeile.vier { grid-template-columns: repeat(4, 1fr); }
.ex-text { width: 100%; height: 240px !important; font: 12px/1.5 var(--mono) !important; white-space: pre; background: var(--code-bg) !important; }
.dialog[data-raster="true"] .nur-text { display: none; }
.dialog[data-raster="false"] .nur-bild { display: none; }
.dialog-fuss { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.dialog-fuss .leise { margin-right: auto; }
.kuerzel dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; }
.kuerzel dt { white-space: nowrap; }
.kuerzel dd { margin: 0; color: var(--leise); }
kbd {
    display: inline-block; min-width: 22px; padding: 1px 6px; text-align: center;
    border: 1px solid var(--linie-stark); border-bottom-width: 2px; border-radius: 5px; background: var(--flaeche-2); font: 12px var(--mono);
}

.toast {
    position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
    padding: 9px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 500; box-shadow: var(--schatten);
    transition: opacity .18s, transform .18s; z-index: 20; max-width: calc(100vw - 32px);
}
.toast.zeigen { opacity: 1; transform: translate(-50%, 0); }
.ablage-hinweis {
    position: fixed; inset: 0; display: none; place-items: center; z-index: 30; pointer-events: none;
    background: rgba(15, 143, 111, 0.12); border: 3px dashed var(--marke);
}
.ablage-hinweis span { padding: 14px 22px; border-radius: 12px; background: var(--flaeche); font-size: 18px; font-weight: 700; box-shadow: var(--schatten); }
body.ablegen .ablage-hinweis { display: grid; }

/* ---------- Text section below the editor ---------- */

.seite { max-width: 980px; margin: 0 auto; padding: 48px 16px 24px; font-size: 16px; line-height: 1.65; }
.text-abschnitt { margin-bottom: 44px; }
.text-abschnitt h2 { font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 14px; }
.text-abschnitt h3 { font-size: 17px; margin: 0 0 6px; }
.text-abschnitt p { margin: 0 0 12px; }
.einstieg p { font-size: 17px; color: var(--leise); max-width: 760px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.kachel { padding: 18px 20px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; }
.kachel p { color: var(--leise); margin: 0; font-size: 15px; }
.schritte { padding-left: 22px; margin: 0; }
.schritte li { margin-bottom: 8px; }
.fragen details { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 0 18px; margin-bottom: 8px; }
.fragen summary { cursor: pointer; font-weight: 600; padding: 13px 0; }
.fragen details p { color: var(--leise); margin: 0 0 14px; }
.fuss {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
    max-width: 980px; margin: 0 auto; padding: 22px 16px 34px; border-top: 1px solid var(--linie); color: var(--leise); font-size: 14px;
}
.fuss nav { display: flex; gap: 18px; }
.fuss a { color: var(--leise); }
.fuss a:hover { color: var(--marke); }

/* Legal pages */
.recht { max-width: 760px; margin: 0 auto; padding: 36px 16px 20px; font-size: 16px; line-height: 1.65; }
.recht h1 { font-size: 30px; margin: 0 0 4px; letter-spacing: -0.02em; }
.recht h2 { font-size: 19px; margin: 30px 0 8px; }
.recht .stand { color: var(--leise); margin: 0 0 22px; }
.recht address { font-style: normal; margin-bottom: 10px; }
.recht ul { padding-left: 20px; }
.zurueck { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; text-decoration: none; font-weight: 600; }

/* ---------- Medium width: narrower properties ---------- */

@media (max-width: 1180px) {
    .arbeit { grid-template-columns: minmax(0, var(--code-fr)) 6px minmax(0, var(--view-fr)) 250px; }
}

/* ---------- Narrow: one view at a time ---------- */

@media (max-width: 860px) {
    .kopf { padding: 8px 12px; gap: 8px; }
    .marke h1 span { display: none; }
    .leiste.datei .trenn, #btn-copy, #btn-download { display: none; }
    .marke h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .hinweiszeile { right: 12px; bottom: 58px; }
    .leiste { gap: 4px; }
    .leiste.aus { order: 1; }
    .leiste.datei { order: 2; width: 100%; flex-wrap: nowrap; }
    .ansichten { display: flex; gap: 4px; padding: 6px 12px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
    .arbeit { display: block; height: calc(100dvh - 135px); min-height: 420px; }
    .arbeit > .pane, .splitter { display: none; height: 100%; }
    .arbeit[data-show="code"] .code-pane,
    .arbeit[data-show="zeichnen"] .zeichen-pane,
    .arbeit[data-show="eigenschaften"] .inspector { display: flex; }
    .inspector { border-left: 0; }
    .werkzeuge { justify-content: flex-start; }
    .seite { padding-top: 32px; }
    .text-abschnitt h2 { font-size: 22px; }
    .ex-zeile.vier { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto auto; }
}
@media (max-width: 480px) {
    .ex-zeile { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; }
    .kuerzel dl { grid-template-columns: 1fr; gap: 2px; }
    .kuerzel dd { margin-bottom: 8px; }
}
