:root {
  --green-950: #082f26;
  --green-900: #0a3d2e;
  --green-700: #236b5b;
  --green-600: #2f7f6d;
  --green-200: #b9d9cf;
  --green-100: #dfeee9;
  --sand-100: #f7f1e6;
  --sand-200: #f0e6d2;
  --white: #ffffff;
  --red-700: #9f2d21;
  --shadow: rgba(5, 37, 29, 0.24);
  --border: rgba(10, 61, 46, 0.18);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--green-950);
  background:
    radial-gradient(circle at 10% 10%, rgba(185, 217, 207, 0.24), transparent 28rem),
    linear-gradient(145deg, var(--green-950), var(--green-700));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  place-items: center;
}

.candidate-card {
  width: min(920px, 100%);
  min-height: min(760px, calc(100dvh - 2rem));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 1.75rem;
  box-shadow: 0 1.5rem 4rem var(--shadow);
}

.candidate-header {
  min-height: 8rem;
  padding: 1.4rem clamp(1.2rem, 4vw, 2.4rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  color: var(--white);
  background: var(--green-900);
  border-bottom: 4px solid var(--green-600);
}

.brand-mark {
  width: 3.6rem;
  height: 3.6rem;
  display: grid;
  place-items: center;
  color: var(--green-900);
  background: var(--sand-200);
  border-radius: 1.1rem 1.1rem 1.1rem 0.3rem;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--green-600);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.candidate-header .eyebrow {
  color: var(--green-200);
}

.candidate-header h1 {
  margin: 0;
  color: var(--sand-100);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.header-copy {
  margin: 0.35rem 0 0;
  color: var(--green-100);
  font-size: 0.9rem;
}

.network-pill {
  min-height: 2rem;
  padding: 0.42rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--sand-100);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.network-pill::before {
  width: 0.5rem;
  height: 0.5rem;
  content: "";
  background: var(--green-200);
  border-radius: 50%;
}

.network-pill[data-state="offline"]::before {
  background: var(--sand-200);
}

.state-panel,
.job-view {
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem) 0;
}

.state-panel {
  align-self: center;
}

.state-panel--center {
  text-align: center;
}

.state-panel h2,
.job-heading h2 {
  margin: 0 0 0.75rem;
  color: var(--green-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  line-height: 1.12;
}

.state-panel p {
  max-width: 38rem;
  margin: 0.75rem auto;
}

.state-panel label {
  display: block;
  margin: 1.5rem 0 0.5rem;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 0.8rem;
  overflow: hidden;
  accent-color: var(--green-600);
  border: 0;
  border-radius: 999px;
}

.resume-form {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
}

.privacy-detail {
  margin-top: 1.5rem;
  padding: 1.15rem;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
}

.privacy-detail h3 {
  margin: 0 0 0.8rem;
  color: var(--green-900);
  font-size: 1rem;
}

.privacy-detail dl {
  margin: 0 0 0.8rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.5rem;
}

.privacy-detail dt {
  color: var(--green-700);
  font-size: 0.75rem;
  font-weight: 800;
}

.privacy-detail dd {
  margin: 0.15rem 0 0;
}

.privacy-detail a {
  color: var(--green-700);
  font-weight: 800;
}

.privacy-detail small {
  display: block;
  margin-top: 0.35rem;
  color: var(--green-700);
}

.identity-form {
  margin-top: 1.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.identity-form label {
  margin: 0;
  font-weight: 700;
}

.identity-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 2.8rem;
  margin-top: 0.3rem;
  padding: 0.65rem 0.75rem;
  color: var(--green-950);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.identity-form input:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

.optional {
  color: var(--green-700);
  font-size: 0.74rem;
  font-weight: 500;
}

.acknowledgement {
  margin-top: 1.2rem !important;
  padding: 1rem;
  display: flex !important;
  align-items: flex-start;
  gap: 0.7rem;
  background: var(--green-100);
  border-radius: 0.8rem;
}

.acknowledgement input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
  accent-color: var(--green-900);
}

.resume-form label {
  margin-top: 0;
}

.resume-form input[type="file"] {
  width: 100%;
  padding: 0.75rem;
  color: var(--green-950);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.resume-form input[type="file"]:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

.resume-form small {
  display: block;
  margin-top: 0.45rem;
  color: var(--green-700);
}

.field-error {
  min-height: 1.5rem;
  margin: 0.55rem 0 0;
  color: var(--red-700);
  font-size: 0.85rem;
  font-weight: 700;
}

.transcript {
  max-height: 24rem;
  margin: 1.25rem 0;
  padding: 0;
  overflow-y: auto;
  display: grid;
  gap: 0.75rem;
  list-style: none;
}

.transcript li {
  max-width: 82%;
  padding: 0.8rem 1rem;
  white-space: pre-wrap;
  background: var(--green-100);
  border-radius: 1rem 1rem 1rem 0.25rem;
}

.transcript li[data-role="candidate"] {
  margin-left: auto;
  background: var(--sand-100);
  border-radius: 1rem 1rem 0.25rem 1rem;
}

.transcript strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--green-700);
  font-size: 0.75rem;
}

.voice-controls {
  margin: 1rem 0;
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem 1rem;
  background: var(--green-100);
  border: 1px solid var(--green-200);
  border-radius: 1rem;
}

.voice-controls h3,
.voice-controls p {
  margin: 0;
}

.voice-controls h3 {
  color: var(--green-900);
  font-size: 1rem;
}

.voice-controls p {
  margin-top: 0.25rem;
  font-size: 0.82rem;
}

.voice-disclosure {
  color: var(--green-700);
  font-weight: 700;
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.button--voice {
  color: var(--white);
  background: var(--green-700);
}

.button--voice[aria-pressed="true"] {
  background: var(--red-700);
}

.voice-actions .button--secondary {
  margin-top: 0;
}

.voice-status {
  grid-column: 1 / -1;
  min-height: 1.5rem;
  color: var(--green-700);
  font-weight: 700;
}

.voice-caption,
.voice-final-label,
.voice-final,
.voice-confirm {
  grid-column: 1 / -1;
}

.voice-caption {
  min-height: 1.5rem;
  padding: 0.55rem 0.7rem;
  color: var(--green-950);
  background: var(--white);
  border-radius: 0.6rem;
  font-style: italic;
}

.voice-final-label {
  font-size: 0.82rem;
  font-weight: 800;
}

.voice-final {
  width: 100%;
  padding: 0.7rem;
  resize: vertical;
  color: var(--green-950);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  font: inherit;
}

.voice-final:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

.voice-confirm.button--primary {
  margin-top: 0;
}

.voice-status[data-state="listening"]::before,
.voice-status[data-state="speaking"]::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  content: "";
  background: var(--red-700);
  border-radius: 50%;
}

.message-form textarea {
  width: 100%;
  padding: 0.75rem;
  resize: vertical;
  color: var(--green-950);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  font: inherit;
}

.message-form textarea:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 2px;
}

