/* =========================================================================
   encryptor.one
   Gestaltung: Cyanotypie — Preußischblau als Trägerton, Bernstein als
   Signalfarbe (das Sicherheitslicht der Dunkelkammer). Kein Serifen-Display,
   stattdessen eine eng gesetzte Groteske für Überschriften und Monospace
   überall dort, wo Maschinendaten stehen: Schlüssel, Fingerabdrücke, Chiffren.
   Das wiederkehrende Motiv ist das Siegel — das aus dem Schlüssel abgeleitete
   Emblem, das an jeder Identität hängt.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --fs-hero: clamp(2rem, 1.1rem + 4vw, 3.4rem);
  --fs-h2: clamp(1.25rem, 1.05rem + .8vw, 1.6rem);
  --fs-h3: 1.0625rem;
  --fs-sm: .875rem;
  --fs-xs: .78rem;
  --fs-mono: .8125rem;

  --r-sm: 9px;
  --r: 12px;
  --r-lg: 18px;
  --r-full: 999px;

  --wrap: 780px;
  --tap: 46px;
  --ease: cubic-bezier(.2, .8, .3, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #061420;
  --bg-deep: #030c14;
  --panel: #0b2233;
  --panel-2: #0f2c41;
  --field: #081c2b;
  --ink: #e6eff6;
  --ink-2: #b9cddd;
  --muted: #7a97ac;
  --line: #16394f;
  --line-2: #1f4b66;
  --edge: rgba(190, 225, 245, .06);
  --accent: #f0a742;
  --accent-ink: #1a1103;
  --accent-soft: #35270f;
  --accent-line: #4a3616;
  --cyan: #62c4d8;
  --cyan-soft: #0d3644;
  --ok: #62c4d8;
  --danger: #f0725c;
  --danger-soft: #3a1a16;
  --danger-line: #5a2820;
  --grid: rgba(125, 190, 225, .05);
  --glow-a: rgba(240, 167, 66, .11);
  --glow-b: rgba(98, 196, 216, .09);
  --scene-bg: #081926;
  --seal-plate: #08202f;
  --shadow: 0 1px 0 var(--edge) inset, 0 14px 34px -22px rgba(0, 0, 0, .9);
  --shadow-lg: 0 1px 0 var(--edge) inset, 0 34px 70px -30px rgba(0, 0, 0, .95);
  --focus: #f0a742;
  --blur-bg: rgba(8, 24, 36, .82);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #e8eff5;
  --bg-deep: #cfdce7;
  --panel: #fbfdfe;
  --panel-2: #eef4f9;
  --field: #ffffff;
  --ink: #0d2337;
  --ink-2: #2e4c64;
  --muted: #5d7a92;
  --line: #d5e1ea;
  --line-2: #bccddb;
  --edge: rgba(255, 255, 255, .9);
  --accent: #9c5c12;
  --accent-ink: #ffffff;
  --accent-soft: #f7ead6;
  --accent-line: #e2c79c;
  --cyan: #135f74;
  --cyan-soft: #ddedf2;
  --ok: #135f74;
  --danger: #a83324;
  --danger-soft: #f8e2de;
  --danger-line: #edc4bd;
  --grid: rgba(20, 62, 96, .055);
  --glow-a: rgba(156, 92, 18, .07);
  --glow-b: rgba(19, 95, 116, .06);
  --scene-bg: #f4f8fb;
  --seal-plate: #f2f7fb;
  --shadow: 0 1px 0 var(--edge) inset, 0 10px 26px -20px rgba(13, 35, 55, .5);
  --shadow-lg: 0 1px 0 var(--edge) inset, 0 30px 60px -28px rgba(13, 35, 55, .45);
  --focus: #135f74;
  --blur-bg: rgba(248, 251, 253, .86);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Blaupausen-Raster + weiches Licht von oben */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 34px 34px;
  -webkit-mask-image: radial-gradient(130% 95% at 50% -8%, #000 22%, transparent 76%);
  mask-image: radial-gradient(130% 95% at 50% -8%, #000 22%, transparent 76%);
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(68rem 42rem at 6% -14%, var(--glow-a), transparent 62%),
    radial-gradient(56rem 34rem at 98% -8%, var(--glow-b), transparent 60%);
}

h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.022em; line-height: 1.18; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { flex: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: var(--r);
}
.skip:focus { left: 12px; }

.icon { width: 20px; height: 20px; }
.icon-sm { width: 15px; height: 15px; }

[hidden] { display: none !important; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--blur-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}
.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px max(16px, env(safe-area-inset-left)) 10px max(16px, env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.brand-mark { width: 22px; height: 22px; color: var(--accent); }
.brand-name {
  font-family: var(--font-mono);
  font-size: .8125rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
}
.brand-name i { font-style: normal; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--r); color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.icon-btn:hover { background: var(--panel-2); color: var(--ink); border-color: var(--line); }
.pill-btn {
  height: 32px; padding: 0 11px;
  background: transparent; border: 1px solid var(--line-2);
  border-radius: var(--r-full); color: var(--muted);
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.pill-btn:hover { color: var(--ink); border-color: var(--accent); }

/* ---------- Layout ---------- */
main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 26px max(16px, env(safe-area-inset-left)) 64px max(16px, env(safe-area-inset-right));
}
.screen { animation: screenIn .32s var(--ease); }
.view { display: grid; gap: 16px; animation: screenIn .26s var(--ease); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 16px; }
.panel-narrow { max-width: 420px; margin-inline: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.stack { display: grid; gap: 14px; }
.rule { border: none; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Typografie-Bausteine ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.lede { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.65; }
.lede-sm { font-size: 1rem; }
.muted { color: var(--muted); font-size: var(--fs-sm); }
.hint { color: var(--muted); font-size: var(--fs-xs); line-height: 1.55; }
.hint.subtle { display: flex; gap: 7px; align-items: flex-start; opacity: .85; }
.hint.subtle .icon-sm { margin-top: 3px; }
.mono { font-family: var(--font-mono); }
.label { display: block; font-size: var(--fs-sm); font-weight: 560; margin-bottom: 7px; }
.label-sm {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 4px;
}
.linklike {
  background: none; border: none; padding: 4px 0;
  color: var(--accent); font-size: var(--fs-sm);
  text-decoration: underline; text-underline-offset: 3px; text-align: left;
}
.empty { color: var(--muted); font-size: var(--fs-sm); padding: 10px 2px; }
.counter { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); text-align: right; margin-top: 5px; }
.version { font-size: .68rem; color: var(--muted); text-align: center; padding-top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--r);
  font-size: .9375rem; font-weight: 570; letter-spacing: -.005em;
  transition: transform .12s var(--ease), background .18s var(--ease), border-color .18s var(--ease), opacity .18s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-quiet { background: var(--panel-2); color: var(--ink); border-color: var(--line-2); }
.btn-quiet:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; }
.btn-small { min-height: 34px; padding: 0 12px; font-size: var(--fs-xs); }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }
.btn-row-end { justify-content: flex-end; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- Felder ---------- */
.field { display: block; }
.input {
  display: block; width: 100%;
  background: var(--field);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.textarea { resize: vertical; min-height: 118px; line-height: 1.6; }
.input.mono { font-family: var(--font-mono); letter-spacing: .01em; }
.cipher { word-break: break-all; color: var(--ink-2); }
.select {
  appearance: none; padding-right: 40px;
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  /* Chevron als Data-URI: eine Datei weniger, und img-src erlaubt data: */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%237fa8c4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
[data-theme="light"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2340637d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.select-wrap { position: relative; }

.input-affix { position: relative; }
.input-affix .input { padding-right: 46px; }
.affix-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: none; border-radius: var(--r-sm); color: var(--muted);
}
.affix-btn:hover { color: var(--ink); }

.form-error {
  color: var(--danger); font-size: var(--fs-sm);
  background: var(--danger-soft); border: 1px solid var(--danger-line);
  border-radius: var(--r); padding: 9px 12px;
}
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: var(--fs-xs); line-height: 1.6;
  border-radius: var(--r); padding: 11px 13px;
}
.callout .icon-sm { margin-top: 3px; }
.callout-warn { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--ink-2); }

.meter { height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; margin-top: 9px; }
.meter-bar { height: 100%; width: 0; background: var(--danger); border-radius: 2px; transition: width .3s var(--ease), background .3s; }
.meter-bar[data-level="2"] { background: var(--accent); }
.meter-bar[data-level="3"], .meter-bar[data-level="4"] { background: var(--ok); }

.disclosure { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.disclosure summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); list-style: none; padding: 4px 0; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::before { content: '+ '; font-family: var(--font-mono); color: var(--accent); }
.disclosure[open] summary::before { content: '– '; }
.disclosure .input { margin-top: 10px; }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px;
}
.segmented button {
  min-height: 38px; border: none; background: transparent; color: var(--muted);
  border-radius: var(--r-sm); font-size: var(--fs-sm); transition: background .18s, color .18s;
}
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 22px 0 12px; }
.hero-seal { display: flex; justify-content: center; margin-bottom: 22px; }
.hero-seal .sigil { width: clamp(108px, 26vw, 148px); height: auto; }
.hero .eyebrow { margin-bottom: 14px; }
.hero-title {
  font-size: var(--fs-hero);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 660;
  max-width: 15ch;
  margin: 0 auto 18px;
  text-wrap: balance;
}
.hero .lede { max-width: 56ch; margin: 0 auto; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 26px 0 18px; }
.hero-actions .btn { flex: 1 1 210px; max-width: 280px; }
.hero-note {
  display: inline-flex; gap: 8px; align-items: flex-start; text-align: left;
  max-width: 52ch; color: var(--muted); font-size: var(--fs-xs); line-height: 1.55;
}
.hero-note .icon-sm { margin-top: 3px; color: var(--cyan); }

