:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #64748b;
  --line: #dfe7f1;
  --page: #f6f9fc;
  --panel: rgba(255, 255, 255, 0.92);
  --accent: #0f766e;
  --accent-dark: #0f5f64;
  --strong-chance: #15965f;
  --good-chance: #2563eb;
  --near-cutoff: #d97706;
  --outside-range: #e11d48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(125, 211, 252, 0.28), transparent 22%),
    linear-gradient(135deg, #f8fbff 0%, #eef7fb 48%, #f9fbff 100%);
  color: var(--ink);
}

.shell {
  display: grid;
  grid-template-columns: minmax(300px, 390px) 1fr;
  gap: 22px;
  min-height: 100vh;
  padding: 18px 22px;
}

.panel,
.results {
  border: 1px solid rgba(209, 221, 234, 0.82);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.filters {
  align-self: start;
  position: sticky;
  top: 18px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.25);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 23px;
  line-height: 1.15;
}

.brand p,
.hero p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #142033;
  font-size: 15px;
  font-weight: 900;
}

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

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

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

label,
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label,
.field-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cfdbe8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

input:focus,
select:focus {
  border-color: #67c4c0;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
  outline: none;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 42px;
  border: 1px solid #cfdbe8;
  border-radius: 8px;
  background: #edf6f7;
  padding: 3px;
}

.segmented label {
  display: block;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 6px;
}

.segmented input:checked + span {
  background: white;
  color: var(--accent-dark);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.primary,
.secondary {
  min-height: 44px;
  border-radius: 9px;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, #0f766e, #0f5f64);
  color: white;
  padding: 12px 16px;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.22);
}

.secondary {
  border: 1px solid #cfdbe8;
  background: white;
  color: var(--accent-dark);
  padding: 10px 12px;
}

.primary:hover,
.secondary:hover {
  filter: brightness(0.98);
}

.tip-card {
  display: grid;
  gap: 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fffbea, #e8f7ff);
  padding: 15px;
  color: #334155;
}

.tip-card strong {
  color: #0f5f64;
  font-size: 14px;
}

.tip-card p {
  color: #526173;
  font-size: 13px;
  line-height: 1.45;
}

.results {
  min-width: 0;
  padding: 26px 30px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(220px, 280px);
  gap: 18px;
  align-items: start;
  margin-bottom: 24px;
}

.hero h2 {
  font-size: 27px;
  letter-spacing: 0;
}

.hero input {
  align-self: start;
  padding-left: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid #d9e4ef;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #475569;
  padding: 10px 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.tab.active {
  border-color: transparent;
  background: linear-gradient(135deg, #0f766e, #0f5f64);
  color: white;
}

.tab span {
  display: grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  font-size: 12px;
}

.tab.active span {
  background: rgba(255, 255, 255, 0.24);
  color: white;
}

.result-filters {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.1fr) minmax(120px, 150px) minmax(120px, 150px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
  padding: 14px;
  border: 1px solid #e0e8f2;
  border-radius: 12px;
  background: rgba(248, 251, 255, 0.8);
}

.cards {
  display: grid;
  gap: 16px;
}

.cards.empty {
  min-height: 280px;
  place-items: center;
  color: var(--muted);
  border: 1px dashed #cad7e5;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.card {
  display: grid;
  border: 1px solid #dfe8f2;
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.card.strong-chance {
  border-left-color: var(--strong-chance);
}

.card.good-chance {
  border-left-color: var(--good-chance);
}

.card.near-cutoff {
  border-left-color: var(--near-cutoff);
}

.card.outside-range {
  border-left-color: var(--outside-range);
}

.card-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card h3 {
  margin: 0;
  max-width: 900px;
  font-size: 21px;
  line-height: 1.25;
}

.meta,
.id-row,
.metrics,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta {
  margin-top: 6px;
  color: #53647a;
  font-size: 14px;
}

.meta span + span::before {
  content: "/";
  margin-right: 8px;
  color: #94a3b8;
}

.id-row {
  margin-top: 9px;
}

.id-chip,
.chip,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
}

.id-chip {
  gap: 7px;
  border: 1px solid #c6e5eb;
  background: #edf9fb;
  color: #164e63;
}

.id-chip span {
  color: #527587;
}

.id-chip strong {
  color: #123d45;
}

.badge {
  align-self: start;
  border: 1px solid currentColor;
  background: white;
}

.badge.strong-chance {
  color: var(--strong-chance);
}

.badge.good-chance {
  color: var(--good-chance);
}

.badge.near-cutoff {
  color: var(--near-cutoff);
}

.badge.outside-range {
  color: var(--outside-range);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.metric {
  min-width: 0;
  border: 1px solid #edf2f7;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px 14px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.metric.closing strong {
  color: var(--strong-chance);
}

.metric.margin strong {
  color: #e11d48;
}

.metric.fees strong {
  color: #7c3aed;
}

.metric.demand strong {
  color: #ea580c;
}

.chip {
  background: #eef2f7;
  color: #344256;
}

.chip.bifocal {
  max-width: 100%;
  background: #e0f2fe;
  color: #075985;
}

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

  .filters {
    position: static;
  }

  .result-filters,
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 12px;
  }

  .results,
  .filters {
    padding: 16px;
  }

  .two,
  .result-filters,
  .metrics {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
  }
}
