/* DealCage concept 01 */
:root {
  --paper: #ffffff;
  --paper-2: #f4f7f5;
  --ink: #142019;
  --ink-2: #4b5a52;
  --ink-3: #7c8a83;
  --rule: #dde4df;
  --rule-2: #c9d3cd;
  --green: #0f5c3d;
  --green-2: #0b4a31;
  --green-soft: #e4f1ea;
  --green-line: #b8d9c7;
  --amber: #a15c0a;
  --amber-soft: #fcefdb;
  --shadow: 0 1px 2px rgba(20, 32, 25, .06), 0 8px 24px rgba(20, 32, 25, .06);
  --serif: "Manrope", "Segoe UI", system-ui, sans-serif;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --max: 1160px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); letter-spacing: -.01em; line-height: 1.12; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 50; }

/* header */
.top {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.top-in { display: flex; align-items: center; gap: 32px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 26px; font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { box-shadow: inset 0 -2px 0 var(--green); padding-bottom: 20px; margin-bottom: -20px; }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule-2); border-radius: 6px; padding: 7px 12px; width: 260px; color: var(--ink-3); font-size: .9rem; background: var(--paper-2); }
.search svg { width: 16px; height: 16px; flex: none; }
.search kbd { margin-left: auto; font: 600 .7rem var(--sans); border: 1px solid var(--rule-2); border-radius: 4px; padding: 1px 5px; color: var(--ink-3); background: #fff; }

/* hero */
.hero { padding: 64px 0 56px; border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, var(--paper-2), var(--paper) 70%); }
.hero-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 20px; height: 2px; background: var(--green); }
.lede { font-size: 1.15rem; color: var(--ink-2); margin-top: 20px; max-width: 34ch; }
.cta-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 6px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; font-family: var(--sans); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-ghost { border-color: var(--rule-2); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.stats { display: flex; gap: 28px; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); }
.stat b { display: block; font-family: var(--serif); font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: .8rem; color: var(--ink-3); }