.facts { display: grid; gap: 12px; margin: 36px 0 30px; }
.fact {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow);
}
.fact .icon { color: var(--accent); margin-bottom: 10px; }
.fact h3 { margin-bottom: 6px; }
.fact p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }

.howto-slot:not(:empty) { margin-top: 26px; }

/* ---------- Siegel ---------- */
.sigil { display: block; }
.sg-plate { fill: var(--seal-plate); stroke: var(--line-2); stroke-width: .7; }
.sg-ring { fill: none; stroke: var(--line-2); stroke-width: .55; }
.sg-tick { stroke-width: 2.1; stroke-linecap: round; }
.sg-a { stroke: var(--accent); fill: var(--accent); }
.sg-b { stroke: var(--seal-hue); fill: var(--seal-hue); }
.sg-core { fill: var(--ink); }
[data-theme="dark"] .sigil { --seal-hue: hsl(var(--sigil-hue, 200) 62% 64%); }
[data-theme="light"] .sigil { --seal-hue: hsl(var(--sigil-hue, 200) 52% 34%); }

.sigil--develop .sg-plate, .sigil--develop .sg-ring { opacity: 0; animation: expose .55s var(--ease) forwards; }
.sigil--develop .sg-tick { opacity: 0; animation: expose .5s var(--ease) .22s forwards; }
.sigil--develop .sg-cell {
  opacity: 0; transform: scale(.35); transform-origin: center; transform-box: fill-box;
  animation: cellIn .5s var(--ease) forwards; animation-delay: calc(320ms + var(--d, 0ms));
}
.sigil--develop .sg-core { opacity: 0; animation: expose .4s ease .78s forwards; }

