:root {
  color-scheme: dark;
  --bg: #061723;
  --surface: #0d2433;
  --surface-elevated: #123044;
  --surface-soft: #102b3d;
  --ink: #e9fbff;
  --muted: #9ec1cc;
  --line: rgba(93, 219, 230, 0.24);
  --accent: #22d3c5;
  --accent-strong: #4fe8ff;
  --gold: #e2a93b;
  --rose: #d6657a;
  --blue: #2f8fff;
  --shadow: 0 22px 56px rgba(0, 10, 18, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 197, 0.18), transparent 34%),
    linear-gradient(135deg, #04101b 0%, #082034 48%, #06383f 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1520px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  background: rgba(5, 18, 30, 0.72);
  backdrop-filter: blur(16px);
}

.workspace {
  padding: 26px clamp(18px, 3vw, 42px) 42px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-elevated);
  box-shadow: var(--shadow);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand h1 {
  font-size: 1.35rem;
}

.brand p,
.step-heading p,
.result-empty p,
.info-box p,
.answer-card p,
.history-item p {
  color: var(--muted);
  line-height: 1.45;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 36, 51, 0.92);
  box-shadow: var(--shadow);
}

.profile-panel,
.guide-panel,
.memory-panel,
.credit-panel,
.decision-summary,
.step-card {
  padding: 18px;
}

.guide-panel h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.guide-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 0;
  color: var(--muted);
  line-height: 1.35;
  font-weight: 650;
  list-style: none;
  counter-reset: guide;
}

.guide-panel li {
  counter-increment: guide;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: center;
}

.guide-panel li::before {
  content: counter(guide);
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
}

.sidebar .panel + .panel {
  margin-top: 16px;
}

.compact-heading {
  margin-bottom: 10px;
}

.credit-panel > strong {
  display: block;
  color: var(--ink);
  font-size: 1.35rem;
}

.credit-panel p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.credit-rules {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.redeem-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.redeem-form .secondary-button {
  width: 100%;
}

.redeem-message {
  min-height: 18px;
  font-size: 0.78rem;
}

.credit-gate {
  border: 1px solid rgba(34, 211, 197, 0.34);
  border-radius: 10px;
  background: rgba(9, 78, 88, 0.26);
  padding: 18px;
}

.credit-gate p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.credit-gate a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #087ee1, #08aebd);
  color: #fff;
  padding: 0 14px;
  font-weight: 850;
  text-decoration: none;
}

.credit-rules span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.panel-heading,
.decision-header,
.step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading h2,
.decision-summary h3 {
  font-size: 1rem;
}

.decision-header {
  margin-bottom: 18px;
}

.decision-header h2 {
  max-width: 760px;
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  letter-spacing: 0;
}

.header-tools {
  display: flex;
  align-items: end;
  gap: 10px;
}

.info-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--accent-strong);
  padding: 0 12px;
  font-weight: 850;
}

.language-switch {
  display: grid;
  gap: 6px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.language-switch select {
  min-height: 38px;
  padding: 8px 10px;
}

.eyebrow,
.score-label {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.89rem;
  font-weight: 750;
}

label + label,
.two-col,
.weight-grid,
.extra-input {
  margin-top: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-elevated);
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 197, 0.16);
}

input[type="range"] {
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 143, 255, 0.78), rgba(34, 211, 197, 0.92));
  box-shadow: inset 0 0 0 1px rgba(233, 251, 255, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7px;
  border: 3px solid #e9fbff;
  border-radius: 999px;
  background: linear-gradient(135deg, #22d3c5, #2f8fff);
  box-shadow: 0 8px 20px rgba(0, 10, 18, 0.42);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 143, 255, 0.78), rgba(34, 211, 197, 0.92));
  box-shadow: inset 0 0 0 1px rgba(233, 251, 255, 0.1);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #e9fbff;
  border-radius: 999px;
  background: linear-gradient(135deg, #22d3c5, #2f8fff);
  box-shadow: 0 8px 20px rgba(0, 10, 18, 0.42);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 650;
}

.icon-button,
.secondary-button,
.primary-button {
  border-radius: 8px;
  font-weight: 800;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--accent-strong);
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 16px;
}

.primary-button {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: linear-gradient(135deg, #087ee1, #08aebd);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--accent-strong);
}

.flow-cancel {
  width: 100%;
  margin-top: 10px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.step-chip {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 36, 51, 0.76);
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 8px;
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
}

.step-chip.active {
  background: linear-gradient(135deg, #087ee1, #08aebd);
  border-color: transparent;
  color: #fff;
}

.step-chip.done {
  color: var(--accent-strong);
  border-color: rgba(34, 211, 197, 0.45);
}

.flow-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 18px;
  align-items: start;
}

.flow-main {
  display: grid;
  gap: 16px;
  max-width: 920px;
}

.step-card {
  display: none;
}

.step-card.active {
  display: block;
}

.step-heading {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 900;
}

.two-col,
.weight-grid,
.score-strip {
  display: grid;
  gap: 12px;
}

.two-col,
.score-strip {
  grid-template-columns: 1fr 1fr;
}

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

.weight-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 12px;
  gap: 10px;
}

