/* Standing Desk Reference — shared styles */

:root {
  --bg: #fafaf7;
  --bg-elev: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #5b5b5b;
  --ink-faint: #8a8a8a;
  --border: #e6e3da;
  --border-strong: #cdc9bd;
  --accent: #2f6f4a;
  --accent-soft: #e6f0e9;
  --warn: #b25a1a;
  --row-hover: #f4f1ea;
  --header-bg: #f7f4ec;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 6px;
  --max-width: 1400px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.site-header {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-brand-link {
  display: inline-flex;
  line-height: 0;
  flex-shrink: 0;
}
.site-logo {
  display: block;
  height: 48px;
  width: auto;
}
.site-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.site-title a { color: inherit; }
.site-tagline {
  color: var(--ink-muted);
  font-size: 14px;
}
.breadcrumbs {
  font-size: 13px;
  color: var(--ink-muted);
}
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs span.sep { margin: 0 6px; color: var(--ink-faint); }
/* When breadcrumbs sit outside the header-inner row (sub-pages), add room */
.site-header > .breadcrumbs {
  max-width: var(--max-width);
  margin: 8px auto 0;
  padding: 0 0;
}

/* Primary site nav — inline with the brand block */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 4px;
  font-size: 14px;
}
.site-nav a,
.site-nav .nav-soon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--ink-muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--row-hover); color: var(--ink); text-decoration: none; }
.site-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.site-nav .nav-soon {
  color: var(--ink-faint);
  cursor: default;
}
.site-nav .nav-soon-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink-faint);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* Old simple footer — kept as a fallback (empty placeholder before
   footer.js runs gets minimal styling) but the rich version below
   takes over once the JS injects its content. */
footer.site-footer {
  max-width: var(--max-width);
  margin: 32px auto 48px;
  padding: 16px 24px;
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}

/* ---------- Site-wide rich footer (built by assets/footer.js) ---------- */
footer.site-footer-rich {
  max-width: none;
  margin: 64px 0 0;
  padding: 48px 24px 24px;
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1fr 1.2fr 2fr;
  gap: 48px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-list li {
  padding: 4px 0;
  line-height: 1.4;
}
.footer-list a {
  color: var(--ink-muted);
}
.footer-list a:hover {
  color: var(--accent);
}

/* Newsletter column */
.footer-newsletter-text {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--ink-muted);
}
.footer-newsletter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-newsletter-row {
  display: flex;
  gap: 8px;
}
.footer-newsletter-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.footer-newsletter-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.footer-newsletter-button {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--bg-elev);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}
.footer-newsletter-button:hover {
  background: #245839;
  border-color: #245839;
}
.footer-newsletter-status {
  font-size: 13px;
  color: var(--ink-faint);
  min-height: 1.4em;
  margin-top: 2px;
}
.footer-newsletter-status-success {
  color: var(--accent);
}
.footer-newsletter-status-error {
  color: #b04a3f;
}

/* Meta row: copyright + affiliate disclaimer */
.footer-meta {
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}
.footer-copyright {
  margin: 0 0 8px;
}
.footer-copyright a {
  color: var(--ink-muted);
  font-weight: 600;
}
.footer-copyright a:hover {
  color: var(--accent);
}
.footer-affiliate {
  margin: 0 auto;
  max-width: 720px;
  line-height: 1.5;
}
.footer-affiliate strong {
  color: var(--ink-muted);
}

