:root {
  --bg: #10131a;
  --panel: #171b24;
  --panel-2: #1f2430;
  --text: #d9deea;
  --muted: #9fb5aa;
  --accent-rgb: 127, 177, 151;
  --accent: #7fb197;
  --accent-strong: #9ad3b4;
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --line: rgba(127, 177, 151, 0.24);
  --bracket: rgba(230, 60, 60, 0.8);
  --c-red: #e86f61;
  --c-gold: #f0b23a;
  --c-pink: #cc6aa5;
  --c-cyan: #35b8ad;
  --c-green: #6aa84f;
  --c-brown: #b8792f;
  --c-magenta: #e8499a;
  --c-purple: #a64d79;
  --c-orange: #f28c28;
  --c-blue: #2d9ed8;
  --c-teal: #008c7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(150, 190, 95, 0.08), transparent 38%),
    var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow: auto;
}

.scale-frame {
  width: min(1280px, 96vw);
  margin: 24px auto;
  transform-origin: top center;
}


.app-shell {
  width: min(1280px, 96vw);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10, 16, 18, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 44px;
  padding: 0 14px;
  background: rgba(5, 9, 10, 0.94);
  border-bottom: 1px solid var(--line);
}

.traffic {
  display: flex;
  gap: 8px;
}

.traffic span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.traffic span:nth-child(1) {
  background: #ff5f57;
}

.traffic span:nth-child(2) {
  background: #ffbd2e;
}

.traffic span:nth-child(3) {
  background: #28c840;
}

.filename {
  color: var(--accent-strong);
  font-size: 14px;
  flex: 1;
}

.topbar-button {
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}

.topbar-button:hover {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: rgba(var(--accent-rgb), 0.62);
}

.topbar-button:focus-visible {
  outline: 2px solid rgba(53, 184, 173, 0.75);
  outline-offset: 2px;
}

.workspace {
  display: grid;
  grid-template-columns: 205px 1fr;
  min-height: 780px;
}

.sidebar {
  background: rgba(7, 16, 13, 0.92);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
}

.side-title {
  color: var(--accent-strong);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.file {
  padding: 9px 10px;
  color: #b7cfc3;
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
}

.file.active {
  background: rgba(var(--accent-rgb), 0.18);
  color: #f2fff7;
  box-shadow: inset 3px 0 0 var(--accent);
}

.editor-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.editor-header {
  display: flex;
  align-items: center;
  height: 42px;
  background: rgba(24, 34, 36, 0.96);
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.tab.active {
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--accent-strong);
}

.status {
  margin-left: auto;
  padding-right: 18px;
  color: var(--muted);
  font-size: 12px;
}

.editor-body {
  display: grid;
  grid-template-columns: 54px 1fr;
  min-height: 730px;
  max-height: 730px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  scrollbar-color: rgba(var(--accent-rgb), 0.42) rgba(7, 16, 13, 0.72);
}

.editor-body::-webkit-scrollbar {
  width: 10px;
}

.editor-body::-webkit-scrollbar-track {
  background: rgba(7, 16, 13, 0.72);
}

.editor-body::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.34);
  border-radius: 999px;
}

.editor-body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.52);
}


.line-numbers {
  padding-top: 22px;
  text-align: right;
  color: rgba(var(--accent-rgb), 0.62);
  border-right: 1px solid rgba(var(--accent-rgb), 0.12);
  user-select: none;
  font-size: 15px;
}

.line-number-title {
  min-height: 34.8px;
  margin-bottom: 10px;
  line-height: 34.8px;
}

.line-number-stanza {
  min-height: 84px;
  margin: 8px 0 14px;
}

.line-number-plain,
.line-number-stanza {
  display: flex;
  flex-direction: column;
}

.line-number-title,
.line-number-stanza div {
  padding-right: 14px;
}

.line-number-stanza div {
  min-height: 33px;
  line-height: 33px;
}

.simulation-grid {
  padding: 22px 28px 42px 22px;
  overflow: visible;
}

