.guided-module {
  --guide-blue: #dff2f7;
  --guide-blue-line: #8fc8d6;
}

.guided-stage,
.guided-summary {
  scroll-margin-top: 152px;
}

[data-just-opened="true"] {
  animation: guided-stage-in 240ms ease both;
}

@keyframes guided-stage-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.guided-task {
  margin: 12px 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  border: 2px solid var(--guide-blue-line);
  border-radius: 18px;
  background: var(--guide-blue);
  scroll-margin-top: 152px;
}

.guided-task.guided-final-task {
  margin-top: 18px;
  border-color: var(--guide-blue-line);
  background: var(--guide-blue);
  box-shadow: 0 12px 28px rgba(73, 123, 142, 0.12);
}

.guided-final-task .guided-task-number {
  background: var(--ink);
}

.guided-final-task h2::before {
  content: "Zum Abschluss · ";
  color: var(--blue);
  font-size: 0.76em;
  font-weight: 900;
  letter-spacing: 0.025em;
}

.guided-exchange {
  margin-top: 10px !important;
  font-weight: 800;
}

.guided-task-tools {
  display: grid;
  gap: 7px;
}

.guided-restart-button {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.guided-restart-button:hover,
.guided-restart-button:focus-visible {
  color: var(--ink);
}

.guided-task-number {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.guided-task h2 {
  margin: 0 0 5px;
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

.guided-task p,
.guided-task ol {
  margin: 0;
}

.guided-task ol {
  padding-left: 1.3rem;
}

.guided-task li + li {
  margin-top: 4px;
}

.guided-task-status {
  width: fit-content;
  margin-top: 10px !important;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.guided-task-status[data-ready="true"] {
  background: var(--green-soft);
  color: var(--green-dark);
}

.guided-actions {
  margin: 12px 0 18px;
  display: flex;
  justify-content: flex-end;
}

.guided-actions .button {
  min-height: 46px;
}

.guided-actions .button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.48;
}

.guided-summary {
  margin-bottom: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #b9dc8d;
  border-radius: 16px;
  background: var(--green-soft);
}

.guided-summary > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.guided-summary p {
  margin: 0;
}

.guided-checkmark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--ink);
  font-weight: 950;
}

.guided-check {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--guide-blue-line);
  border-radius: 16px;
  background: var(--guide-blue);
}

.guided-check fieldset {
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
  border: 0;
}

.guided-check legend {
  margin-bottom: 9px;
  font-weight: 900;
}

.guided-check label {
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
}

.guided-check label:has(input:checked) {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(85, 153, 170, 0.14);
}

.guided-check input {
  margin-top: 0.3em;
}

.guided-feedback {
  min-height: 1.5em;
  margin: 0 0 10px;
  color: #923b2f;
  font-weight: 800;
}

.guided-feedback[data-correct="true"] {
  color: var(--green-dark);
}

.parameter-explanation {
  margin: 13px 0 -7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.guided-module #experimentStage {
  scroll-margin-top: 152px;
}

.guided-module #trainingMetrics:not([hidden]) {
  margin-bottom: 14px;
}

.guided-module #trainingMetrics:has(.guided-deep-detail[hidden]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guided-module #trainingMetrics:has(.guided-deep-detail:not([hidden])) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-explanation {
  margin: -4px 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--blue);
  border-radius: 0 12px 12px 0;
  background: var(--blue-soft);
  color: var(--muted);
  font-size: 0.84rem;
}

.metric-explanation strong {
  color: var(--ink);
}

.analysis-steps {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.analysis-steps section {
  padding: 12px;
  border: 1px solid var(--guide-blue-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.analysis-steps h3 {
  margin: 0 0 5px;
  font-size: 0.88rem;
}

.analysis-steps p {
  font-size: 0.86rem;
}

@media (max-width: 800px) {
  .guided-task {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .guided-task-tools {
    width: fit-content;
  }

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

@media (max-width: 600px) {
  .guided-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .guided-summary .button,
  .guided-actions .button,
  .guided-check .button {
    width: 100%;
    justify-content: center;
  }

  .guided-task {
    padding: 13px;
  }

  .guided-module #trainingMetrics:has(.guided-deep-detail[hidden]),
  .guided-module #trainingMetrics:has(.guided-deep-detail:not([hidden])) {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-just-opened="true"] {
    animation: none;
  }
}
