/* ==========================================================================
   Building Products — supplier-facing pages
   Tiers & benefits · gamified profile builder · media listings
   Loads on top of styles.css

   Chart colour policy: every visual here is SINGLE-MEASURE, so it takes one
   hue and identity is carried by axis labels, never by colour. The four UI
   colours in styles.css fail a categorical-palette validation (chroma floor;
   green-vs-blue normal-vision dE 13.1, under the 15 floor), so they are
   deliberately never used as a series set.
     --viz   #1f5f8b  6.84:1 on white, 6.38:1 on paper-2  (magnitude/time)
     --accent #b76a17 4.13:1 on white, 3.85:1 on paper-2  (progress)
   ========================================================================== */

:root {
  --viz:       #1f5f8b;
  --viz-hover: #17486a;
  --viz-track: #e7ecf0;
}

/* --- numbered step flow -------------------------------------------------- */
.steps { counter-reset: s; display: grid; gap: 16px; padding: 0; }
.steps > li { list-style: none; display: grid; grid-template-columns: 34px 1fr; gap: 15px; align-items: start; margin: 0; }
.steps > li::before {
  counter-increment: s; content: counter(s);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--mono); font-size: .82rem; display: grid; place-items: center;
}
.steps h4 { margin-bottom: 3px; }
.steps p { font-size: .88rem; color: var(--grey); margin: 0; }

/* --- benefit cards ------------------------------------------------------- */
.benefit { border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 20px; }
.benefit .bnum { font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; color: var(--accent); }
.benefit h3 { font-size: 1.05rem; margin: 7px 0 6px; }
.benefit p { font-size: .88rem; color: var(--grey); margin: 0; }

/* --- pricing tiers ------------------------------------------------------- */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
.tier {
  border: 1px solid var(--rule); border-radius: 5px; background: #fff;
  padding: 24px 20px; display: flex; flex-direction: column;
}
.tier.featured { border: 2px solid var(--accent); box-shadow: var(--shadow); position: relative; }
.tier.featured::before {
  content: "Recommended"; position: absolute; top: -11px; left: 20px;
  background: var(--accent); color: #fff; font-family: var(--mono);
  font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 2px;
}
.tier-name { font-family: var(--slab); font-weight: 700; font-size: 1.25rem; }
.tier-sub { font-size: .82rem; color: var(--grey); min-height: 40px; margin-top: 4px; }
.tier-price { font-family: var(--slab); font-weight: 700; font-size: 2.1rem; margin: 16px 0 2px; letter-spacing: -.02em; }
.tier-price small { font-family: var(--sans); font-weight: 400; font-size: .8rem; color: var(--grey); letter-spacing: 0; }
.tier-bill { font-size: .78rem; color: var(--grey); min-height: 20px; }
.tier ul { list-style: none; padding: 0; margin: 20px 0; font-size: .87rem; }
.tier ul li { display: grid; grid-template-columns: 18px 1fr; gap: 9px; padding: 6px 0; align-items: start; }
.tier ul li i { font-style: normal; color: var(--good); font-weight: 700; }
.tier ul li.no { color: var(--grey-2); }
.tier ul li.no i { color: var(--grey-2); font-weight: 400; }
.tier .tier-cta { margin-top: auto; }

