:root {
  --bg: #f4f1ec;
  --surface: #fffdf8;
  --surface-2: #f8faf7;
  --ink: #20211d;
  --muted: #6d7168;
  --line: #d9ddd2;
  --green: #2f8f65;
  --yellow: #c28a1d;
  --orange: #d46b2c;
  --red: #bb3e3e;
  --blue: #2f6f9f;
  --teal: #217c83;
  --shadow: 0 18px 50px rgba(41, 39, 32, 0.12);
}

/* Approved black-white candidate visual system */
:root {
  --bg: #f8f7f1;
  --surface: #fffefa;
  --surface-2: #ffffff;
  --ink: #050505;
  --muted: #444444;
  --line: #e2e0d8;
  --green: #050505;
  --yellow: #050505;
  --orange: #050505;
  --red: #050505;
  --blue: #050505;
  --teal: #050505;
  --pastel-blue: rgba(194, 244, 250, 0.72);
  --pastel-green: rgba(190, 242, 207, 0.72);
  --pastel-yellow: rgba(255, 247, 177, 0.76);
  --pastel-peach: rgba(255, 218, 202, 0.68);
  --shadow: none;
}

body {
  background: var(--bg);
  color: var(--ink);
}

.soft-label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  padding: 0 24px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.soft-label.mint {
  background: var(--pastel-green);
}

.soft-label.yellow {
  background: var(--pastel-yellow);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 34px 0;
}

.pill,
.welcome-facts span {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.pill.blue,
.welcome-facts span:nth-child(1) {
  background: var(--pastel-blue);
}

.pill.green,
.welcome-facts span:nth-child(2) {
  background: var(--pastel-green);
}

.pill.yellow,
.welcome-facts span:nth-child(3) {
  background: var(--pastel-yellow);
}

.welcome-shell,
.final-shell {
  min-height: 100vh;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 32px 0;
}

.welcome-card,
.final-card {
  min-height: min(820px, calc(100vh - 64px));
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.75fr);
  gap: 56px;
  align-items: center;
  padding: 44px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.welcome-copy,
.final-copy {
  max-width: 680px;
  min-width: 0;
}

.welcome-copy h1,
.final-copy h1 {
  max-width: 680px;
  margin: 24px 0;
  font-size: clamp(50px, 5.2vw, 82px);
  line-height: 0.94;
  font-weight: 950;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.welcome-copy .lead,
.final-copy .lead {
  max-width: 900px;
  margin: 0 0 16px;
  color: #2f3438;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.42;
}

.welcome-copy .sublead,
.final-copy .sublead {
  max-width: 860px;
  margin: 0;
  color: #42464b;
  font-size: 24px;
  line-height: 1.45;
}

.welcome-visual,
.final-visual {
  position: relative;
  min-height: 720px;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: end;
  justify-items: center;
  gap: 18px;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  padding: 24px 24px 0;
  background: linear-gradient(180deg, var(--pastel-green), rgba(255, 255, 255, 0.34));
}

@media (max-width: 1180px) {
  .welcome-card,
  .final-card {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .welcome-visual,
  .final-visual {
    order: -1;
    min-height: 520px;
  }

  .welcome-copy h1,
  .final-copy h1 {
    max-width: 900px;
    font-size: clamp(50px, 7vw, 82px);
  }

  .welcome-copy .lead,
  .final-copy .lead {
    font-size: clamp(22px, 2vw, 28px);
  }
}

.final-visual {
  background: linear-gradient(180deg, var(--pastel-yellow), rgba(255, 255, 255, 0.34));
}

.welcome-character,
.final-visual img {
  width: min(92%, 560px);
  max-height: 520px;
  object-fit: contain;
  filter: grayscale(0.08) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.13));
}

.speech-card {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 254, 250, 0.92);
  color: var(--ink);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.35;
}

.consent-box {
  display: grid;
  gap: 14px;
  max-width: 860px;
  margin: 0;
}

.consent-action-panel {
  width: min(100%, 860px);
  display: grid;
  justify-items: center;
  gap: 34px;
}

.consent-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.84);
  cursor: pointer;
}

.consent-row span {
  width: 34px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  color: white;
}

.consent-row.selected span {
  background: var(--ink);
  border-color: var(--ink);
}

