:root {
  color-scheme: light;
  --ink: #071426;
  --muted: #5d6b78;
  --line: #d8e5e3;
  --paper: #f6fbfa;
  --panel: #ffffff;
  --teal: #071a2f;
  --navy: #071426;
  --cyan: #0f9be8;
  --aqua: #13cfc0;
  --mint: #25d98a;
  --green: #18b978;
  --amber: #d89b2b;
  --red: #c94c4c;
  --blue: #0f8fd3;
  --soft-panel: #f0f8f7;
  --hero-start: rgba(7, 20, 38, 0.95);
  --hero-end: rgba(15, 155, 232, 0.76);
  --shadow: 0 18px 44px rgba(7, 20, 38, 0.12);
}

body.dark-mode {
  color-scheme: dark;
  --ink: #f4fbff;
  --muted: #a9bbc8;
  --line: rgba(150, 206, 214, 0.22);
  --paper: #06111f;
  --panel: #0b1b2d;
  --teal: #071426;
  --navy: #050d18;
  --cyan: #1ca8ff;
  --aqua: #19ddce;
  --mint: #2df098;
  --green: #20cf86;
  --amber: #f3b84d;
  --red: #ff6b6b;
  --blue: #31b4ff;
  --soft-panel: #102437;
  --hero-start: rgba(5, 13, 24, 0.98);
  --hero-end: rgba(13, 102, 151, 0.88);
  --shadow: 0 20px 58px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.launch-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(237, 247, 245, 0.92)),
    radial-gradient(circle at 15% 15%, rgba(31, 184, 211, 0.24), transparent 30%),
    radial-gradient(circle at 86% 30%, rgba(38, 214, 139, 0.22), transparent 28%),
    #f7faf9;
}

.launch-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.launch-card {
  display: grid;
  gap: 20px;
  width: min(760px, 100%);
  padding: clamp(22px, 5vw, 46px);
  border: 1px solid rgba(18, 52, 59, 0.12);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 28px 80px rgba(18, 52, 59, 0.16);
}

.launch-logo {
  display: block;
  width: min(560px, 100%);
  margin: 0 auto;
}

.launch-copy {
  max-width: 580px;
  margin: 0 auto;
  color: var(--muted);
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.55;
}

.auth-panel {
  display: grid;
  gap: 12px;
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.text-button {
  min-height: 38px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-weight: 800;
}

.text-button.compact {
  min-height: 36px;
  padding: 6px 8px;
  color: var(--muted);
}

.auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.brand-card {
  display: block;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  background: linear-gradient(180deg, #071426 0%, #082845 34%, #0f8fd3 68%, #18b978 100%);
  color: #f6fbf8;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.14);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}


.brand span,
.link-step small,
.metric-card small,
.bill-card small,
.budget-card small,
.score-copy p,
.idea-list small {
  color: inherit;
  opacity: 0.72;
}

.nav-list {
  display: grid;
  gap: 10px;
}

.nav-item,
.mobile-tab {
  border: 0;
  text-align: left;
  color: inherit;
  background: transparent;
}

.nav-item {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.16);
}

.nav-item.active {
  color: #071426;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.72);
}

.main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 28px 108px;
}

.topbar,
.section-band,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(7, 20, 38, 0.08);
}

.toggle-track {
  position: relative;
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--mint));
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}

body.dark-mode .toggle-thumb {
  transform: translateX(18px);
}

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

body.dark-mode .mobile-tabs {
  background: rgba(11, 27, 45, 0.94);
}

body.dark-mode input,
body.dark-mode select {
  color: var(--ink);
  background: #102437;
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.primary-action,
.ghost-button,
.icon-button,
.filter-chip {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 9px 13px;
}

.primary-action {
  background: linear-gradient(180deg, var(--navy), var(--teal));
  color: white;
  border-color: var(--teal);
  font-weight: 800;
}

.primary-action.wide {
  width: 100%;
}

.ghost-button,
.filter-chip {
  color: var(--teal);
  background: var(--soft-panel);
  border-color: #d3e1dc;
  font-weight: 700;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--teal);
  background: var(--soft-panel);
  border-color: #d3e1dc;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-band,
.section-band {
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: center;
  min-height: 230px;
  padding: 28px;
  color: white;
  background:
    linear-gradient(135deg, rgba(18, 52, 59, 0.92), rgba(42, 157, 143, 0.8)),
    radial-gradient(circle at 80% 35%, rgba(240, 199, 110, 0.36), transparent 26%),
    var(--teal);
}

.hero-copy p {
  max-width: 680px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.hero-copy .eyebrow {
  color: #f0c76e;
}

.risk-meter,
.score-ring {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
}

.risk-meter {
  border: 10px solid rgba(240, 199, 110, 0.95);
  background: rgba(255, 255, 255, 0.1);
}

.risk-meter span,
.score-ring span {
  font-size: 2.55rem;
  font-weight: 900;
}

.risk-meter small,
.score-ring small {
  margin-top: -28px;
  opacity: 0.78;
}

.metric-grid,
.content-grid,
.budget-grid,
.bill-grid,
.credit-actions,
.coach-layout,
.settings-layout {
  display: grid;
  gap: 14px;
}

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

.content-grid,
.coach-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.metric-card,
.panel,
.bill-card,
.budget-card,
.setup-card,
.link-step,
.score-panel,
.coach-output,
.idea-card,
.credit-action,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.bill-card .label,
.budget-card .label {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.55rem;
}

.panel,
.coach-output {
  padding: 18px;
}

.bill-timeline,
.advice-list,
.import-list,
.idea-list,
.setup-track {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline-item,
.advice-item,
.import-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-panel);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.risk {
  background: var(--red);
}

.section-band {
  padding: 18px;
}

.step-pill {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--teal);
  background: var(--soft-panel);
  font-weight: 800;
}

.setup-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.setup-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: var(--blue);
  font-weight: 900;
}

