:root {
  color-scheme: light;
  --ink: #16202c;
  --muted: #627084;
  --quiet: #8b97a8;
  --line: #dbe3ec;
  --paper: #ffffff;
  --wash: #f5f7fa;
  --nav: #101828;
  --nav-2: #182231;
  --teal: #08756f;
  --teal-2: #0b615d;
  --blue: #285f9d;
  --amber: #9a6417;
  --danger: #a83f3f;
  --mint: #e9f7f3;
  --sky: #edf5ff;
  --cream: #fff7ea;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 16px 42px rgba(16, 24, 40, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--wash);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
}

a {
  color: inherit;
}

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

.app-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 20px 14px;
  color: #d9e3f0;
  background: var(--nav);
}

.brand-mark {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 2px;
  color: #fff;
  text-decoration: none;
}

.brand-mark span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #063d39;
  background: #81d8ce;
  font-weight: 950;
}

.brand-mark strong {
  font-size: 1.03rem;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  color: #c7d2e1;
  font-weight: 850;
  text-decoration: none;
}

.tab:hover {
  color: #fff;
  background: var(--nav-2);
}

.tab.active {
  color: #fff;
  background: var(--teal);
}

.nav-footer {
  display: grid;
  gap: 9px;
  padding: 16px 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-footer a {
  color: #b8c5d6;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-footer a:hover {
  color: #fff;
}

.app-main {
  width: min(1240px, 100%);
  padding: 28px 32px 34px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  margin-bottom: 18px;
}

.topbar-actions,
.action-stack,
.form-actions,
.plus-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 880px;
  margin-bottom: 8px;
  font-size: clamp(2.05rem, 3.1vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

.page-subtitle {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.5;
}

button,
.button-link,
.action-link {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 15px;
  color: #fff;
  background: var(--teal);
  box-shadow: var(--shadow-sm);
  font: inherit;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

button:hover,
.action-link:hover {
  background: var(--teal-2);
}

button.secondary,
.button-link.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

button.secondary:hover,
.button-link.secondary:hover {
  background: #f8fafc;
}

.mobile-menu {
  display: none;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.5fr) auto;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: #80c8bf;
  box-shadow: 0 0 0 4px rgba(8, 117, 111, 0.12);
}

.suggestion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.suggestion-chip {
  display: grid;
  max-width: 280px;
  min-height: 0;
  gap: 3px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  color: var(--ink);
  background: #f8fbfd;
  text-align: left;
  white-space: normal;
}

.suggestion-chip span,
.suggestion-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-chip span {
  font-size: 0.9rem;
}

.suggestion-chip small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.result-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin: 16px 0;
  padding: 12px 0;
}

.summary,
.muted,
.meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.decision-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 166px;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 22px;
}

.deal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 158px;
  border-radius: 8px;
  padding: 22px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.deal-copy {
  min-width: 0;
}

.deal-card h2 {
  margin: 12px 0 8px;
  font-size: clamp(1.6rem, 2.2vw, 2.8rem);
}

.deal-card p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.deal-price {
  min-width: 210px;
  padding: 16px;
  border-radius: 8px;
  background: var(--mint);
  text-align: right;
}

.deal-price span,
.deal-price small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.deal-price strong {
  display: block;
  margin: 4px 0;
  color: var(--teal-2);
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 0.95;
}

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

.action-stack button {
  width: 100%;
  min-height: 52px;
}

.page-grid {
  min-height: 470px;
}

.page-panel {
  display: none;
}

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

.page-head,
.subpanel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--teal-2);
  background: var(--mint);
  font-size: 0.76rem;
  font-weight: 950;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.bot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.price-list,
.source-list,
.plan-list {
  display: grid;
  gap: 12px;
}

.price-row,
.source-row,
.plan-row,
.subpanel,
.notice,
.plan-summary,
.account-form {
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
}

.price-row:first-child {
  background: #f1fbf8;
  box-shadow: 0 0 0 1px rgba(8, 117, 111, 0.18), var(--shadow-sm);
}