.consent-row strong {
  font-size: 18px;
  line-height: 1.35;
}

.start-btn,
.final-done,
.chat-actions .btn.primary {
  min-height: 76px;
  padding: 0 44px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  font-size: 26px;
  font-weight: 900;
}

.start-btn {
  min-width: min(100%, 380px);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.start-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.2);
}

.start-btn:disabled {
  border: 2px solid var(--ink);
  background: rgba(255, 247, 177, 0.76);
  color: var(--ink);
  opacity: 0.72;
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.72;
}

.chat-shell {
  width: min(1440px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.chat-top {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
}

.chat-progress span {
  color: var(--muted);
  font-weight: 900;
}

.progress-track {
  height: 12px;
  border: 1px solid var(--line);
  background: white;
}

.progress-track i {
  background: var(--ink);
}

.chat-stage {
  min-height: calc(100vh - 120px);
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 36px;
  padding-top: 34px;
}

.guide-panel {
  min-height: 720px;
  height: calc(100vh - 140px);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--pastel-blue), rgba(255, 255, 255, 0.42));
  box-shadow: none;
}

.guide-character {
  width: min(96%, 330px);
  max-height: 440px;
  align-self: end;
  justify-self: center;
  object-fit: contain;
  filter: grayscale(0.08) drop-shadow(0 20px 30px rgba(0, 0, 0, 0.13));
}

.guide-caption {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 254, 250, 0.92);
}

.chat-card {
  min-height: calc(100vh - 140px);
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 254, 250, 0.76);
  box-shadow: none;
}

.message.assistant {
  display: block;
}

.avatar {
  display: none;
}

.bubble {
  margin-top: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.question-count,
.section-label {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--pastel-peach);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.bubble h2 {
  max-width: 960px;
  margin: 18px 0 14px;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 62px);
  line-height: 1.03;
  font-weight: 950;
}

.bubble p {
  max-width: 900px;
  color: #383d42;
  font-size: 24px;
  line-height: 1.45;
}

.choice,
.input,
.textarea {
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: white;
}

.choice {
  min-height: 64px;
}

.choice.selected {
  border-color: var(--ink);
  background: var(--pastel-green);
}

.choice span {
  border: 2px solid var(--ink);
  border-radius: 10px;
}

.choice.selected span {
  background: var(--ink);
  border-color: var(--ink);
}

.textarea {
  min-height: 190px;
  font-size: 20px;
}

.input {
  min-height: 62px;
  font-size: 20px;
}

.chat-actions .btn.ghost,
.secondary-action {
  min-height: 62px;
  padding: 0 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.admin-shell {
  color: var(--ink);
}

.admin-shell .badge,
.admin-shell .kpi,
.admin-shell .table-panel,
.admin-shell .insight-panel,
.admin-shell .mini-panel,
.admin-shell .drawer,
.admin-shell .config-panel,
.login-card {
  border: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.86);
  box-shadow: none;
}

.admin-shell .btn.primary,
.login-card .btn.primary {
  background: var(--ink);
  color: white;
}

.status-pill,
.score-badge {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}

.status-pill.green,
.status-pill.yellow,
.status-pill.orange,
.status-pill.red,
.score-badge.green,
.score-badge.yellow,
.score-badge.orange,
.score-badge.red {
  background: var(--surface);
  color: var(--ink);
}

@media (max-width: 940px) {
  .welcome-card,
  .final-card,
  .chat-stage {
    grid-template-columns: 1fr;
  }

  .welcome-visual,
  .final-visual {
    min-height: 520px;
    order: -1;
  }

  .guide-panel {
    position: relative;
    top: 0;
    height: auto;
    min-height: 260px;
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: end;
  }

  .guide-character {
    max-height: 230px;
  }

  .chat-card {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .welcome-shell,
  .final-shell,
  .chat-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 10px;
  }

  .welcome-card,
  .final-card,
  .chat-card {
    padding: 16px 0;
    min-height: auto;
  }

  .welcome-copy h1,
  .final-copy h1 {
    font-size: 46px;
  }

  .welcome-copy .lead,
  .final-copy .lead,
  .welcome-copy .sublead,
  .final-copy .sublead,
  .bubble p {
    font-size: 19px;
  }

  .pill,
  .welcome-facts span {
    min-height: 48px;
    padding: 0 18px;
    font-size: 18px;
  }

  .welcome-visual,
  .final-visual {
    min-height: 390px;
    padding: 14px 14px 0;
  }

  .welcome-character,
  .final-visual img {
    width: 96%;
  }

  .speech-card {
    padding: 15px 16px;
    font-size: 16px;
  }

  .chat-card {
    padding: 22px;
  }

  .bubble h2 {
    font-size: 30px;
  }
}

