:root {
  --bg: #f4f6f4;
  --surface: #ffffff;
  --ink: #1c2225;
  --muted: #667174;
  --line: #d9e0dd;
  --teal: #256d6a;
  --teal-dark: #1c5553;
  --amber: #c28a1d;
  --red: #b94a48;
  --blue: #4c6f9f;
  --green-soft: #e8f3ef;
  --red-soft: #faeaea;
  --shadow: 0 18px 40px rgba(25, 35, 38, 0.09);
}

/* Symbolische KI: Codebeispiele im interaktiven Skript */
.symbolic-code-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 0.65fr);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.symbolic-code-panel,
.symbolic-code-result {
  min-width: 0;
}

.symbolic-code-panel {
  background: #252b2f;
  color: #f6f8f7;
}

.symbolic-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.symbolic-code-head span {
  color: #70c4bc;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.symbolic-code-head strong {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.symbolic-code-panel pre,
.symbolic-code-result pre {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  white-space: pre;
}

.symbolic-code-panel pre {
  min-height: 230px;
  padding: 18px;
  color: #f4f0d8;
  font: 650 0.88rem/1.65 ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.symbolic-code-result {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: #fbfcfb;
}

.symbolic-code-result > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.symbolic-code-result > code,
.symbolic-code-result > pre {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: 750 0.82rem/1.55 ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

.symbolic-code-result > pre {
  color: var(--teal);
  white-space: pre-wrap;
}

.symbolic-code-result small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .symbolic-code-band {
    grid-template-columns: 1fr;
  }

  .symbolic-code-result {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .symbolic-code-panel pre {
    min-height: 0;
    font-size: 0.78rem;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(37, 109, 106, 0.08), rgba(244, 246, 244, 0) 320px),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.auth-locked .topbar,
.auth-locked .shell {
  visibility: hidden;
}

.auth-locked::before {
  content: "Anmeldung wird geprüft...";
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--teal);
  font-weight: 850;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 18px;
}

.brand-block {
  flex: 1 1 320px;
  min-width: 0;
}

.brand-block h1 {
  max-width: 760px;
  font-size: clamp(1.55rem, 2.6vw, 2.25rem);
  overflow-wrap: anywhere;
}

.platform-topbar .app-nav {
  flex: 1 0 100%;
  justify-content: flex-start;
  padding-top: 14px;
  border-top: 1px solid rgba(37, 109, 106, 0.14);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.05;
}

.top-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
  min-width: min(430px, 100%);
}

.top-stats div,
.side-panel,
.panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.top-stats div {
  min-height: 68px;
  padding: 12px;
  border-radius: 8px;
}

.top-stats span,
.side-panel span,
.source-line span,
.section-title span,
.result-hero span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.top-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.04rem;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 42px;
}

.visual-band {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(210px, 320px);
  align-items: center;
  gap: 22px;
  min-height: 170px;
  margin-bottom: 18px;
  padding: 18px 22px;
  border: 1px solid rgba(37, 109, 106, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(232, 243, 239, 0.82));
}

#topicMap {
  display: block;
  width: 100%;
  height: 138px;
}

.visual-copy {
  border-left: 3px solid var(--amber);
  padding-left: 18px;
}

.visual-copy strong {
  display: block;
  margin-bottom: 8px;
}

.visual-copy span {
  color: var(--muted);
  line-height: 1.5;
}

.message {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(185, 74, 72, 0.25);
  border-radius: 8px;
  background: var(--red-soft);
  color: #7d2d2b;
  font-weight: 700;
}

.panel {
  border-radius: 8px;
  padding: 22px;
}

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 22px;
}

.setup-main {
  min-width: 0;
}

.section-title,
.filter-head,
.action-row,
.question-head,
.result-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-title {
  margin-bottom: 18px;
}

.section-title strong {
  color: var(--teal);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.filter-head strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
.numeric-answer input,
.short-answer input,
.order-row select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px 12px;
}

.field input:focus,
.field select:focus,
.numeric-answer input:focus,
.short-answer input:focus,
.order-row select:focus {
  outline: 3px solid rgba(37, 109, 106, 0.18);
  border-color: var(--teal);
}

.field input:disabled {
  color: #9aa4a6;
  background: #eef1ef;
}

