:root {
  --ink: #17201e;
  --muted: #55615e;
  --paper: #ffffff;
  --surface: #f1f4f2;
  --line: #cdd5d1;
  --green: #1f6258;
  --coral: #d9573f;
  --teal: #28758b;
  --yellow: #efbd3f;
  --focus: #0b66c3;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-underline-offset: 3px; }

a:hover { color: var(--green); }

button, input, select { font: inherit; letter-spacing: 0; }

button, select, input[type="checkbox"], input[type="radio"] { cursor: pointer; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 20;
  padding: 9px 12px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  width: min(var(--max), calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  font-size: 12px;
}

.site-header nav { display: flex; gap: 24px; }
.site-header nav a { font-size: 14px; font-weight: 700; text-decoration: none; }

.tool-shell {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.tool-intro,
.fit-workspace,
.guide-band,
.method-band,
.site-footer,
.guide-article,
.simple-page {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.tool-intro { padding: 54px 0 30px; max-width: 760px; margin-left: max(20px, calc((100% - var(--max)) / 2)); }

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 900;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; line-height: 1.12; letter-spacing: 0; }
h1 { max-width: 760px; margin-bottom: 16px; font-size: clamp(40px, 7vw, 72px); }
h2 { margin-bottom: 14px; font-size: clamp(28px, 4vw, 44px); }
h3 { font-size: 22px; }

.tool-intro > p:not(.eyebrow) { max-width: 650px; margin: 0 0 12px; color: var(--muted); font-size: 18px; }
.tool-intro .evidence-note { font-size: 13px !important; }

.fit-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  min-height: 470px;
  padding-bottom: 54px;
}

.fit-form,
.fit-result {
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--line);
}

.fit-form { background: #fff; border-radius: 6px 0 0 6px; }
.fit-result { color: #fff; background: var(--ink); border-color: var(--ink); border-radius: 0 6px 6px 0; }

fieldset { margin: 0 0 24px; padding: 0; border: 0; }
legend, .fit-form > label { margin-bottom: 8px; font-size: 14px; font-weight: 800; }

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.segmented-control label { min-width: 0; }
.segmented-control input { position: absolute; opacity: 0; pointer-events: none; }
.segmented-control span { min-height: 44px; display: grid; place-items: center; padding: 8px; font-size: 14px; font-weight: 800; text-align: center; }
.segmented-control label + label span { border-left: 1px solid var(--line); }
.segmented-control input:checked + span { color: #fff; background: var(--green); }
.segmented-control input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.input-grid label { font-size: 14px; font-weight: 800; }
.number-field { height: 48px; margin-top: 7px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.number-field input { width: 100%; min-width: 0; height: 46px; padding: 0 12px; border: 0; background: transparent; }
.number-field span { padding-right: 12px; color: var(--muted); font-size: 13px; }

.range-label { display: grid; gap: 7px; }
select { width: 100%; height: 48px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; }

.check-row { display: flex !important; align-items: center; gap: 10px; margin: 20px 0 !important; font-weight: 600 !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }

.primary-button,
.secondary-button {
  min-height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button { width: 100%; color: #fff; background: var(--coral); border-color: var(--coral); }
.primary-button:hover { color: #fff; background: #ba402d; }
.secondary-button { color: #fff; background: var(--ink); }
.secondary-button:hover { color: #fff; background: var(--green); }

.result-topline { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.result-status { margin: 0; color: #88d8c8; font-size: 13px; font-weight: 900; text-transform: uppercase; }
.result-score { width: 58px; height: 58px; display: grid; place-items: center; border: 2px solid #88d8c8; border-radius: 50%; font-weight: 900; }
.fit-result h2 { max-width: 520px; margin: 14px 0 10px; font-size: 30px; }
.fit-result > p { color: #cbd5d2; }

.dimension-sketch {
  position: relative;
  min-height: 150px;
  margin: 24px 0;
  display: grid;
  place-items: center;
  border-left: 2px solid var(--yellow);
  border-bottom: 2px solid var(--yellow);
}

.sketch-object { width: 58%; height: 88px; display: grid; place-items: center; color: var(--ink); background: #f8e7a8; border: 2px solid var(--yellow); font-size: 13px; font-weight: 900; }
.sketch-width { position: absolute; left: 50%; bottom: -28px; transform: translateX(-50%); font-size: 12px; }
.sketch-depth { position: absolute; left: -5px; top: 50%; padding: 3px 6px; color: var(--ink); background: var(--yellow); transform: translate(-50%, -50%) rotate(-90deg); font-size: 12px; }
.result-steps { margin: 36px 0 22px; padding-left: 22px; color: #dce3e1; }
.result-steps li { margin-bottom: 7px; }
.text-link { color: #fff; font-weight: 900; }
.text-link:hover { color: #88d8c8; }

.guide-band { padding: 76px 0; }
.path-band { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; padding: 72px 0 18px; border-top: 1px solid var(--line); }
.path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
.path-grid li { min-width: 0; padding-top: 18px; border-top: 4px solid var(--green); }
.path-grid li:nth-child(2) { border-color: var(--teal); }
.path-grid li:nth-child(3) { border-color: var(--coral); }
.path-number { display: block; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.path-grid strong { display: block; margin-bottom: 8px; font-size: 18px; }
.path-grid p { margin: 0; color: var(--muted); font-size: 14px; }
.section-heading { max-width: 760px; margin-bottom: 34px; }
.section-heading > p:last-child { color: var(--muted); font-size: 18px; }

.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.topic-grid--single { grid-template-columns: minmax(0, 760px); }
.topic-card { min-width: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.topic-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 54%; }
.topic-cat img { object-position: center 50%; }
.topic-storage img { object-position: center 46%; }
.topic-coffee img { object-position: center 52%; }
.topic-card-body { padding: 20px; border-top: 5px solid var(--green); }
.topic-storage .topic-card-body { border-color: var(--teal); }
.topic-coffee .topic-card-body { border-color: var(--coral); }
.topic-kicker { margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.topic-card h3 { min-height: 50px; margin-bottom: 18px; }
.topic-card-body > p:last-child { margin-bottom: 0; color: var(--muted); }
.guide-links { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.guide-links li { border-bottom: 1px solid var(--line); }
.guide-links a { display: block; padding: 11px 0; font-weight: 750; text-decoration: none; }
.guide-links a::after { content: "\2192"; float: right; }
.guide-directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; margin-top: 38px; }
.guide-directory section { min-width: 0; padding-top: 18px; border-top: 4px solid var(--green); }
.guide-directory section:nth-child(2) { border-top-color: var(--teal); }
.guide-directory section:nth-child(3) { border-top-color: var(--coral); }
.guide-directory h3 { min-height: 50px; margin-bottom: 18px; }

.method-band { padding: 54px 0; display: grid; grid-template-columns: 0.8fr 1.4fr auto; gap: 38px; align-items: start; border-top: 1px solid var(--line); }
.method-list p { margin: 0 0 12px; color: var(--muted); }

.site-footer { padding: 34px 0 42px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 12px 24px; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer div { display: flex; gap: 20px; }
.affiliate-disclosure { grid-column: 1 / -1; color: var(--ink); font-size: 13px; font-weight: 800; }
.footer-note { grid-column: 1 / -1; font-size: 12px; }

/* Guide pages */
.guide-hero { border-bottom: 1px solid var(--line); background: var(--surface); }
.guide-hero-inner { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: stretch; }
.guide-hero-copy { padding: 62px 48px 62px 0; }
.guide-hero-copy h1 { font-size: clamp(38px, 5vw, 64px); }
.guide-hero-copy > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: 18px; }
.guide-hero img { width: 100%; height: 100%; min-height: 420px; object-fit: cover; }
.guide-article { max-width: 920px; padding: 60px 0 80px; }
.guide-article h2 { margin-top: 48px; font-size: 30px; }
.guide-article h3 { margin-top: 30px; }
.guide-article p, .guide-article li { color: #34413e; }
.guide-article li { margin-bottom: 8px; }
.guide-article .lede { font-size: 20px; color: var(--ink); }
.article-date { margin: 0 0 12px; color: var(--muted) !important; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.guide-article .evidence-note { padding: 16px 18px; border-left: 4px solid var(--teal); background: var(--surface); }
.source-label { display: inline-block; margin-bottom: 16px; padding: 4px 8px; background: #e1ebe8; color: var(--green); border-radius: 3px; font-size: 12px; font-weight: 900; }
.measure-table { width: 100%; margin: 24px 0; border-collapse: collapse; table-layout: fixed; }
.measure-table th, .measure-table td { padding: 12px; border: 1px solid var(--line); overflow-wrap: anywhere; text-align: left; vertical-align: top; }
.measure-table th { background: var(--surface); }
.formula-box { margin: 28px 0; padding: 20px; border-left: 5px solid var(--yellow); background: #fff9e6; }
.formula-box p { margin: 0 0 7px; }
.formula-box p:last-child { margin-bottom: 0; }
.decision-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 28px 0; background: var(--line); border: 1px solid var(--line); }
.decision-strip div { min-height: 120px; padding: 18px; background: #fff; }
.decision-strip strong { display: block; margin-bottom: 8px; }
.cta-band { margin-top: 50px; padding: 28px; display: flex; justify-content: space-between; gap: 24px; align-items: center; color: #fff; background: var(--ink); }
.cta-band p { margin: 0; color: #dce3e1; }
.cta-band a { flex: 0 0 auto; color: var(--ink); background: var(--yellow); border-color: var(--yellow); }
.guide-nav { margin-top: 50px; padding-top: 24px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); }

/* Data-driven candidate catalog */
.product-zone { margin-top: 58px; padding-top: 42px; border-top: 1px solid var(--line); }
.catalog-heading { max-width: 700px; margin-bottom: 26px; }
.catalog-heading h2 { margin-bottom: 10px; font-size: 32px; }
.catalog-description, .catalog-note, .catalog-empty { color: var(--muted); }
.catalog-trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.catalog-trust__item { padding: 6px 9px; color: var(--green); background: #e7f0ed; border-radius: 3px; font-size: 11px; font-weight: 800; }
.catalog-toolbar { display: flex; align-items: end; justify-content: flex-start; gap: 14px; margin: 24px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.catalog-filter-label { display: grid; gap: 7px; min-width: 190px; font-size: 13px; font-weight: 800; }
.catalog-filter { width: 100%; min-width: 0; height: 42px; }
.catalog-count { color: var(--muted); font-size: 13px; font-weight: 800; }
.catalog-grid, .catalog-static-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.product-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-top: 4px solid var(--teal); border-radius: 5px; background: #fff; }
.product-card--featured { border-top-color: var(--coral); box-shadow: 0 8px 20px rgba(23, 32, 30, 0.08); }
.product-card__body { padding: 20px; }
.product-card__header, .product-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-card__label { margin: 0; color: var(--muted); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.product-card__evidence { color: var(--green); font-size: 11px; font-weight: 800; text-align: right; }
.product-card__title { margin: 12px 0 8px; font-size: 21px; }
.product-card__summary { margin: 0 0 14px; color: #34413e; font-size: 14px; }
.product-card__fit { margin: 0 0 14px; font-size: 13px; }
.product-card__fit--pass { color: var(--green); }
.product-card__fit--check { color: var(--coral); }
.product-card__meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 14px; font-size: 13px; }
.product-card__meta dt { color: var(--muted); }
.product-card__meta dd { margin: 0; font-weight: 800; text-align: right; }
.product-card__reason, .product-card__risk { margin: 0 0 10px; color: #34413e; font-size: 13px; }
.product-card__risk { color: var(--muted); }
.product-card__reason strong, .product-card__risk strong { color: var(--ink); }
.product-card__tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 27px; margin-bottom: 16px; }
.product-tag { padding: 4px 7px; color: var(--green); background: #e7f0ed; border-radius: 3px; font-size: 11px; font-weight: 800; text-transform: capitalize; }
.product-card__footer { align-items: baseline; padding-top: 12px; border-top: 1px solid var(--line); }
.product-card__link { color: var(--green); font-size: 14px; font-weight: 900; }
.product-card__status { color: var(--muted); font-size: 11px; }
.catalog-note { margin: 18px 0 0; font-size: 12px; }
.catalog-empty { margin: 0; padding: 20px; border: 1px dashed var(--line); }

.simple-page { max-width: 820px; padding: 70px 0 90px; }
.simple-page h1 { font-size: 54px; }
.simple-page h2 { margin-top: 42px; font-size: 28px; }

.analytics-consent {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100% - 36px));
  padding: 18px;
  color: #fff;
  background: var(--ink);
  border: 1px solid #41504d;
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(23, 32, 30, 0.24);
}
.analytics-consent p { margin: 0 0 14px; color: #e8efed; font-size: 14px; }
.analytics-consent div { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.analytics-consent button { width: auto; min-height: 40px; padding: 9px 13px; }
.analytics-consent__decline { color: #fff; background: transparent; border-color: #83918e; }
.analytics-consent a { margin-left: auto; color: #fff; font-size: 13px; font-weight: 800; }

@media (max-width: 860px) {
  .site-header { min-height: 62px; }
  .site-header nav a:not(:last-child) { display: none; }
  .tool-intro { width: calc(100% - 40px); margin-inline: auto; padding-top: 42px; }
  .fit-workspace, .topic-grid, .method-band, .guide-hero-inner, .path-grid, .guide-directory { grid-template-columns: 1fr; }
  .fit-form { border-radius: 6px 6px 0 0; }
  .fit-result { border-radius: 0 0 6px 6px; }
  .method-band { gap: 24px; }
  .guide-hero-copy { padding: 46px 0 32px; }
  .guide-hero img { min-height: 300px; max-height: 520px; }
  .decision-strip { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer div { flex-wrap: wrap; }
  .cta-band { align-items: flex-start; flex-direction: column; }
  .catalog-grid, .catalog-static-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .site-header, .tool-intro, .fit-workspace, .path-band, .guide-band, .method-band, .site-footer, .guide-hero-inner, .guide-article, .simple-page { width: min(100% - 28px, var(--max)); }
  .brand { font-size: 14px; }
  h1 { font-size: 42px; }
  .fit-form, .fit-result { padding: 22px; }
  .segmented-control span { min-height: 50px; padding: 6px 3px; font-size: 12px; }
  .input-grid { grid-template-columns: 1fr; }
  .topic-card h3 { min-height: auto; }
  .guide-directory h3 { min-height: auto; }
  .guide-article { padding-top: 42px; }
  .guide-article h2 { font-size: 27px; }
  .simple-page h1 { font-size: 42px; }
  .catalog-toolbar { align-items: flex-start; flex-direction: column; }
  .catalog-filter-label, .catalog-filter { width: 100%; max-width: none; }
  .catalog-count { align-self: flex-start; }
  .product-card__header { align-items: flex-start; flex-direction: column; gap: 4px; }
  .product-card__evidence { text-align: left; }
  .product-card__footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .analytics-consent { right: 14px; bottom: 14px; width: calc(100% - 28px); }
  .analytics-consent a { margin-left: 0; }
}

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