.setup-card.complete .setup-number {
  background: var(--green);
}

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

.link-step {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.link-step span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  background: var(--muted);
  font-weight: 900;
}

.link-step.active {
  border-color: var(--amber);
}

.link-step.active span {
  background: var(--amber);
}

.link-step.complete span {
  background: var(--green);
}

.bill-buckets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.bill-bucket {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
}

.bill-bucket.active {
  color: white;
  background: linear-gradient(180deg, var(--navy), var(--teal));
  border-color: transparent;
}

.bucket-icon,
.bill-card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: linear-gradient(180deg, var(--cyan), var(--aqua));
  font-size: 0.72rem;
  font-weight: 900;
}

.provider-badge {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.66rem;
  letter-spacing: 0;
}

.provider-badge.netflix {
  background: #e50914;
  font-size: 1rem;
  font-family: Georgia, serif;
}

.provider-badge.hulu {
  color: #071426;
  background: #1ce783;
  font-size: 0.7rem;
}

.provider-badge.disney {
  background: linear-gradient(160deg, #113ccf, #071426);
  font-size: 0.78rem;
}

.provider-badge.prime {
  background: #00a8e1;
  font-size: 0.62rem;
}

.provider-badge.max {
  background: #2411db;
  font-size: 0.72rem;
}

.provider-badge.spotify {
  color: #071426;
  background: #1ed760;
  font-size: 0.92rem;
}

.provider-badge.apple {
  background: #111;
  font-size: 0.7rem;
}

.provider-badge.youtube {
  background: #ff0033;
  font-size: 0.78rem;
}

.provider-badge.peacock {
  background: linear-gradient(135deg, #4d2cff, #00a6ff, #ffe600, #ff7a00);
  font-size: 0.85rem;
}

.provider-badge.paramount {
  background: #0064ff;
  font-size: 0.72rem;
}

.bill-bucket.active .bucket-icon {
  background: rgba(255, 255, 255, 0.18);
}

.bucket-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.bucket-copy small {
  color: inherit;
  opacity: 0.7;
  font-size: 0.78rem;
}

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

.bill-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.bill-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bill-title-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.bill-card h3 {
  margin-bottom: 4px;
}

.amount {
  font-size: 1.35rem;
  font-weight: 900;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--teal);
  background: var(--soft-panel);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.warn {
  color: #6f4700;
  background: #fff0cf;
}

.tag.risk {
  color: #842626;
  background: #ffe0e0;
}

.statement-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.statement-strip div {
  min-height: 68px;
  padding: 10px;
  border-radius: 8px;
  background: var(--soft-panel);
}

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

.budget-card {
  padding: 16px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe8;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--mint);
}

.progress.warn span {
  background: var(--amber);
}

.progress.risk span {
  background: var(--red);
}

.budget-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.credit-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.score-panel {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
}

.score-ring {
  border: 12px solid var(--mint);
  background: var(--soft-panel);
}

.score-ring small {
  color: var(--muted);
}

.credit-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credit-action {
  padding: 16px;
}

.credit-action strong {
  display: block;
  margin-bottom: 8px;
}

.coach-output {
  min-height: 360px;
}

.plan-block {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 8px;
  background: var(--soft-panel);
}

.plan-block strong {
  display: block;
  margin-bottom: 7px;
}

.idea-card {
  padding: 14px;
}

.idea-card strong {
  display: block;
  margin-bottom: 6px;
}

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

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

.settings-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft-panel);
}

.settings-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--muted);
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button.danger {
  color: var(--red);
}

.empty-state {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: var(--muted);
  background: var(--soft-panel);
}

.empty-state strong {
  color: var(--ink);
}

.empty-state.wide {
  grid-column: 1 / -1;
}

.prosper-guide.hidden {
  display: none;
}

.prosper-guide {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

body.dark-mode .prosper-guide {
  background: rgba(11, 27, 45, 0.94);
}

.guide-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.prosper-guide p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.guide-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mobile-tabs {
  display: none;
}

dialog {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(18, 52, 59, 0.45);
}

.dialog-body {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--ink);
  background: var(--panel);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .main {
    padding: 18px 14px 90px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero-band,
  .content-grid,
  .credit-layout,
  .coach-layout,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .risk-meter {
    width: 150px;
  }

  .metric-grid,
  .bill-grid,
  .budget-grid,
  .credit-actions,
  .link-flow {
    grid-template-columns: 1fr;
  }

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

  .mobile-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .mobile-tab {
    min-height: 58px;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
  }

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

  .prosper-guide {
    right: 10px;
    bottom: 70px;
    left: 10px;
    width: auto;
  }
}

@media (max-width: 620px) {
  .topbar,
  .section-band,
  .panel-heading,
  .setup-card,
  .score-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .section-band {
    display: grid;
  }

  .hero-band {
    min-height: 0;
    padding: 20px;
  }

  .statement-strip,
  .timeline-item,
  .advice-item,
  .import-item,
  .settings-row,
  .prosper-guide,
  .settings-grid,
  .bill-buckets,
  .bill-card-header {
    grid-template-columns: 1fr;
  }

  .setup-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .setup-card .ghost-button {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: 2rem;
  }

  .auth-actions {
    grid-template-columns: 1fr;
  }

  .launch-card {
    padding: 20px;
  }}