/* preview table in the hero */
.preview { background: #fff; border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rule); font-size: .85rem; }
.preview-head strong { font-family: var(--serif); font-weight: 700; font-size: 1rem; }
.preview-head span { color: var(--ink-3); }
.preview-foot { padding: 12px 18px; font-size: .82rem; color: var(--ink-3); border-top: 1px solid var(--rule); display: flex; justify-content: space-between; }
.preview-foot a { color: var(--green); font-weight: 600; }

/* deal rows (shared) */
.deals { list-style: none; margin: 0; padding: 0; }
.deal {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 118px 132px 120px 96px;
  gap: 16px; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--rule);
}
.deal:last-child { border-bottom: 0; }
.deals-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 118px 132px 120px 96px; gap: 16px; padding: 10px 18px; font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.rank { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 1rem; border: 1.5px solid var(--rule-2); color: var(--ink-2); }
.deal[data-rank="1"] .rank { background: var(--green); border-color: var(--green); color: #fff; }
.deal[data-rank="2"] .rank, .deal[data-rank="3"] .rank { border-color: var(--green-line); color: var(--green); background: var(--green-soft); }
.deal-name { font-weight: 700; font-size: 1rem; }
.deal-blurb { font-size: .85rem; color: var(--ink-2); margin-top: 2px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: .72rem; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 7px; background: #fff; }
.price { font-size: 1.05rem; font-weight: 700; }
.price small, .renew small { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 500; margin-top: 1px; }
.renew { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.jump { display: inline-block; margin-left: 6px; font-size: .7rem; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 1px 6px; border-radius: 4px; vertical-align: 2px; }
.jump.flat { color: var(--green); background: var(--green-soft); }
.score { display: flex; align-items: center; gap: 10px; }
.score b { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; min-width: 2ch; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.rel { font-size: .95rem; font-weight: 600; color: var(--ink-2); }
.rel small { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 500; }
.deal .btn { justify-self: end; }

/* compact rows inside the hero preview */
.preview .deal { grid-template-columns: 36px minmax(0, 1fr) 96px 116px 96px; gap: 12px; padding: 14px 16px; }
.preview .votes, .preview .tags, .preview .deal-blurb { display: none; }
.deal .btn { white-space: nowrap; }
.preview .deal-name { font-size: .95rem; }
.preview .deal-blurb { font-size: .8rem; }
.preview .price { font-size: .98rem; }
.preview .renew { font-size: .92rem; }
.preview .jump { display: block; margin: 3px 0 0; width: max-content; }

/* sections */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head p { color: var(--ink-2); margin-top: 8px; max-width: 56ch; }
.more { color: var(--green); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.more:hover { text-decoration: underline; }

/* categories */
.cats { display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.cat { padding: 22px 20px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: #fff; display: flex; flex-direction: column; gap: 6px; min-height: 172px; transition: background .15s; }
.cat:nth-child(5n) { border-right: 0; }
.cat:nth-child(n+6) { border-bottom: 0; }
.cat:hover { background: var(--paper-2); }
.cat svg { width: 22px; height: 22px; color: var(--green); margin-bottom: 8px; }
.cat h3 { font-size: 1rem; }
.cat p { font-size: .84rem; color: var(--ink-2); flex: 1; }
.cat span { font-size: .78rem; color: var(--ink-3); font-weight: 600; }

/* scoring */
.how { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: start; }
.formula { border: 1px solid var(--rule); border-radius: 10px; padding: 28px; background: var(--paper-2); }
.formula-bar { display: flex; height: 44px; border-radius: 6px; overflow: hidden; margin: 20px 0 10px; font-family: var(--serif); font-weight: 800; color: #fff; }
.formula-bar .p { flex: 55; background: var(--green); display: grid; place-items: center; }
.formula-bar .r { flex: 45; background: #2f7a5a; display: grid; place-items: center; }
.formula-legend { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-2); }
.formula-example { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule-2); font-size: .9rem; color: var(--ink-2); }
.formula-example code { font-family: var(--sans); font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 1px 6px; }
.steps { display: grid; gap: 22px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; }
.step-n { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--green); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: .85rem; font-family: var(--serif); }
.step p { color: var(--ink-2); font-size: .95rem; margin-top: 4px; }

/* disclosure */
.notice { border-left: 3px solid var(--green); padding: 4px 0 4px 22px; max-width: 70ch; }
.notice h2 { font-size: 1.2rem; margin-bottom: 8px; }
.notice p { color: var(--ink-2); font-size: .95rem; }

/* footer */
.foot { border-top: 1px solid var(--rule); background: var(--paper-2); padding: 44px 0; font-size: .85rem; color: var(--ink-2); }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.foot h4 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot .small { margin-top: 14px; color: var(--ink-3); font-size: .78rem; }

/* category page */
.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a:hover { color: var(--ink); }
.page-head { padding-top: 44px; padding-bottom: 28px; }  /* keep .wrap horizontal padding */
.page-head .lede { font-size: 1.05rem; max-width: 62ch; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-3); margin-top: 18px; }
.meta b { color: var(--ink-2); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-label { font-size: .8rem; color: var(--ink-3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sorts { display: flex; gap: 4px; flex-wrap: wrap; }
.sort { border: 1px solid transparent; background: none; font: 500 .88rem var(--sans); color: var(--ink-2); padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.sort:hover { background: var(--paper-2); }
.sort[aria-pressed="true"] { background: var(--green-soft); color: var(--green); border-color: var(--green-line); font-weight: 600; }
.toolbar .hint { margin-left: auto; font-size: .82rem; color: var(--ink-3); }
.table { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: #fff; }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.pager a, .pager span { padding: 7px 12px; border: 1px solid var(--rule); border-radius: 6px; font-size: .88rem; }
.pager [aria-current] { background: var(--green); color: #fff; border-color: var(--green); }
.aside-note { margin-top: 40px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 1000px) {
  .hero-in, .how { grid-template-columns: 1fr; gap: 36px; }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cat:nth-child(5n) { border-right: 1px solid var(--rule); }
  .cat:nth-child(2n) { border-right: 0; }
  .cat:nth-child(n+6) { border-bottom: 1px solid var(--rule); }
  .cat:nth-child(n+9) { border-bottom: 0; }
  .foot-in { grid-template-columns: 1fr; }
  .search { display: none; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .deals-head { display: none; }
  .deal, .preview .deal { grid-template-columns: 36px 1fr; grid-template-areas: "rank name" "rank price" "rank score" "rank cta"; row-gap: 10px; }
  .deal > :nth-child(1) { grid-area: rank; align-self: start; }
  .deal > :nth-child(2) { grid-area: name; }
  .deal > :nth-child(3), .deal > :nth-child(4) { grid-area: price; }
  .deal > :nth-child(4) { justify-self: end; }
  .deal > :nth-child(5), .deal > :nth-child(6) { grid-area: score; }
  .deal > :nth-child(6) { justify-self: end; }
  .deal .btn { grid-area: cta; justify-self: start; }
  .hero { padding: 40px 0; }
  .section { padding: 48px 0; }
  .cats { grid-template-columns: 1fr; }
  .cat { border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; min-height: 0; }
  .cat:last-child { border-bottom: 0 !important; }
  .stats { gap: 18px; flex-wrap: wrap; }
}

/* brand logos next to deal names */
.deal-brand { display: flex; align-items: flex-start; gap: 12px; }
.brand-logo {
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  object-fit: contain; background: #fff; border: 1px solid var(--rule);
  padding: 2px; margin-top: 2px;
}
.deal-brand .deal-name { line-height: 1.25; }
.preview .brand-logo { width: 24px; height: 24px; }

/* search as form (production) */
.search input {
  border: 0; background: transparent; outline: none; width: 100%;
  font: inherit; color: var(--ink); min-width: 0;
}
.search input::placeholder { color: var(--ink-3); }

/* pagination buttons matching concept1 pager */
.pager button {
  padding: 7px 12px; border: 1px solid var(--rule); border-radius: 6px;
  font-size: .88rem; background: #fff; color: var(--ink); cursor: pointer;
  font-family: var(--sans);
}
.pager button:hover:not(:disabled) { border-color: var(--ink-3); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager button.is-active, .pager button[aria-current="page"] {
  background: var(--green); color: #fff; border-color: var(--green);
}
.pager .page-numbers { display: flex; gap: 6px; }


/* community votes */
.votes { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.vote-pct { font-family: var(--serif); font-weight: 800; font-size: 1.05rem; color: var(--ink); line-height: 1.2; }
.vote-actions { display: flex; flex-direction: row; gap: 10px; align-items: center; }
.vote-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  line-height: 0;
}
.vote-icon-btn svg { display: block; width: 18px; height: 18px; pointer-events: none; }
.vote-icon-btn:hover svg { stroke: #142019; }
.vote-icon-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.vote-thanks { font-size: .75rem; color: var(--ink-2); font-weight: 600; }
.deals-empty { padding: 24px 18px; margin: 0; color: var(--ink-2); font-size: .95rem; }
.search { width: min(280px, 42vw); }
@media (max-width: 1000px) {
  .search { display: flex !important; width: min(220px, 40vw); }
}

/* Responsive repairs preserve the concept 01 paper and ink-green palette. */
:root { --ink-3: #596b60; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.search:focus-within { outline: 2px solid var(--green); outline-offset: 3px; }
[id] { scroll-margin-top: 140px; }
main { padding-bottom: 48px; }
main:has(.hero) { padding-bottom: 0; }
.deal > *, .deal-brand > div { min-width: 0; }
.deal-name, .deal-blurb, .tag { overflow-wrap: anywhere; }
.preview .deal { grid-template-columns: 32px minmax(100px, 1fr) 82px 100px; }
.preview .deal .btn { grid-column: 2 / -1; justify-self: start; }
.preview-head, .preview-foot { gap: 12px; flex-wrap: wrap; }
.preview-head span { font-size: .75rem; }
.cats { gap: 1px; background: var(--rule); }
.cat { border: 0 !important; }
.vote-icon-btn { width: 36px; height: 36px; }
.vote-icon-btn:disabled { opacity: .5; cursor: wait; }
.results-status { color: var(--ink-2); padding: 12px 18px; font-size: .9rem; }
.results-status:empty { display: none; }
.notice a, .hint a { color: var(--green); text-decoration: underline; }
.pager { flex-wrap: wrap; }
.pager .page-numbers { padding: 0; border: 0; flex-wrap: wrap; }
@media (max-width: 1100px) and (min-width: 761px) {
  .deal, .deals-head { grid-template-columns: 36px minmax(0, 1fr) 95px 110px 86px 96px; gap: 10px; }
  .top-in { gap: 18px; }
  .nav { gap: 16px; }
}
@media (max-width: 760px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .top-in { height: auto; min-height: 64px; padding-top: 12px; padding-bottom: 12px; gap: 12px; flex-wrap: wrap; }
  .logo { font-size: 1.1rem; }
  .nav { display: flex; order: 3; width: 100%; gap: 18px; flex-wrap: wrap; font-size: .85rem; }
  .nav a[aria-current] { padding-bottom: 3px; margin-bottom: 0; }
  .search { flex: 1; width: auto; min-width: 130px; padding: 7px 8px; }
  .search kbd { display: none; }
  .deal, .preview .deal {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-areas: "rank name" ". price" ". renewal" ". votes" ". cta";
    gap: 12px; padding: 16px 12px;
  }
  .deal > :nth-child(1) { grid-area: rank; }
  .deal > :nth-child(2) { grid-area: name; }
  .deal > :nth-child(3) { grid-area: price; }
  .deal > :nth-child(4) { grid-area: renewal; justify-self: start; }
  .deal > :nth-child(5) { grid-area: votes; }
  .deal > :nth-child(6), .preview .deal .btn { grid-area: cta; justify-self: start; }
  .preview .jump { display: inline-block; margin-left: 6px; }
  .section-head { align-items: start; flex-direction: column; gap: 16px; }
  .formula { padding: 20px; }
}

/* Round 2: give navigation and comparison content room at intermediate widths. */
.logo { flex-shrink: 0; }
.nav { flex-shrink: 0; }
.search { min-width: 220px; }
.deal .jump { max-width: 100%; overflow-wrap: anywhere; }
.pager button, .sort { min-height: 44px; }
.pager button { min-width: 44px; }
.vote-icon-btn { width: 40px; height: 40px; }
.vote-actions { gap: 6px; }
@media (min-width: 761px) and (max-width: 900px) {
  .top-in { height: auto; min-height: 64px; flex-wrap: wrap; gap: 12px 24px; padding-top: 12px; padding-bottom: 12px; }
  .nav { order: 3; width: 100%; }
  .nav a[aria-current] { padding-bottom: 3px; margin-bottom: 0; }
  .search { width: 280px; }
  .deal, .deals-head { grid-template-columns: 32px minmax(0, 1fr) 90px 96px 86px; }
  .deal > .btn { grid-column: 2 / -1; justify-self: start; }
  .deals-head > :last-child { display: none; }
}
@media (max-width: 760px) {
  .search { min-width: 130px; }
  .nav a { display: inline-flex; align-items: center; min-height: 32px; }
  .deal .rank { width: 32px; height: 32px; }
  .search input { font-size: 16px; }
}
