:root {
  --bg-top: #d7e0ea;
  --bg-bottom: #b2bfce;
  --ink-strong: #192230;
  --ink: #334155;
  --ink-soft: #5b6b80;
  --line: rgba(111, 128, 150, 0.18);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --shadow-lg: 0 30px 80px rgba(44, 62, 80, 0.14);
  --shadow-md: 0 18px 40px rgba(44, 62, 80, 0.1);
  --shadow-sm: 0 10px 24px rgba(44, 62, 80, 0.08);
  --green: #1e9c63;
  --green-soft: rgba(30, 156, 99, 0.12);
  --amber: #d98e2f;
  --amber-soft: rgba(217, 142, 47, 0.12);
  --red: #cc5a43;
  --red-soft: rgba(204, 90, 67, 0.12);
  --blue: #5d84d8;
  --blue-soft: rgba(93, 132, 216, 0.14);
  --purple: #5b2ea6;
  --purple-deep: #472186;
  --purple-soft: rgba(91, 46, 166, 0.16);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 34%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.backdrop-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(36px);
  opacity: 0.85;
}

.orb-a {
  width: 320px;
  height: 320px;
  top: -80px;
  right: 12%;
  background: rgba(140, 212, 181, 0.28);
}

.orb-b {
  width: 260px;
  height: 260px;
  left: -70px;
  top: 32%;
  background: rgba(135, 170, 223, 0.24);
}

.orb-c {
  width: 240px;
  height: 240px;
  right: 8%;
  bottom: 8%;
  background: rgba(255, 207, 146, 0.2);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 24px 40px;
}

.glass-panel {
  background: var(--glass);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow-md);
}

.announcement-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 999px;
  padding: 12px 18px;
  margin-bottom: 18px;
  color: var(--ink-strong);
  font-weight: 600;
}

.announcement-copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.announcement-copy span:last-child {
  min-width: 0;
}

.announcement-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.announcement-button {
  appearance: none;
  border: 1px solid rgba(91, 46, 166, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-strong);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.announcement-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(44, 62, 80, 0.12);
}

.announcement-button-strong {
  background: linear-gradient(180deg, rgba(91, 46, 166, 0.96), rgba(71, 33, 134, 0.94));
  color: #fff;
  border-color: rgba(71, 33, 134, 0.38);
}

.announcement-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3ec68a, #1e9c63);
  box-shadow: 0 0 0 6px rgba(62, 198, 138, 0.14);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius-xl);
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.hero h1,
.section-header h2,
.detail-header h2,
.login-copy h1 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  color: var(--ink-strong);
}

.hero h1,
.login-copy h1 {
  font-size: clamp(1.7rem, 2.3vw, 2.85rem);
  line-height: 1.08;
  max-width: 14ch;
}

.hero-subtitle,
.section-copy,
.metric-footnote,
.helper-copy,
.empty-copy,
.calculator-footnote {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.hero-subtitle {
  max-width: 64ch;
  font-size: 1rem;
  margin-top: 16px;
}

.hero-copy > .hero-subtitle:first-of-type {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.hero-signoff-wrap {
  margin: 16px 0 0;
}

.hero-signoff {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(38, 52, 72, 0.92);
  text-decoration: none;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.48), rgba(255, 255, 255, 0.22));
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 10px 24px rgba(78, 96, 120, 0.1);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.hero-signoff:hover {
  transform: translateY(-1px);
  color: rgba(25, 34, 48, 0.98);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.3));
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 14px 28px rgba(78, 96, 120, 0.14);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: start;
}

.stat-card {
  border-radius: var(--radius-lg);
  padding: 18px;
  background: var(--glass-strong);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-sm);
}

.stat-card-wide {
  grid-column: 1 / -1;
}

.stat-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
  margin-bottom: 10px;
}

.stat-value {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--ink-strong);
}

