:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --panel-soft: #f8fbfd;
  --text: #142033;
  --muted: #66758b;
  --muted-2: #8a97a9;
  --line: #dce4ee;
  --line-strong: #c7d3df;
  --accent: #0e8795;
  --accent-dark: #087583;
  --accent-soft: #e8f7fb;
  --good: #19a871;
  --warn: #bd6d1c;
  --warn-soft: #fff6ec;
  --shadow: 0 18px 50px rgba(22, 39, 56, 0.08);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 760;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(135deg, #0a7d8b, #27a6b1);
  border-radius: 8px;
  font-size: 21px;
  font-weight: 860;
}

.top-actions,
.session-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ghost-button,
.secondary-button,
.avatar-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  color: #44536a;
  font-size: 14px;
  font-weight: 600;
}

.ghost-button:hover,
.secondary-button:hover,
.icon-button:hover {
  border-color: var(--line);
  background: var(--panel-soft);
}

.secondary-button {
  padding: 0 12px;
  border-color: var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.avatar-button {
  width: 38px;
  border-color: var(--line-strong);
  border-radius: 50%;
  background: #eef3f8;
  color: #2a3748;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(460px, 1.52fr) minmax(300px, 0.82fr);
  gap: 16px;
  width: min(1480px, calc(100vw - 48px));
  margin: 18px auto 30px;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.setup-panel,
.feedback-panel {
  padding: 22px;
}

.panel-heading,
.feedback-heading {
  padding-bottom: 18px;
}

.panel-heading h1,
.feedback-heading h2,
.interview-header h2,
.dialog-header h2 {
  margin: 0;
  color: #15243a;
  font-size: 20px;
  line-height: 1.25;
}

.panel-heading p:not(.step-label) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.step-label {
  margin: 0 0 4px;
  color: #172842;
  font-size: 17px;
  font-weight: 780;
}

.setup-form {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.type-field legend {
  color: #24324a;
  font-size: 14px;
  font-weight: 740;
}

.field strong {
  color: #bd4b3e;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

.field input,
.answer-input-wrap textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  outline: none;
}

.field input {
  height: 42px;
  padding: 0 14px;
  font-size: 14px;
}

.field input:focus,
.answer-input-wrap textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 135, 149, 0.12);
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

.type-field {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.segmented label {
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 10px 6px;
  border-right: 1px solid var(--line);
  color: #53627a;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.info-box {
  padding: 12px 14px;
  border: 1px solid #bde5f1;
  border-radius: var(--radius);
  background: #eef9fc;
  color: #53677c;
  font-size: 13px;
  line-height: 1.45;
}

.settings-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.settings-box label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: #26354c;
  font-size: 14px;
  font-weight: 600;
}

.settings-box label:last-child {
  border-bottom: 0;
}

.settings-box span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-box select {
  min-width: 120px;
  border: 0;
  background: transparent;
  color: #27364d;
  text-align: right;
  outline: none;
}

.primary-button,
.send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0d91a1, #087986);
  color: #fff;
  font-size: 16px;
  font-weight: 780;
  box-shadow: 0 12px 26px rgba(8, 121, 134, 0.24);
}

.primary-button:hover,
.send-button:hover {
  background: linear-gradient(180deg, #0a8493, #076d79);
}

.privacy-note,
.tip,
.disclaimer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.interview-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: calc(100vh - 112px);
}

.interview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.interview-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.interview-header h2 {
  font-size: 15px;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0ba38d;
  box-shadow: 0 0 0 6px rgba(11, 163, 141, 0.12);
}

#timer {
  color: #516178;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
  padding: 24px 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #fff 54%);
}

.message-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.message-row.candidate {
  grid-template-columns: minmax(0, 1fr) 38px;
  margin-left: 42px;
}

.message-row.candidate .bubble {
  order: 1;
}

.message-row.candidate .message-avatar {
  order: 2;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #dff4f8;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.message-row.candidate .message-avatar {
  background: #7b8797;
  color: #fff;
}

.bubble {
  max-width: 640px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #edf7fb;
  color: #1d2b3f;
  font-size: 15px;
  line-height: 1.55;
}

.candidate .bubble {
  margin-left: auto;
  background: #f0f2f5;
}

.bubble-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #596a80;
  font-size: 13px;
  font-weight: 650;
}

.bubble p {
  margin: 0;
}

.bubble p + p {
  margin-top: 12px;
}

.answer-box {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.answer-box label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.answer-input-wrap {
  position: relative;
}

.answer-input-wrap textarea {
  display: block;
  min-height: 106px;
  padding: 14px 60px 14px 14px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
}

.mic-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(14, 135, 149, 0.22);
}

.mic-button.recording {
  background: #bd3f32;
}

.answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.send-button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: none;
}

.tip {
  margin-top: 12px;
}

.feedback-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.score-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
}

.score-ring {
  display: grid;
  place-items: center;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 56%, transparent 57%),
    conic-gradient(var(--accent) 0 295deg, #edf2f6 295deg 360deg);
}

.score-ring span {
  color: #17243a;
  font-size: 40px;
  font-weight: 820;
  line-height: 1;
}

.score-ring small {
  margin-top: -18px;
  color: var(--muted);
  font-size: 13px;
}

.score-card strong {
  color: var(--accent);
  font-size: 16px;
}

.score-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.feedback-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feedback-box h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.feedback-box ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feedback-box li {
  position: relative;
  padding-left: 26px;
  color: #35445a;
  font-size: 13px;
  line-height: 1.35;
}

.feedback-box li::before {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.strengths {
  background: linear-gradient(180deg, #f9fffc, #fff);
}

.strengths li::before {
  content: "✓";
  color: #fff;
  background: var(--good);
}

.improvements {
  border-color: #f0d2b6;
  background: var(--warn-soft);
}

.improvements li::before {
  content: "!";
  color: var(--warn);
  border: 1px solid currentColor;
}

.next-practice {
  display: grid;
  grid-template-columns: 42px 1fr 18px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid #cfe4f2;
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--text);
  text-align: left;
}

.next-practice > span:first-child {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #edf7fb;
  color: var(--accent);
}

.next-practice strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.next-practice small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chevron {
  color: #506177;
}

.report-link {
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 750;
}

.disclaimer {
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.36);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 38px;
  border-radius: var(--radius);
}

.report-content {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.report-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.report-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.report-section p {
  margin: 0;
  color: #47566c;
  font-size: 14px;
  line-height: 1.55;
}

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

  .interview-panel {
    min-height: 740px;
  }

  .setup-panel,
  .feedback-panel {
    order: initial;
  }
}

@media (max-width: 680px) {
  .topbar {
    height: auto;
    align-items: flex-start;
    padding: 14px 16px;
  }

  .brand {
    font-size: 19px;
  }

  .top-actions {
    gap: 4px;
  }

  .ghost-button {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .app-shell {
    width: calc(100vw - 24px);
    margin-top: 12px;
  }

  .setup-panel,
  .feedback-panel {
    padding: 16px;
  }

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

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

  .segmented label:last-child span {
    border-bottom: 0;
  }

  .interview-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .conversation {
    padding: 18px 14px;
  }

  .message-row,
  .message-row.candidate {
    grid-template-columns: 1fr;
    margin-left: 0;
  }

  .message-avatar {
    display: none;
  }

  .bubble {
    max-width: none;
    font-size: 14px;
  }

  .answer-box {
    padding: 14px;
  }

  .answer-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .score-card {
    grid-template-columns: 1fr;
  }

  .score-ring {
    margin: 0 auto;
  }
}