.title-row {
  display: grid;
  grid-template-columns: 335px minmax(560px, 1fr);
  column-gap: 28px;
  align-items: start;
  margin-bottom: 10px;
}

.title-line {
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  line-height: 1.45;
}

.stanza-row {
  display: grid;
  grid-template-columns: 335px minmax(560px, 1fr);
  column-gap: 28px;
  align-items: start;
  min-height: 84px;
  margin: 8px 0 14px;
}

.note-slot {
  min-height: 74px;
  position: relative;
  overflow: visible;
}

.poem-stanza {
  font-size: 17px;
  line-height: 1.95;
  white-space: pre-wrap;
  min-width: 0;
}

.line {
  min-height: 33px;
}

.token {
  transition: color 160ms ease, text-shadow 160ms ease;
}

.trigger {
  font-weight: 650;
  text-shadow: 0 0 12px currentColor;
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 1.15em;
  margin-left: 1px;
  background: #dfe7ff;
  vertical-align: -0.18em;
  animation: blink 0.75s steps(1) infinite;
}

.ghost {
  opacity: 0.42;
  filter: blur(0.1px);
}

.bracket-note {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  width: 322px;
  min-height: 74px;
  opacity: 0;
  transform: translateX(-340px);
  transition: transform 950ms cubic-bezier(.2, .9, .16, 1), opacity 950ms ease;
  pointer-events: none;
}

.bracket-note.visible {
  opacity: 1;
  transform: translateX(0);
}

.bracket {
  height: 74px;
  border-left: 5px solid var(--bracket);
  border-top: 5px solid var(--bracket);
  border-bottom: 5px solid var(--bracket);
  border-radius: 14px 0 0 14px;
  box-shadow: 0 0 18px rgba(230, 60, 60, 0.24);
}

.note-card {
  background: rgba(20, 22, 30, 0.8);
  border: 1px solid rgba(230, 60, 60, 0.36);
  border-radius: 14px;
  padding: 9px 11px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}

.note-title {
  color: #ff7777;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.note-formula {
  color: #f0f3ff;
  font-size: 13px;
  line-height: 1.35;
}

.note-desc {
  color: #aeb7c8;
  font-size: 10px;
  line-height: 1.35;
  margin-top: 4px;
}

.bracket-note.note-white .bracket {
  border-left-color: rgba(228, 234, 246, 0.58);
  border-top-color: rgba(228, 234, 246, 0.58);
  border-bottom-color: rgba(228, 234, 246, 0.58);
  box-shadow: 0 0 12px rgba(228, 234, 246, 0.10);
}

.bracket-note.note-white .note-card {
  border-color: rgba(228, 234, 246, 0.22);
  background: rgba(245, 247, 255, 0.045);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.bracket-note.note-white .note-title {
  color: rgba(244, 247, 255, 0.78);
}

.bracket-note.note-white .note-formula {
  color: #f0f3ff;
}

.bracket-note.note-white .note-desc {
  color: #aeb7c8;
}


.info-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 7, 12, 0.62);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.info-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.info-modal {
  position: relative;
  width: min(560px, 92vw);
  max-height: min(82vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: rgba(10, 16, 18, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.info-modal h2 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 22px;
}

.info-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
}

.info-list div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
}

.info-list dt {
  color: var(--muted);
}

.info-list dd {
  margin: 0;
  color: var(--text);
}

.info-modal p {
  margin: 0 0 18px;
  color: #aeb7c8;
  line-height: 1.55;
}

.info-copy p:last-child {
  margin-bottom: 20px;
}

.info-recommendation {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.08);
}

.info-recommendation h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 15px;
}

.info-recommendation p {
  margin-bottom: 0;
}

.info-recommendation strong {
  color: #ffffff;
}