.stat-subtext {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  position: sticky;
  top: 12px;
  z-index: 30;
  padding: 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 22px;
}

.toolbar-left {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) repeat(2, minmax(180px, 0.5fr));
  gap: 14px;
}

.toolbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(125, 143, 166, 0.2);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-strong);
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(91, 46, 166, 0.4);
  box-shadow: 0 0 0 4px rgba(91, 46, 166, 0.12);
  transform: translateY(-1px);
}

.secondary-button,
.primary-button,
.card-button {
  appearance: none;
  border: none;
  cursor: pointer;
}

.secondary-button,
.primary-button {
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.secondary-button {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-strong);
}

.secondary-button-soft {
  background: rgba(255, 255, 255, 0.64);
}

.primary-button {
  background: linear-gradient(180deg, rgba(91, 46, 166, 0.97), rgba(71, 33, 134, 0.94));
  color: #fff;
}

.secondary-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(44, 62, 80, 0.12);
}

.split-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 22px;
  align-items: start;
}

.results-column {
  min-width: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.55rem;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.result-card {
  border-radius: var(--radius-lg);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  overflow: hidden;
}

.result-card:hover,
.result-card.is-active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.result-card.is-active {
  border-color: rgba(93, 132, 216, 0.34);
}

.card-button {
  width: 100%;
  text-align: left;
  background: transparent;
  padding: 22px;
  color: inherit;
}

.card-topline,
.detail-header-top,
.metric-grid,
.notes-list {
  display: grid;
  gap: 14px;
}

.card-topline {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 16px;
}

.card-title {
  margin: 0 0 6px;
  font-size: 1.3rem;
  color: var(--ink-strong);
}

.card-meta,
.detail-meta,
.pill-row,
.note-meta,
.empty-state {
  color: var(--ink-soft);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.95rem;
}

.dealer-pill,
.score-pill,
.label-pill,
.highlight-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dealer-pill {
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-strong);
  box-shadow: inset 0 0 0 1px rgba(111, 128, 150, 0.12);
}

.dealer-pill.tie {
  background: var(--blue-soft);
  color: #2a4f96;
}

.dealer-pill.invalid {
  background: var(--amber-soft);
  color: #9c6820;
}

.card-scoreline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.score-pill {
  background: var(--green-soft);
  color: var(--green);
}

.score-pill.weak {
  background: var(--amber-soft);
  color: #8c611c;
}

.score-pill.unranked {
  background: rgba(111, 128, 150, 0.12);
  color: var(--ink-soft);
}

.score-pill.success {
  background: var(--green-soft);
  color: var(--green);
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

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

.result-card .metric-card:first-child {
  grid-column: 1 / -1;
}

.metric-card,
.summary-card,
.calculator-output {
  border-radius: var(--radius-md);
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.68);
  min-width: 0;
  box-shadow: 0 10px 22px rgba(67, 83, 104, 0.08);
}

.metric-label,
.summary-label,
.calculator-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.metric-value,
.summary-value,
.calculator-value {
  display: block;
  color: var(--ink-strong);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.metric-value.positive,
.summary-value.positive,
.calculator-value.positive {
  color: var(--green);
}

.metric-value.warning,
.summary-value.warning,
.calculator-value.warning {
  color: var(--amber);
}

.metric-value.negative,
.summary-value.negative,
.calculator-value.negative {
  color: var(--red);
}

.metric-footnote {
  margin-top: 14px;
  font-size: 0.92rem;
}

.card-footer {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.result-card .metric-value {
  font-size: 0.94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

.detail-column {
  position: relative;
  min-width: 0;
}

.detail-panel {
  position: sticky;
  top: 24px;
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-xl);
  padding: 24px;
  overflow: hidden;
}

.detail-placeholder {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 18px;
  color: var(--ink-soft);
}

.placeholder-mark {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  margin: 0 auto 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(225, 232, 242, 0.9));
  color: var(--ink-strong);
  box-shadow: var(--shadow-sm);
}

.placeholder-mark svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.detail-layout {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.detail-layout > * {
  min-width: 0;
  max-width: 100%;
}

.detail-header-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  min-width: 0;
}

.detail-header-top > * {
  min-width: 0;
}

.detail-header h2 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 10px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-size: 0.95rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.label-pill {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink-strong);
}

