:root {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --ink: #111111;
  --muted: #6f6f6f;
  --line: #e1e1df;
  --line-strong: #d2d2cf;
  --accent: #0a7f58;
  --danger: #d43f4c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden],
.hidden {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 160ms ease, transform 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

textarea:focus,
input:focus {
  border-color: var(--ink);
  outline: 3px solid rgba(17, 17, 17, 0.08);
}

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

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

.page-shell {
  min-height: 100svh;
  padding: 28px clamp(16px, 5vw, 72px) 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
}

.brand-mark {
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 7px solid currentColor;
  border-right-color: transparent;
  border-radius: 8px;
  transform: rotate(45deg);
}

.status {
  color: var(--muted);
  font-size: 14px;
}

.interview-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}

.intro-panel,
.dialog-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.intro-panel {
  display: flex;
  min-height: 620px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 30px;
  text-align: center;
}

.agent-logo {
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  margin-bottom: 34px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(99, 159, 166, 0.82), rgba(231, 224, 192, 0.5)),
    linear-gradient(140deg, #7db9c2 0%, #e4dac1 58%, #b9c9b8 100%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.agent-logo .brand-mark {
  width: 52px;
  height: 52px;
  border-width: 12px;
  border-radius: 15px;
}

.intro-panel h1 {
  margin-bottom: 14px;
  font-size: 34px;
  line-height: 1.08;
}

.intro-panel p {
  max-width: 280px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.start-button {
  min-width: 180px;
  margin-bottom: 18px;
}

body.session-active .start-button {
  display: none;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 700;
}

.state-pill::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 0 6px rgba(212, 63, 76, 0.1);
}

.dialog-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 620px;
  padding: 34px;
}

.question-block {
  border-bottom: 1px solid var(--line);
  padding-bottom: 26px;
}

.question-block span,
.confirm-head span {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.question-block p {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 650;
  line-height: 1.16;
}

.history-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 16px;
}

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

.history-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-head strong {
  display: inline-flex;
  min-width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13px;
}

.answers {
  display: grid;
  gap: 16px;
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.answers li {
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--line-strong);
  padding-left: 14px;
}

.answers strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.answers span {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.answer-box,
.confirm-box,
.completion {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
  padding: 18px;
}

.answer-box {
  display: none;
}

body.session-active .answer-box {
  display: grid;
  grid-template-columns: auto auto;
  justify-items: center;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

body.review-active .answer-box {
  display: none;
}

.text-answer,
.answer-box label,
.confirm-box label {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.text-answer {
  grid-column: 1 / -1;
  width: 100%;
}

.text-answer label {
  margin-bottom: 14px;
}

.voice-answer {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.mic-button {
  display: grid;
  place-items: center;
  gap: 12px;
  width: 260px;
  height: 260px;
  border: 1px solid #0d0d0d;
  border-radius: 999px;
  background: #0d0d0d;
  padding: 28px;
  text-align: center;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
}

.mic-button strong {
  max-width: 150px;
  font-size: 15px;
  line-height: 1.35;
}

.mic-icon {
  position: relative;
  display: block;
  width: 46px;
  height: 64px;
  border: 5px solid #fff;
  border-radius: 24px;
}

.mic-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -20px;
  width: 5px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
}

.mic-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: #fff;
  transform: translateX(-50%);
}

.mic-button.recording {
  background: var(--danger);
  border-color: var(--danger);
}

.stop-button {
  display: none;
  min-height: 44px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.stop-button:not(:disabled) {
  display: inline-flex;
  align-items: center;
}

.text-link {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-link:disabled {
  display: none;
}

.confirm-box h2 {
  margin-bottom: 14px;
  font-size: 24px;
}

.confirm-box textarea {
  margin-bottom: 14px;
}

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

.completion {
  display: grid;
  gap: 6px;
  color: var(--muted);
  line-height: 1.45;
}

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

@media (max-width: 860px) {
  .page-shell {
    padding: 18px 12px 36px;
  }

  .topbar {
    margin-bottom: 18px;
  }

  .status {
    display: none;
  }

  .interview-shell {
    grid-template-columns: 1fr;
    border-radius: 22px;
    padding: 10px;
  }

  .intro-panel,
  .dialog-panel {
    min-height: auto;
    border-radius: 18px;
  }

  .intro-panel {
    padding: 28px 18px;
  }

  .dialog-panel {
    gap: 14px;
    padding: 22px 18px;
  }

  .question-block p {
    font-size: 24px;
  }

  .button-row,
  .text-answer button,
  .start-button {
    width: 100%;
  }

  body.session-active .answer-box {
    grid-template-columns: 1fr;
  }

  .mic-button {
    width: min(230px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
}