/* --- tier comparison table ---------------------------------------------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.compare-table th, .compare-table td { padding: 11px 12px; border-bottom: 1px solid var(--rule-2); text-align: center; }
.compare-table thead th {
  background: var(--ink); color: #fff; font-family: var(--mono);
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
}
.compare-table thead th:first-child, .compare-table tbody th { text-align: left; }
.compare-table tbody th { font-weight: 600; width: 32%; background: var(--paper-2); }
.compare-table tr.group th {
  background: var(--ink-2); color: #fff; font-family: var(--mono);
  font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 400;
}
.compare-table .y { color: var(--good); font-weight: 700; }
.compare-table .n { color: var(--grey-2); }
.compare-table td.hl { background: var(--accent-2); }
.compare-table tbody tr:hover td:not(.hl) { background: var(--paper-2); }

/* --- KPI tiles (hero number, no plot, no hover) -------------------------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 16px 18px 18px; }
.kpi-l { font-size: .78rem; color: var(--grey); }
.kpi-v { font-family: var(--slab); font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 6px 0 5px; letter-spacing: -.02em; }
.kpi-d { font-size: .78rem; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }
.kpi-d .ar { font-family: var(--mono); font-weight: 700; }
.kpi-d.up .ar { color: var(--good); }
.kpi-d.dn .ar { color: var(--warn); }

/* --- meters & benchmark bars (single measure, always direct-labelled) ---- */
.meter-lg { height: 14px; border-radius: 7px; background: var(--rule); overflow: hidden; }
.meter-lg i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }

.bench { display: grid; gap: 11px; }
.bench-row { display: grid; grid-template-columns: 230px 1fr 46px; gap: 12px; align-items: center; font-size: .86rem; }
.bench-track { height: 14px; background: var(--viz-track); border-radius: 3px; overflow: hidden; }
.bench-track i { display: block; height: 100%; background: var(--viz); border-radius: 0 4px 4px 0; }
.bench-track i.neutral { background: var(--grey-2); }
.bench-row b { font-family: var(--mono); font-size: .84rem; text-align: right; }

/* --- small bar chart: single series, one hue, hover tooltip -------------- */
.barchart { border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 18px 20px 16px; }
.bc-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.bc-head h4 { font-family: var(--sans); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--grey); }
.bc-head .bc-max { margin-left: auto; font-family: var(--mono); font-size: .72rem; color: var(--grey-2); }
.bc-plot { display: flex; align-items: flex-end; gap: 8px; height: 150px; border-bottom: 1px solid var(--rule); }
.bc-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bc-bar { display: block; background: var(--viz); border-radius: 4px 4px 0 0; }
.bc-col:hover .bc-bar { background: var(--viz-hover); }
.bc-tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .74rem; white-space: nowrap;
  padding: 4px 9px; border-radius: 3px; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5;
}
.bc-col:hover .bc-tip { opacity: 1; }
.bc-val { font-family: var(--mono); font-size: .72rem; color: var(--ink-2); text-align: center; margin-bottom: 5px; }
.bc-xrow { display: flex; gap: 8px; margin-top: 8px; }
.bc-xrow span { flex: 1; text-align: center; font-size: .74rem; color: var(--grey); }
.bc-note { font-size: .78rem; color: var(--grey); margin: 12px 0 0; }

/* horizontal single-series bars (categories on the axis, one measure) */
.bc-h { display: grid; gap: 10px; }
.bc-hrow { display: grid; grid-template-columns: 158px 1fr 54px; gap: 12px; align-items: center; font-size: .86rem; }
.bc-htrack { background: var(--viz-track); border-radius: 3px; height: 15px; }
.bc-hbar { height: 15px; background: var(--viz); border-radius: 0 4px 4px 0; }
.bc-hrow b { font-family: var(--mono); font-size: .82rem; text-align: right; }