.interview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .voice-controls {
    grid-template-columns: 1fr;
  }

  .voice-actions {
    justify-content: stretch;
  }

  .voice-actions .button {
    width: 100%;
  }
}

.state-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--red-700);
  border-radius: 50%;
  font-size: 1.65rem;
  font-weight: 800;
}

.state-icon--success {
  margin-left: 0;
  color: var(--green-950);
  background: var(--green-200);
}

.spinner {
  width: 2.7rem;
  height: 2.7rem;
  margin: 0 auto 1.4rem;
  display: block;
  border: 4px solid var(--green-100);
  border-top-color: var(--green-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.job-heading {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.job-tags span {
  padding: 0.35rem 0.65rem;
  color: var(--green-900);
  background: var(--green-100);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.job-content {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(12rem, 1fr);
  gap: clamp(1.5rem, 5vw, 3rem);
  padding: 1.7rem 0;
}

.job-content h3 {
  margin: 0 0 0.65rem;
  color: var(--green-900);
  font-size: 1rem;
}

.job-description {
  margin: 0;
  white-space: pre-wrap;
}

.benefits {
  margin: 0;
  padding-left: 1.2rem;
}

.benefits li + li {
  margin-top: 0.4rem;
}

.privacy-summary {
  padding: 1rem 1.15rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem 1rem;
  background: var(--sand-100);
  border: 1px solid var(--sand-200);
  border-radius: 1rem;
}

.privacy-summary p {
  grid-row: span 2;
  margin: 0;
  font-size: 0.86rem;
}

.privacy-summary a {
  color: var(--green-700);
  font-size: 0.82rem;
  font-weight: 800;
}

.privacy-summary small {
  color: var(--green-700);
}

.inline-notice {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--green-700);
  font-size: 0.85rem;
  font-weight: 700;
}

.button {
  min-height: 3rem;
  padding: 0.75rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  cursor: pointer;
  font-weight: 800;
}

.button--primary {
  width: 100%;
  margin-top: 0.75rem;
  color: var(--white);
  background: var(--green-900);
}

.button--secondary {
  margin-top: 1rem;
  color: var(--green-900);
  background: var(--white);
  border-color: var(--green-600);
}

.button:hover {
  filter: brightness(1.08);
}

.button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--green-600);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.reference {
  color: var(--green-700);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
}

.candidate-footer {
  padding: 0.85rem clamp(1.2rem, 4vw, 2.4rem) calc(0.85rem + var(--safe-bottom));
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--green-900);
  background: var(--sand-200);
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 0;
  }

  .candidate-card {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .candidate-header {
    grid-template-columns: auto 1fr;
    padding: 1rem;
  }

  .network-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .state-panel,
  .job-view {
    width: calc(100% - 2rem);
  }

  .job-content {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .privacy-detail dl {
    grid-template-columns: 1fr;
  }

  .privacy-summary {
    grid-template-columns: 1fr;
  }

  .privacy-summary p {
    grid-row: auto;
  }

  .candidate-footer {
    flex-direction: column;
    padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
  }
}