/* ---------- Tabs ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 3px; margin-bottom: 18px;
}
.tab {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; border: none; background: transparent; color: var(--muted);
  border-radius: 11px; font-size: var(--fs-sm); font-weight: 540;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.tab .icon { width: 17px; height: 17px; }
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Ergebnisse ---------- */
.result-panel { border-color: var(--accent-line); }
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.result-status { font-size: var(--fs-xs); color: var(--ok); font-weight: 560; }
.result-panel .textarea { min-height: 132px; }
.result-panel .hint { margin-top: 9px; }
.result-panel .btn-row { margin-top: 13px; }

.plain-out {
  background: var(--field); border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 14px; margin-top: 8px; min-height: 90px;
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6;
}
.sender {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line);
}
.sender .sigil { width: 42px; height: 42px; }
.sender-name { font-weight: 570; }
#decMeta { margin-top: 9px; }

/* ---------- Identität & Kontakte ---------- */
.identity-panel { border-color: var(--line-2); }
.identity { display: flex; align-items: center; gap: 16px; margin: 14px 0 16px; }
.identity-seal .sigil { width: 68px; height: 68px; }
.identity-body { min-width: 0; }
.fingerprint {
  font-family: var(--font-mono); font-size: .8125rem;
  letter-spacing: .06em; color: var(--ink); overflow-wrap: anywhere;
}

