:root {
  color-scheme: light;
  --page: #f8f7fc;
  --paper: #fff;
  --ink: #211a31;
  --muted: #615a70;
  --edge: #e5e0ee;
  --brand: #5632b9;
  --brand-dark: #45239e;
  --lavender: #eee8ff;
  --green: #205a3a;
  --green-bg: #e9f6ec;
  --font: Inter, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button, a, input, select, summary, textarea { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid #8660e4;
  outline-offset: 3px;
}

.wrap {
  width: min(100% - 3rem, 74rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 2;
  top: .75rem;
  left: .75rem;
  padding: .65rem 1rem;
  border-radius: .5rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--edge);
}

.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.28rem;
  font-weight: 820;
  letter-spacing: -.055em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: .7rem;
  color: white;
  background: var(--brand);
}

.basket-icon {
  position: relative;
  display: block;
  width: 1.17rem;
  height: .8rem;
  margin-top: .29rem;
  border: 1.7px solid currentColor;
  border-radius: .13rem .13rem .29rem .29rem;
  background: linear-gradient(to right, transparent 40%, currentColor 40% 56%, transparent 56%) center / 100% 52% no-repeat;
}

.basket-icon::before {
  content: "";
  position: absolute;
  top: -.42rem;
  left: 50%;
  width: .46rem;
  height: .43rem;
  transform: translateX(-50%);
  border: 1.7px solid currentColor;
  border-bottom: 0;
  border-radius: .45rem .45rem 0 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.7rem;
  font-size: .93rem;
  font-weight: 650;
  color: var(--muted);
}

.nav > a, .footer-links > a { text-decoration: none; }
.nav > a:hover, .footer-links > a:hover { color: var(--brand-dark); }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: .35rem;
  padding-inline: .25rem;
  border-radius: 1rem;
  color: var(--brand-dark);
  background: var(--lavender);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .55rem .95rem;
  border: 1px solid transparent;
  border-radius: .62rem;
  text-decoration: none;
  font-size: .92rem;
  font-weight: 720;
  line-height: 1.24;
  text-align: center;
  transition: background-color 140ms, border-color 140ms;
}

.button-primary { color: white; background: var(--brand); }
.button-primary:hover { background: var(--brand-dark); }

.button-outline {
  color: var(--brand-dark);
  background: var(--paper);
  border-color: #dcd2f2;
}

.button-outline:hover:not(:disabled) {
  background: #f6f2ff;
  border-color: #c7b7ec;
}

.button-quiet { color: var(--muted); background: transparent; }
.button-quiet:hover:not(:disabled) { background: var(--page); color: var(--ink); }

