/* IconCutter · Schneidematte
   Gestaltung: dunkle Schneidematte als Bühne, Werkzeugleiste rechts,
   Bernstein für Schnittlinien, Türkis für Inhalt, Weiß für die Ausgabe. */

:root {
    --bg: #0b1614;
    --mat: #15302a;
    --mat-line: rgba(178, 222, 205, 0.09);
    --mat-line-strong: rgba(178, 222, 205, 0.16);
    --panel: #0f1f1b;
    --panel-2: #142823;
    --edge: rgba(178, 222, 205, 0.14);
    --edge-strong: rgba(178, 222, 205, 0.42);   /* 3.1:1 auf Panel, WCAG 1.4.11 */
    --ink: #eaf2ec;
    --ink-2: #a9bcb3;
    --ink-3: #86998f;      /* 5.7:1 auf Panel, 4.7:1 auf Matte */
    --amber: #ffb454;
    --amber-2: #ffcf85;
    --teal: #4fd1c5;
    --white: #ffffff;
    --danger: #ff6b6b;
    --ok: #8be08a;
    --focus: #ffd166;
    --kofi: #d9235f;       /* 4.8:1 mit weißem Text; #ff4080 nur dekorativ */
    --kofi-hover: #c41e55;
    --radius: 14px;
    --radius-s: 9px;
    --font-display: "Bricolage Grotesque", "Avenir Next Condensed", "Segoe UI Variable Display", "Helvetica Neue", system-ui, sans-serif;
    --font-body: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
    --topbar-h: 58px;
    --panel-w: 340px;
    --ruler: 24px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
h1, h2, h3, legend { font-family: var(--font-display); letter-spacing: -0.01em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::placeholder { color: var(--ink-3); opacity: 1; }
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 50;
    background: var(--amber); color: #1a1200; padding: 8px 12px; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------- Topbar */
.topbar {
    height: var(--topbar-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 0 18px;
    border-bottom: 1px solid var(--edge);
    background: linear-gradient(180deg, rgba(21, 48, 42, .6), rgba(11, 22, 20, .2));
    backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; color: var(--amber); }
.wordmark { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }
.wordmark b { font-weight: 800; color: var(--amber); }
.topbar-status { margin: 0; color: var(--ink-2); font-size: .9rem; min-height: 1.2em; text-align: center; }
.topbar-actions { display: flex; gap: 8px; }

/* ---------------------------------------------------------- Layout */
.app {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--panel-w);
    min-height: calc(100vh - var(--topbar-h));
}
.workbench {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 18px;
    min-width: 0;
    background:
        linear-gradient(var(--mat-line-strong) 1px, transparent 1px) 0 0 / 120px 120px,
        linear-gradient(90deg, var(--mat-line-strong) 1px, transparent 1px) 0 0 / 120px 120px,
        linear-gradient(var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, var(--mat-line) 1px, transparent 1px) 0 0 / 24px 24px,
        radial-gradient(1200px 700px at 30% 0%, rgba(79, 209, 197, .07), transparent 60%),
        var(--mat);
}
.panel {
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--edge);
    background: var(--panel);
}
.panel-scroll > * { animation: rise .6s .08s var(--ease) both; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 8px; }
.panel-cta {
    position: sticky; bottom: 0;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--edge);
    background: linear-gradient(180deg, rgba(15, 31, 27, .7), var(--panel) 40%);
    display: grid; gap: 10px;
}
.cta-summary { margin: 0; color: var(--ink-2); font-size: .9rem; }

