/* cartridge Konsole · Module statt Kassetten (Logo und neue Gestaltung folgen)
   Tasten wie an der Konsole: einstecken, ▶ läuft, ⏏ rausziehen, tauschen, wegwerfen.
   Magenta heißt nur zweierlei: Wortmarke/Streifen und „läuft“. Schriften liegen hier (CSP), siehe FONTS.md. */

@font-face { font-family: "Saira Semi Condensed"; font-weight: 500; font-display: swap; src: url("/ui/saira-semi-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Saira Semi Condensed"; font-weight: 600; font-display: swap; src: url("/ui/saira-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 300 900; font-display: swap; src: url("/ui/figtree.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/ui/jetbrains-mono-500.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* Gehäuse einer Leerkassette: kühles Hellgrau, weiße Flächen */
  --ground: #f3f4f7;
  --surface: #ffffff;
  --recess: #e8eaf0;
  --shelf: #e4e7ed;
  --line: #d8dce4;
  --key-edge: #c5cad5;
  --key-lip: #a9afbe;
  /* Tinte aus der Extrusion der Wortmarke */
  --ink: #0a1020;
  --ink-2: #4b5366;
  --ink-3: #5f6679;
  --magenta: #fb02fe;
  --live-ink: #a000a6;
  --violet: #9d38ea;
  --blue: #3f6fd6;
  --blue-tint: #e7edfb;
  --select: #cfdaf6;
  --ok: #17693a;
  --warn: #8a5300;
  --warn-tint: #fdf1d8;
  --warn-edge: #e4b25c;
  --bad: #b42318;
  --bad-tint: #fdecea;

  --label: "Saira Semi Condensed", "Arial Narrow", sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(16px, 5vw, 80px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --stripe: linear-gradient(to bottom,
    var(--magenta) 0 38%, transparent 38% 47%,
    var(--violet) 47% 60%, transparent 60% 69%,
    var(--blue) 69% 100%);
  --key-shadow: 0 3px 0 var(--key-lip), 0 6px 10px -6px rgb(10 16 32 / .35);
  --key-shadow-down: 0 1px 0 var(--key-lip), 0 2px 3px -2px rgb(10 16 32 / .3);
  /* eingerastete Taste: blaue Kante + dunkle Extrusion wie in der Wortmarke */
  --key-latched: 0 0 0 2px var(--blue), -3px 3px 0 2px var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--key-lip) var(--ground); caret-color: var(--blue); }
body {
  margin: 0; min-height: 100vh;
  background: var(--ground); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--label); font-weight: 600; letter-spacing: .005em; line-height: 1.15; text-wrap: balance; }
::selection { background: var(--select); color: var(--ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--key-lip); border-radius: 8px; border: 3px solid var(--ground); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: var(--blue); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 3px; }
code { font: 500 .88em/1.4 var(--mono); }
code.wrap { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--gutter), 1200px); margin-inline: auto; }
.ico { width: 1em; height: 1em; flex: none; fill: currentColor; }

