:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6875;
  --line: #d9e0e7;
  --paper: #ffffff;
  --wash: #f4f7fa;
  --accent: #1466c3;
  --accent-dark: #0c4d98;
  --green: #268d5c;
  --gold: #a87607;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--wash);
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(16px, 3vw, 36px);
  background: #26313d;
  box-shadow: 0 2px 14px rgba(17, 24, 39, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 5px;
}

.brand span {
  overflow-wrap: anywhere;
}

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

.nav-button,
.secondary-button,
.primary-button,
.answer-card,
.small-button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-button {
  padding: 8px 12px;
  color: #f8fafc;
  background: transparent;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.12);
}

main {
  min-height: calc(100vh - 72px);
}

.view {
  display: none;
  padding: clamp(18px, 4vw, 44px);
}

.view.active {
  display: block;
}

.home-panel,
.agenda-panel,
.result-panel,
.test-shell {
  width: min(1060px, 100%);
  margin: 0 auto;
}

.home-panel,
.agenda-panel,
.result-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 42px);
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin: 34px 0 14px;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: 0;
}

p,
li,
blockquote {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.65;
}

blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: #eef5fc;
}

.primary-button,
.secondary-button,
.small-button {
  min-height: 42px;
  padding: 10px 16px;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.secondary-button,
.small-button {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.secondary-button:hover,
.small-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.profile-panel {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.profile-actions,
.resume-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-actions {
  margin-top: 14px;
}

.file-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.file-button input {
  display: none;
}

.profile-status {
  margin: 14px 0;
  padding: 12px;
  color: var(--muted);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.resume-card {
  flex: 1 1 260px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.resume-card span {
  color: var(--muted);
}

.resume-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 700;
}

.resume-card input {
  min-height: 38px;
  width: 120px;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.combined-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.combined-card {
  padding: 14px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.combined-card strong,
.combined-card span {
  display: block;
}

.combined-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.representative-avatar {
  width: min(520px, 100%);
  margin: 0 auto 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dce7ef;
}

.representative-avatar.compact {
  width: min(280px, 80vw);
  margin-bottom: 10px;
}

.representative-avatar video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.style-grid article {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.style-grid strong,
.style-grid span {
  display: block;
}

.style-grid span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.test-shell {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 700;
}

.speech-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#question-root {
  flex: 1;
  display: grid;
  align-items: center;
}

.question-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 28px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(17, 24, 39, 0.08);
}

.question-image {
  display: block;
  max-width: min(680px, 100%);
  max-height: 44vh;
  object-fit: contain;
}

.answers-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 14px;
  width: 100%;
}

.scenario-card {
  align-items: stretch;
  justify-items: stretch;
  max-width: 980px;
}

.scenario-kicker {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.scenario-text {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  line-height: 1.35;
}

.text-answers-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.text-answer-card {
  min-height: 132px;
  padding: 16px;
  text-align: left;
  color: var(--ink);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.text-answer-card:hover {
  background: #ffffff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.text-answer-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
}

.text-answer-card span {
  display: block;
  line-height: 1.5;
}

.answer-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  align-content: center;
  min-height: 150px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcfe;
  border-color: var(--line);
}

.answer-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.answer-card img {
  width: min(112px, 100%);
  height: 96px;
  object-fit: contain;
}

.answer-letter {
  font-weight: 800;
}

.interactive-stage {
  position: relative;
  width: min(760px, 100%);
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.puzzle-base {
  max-width: 100%;
  max-height: 430px;
}

.rotating-piece {
  position: absolute;
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
}

.rotating-piece img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.piece-one {
  left: 52%;
  top: 46%;
}

.piece-two {
  left: 36%;
  top: 35%;
}

.chart-wrap {
  display: grid;
  gap: 16px;
  justify-items: center;
  width: 100%;
}

.radial-chart {
  width: min(360px, 80vw);
  aspect-ratio: 1;
}

.radial-chart circle {
  fill: none;
  stroke-width: 3;
}

.segment-0 { stroke: #1466c3; }
.segment-1 { stroke: #268d5c; }
.segment-2 { stroke: #a87607; }
.segment-3 { stroke: #a13d63; }

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: min(520px, 100%);
}

.control-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.value-label {
  color: var(--muted);
  font-weight: 700;
}

.figure-stage {
  width: min(640px, 100%);
  min-height: 430px;
  position: relative;
  display: grid;
  place-items: center;
}

.figure-orbit {
  position: absolute;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border: 2px solid #1466c3;
  border-radius: 50%;
}

.figure-button {
  width: 82px;
  height: 82px;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.shape-circle {
  border-radius: 50%;
  background: #1466c3;
}

.shape-square {
  background: #268d5c;
}

.shape-triangle {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 44px solid transparent;
  border-right: 44px solid transparent;
  border-bottom: 82px solid #c93f3f;
}

.top-styles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.style-result {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.bar {
  height: 10px;
  margin-top: 12px;
  border-radius: 99px;
  background: #e6edf4;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

#curve-canvas {
  width: 100%;
  max-width: 720px;
  height: auto;
  display: block;
  margin: 16px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.voice-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.voice-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.voice-card strong,
.voice-card span {
  display: block;
}

.voice-card span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.prompt-box {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 16px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  font: 0.98rem/1.55 Arial, Helvetica, sans-serif;
}

.vector-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.vector-card strong,
.vector-card span {
  display: block;
}

.vector-card span {
  margin-top: 6px;
  color: var(--muted);
}

.result-actions,
.question-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

@media (max-width: 820px) {
  .topbar,
  .progress-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .speech-controls {
    justify-content: flex-start;
  }

  nav {
    justify-content: flex-start;
  }

  .style-grid,
  .answers-grid,
  .text-answers-grid,
  .top-styles,
  .voice-summary,
  .combined-summary,
  .vector-output {
    grid-template-columns: 1fr;
  }

  .question-image {
    max-height: 34vh;
  }

  .interactive-stage,
  .figure-stage {
    min-height: 410px;
  }

  .rotating-piece {
    width: 92px;
    height: 92px;
  }
}