/* --- level track / gamification ----------------------------------------- */
.level-track { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 20px 0 6px; }
.level-seg { text-align: center; }
.level-seg .lb { height: 8px; background: var(--rule); border-radius: 2px; }
.level-seg.done .lb { background: var(--accent); }
.level-seg.now .lb { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.level-seg .ll { font-size: .74rem; color: var(--grey-2); margin-top: 8px; display: block; }
.level-seg.done .ll { color: var(--ink-2); }
.level-seg.now .ll { color: var(--ink); font-weight: 700; }

.ladder { display: grid; }
.ladder-step {
  display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; align-items: center;
  padding: 17px 0; border-bottom: 1px solid var(--rule-2);
}
.ladder-step:last-child { border-bottom: 0; }
.ladder-pts { font-family: var(--mono); font-size: .78rem; color: var(--grey); }
.ladder-step.unlocked .ladder-pts { color: var(--good); font-weight: 700; }
.ladder-step h4 { font-size: 1rem; }
.ladder-step .lm { font-size: .85rem; color: var(--grey); margin-top: 3px; }
.ladder-step.locked { opacity: .6; }

.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.badge { border: 1px solid var(--rule); border-radius: 4px; background: #fff; padding: 15px; text-align: center; }
.badge .bi { width: 40px; height: 40px; margin: 0 auto 10px; border-radius: 50%; background: var(--accent-2); color: var(--accent); display: grid; place-items: center; font-size: 1.05rem; }
.badge.off { background: var(--paper-2); opacity: .6; }
.badge.off .bi { background: var(--rule-2); color: var(--grey-2); }
.badge .bn { font-size: .85rem; font-weight: 600; }
.badge .bd { font-size: .74rem; color: var(--grey); margin-top: 3px; }

.nba { border-left: 3px solid var(--accent); background: var(--accent-2); border-radius: 0 4px 4px 0; padding: 15px 17px; }
.nba h4 { font-size: .96rem; margin-bottom: 4px; }
.nba p { font-size: .84rem; margin: 0 0 12px; color: #5a4220; }

/* --- media / rate card -------------------------------------------------- */
.rate-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
.rate-table th, .rate-table td { padding: 14px; border-bottom: 1px solid var(--rule-2); text-align: left; vertical-align: top; }
.rate-table thead th {
  background: var(--paper-2); font-family: var(--mono); font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--grey);
}
.rate-table td.price { font-family: var(--slab); font-weight: 700; white-space: nowrap; }
.rate-table tbody tr:hover { background: var(--paper-2); }
.rate-table .fmt { font-weight: 600; }
.rate-table .fmtd { font-size: .84rem; color: var(--grey); margin-top: 3px; }

.ad-slot {
  border: 1px dashed var(--grey-2); border-radius: 3px; background: var(--paper-2);
  display: grid; place-items: center; text-align: center;
  font-family: var(--mono); font-size: .66rem; color: var(--grey); padding: 12px; line-height: 1.5;
}
.ad-mock { border: 1px solid var(--rule); border-radius: 4px; padding: 16px; background: #fff; }
.ad-mock .aml { height: 8px; background: var(--rule-2); border-radius: 2px; margin-bottom: 7px; }
.ad-mock .aml.s { width: 62%; }
.sponsored-flag {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: #fff; padding: 3px 8px; border-radius: 2px; display: inline-block;
}

/* --- backlink spec box -------------------------------------------------- */
.link-spec { background: #16181d; color: #cfd3d9; border-radius: 4px; padding: 18px 20px; font-family: var(--mono); font-size: .78rem; line-height: 1.7; overflow-x: auto; }
.link-spec .t { color: #8fb6d1; }
.link-spec .a { color: #d9b382; }
.link-spec .c { color: #6c7480; }

/* --- responsive --------------------------------------------------------- */
@media (max-width: 1060px) {
  .tiers, .kpi-row, .badge-grid { grid-template-columns: repeat(2, 1fr); }
  .bench-row { grid-template-columns: 150px 1fr 42px; }
}
@media (max-width: 720px) {
  .tiers, .kpi-row, .badge-grid, .level-track { grid-template-columns: 1fr; }
  .bench-row, .bc-hrow { grid-template-columns: 1fr; gap: 5px; }
  .bench-row b, .bc-hrow b { text-align: left; }
  .ladder-step { grid-template-columns: 1fr; gap: 7px; }
  .compare-table { font-size: .78rem; }
  .compare-table th, .compare-table td { padding: 8px 6px; }
  .steps > li { grid-template-columns: 28px 1fr; gap: 11px; }
}