.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.ok { color: var(--ok); font-weight: 600; }
.bad, .error { color: var(--bad); }
.warn { color: var(--warn); font-weight: 600; }
.hint { color: var(--ink-2); font-size: .9rem; }
.status { min-height: 1.4em; color: var(--bad); }
.status:empty { min-height: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Tasten ---------- */
button, .button {
  --face: var(--surface);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 42px; padding: 0 16px;
  font: 600 1rem/1.1 var(--label); letter-spacing: .02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  background: var(--face);
  border: 1px solid var(--key-edge); border-radius: 8px;
  box-shadow: var(--key-shadow);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .1s var(--ease-out), box-shadow .1s var(--ease-out), background-color .15s, border-color .15s;
}
button:hover:not(:disabled), .button:hover { --face: #fafbfd; border-color: var(--key-lip); }
button:active:not(:disabled), .button:active { transform: translateY(2px); box-shadow: var(--key-shadow-down); }
button:focus-visible, .button:focus-visible { outline-offset: 5px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
button[aria-expanded="true"], button.is-latched { transform: translateY(2px); box-shadow: var(--key-latched); }
button[aria-expanded="true"]:focus-visible { outline-offset: 8px; }
.primary, button.primary { --face: var(--ink); color: var(--surface); border-color: var(--ink); box-shadow: 0 3px 0 #000, 0 6px 10px -6px rgb(10 16 32 / .5); }
.primary:hover:not(:disabled), button.primary:hover:not(:disabled) { --face: #1b2438; border-color: var(--ink); }
.primary .i-insert { color: var(--magenta); }
.big { min-height: 52px; padding: 0 22px; font-size: 1.12rem; }
button.danger, .button.danger { --face: var(--bad); color: #fff; border-color: var(--bad); box-shadow: 0 3px 0 #7a150d, 0 6px 10px -6px rgb(10 16 32 / .45); }
button.danger:hover:not(:disabled) { --face: #9a1e14; border-color: #9a1e14; }
button.link, .button.link {
  --face: transparent; min-height: 0; padding: 2px 0; border: 0; box-shadow: none; border-radius: 2px;
  font-family: var(--body); font-weight: 500; font-size: inherit; line-height: 1.4; letter-spacing: 0; color: var(--ink);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; white-space: normal;
}
button.link:hover:not(:disabled), .button.link:hover { text-decoration-color: var(--blue); }
button.link:active:not(:disabled) { transform: none; box-shadow: none; }
button.link.danger { --face: transparent; color: var(--bad); }
button.small, .button.small { min-height: 34px; padding: 0 12px; font-size: .9rem; border-radius: 6px; box-shadow: 0 2px 0 var(--key-lip), 0 4px 8px -6px rgb(10 16 32 / .35); }
button.link.small { min-height: 0; padding: 2px 0; font-size: .9rem; box-shadow: none; border-radius: 2px; justify-self: start; }
button.chip { min-height: 30px; padding: 0 10px; margin: 2px 4px 2px 0; font-size: .9rem; border-radius: 999px; box-shadow: 0 2px 0 var(--key-lip); }
button .ico, .button .ico { width: 12px; height: 12px; }

input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--key-edge); border-radius: 8px;
  padding: 9px 12px; min-height: 42px;
  box-shadow: inset 0 2px 3px -2px rgb(10 16 32 / .18);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
input[type="radio"] { min-height: 0; width: 18px; height: 18px; margin: 0; padding: 0; box-shadow: none; accent-color: var(--ink); }
input[type="radio"]:focus { outline-offset: 3px; border-radius: 50%; }
textarea.paste { width: 100%; min-height: 200px; font: 500 13px/1.45 var(--mono); }

/* ---------- Kopfzeile ---------- */
.bar { background: var(--surface); }
.bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; min-height: 68px; padding-block: 10px; }
/* Placeholder until the cartridge logo exists: the name as text */
.brand { display: block; border-radius: 4px; font: 600 1.7rem/1 var(--label); letter-spacing: .01em; color: var(--ink); text-decoration: none; }
.bar nav { display: flex; align-items: center; gap: 4px; }
.bar nav a {
  padding: 6px 12px; border-radius: 6px;
  font: 600 1rem/1.2 var(--label); letter-spacing: .02em; color: var(--ink-2); text-decoration: none;
}
.bar nav a:hover, .bar nav a[aria-current="page"] { color: var(--ink); background: var(--ground); }
.who { display: flex; align-items: center; gap: 16px; margin-left: auto; font-size: .95rem; color: var(--ink-2); }
.stripe-line {
  height: 13px;
  background: linear-gradient(to bottom,
    var(--magenta) 0 4px, transparent 4px 6px,
    var(--violet) 6px 8px, transparent 8px 10px,
    var(--blue) 10px 13px);
}
.page { padding-block: 40px 96px; display: grid; gap: 28px; align-content: start; }

/* ---------- Flächen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(20px, 3vw, 28px); display: grid; gap: 14px; align-content: start; }
.card h1 { font-size: clamp(1.7rem, 1.3rem + 1vw, 2.1rem); }
.card h2 { font-size: 1.4rem; }
.card > button, .card > .button, .card > .row { justify-self: start; }
.card.center > button, .card.center > .button, .card.center > .row { justify-self: center; }
.card.center { width: min(100%, 500px); margin: clamp(8px, 6vh, 56px) auto 0; justify-items: center; text-align: center; }
.card.center > .row { justify-content: center; }
.list { list-style: none; padding: 0; display: grid; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.made { display: grid; gap: 8px; padding: 14px; background: var(--blue-tint); border-radius: 10px; }
.list li > .made { flex-basis: 100%; }
.card > h3 { font-size: 1.05rem; margin-top: 6px; }
.code { font: 600 1.4rem var(--mono); text-align: center; letter-spacing: .1em; width: 15ch; max-width: 100%; text-transform: uppercase; }
.code-show { font: 600 2rem var(--mono); letter-spacing: .15em; }

/* Etikett eines Moduls */
.label {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: .2em .7em .28em;
  font: 600 1.15rem/1.2 var(--label); letter-spacing: .01em; color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--key-edge), var(--key-edge)) no-repeat .7em calc(100% - .32em) / calc(100% - 1.4em) 1px, var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
}
.state { display: inline-flex; align-items: center; gap: .4em; font: 600 1rem/1 var(--label); letter-spacing: .03em; color: var(--live-ink); }
.state .ico { width: 12px; height: 12px; color: var(--magenta); }
.state.paused, .state.paused .ico { color: var(--ink-2); }

/* ---------- Startseite (Konsole ohne Sitzung) ---------- */
.top { display: flex; align-items: center; justify-content: flex-end; min-height: 76px; }
.stage { position: relative; margin-top: clamp(4px, 2vh, 24px); }
.stage::before { content: ""; position: absolute; inset-inline: 0; top: 40%; height: 30%; background: var(--stripe); }
.mark {
  position: relative; display: inline-block; margin-left: -.12em; padding: 0 .12em .04em;
  font: 600 clamp(3.4rem, 1.6rem + 8vw, 8.5rem)/1 var(--label); letter-spacing: -.01em; color: var(--ink);
  background: var(--ground);
}
.hero { padding-bottom: clamp(80px, 10vw, 140px); }
.hero-copy { margin-top: clamp(20px, 4vh, 40px); }
.hook {
  display: flex; align-items: flex-start; gap: .38em;
  font-size: clamp(2rem, 1.1rem + 2.5vw, 3.05rem); line-height: 1.06; letter-spacing: -.005em;
}
.insert-key {
  display: inline-grid; place-items: center; flex: none;
  width: .92em; height: .92em; margin-top: .06em;
  background: var(--surface); border: 1px solid var(--key-edge); border-radius: .17em;
  transform: translateY(2px); box-shadow: var(--key-latched);
  animation: key-press .22s .45s var(--ease-out) both;
}
.insert-key .ico { width: .44em; height: .44em; color: var(--magenta); animation: key-blink 1.4s .5s both; }
@keyframes key-press { from { transform: none; box-shadow: var(--key-shadow); } }
@keyframes key-blink {
  0%, 19% { color: var(--ink); }
  20%, 42% { color: var(--magenta); }
  43%, 63% { color: var(--ink); }
  64%, 100% { color: var(--magenta); }
}
.offer { max-width: 58ch; margin-top: 18px; font-size: clamp(1.06rem, .98rem + .35vw, 1.25rem); color: var(--ink-2); text-wrap: pretty; }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 1060px; margin-top: 40px; }
.way {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 4px;
  grid-template-rows: auto auto 1fr; align-items: start; justify-content: stretch; justify-items: start;
  min-height: 0; padding: 20px 22px 20px 20px; border-radius: 12px; white-space: normal; text-align: left;
  box-shadow: 0 4px 0 var(--key-lip), 0 10px 18px -12px rgb(10 16 32 / .45);
}
.way:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--key-lip), 0 2px 4px -3px rgb(10 16 32 / .35); }
.way > .ico { grid-row: 1 / span 3; width: 20px; height: 20px; margin-top: 3px; color: var(--ink); transition: color .15s; }
.way:hover > .ico, .way:active > .ico { color: var(--magenta); }
.way-title { font: 600 1.4rem/1.15 var(--label); letter-spacing: .01em; }
.way-detail { font: 400 .98rem/1.45 var(--body); color: var(--ink-2); letter-spacing: 0; }
code.way-detail { font: 500 .92rem/1.45 var(--mono); color: var(--ink); }
.way-act { align-self: end; margin-top: 12px; font: 600 .95rem/1.1 var(--label); letter-spacing: .04em; color: var(--ink-2); }
.way:hover .way-act { color: var(--ink); }
.sign-status { margin-top: 14px; }
.sec { padding-bottom: clamp(80px, 10vw, 140px); }
.sec h2 { font-size: clamp(1.5rem, 1.15rem + 1vw, 2rem); line-height: 1.1; }
.lead { margin-top: 12px; max-width: 60ch; color: var(--ink-2); font-size: 1.125rem; }
.legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 36px; margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.legend dt { display: flex; align-items: center; gap: .5em; font: 600 1.3rem/1.2 var(--label); letter-spacing: .01em; }
.legend dt .ico { width: 16px; height: 16px; }
.legend dd { margin-top: 8px; max-width: 30ch; color: var(--ink-2); }
.note { margin-top: 36px; max-width: 62ch; color: var(--ink-2); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 64px; align-items: start; }
.split p { max-width: 56ch; font-size: 1.15rem; color: var(--ink-2); padding-top: .35em; }
.invite-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; padding-top: 36px; border-top: 1px solid var(--line); }
.invite-strip p { font: 600 clamp(1.3rem, 1.1rem + .6vw, 1.6rem)/1.25 var(--label); max-width: 34ch; text-wrap: balance; }
.invite-strip .small { font: 400 .95rem/1.5 var(--body); color: var(--ink-2); margin-top: 6px; }
.foot { padding: 0 0 40px; font-size: .875rem; color: var(--ink-3); }