/* ---------------------------------------------------------- Dropzone */
.dropzone {
    flex: 1;
    min-height: 60vh;
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 40px 24px;
    border: 1.5px dashed var(--edge-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .2s, background-color .2s, transform .2s var(--ease);
    animation: rise .6s .12s var(--ease) both;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.is-over {
    border-color: var(--amber);
    background: rgba(255, 180, 84, .05);
}
.dropzone.is-over { transform: scale(.995); }
.drop-corner {
    position: absolute; width: 28px; height: 28px; border: 2px solid var(--amber); opacity: .8;
}
.drop-corner-tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.drop-corner-br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }
.drop-icon { width: 56px; height: 56px; color: var(--amber); margin-bottom: 14px; animation: float 4s ease-in-out infinite; }
.drop-title { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 2.3rem); font-weight: 700; }
.drop-hint { margin: 0; color: var(--ink-2); max-width: 44ch; }
.drop-hint .link { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------- Editor / Stage */
.editor { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.filestrip { display: flex; gap: 6px; flex-wrap: wrap; min-height: 34px; }
.filetab {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 0 4px 0 0; min-height: 36px;
    border: 1px solid var(--edge); border-radius: 999px;
    background: rgba(11, 22, 20, .5); color: var(--ink-2);
    font-size: .85rem;
    transition: border-color .15s, color .15s, background-color .15s;
}
.filetab.is-active { border-color: var(--amber); color: var(--ink); background: rgba(255, 180, 84, .1); }
.filetab-select {
    display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
    padding: 4px 6px 4px 12px; border: 0; border-radius: 999px;
    background: transparent; color: inherit; font: inherit; cursor: pointer;
}
.filetab-select:hover { color: var(--ink); }
.filetab .badge { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }
.filetab .badge.warn { color: var(--danger); }
.filetab .remove {
    display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--ink-3); border: 0; background: transparent; cursor: pointer;
}
.filetab .remove:hover { color: var(--danger); background: rgba(255, 107, 107, .12); }
.filetab .remove svg { width: 14px; height: 14px; }

.stage {
    flex: 1;
    display: grid;
    grid-template-columns: var(--ruler) minmax(0, 1fr);
    grid-template-rows: var(--ruler) minmax(0, 1fr);
    min-height: 420px;
    min-width: 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--edge-strong);
    background: rgba(11, 22, 20, .35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
/* Canvas-Bitmaps sind DPR-skaliert. Kein Canvas darf am Layout teilnehmen,
   deshalb liegen alle absolut in Wrappern, sonst weiten sie das Grid in einer Schleife auf. */
.ruler { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #0c1a17; }
.ruler canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.ruler-top { grid-column: 2; grid-row: 1; }
.ruler-left { grid-column: 1; grid-row: 2; }
.ruler-corner { grid-column: 1; grid-row: 1; background: #0c1a17; border-right: 1px solid var(--edge); border-bottom: 1px solid var(--edge); }
.mat {
    grid-column: 2; grid-row: 2; position: relative; min-height: 380px; min-width: 0; overflow: hidden;
    background:
        repeating-conic-gradient(rgba(255, 255, 255, .05) 0% 25%, transparent 0% 50%) 50% / 18px 18px;
}
.mat canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { touch-action: none; cursor: default; }
#overlay.hover-col { cursor: col-resize; }
#overlay.hover-row { cursor: row-resize; }
#overlay.dragging { cursor: grabbing; }
.mat-loading {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    display: inline-flex; gap: 8px; align-items: center;
    padding: 6px 10px; border-radius: 999px; font-size: .8rem;
    background: rgba(11, 22, 20, .85); color: var(--ink-2); border: 1px solid var(--edge);
}
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--edge-strong); border-top-color: var(--amber); animation: spin .8s linear infinite; }

.stagebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; font-size: .8rem; color: var(--ink-2); flex-wrap: wrap; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.sw-line { background: var(--amber); }
.sw-content { background: var(--teal); }
.sw-frame { background: var(--white); height: 0; border-top: 2px dashed var(--white); }
.sw-warn { background: var(--danger); }
.readout { margin: 0; font-size: .78rem; color: var(--ink-3); min-height: 1.2em; }

.lines-editor { border: 1px solid var(--edge); border-radius: var(--radius-s); background: rgba(11, 22, 20, .4); font-size: .85rem; }
.lines-editor summary { padding: 8px 12px; cursor: pointer; color: var(--ink-2); }
.lines-editor summary:hover { color: var(--ink); }
.lines-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 12px 12px; }
.lines-columns h3 { margin: 6px 0; font-size: .8rem; color: var(--ink-3); font-weight: 600; }
.lines-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lines-list li { display: flex; gap: 6px; align-items: center; }
.lines-list input { width: 90px; }
.lines-list .empty { color: var(--ink-3); }

/* ---------------------------------------------------------- Ergebnisse */
.results { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.results-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.results-title { margin: 0; flex: 1; font-size: 1.4rem; font-weight: 700; }
.results-note { margin: 0; color: var(--ink-2); font-size: .9rem; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.icon-card {
    position: relative;
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px; border-radius: var(--radius-s);
    border: 1px solid var(--edge); background: rgba(11, 22, 20, .5);
    animation: pop .4s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 25ms);
}
.icon-card.has-warn { border-color: rgba(255, 107, 107, .5); }
.icon-card .thumb {
    width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px;
    background: repeating-conic-gradient(rgba(255, 255, 255, .08) 0% 25%, transparent 0% 50%) 50% / 14px 14px;
}
.icon-card .meta { display: flex; justify-content: space-between; gap: 6px; font-size: .72rem; color: var(--ink-3); }
.icon-card .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-card .warn-badge {
    position: absolute; top: 6px; right: 6px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 6px; border-radius: 6px; font-size: .7rem; font-weight: 700;
    background: var(--danger); color: #2a0000;
}
.icon-card .warn-badge svg { width: 12px; height: 12px; }
.icon-card .dl { align-self: stretch; }

/* ---------------------------------------------------------- Formulare */
.group { border: 0; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.group legend {
    padding: 0; margin-bottom: 8px;
    font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.field { display: grid; gap: 5px; }
.field label { font-size: .82rem; color: var(--ink-2); display: flex; justify-content: space-between; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { margin: 0; font-size: .8rem; color: var(--ink-3); }
.hint.warn { color: var(--amber-2); }
.hint.bad { color: var(--danger); }

input[type="number"], input[type="text"], input[type="password"], select {
    width: 100%; min-height: 40px; padding: 8px 10px;
    border: 1px solid var(--edge-strong); border-radius: var(--radius-s);
    background: var(--panel-2); color: var(--ink); font: inherit; font-size: .92rem;
    transition: border-color .15s;
}
input[type="number"], .mono-input { font-family: var(--font-mono); }
input:focus, select:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(255, 180, 84, .18); }
input:disabled { opacity: .45; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

input[type="range"] { width: 100%; height: 28px; margin: 0; accent-color: var(--amber); background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--edge-strong); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--amber); border: 2px solid #1a1200; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
input[type="range"]::-moz-range-track { height: 4px; background: var(--edge-strong); border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--amber); border: 2px solid #1a1200; }
input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--edge); }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented span {
    display: flex; align-items: center; justify-content: center; min-height: 36px;
    border-radius: 7px; font-size: .86rem; color: var(--ink-2); transition: background-color .15s, color .15s;
}
.segmented input:checked + span { background: var(--amber); color: #1a1200; font-weight: 700; }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.segmented input:not(:checked) + span:hover { color: var(--ink); background: rgba(178, 222, 205, .08); }

.switch { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: .9rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--edge-strong); transition: background-color .15s; flex: none; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s var(--ease); }
.switch input:checked + .switch-track { background: var(--amber); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #1a1200; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius-s);
    border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .92rem;
    cursor: pointer; text-decoration: none; transition: transform .15s var(--ease), background-color .15s, border-color .15s, opacity .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: #1a1200; }
.btn-primary:not(:disabled):hover { background: var(--amber-2); }
.btn-secondary { background: var(--panel-2); color: var(--ink); border-color: var(--edge-strong); }
.btn-secondary:not(:disabled):hover { border-color: var(--amber); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--edge); }
.btn-ghost:not(:disabled):hover { color: var(--ink); border-color: var(--edge-strong); }
.btn-cut { font-size: 1.05rem; min-height: 52px; font-family: var(--font-display); letter-spacing: .01em; }
.btn-small { min-height: 34px; padding: 0 10px; font-size: .8rem; }
.btn-icon { min-width: 34px; padding: 0; }

/* ---------------------------------------------------------- Feedback */
.progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 40; background: rgba(255, 180, 84, .15); overflow: hidden; }
.progress-fill { position: absolute; inset: 0; width: 40%; background: var(--amber); animation: slide 1.1s var(--ease) infinite; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast {
    padding: 10px 14px; border-radius: var(--radius-s); font-size: .88rem; font-weight: 500;
    background: var(--panel-2); color: var(--ink); border: 1px solid var(--edge-strong);
    border-left: 4px solid var(--teal); box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    animation: pop .3s var(--ease) both;
}
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--amber); }
.toast.success { border-left-color: var(--ok); }