.switch-row {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 74px;
  padding: 0 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.switch-row input,
.check-row input,
.option-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.filter-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-head {
  margin-bottom: 10px;
}

.ghost-btn {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.ghost-btn:hover,
.secondary-btn:hover {
  border-color: rgba(37, 109, 106, 0.45);
  color: var(--teal);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
  gap: 9px;
}

.check-grid.compact {
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-weight: 700;
}

.action-row {
  margin-top: 22px;
}

.action-row.split {
  align-items: center;
}

.action-row.split > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-btn {
  min-width: 118px;
  padding: 0 18px;
  background: var(--teal);
  color: #fff;
  font-weight: 850;
}

.primary-btn:hover:not(:disabled) {
  background: var(--teal-dark);
}

.secondary-btn {
  min-width: 112px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.side-panel {
  align-self: start;
  border-radius: 8px;
  padding: 18px;
  box-shadow: none;
}

.side-panel strong {
  display: block;
  margin-top: 10px;
  line-height: 1.45;
}

.quiz-panel {
  min-height: 520px;
}

.question-head {
  align-items: flex-start;
}

.question-head h2 {
  max-width: 760px;
  margin: 8px 0 0;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
  line-height: 1.25;
}

#questionPosition {
  color: var(--teal);
  font-weight: 850;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 210px;
}

.chips span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  margin: 22px 0;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebe8;
}

#progressBar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  transition: width 0.25s ease;
}

.answer-area {
  display: grid;
  gap: 10px;
  min-height: 220px;
}

.option-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  line-height: 1.42;
  font-weight: 700;
}

.option-row:hover {
  border-color: rgba(37, 109, 106, 0.42);
}

.option-row.is-correct {
  border-color: rgba(37, 109, 106, 0.38);
  background: var(--green-soft);
}

.option-row.is-wrong {
  border-color: rgba(185, 74, 72, 0.36);
  background: var(--red-soft);
}

.numeric-answer,
.short-answer {
  display: block;
  width: min(520px, 100%);
}

.numeric-answer input,
.short-answer input {
  font-size: 1.12rem;
  font-weight: 800;
}

.order-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.order-row > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.feedback {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.5;
}

.feedback p {
  margin: 8px 0 0;
}

.feedback span,
.review-item span {
  color: var(--muted);
  font-weight: 800;
}

.feedback.correct {
  border: 1px solid rgba(37, 109, 106, 0.28);
  background: var(--green-soft);
}

.feedback.wrong {
  border: 1px solid rgba(185, 74, 72, 0.28);
  background: var(--red-soft);
}

.source-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.source-line strong {
  overflow-wrap: anywhere;
}

.result-hero {
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.result-hero h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.result-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.score-badge {
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 92px;
  border: 1px solid rgba(194, 138, 29, 0.35);
  border-radius: 8px;
  background: #fff8e8;
}

.score-badge strong {
  font-size: 2rem;
}

.score-badge span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  margin-top: 22px;
}

.result-grid h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.topic-results {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-results li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.topic-results span {
  color: var(--muted);
}

.review-list {
  display: grid;
  gap: 10px;
}

.review-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.review-item summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.35;
}

.review-item p,
.review-item small {
  display: block;
  margin: 0;
  padding: 0 14px 10px;
  color: var(--muted);
  line-height: 1.45;
}

.empty-review {
  margin-bottom: 0;
  color: var(--muted);
}

.app-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.app-nav a:hover,
.app-nav a[aria-current="page"] {
  border-color: rgba(37, 109, 106, 0.42);
  background: var(--teal);
  color: #fff;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(37, 109, 106, 0.22);
  border-radius: 8px;
  background: var(--green-soft);
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 900;
}