.contact-list { display: grid; gap: 8px; }
.contact-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 11px 13px; min-height: 62px;
  transition: border-color .18s var(--ease);
}
.contact-row:hover { border-color: var(--accent); }
.contact-row .sigil { width: 38px; height: 38px; }
.contact-meta { min-width: 0; flex: 1; }
.contact-name { font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-fp { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); letter-spacing: .05em; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--r-full); border: 1px solid;
}
.badge-ok { color: var(--ok); border-color: var(--ok); background: var(--cyan-soft); }
.badge-warn { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.preview {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px;
}
.preview .sigil { width: 46px; height: 46px; }

/* ---------- Anleitung ---------- */
.howto .lede-sm { margin: 10px 0 22px; max-width: 62ch; }
.steps { position: relative; }
.step { display: none; }
.step.is-active { display: grid; gap: 20px; animation: stepIn .38s var(--ease); }
.step-index {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.step-body h3 { margin-bottom: 8px; }
.step-body p { color: var(--muted); font-size: var(--fs-sm); line-height: 1.65; }
.scene {
  margin: 0; background: var(--scene-bg);
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.scene svg { display: block; width: 100%; height: auto; }

.steps-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.dots { display: flex; gap: 8px; }
.dot {
  width: 26px; height: 4px; border: none; padding: 0;
  border-radius: 2px; background: var(--line-2);
  transition: background .2s var(--ease), width .2s var(--ease);
}
.dot.is-active { background: var(--accent); width: 34px; }

/* Szenen-Grafik */
.sc-dev rect, .sc-dev-plain { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 1.4; }
.sc-seal { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.sc-core { fill: var(--accent); stroke: none; }
.sc-dash { fill: none; stroke: var(--line-2); stroke-width: 1.4; stroke-dasharray: 4 6; }
.sc-card { fill: var(--panel); stroke: var(--accent); stroke-width: 1.4; }
.sc-card-line { stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.sc-fp { stroke: var(--muted); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 5 4; fill: none; }
.sc-check { fill: none; stroke: var(--ok); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 46; stroke-dashoffset: 46; }
.sc-plain path { fill: none; stroke: var(--ink-2); stroke-width: 4; stroke-linecap: round; }
.sc-cipher path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 7 5; }
.sc-lockmark rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.6; }
.sc-shackle { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.sc-bubble rect { fill: var(--panel); stroke: var(--line-2); stroke-width: 1.4; }
.sc-noise { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 4; fill: none; }
.sc-reveal path { fill: none; stroke: var(--ok); stroke-width: 3.4; stroke-linecap: round; opacity: 0; }
.sc-travel, .sc-bubble { transform: translate(112px, 75px); }

.step.is-active .sc-dev-a { animation: rise .5s var(--ease) both; }
.step.is-active .sc-dev-b { animation: rise .5s var(--ease) .14s both; }
.step.is-active .sc-travel { animation: travel 3.4s var(--ease) infinite; }
.step.is-active .sc-cmp-a { animation: rise .45s var(--ease) both; }
.step.is-active .sc-cmp-b { animation: rise .45s var(--ease) .12s both; }
.step.is-active .sc-check { animation: draw .55s ease .55s forwards; }
.step.is-active .sc-plain { animation: swapOut 3.4s ease-in-out infinite; }
.step.is-active .sc-cipher { animation: swapIn 3.4s ease-in-out infinite; }
.step.is-active .sc-lockmark { animation: clack 3.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.step.is-active .sc-bubble { animation: travel 3.6s var(--ease) infinite; }
.step.is-active .sc-reveal path { animation: revealIn 3.6s ease infinite; }

/* ---------- Sicherheitsblock ---------- */
.security { margin-top: 16px; }
.sec-grid { display: grid; gap: 22px; margin: 16px 0 18px; }
.sec-h { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); margin-bottom: 10px; }
.sec-yes { color: var(--ok); }
.sec-no { color: var(--accent); }
.sec-list { display: grid; gap: 9px; }
.sec-list li {
  color: var(--muted); font-size: var(--fs-sm); line-height: 1.6;
  padding-left: 14px; position: relative;
}
.sec-list li::before {
  content: ''; position: absolute; left: 0; top: .68em;
  width: 5px; height: 1px; background: var(--line-2);
}
.stack-line {
  font-size: .68rem; color: var(--muted); letter-spacing: .04em;
  border-top: 1px solid var(--line); padding-top: 14px;
}

/* ---------- Sperrbildschirm ---------- */
.lock-panel { text-align: center; margin-top: 6vh; }
.lock-seal { display: flex; justify-content: center; margin-bottom: 18px; }
.lock-seal .sigil { width: 84px; height: 84px; }
.lock-panel .panel-title { margin-bottom: 6px; }
.lock-panel form { margin-top: 20px; text-align: left; }
.lock-panel .linklike { display: block; margin: 16px auto 0; text-align: center; }

/* ---------- Dialoge ---------- */
dialog.sheet {
  border: 1px solid var(--line);
  padding: 0; background: var(--panel); color: var(--ink);
  border-radius: var(--r-lg);
  width: min(560px, calc(100vw - 32px));
  max-height: min(88dvh, 880px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
dialog.sheet::backdrop { background: rgba(3, 12, 20, .66); backdrop-filter: blur(5px); }
dialog.sheet[open] { animation: sheetIn .3s var(--ease); }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px 20px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font-size: 1.125rem; }
.sheet-body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; max-height: calc(88dvh - 62px); }
.sheet-compact .sheet-body { max-height: none; }
.setting { display: grid; gap: 9px; }
.setting.danger .label { color: var(--danger); }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line-2);
  border-radius: var(--r); padding: 11px 14px;
  font-size: var(--fs-sm); box-shadow: var(--shadow-lg);
  animation: toastIn .26s var(--ease);
  pointer-events: auto;
}
.toast .icon-sm { color: var(--ok); }
.toast-warn .icon-sm { color: var(--accent); }
.toast button { background: none; border: none; color: var(--accent); text-decoration: underline; font-size: var(--fs-sm); margin-left: auto; }

/* ---------- Animationen ---------- */
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sheetIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes expose { to { opacity: 1; } }
@keyframes cellIn { to { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel {
  0% { transform: translate(112px, 75px); opacity: 0; }
  14% { opacity: 1; }
  76% { opacity: 1; }
  90%, 100% { transform: translate(266px, 75px); opacity: 0; }
}
@keyframes swapOut { 0%, 38% { opacity: 1; } 55%, 92% { opacity: .12; } 100% { opacity: 1; } }
@keyframes swapIn { 0%, 38% { opacity: .12; } 55%, 92% { opacity: 1; } 100% { opacity: .12; } }
@keyframes clack { 0%, 40% { transform: scale(1); } 48% { transform: scale(1.16); } 60%, 100% { transform: scale(1); } }
@keyframes revealIn { 0%, 62% { opacity: 0; } 76%, 94% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- Ab Tablet ---------- */
@media (min-width: 720px) {
  main { padding-top: 34px; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .sec-grid { grid-template-columns: 1fr 1fr; }
  .step.is-active { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 26px; }
  .panel { padding: 24px; }
  .input, .textarea { font-size: .9375rem; }
  .input.mono { font-size: var(--fs-mono); }
}

/* ---------- Mobil: Tabs unten ---------- */
@media (max-width: 719px) {
  main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    grid-template-columns: repeat(4, 1fr);
    border-radius: 0; border-left: none; border-right: none; border-bottom: none;
    margin: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--blur-bg);
    backdrop-filter: saturate(150%) blur(14px);
    -webkit-backdrop-filter: saturate(150%) blur(14px);
  }
  .tab { flex-direction: column; gap: 3px; min-height: 48px; font-size: .66rem; letter-spacing: .01em; }
  .tab .icon { width: 20px; height: 20px; }
  .toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }
  dialog.sheet {
    width: 100vw; max-width: 100vw;
    margin: auto auto 0; max-height: 92dvh;
    border-radius: 20px 20px 0 0; border-bottom: none;
  }
  .sheet-body { max-height: calc(92dvh - 62px); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  dialog.sheet[open] { animation: sheetUp .3s var(--ease); }
  @keyframes sheetUp { from { transform: translateY(28px); opacity: .4; } to { transform: none; opacity: 1; } }
  .btn-row .btn { flex: 1 1 100%; }
  .hero-actions .btn { flex: 1 1 100%; max-width: none; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .sigil--develop .sg-plate, .sigil--develop .sg-ring, .sigil--develop .sg-tick,
  .sigil--develop .sg-cell, .sigil--develop .sg-core { opacity: 1; transform: none; }
  .sc-reveal path { opacity: 1; }
  .sc-check { stroke-dashoffset: 0; }
}

/* ---- Nachtraege: Sperrbildschirm-Links, Versionszeile, enge Buttonzeile ---- */
.lock-links {
  display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px;
}
.linklike-quiet { color: var(--text-dim); font-size: .86rem; }
.linklike-quiet:hover { color: var(--text); }

#btnRestoreLanding { display: block; margin: 14px auto 0; }

.btn-row-tight { gap: 14px; margin-top: 2px; }

.version-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 0; color: var(--text-dim); font-size: .88rem;
}
.version-row .mono { color: var(--text); }

#decSender + .eyebrow, .result-panel .eyebrow + .sender { margin-top: 6px; }

.hero-tagline {
  margin: 10px 0 0; color: var(--accent);
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
}