/* Final character framing fix */
.welcome-visual,
.final-visual {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: end;
  justify-items: center;
  gap: 18px;
  padding: 24px 24px 0;
}

.welcome-visual .speech-card,
.final-visual .speech-card {
  position: relative;
  inset: auto;
  width: 100%;
  grid-row: 1;
}

.welcome-character,
.final-visual img {
  grid-row: 2;
  width: min(86%, 500px);
  max-height: 500px;
  object-fit: contain;
}

.guide-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
}

.guide-character {
  width: min(92%, 300px);
  max-height: 410px;
  object-fit: contain;
}

@media (max-width: 640px) {
  .welcome-visual,
  .final-visual {
    padding: 14px 14px 0;
  }

  .welcome-character,
  .final-visual img {
    width: min(88%, 320px);
    max-height: 280px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(47, 111, 159, 0.10), transparent 34%),
    linear-gradient(310deg, rgba(47, 143, 101, 0.12), transparent 38%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.candidate-shell,
.admin-shell,
.chat-shell,
.welcome-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.welcome-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.welcome-card {
  min-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(248, 250, 247, 0.94)),
    radial-gradient(circle at 80% 20%, rgba(33, 124, 131, 0.14), transparent 34%);
  box-shadow: var(--shadow);
}

.welcome-copy h1 {
  margin-top: 18px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 82px);
}

.welcome-copy p {
  max-width: 680px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.welcome-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.welcome-facts span {
  padding: 8px 10px;
  border: 1px solid rgba(47, 111, 159, 0.2);
  border-radius: 999px;
  background: rgba(47, 111, 159, 0.08);
  color: #245a81;
  font-weight: 800;
}

.consent-box {
  display: grid;
  gap: 10px;
  margin: 24px 0;
}

.consent-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.consent-row input {
  position: absolute;
  opacity: 0;
}

.consent-row span {
  width: 30px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
}

.consent-row strong {
  font-size: 14px;
  line-height: 1.45;
}

.consent-row.selected {
  border-color: rgba(33, 124, 131, 0.55);
  background: rgba(33, 124, 131, 0.08);
}

.consent-row.selected span {
  border-color: var(--teal);
  background: var(--teal);
}

.start-btn {
  min-width: 190px;
}

.welcome-visual {
  min-height: 620px;
  position: relative;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border: 1px solid rgba(217, 221, 210, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(244, 241, 236, 0.72)),
    repeating-linear-gradient(0deg, rgba(47, 143, 101, 0.07) 0 1px, transparent 1px 18px);
}

.welcome-character {
  width: min(88%, 520px);
  max-height: 590px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(32, 33, 29, 0.18));
}

.speech-card {
  position: absolute;
  top: 28px;
  left: 28px;
  right: 28px;
  padding: 15px 16px;
  border: 1px solid rgba(33, 124, 131, 0.24);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  font-weight: 750;
  line-height: 1.45;
}

.chat-shell {
  min-height: 100vh;
}

