:root {
  color-scheme: dark;
  --ink: #f6f8fb;
  --muted: #9ba8b8;
  --panel: #111923;
  --panel-soft: #172230;
  --line: #283547;
  --accent: #3ce0a3;
  --accent-dark: #102d27;
  --warning: #ffb454;
  --danger: #ff647c;
  --page: #091018;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 80% 0%, rgba(60, 224, 163, 0.1), transparent 30rem),
    var(--page);
  color: var(--ink);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header,
main,
footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border: 1px solid rgba(60, 224, 163, 0.6);
  border-radius: 12px;
  background: var(--accent-dark);
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 0.16rem;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255, 180, 84, 0.12);
}

.service-state.ready .state-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(60, 224, 163, 0.12);
}

.service-state.failed .state-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 100, 124, 0.12);
}

.hero {
  min-height: 370px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.7fr);
  align-items: center;
  gap: 4rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 1rem;
  font-size: clamp(2.3rem, 5vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}

.hero-copy {
  max-width: 670px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.model-facts {
  margin: 0;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(17, 25, 35, 0.78);
}

.model-facts div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.model-facts div:last-child {
  border-bottom: 0;
}

.model-facts dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.model-facts dd {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 760;
}

.workspace,
.results {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(23, 34, 48, 0.94), rgba(13, 21, 30, 0.94));
  padding: clamp(1.2rem, 3vw, 2.2rem);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.7rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page);
}

.tab {
  border: 0;
  border-radius: 7px;
  padding: 0.6rem 0.85rem;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: var(--panel-soft);
  color: var(--ink);
}

.input-panel {
  display: none;
}

.input-panel.active {
  display: block;
}

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

label {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 650;
  letter-spacing: 0.025em;
}

input {
  width: 100%;
  margin-top: 0.42rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.78rem 0.85rem;
  outline: none;
  background: rgba(6, 12, 18, 0.72);
  color: var(--ink);
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(60, 224, 163, 0.11);
}

.span-2 {
  grid-column: span 2;
}

.primary-action {
  margin-top: 1.35rem;
  border: 0;
  border-radius: 10px;
  padding: 0.82rem 1.05rem;
  background: var(--accent);
  color: #062118;
  font-weight: 800;
}

.primary-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.upload-zone {
  padding: 2.4rem;
  border: 1px dashed #43546a;
  border-radius: 14px;
  text-align: center;
  background: rgba(6, 12, 18, 0.35);
}

.upload-zone input {
  max-width: 600px;
  margin-inline: auto;
}

.upload-zone p {
  max-width: 680px;
  margin: 1rem auto 0;
  color: var(--muted);
  line-height: 1.6;
}

.notice {
  margin-top: 1rem;
  border: 1px solid rgba(255, 100, 124, 0.4);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(255, 100, 124, 0.08);
  color: #ffc2cc;
}

.results {
  margin-top: 1.25rem;
}

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

.result-list {
  display: grid;
  gap: 1rem;
}

.risk-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1.4rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 18, 0.5);
}

.risk-score {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 150px;
  border-radius: 12px;
  background: var(--accent-dark);
}

.risk-card.flagged .risk-score {
  background: rgba(255, 100, 124, 0.12);
}

.risk-score strong {
  font-size: 2.2rem;
}

.risk-score span {
  color: var(--muted);
  font-size: 0.8rem;
}

.risk-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.risk-header h3 {
  margin: 0 0 0.25rem;
}

.risk-header p,
.driver-list {
  color: var(--muted);
  font-size: 0.85rem;
}

.decision {
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  background: rgba(60, 224, 163, 0.12);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.flagged .decision {
  background: rgba(255, 100, 124, 0.12);
  color: var(--danger);
}

.driver-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 1rem;
  margin: 1rem 0;
  padding: 0;
  list-style: none;
}

.driver-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(40, 53, 71, 0.6);
  padding-bottom: 0.35rem;
}

.review-actions {
  display: flex;
  gap: 0.55rem;
}

.review-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.72rem;
  background: var(--panel-soft);
  color: var(--ink);
}

.review-actions button:hover {
  border-color: var(--accent);
}

footer {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-block: 4rem;
  }

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

@media (max-width: 620px) {
  .site-header,
  .section-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    justify-content: center;
    padding-block: 1rem;
  }

  .form-grid,
  .risk-card {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .driver-list {
    grid-template-columns: 1fr;
  }
}
