:root {
  --bg: #080d16;
  --bg-soft: #0d1422;
  --panel: rgba(17, 24, 39, 0.84);
  --panel-solid: #111827;
  --panel-border: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --muted: #9ca3af;
  --muted-strong: #cbd5e1;
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.15);
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1120px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.24), transparent 36rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.14), transparent 32rem),
    linear-gradient(180deg, #080d16 0%, #0b1020 50%, #080d16 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.7rem 1rem;
  color: var(--bg);
  background: var(--text);
  border-radius: 999px;
}

.skip-link:focus {
  top: 1rem;
}

.section-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(8, 13, 22, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), #22c55e);
  color: white;
  font-size: 0.9rem;
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.26);
}

.brand-text {
  font-size: 1.28rem;
}

.nav-links {
  display: flex;
  gap: 1.25rem;
  color: var(--muted-strong);
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  align-items: center;
  gap: 3rem;
  padding: 6rem 0 4.5rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #93c5fd;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 1.2rem;
  font-size: clamp(3rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 0.85rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 0.55rem;
  letter-spacing: -0.03em;
}

.hero-subtitle,
.section-heading p,
.split-section p,
.search-card p,
.empty-state p,
.feature-card p {
  color: var(--muted-strong);
  line-height: 1.68;
}

.hero-subtitle {
  max-width: 64ch;
  font-size: 1.16rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 1.8rem 0 1.05rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.84rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.button:hover,
.button:focus {
  transform: translateY(-1px);
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.28);
}

.button.secondary {
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
}

.button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.fine-print,
.field-group small {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel,
.search-card,
.feature-card,
.result-card,
.empty-state {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
  border-radius: var(--radius-xl);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.28);
  filter: blur(30px);
}

.panel-topline,
.advanced-row,
.result-meta,
.provider-badge {
  display: flex;
  align-items: center;
}

.panel-topline {
  position: relative;
  gap: 0.5rem;
  color: var(--muted-strong);
  font-weight: 700;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.12);
}

.mini-route {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2.25rem 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.route-line {
  flex: 1;
  height: 3px;
  min-width: 70px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.score-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.score-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.score-card strong {
  font-size: 1.5rem;
}

.score-pill {
  justify-self: start;
  padding: 0.35rem 0.58rem;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.16);
  font-size: 0.86rem;
  font-weight: 800;
}

.reason-list {
  padding-left: 1.1rem;
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.6;
}

.reason-list.compact {
  margin-top: 1rem;
}

.search-section {
  padding: 1.5rem 0 5rem;
}

.search-card {
  padding: clamp(1rem, 3vw, 1.5rem);
  border-radius: var(--radius-xl);
}

.compact-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr 0.9fr auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1.4rem;
}

.field-group {
  display: grid;
  gap: 0.42rem;
}

.field-group label {
  color: var(--muted-strong);
  font-weight: 700;
  font-size: 0.93rem;
}

.field-group input {
  width: 100%;
  min-height: 52px;
  padding: 0 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.26);
  outline: none;
}

.field-group input:focus {
  border-color: rgba(96, 165, 250, 0.72);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.submit-button {
  min-height: 52px;
  border-radius: 14px;
}

.button-spinner {
  display: none;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.is-loading .button-spinner {
  display: inline-block;
}

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

.advanced-row {
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

.text-button {
  padding: 0;
  border: 0;
  color: #93c5fd;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.provider-badge {
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255,255,255,0.04);
  font-size: 0.9rem;
}

.provider-badge::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.advanced-fields {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.results-region {
  margin-top: 1.4rem;
}

.empty-state {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.results-header p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.result-card {
  padding: 1.2rem;
  border-radius: var(--radius-lg);
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.option-label {
  margin-bottom: 0.35rem;
  color: #93c5fd;
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.option-title {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.probability-ring {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  border: 7px solid rgba(34, 197, 94, 0.8);
  background: rgba(34, 197, 94, 0.08);
  text-align: center;
}

.probability-value {
  font-weight: 900;
  font-size: 1.15rem;
}

.probability-caption {
  margin-top: -0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-meta {
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.95rem 0;
}

.meta-pill {
  padding: 0.36rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(255,255,255,0.04);
  font-size: 0.87rem;
  font-weight: 700;
}

.risk-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}

.risk-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
}

.result-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.result-body h4 {
  margin: 0 0 0.45rem;
}

.warnings-wrap:empty {
  display: none;
}

.components-details {
  margin-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  padding-top: 0.8rem;
  color: var(--muted-strong);
}

.components-details summary {
  cursor: pointer;
  font-weight: 800;
}

.components-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem 1rem;
  margin: 0.8rem 0 0;
}

.components-list dt {
  color: var(--muted);
}

.components-list dd {
  margin: 0;
  color: var(--text);
}

.content-grid,
.split-section {
  padding: 5rem 0;
}

.section-heading {
  max-width: 760px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}

.feature-card {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
}

.feature-number {
  display: inline-block;
  margin-bottom: 1rem;
  color: #93c5fd;
  font-weight: 900;
}

.split-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 0;
}

.error-box {
  padding: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.36);
  border-radius: var(--radius-md);
  color: #fecaca;
  background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 900px) {
  .hero,
  .split-section {
    grid-template-columns: 1fr;
  }

  .search-form {
    grid-template-columns: 1fr 1fr;
  }

  .submit-button,
  .date-field,
  .party-field {
    grid-column: span 1;
  }

  .feature-grid,
  .result-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 4rem;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .result-header,
  .results-header,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .probability-ring {
    width: 76px;
    height: 76px;
  }
}