/* ---------------------------------------------------------- Schlichte Seiten (Fehler, Admin) */
.page-plain { display: grid; place-items: center; padding: 24px; }
.plain-card { width: min(460px, 100%); padding: 32px; border-radius: var(--radius); border: 1px solid var(--edge-strong); background: var(--panel); display: grid; gap: 14px; }
.plain-code { margin: 0; font-family: var(--font-mono); color: var(--amber); font-size: .85rem; letter-spacing: .1em; }
.plain-title { margin: 0; font-size: 1.5rem; }
.plain-text { margin: 0; color: var(--ink-2); }
.plain-form { display: grid; gap: 10px; }
.plain-form label { font-size: .85rem; color: var(--ink-2); }
.plain-link { color: var(--amber); }

/* ---------------------------------------------------------- Marke, Footer, Textseiten */
:root { --footer-h: 44px; }
.app { min-height: calc(100vh - var(--topbar-h) - var(--footer-h)); }
.brand { text-decoration: none; color: inherit; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; }
.bs-link { display: inline-flex; align-items: center; margin-left: 6px; border-radius: 50%; }
.bs-link img { width: 32px; height: 32px; border-radius: 50%; display: block; transition: transform .2s var(--ease); }
.bs-link:hover img, .bs-link:focus-visible img { transform: scale(1.08); }
.drop-icon { width: 76px; height: 76px; border-radius: 17px; filter: drop-shadow(0 14px 28px rgba(0, 0, 0, .4)); }
.drop-powered { margin: 26px 0 0; font-size: .8rem; letter-spacing: .04em; color: var(--ink-3); }
.drop-powered a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--edge-strong); padding-bottom: 1px; }
.drop-powered a:hover { color: var(--amber); border-color: var(--amber); }