.button:disabled { cursor: default; opacity: .53; }
.save-button[data-saved="true"] { opacity: 1; color: var(--green); border-color: #cee4d6; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.04fr 1fr;
  min-height: 23rem;
  margin-top: 1.8rem;
  overflow: hidden;
  border: 1px solid #e4d9fc;
  border-radius: 1.6rem;
  background: #eee7fc;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 2.55rem clamp(2.3rem, 4.7vw, 4.4rem);
  background: radial-gradient(ellipse at 6% 9%, #f7f2ff, transparent 67%), #eee7fc;
}

.hero h1 {
  font-size: clamp(3.2rem, 6.1vw, 5.15rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.075em;
}

.hero h1 em {
  color: var(--brand);
  font-style: normal;
}

.hero p {
  max-width: 24rem;
  margin-top: 1.12rem;
  color: #51465f;
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.52;
}

.hero-cta {
  min-height: 3rem;
  margin-top: 1.45rem;
  padding-inline: 1.18rem;
  box-shadow: 0 3px 8px #45239e29;
}

.hero-media { position: relative; min-width: 0; background: #c5b4ef; }
.hero-media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.compare-section { margin-top: 2.3rem; }
#compare, #saved, #guide { scroll-margin-top: 1.25rem; }

.section-heading h2 {
  font-size: clamp(1.6rem, 3.3vw, 2.13rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -.046em;
}

.section-heading p {
  margin-top: .35rem;
  color: var(--muted);
}

.compare-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19.75rem, 32%);
  align-items: start;
  gap: 1.12rem;
  margin-top: 1.04rem;
}

.panel {
  border: 1px solid var(--edge);
  border-radius: 1rem;
  background: var(--paper);
  box-shadow: 0 1px 3px #23154006;
}

.calculator, .result-panel, .saved-panel, .guide-panel { padding: 1.25rem; }

.calculator-toolbar, .examples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.calculator-toolbar {
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: 1.15rem;
}

.examples { gap: .4rem; }
.examples-label { margin-right: .35rem; color: var(--muted); font-size: .87rem; font-weight: 650; }

.chip {
  min-height: 2.3rem;
  padding: .35rem .8rem;
  border: 1px solid var(--edge);
  border-radius: 2rem;
  background: white;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
  white-space: nowrap;
}

.chip:hover { border-color: #c5b0eb; color: var(--brand-dark); }

.chip[aria-pressed="true"] {
  color: var(--brand-dark);
  border-color: #ddd1f9;
  background: #f1ebff;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 .1rem;
  border: 0;
  border-radius: .25rem;
  color: var(--brand-dark);
  background: transparent;
  font-size: .87rem;
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: .19em;
}

.text-button:hover { color: var(--brand); }
.clear-button { min-height: 2.3rem; }

.pack-grid, .deal-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.pack-grid { align-items: start; }

.pack {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #e8e3f1;
  border-radius: .8rem;
  background: #faf9fd;
}

.pack-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .25rem .5rem;
  margin-bottom: .85rem;
}

.pack h3 {
  font-size: 1.12rem;
  font-weight: 790;
  letter-spacing: -.035em;
}

.pack-total {
  color: #5b4286;
  font-size: .85rem;
  font-weight: 640;
  overflow-wrap: anywhere;
}

.field { min-width: 0; }

.field + .field { margin-top: .85rem; }

.field label {
  display: block;
  margin-bottom: .28rem;
  color: #514660;
  font-size: .88rem;
  font-weight: 670;
}

.field input, .field select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: .48rem .62rem;
  border: 1px solid #dcd5e9;
  border-radius: .52rem;
  color: var(--ink);
  background: var(--paper);
}

.field input {
  appearance: textfield;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
}

.field input::-webkit-inner-spin-button, .field input::-webkit-outer-spin-button { appearance: none; }
.field input:hover, .field select:hover { border-color: #b8a8d3; }
.field input:user-invalid { border-color: #b85156; }

.price-input { position: relative; }

.price-input span {
  position: absolute;
  left: .65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.price-input input { padding-left: 1.73rem; }

.quantity-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(5.55rem, 41%);
  gap: .4rem;
}

.field select {
  appearance: none;
  padding-right: 1.42rem;
  background-image: linear-gradient(45deg, transparent 50%, #645972 51%), linear-gradient(135deg, #645972 49%, transparent 50%);
  background-position: right .86rem center, right .55rem center;
  background-size: .32rem .32rem;
  background-repeat: no-repeat;
  font-weight: 600;
}

.deal { margin-top: .9rem; border-top: 1px solid #e9e3f1; }

details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 2.6rem;
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker { display: none; }

.deal summary {
  color: var(--brand-dark);
  font-size: .88rem;
  font-weight: 710;
}

.chevron {
  flex-shrink: 0;
  width: .48rem;
  height: .48rem;
  margin-right: .2rem;
  margin-bottom: .16rem;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
}

details[open] > summary .chevron { transform: translateY(.2rem) rotate(225deg); }

.deal-fields .field { margin: .15rem 0 0; }
.deal p { margin-top: .55rem; color: var(--muted); font-size: .84rem; }

.calculator-note {
  display: flex;
  align-items: center;
  gap: .43rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: .87rem;
}

.info-icon {
  display: inline-grid;
  place-items: center;
  width: .97rem;
  height: .97rem;
  border: 1px solid #827994;
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

.result-column { display: grid; gap: .82rem; }

.result-panel > h3 {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .88rem;
  font-weight: 780;
  font-size: 1.1rem;
  letter-spacing: -.025em;
}

.result-icon {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: .52rem;
  color: var(--brand);
  background: var(--lavender);
}

.result-icon::before {
  content: "";
  position: absolute;
  inset: .5rem .45rem;
  border-radius: .08rem;
  background:
    linear-gradient(currentColor, currentColor) left bottom / 23% 43% no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 23% 70% no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 23% 100% no-repeat;
}

.winner-panel {
  display: grid;
  align-content: center;
  min-height: 6.85rem;
  padding: .82rem .9rem;
  border-radius: .7rem;
  color: #4d4162;
  background: #f4f1fa;
  overflow-wrap: anywhere;
}

.winner-panel[data-state="winner"] { color: var(--green); background: var(--green-bg); }
.winner-panel[data-state="invalid"] { color: #733638; background: #fcf0ef; }

.winner-label { font-size: .91rem; font-weight: 780; line-height: 1.35; }
.winner-value { margin: .21rem 0 .18rem; font-size: clamp(1.5rem, 3vw, 1.83rem); font-weight: 810; line-height: 1.1; letter-spacing: -.06em; }
.winner-detail { font-size: .88rem; }
.winner-value[hidden] + .winner-detail { margin-top: .22rem; }

.rates {
  margin-top: .6rem;
  color: var(--muted);
  font-size: .92rem;
}

.rates > div {
  display: flex;
  justify-content: space-between;
  gap: .7rem;
  padding-block: .45rem;
  border-bottom: 1px solid #efebf3;
}

.rates dd {
  color: var(--ink);
  font-weight: 740;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .78rem;
}

.save-button { min-width: 5.85rem; }

.bookmark-icon {
  display: inline-block;
  width: .65rem;
  height: .92rem;
  border-radius: .08rem .08rem 0 0;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%, 0 0, 17% 11%, 17% 78%, 50% 58%, 83% 78%, 83% 11%, 17% 11%);
}

.action-status {
  margin-top: .65rem;
  color: var(--muted);
  font-size: .88rem;
}

.ad-slot {
  --ad-ink: #442e1a;
  --ad-muted: #6a5139;
  --ad-accent: #744717;
  min-width: 0;
  padding: .78rem .96rem;
  border: 1px solid #efddba;
  border-radius: .9rem;
  background: #fff6e4;
  color: var(--ad-ink);
  overflow-wrap: anywhere;
}

.ad-slot--banner {
  --ad-ink: #1d3f31;
  --ad-muted: #3a5e4c;
  --ad-accent: #1f5c40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "mark label action" "mark copy action";
  align-items: center;
  gap: .08rem .9rem;
  margin-top: .9rem;
  padding: .76rem 1rem;
  border-color: #d7e8dc;
  background: #eef7ef;
}

.ad-mark {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: .8rem;
  color: var(--ad-accent);
  background: #d6ecdc;
}

.ad-label {
  color: var(--ad-accent);
  font-size: .75rem;
  font-weight: 780;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.ad-slot--banner .ad-label { grid-area: label; }
.ad-copy { grid-area: copy; }

.ad-title {
  margin-top: .13rem;
  font-size: 1rem;
  font-weight: 780;
  letter-spacing: -.02em;
  line-height: 1.33;
}

.ad-description {
  margin-top: .13rem;
  color: var(--ad-muted);
  font-size: .875rem;
}

.ad-button { grid-area: action; color: white; background: var(--ad-accent); }
.ad-button:hover { background: #18472f; }

.ad-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 .65rem;
}

.ad-text-link { color: var(--ad-accent); }
.ad-text-link:hover { color: #4e2609; }

.details-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.12rem;
  margin: 2rem 0 3rem;
}

.details-grid .section-heading h2 { font-size: 1.43rem; }
.details-grid .section-heading p { margin-top: .25rem; font-size: .94rem; }

.empty-state {
  margin-top: 1rem;
  padding: .86rem .95rem;
  border: 1px dashed #dbd3e8;
  border-radius: .65rem;
  color: var(--muted);
  background: #faf9fd;
  font-size: .93rem;
}

.saved-list {
  display: grid;
  gap: .55rem;
  margin: .9rem 0 0;
  padding: 0;
  list-style: none;
}

.saved-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .67rem .75rem;
  border: 1px solid var(--edge);
  border-radius: .65rem;
}

.saved-info { min-width: 0; overflow-wrap: anywhere; }
.saved-info p, .saved-info time { color: var(--muted); font-size: .86rem; }
.saved-info time { font-size: .8rem; }

.saved-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .65rem; }
.saved-actions .button { min-height: 2.4rem; padding-inline: .65rem; }
.remove-button { min-height: 2.4rem; color: var(--muted); }

.guide-item { margin-top: .45rem; border-bottom: 1px solid var(--edge); }
.guide-item:first-of-type { margin-top: .55rem; }
.guide-item:last-of-type { border-bottom: 0; }

.guide-item summary {
  min-height: 2.58rem;
  color: #3e344e;
  font-weight: 680;
  font-size: .95rem;
}

.guide-item p {
  margin: -.1rem .9rem .75rem 0;
  color: var(--muted);
  font-size: .94rem;
}

.site-footer {
  border-top: 1px solid var(--edge);
  background: var(--paper);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 650;
}

.footer-inner { min-height: 3.8rem; }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .3rem 1rem;
}

.privacy-page {
  max-width: 48rem;
  margin-block: clamp(1.5rem, 5vw, 3.5rem);
  padding: clamp(1.25rem, 5vw, 3rem);
}

.privacy-page h1 {
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -.045em;
}

.privacy-page section { margin-top: 1.4rem; }
.privacy-page h2 { font-size: 1.2rem; }
.privacy-page p { margin-top: .4rem; color: var(--muted); }
.privacy-page a { color: var(--brand-dark); }

dialog {
  width: min(31rem, calc(100% - 1.5rem));
  max-height: calc(100% - 1.5rem);
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 1rem;
  box-shadow: 0 16px 65px #22163842;
  color: var(--ink);
  background: var(--paper);
}

dialog::backdrop { background: #211a315c; }
.dialog-content { position: relative; padding: 1.55rem; }
.dialog-top { position: absolute; top: .7rem; right: .7rem; }

.close-button {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: .62rem;
  background: var(--paper);
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
}

.close-button:hover { background: var(--page); }
.dialog-content h2 { padding-right: 2rem; font-size: 1.58rem; line-height: 1.15; letter-spacing: -.045em; }
.dialog-content > p { margin-top: .62rem; color: var(--muted); }
.placement-spec { margin-top: .9rem; }
.placement-spec > div { display: grid; grid-template-columns: 6rem 1fr; gap: .55rem; padding-block: .53rem; border-bottom: 1px solid var(--edge); }
.placement-spec dt { font-weight: 730; }
.placement-spec dd { color: var(--muted); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.15rem; }

.copy-fallback {
  display: block;
  width: 100%;
  margin-top: .75rem;
  padding: .64rem;
  border: 1px solid var(--edge);
  border-radius: .55rem;
  color: var(--ink);
  background: var(--page);
  resize: vertical;
}

@media (max-width: 54rem) {
  .wrap { width: min(100% - 2rem, 74rem); }
  .hero { min-height: 20rem; }
  .hero-copy { padding-inline: 1.7rem; }
  .hero h1 { font-size: clamp(3rem, 8vw, 4.3rem); }
  .compare-layout { grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 34%); gap: .8rem; }
  .calculator, .result-panel, .saved-panel, .guide-panel { padding: .97rem; }
  .pack { padding: .78rem; }
  .quantity-fields { grid-template-columns: minmax(0, 1fr) minmax(5.1rem, 43%); }
}

@media (max-width: 46rem) {
  .nav { gap: 1rem; }
  .hero { min-height: 18rem; }
  .compare-layout { grid-template-columns: minmax(0, 1fr); }
  .result-column { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); align-items: start; }
  .details-grid { gap: .8rem; }
  .saved-row { flex-wrap: wrap; }
}

@media (max-width: 35rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .header-inner { gap: .55rem; min-height: 3.75rem; }
  .wordmark { font-size: 1.17rem; gap: .45rem; }
  .brand-mark { width: 2rem; height: 2rem; border-radius: .57rem; }
  .nav { gap: .65rem; font-size: .87rem; }
  .nav-compare { display: none; }
  .nav-sponsor { min-height: 2.5rem; padding-inline: .6rem; font-size: .84rem; }
  .count { min-width: 1.12rem; height: 1.12rem; margin-left: .18rem; }
  .hero { grid-template-columns: 1fr; margin-top: 1rem; border-radius: 1.15rem; }
  .hero-copy { padding: 1.6rem 1.3rem 1.35rem; }
  .hero h1 { font-size: clamp(2.85rem, 10.7vw, 3.65rem); }
  .hero p { margin-top: .8rem; max-width: 19rem; }
  .hero-cta { min-height: 2.75rem; margin-top: 1.1rem; }
  .hero-media { min-height: 10rem; aspect-ratio: 1.85; }
  .hero-media img { object-position: 52% 52%; }
  .ad-slot--banner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label label" "copy action";
    gap: .2rem .6rem;
    padding: .68rem .75rem;
  }
  .ad-mark { display: none; }
  .ad-button { padding-inline: .63rem; }
  .compare-section { margin-top: 1.6rem; }
  .examples-label { flex-basis: 100%; }
  .calculator-toolbar { flex-wrap: nowrap; align-items: flex-end; }
  .chip { min-height: 2.4rem; padding-inline: .65rem; }
  .pack-grid { grid-template-columns: 1fr; gap: .65rem; }
  .result-column, .details-grid { grid-template-columns: minmax(0, 1fr); }
  .details-grid { margin-top: 1.4rem; margin-bottom: 1.8rem; }
}

@media (max-width: 22rem) {
  .wordmark { gap: .35rem; font-size: 1.02rem; }
  .brand-mark { width: 1.85rem; height: 1.85rem; }
  .nav { gap: .45rem; }
  .nav .count { display: none; }
  .nav-sponsor { padding-inline: .52rem; font-size: .8rem; }
  .examples { gap: .28rem; }
  .chip { padding-inline: .54rem; font-size: .82rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
