@font-face {
  font-family: "Roboto Condensed"; font-weight: 100 900; font-style: normal; font-display: swap;
  src: url("fonts/roboto-condensed-var.woff") format("woff");
}
@font-face {
  font-family: "Bricolage Grotesque"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("fonts/bricolage-grotesque-700.woff") format("woff");
}
@font-face {
  font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("fonts/ibm-plex-mono-400.woff") format("woff");
}
/* Layout: Eingabe + Gestaltung links, fixierte Vorschau mit Export rechts; auf dem Handy Eingabe → Vorschau → Gestaltung. */
:root {
  --bg: #eef0f5;
  --surface: #ffffff;
  --ink: #141722;
  --muted: #5a6072;
  --line: #d6dae5;
  --accent: #2946d6;
  --accent-ink: #ffffff;
  --accent-soft: #e3e8fd;
  --warn: #9a4a00;
  --warn-soft: #fff1e0;
  --check-a: #e6e9f0;
  --check-b: #f6f7fa;
  --m-phrase: #ffe7a8; --m-phrase-line: #b07800;
  --m-buzz: #ffd6e3; --m-buzz-line: #b0285a;
  --m-struct: #d7e3ff; --m-struct-line: #2946d6;
  --m-format: #e4e6ec; --m-format-line: #5a6072;
  --font-display: "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Roboto Condensed", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1016; --surface: #171a23; --ink: #e9ebf3; --muted: #9ba1b5; --line: #2a2f3e;
    --accent: #8197ff; --accent-ink: #0e1016; --accent-soft: #232a4a;
    --warn: #ffb766; --warn-soft: #34261a; --check-a: #20242f; --check-b: #191c25;
    --m-phrase: #4a3a12; --m-phrase-line: #ffc94a; --m-buzz: #4a1d2e; --m-buzz-line: #ff8fb5;
    --m-struct: #1f2a55; --m-struct-line: #8fa5ff; --m-format: #2b2f3c; --m-format-line: #b3b9cc;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1016; --surface: #171a23; --ink: #e9ebf3; --muted: #9ba1b5; --line: #2a2f3e;
  --accent: #8197ff; --accent-ink: #0e1016; --accent-soft: #232a4a;
  --warn: #ffb766; --warn-soft: #34261a; --check-a: #20242f; --check-b: #191c25;
  --m-phrase: #4a3a12; --m-phrase-line: #ffc94a; --m-buzz: #4a1d2e; --m-buzz-line: #ff8fb5;
  --m-struct: #1f2a55; --m-struct-line: #8fa5ff; --m-format: #2b2f3c; --m-format-line: #b3b9cc;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 110px; } /* Platz für den Ko-fi-Button unten links */
header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 22px; }
h1 {
  font: 700 clamp(26px, 4vw, 34px)/1.1 var(--font-display);
  letter-spacing: -0.01em; margin: 0; text-wrap: balance;
}
header p { margin: 0; color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  grid-template-areas: "input preview" "style preview";
  gap: 18px 24px;
  align-items: start;
}
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
#inputCard { grid-area: input; }
#styleCard { grid-area: style; }
#previewCard { grid-area: preview; position: sticky; top: 16px; display: grid; gap: 14px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "input" "preview" "style"; }
  #previewCard { position: static; }
}

