:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #10213a;
  --muted: #61748f;
  --line: #d9e2ef;
  --primary: #0d7c66;
  --primary-ink: #ffffff;
  --warn: #d97706;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7fbff 0%, #f1f6fc 100%);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.28;
  pointer-events: none;
  z-index: 0;
}

.bg-orb-a {
  background: #8fd4bf;
  top: -120px;
  right: -70px;
}

.bg-orb-b {
  background: #b6d3ff;
  bottom: -140px;
  left: -60px;
}

.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
  position: relative;
  z-index: 1;
}

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

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.86rem;
}

.app-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(16, 33, 58, 0.05);
}

.controls {
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: 16px;
}

.controls h2 {
  margin-top: 0;
  margin-bottom: 14px;
}

.controls h3 {
  margin: 12px 0 8px;
}

.model-callout {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #dce8f7;
  border-radius: 14px;
  background: linear-gradient(135deg, #fbfdff 0%, #eef8f4 100%);
}

.model-callout h3 {
  margin: 6px 0 4px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2c3f59;
}

textarea,
select,
input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.resume-list {
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfdff;
  max-height: 140px;
  overflow-y: auto;
}

textarea:focus,
select:focus,
input[type="file"]:focus {
  outline: 2px solid #a6c9ff;
  border-color: #7caefc;
}

input[type="range"] {
  width: calc(100% - 40px);
  vertical-align: middle;
}

#topKValue {
  margin-left: 8px;
  font-weight: 700;
}

.control-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(16, 33, 58, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

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

.btn-ghost {
  background: #f8fafc;
}

.full {
  width: 100%;
  margin-top: 10px;
}

.workspace {
  padding: 18px;
  min-height: 680px;
}

.workspace-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #f3f7fb;
  border: 1px solid var(--line);
}

.tab-btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(16, 33, 58, 0.08);
}

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

.workspace-panel.hidden {
  display: none !important;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.status {
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status.idle {
  background: #eef2f7;
  color: #405773;
}

.status.running {
  background: #fff5e6;
  color: #a15b00;
}

.status.success {
  background: #e8f8f4;
  color: #0d7c66;
}

.status.error {
  background: #fdecec;
  color: var(--danger);
}

.summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.summary h4 {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.summary p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.interview-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6fbf9 100%);
}

.interview-empty h3 {
  margin: 6px 0 6px;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.candidate-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.candidate-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(16, 33, 58, 0.08);
}

.candidate-card.active {
  border-color: #7fcdb6;
  box-shadow: 0 12px 28px rgba(13, 124, 102, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f4fffb 100%);
}

.candidate-card h4 {
  margin: 0;
  font-size: 1rem;
}

.candidate-meta {
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 6px;
}

.score-bar {
  height: 7px;
  border-radius: 999px;
  background: #e8eef7;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, #0d7c66 0%, #2ca58d 100%);
}

.candidate-insight {
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

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

.candidate-insight-head h4 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

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

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

.insight-block h5 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: #29405d;
}

.insight-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.insight-list li + li {
  margin-top: 6px;
}

.insight-summary {
  margin: 0 0 12px;
  color: #29405d;
}

.recommendation-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  background: #eef7ff;
  color: #24507a;
}

.recommendation-chip.strong {
  background: #e8f8f4;
  color: #0d7c66;
}

.recommendation-chip.caution {
  background: #fff5e6;
  color: #a15b00;
}

.interview {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.interview-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid #dce8f7;
  background: linear-gradient(135deg, #f8fbff 0%, #eef8f4 100%);
}

.interview-hero h4 {
  margin: 6px 0 4px;
  font-size: 1.05rem;
}

.interview-hero-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge.active {
  background: #e8f8f4;
  border-color: #b9e6d8;
  color: #0d7c66;
}

.badge.waiting {
  background: #fff5e6;
  border-color: #ffd9a8;
  color: #a15b00;
}

.live-hint {
  margin-top: 10px;
}

.interview-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

.current-question {
  margin-top: 10px;
  border: 1px solid #bee3d8;
  background: #f1fff8;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
}

.chat-feed {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  max-height: 320px;
  overflow-y: auto;
  background: #fbfdff;
}

.chat-msg {
  max-width: 78%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.chat-msg.recruiter {
  margin-right: auto;
  border: 1px solid #c8daf6;
  background: #f1f7ff;
}

.chat-msg.candidate {
  margin-left: auto;
  border: 1px solid #bbe2d8;
  background: #ebfbf5;
}

.response-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.typing-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 12px 0 0 rgba(13, 124, 102, 0.55), 24px 0 0 rgba(13, 124, 102, 0.28);
  animation: pulseDots 1.2s infinite ease-in-out;
}

@keyframes pulseDots {
  0%, 100% {
    opacity: 0.65;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(2px);
  }
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

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

  .controls {
    position: static;
  }
}

@media (max-width: 780px) {
  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .interview-hero,
  .candidate-insight-grid,
  .response-grid,
  .interview-controls,
  .control-row {
    grid-template-columns: 1fr;
  }

  .interview-hero {
    display: block;
  }

  .interview-hero-meta {
    justify-content: flex-start;
    margin-top: 10px;
  }
}