.chat-top {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.chat-progress {
  min-width: min(420px, 50vw);
  display: grid;
  gap: 8px;
}

.chat-progress span {
  color: var(--muted);
  font-weight: 850;
  text-align: right;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.chat-stage {
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.guide-panel {
  position: sticky;
  top: 18px;
  height: calc(100vh - 120px);
  min-height: 560px;
  display: grid;
  align-content: end;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(248, 250, 247, 0.86)),
    repeating-linear-gradient(45deg, rgba(33, 124, 131, 0.06) 0 1px, transparent 1px 16px);
  box-shadow: 0 12px 35px rgba(41, 39, 32, 0.08);
}

.guide-character {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  filter: drop-shadow(0 14px 24px rgba(32, 33, 29, 0.16));
}

.guide-caption {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(33, 124, 131, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
}

.guide-caption span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.chat-card {
  display: grid;
  align-content: center;
  min-height: calc(100vh - 120px);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.message.assistant {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 22px;
}

.avatar {
  width: 58px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: top center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: 0 8px 18px rgba(32, 33, 29, 0.12);
}

.bubble {
  padding: 18px;
  border: 1px solid rgba(33, 124, 131, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(33, 124, 131, 0.09), rgba(255, 255, 255, 0.88));
}

.bubble h2 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(26px, 4vw, 46px);
}

.bubble p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.question-count {
  display: block;
  margin-bottom: 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.answer-area {
  display: grid;
  gap: 14px;
}

.chat-actions {
  align-items: center;
}

.candidate-hero {
  min-height: 240px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: stretch;
  gap: 20px;
  padding: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.95), rgba(248, 250, 247, 0.92)),
    repeating-linear-gradient(45deg, rgba(47, 111, 159, 0.08) 0 1px, transparent 1px 15px);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 10px;
  border: 1px solid rgba(33, 124, 131, 0.25);
  background: rgba(33, 124, 131, 0.08);
  color: #155e63;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 0.96;
  max-width: 760px;
}

h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.hero-copy p,
.dash-header p,
.login-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.hero-panel {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border-left: 1px solid var(--line);
}

.metric-ring {
  --value: 0;
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--teal) calc(var(--value) * 1%), #e2e6dc 0);
  position: relative;
}

.metric-ring::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
}

.metric-ring span {
  z-index: 1;
  font-size: 30px;
  font-weight: 800;
}

.question-layout {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.steps-rail {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.74);
  border-radius: 8px;
}

.step-dot {
  width: 44px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}

.step-dot.active {
  background: var(--ink);
  color: white;
}

.step-dot.done {
  border-color: rgba(47, 143, 101, 0.45);
  color: var(--green);
}

.question-card,
.login-card,
.table-panel,
.insight-panel,
.mini-panel,
.kpi,
.drawer {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(41, 39, 32, 0.08);
}

.question-card {
  min-height: 520px;
  padding: 28px;
}

.section-label,
.hint,
.muted,
.panel-head span,
.candidate-row span,
.answer-line span {
  color: var(--muted);
}

.section-label {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.hint {
  line-height: 1.45;
}

.input,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

.input {
  height: 54px;
  padding: 0 16px;
}

.textarea-wrap {
  position: relative;
}

.textarea {
  min-height: 220px;
  padding: 16px;
  resize: vertical;
  line-height: 1.5;
}

.counter {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 4px 8px;
  background: rgba(255, 253, 248, 0.92);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.choice-grid,
.choice-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

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

.choice-grid.compact,
.choice-list.compact {
  margin-top: 0;
}

.expectations-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.mini-field {
  display: grid;
  gap: 10px;
}

.mini-field h3 {
  margin-bottom: 0;
}

.mini-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.choice {
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  width: 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: white;
}

.choice strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.2;
}

.choice.selected {
  border-color: rgba(33, 124, 131, 0.55);
  background: rgba(33, 124, 131, 0.08);
}

.choice.selected span {
  background: var(--teal);
  border-color: var(--teal);
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--ink);
  color: white;
}

.btn.ghost {
  border-color: var(--line);
  background: white;
}

.btn.danger {
  background: rgba(187, 62, 62, 0.10);
  color: var(--red);
}

.btn.wide {
  width: 100%;
}

.thanks,
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.thanks {
  text-align: center;
}

.thanks p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.5;
}

.success-mark {
  width: 74px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 50%;
  background: rgba(47, 143, 101, 0.12);
  color: var(--green);
}

.success-mark .icon {
  width: 38px;
  height: 38px;
}

.login-card {
  width: min(460px, 100%);
  padding: 28px;
}

.login-card .input {
  margin: 22px 0 12px;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

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

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 20px;
}

.dash-header h1 {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 48px;
}

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

.kpi {
  padding: 16px;
}

.kpi span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.kpi strong {
  font-size: 30px;
}

.kpi.green strong {
  color: var(--green);
}