h2 {
  font: 600 13px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 0 0 12px;
}
.section + .section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Segmentierte Auswahl */
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.seg legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; font-weight: 500; font-size: 14px; background: var(--surface);
  transition: background .12s, border-color .12s, color .12s;
}
.seg label small { font: 400 12px var(--font-mono); color: var(--muted); }
.seg label:hover { border-color: var(--accent); }
.seg input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg input:checked + label small { color: inherit; opacity: .8; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.fields { display: grid; gap: 12px; margin-top: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
input[type="text"], input[type="url"], input[type="email"], input[type="tel"], input[type="password"], textarea, select {
  width: 100%; font: 15px/1.4 var(--font-body); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
}
textarea { resize: vertical; min-height: 92px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.swatch {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--bg);
}
.swatch input[type="color"] {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0;
  background: none; cursor: pointer; flex: none;
}
.swatch input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.swatch span { display: grid; line-height: 1.25; font-size: 13px; color: var(--muted); }
.swatch b { font: 400 13px var(--font-mono); color: var(--ink); text-transform: uppercase; }

.range { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.range > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.range output { font: 400 13px var(--font-mono); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); margin: 0; }

.logo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.logo-thumb {
  width: 44px; height: 44px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg) center / contain no-repeat; flex: none;
}

button, .btn {
  font: 600 14px/1 var(--font-body); border-radius: 10px; padding: 11px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Vorschau */
.stage {
  border-radius: 12px; border: 1px solid var(--line); padding: 22px;
  background-color: var(--check-b);
  background-image: conic-gradient(var(--check-a) 25%, transparent 0 50%, var(--check-a) 0 75%, transparent 0);
  background-size: 18px 18px;
  display: grid; place-items: center; aspect-ratio: 1 / 1;
}
.stage svg { width: 100%; height: 100%; display: block; }
.stage .empty { color: var(--muted); text-align: center; max-width: 24ch; font-size: 14px; }
.meta { font: 400 12.5px/1.5 var(--font-mono); color: var(--muted); display: grid; gap: 6px; }
.meta .line { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.meta b { color: var(--ink); font-weight: 400; }
.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s; }
.bar.full i { background: var(--warn); }

.notes { display: grid; gap: 8px; }
.note {
  font-size: 13.5px; line-height: 1.4; padding: 9px 11px; border-radius: 9px;
  background: var(--warn-soft); color: var(--warn); border-left: 3px solid var(--warn);
}
.note.info { background: var(--accent-soft); color: var(--ink); border-left-color: var(--accent); }

.export { display: grid; gap: 10px; }
.export .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.export .sizes { display: flex; align-items: center; gap: 10px; }
.export .sizes label { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.export .sizes select { flex: 1; min-width: 0; }
#status { min-height: 1.4em; font-size: 13px; color: var(--muted); margin: 0; }

[hidden], .notes:empty { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

footer { margin-top: 28px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: inherit; }



/* ---------- Gemeinsame Bausteine der Rechner-Tools ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --ok: #1f7a4d; --ok-soft: #e2f4ea; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #2f9e2f; --ok: #6fd6a0; --ok-soft: #173326; } }
:root[data-theme="dark"] { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #2f9e2f; --ok: #6fd6a0; --ok-soft: #173326; }
input[type="number"] { width: 100%; font: 15px/1.4 var(--font-body); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-variant-numeric: tabular-nums; }
.unit { position: relative; }
.unit input { padding-right: 52px; }
.unit::after { content: attr(data-unit); position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font: 400 13px var(--font-mono); color: var(--muted); pointer-events: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: -2px 0 0; line-height: 1.4; }
.big { font: 700 clamp(44px, 7vw, 64px)/1 var(--font-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.big small { font-size: 0.45em; font-weight: 700; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-mono); font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kv .strong { font-weight: 600; color: var(--ink); }
.stack { display: flex; height: 18px; border-radius: 6px; overflow: hidden; gap: 2px; background: var(--surface); }
.stack i { display: block; height: 100%; min-width: 2px; }
.stack i:first-child { border-radius: 6px 0 0 6px; }
.stack i:last-child { border-radius: 0 6px 6px 0; }
.legend2 { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.legend2 li { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; }
.legend2 .dot { width: 12px; height: 12px; border-radius: 3px; }
.legend2 .v { font: 400 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.legend2 .p { font: 400 12px var(--font-mono); color: var(--muted); min-width: 3.5em; text-align: right; }
.pill { display: inline-block; font: 600 11.5px/1 var(--font-body); padding: 4px 8px; border-radius: 99px; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--ink); }
.subgrid { display: grid; gap: 14px; }

@media (min-width: 821px) { .layout { grid-template-rows: auto 1fr; } }

/* ---------- Textputzer ---------- */
#textIn { min-height: 320px; font-size: 15px; line-height: 1.55; font-family: var(--font-body); }
.actions { display: grid; gap: 14px; }
.actions h3 { font: 600 12px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 6px; }
.btns2 { display: flex; flex-wrap: wrap; gap: 6px; }
.btns2 button { padding: 8px 11px; font-size: 13px; font-weight: 500; }
.btns2 button.hero { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar button { padding: 8px 11px; font-size: 13px; }
.toolbar .grow { flex: 1; }
.counter { font: 400 12.5px var(--font-mono); color: var(--muted); }
.diff { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; margin: 0; max-height: 420px; overflow: auto; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.diff del { background: #ffd9d9; color: #8a1c1c; text-decoration: line-through; border-radius: 3px; }
.diff ins { background: #d6f5e0; color: #145c33; text-decoration: none; border-radius: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diff del { background: #4a1f22; color: #ffb3b3; } :root:not([data-theme="light"]) .diff ins { background: #173a26; color: #9ff0bf; } }
:root[data-theme="dark"] .diff del { background: #4a1f22; color: #ffb3b3; }
:root[data-theme="dark"] .diff ins { background: #173a26; color: #9ff0bf; }
.replace { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 480px) { .replace { grid-template-columns: 1fr; } }
.sumline { font-size: 13.5px; color: var(--ink); margin: 0; }

/* Aufgeräumte Aktionen: ein Hauptknopf, Reiter, Liste mit Erklärung */
.heroop { display: grid; gap: 3px; justify-items: start; text-align: left; width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.heroop b { font: 700 17px/1.2 var(--font-display); }
.heroop span { font-size: 13px; font-weight: 400; opacity: .85; line-height: 1.35; }
.heroop:hover:not(:disabled) { filter: brightness(1.08); }
.tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs label { padding: 6px 11px; font-size: 13px; white-space: nowrap; }
.oplist { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.oplist button { display: grid; gap: 2px; justify-items: start; text-align: left; width: 100%; border: 0; border-radius: 0; padding: 11px 14px; background: var(--surface); }
.oplist button + button { border-top: 1px solid var(--line); }
.oplist button:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--line); }
.oplist button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.oplist b { font-weight: 600; font-size: 14px; }
.oplist span { font-weight: 400; font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.next { font-size: 13px; color: var(--muted); margin: 0; }
.linkbtn { display: inline; padding: 0; border: 0; background: none; color: var(--accent); font: 500 13px var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover:not(:disabled) { border: 0; }
fieldset.tabs { min-width: 0; max-width: 100%; }
#previewCard { min-width: 0; }
.heroop, .oplist button { justify-content: start; align-content: start; }
.tabs { flex-wrap: wrap; overflow: visible; }
.tabs label { padding: 6px 10px; }
.tabs { gap: 4px; }
.tabs label { padding: 6px 8px; font-size: 12.5px; }

/* Funktionsliste: alle Funktionen sichtbar, jede mit Vorher-nachher-Beispiel */
#previewCard { align-content: start; }
@media (min-width: 821px) { #previewCard { max-height: calc(100vh - 32px); overflow: auto; } }
.oplist2 { display: grid; gap: 6px; }
.oplist2 h3 { font: 600 12px/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 10px 0 2px; }
.oplist2 h3:first-child { margin-top: 0; }
.opgroup { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.opgroup button { display: grid; gap: 3px; justify-items: start; justify-content: stretch; align-content: start; text-align: left; width: 100%;
  border: 0; border-radius: 0; padding: 9px 12px; background: var(--surface); font-weight: 400; }
.opgroup button + button { border-top: 1px solid var(--line); }
.opgroup button:hover:not(:disabled) { background: var(--accent-soft); }
.opgroup button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.opgroup b { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.opgroup .tag { font: 600 10.5px/1 var(--font-body); font-style: normal; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); background: var(--accent-soft); padding: 3px 6px; border-radius: 99px; }
.opgroup .ex { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: 12px; color: var(--muted); }
.opgroup .ex code { font: 400 12px/1.4 var(--font-mono); background: var(--bg); border-radius: 4px; padding: 1px 5px; color: var(--ink); white-space: pre-wrap; }
.opgroup .ex i { font-style: normal; color: var(--muted); }

/* Gruppen als aufklappbare Bereiche, kräftigere Einträge */
.oplist2 { gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.acc[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 1px 0 var(--line); }
.acc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .15s; flex: none; }
.acc[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.acc summary:hover { background: var(--accent-soft); }
.acc summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc .st { display: grid; gap: 2px; flex: 1; min-width: 0; }
.acc .st b { font: 700 17px/1.2 var(--font-display); }
.acc .st small { font-size: 13px; color: var(--muted); line-height: 1.3; }
.acc .cnt { font: 600 12px/1 var(--font-body); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 4px 9px; }
.acc .opgroup { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.acc .opgroup button { padding: 13px 16px; gap: 5px; }
.acc .opgroup b { font-size: 15.5px; }
.acc .opgroup .ex, .acc .opgroup .ex code { font-size: 12.5px; }

/* ---------- Ko-fi als einfacher Link (lädt nichts von Ko-fi, bis jemand klickt) ---------- */
.kofi { position: fixed; left: 16px; bottom: 16px; z-index: 50; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 15px 10px; border-radius: 99px; background: #fff; color: #323842; text-decoration: none;
  font: 600 14px/1 var(--font-body); box-shadow: 0 4px 16px rgba(10, 16, 40, .18); transition: transform .15s ease; }
.kofi:hover { transform: translateY(-2px); }
.kofi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media print { .kofi { display: none; } }
footer .legal { display: flex; gap: 14px; }
footer { padding-bottom: 56px; }