/* ---------- Deine Apps: das Regal ---------- */
.rack-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 28px; }
.rack-head h1 { font-size: 2.1rem; line-height: 1.1; }
.rack {
  --gap: 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--gap);
}

/* Leeres Modul-Fach „Neues Modul“. Beim Darüberziehen: gedrückte Einstecken-Taste. */
.slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 260px; padding: 24px 18px; text-align: center; cursor: pointer;
  background: var(--recess); border: 1.5px dashed var(--key-lip); border-radius: 12px;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), background-color .12s;
}
.slot > .ico { width: 28px; height: 28px; margin-bottom: 10px; color: var(--ink); transition: color .12s; }
.slot-title { font-size: 1.35rem; }
.slot-sub { max-width: 26ch; color: var(--ink-2); font-size: .95rem; }
.slot-keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.slot:hover > .ico { color: var(--magenta); }
.slot.over, .slot.busy {
  background: var(--surface); border-style: solid; border-color: var(--key-edge);
  transform: translateY(2px); box-shadow: var(--key-latched);
}
.slot.over > .ico, .slot.busy > .ico { color: var(--magenta); }
.slot.over .slot-keys { visibility: hidden; }

/* Modul (Klasse .tape aus der Kassetten-Zeit) */
.tape {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  padding: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 0 var(--line), 0 10px 20px -16px rgb(10 16 32 / .45);
  transition: border-color .15s;
}
.tape.open { border-color: var(--key-lip); }
.cover {
  --face: var(--recess);
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; width: 100%; min-height: 0;
  padding: 0; border: 0; border-radius: 7px; box-shadow: inset 0 0 0 1px rgb(10 16 32 / .1);
  white-space: normal;
}
/* Cover tones: a tape-label band per app, from the name. Blue and violet only; magenta means "läuft". */
.cover {
  --band-y: 70%; --band-1: var(--blue); --band-2: var(--violet); --cover: var(--recess);
  background:
    linear-gradient(to bottom,
      transparent 0 var(--band-y),
      var(--band-1) var(--band-y) calc(var(--band-y) + 6%),
      transparent calc(var(--band-y) + 6%) calc(var(--band-y) + 9%),
      var(--band-2) calc(var(--band-y) + 9%) calc(var(--band-y) + 12%),
      transparent calc(var(--band-y) + 12%)),
    var(--cover);
}
.cover[data-tone="1"] { --band-y: 74%; --band-1: var(--violet); --band-2: transparent; --cover: #ebe8f2; }
.cover[data-tone="2"] { --band-y: 66%; --band-1: var(--blue); --band-2: var(--blue); --cover: #e6eaf3; }
.cover[data-tone="3"] { --band-y: 72%; --band-1: var(--ink-3); --band-2: var(--blue); }
.cover[data-tone="4"] { --band-y: 68%; --band-1: var(--violet); --band-2: var(--blue); --cover: #e6eaf3; }
.cover[data-tone="5"] { --band-y: 76%; --band-1: var(--blue); --band-2: transparent; --cover: #ebe8f2; }
.tape.paused .cover { --band-1: var(--key-edge); --band-2: var(--key-edge); --cover: var(--recess); }
.cover:hover:not(:disabled) { --face: var(--recess); box-shadow: inset 0 0 0 2px var(--key-lip); border-color: transparent; }
.cover:active:not(:disabled) { transform: none; box-shadow: inset 0 0 0 2px var(--key-lip); }
.cover[aria-expanded="true"] { transform: none; box-shadow: inset 0 0 0 2px var(--key-lip); }
.cover-strip {
  padding: .16em .9em .24em;
  font: 600 2.6rem/1 var(--label); letter-spacing: .02em; color: var(--ink);
  background: linear-gradient(var(--key-edge), var(--key-edge)) no-repeat .5em calc(100% - .2em) / calc(100% - 1em) 1px, var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
}
.pause-badge {
  position: absolute; bottom: 10px; display: inline-flex; align-items: center; gap: .45em; padding: 6px 12px;
  font: 600 .95rem/1 var(--label); letter-spacing: .03em; color: var(--ink);
  background: var(--surface); border-radius: 999px; box-shadow: 0 6px 14px -8px rgb(10 16 32 / .5);
}
.pause-badge .ico { width: 11px; height: 11px; }
.tape.paused .cover-strip { opacity: .35; }
/* the app's own icon, with the corners of a home screen */
.cover-icon {
  width: 36%; height: auto; aspect-ratio: 1; object-fit: cover; /* 58 % of the 16:10 cover's height */
  border-radius: 22%; box-shadow: 0 0 0 1px rgb(10 16 32 / .1), 0 8px 16px -10px rgb(10 16 32 / .5);
}
.tape.paused .cover-icon { opacity: .35; filter: grayscale(1); }
.tape-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 8px 12px; padding: 14px 4px 4px; }
.tape-body .label { grid-column: 1 / -1; justify-self: start; }
.tape-body .state { grid-column: 1; }
.tape-body .meta { grid-column: 1; align-self: end; font-size: .92rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.key-drawer { grid-column: 2; grid-row: 2 / span 2; align-self: end; width: 38px; padding: 0; }
.key-drawer .ico { width: 13px; height: 13px; transition: transform .2s var(--ease-out); }
.key-drawer[aria-expanded="true"] .ico { transform: rotate(180deg); }

/* Schublade: vertieftes Fach unter der Reihe, Kerbe zeigt auf das offene Modul */
.drawer {
  position: relative; grid-column: 1 / -1; display: grid; grid-template-rows: 0fr;
  margin-top: -8px; background: var(--shelf); border-radius: 14px;
  box-shadow: inset 0 2px 5px -2px rgb(10 16 32 / .14);
  transition: grid-template-rows .38s var(--ease-out);
}
.drawer.open { grid-template-rows: 1fr; }
.drawer::before {
  content: ""; position: absolute; top: -13px; width: 28px; height: 14px;
  left: calc(var(--col, 0) * (100% + var(--gap)) / var(--cols, 1) + (100% - (var(--cols, 1) - 1) * var(--gap)) / var(--cols, 1) / 2 - 14px);
  background: var(--shelf); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.drawer-clip { min-height: 0; overflow: hidden; }
.drawer-in { padding: 22px 28px 26px; opacity: 0; transform: translateY(-6px); transition: opacity .28s .06s var(--ease-out), transform .38s var(--ease-out); }
.drawer.open .drawer-in { opacity: 1; transform: none; }
.drawer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.drawer-title { font-size: 1.4rem; width: fit-content; }
.drawer-title:focus-visible { outline-offset: 4px; }
.drawer-head .row { margin-left: auto; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .85fr); margin-top: 18px; }
.cols > * { min-width: 0; padding-inline: 28px; }
.cols > :first-child { padding-left: 0; }
.cols > :last-child { padding-right: 0; }
.cols > * + * { border-left: 1px solid var(--line); }
.cols h3 { margin-bottom: 12px; font-size: 1.05rem; letter-spacing: .02em; }
.col { display: grid; gap: 12px; align-content: start; }
.col > h3 { margin-bottom: 0; }

.share { display: flex; align-items: flex-start; gap: 16px; }
.qr-btn { --face: #fff; flex: none; width: 92px; min-height: 0; padding: 4px; border-radius: 6px; cursor: zoom-in; box-shadow: none; border: 1px solid var(--line); }
.qr-btn[aria-pressed="true"] { width: 184px; cursor: zoom-out; }
.qr-btn:active:not(:disabled) { transform: none; box-shadow: none; }
.qr-btn img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.share-text { display: grid; justify-items: start; gap: 10px; min-width: 0; }
.url { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; color: var(--ink-3); }
.invite-code { font: 600 1.5rem/1 var(--mono); letter-spacing: .12em; }

.versions { list-style: none; padding: 0; }
.versions li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.versions li:first-child { padding-top: 0; }
.v-no { display: block; font: 600 1rem/1.35 var(--label); letter-spacing: .02em; }
.counter { display: inline-block; min-width: 2.2em; margin-left: .15em; padding: 0 .3em; text-align: center; font-variant-numeric: tabular-nums; background: var(--surface); border: 1px solid var(--key-edge); border-radius: 3px; }
.v-meta { display: block; font-size: .86rem; color: var(--ink-2); overflow-wrap: anywhere; }
.more-keys { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.more-box { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.more-box.danger { border-color: var(--ink); }
.more-box input { width: 100%; }
.more-box.domain .row input { flex: 1; width: auto; min-width: 0; }
table.dns { border-collapse: collapse; font-size: .92rem; width: 100%; }
table.dns th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 0 10px 4px 0; }
table.dns td { padding: 6px 10px 6px 0; border-top: 1px solid var(--line); vertical-align: baseline; overflow-wrap: anywhere; }
.dns-problems { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; }
.copy-link { font: 500 .8rem/1.4 var(--mono); word-break: break-all; background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }

/* Einstecken (Veröffentlichen) in der Schublade */
.step, .done { display: grid; gap: 14px; justify-items: start; }
.address { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 1.15rem; }
.address input.name { font: 600 1.15rem var(--mono); min-width: 8ch; max-width: 100%; }
.name-status { min-height: 1.5em; }
.problems { display: grid; gap: 8px; width: 100%; }
.problems:empty { display: none; }
.problem { display: grid; gap: 2px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }
.problem.error { border-color: var(--bad); background: var(--bad-tint); }
.problem.warning { border-color: var(--warn-edge); background: var(--warn-tint); }
.problem .hint { font-size: .88rem; }
.done-title { display: flex; align-items: center; gap: .45em; font-size: 1.5rem; }
.done-title .ico { width: 14px; height: 14px; color: var(--magenta); }
.big-link { font: 600 1.2rem/1.3 var(--label); letter-spacing: .01em; word-break: break-all; }
.qr-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.qr { width: 150px; height: 150px; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 6px; image-rendering: pixelated; }

/* Wege zum Bauen */
.ways-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.ways-box > summary { padding: 16px 22px; font: 600 1.1rem/1.2 var(--label); letter-spacing: .02em; cursor: pointer; list-style: none; }
.ways-box > summary::-webkit-details-marker { display: none; }
.ways-box > summary::after {
  content: ""; display: inline-block; width: .42em; height: .42em; margin: 0 0 .2em .6em;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .2s var(--ease-out);
}
.ways-box[open] > summary::after { transform: rotate(-135deg); margin-bottom: -.05em; }
.ways-box > h2 { padding: 22px 22px 0; font-size: 1.4rem; }
.ways-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 32px; padding: 18px 22px 24px; }
.ways-list h3 { font-size: 1.15rem; margin-bottom: 6px; }
.ways-list p, .ways-list li { font-size: .95rem; }
.ways-list > div { display: grid; gap: 8px; align-content: start; }
.ways-list ol { padding-left: 1.2em; display: grid; gap: 4px; }

/* Warnungen vor dem Veröffentlichen (S20) */
.opening { display: grid; gap: 10px; padding: 14px 16px; background: var(--warn-tint); border: 1px solid var(--warn-edge); border-radius: 10px; }
.opening ul { padding-left: 1.2em; display: grid; gap: 4px; }

/* Kopieren (Remix) in der Spalte „Mehr“ */
.more { display: grid; gap: 14px; }
.more-row { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.more-row > div { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.share-link { display: grid; gap: 8px; justify-items: start; }

/* ---------- Daten einer App ---------- */
.data { display: grid; gap: 28px; }
.rows.sign-out { margin-top: 12px; }
.back { display: inline-flex; align-items: center; gap: .4em; font: 600 1rem/1.2 var(--label); letter-spacing: .02em; text-decoration: none; color: var(--ink-2); }
.back:hover { color: var(--ink); }
.data-head { display: grid; gap: 10px; }
.data-head h1 { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.6rem); line-height: 1.05; }
.summary { max-width: 60ch; font-size: 1.15rem; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; background: var(--blue-tint); border-radius: 8px; font-size: .98rem; width: fit-content; max-width: 100%; }
.notice.warn { background: var(--warn-tint); color: var(--ink); font-weight: 400; }
.keep { display: grid; gap: 10px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 0 0 2px var(--blue); }
.keep h2 { font-size: 1.35rem; }
.keep p { max-width: 64ch; }
.sec-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; margin-bottom: 12px; }
.sec-h h2 { font-size: 1.5rem; }
.rows { list-style: none; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.rows > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 20px; padding: 14px 18px; }
.rows > li + li { border-top: 1px solid var(--line); }
.row-title { font: 600 1.15rem/1.25 var(--label); letter-spacing: .01em; }
.row-meta { font-size: .92rem; color: var(--ink-2); }
.who-says { font-weight: 600; }
.row-act { justify-self: end; }
.room-code { font: 600 1rem/1 var(--mono); letter-spacing: .08em; padding: 3px 6px; background: var(--ground); border: 1px solid var(--line); border-radius: 4px; }
/* Löschen fragt an Ort und Stelle und zeigt vorher, was verschwindet */
.confirm { grid-column: 1 / -1; display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--ink); border-radius: 10px; }
.gone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .92rem; }
.gone b { font-weight: 600; padding: 2px 8px; border: 1px solid var(--bad); color: var(--bad); border-radius: 4px; background: var(--bad-tint); }

/* ---------- schmal ---------- */
@media (max-width: 900px) {
  .ways { grid-template-columns: 1fr; max-width: 520px; gap: 18px; }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .cols > * { padding-inline: 0; }
  .cols > * + * { border-left: 0; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
  .ways-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .bar nav { order: 3; width: 100%; margin-left: -12px; }
  .who { gap: 12px; font-size: .9rem; }
  .rack { --gap: 18px; }
  .slot { min-height: 0; padding: 28px 18px; }
  .drawer-in { padding: 18px 16px 22px; }
  .rows > li { grid-template-columns: minmax(0, 1fr); }
  .row-act { justify-self: start; }
  .page { padding-top: 28px; }
}
@media (max-width: 560px) {
  /* one column: modules lie on their side, the cover shrinks to a square */
  .tape { flex-direction: row; align-items: stretch; }
  .cover { flex: none; width: 96px; aspect-ratio: 1; align-self: start; }
  .cover-strip { font-size: 1.7rem; }
  .cover-icon { width: 64%; }
  .pause-badge { padding: 4px 8px; font-size: .8rem; }
  .tape-body { padding: 2px 0 2px 14px; }
}
@media (max-width: 520px) {
  .legend { grid-template-columns: 1fr; gap: 22px; }
  .way { padding: 18px 18px 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- KI (ai.md §3): vier Fragen auf einer Karte ---------- */
.ai-card { gap: 18px; }
.ai-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.switch { font-weight: 600; }
.switch input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ink); }
.ai-status { display: flex; align-items: baseline; gap: 10px; font-weight: 600; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); transform: translateY(-1px); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.ai-step { display: grid; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.ai-step h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.step-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--key-edge); font: 600 .9rem var(--label); }
.field { display: grid; grid-template-columns: 11rem minmax(0, 1fr); align-items: center; gap: 6px 16px; }
.field > label, .field-label { color: var(--ink-2); font-size: .95rem; }
.field input[type="url"], .field input[type="password"], .field input[type="text"]:not(.num), .field select { width: min(100%, 34rem); }
.field input.num { width: 11rem; text-align: right; font-variant-numeric: tabular-nums; }
.field input.num.short { width: 6rem; }
.ai-preview { padding: 10px 14px; background: var(--ground); border-radius: 8px; max-width: 60ch; }
.meter { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: var(--recess); overflow: hidden; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--blue); }
.ai-owner { display: grid; gap: 2px; }
.ai-assistant summary { cursor: pointer; }
.ai-system { white-space: pre-wrap; padding: 8px 10px; background: var(--ground); border-radius: 6px; font-family: var(--mono); font-size: .82rem; }
@media (max-width: 640px) { .field { grid-template-columns: minmax(0, 1fr); } }