.logout-btn {
  min-height: 38px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  width: min(920px, 100%);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-brand h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.auth-brand p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

.auth-module-preview {
  display: grid;
  gap: 5px;
  max-width: 520px;
  margin-top: 28px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.auth-module-preview span,
.auth-form-head span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-module-preview strong {
  color: var(--teal);
  line-height: 1.4;
}

.auth-form-head h2 {
  margin: 4px 0 6px;
  font-size: 1.4rem;
}

.auth-form {
  display: grid;
  align-content: start;
  gap: 14px;
}

.auth-form .primary-btn {
  width: 100%;
  margin-top: 4px;
}

.auth-message,
.admin-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.auth-message:not(:empty),
.admin-message:not(:empty) {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.admin-message[data-tone="success"] {
  border-color: rgba(37, 109, 106, 0.28);
  background: var(--green-soft);
  color: var(--teal);
}

.admin-message[data-tone="error"],
.auth-message:not(:empty) {
  border-color: rgba(185, 74, 72, 0.28);
  background: var(--red-soft);
  color: #7d2d2b;
}

.login-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(194, 138, 29, 0.28);
  border-radius: 8px;
  background: #fff8e8;
}

.login-note strong {
  color: #7a560f;
}

.login-note span {
  color: var(--muted);
  line-height: 1.5;
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
}

.account-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(130px, 0.7fr) auto;
  align-items: end;
  gap: 12px;
}

.account-list {
  display: grid;
  gap: 10px;
}

.account-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.account-info {
  display: grid;
  gap: 5px;
}

.account-info strong {
  font-size: 1.04rem;
}

.account-info span,
.account-info small,
.admin-grid .side-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.account-info small {
  justify-self: start;
  padding: 4px 8px;
  border: 1px solid rgba(37, 109, 106, 0.22);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 850;
}

.account-actions {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto auto;
  align-items: end;
  gap: 10px;
}

.danger-btn {
  min-width: 112px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(185, 74, 72, 0.35);
  border-radius: 8px;
  background: var(--red-soft);
  color: #7d2d2b;
  font-weight: 850;
}

.danger-btn:hover {
  border-color: rgba(185, 74, 72, 0.62);
  color: #5f211f;
}

.compact-field {
  gap: 5px;
}

.compact-field input {
  min-height: 40px;
}

.dashboard-shell {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
}

.dashboard-role {
  min-width: 150px;
}

.dashboard-role strong {
  font-size: 1.34rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-card {
  min-height: 132px;
  box-shadow: none;
}

.dashboard-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.dashboard-card strong {
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: clamp(1.28rem, 2.2vw, 1.72rem);
}

.dashboard-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-actions a {
  text-decoration: none;
}

.dashboard-tips .reader-card {
  min-height: 150px;
}

.dashboard-tool-section {
  padding-top: 4px;
}

.brainspot-launch {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(190px, 0.65fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 184px;
  padding: 24px;
  border: 1px solid rgba(37, 109, 106, 0.24);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.brainspot-launch:hover {
  border-color: rgba(37, 109, 106, 0.48);
  transform: translateY(-2px);
}

.brainspot-launch span {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brainspot-launch h3 {
  margin: 6px 0 8px;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
}

.brainspot-launch p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.brainspot-launch ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  list-style: none;
}

.brainspot-launch li::before {
  content: "•";
  margin-right: 9px;
  color: var(--amber);
  font-weight: 950;
}

.brainspot-launch > strong {
  color: var(--teal);
  white-space: nowrap;
}

.module-shell {
  display: grid;
  gap: 22px;
}

.module-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 186px;
  padding: 26px;
  border: 1px solid rgba(37, 109, 106, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 239, 0.78) 62%, rgba(255, 248, 232, 0.7));
  box-shadow: var(--shadow);
}

.module-hero h2 {
  max-width: 760px;
  margin: 8px 0 10px;
  font-size: clamp(1.45rem, 2.8vw, 2.25rem);
  line-height: 1.12;
}

.module-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

.module-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(37, 109, 106, 0.12);
}

.module-status.compact {
  font-size: 0.72rem;
}

.module-status.compact i {
  width: 7px;
  height: 7px;
}

.module-section {
  padding: 8px 0 4px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.section-heading-row span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading-row h2 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.section-heading-row p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.module-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.module-card {
  display: grid;
  gap: 14px;
  min-height: 310px;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.module-card-head,
.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.module-card-identity {
  display: grid;
  gap: 3px;
}

.module-code {
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 950;
}

.module-category {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.module-card h3 {
  max-width: 580px;
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.22;
}

.module-card > p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.module-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.module-metrics span {
  color: var(--muted);
  font-size: 0.85rem;
}

.module-metrics strong {
  color: var(--ink);
}

.module-card-footer {
  align-items: end;
  margin-top: auto;
}

.module-card-footer > span {
  max-width: 66%;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.module-open-link,
.module-feature-link,
.text-link {
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

.module-open-link:hover,
.module-feature-link:hover,
.text-link:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.module-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.module-feature-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  min-height: 188px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.module-feature-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.module-feature-card h3 {
  margin: 7px 0 8px;
  font-size: 1.15rem;
}

.module-feature-card p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.module-feature-link {
  flex: 0 0 auto;
}

.module-topics-panel {
  box-shadow: none;
}

.module-topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-topic-list span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.module-card.is-compact {
  min-height: 285px;
}

.catalog-preview-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.module-catalog-shell {
  display: grid;
  gap: 22px;
}

.catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 0 4px;
}

.catalog-heading > div:first-child > span {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.catalog-heading h2 {
  margin: 5px 0 8px;
  font-size: 1.9rem;
}

.catalog-heading p,
.empty-catalog p {
  margin: 0;
  color: var(--muted);
}

.catalog-count {
  display: grid;
  min-width: 92px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.catalog-count strong {
  font-size: 1.7rem;
}

.catalog-count span {
  color: var(--muted);
  font-size: 0.78rem;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) minmax(170px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  box-shadow: none;
}

.catalog-toolbar .secondary-btn {
  min-height: 44px;
  white-space: nowrap;
}

.catalog-results {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.empty-catalog {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 42px 20px;
  text-align: center;
  box-shadow: none;
}

.dashboard-lower-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.account-summary,
.activity-summary {
  box-shadow: none;
}

.account-summary p,
.activity-summary p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}

.exam-shell {
  display: grid;
  gap: 18px;
}

.exam-hero {
  grid-template-columns: minmax(0, 1fr) minmax(140px, auto);
}

.exam-time-toggle {
  align-items: center;
  min-height: 54px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.exam-command-panel {
  box-shadow: none;
}

.exam-command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.exam-command-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.exam-command-card span,
.exam-toolbar span,
.exam-task-head span {
  display: block;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.exam-command-card h3 {
  margin: 5px 0 6px;
  font-size: 1.18rem;
}

.exam-command-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.exam-command-card ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.exam-command-card li {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.exam-focus {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.exam-focus span {
  min-height: 28px;
  padding: 6px 9px;
  border: 1px solid rgba(37, 109, 106, 0.22);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--teal);
  font-size: 0.74rem;
}

.exam-command-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.exam-workspace {
  display: grid;
  gap: 18px;
}

.exam-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.exam-toolbar h2 {
  margin: 6px 0 8px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.exam-toolbar p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.exam-status {
  display: grid;
  gap: 8px;
  min-width: 150px;
  text-align: right;
}

.exam-status strong {
  color: var(--teal);
  font-size: 1.34rem;
}

.exam-status span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.exam-result {
  padding: 14px 16px;
  border: 1px solid rgba(37, 109, 106, 0.26);
  border-radius: 8px;
  background: var(--green-soft);
}

.exam-result strong {
  color: var(--teal);
}

.exam-result p {
  margin: 7px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.exam-task-list {
  display: grid;
  gap: 14px;
}

.exam-task {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.exam-task.is-correct {
  border-color: rgba(37, 109, 106, 0.35);
  background: rgba(232, 243, 239, 0.78);
}

.exam-task.is-partial {
  border-color: rgba(194, 138, 29, 0.38);
  background: #fff8e8;
}

.exam-task.is-wrong {
  border-color: rgba(185, 74, 72, 0.32);
  background: var(--red-soft);
}

.exam-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.exam-task-head h3 {
  margin: 6px 0 0;
  font-size: 1.04rem;
  line-height: 1.35;
}

.exam-task-head > strong {
  min-width: 54px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  text-align: center;
}

.exam-answer-options,
.exam-order {
  display: grid;
  gap: 9px;
}

.exam-numeric,
.exam-short {
  margin-top: 6px;
}

.exam-written textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font: inherit;
  line-height: 1.5;
}

.exam-written textarea:focus {
  outline: 3px solid rgba(37, 109, 106, 0.18);
  border-color: var(--teal);
}

.exam-solution {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(37, 109, 106, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.exam-solution p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.exam-solution span {
  color: var(--muted);
  font-weight: 850;
}

.visual-lab {
  display: grid;
  gap: 18px;
}

.interactive-script {
  display: grid;
  gap: 18px;
}

#analysisVisualSections,
#analysisScriptSections {
  display: grid;
  gap: 18px;
}

.analysis-source-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.analysis-source-band a {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 15px 17px;
  border-right: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.analysis-source-band a:last-child {
  border-right: 0;
}

.analysis-source-band a:hover {
  background: var(--green-soft);
}

.analysis-source-band strong,
.analysis-source-band span {
  overflow-wrap: anywhere;
}

.analysis-source-band span {
  color: var(--muted);
  font-size: 0.78rem;
}

.script-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(37, 109, 106, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 243, 239, 0.76));
  box-shadow: var(--shadow);
}

.script-hero span,
.reader-head span {
  display: block;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.script-hero h2 {
  margin: 5px 0 8px;
  font-size: clamp(1.45rem, 2.7vw, 2.15rem);
}

.script-hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.55;
}

.pdf-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 246, 244, 0.94);
  backdrop-filter: blur(12px);
}

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}

.chapter-nav a:hover {
  border-color: rgba(37, 109, 106, 0.42);
  color: var(--teal);
}

.reader-section {
  scroll-margin-top: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reader-head {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.reader-head h2 {
  margin: 5px 0 8px;
  font-size: clamp(1.3rem, 2.3vw, 1.85rem);
}

.reader-head p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  font-weight: 620;
  line-height: 1.58;
}

.reader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
}

.analysis-reader-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reader-card {
  min-height: 190px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.reader-card:last-child {
  border-right: 0;
}

.reader-card h3 {
  margin-bottom: 9px;
  color: var(--teal);
  font-size: 1rem;
}

.reader-card p,
.reader-card li {
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.55;
}

.reader-card ul,
.reader-card ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.formula-chip {
  display: inline-flex;
  max-width: 100%;
  margin-top: 8px !important;
  padding: 8px 10px;
  border: 1px solid rgba(194, 138, 29, 0.34);
  border-radius: 8px;
  background: #fff8e8;
  color: #7a560f !important;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem !important;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.script-workbench {
  border-top: 0;
}

.flow-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.flow-strip div {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.flow-strip span,
.visual-section-head span {
  display: block;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.flow-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 1.05rem;
}

.flow-strip small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.script-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(37, 109, 106, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(232, 243, 239, 0.72));
}

.script-intro p {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 680;
  line-height: 1.58;
}

.visual-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 251, 0.84);
}

.visual-section-head h2 {
  margin: 5px 0 0;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.16;
}

.visual-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.visual-tags span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.76rem;
}

.script-copy {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.script-copy p {
  margin: 0;
  min-height: 142px;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 560;
  line-height: 1.58;
}

.script-copy p:last-child {
  border-right: 0;
}

.script-copy strong {
  display: block;
  margin-bottom: 7px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0;
}

.demo-canvas {
  display: block;
  width: 100%;
  height: 360px;
  background: #fff;
}

.demo-controls {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: #fbfcfb;
}

.demo-controls .field {
  gap: 9px;
}

.demo-controls input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.demo-controls select {
  width: 100%;
}

.demo-controls output {
  justify-self: start;
  min-width: 54px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 900;
}

.mci-action-field {
  display: grid;
  gap: 9px;
}

.mci-action-field .secondary-btn {
  width: 100%;
  min-height: 42px;
}

.mci-reaction-status {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Brain Spot */
.brain-shell {
  display: grid;
  gap: 16px;
}

.brain-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.78fr);
  align-items: center;
  gap: 28px;
  min-height: 176px;
  padding: 26px;
  border: 1px solid rgba(37, 109, 106, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.brain-hero > div:first-child > span,
.brain-pane-head span,
.brain-relations > div > span,
.brain-board-inspector > span,
.brain-board-inspector-form > span,
.brain-board-inspector-empty > span {
  display: block;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brain-hero h2 {
  margin: 7px 0 9px;
  font-size: clamp(1.45rem, 2.6vw, 2.15rem);
  line-height: 1.12;
}

.brain-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.brain-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(76px, 1fr));
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.brain-summary div {
  min-width: 0;
  padding: 17px 12px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.brain-summary div:last-child {
  border-right: 0;
}

.brain-summary strong,
.brain-summary span {
  display: block;
}

.brain-summary strong {
  color: var(--teal);
  font-size: 1.42rem;
}

.brain-summary span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brain-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.brain-tab {
  min-height: 38px;
  padding: 0 15px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.brain-tab:hover,
.brain-tab[aria-pressed="true"] {
  background: var(--green-soft);
  color: var(--teal-dark);
}

#brainMessage[data-tone="success"] {
  border-color: rgba(37, 109, 106, 0.24);
  background: var(--green-soft);
  color: var(--teal-dark);
}

.brain-view {
  min-width: 0;
  min-height: 550px;
  overflow: hidden;
  box-shadow: none;
}

.brain-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  padding: 0;
}

.brain-note-browser,
.brain-note-editor,
.brain-dump-form,
.brain-dump-history,
.brain-tracker-form,
.brain-trackers {
  min-width: 0;
}

.brain-note-browser {
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.brain-pane-head,
.brain-editor-footer,
.brain-file-item,
.brain-tracker-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brain-pane-head {
  margin-bottom: 16px;
}

.brain-pane-head strong {
  display: block;
  margin-top: 3px;
}

.compact-btn {
  min-width: 0;
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.brain-search-field {
  margin-bottom: 13px;
}

.brain-note-list {
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: 610px;
  overflow: auto;
  padding-right: 3px;
}

.brain-note-row {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 90px;
  padding: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brain-note-row:hover {
  border-color: var(--line);
  background: #fff;
}

.brain-note-row.is-selected,
.brain-note-row[aria-pressed="true"] {
  border-color: rgba(37, 109, 106, 0.36);
  background: var(--green-soft);
}

.brain-note-row-head,
.brain-note-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.brain-note-row-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-note-row-head small,
.brain-note-row-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.brain-note-row-head small {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.brain-note-row-head small[data-status="active"] {
  border-color: rgba(76, 111, 159, 0.28);
  color: #36577f;
}

.brain-note-row-head small[data-status="done"] {
  border-color: rgba(37, 109, 106, 0.28);
  color: var(--teal-dark);
}

.brain-note-preview {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-note-editor {
  min-height: 550px;
  padding: 22px;
  background: #fff;
}

.brain-empty-state,
.brain-empty {
  display: grid;
  place-content: center;
  min-height: 200px;
  color: var(--muted);
  text-align: center;
}

.brain-empty-state {
  min-height: 500px;
}

.brain-empty-state strong {
  color: var(--ink);
  font-size: 1.15rem;
}

.brain-empty-state p,
.brain-empty p {
  margin: 6px 0 0;
}

.brain-note-form {
  display: grid;
  gap: 16px;
}

.brain-editor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 12px;
}

.brain-title-field input {
  font-size: 1.05rem;
  font-weight: 800;
}

.brain-body-field textarea,
.brain-dump-field textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 13px;
  font: inherit;
  line-height: 1.55;
}

.brain-body-field textarea {
  min-height: 260px;
}

.brain-dump-field textarea {
  min-height: 310px;
}

.brain-body-field textarea:focus,
.brain-dump-field textarea:focus {
  outline: 3px solid rgba(37, 109, 106, 0.18);
  border-color: var(--teal);
}

.brain-relations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-top: 2px;
}

.brain-link-options,
.brain-backlinks {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 7px;
  min-height: 46px;
  max-height: 150px;
  margin-top: 9px;
  overflow: auto;
}

.brain-link-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 750;
}

.brain-link-choice input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal);
}

.brain-backlink {
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(76, 111, 159, 0.28);
  background: rgba(76, 111, 159, 0.08);
  color: #36577f;
  font-size: 0.8rem;
  font-weight: 800;
}

.brain-editor-footer {
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.brain-editor-footer > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.brain-editor-footer > div,
.brain-dump-item > div,
.brain-file-item > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brain-board-view {
  padding: 0;
}

.brain-board-head {
  min-height: 76px;
  margin: 0;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.brain-board-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.brain-board-actions [aria-pressed="true"] {
  border-color: rgba(37, 109, 106, 0.42);
  background: var(--green-soft);
  color: var(--teal-dark);
}

.brain-board-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 248px;
  min-height: 648px;
}

.brain-board-palette {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.brain-board-palette-head {
  margin-bottom: 5px;
}

.brain-board-palette-head span,
.brain-board-palette-head strong {
  display: block;
}

.brain-board-palette-head span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.brain-board-palette-head strong {
  margin-top: 4px;
}

.brain-block-template {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: grab;
}

.brain-block-template[data-board-template="task"] {
  border-left-color: var(--blue);
}

.brain-block-template[data-board-template="keypoint"] {
  border-left-color: var(--teal);
}

.brain-block-template:hover {
  border-color: rgba(37, 109, 106, 0.42);
}

.brain-block-template.is-dragging {
  opacity: 0.55;
}

.brain-block-template span {
  color: var(--muted);
  font-size: 0.75rem;
}

.brain-board-stage-wrap {
  min-width: 0;
  overflow: auto;
  padding: 12px;
  background: #eef2ef;
}

.brain-board-stage {
  position: relative;
  width: max(100%, 720px);
  height: 620px;
  overflow: hidden;
  border: 1px solid #cfd8d3;
  border-radius: 8px;
  background-color: #fbfcfb;
  background-image:
    linear-gradient(rgba(102, 113, 116, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 113, 116, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.brain-board-stage.is-drop-target {
  border-color: var(--teal);
  background-color: var(--green-soft);
}

.brain-board-connections,
.brain-board-cards {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brain-board-connections {
  z-index: 1;
  pointer-events: none;
}

.brain-board-connections line {
  stroke: #aab7b2;
  stroke-width: 2;
}

.brain-board-connections line.is-active {
  stroke: var(--teal);
  stroke-width: 3;
}

.brain-board-cards {
  z-index: 2;
  pointer-events: none;
}

.brain-board-card {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(46px, 1fr) auto auto;
  gap: 9px;
  width: 210px;
  min-height: 150px;
  padding: 11px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--amber);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(25, 35, 38, 0.11);
  pointer-events: auto;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.brain-board-card[data-status="active"] {
  border-top-color: var(--blue);
}

.brain-board-card[data-status="done"] {
  border-top-color: var(--teal);
}

.brain-board-card[aria-selected="true"] {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37, 109, 106, 0.16), 0 12px 26px rgba(25, 35, 38, 0.14);
}

.brain-board-card.is-dragging {
  z-index: 5;
  box-shadow: 0 18px 34px rgba(25, 35, 38, 0.2);
}

.brain-board-card-handle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: grab;
  touch-action: none;
}

.brain-board-card-handle:active {
  cursor: grabbing;
}

.brain-board-card-handle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-board-grip {
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0;
}

.brain-board-card > p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.brain-board-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.brain-board-card-meta span,
.brain-board-card-meta small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-board-card-meta span {
  font-weight: 850;
}

.brain-board-open {
  justify-self: end;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 850;
}

.brain-board-empty {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  min-width: 180px;
  transform: translate(-50%, -50%);
  border: 1px dashed rgba(37, 109, 106, 0.46);
  background: var(--green-soft);
  color: var(--teal-dark);
  font-weight: 850;
}

.brain-board-inspector {
  min-width: 0;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: #fff;
}

.brain-board-inspector-empty strong {
  display: block;
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.brain-board-inspector-form {
  display: grid;
  gap: 13px;
}

.brain-board-body-field textarea {
  width: 100%;
  min-height: 178px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 10px;
  font: inherit;
  line-height: 1.5;
}

.brain-board-body-field textarea:focus {
  outline: 3px solid rgba(37, 109, 106, 0.18);
  border-color: var(--teal);
}

.brain-board-inspector-form > small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.brain-board-inspector-actions {
  display: grid;
  gap: 8px;
}

.brain-board-inspector-actions .primary-btn,
.brain-board-inspector-actions .secondary-btn {
  width: 100%;
}

.brain-dump-layout,
.brain-progress-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 0;
  min-height: 506px;
}

.brain-dump-form,
.brain-tracker-form {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.brain-dump-history,
.brain-trackers {
  padding: 24px;
}

.brain-dump-list,
.brain-file-list,
.brain-tracker-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.brain-dump-item,
.brain-file-item,
.brain-tracker-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.brain-dump-item > span,
.brain-file-item span,
.brain-tracker-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.brain-dump-item p {
  margin: 8px 0 13px;
  overflow-wrap: anywhere;
  color: var(--ink);
  line-height: 1.5;
  white-space: pre-wrap;
}

.brain-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px dashed rgba(37, 109, 106, 0.4);
  border-radius: 8px;
  background: var(--green-soft);
}

.brain-upload-form small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.brain-file-item {
  min-height: 72px;
}

.brain-file-item > div:first-child {
  min-width: 0;
}

.brain-file-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brain-file-item span {
  margin-top: 5px;
}

.brain-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  text-decoration: none;
}

.brain-tracker-fields {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(130px, 1fr);
  gap: 10px;
}

.brain-tracker-item {
  display: grid;
  gap: 13px;
}

.brain-tracker-item > div:first-child > div {
  min-width: 0;
}

.brain-tracker-item > div:first-child > div strong {
  display: block;
  overflow-wrap: anywhere;
}

.brain-tracker-item > div:first-child span {
  margin-top: 4px;
}

.brain-tracker-percent {
  flex: 0 0 auto;
  color: var(--teal);
}

.brain-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 8px;
  background: #e5eae7;
}

.brain-progress-track div {
  height: 100%;
  border-radius: 8px;
  background: var(--teal);
  transition: width 180ms ease;
}

.brain-tracker-actions {
  display: grid;
  grid-template-columns: 40px minmax(80px, 120px) 40px minmax(90px, auto);
  align-items: center;
  gap: 8px;
}

.brain-tracker-actions input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 9px;
  text-align: center;
}

.brain-tracker-actions .compact-btn {
  width: 40px;
  padding: 0;
  font-size: 1rem;
}

.brain-page .brain-view[hidden] {
  display: none;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 920px) {
  .topbar,
  .visual-band,
  .setup-grid,
  .auth-card,
  .admin-grid,
  .account-form,
  .account-item,
  .exam-hero,
  .exam-command-grid,
  .script-intro,
  .script-copy,
  .script-hero,
  .reader-grid,
  .visual-workbench,
  .question-head,
  .result-hero,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .module-hero,
  .module-catalog,
  .module-feature-grid,
  .dashboard-lower-grid,
  .brainspot-launch,
  .brain-hero,
  .brain-workspace,
  .brain-board-layout,
  .brain-dump-layout,
  .brain-progress-layout {
    grid-template-columns: 1fr;
  }

  .analysis-source-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analysis-source-band a:nth-child(2) {
    border-right: 0;
  }

  .analysis-source-band a:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .catalog-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-search-field {
    grid-column: 1 / -1;
  }

  .brain-note-browser,
  .brain-dump-form,
  .brain-tracker-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brainspot-launch {
    align-items: start;
  }

  .brainspot-launch > strong {
    white-space: normal;
  }

  .brain-note-list {
    max-height: 330px;
  }

  .brain-note-editor,
  .brain-empty-state {
    min-height: 390px;
  }

  .brain-board-palette {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brain-board-palette-head {
    grid-column: 1 / -1;
  }

  .brain-board-inspector {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .topbar,
  .question-head,
  .result-hero,
  .visual-section-head {
    display: grid;
  }

  .top-stats,
  .dashboard-grid,
  .control-grid,
  .check-grid,
  .check-grid.compact {
    grid-template-columns: 1fr 1fr;
  }

  .chips {
    justify-content: flex-start;
  }

  .app-nav,
  .visual-tags {
    justify-content: flex-start;
  }

  .section-heading-row {
    align-items: start;
  }

  .reader-card {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reader-card:last-child {
    border-bottom: 0;
  }

  .demo-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .account-actions {
    grid-template-columns: minmax(160px, 1fr) auto auto auto;
  }

  .exam-toolbar,
  .exam-task-head {
    display: grid;
  }

  .exam-status {
    text-align: left;
  }

  .script-copy p {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .script-copy p:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .topbar,
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .top-stats,
  .dashboard-grid,
  .control-grid,
  .account-actions,
  .exam-command-card ul,
  .check-grid,
  .check-grid.compact,
  .flow-strip,
  .chapter-nav,
  .demo-controls {
    grid-template-columns: 1fr;
  }

  .catalog-heading {
    display: grid;
    align-items: start;
  }

  .catalog-count {
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-search-field {
    grid-column: auto;
  }

  .analysis-source-band {
    grid-template-columns: 1fr;
  }

  .analysis-source-band a,
  .analysis-source-band a:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .analysis-source-band a:last-child {
    border-bottom: 0;
  }

  .panel,
  .visual-band {
    padding: 16px;
  }

  .module-hero,
  .module-card,
  .module-feature-card {
    padding: 16px;
  }

  .module-feature-card,
  .module-card-head,
  .module-card-footer,
  .section-heading-row,
  .brain-editor-head,
  .brain-relations,
  .brain-upload-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brain-hero,
  .brain-note-editor,
  .brain-dump-form,
  .brain-dump-history,
  .brain-tracker-form,
  .brain-trackers,
  .brain-board-inspector {
    padding: 16px;
  }

  .brain-board-head {
    display: grid;
    align-items: stretch;
  }

  .brain-board-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .brain-board-actions .secondary-btn {
    width: 100%;
  }

  .brain-board-palette {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .brain-board-palette-head {
    grid-column: auto;
  }

  .brain-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brain-summary div:nth-child(2) {
    border-right: 0;
  }

  .brain-summary div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .brain-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brain-tab:last-child {
    grid-column: 1 / -1;
  }

  .brain-pane-head,
  .brain-editor-footer,
  .brain-file-item {
    align-items: stretch;
  }

  .brain-editor-footer,
  .brain-file-item {
    display: grid;
  }

  .brain-editor-footer > div,
  .brain-file-item > div:last-child {
    justify-content: stretch;
  }

  .brain-editor-footer button,
  .brain-file-item a,
  .brain-file-item button {
    flex: 1 1 130px;
  }

  .brain-upload-form small {
    grid-column: auto;
  }

  .brain-tracker-actions {
    grid-template-columns: 40px minmax(70px, 1fr) 40px;
  }

  .brain-tracker-actions .ghost-btn {
    grid-column: 1 / -1;
  }

  .brain-board-stage {
    height: 540px;
  }

  .module-card-footer > span {
    max-width: none;
  }

  .script-intro,
  .script-copy p,
  .script-hero,
  .reader-head,
  .reader-card {
    padding: 16px;
  }

  .chapter-nav {
    position: static;
    display: grid;
  }

  .chapter-nav a {
    justify-content: center;
  }

  .demo-canvas {
    height: 310px;
  }

  .visual-section-head {
    padding: 16px;
  }

  .action-row,
  .action-row.split {
    display: grid;
    justify-items: stretch;
  }

  .action-row.split > div {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .source-line {
    grid-template-columns: 1fr;
  }

  .order-row {
    grid-template-columns: 1fr;
  }
}

body[data-module-id="software-qualitaetssicherung"] .demo-canvas,
body[data-module-id="mensch-computer-interaktion"] .demo-canvas,
body[data-module-id="datenstrukturen-algorithmen"] .demo-canvas {
  height: 360px;
}