.footer {
    min-height: var(--footer-h);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 6px 16px; padding: 8px 18px;
    border-top: 1px solid var(--edge); background: var(--bg);
    font-size: .78rem; color: var(--ink-3);
}
.footer p { margin: 0; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover, .footer a:focus-visible { color: var(--ink); }
.footer-copy b { color: var(--amber); font-weight: 700; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.footer-nav > a:not(.kofi) { display: inline-flex; align-items: center; min-height: 28px; padding: 0 3px; }
.kofi {
    display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 11px;
    border-radius: 999px; background: var(--kofi); color: #fff; font-weight: 600;
    transition: background-color .15s, transform .15s var(--ease);
}
.kofi svg { width: 14px; height: 14px; }
.kofi img { width: auto; height: 16px; }
.footer .kofi, .footer .kofi:hover, .footer .kofi:focus-visible,
.doc .kofi, .doc .kofi:hover, .doc .kofi:focus-visible { color: #fff; text-decoration: none; }
.kofi:hover { background: var(--kofi-hover); transform: translateY(-1px); }

.page-doc { min-height: 100vh; display: flex; flex-direction: column; }
.page-doc .topbar { grid-template-columns: auto 1fr auto; }
.doc { flex: 1; width: 100%; max-width: 78ch; margin: 0 auto; padding: 36px 18px 56px; }
.doc-kicker { margin: 0 0 6px; font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.doc h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; line-height: 1.1; }
.doc h2 { margin: 2.2rem 0 .6rem; font-size: 1.2rem; font-weight: 700; }
.doc h3 { margin: 1.4rem 0 .4rem; font-size: 1rem; font-weight: 700; color: var(--ink); }
.doc p, .doc li { color: var(--ink-2); }
.doc p { margin: 0 0 .9rem; }
.doc .lead { font-size: 1.08rem; color: var(--ink); }
.doc a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.doc ul, .doc ol { padding-left: 1.3rem; margin: 0 0 1rem; }
.doc li { margin-bottom: .35rem; }
.doc address { font-style: normal; color: var(--ink); line-height: 1.6; }
.doc table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.2rem; font-size: .9rem; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--edge); vertical-align: top; color: var(--ink-2); }
.doc th { color: var(--ink-3); font-weight: 600; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.doc .steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 10px; }
.doc .steps li { position: relative; padding: 12px 14px 12px 52px; border: 1px solid var(--edge); border-radius: var(--radius-s); background: rgba(11, 22, 20, .5); }
.doc .steps li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: 14px; top: 12px; font-family: var(--font-mono); font-weight: 600; color: var(--amber); }
.doc .callout { padding: 12px 14px; border-left: 3px solid var(--teal); background: rgba(79, 209, 197, .07); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.doc .callout p:last-child { margin: 0; }
.doc .doc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.4rem 0; }
.doc .doc-actions a { text-decoration: none; }
.doc .logo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: .6rem 0 1.2rem; }
.doc .logo-row img { display: block; }
.doc .muted { color: var(--ink-3); font-size: .85rem; }

/* ---------------------------------------------------------- Wortmarke im Text, Sticky-Leisten, Ko-fi */
/* .wordmark = Marke in der Topbar (eigene Größe), .wm = Marke im Fließtext (erbt die Größe). */
.wm, .wordmark { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; color: var(--ink); }
.wm b, .wordmark b { font-weight: 800; color: var(--amber); }
.doc .wm { color: var(--ink); }

.topbar { position: sticky; top: 0; z-index: 30; }
.footer-logo { display: inline-flex; vertical-align: middle; margin-right: 8px; }
.footer-logo img { display: block; border-radius: 50%; }
@media (min-width: 980px) {
    .footer { position: sticky; bottom: 0; z-index: 25; }
    .panel { height: calc(100vh - var(--topbar-h) - var(--footer-h)); }
}