.about-link,
.resource-link {
  display: block;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(15, 18, 24, 0.84);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.about-link:hover,
.resource-link:hover {
  background: rgba(var(--accent-rgb), 0.24);
  border-color: rgba(var(--accent-rgb), 0.62);
}

.about-link:focus-visible,
.resource-link:focus-visible {
  outline: 2px solid rgba(53, 184, 173, 0.75);
  outline-offset: 2px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(var(--accent-rgb), 0.24);
}

.modal-action {
  width: 100%;
}

.copyright {
  padding: 12px 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(5, 9, 10, 0.94);
  font-size: 12px;
}

.c-red {
  color: var(--c-red);
}

.c-gold {
  color: var(--c-gold);
}

.c-pink {
  color: var(--c-pink);
}

.c-cyan {
  color: var(--c-cyan);
}

.c-green {
  color: var(--c-green);
}

.c-brown {
  color: var(--c-brown);
}

.c-magenta {
  color: var(--c-magenta);
}

.c-purple {
  color: var(--c-purple);
}

.c-orange {
  color: var(--c-orange);
}

.c-blue {
  color: var(--c-blue);
}

.c-teal {
  color: var(--c-teal);
}

@keyframes blink {

  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 1050px) {
  .scale-frame {
    width: min(760px, 96vw);
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .title-row,
  .stanza-row {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .note-slot {
    min-height: 80px;
  }

  .poem-stanza {
    font-size: 14px;
  }
}
/* v1.0.8: „wah“ nutzt die Fahr-Fraktalfarbe; „rnehmung“ und „Erhebung“ bleiben weiß mit gelber Punktebene */
:root {
  --c-fractal-deep: #51406f;
  --c-fractal-glow: #7460a8;
  --c-spark-yellow: var(--c-gold);
}

.c-fractal {
  color: var(--c-fractal-glow);
}

.trigger.c-fractal {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #8470bd;
  text-shadow:
    0 0 7px rgba(116, 96, 168, 0.58),
    0 0 16px rgba(81, 64, 111, 0.42),
    0.04em 0 rgba(53, 184, 173, 0.22),
    -0.04em 0 rgba(240, 178, 58, 0.18);
  animation: fractalPulse 1.65s ease-in-out infinite;
}

.trigger.c-fractal::after {
  content: attr(data-fragment);
  position: absolute;
  inset: 0;
  color: rgba(132, 112, 189, 0.30);
  transform: translate(0.055em, -0.035em);
  clip-path: polygon(0 0, 100% 0, 100% 46%, 0 58%);
  pointer-events: none;
}

.trigger.c-dots-yellow {
  position: relative;
  display: inline-block;
  isolation: isolate;
  color: #ffffff;
  text-shadow: 0 0 9px rgba(255, 255, 255, 0.32);
}

.trigger.c-dots-yellow::before {
  content: "";
  position: absolute;
  inset: -0.20em -0.14em -0.10em;
  z-index: -1;
  pointer-events: none;
  border-radius: 0.28em;
  background:
    radial-gradient(circle, rgba(240, 178, 58, 0.96) 0 1.05px, transparent 1.35px) 0.04em 0.02em / 0.34em 0.34em,
    radial-gradient(circle, rgba(255, 214, 91, 0.82) 0 0.9px, transparent 1.25px) 0.19em 0.17em / 0.41em 0.41em;
  mix-blend-mode: screen;
  opacity: 0.9;
  filter: drop-shadow(0 0 4px rgba(240, 178, 58, 0.58));
  animation: wahrSparkle 1.28s steps(2, end) infinite;
}

@keyframes wahrSparkle {
  0%, 100% {
    opacity: 0.58;
    transform: translate(0, 0);
  }
  45% {
    opacity: 1;
    transform: translate(0.035em, -0.025em);
  }
  72% {
    opacity: 0.76;
    transform: translate(-0.025em, 0.018em);
  }
}

@keyframes fractalPulse {
  0%, 100% {
    transform: translate(0, 0);
    filter: saturate(1);
  }
  35% {
    transform: translate(0.018em, -0.012em);
    filter: saturate(1.22);
  }
  70% {
    transform: translate(-0.012em, 0.014em);
    filter: saturate(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trigger.c-fractal,
  .trigger.c-dots-yellow::before {
    animation: none;
  }
}