.kpi.yellow strong {
  color: var(--yellow);
}

.status-bar {
  height: 16px;
  display: flex;
  overflow: hidden;
  margin: 14px 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
}

.status-bar span.green,
.score-badge.green,
.status-pill.green {
  background: rgba(47, 143, 101, 0.15);
  color: var(--green);
}

.status-bar span.yellow,
.score-badge.yellow,
.status-pill.yellow {
  background: rgba(194, 138, 29, 0.17);
  color: var(--yellow);
}

.status-bar span.orange,
.score-badge.orange,
.status-pill.orange {
  background: rgba(212, 107, 44, 0.16);
  color: var(--orange);
}

.status-bar span.red,
.score-badge.red,
.status-pill.red {
  background: rgba(187, 62, 62, 0.15);
  color: var(--red);
}

.table-panel,
.insight-panel,
.mini-panel,
.config-panel {
  padding: 18px;
}

.config-panel {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 35px rgba(41, 39, 32, 0.08);
}

.config-editor {
  width: 100%;
  min-height: 480px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #161713;
  color: #f5f3eb;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.candidate-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 120px 34px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
}

.candidate-row + .candidate-row {
  margin-top: 8px;
}

.candidate-row strong,
.candidate-row span {
  display: block;
}

.score-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 900;
}

.score-badge.big {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  font-size: 30px;
}

.dashboard-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.insight-panel p,
.mini-panel p {
  color: var(--muted);
  line-height: 1.45;
}

.ai-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 159, 0.22);
  background: rgba(47, 111, 159, 0.07);
  border-radius: 8px;
}