.kofi-fab-wrap { position: fixed; left: 30px; bottom: calc(var(--footer-h) + 100px); z-index: 45; }
.kofi-fab {
    display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px 0 14px;
    border: 0; border-radius: 999px; background: var(--kofi); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer;
    box-shadow: 0 10px 28px rgba(217, 35, 95, .35), 0 2px 6px rgba(0, 0, 0, .3);
    transition: background-color .15s, transform .15s var(--ease);
}
.kofi-fab svg { width: 22px; height: 22px; }
.kofi-fab img { width: auto; height: 24px; display: block; }
.kofi-fab:hover { background: var(--kofi-hover); transform: translateY(-1px); }
.kofi-fab[aria-expanded="true"] { background: var(--kofi-hover); }
.kofi-panel {
    position: absolute; left: 0; bottom: calc(100% + 12px);
    width: min(360px, calc(100vw - 32px));
    background: #fff; color: #1a1a1a; border-radius: 16px; overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    animation: pop .25s var(--ease) both;
}
.kofi-panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; font-weight: 700; font-size: .95rem; }
.kofi-panel-head img { border-radius: 50%; }
.kofi-panel-head span { flex: 1; }
.kofi-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f0f0f0; color: #333; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.kofi-close svg { width: 16px; height: 16px; }
.kofi-close:hover { background: #e2e2e2; }
.kofi-frame { height: min(600px, calc(100vh - 240px)); background: #f9f9f9; }
.kofi-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.kofi-loading { margin: 0; padding: 24px 16px; color: #666; font-size: .9rem; text-align: center; }
.kofi-note { margin: 0; padding: 8px 14px 12px; font-size: .74rem; color: #666; }
.kofi-note a { color: var(--kofi); }
@media (max-width: 979px) {
    .kofi-fab-wrap { left: 16px; bottom: 14px; }
}
@media (max-width: 600px) {
    .kofi-fab { min-height: 44px; width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
    .kofi-fab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .panel-cta { padding-left: 74px; }
}

/* ---------------------------------------------------------- v2.1: Update-Hinweis, Zoom, Werkzeuge */
.update-banner {
    position: fixed; left: 50%; bottom: calc(var(--footer-h) + 14px); transform: translateX(-50%);
    z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 14px; max-width: calc(100vw - 32px);
    border-radius: var(--radius-s); background: var(--panel-2); border: 1px solid var(--amber);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-size: .9rem;
}
@media (max-width: 979px) { .update-banner { bottom: 76px; } }
.segmented-4 { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); }
.stagebar { gap: 8px 12px; }
.stage-tools { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stage-tools .btn { min-height: 32px; min-width: 32px; padding: 0 8px; }
.stage-tools .btn svg { width: 16px; height: 16px; }
.stage-tools .sep { width: 1px; height: 20px; background: var(--edge-strong); margin: 0 4px; }
.zoom-out { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-2); min-width: 4.5ch; text-align: center; }
textarea {
    width: 100%; min-height: 96px; padding: 8px 10px;
    border: 1px solid var(--edge-strong); border-radius: var(--radius-s);
    background: var(--panel-2); color: var(--ink); font: inherit; font-family: var(--font-mono); font-size: .85rem;
    resize: vertical;
}
textarea:focus { border-color: var(--amber); outline: none; box-shadow: 0 0 0 3px rgba(255, 180, 84, .18); }
.tool-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-row .btn { flex: 1 1 auto; min-height: 36px; font-size: .82rem; padding: 0 10px; }
#overlay.can-pan { cursor: grab; }
#overlay.panning { cursor: grabbing; }

/* ---------------------------------------------------------- Animation */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { from { left: -40%; } to { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------- Responsiv */
@media (max-width: 980px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .panel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--edge); }
    .panel-scroll { padding: 14px 16px 8px; overflow: visible; }
    .stage { min-height: 360px; }
    .topbar { grid-template-columns: auto 1fr auto; padding: 0 12px; }
    .topbar-status { display: none; }
}
@media (max-width: 600px) {
    body { font-size: 14px; }
    .workbench { padding: 12px; }
    .panel-cta { background: var(--panel); }
    .topbar-actions .btn { min-height: 38px; padding: 0 10px; font-size: .8rem; white-space: nowrap; }
    .topbar-actions .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .wordmark { font-size: 1.1rem; }
    :root { --ruler: 20px; }
    .stage { min-height: 300px; }
    .mat { min-height: 280px; }
    .row2 { grid-template-columns: 1fr 1fr; }
    .lines-columns { grid-template-columns: 1fr; }
    .icon-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .results-head .btn-primary { flex: 1 1 100%; }
    .topbar-actions .btn { padding: 0 10px; }
}
