:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d6dde6;
  --panel: #ffffff;
  --page: #eef3f6;
  --teal: #2f6f73;
  --teal-dark: #244f55;
  --clay: #d85d3f;
  --blue: #315f9d;
  --amber: #b7791f;
  --green-soft: #e6f0ed;
  --blue-soft: #e8eef7;
  --clay-soft: #faebe7;
  --shadow: 0 18px 50px rgba(31, 41, 55, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
  max-width: 1220px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.context-panel {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #f9fbfc;
  border-right: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  background: #050505;
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.75rem, 2.5vw, 2.65rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.visual-board {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.visual-board svg {
  display: block;
  width: 100%;
  height: auto;
}

.mini-games {
  display: grid;
  gap: 12px;
  margin-top: auto;
}

.mini-games article {
  display: grid;
  grid-template-columns: 38px 1fr;
  column-gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.mini-games span {
  color: var(--clay);
  font-weight: 800;
}

.mini-games strong {
  font-size: .95rem;
}

.mini-games p {
  grid-column: 2;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
}

.quiz-panel {
  display: flex;
  flex-direction: column;
  padding: 32px;
  min-width: 0;
}

.quiz-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.progress-wrap {
  min-width: 150px;
  text-align: right;
}

#progress-text {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #e5ebf0;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--teal);
  transition: width .2s ease;
}

.quiz-card {
  display: grid;
  align-content: start;
  flex: 1;
  padding: 28px 0;
}

.question-kicker {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.6;
  max-width: 720px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.option-button {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  text-align: left;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.option-button:hover,
.option-button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 10px 26px rgba(47, 111, 115, .13);
  outline: none;
  transform: translateY(-1px);
}

.option-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--teal-dark);
}

.option-button:nth-child(2n) .option-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.option-button:nth-child(3n) .option-icon {
  background: var(--clay-soft);
  color: var(--clay);
}

.option-icon svg,
.icon-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.option-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.option-copy {
  display: block;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.45;
}

.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.icon-button,
.secondary-button,
.primary-button {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  color: var(--ink);
  background: #fff;
}

.secondary-button {
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  font-weight: 700;
}

.primary-button {
  padding: 0 18px;
  color: #fff;
  background: var(--teal);
  border-color: var(--teal);
  font-weight: 800;
}

.icon-button:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
  gap: 24px;
  align-items: start;
}

.result-hero {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
}

.result-label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--teal-dark);
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-hero h3 {
  margin-bottom: 12px;
  font-size: 1.8rem;
  line-height: 1.1;
}

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

.recommendations {
  display: grid;
  gap: 12px;
}

.model-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 6px;
  background: #fff;
}

.model-card:nth-child(2) {
  border-left-color: var(--blue);
}

.model-card:nth-child(3) {
  border-left-color: var(--clay);
}

.model-card strong {
  display: block;
  margin-bottom: 6px;
}

.model-card p,
.warning-box p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.warning-box {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e6c77d;
  border-radius: 6px;
  background: #fff8e8;
}

.warning-box strong {
  display: block;
  color: #6f4b0a;
  margin-bottom: 6px;
}

.result-stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.insight-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.insight-card span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  line-height: 1.25;
}

.score-meter {
  margin-top: 16px;
}

.score-meter-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.score-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ebf0;
}

.score-fill {
  height: 100%;
  background: var(--clay);
}

.model-rationale {
  display: block;
  margin-top: 8px;
  color: var(--teal-dark);
  font-size: .86rem;
  font-weight: 800;
}

.analysis-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.analysis-list li {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  line-height: 1.45;
}

.analysis-list strong {
  color: var(--ink);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
  }

  .workspace,
  .result-layout,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: calc(100vh - 28px);
  }

  .context-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mini-games {
    margin-top: 0;
  }

  .quiz-panel {
    padding: 24px;
  }

  .quiz-topbar {
    display: grid;
  }

  .progress-wrap {
    width: 100%;
    text-align: left;
  }

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

@media (max-width: 520px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    min-height: 100vh;
    border: 0;
  }

  .context-panel,
  .quiz-panel {
    padding: 18px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
  }

  .option-button {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}