.mode {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.risk-text {
  color: var(--red) !important;
}

.rank-row,
.answer-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.rank-row span,
.answer-line span {
  min-width: 0;
}

.rank-row strong,
.answer-line strong {
  text-align: right;
  overflow-wrap: anywhere;
}

.empty {
  padding: 26px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(32, 33, 29, 0.35);
  z-index: 20;
}

.drawer {
  width: min(720px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  border-radius: 8px 0 0 8px;
}

.close-btn {
  float: right;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background: white;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 32px 0 18px;
}

.profile-head h2 {
  margin-bottom: 4px;
}

.profile-head p {
  color: var(--muted);
}

.profile-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.profile-section ul {
  padding-left: 18px;
  line-height: 1.55;
}

.flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flags span,
.flags.ok {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(187, 62, 62, 0.12);
  color: var(--red);
  font-weight: 800;
  font-size: 13px;
}

.flags.ok {
  color: var(--green);
  background: rgba(47, 143, 101, 0.12);
}

.toast,
.loading {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
}

.loading-inline {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.toast {
  bottom: 24px;
}

.loading {
  top: 18px;
}

@media (max-width: 940px) {
  .candidate-hero,
  .dashboard-grid,
  .welcome-card,
  .chat-stage {
    grid-template-columns: 1fr;
  }

  .welcome-visual {
    min-height: 480px;
    order: -1;
  }

  .guide-panel {
    position: relative;
    top: 0;
    height: auto;
    min-height: 260px;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: end;
  }

  .guide-character {
    max-height: 230px;
  }

  .chat-card {
    min-height: auto;
  }

  .hero-panel {
    min-height: 170px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .question-layout {
    grid-template-columns: 1fr;
  }

  .steps-rail {
    display: flex;
    overflow-x: auto;
  }

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

@media (max-width: 640px) {
  .candidate-shell,
  .admin-shell,
  .chat-shell,
  .welcome-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .candidate-hero,
  .question-card,
  .login-card,
  .table-panel,
  .insight-panel,
  .mini-panel,
  .welcome-card,
  .chat-card {
    padding: 16px;
  }

  .welcome-card {
    min-height: auto;
  }

  .welcome-visual {
    min-height: 390px;
  }

  .welcome-character {
    width: 96%;
  }

  .speech-card {
    top: 14px;
    left: 14px;
    right: 14px;
  }

  .chat-top {
    height: auto;
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 14px;
  }

  .chat-progress {
    min-width: 0;
  }

  .chat-progress span {
    text-align: left;
  }

  .chat-stage,
  .chat-card {
    min-height: auto;
  }

  .guide-panel {
    min-height: 180px;
    grid-template-columns: 110px minmax(0, 1fr);
    padding: 12px;
  }

  .guide-character {
    max-height: 160px;
  }

  .message.assistant {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .avatar {
    width: 44px;
  }

  .bubble {
    padding: 14px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 23px;
  }

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

  .form-actions,
  .dash-header,
  .topbar,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dash-header h1 {
    font-size: 38px;
  }

  .candidate-row {
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  .candidate-row .status-pill,
  .candidate-row .row-icon {
    display: none;
  }

  .drawer {
    padding: 18px;
  }

  .profile-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Candidate header brand mark */
.brand-mark {
  justify-self: end;
  text-align: right;
  color: var(--ink);
  line-height: 1.05;
}

.brand-kicker,
.brand-name {
  display: block;
}

.brand-kicker {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 650;
}

.brand-name {
  font-size: 26px;
  font-weight: 950;
}

.welcome-shell > .brand-mark,
.final-shell > .brand-mark {
  align-self: start;
  margin-bottom: 18px;
}

.chat-top {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
}

.chat-top .brand-mark {
  grid-column: 3;
}

.chat-top .chat-progress {
  grid-column: 2;
  justify-self: end;
  width: min(420px, 100%);
}

@media (max-width: 640px) {
  .brand-mark {
    text-align: left;
    justify-self: start;
  }

  .brand-kicker {
    font-size: 13px;
  }

  .brand-name {
    font-size: 20px;
  }

  .chat-top {
    grid-template-columns: 1fr;
  }

  .chat-top .brand-mark,
  .chat-top .chat-progress {
    grid-column: auto;
    justify-self: stretch;
  }

  .consent-action-panel,
  .start-btn {
    width: 100%;
  }

  .start-btn {
    min-width: 0;
    font-size: 22px;
  }
}

/* Final CTA state override */
.start-btn {
  width: min(100%, 380px);
  justify-self: center;
  opacity: 1 !important;
}

.start-btn:disabled {
  background: var(--pastel-yellow) !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink);
  opacity: 0.92 !important;
}

.start-btn:not(:disabled) {
  background: var(--ink) !important;
  color: white !important;
  opacity: 1 !important;
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 24px;
  align-items: stretch;
  max-width: 760px;
}

.named-input {
  display: grid;
  gap: 10px;
}

.named-input span {
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.question-count {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-transform: none !important;
}

.section-label,
.chat-progress,
.progress-track {
  display: none !important;
}

.chat-top {
  grid-template-columns: auto 1fr !important;
}

.chat-top .brand-mark {
  grid-column: auto !important;
  justify-self: end !important;
}

/* Final responsive questionnaire fixes for Edge/narrow viewports */
.chat-stage {
  width: 100%;
  grid-template-columns: clamp(260px, 22vw, 340px) minmax(0, 1fr) !important;
}

.chat-card,
.message.assistant,
.bubble,
.answer-area {
  min-width: 0;
}

.message.assistant {
  display: block !important;
  grid-template-columns: none !important;
}

.bubble {
  width: 100% !important;
  max-width: none !important;
}

.bubble h2,
.bubble p {
  width: 100% !important;
  max-width: none !important;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.chat-actions .btn.primary:disabled {
  background: var(--pastel-yellow) !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink);
  opacity: 0.9 !important;
  cursor: not-allowed;
}

@media (max-width: 700px) {
  .chat-shell {
    width: min(100% - 24px, 1440px) !important;
  }

  .chat-stage {
    display: block !important;
    min-height: auto !important;
    padding-top: 18px !important;
  }

  .guide-panel {
    display: none !important;
  }

  .chat-card {
    width: 100% !important;
    min-height: auto !important;
    padding: 24px !important;
    border-radius: 18px;
  }

  .bubble h2 {
    font-size: clamp(38px, 11vw, 64px) !important;
    line-height: 1.02 !important;
  }

  .bubble p {
    font-size: 22px !important;
    line-height: 1.42 !important;
  }

  .chat-actions {
    grid-template-columns: 1fr !important;
  }

  .chat-actions .btn {
    width: 100%;
  }

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

  .chat-top {
    grid-template-columns: 1fr !important;
  }

  .chat-top .brand-mark {
    justify-self: start !important;
  }
}

/* Hard stop for welcome/final overlap in Edge and narrow desktop widths */
.welcome-shell,
.final-shell {
  overflow-x: clip;
}

.welcome-card,
.final-card {
  grid-template-columns: minmax(0, 680px) minmax(340px, 0.72fr) !important;
  gap: clamp(28px, 4vw, 58px) !important;
  align-items: center !important;
}

.welcome-copy,
.final-copy {
  min-width: 0 !important;
  max-width: 680px !important;
}

.welcome-copy h1,
.final-copy h1 {
  max-width: 680px !important;
  font-size: clamp(46px, 5vw, 76px) !important;
  line-height: 0.96 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.welcome-copy .lead,
.final-copy .lead,
.welcome-copy .sublead,
.final-copy .sublead {
  max-width: 680px !important;
}

.welcome-visual,
.final-visual {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 1400px) {
  .welcome-card,
  .final-card {
    grid-template-columns: 1fr !important;
    gap: 34px !important;
  }

  .welcome-copy,
  .final-copy,
  .welcome-copy h1,
  .final-copy h1,
  .welcome-copy .lead,
  .final-copy .lead,
  .welcome-copy .sublead,
  .final-copy .sublead {
    max-width: 920px !important;
  }

  .welcome-copy h1,
  .final-copy h1 {
    font-size: clamp(46px, 7vw, 78px) !important;
  }

  .welcome-visual,
  .final-visual {
    order: 0 !important;
    min-height: 520px !important;
  }
}

/* Final screen: compact thank-you layout */
.final-shell {
  width: min(1180px, calc(100% - 40px)) !important;
  min-height: 100vh;
  padding: 24px 0 42px;
  align-items: start !important;
  align-content: start;
}

.final-card {
  min-height: auto !important;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.78fr) !important;
  gap: clamp(28px, 4vw, 52px) !important;
  padding: 34px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.64) !important;
  overflow: hidden;
}

.final-copy {
  max-width: 640px !important;
  align-self: center;
}

.final-copy h1 {
  max-width: 620px !important;
  margin: 18px 0 !important;
  font-size: clamp(44px, 4.6vw, 68px) !important;
  line-height: 1 !important;
}

.final-copy .lead {
  max-width: 620px !important;
  font-size: clamp(23px, 2vw, 30px) !important;
  line-height: 1.38 !important;
}

.final-copy .sublead {
  max-width: 620px !important;
  font-size: 21px !important;
  line-height: 1.45 !important;
}

.final-copy .pill-row {
  margin: 26px 0 18px;
}

.final-copy .pill {
  min-height: 48px;
  padding: 0 22px;
  font-size: 18px;
}

.final-copy > .status-pill {
  margin: 2px 0 22px;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
}

.final-done {
  min-height: 58px !important;
  padding: 0 30px !important;
  font-size: 22px !important;
}

.final-visual {
  min-height: 600px !important;
  padding: 22px 22px 0 !important;
  border: 1px solid rgba(217, 221, 210, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--pastel-yellow), rgba(255, 255, 255, 0.44)) !important;
}

.final-visual img {
  width: min(88%, 430px) !important;
  max-height: 450px !important;
}

.final-visual .speech-card {
  max-width: 100%;
  padding: 18px 20px;
  font-size: 19px;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .final-card {
    grid-template-columns: 1fr !important;
  }

  .final-visual {
    min-height: 500px !important;
    order: 0 !important;
  }
}

.consent-row a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-row a:hover {
  color: var(--teal);
}

.legal-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.legal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: clamp(24px, 4vw, 46px);
}

.legal-card h1 {
  margin: 18px 0 14px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1;
}

.legal-note {
  max-width: 820px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}

.legal-section {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.legal-section p,
.legal-section li {
  color: #34383d;
  font-size: 18px;
  line-height: 1.55;
}

.legal-section p {
  margin: 0 0 10px;
}

.legal-section ul {
  margin: 0;
  padding-left: 22px;
}

.legal-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

@media (max-width: 700px) {
  .legal-top {
    display: grid;
  }

  .legal-card h1 {
    font-size: 40px;
  }
}
