:root {
  --background: #ffffff;
  --foreground: #111111;
  --muted: #666666;
  --muted-surface: #f8f8f6;
  --surface-soft: #f2f3f0;
  --card: #ffffff;
  --primary: #ff8400;
  --primary-soft: #fff8f0;
  --success: #2e7d32;
  --success-soft: #e8f5e9;
  --danger: #d93c15;
  --border: #cbccc9;
  --shadow: 0 8px 40px #00000012;
  --shadow-lg: 0 4px 24px #00000010, 0 16px 64px #00000008;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Geist, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  min-height: 100vh;
  padding: 60px 24px 80px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.agent-card,
.card,
.call-card {
  width: min(720px, 100%);
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 48px;
}

.agent-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.title-row,
.brand,
.top-bar,
.hint-box,
.call-progress,
.actions,
.voice-session,
.company-dots,
.job,
.status-badge {
  display: flex;
  align-items: center;
}

.title-row {
  gap: 14px;
}

.icon-badge,
.brand span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 800;
}

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

h1 {
  font-size: clamp(30px, 6vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.agent-header p,
.call-heading p,
.hint-box p,
small {
  color: var(--muted);
}

.agent-header p {
  font-size: 18px;
}

.prompt-box {
  display: block;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--muted-surface);
  overflow: hidden;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--foreground);
  font: inherit;
  padding: 12px 14px;
}

.prompt-box textarea {
  min-height: 200px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  padding: 20px 24px;
}

.hint-box {
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--primary-soft);
}

.hint-box span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.hint-box p {
  font-size: 15px;
  line-height: 1.5;
}

button {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary,
.answer {
  min-height: 58px;
  border-radius: 16px;
  background: var(--primary);
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 12px 28px #ff840026;
}

.call-agent {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 68px;
  font-size: 22px;
}

.primary:disabled,
.answer:disabled {
  cursor: wait;
  opacity: 0.72;
}

.error {
  min-height: 20px;
  color: var(--danger);
  font-size: 14px;
}

.card {
  overflow: hidden;
}

.top-bar {
  position: relative;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.brand {
  gap: 12px;
  font-size: 22px;
}

.brand span {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 14px;
}

.status-badge {
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

.status-badge.active {
  background: #fff3e0;
  color: var(--primary);
}

.status-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.jobs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
}

.job {
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
}

.job .number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.job div {
  flex: 1;
}

.badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.badge.offered_to_widget,
.badge.claimed,
.badge.in_progress {
  background: #fff3e0;
  color: var(--primary);
}

.badge.done {
  background: var(--success-soft);
  color: var(--success);
}

.call-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 760px;
  padding: 48px 48px 40px;
  box-shadow: var(--shadow);
}

.call-progress {
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
}

.call-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: center;
}

.call-heading p {
  font-size: 20px;
}

.call-heading h2 {
  font-size: clamp(26px, 5vw, 32px);
  line-height: 1.2;
}

.company-dots {
  justify-content: center;
  gap: 10px;
}

.company-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
}

.company-dots .done {
  background: var(--success);
}

.company-dots .active {
  background: var(--primary);
}

.ring-orbit {
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary) 0 29px, #ff840018 30px 43px, #ff840010 44px 61px, #ff840008 62px 80px);
  border: 2px solid #ff840015;
}

.ring-orbit div {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 26px;
}

.call-meta {
  color: var(--foreground);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.persona {
  width: 100%;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--muted-surface);
  color: var(--foreground);
  line-height: 1.5;
}

.persona p {
  margin-top: 6px;
  color: var(--muted);
}

.result-summary {
  margin-top: 14px;
}

.result-summary strong {
  display: block;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-summary p {
  color: var(--foreground);
  font-size: 17px;
  line-height: 1.5;
}

.subtitles {
  width: 100%;
}

.subtitles h3 {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.subtitles-list {
  height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border-radius: 16px;
  background: var(--muted-surface);
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.subtitles-list::-webkit-scrollbar {
  display: none;
}

.subtitles-list p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  transition: color 160ms ease, font-size 160ms ease;
}

.subtitles-list p:last-child {
  color: var(--foreground);
  font-size: 19px;
  font-weight: 600;
}

.subtitles-list strong {
  display: block;
  color: var(--primary);
  font-size: 13px;
  margin-bottom: 4px;
}

.empty-subtitles {
  color: var(--muted) !important;
}

.actions {
  gap: 12px;
  width: 100%;
}

.actions button {
  flex: 1;
}

.decline {
  min-height: 58px;
  border-radius: 16px;
  background: var(--danger);
  color: #ffffff;
  font-size: 18px;
}

.voice-session {
  justify-content: center;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 700;
}

.connection-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
}

.call-timer {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffffff99;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.voice-session .decline {
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  border-radius: 16px;
  font-size: 18px;
}

.post-call-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ff840033;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.grid {
  display: grid;
  gap: 12px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#benchmark,
#ranking,
#call-results {
  padding: 0 28px 20px;
}

#benchmark {
  padding-top: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr.recommended td {
  background: var(--primary-soft);
}

pre {
  overflow: auto;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.incoming-answer {
  animation: pulse-answer 900ms ease-in-out 2;
}

@keyframes pulse-answer {
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 8px #ff840024;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  main {
    padding: 20px 14px 48px;
  }

  .prompt-form,
  .call-card {
    padding: 28px 20px;
  }

  .top-bar,
  .actions,
  .job {
    align-items: stretch;
    flex-direction: column;
  }

  .status-badge,
  .badge {
    width: fit-content;
  }

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

  .prompt-box textarea {
    font-size: 16px;
  }
}