.price-row:hover,
.source-row:hover,
.plan-row:hover {
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
}

.retailer {
  color: var(--ink);
  font-weight: 950;
}

.trust-row {
  margin: 7px 0;
}

.trust-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.75rem;
  font-weight: 950;
}

.quality-official {
  color: var(--teal-2);
  background: var(--mint);
}

.quality-retailer {
  color: var(--blue);
  background: var(--sky);
}

.quality-user {
  color: var(--amber);
  background: var(--cream);
}

.quality-info {
  color: var(--muted);
  background: #eef2f6;
}

.out {
  color: var(--danger);
}

.price {
  min-width: 132px;
  text-align: right;
  font-size: 1.85rem;
  font-weight: 950;
}

.discount {
  margin-top: 5px;
  color: var(--teal-2);
  font-size: 0.78rem;
  font-weight: 950;
}

.action-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--teal-2);
  background: #fff;
  box-shadow: 0 0 0 1px rgba(8, 117, 111, 0.22) inset;
  font-size: 0.82rem;
}

.action-link:hover {
  color: #fff;
  box-shadow: none;
}

.source-section {
  display: grid;
  gap: 12px;
}

.source-section + .source-section {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.source-section h3 {
  margin: 0;
}

.source-row,
.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px;
}

.wallet-layout,
.details-grid {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.account-form,
.report-form,
.plan-form {
  display: grid;
  gap: 12px;
}

.account-form,
.subpanel,
.notice,
.plan-summary {
  padding: 16px;
}

.report-form {
  grid-template-columns: 1.2fr 0.7fr 0.7fr 0.8fr auto;
  align-items: end;
  padding: 16px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.plan-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  margin: 16px 0;
  padding: 16px;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.plan-form.single-action {
  grid-template-columns: minmax(0, 1fr) auto;
}

.match-card,
.kendra {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.match-card:first-child,
.kendra:first-child {
  border-top: 0;
}

.plan-saving {
  min-width: 125px;
  text-align: right;
  font-weight: 950;
}

.link-button {
  display: block;
  min-height: auto;
  margin-top: 8px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.8rem;
  text-align: right;
}

.link-button:hover {
  color: var(--teal-2);
  background: transparent;
}

.safety-note {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.safety-note strong {
  color: var(--ink);
}

.shell {
  width: min(920px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

.legal-page .app-header,
.hero {
  display: grid;
  gap: 14px;
}

.legal-panel {
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.legal-panel h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.legal-panel p,
.legal-panel li {
  color: var(--muted);
  line-height: 1.6;
}

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

  .app-nav {
    position: sticky;
    z-index: 30;
    height: auto;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    gap: 12px;
    padding: 10px 12px;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    gap: 7px;
  }

  .tab {
    min-height: 38px;
    padding: 0 13px;
  }

  .nav-footer {
    grid-column: 1 / -1;
    display: flex;
    padding-top: 8px;
  }

  .app-main {
    padding: 20px 16px 28px;
  }

  .mobile-menu {
    display: inline-flex;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .topbar,
  .search,
  .result-strip,
  .decision-board,
  .deal-card,
  .price-row,
  .source-row,
  .plan-row,
  .wallet-layout,
  .details-grid,
  .report-form,
  .plan-form,
  .plan-form.single-action {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 18px 12px 24px;
  }

  h1 {
    font-size: 2.05rem;
  }

  .page-subtitle {
    font-size: 0.96rem;
  }

  .topbar-actions,
  .result-strip,
  .safety-note {
    align-items: stretch;
    flex-direction: column;
  }

  .command-bar {
    position: static;
  }

  .deal-price {
    min-width: 0;
    text-align: left;
  }

  .action-stack {
    min-width: 0;
  }

  .price,
  .plan-saving,
  .link-button {
    text-align: left;
  }

  .page-head,
  .subpanel-head {
    align-items: flex-start;
  }
}