.weight-item span {
  color: var(--ink);
}

.weight-item small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.weight-endpoints {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
}

.weight-endpoints em {
  max-width: 46%;
  font-style: normal;
  overflow-wrap: anywhere;
}

.thinking-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 16px;
}

.thinking-box p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.thinking-dots {
  display: inline-flex;
  gap: 6px;
  flex: 0 0 auto;
}

.thinking-dots span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse-dot 1.05s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes pulse-dot {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.86);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px) scale(1);
  }
}

.question-card,
.info-box,
.api-notice,
.answer-card,
.analysis-card,
.warning-box,
.score-strip > div,
.history-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 16px;
}

.api-notice {
  margin-bottom: 14px;
  border-color: rgba(214, 101, 122, 0.5);
  background: rgba(74, 22, 39, 0.45);
}

.api-notice p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.question-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.follow-up-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.suggestion-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.suggestion-header,
.suggestion-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 12px;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.suggestion-header span,
.suggestion-item small {
  color: var(--muted);
  font-weight: 700;
}

.suggestion-item {
  border-color: rgba(34, 211, 197, 0.4);
  background: rgba(9, 78, 88, 0.32);
}

.suggestion-item p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.4;
}

.suggestion-item small {
  display: block;
  margin-top: 8px;
}

.field-assessment-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.field-assessment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 10px 12px;
}

.field-assessment span {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.field-assessment.fehlt span {
  background: rgba(226, 169, 59, 0.18);
  color: #f5cf80;
}

.field-assessment.unklar span {
  background: rgba(47, 143, 255, 0.18);
  color: #9bc9ff;
}

.follow-up-item {
  border: 1px solid rgba(34, 211, 197, 0.34);
  border-radius: 10px;
  background: rgba(9, 78, 88, 0.28);
  padding: 12px;
}

.decision-summary {
  position: sticky;
  top: 20px;
}

.summary-assessments {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.summary-assessments h3 {
  font-size: 1rem;
}

.decision-summary dd {
  overflow-wrap: anywhere;
}

.decision-summary dl {
  display: grid;
  gap: 14px;
  margin: 14px 0 0;
}

.decision-summary div {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.decision-summary dt {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.decision-summary dd {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.result-content {
  display: grid;
  gap: 12px;
}

.result-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 260px;
  gap: 12px;
  text-align: center;
}

.decision-orbit {
  position: relative;
  width: min(180px, 48vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(13, 36, 51, 0.95) 0 30%, transparent 31%),
    conic-gradient(from 20deg, var(--accent), var(--gold), var(--blue), var(--rose), var(--accent));
  box-shadow: inset 0 0 0 16px rgba(233, 251, 255, 0.12), var(--shadow);
}

.decision-orbit span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.decision-orbit span:nth-child(1) {
  left: 32px;
  top: 42px;
}

.decision-orbit span:nth-child(2) {
  right: 34px;
  top: 62px;
}

.decision-orbit span:nth-child(3) {
  left: 82px;
  bottom: 28px;
}

.answer-card h3,
.warning-box h3 {
  margin-top: 8px;
  font-size: 1.35rem;
}

.result-source {
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  padding: 5px 9px;
  font-weight: 850;
}

.score-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 1.25rem;
}

.analysis-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.pros-cons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pro-card {
  border-color: rgba(34, 211, 197, 0.38);
  background: rgba(9, 78, 88, 0.3);
}

.con-card {
  border-color: rgba(214, 101, 122, 0.32);
  background: rgba(74, 22, 39, 0.34);
}

.analysis-card ul,
.warning-box ul,
.memory-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-row .secondary-button.selected {
  border-color: rgba(34, 211, 197, 0.75);
  background: linear-gradient(135deg, rgba(8, 126, 225, 0.95), rgba(8, 174, 189, 0.95));
  color: #fff;
  box-shadow: 0 10px 22px rgba(0, 10, 18, 0.28);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(2, 10, 18, 0.72);
  padding: 18px;
}

.modal-backdrop[hidden] {
  display: none;
}

.info-modal {
  width: min(760px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d2433;
  box-shadow: 0 28px 80px rgba(0, 10, 18, 0.58);
  padding: 18px;
}

.modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.modal-heading h2 {
  margin-top: 4px;
}

.icon-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 1.35rem;
}

.modal-content {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.modal-content article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-elevated);
  padding: 14px;
}

.modal-content h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.modal-content p {
  color: var(--muted);
  line-height: 1.5;
}

.pill {
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.memory-list {
  min-height: 72px;
  padding: 0 18px 16px 34px;
}

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

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.history-item strong {
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 980px) {
  .app-shell,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .decision-summary {
    position: static;
  }
}

@media (max-width: 680px) {
  .workspace,
  .sidebar {
    padding: 16px;
  }

  .decision-header,
  .two-col,
  .pros-cons-grid,
  .score-strip {
    display: grid;
    grid-template-columns: 1fr;
  }

  .stepper {
    width: 100%;
    min-width: 0;
  }

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

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