@media (max-width: 980px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-col-newsletter {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .footer-cols {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  footer.site-footer-rich {
    padding: 32px 16px 20px;
    margin-top: 40px;
  }
  .footer-newsletter-row {
    flex-direction: column;
  }
}

/* ---------- Home: intro blurb ---------- */
.home-intro {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.home-intro-heading {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.home-intro-steps {
  margin: 0;
  padding-left: 22px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}
.home-intro-steps li {
  margin: 6px 0;
}
.home-intro-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}
.home-intro-steps strong {
  color: var(--ink);
  font-weight: 600;
}
.home-intro-steps em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Home: controls ---------- */
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.controls-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.controls input[type="search"] {
  flex: 1 1 260px;
  min-width: 200px;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.controls select {
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.controls .count {
  color: var(--ink-muted);
  font-size: 13px;
  margin-left: auto;
}
/* Height filter — sits on its own row above the search bar */
.height-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
}
.ctrl-label {
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 600;
  margin-right: 4px;
}
.height-input {
  width: 48px;
  padding: 6px 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  text-align: center;
  font-variant-numeric: tabular-nums;
  /* Hide the spinners so we don't get cluttered controls inside the pill */
  -moz-appearance: textfield;
}
.height-input::-webkit-outer-spin-button,
.height-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.height-sep {
  color: var(--ink-faint);
  font-size: 14px;
  font-weight: 600;
}
.height-clear {
  margin-left: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--ink-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.height-clear:hover {
  background: var(--row-hover);
  color: var(--ink);
}
.height-hint {
  color: var(--ink-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.height-hint.height-hint-prompt {
  color: var(--accent);
  font-style: italic;
  font-variant-numeric: normal;
}

/* ---------- Banner ad slot (used on every page) ---------- */
/* Sits inside <main>, stretches to its parent's width, scales the image
   proportionally. On the home page only, the wide-view toggle expands
   it alongside the table via the body.fullwidth-table rule below. */
.page-banner {
  display: block;
  margin: 28px 0 0;
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
  transition: opacity 0.15s ease;
}
.page-banner:hover {
  opacity: 0.92;
}
.page-banner img {
  width: 100%;
  height: auto;
  display: block;
}
body.fullwidth-table .page-banner {
  max-width: none;
  width: calc(100vw - 32px);
  margin-left: calc(50% - 50vw + 16px);
  margin-right: calc(50% - 50vw + 16px);
}

/* ---------- Home: a small helper line above the table ---------- */
/* Flex row: help text on the left, the wide-view toggle right-aligned. */
.table-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.table-help-text {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.table-help-em {
  color: var(--ink-muted);
  font-weight: 600;
}
.table-help .fullwidth-toggle {
  flex-shrink: 0;
}

/* ---------- Home: table ---------- */
.desk-table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}
table.desk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.desk-table th, .desk-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.desk-table th {
  background: var(--header-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 1;
}
.desk-table th:hover { background: #f1ecde; color: var(--ink); }
.desk-table th .arrow {
  display: inline-block;
  margin-left: 4px;
  color: var(--ink-faint);
  font-size: 11px;
}
.desk-table th.sorted-asc .arrow,
.desk-table th.sorted-desc .arrow { color: var(--accent); }
.desk-table tbody tr:hover { background: var(--row-hover); }
.desk-table tbody tr:last-child td { border-bottom: none; }
.desk-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.desk-table td.wrap { white-space: normal; min-width: 300px; }
.desk-table th.col-center, .desk-table td.col-center { text-align: center; }
.desk-table .price { font-variant-numeric: tabular-nums; }
.desk-table .model-cell { font-weight: 600; }
.desk-table .mfr-cell a { color: var(--ink-muted); }
.desk-table .known-for {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
/* Scores column — three labeled 0-5 dot bars on the left,
   composite total on the right, vertically centered.            */
.desk-table .scores {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 180px;
}
.desk-table .scores-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
}
.desk-table .scores-total {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.desk-table .scores-total-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.desk-table .scores-total-max {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 2px;
  letter-spacing: 0.04em;
}
.desk-table .score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-muted);
}
.desk-table .score-label {
  flex: 0 0 56px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.desk-table .score-bar {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.desk-table .score-bar .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  display: inline-block;
}
.desk-table .score-bar .dot.dot-on {
  background: var(--accent);
}
/* Clamp the model tagline at 2 lines so long blurbs never balloon row height */
.desk-table .model-tag {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-muted);
}
.empty-state .pill {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Detail pages ---------- */
.page-title {
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 4px;
}
.page-subtitle {
  color: var(--ink-muted);
  margin: 0 0 24px;
  font-size: 16px;
}

.section {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.section h2 {
  font-size: 18px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.section h3 {
  font-size: 15px;
  margin: 16px 0 8px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
}
.spec-grid .spec dt {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.spec-grid .spec dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tag-list li {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.proscons ul { padding-left: 20px; margin: 6px 0; }
.proscons .pros h3 { color: var(--accent); }
.proscons .cons h3 { color: var(--warn); }

.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.review-list li:last-child { border-bottom: none; }
.review-list .meta { color: var(--ink-faint); font-size: 12px; margin-left: 6px; }

.buy-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.buy-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  font-weight: 600;
  font-size: 14px;
}
.buy-links a:hover { background: var(--row-hover); text-decoration: none; }
.buy-links a.direct {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.buy-links a.direct:hover { background: #245839; }

.price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: baseline;
  font-size: 15px;
  margin-bottom: 12px;
}
.price-row .price-big {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price-row .price-label {
  color: var(--ink-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.model-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-elev);
}
.model-card h3 { margin: 0 0 4px; font-size: 16px; }
.model-card .price { color: var(--ink-muted); font-size: 13px; }

.accessory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.accessory {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-elev);
}
.accessory-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.accessory-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.accessory-thumb:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  text-decoration: none;
}
.accessory-thumb svg {
  width: 56px;
  height: 56px;
  display: block;
}
.accessory-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
}
.accessory-icon-fallback {
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
}
.accessory-icon-fallback svg {
  width: 56px;
  height: 56px;
}
.accessory-body {
  flex: 1 1 auto;
  min-width: 0;
}
.accessory-head {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.accessory-name { color: var(--accent); }
.accessory-vendor {
  color: var(--ink-muted);
  font-weight: 400;
  font-size: 14px;
}
.accessory-desc {
  color: var(--ink-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 8px;
}
.accessory-links {
  font-size: 13px;
}
.accessory-links a { font-weight: 600; }

/* ---------- Calculator page ---------- */
.calc-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin: 12px 0 24px;
}
.calc-tab {
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
}
.calc-tab:hover { color: var(--ink); }
.calc-tab.active {
  background: var(--accent);
  color: white;
}
.calc-tab-sub {
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
  opacity: 0.85;
}

.calc-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.calc-card h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 700;
  margin: 0 0 14px;
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 32px;
  align-items: start;
}
.calc-inputs { display: flex; flex-direction: column; gap: 16px; }
.calc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.calc-field select {
  padding: 9px 12px;
  font-size: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.calc-help {
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.45;
}
/* Hide advanced-only fields unless body has the advanced class */
.calc-advanced-only { display: none; }
.calc-mode-advanced .calc-advanced-only { display: flex; }
/* Result cards need block display, not flex (their dt/dd should stack) */
.calc-mode-advanced .calc-result.calc-advanced-only { display: block; }

.calc-output {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.calc-figure {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin: 0 0 8px;
  overflow: hidden;
}
.calc-figure img {
  display: block;
  width: 100%;
  height: auto;
}
/* Calculated values overlaid on the figure. Positions sit on the two
   unlabeled vertical arrows in the right-hand panel of the diagram:
   the long left-side arrow (eye height, full body span) and the short
   right-side arrow (desk height, desk-to-floor). */
.calc-fig-overlay {
  position: absolute;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 6px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
}
.calc-fig-eye  { top: 33%; left: 57%; }
.calc-fig-desk { top: 74%; left: 90%; }

.calc-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 0;
}
.calc-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.calc-result dt {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  margin-bottom: 4px;
}
.calc-result dd {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.calc-result-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* Required-range card */
.calc-range-card { padding: 24px; }
.calc-range-head { margin-bottom: 16px; }
.calc-range-blurb {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.55;
}
.calc-range-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}
.calc-range-cell {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-align: center;
}
.calc-range-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  font-weight: 700;
}
.calc-range-value {
  display: block;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin: 4px 0;
}
.calc-range-sub {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calc-range-arrow {
  font-size: 22px;
  color: var(--ink-faint);
  font-weight: 700;
}
.calc-range-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 4px;
}
.calc-fit-button {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: var(--radius);
}
.calc-fit-button:hover {
  background: #245839;
  text-decoration: none;
  color: white;
}
.calc-fit-hint {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ---------- Blog: listing ---------- */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Pagination controls (top + bottom of the post list).
 * Anchors look like the post-pager links on individual post pages so the
 * blog has a consistent navigation vocabulary. */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.blog-pagination .pagination-prev,
.blog-pagination .pagination-next {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.blog-pagination .pagination-prev:hover,
.blog-pagination .pagination-next:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}
.blog-pagination .disabled {
  color: var(--ink-muted);
  opacity: 0.55;
  cursor: default;
}
.blog-pagination .pagination-nums {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.blog-pagination .pagination-num {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
}
.blog-pagination .pagination-num:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}
.blog-pagination .pagination-num.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}

@media (max-width: 560px) {
  .blog-pagination { gap: 8px; }
  .blog-pagination .pagination-num { min-width: 30px; padding: 6px 8px; }
}
.post-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: border-color 0.15s ease;
}
.post-card:hover {
  border-color: var(--border-strong);
}
.post-card-thumb {
  flex: 0 0 220px;
  display: block;
  background: var(--bg);
  overflow: hidden;
  /* Override the default link color/underline so the thumb behaves
     like an image button, not a text link. */
  color: inherit;
  text-decoration: none;
}
.post-card-thumb:hover { text-decoration: none; }
.post-card-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ensure images don't get crushed when card content is short. The
     min-height keeps the card looking "image-led" even on tiny excerpts. */
  min-height: 160px;
}
.post-card-body {
  flex: 1 1 auto;
  min-width: 0; /* let long words wrap inside flex child */
  padding: 22px 24px;
}
.post-meta {
  font-size: 12px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.post-author { color: var(--ink-faint); }
.post-card-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.post-card-title a { color: var(--ink); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-subtitle {
  color: var(--ink-muted);
  font-size: 15px;
  font-style: italic;
  margin-bottom: 10px;
}
.post-card-excerpt {
  color: var(--ink);
  margin: 8px 0 12px;
  line-height: 1.55;
}
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.post-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: lowercase;
  letter-spacing: 0.02em;
}
.post-card-link a {
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Blog: single post ---------- */
.post {
  max-width: 720px;
  margin: 0 auto;
}
.post-header { margin-bottom: 28px; }
.post-title {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  margin: 8px 0 4px;
  color: var(--ink);
}
.post-subtitle {
  font-size: 18px;
  font-style: italic;
  color: var(--ink-muted);
  margin: 4px 0 14px;
  line-height: 1.45;
}
.post-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}
.post-body p { margin: 0 0 16px; }
.post-body h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--ink);
}
.post-body h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 10px;
}
.post-body ul, .post-body ol { margin: 0 0 16px; padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body strong { font-weight: 700; }
.post-body em { font-style: italic; }
.post-body a { color: var(--accent); }
.post-body a:hover { text-decoration: underline; }
.post-body code {
  background: var(--bg-elev);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border);
}
.post-body blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-muted);
  font-style: italic;
}
.post-body .post-figure {
  margin: 24px 0;
  padding: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-body .post-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.post-body .post-figure figcaption {
  font-size: 13px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Prev/next pager at the bottom of a post */
.post-pager {
  max-width: 720px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
}
.post-pager a:hover {
  border-color: var(--border-strong);
  text-decoration: none;
}
.post-pager-prev { text-align: left; }
.post-pager-next { text-align: right; grid-column: 2; }
.post-pager-direction {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 600;
}
.post-pager-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .proscons { grid-template-columns: 1fr; }
  .desk-table th, .desk-table td { padding: 8px 8px; }
  main { padding: 16px; }
  .accessory-list { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; gap: 20px; }
  .calc-range-grid { grid-template-columns: 1fr; }
  .calc-range-arrow { transform: rotate(90deg); }
  .post-title { font-size: 26px; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager-next { grid-column: 1; text-align: left; }
  /* On narrow screens, stack the blog-card hero on top of the body
     instead of the side-by-side rail. 3:2 aspect mirrors the source
     image so we don't get awkward squashing. */
  .post-card { flex-direction: column; }
  .post-card-thumb { flex: 0 0 auto; aspect-ratio: 3 / 2; width: 100%; }
  .post-card-thumb img { min-height: 0; }
}

/* ---------- FAQ page ---------- */
.page-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
}
.page-subtitle {
  color: var(--ink-muted);
  font-size: 16px;
  margin: 0 0 32px;
  max-width: 720px;
}
.faq-section {
  margin: 0 0 28px;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--border);
}
.faq-section:last-child {
  border-bottom: none;
}
.faq-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink);
}
.faq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.faq-list li {
  padding: 6px 0;
}
.faq-list a {
  font-size: 16px;
  color: var(--accent);
}

/* ---------- Home: FAQ block (sits above the intro at the top of home) ---------- */
.home-faq {
  margin: 0 0 28px;
  padding: 28px 28px 24px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.home-faq-heading {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
}
.home-faq-subtitle {
  color: var(--ink-muted);
  font-size: 14px;
  margin: 0 0 24px;
}
.home-faq-subtitle a {
  font-weight: 600;
}
.home-faq-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.home-faq-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.home-faq-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.home-faq-col li {
  padding: 5px 0;
  line-height: 1.35;
}
.home-faq-col a {
  font-size: 14px;
  color: var(--accent);
}
@media (max-width: 980px) {
  .home-faq-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .home-faq-grid { grid-template-columns: 1fr; }
  .home-faq { padding: 20px 18px; }
}

/* ---------- Full-width table toggle ---------- */
.fullwidth-toggle {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.fullwidth-toggle:hover {
  background: var(--row-hover);
  color: var(--ink);
}
body.fullwidth-table .fullwidth-toggle {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}
/* When wide-view is on, break the table out of main's max-width.
   Keep the prose blocks (intro, FAQ, controls) at their normal width
   so they remain readable; only the table expands. */
body.fullwidth-table .desk-table-wrap {
  max-width: none;
  width: calc(100vw - 32px);
  margin-left: calc(50% - 50vw + 16px);
  margin-right: calc(50% - 50vw + 16px);
}
/* Don't show the toggle on viewports too narrow to benefit from wide view. */
@media (max-width: 1099px) {
  .fullwidth-toggle { display: none; }
}

/* ---------- Tempo compatibility icons ---------- */
.tempo-icon {
  display: inline-block;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  font-variant-numeric: normal;
}
.tempo-icon.tempo-yes { color: var(--accent); }
.tempo-icon.tempo-no { color: #b04a3f; }
.tempo-icon.tempo-unknown { color: var(--ink-faint); font-weight: 400; }

/* ---------- Column header tooltips ---------- */
/* A single shared tooltip element is appended to <body> by home.js and
   positioned via JS on column-header hover. Living outside the table wrap
   (which has overflow:auto) means it can never be clipped by the wrap, and
   the JS clamps its left/top so it always fits in the viewport. */
.col-tooltip {
  position: fixed;
  background: var(--ink);
  color: var(--bg);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: none;
  letter-spacing: 0;
  width: 260px;
  text-align: left;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}
.col-tooltip.col-tooltip-shown {
  opacity: 1;
  visibility: visible;
}
@media (max-width: 720px) {
  .col-tooltip { display: none !important; }
}

/* ---------- Recommendations page ---------- */
/* The TOC sits between the page subtitle and the first category section. */
.rec-toc {
  margin: 0 0 36px;
  padding: 18px 24px;
  background: var(--header-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rec-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rec-toc-list li {
  padding: 5px 0;
  font-size: 15px;
  line-height: 1.4;
  border-bottom: 1px dashed var(--border);
}
.rec-toc-list li:last-child { border-bottom: none; }
.rec-toc-list a {
  color: var(--ink);
  font-weight: 600;
  display: inline-block;
}
.rec-toc-list a:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Each numbered category section. The thin border across the top is the
   visual cue separating one category from the next. */
.rec-section {
  margin: 0 0 48px;
  padding: 28px 0 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 24px;
}
.rec-section:first-of-type { border-top: none; padding-top: 0; }

.rec-section-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 6px;
}
.rec-section-num {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.rec-section-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}
.rec-section-blurb {
  color: var(--ink-muted);
  font-size: 15px;
  margin: 0 0 22px;
  max-width: 820px;
}

/* Pick cards. Three-up on desktop, two-up around tablet, one-up on phone. */
.rec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 980px) {
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .rec-grid { grid-template-columns: 1fr; }
}

.rec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.rec-card:hover {
  border-color: var(--border-strong);
}

/* Tier ribbon — sits in the top-right corner of the card. */
.rec-tier {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-muted);
}
.rec-tier-top {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.rec-tier-value {
  background: #fff5e6;
  border-color: var(--warn);
  color: var(--warn);
}
.rec-tier-budget {
  background: var(--row-hover);
  border-color: var(--border-strong);
  color: var(--ink-muted);
}
/* Bonus section uses a distinct purple tone so the cards read as "extras"
   rather than fitting the Top/Value/Budget hierarchy of the main sections. */
.rec-tier-bonus {
  background: #efe9f5;
  border-color: #8a6dab;
  color: #6a4f8a;
}

/* Image slot. Until real images are dropped in, the .rec-thumb-label inside
   shows the product name on a subtle gradient — looks intentional, not
   broken. To use a real image, replace the inner label with an <img>. */
.rec-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  width: 100%;
  margin: 0 0 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f0ece2 0%, #e6e3da 100%);
  overflow: hidden;
}
.rec-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.rec-thumb-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  text-align: center;
  padding: 0 12px;
}

.rec-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
  line-height: 1.25;
}
.rec-card-desc {
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 14px;
  flex: 1 1 auto;
}

/* Foot row — price on the left, buy button right-aligned. */
.rec-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.rec-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.rec-buy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-elev);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  white-space: nowrap;
}
.rec-buy:hover {
  background: #245a3b;
  text-decoration: none;
  color: var(--bg-elev);
}