.label-pill.success {
  background: var(--green-soft);
  color: var(--green);
}

.label-pill.info {
  background: var(--blue-soft);
  color: #2a4f96;
}

.label-pill.warn,
.label-pill.weak {
  background: var(--amber-soft);
  color: #8c611c;
}

.label-pill.unranked {
  background: rgba(111, 128, 150, 0.12);
  color: var(--ink-soft);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.table-panel,
.calculator-panel,
.notes-panel {
  border-radius: var(--radius-lg);
  padding: 20px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.68);
  min-width: 0;
  max-width: 100%;
}

.panel-title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--ink-strong);
}

.helper-copy,
.calculator-footnote {
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.pricing-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(111, 128, 150, 0.12);
}

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.pricing-table th,
.pricing-table td {
  padding: 14px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(111, 128, 150, 0.1);
  vertical-align: top;
}

.pricing-table thead th {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
  background: rgba(249, 251, 254, 0.72);
  position: sticky;
  top: 0;
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody tr.highlighted-row {
  background: linear-gradient(90deg, rgba(30, 156, 99, 0.12), rgba(255, 255, 255, 0.78));
}

.pricing-table tbody tr.invalid-row {
  background: linear-gradient(90deg, rgba(217, 142, 47, 0.08), rgba(255, 255, 255, 0.6));
}

.cell-strong {
  font-weight: 800;
  color: var(--ink-strong);
}

.cell-sub {
  display: block;
  margin-top: 5px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.highlight-pill {
  background: var(--green-soft);
  color: var(--green);
}

.row-badge-wrap {
  margin-top: 8px;
}

.calculator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.calculator-grid .field input {
  background: rgba(255, 255, 255, 0.78);
}

.calculator-output-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.notes-list {
  gap: 12px;
}

.note-card {
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.note-card h4 {
  margin: 0 0 8px;
  color: var(--ink-strong);
  font-size: 1rem;
}

.note-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.note-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

.note-link {
  margin-top: 10px;
}

.empty-state,
.loading-state,
.empty-results {
  padding: 26px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  border: 1px dashed rgba(111, 128, 150, 0.22);
  color: var(--ink-soft);
}

.empty-results h3 {
  margin: 0 0 8px;
  color: var(--ink-strong);
}

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  border-radius: var(--radius-xl);
  padding: 30px;
  width: min(100%, 560px);
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.login-copy {
  text-align: center;
}

.login-copy .hero-subtitle {
  margin-left: auto;
  margin-right: auto;
}

.login-status {
  min-height: 1.4em;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 1380px) {
  .detail-header-top,
  .summary-grid {
    grid-template-columns: 1fr;
  }
}

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

  .detail-panel {
    position: static;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-left,
  .results-grid {
    grid-template-columns: 1fr;
  }

  .announcement-bar {
    align-items: stretch;
    border-radius: 28px;
    flex-direction: column;
  }

  .announcement-actions {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .page-shell,
  .login-shell {
    padding: 18px 14px 28px;
  }

  .hero,
  .toolbar,
  .detail-panel,
  .login-panel {
    padding: 18px;
  }

  .metric-grid,
  .summary-grid,
  .calculator-grid,
  .calculator-output-grid,
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .result-card .metric-card:first-child,
  .stat-card-wide {
    grid-column: auto;
  }

  .section-header,
  .toolbar-right,
  .announcement-actions {
    align-items: start;
    flex-direction: column;
  }

  .announcement-button {
    width: 100%;
    justify-content: center;
  }
}
