/* ==================================================================
   printtestpro.com
   Screen styles first, print styles last (print always wins).
   ================================================================== */

:root {
  --ink: #0f1115;
  --muted: #5b6472;
  --line: #e3e7ee;
  --bg: #f7f8fa;
  --accent: #0057ff;
  --accent-ink: #ffffff;
  --ok: #0f9d58;
  --warn: #b45309;
  --radius: 12px;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

img, svg { max-width: 100%; }

a { color: var(--accent); }

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* ---------- header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
  flex: none;
}
.brand-mark {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, #00AEEF 0 25%, #EC008C 25% 50%, #FFF200 50% 75%, #111 75%);
  flex: none;
}
.nav {
  display: flex;
  gap: 1.1rem;
  font-size: .9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { font-weight: 700; }

/* ---------- hero ---------- */
.hero { padding: 2.8rem 0 1.4rem; text-align: center; }
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 2.75rem);
  line-height: 1.15;
  margin: 0 0 .7rem;
  letter-spacing: -.025em;
}
.hero p.lede {
  font-size: 1.06rem;
  color: var(--muted);
  margin: 0 auto 1.2rem;
  max-width: 68ch;
}
.hero .controls,
.hero .notice,
.hero .section-list,
.hero .preview-frame { text-align: left; }
.eyebrow {
  display: inline-block;
  font-size: .76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  background: #eaf1ff;
  border: 1px solid #d3e0ff;
  padding: .28rem .7rem;
  border-radius: 999px;
  margin-bottom: .9rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .5rem .7rem;
  text-align: center;
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .55rem 1.2rem;
  margin: 0 auto 1.4rem;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(15,17,21,.05);
}
.hero-meta i {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}
.hero-meta span { white-space: nowrap; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  margin: 0 0 .85rem;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs b { color: #c3c9d4; font-weight: 400; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 700; }

.trust {
  list-style: none;
  margin: 0 0 1.4rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .45rem .55rem;
}
.trust li {
  font-size: .84rem;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .75rem;
}
.trust li::before {
  content: '✓';
  color: var(--ok);
  font-weight: 700;
  margin-right: .38rem;
}

/* ---------- controls ---------- */
.controls {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.2rem;
}
.section-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.4rem auto 1.2rem;
}
.section-list h2 {
  margin: 0 0 .55rem;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-list ul { margin: 0; padding: 0; list-style: none; }
.section-list li {
  border-top: 1px solid var(--line);
  padding: .58rem 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--muted);
}
.section-list li:first-child { border-top: 0; }
.section-list li a { color: var(--ink); font-weight: 700; text-decoration: none; }
.section-list li a:hover { color: var(--accent); }

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 1.4rem;
  align-items: flex-end;
}
.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
}
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg button {
  font: inherit;
  font-size: .87rem;
  padding: .46rem .8rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  transition: .12s;
}
.seg button:hover { border-color: #b9c0cc; }
.seg button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  padding: .72rem 1.3rem;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #b9c0cc; }

/* ---------- scaling warning ---------- */
.notice {
  display: flex;
  gap: .6rem;
  align-items: flex-start;
  background: #fff8eb;
  border: 1px solid #f3dfb0;
  color: var(--warn);
  border-radius: 9px;
  padding: .7rem .9rem;
  font-size: .89rem;
  margin-bottom: 1.1rem;
}
.notice strong { color: #8a4708; }

/* ---------- PDF download matrix ---------- */
.dl-table { overflow-x: auto; margin: .4rem 0 1.6rem; }
.dl-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dl-table th, .dl-table td { border-bottom: 1px solid var(--line); padding: .5rem .55rem; }
.dl-table thead th {
  background: #f5f7fa;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  text-align: center;
}
.dl-table thead th:first-child { text-align: left; }
.dl-table tbody th { font-weight: 600; text-align: left; }
.dl-table td { text-align: center; }
.dl-table a { color: var(--accent); font-weight: 700; text-decoration: none; }
.dl-table a:hover { text-decoration: underline; }

/* ---------- preview ---------- */
.preview-frame {
  background: #eceef2;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(.6rem, 2vw, 1.5rem);
  overflow: auto;
  display: flex;
  justify-content: center;
}
.sheet-preview {
  display: block;
  background: #fff;
  box-shadow: 0 6px 26px rgba(15,17,21,.13);
  width: 210mm;
  height: 297mm;
  max-width: none;
}
.sheet-preview svg { display: block; width: 100%; height: 100%; }

/* ---------- pattern cards ---------- */
.section { padding: 2.6rem 0; scroll-margin-top: 70px; }
.section.alt {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section h2 {
  font-size: 1.45rem;
  margin: 0 0 .3rem;
  letter-spacing: -.01em;
}
.section p.sub { color: var(--muted); margin: 0 0 1.4rem; max-width: 72ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .9rem;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: .14s;
}
.section:not(.alt) .card { background: #fff; }
.card:hover { border-color: #b9c0cc; transform: translateY(-2px); }
.card h3 { margin: 0; font-size: 1.02rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; font-size: .88rem; color: var(--muted); flex: 1; }
.card .card-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.card .btn { font-size: .84rem; padding: .5rem .85rem; }

.card-thumb {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  height: 152px;
  position: relative;
  text-decoration: none;
}
.card-thumb svg { display: block; width: 100%; height: auto; }
.card-thumb::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 46px;
  background: linear-gradient(rgba(255,255,255,0), #fff);
  pointer-events: none;
}
.card-thumb:empty::before {
  content: 'Loading preview…';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .78rem;
  color: var(--muted);
  background: repeating-linear-gradient(45deg, #fafbfd 0 8px, #f3f5f9 8px 16px);
}

.chip {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .16rem .5rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  align-self: flex-start;
}

/* ---------- symptom finder ---------- */
.finder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: .7rem;
}
.finder-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: .8rem .95rem;
  text-decoration: none;
  color: var(--ink);
  transition: .13s;
}
.finder-item:hover {
  border-left-color: var(--ink);
  box-shadow: 0 3px 12px rgba(15,17,21,.07);
}
.finder-q { font-size: .94rem; }
.finder-a {
  font-size: .86rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  flex: none;
}

/* ---------- steps ---------- */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .9rem;
}
.steps li {
  counter-increment: step;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.05rem;
}
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .55rem;
}
.steps h3 { margin: 0 0 .3rem; font-size: .98rem; }
.steps p { margin: 0; font-size: .87rem; color: var(--muted); }
.steps a { text-decoration: none; font-weight: 700; }

/* ---------- why / facts ---------- */
.split {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.6rem;
  align-items: start;
}
.split p { margin: 0 0 .85rem; color: var(--muted); font-size: .97rem; }
.split p:last-child { margin-bottom: 0; }
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .7rem;
}
.fact {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .95rem 1rem;
}
.fact strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.fact span { font-size: .8rem; color: var(--muted); }

/* ---------- brands ---------- */
.brands {
  list-style: none;
  margin: 0 0 1.2rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.brands li {
  font-size: .87rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .34rem .85rem;
  color: var(--muted);
}
.note {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: .8rem 1rem;
  font-size: .9rem;
  color: var(--muted);
}
.note strong { color: var(--ink); }
.note a { font-weight: 700; text-decoration: none; }

/* ---------- content ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; }
.prose h3 { font-size: 1.08rem; margin-top: 1.5rem; }
.prose li { margin-bottom: .3rem; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: .85rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  position: relative;
  padding-right: 2rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: .2rem;
  color: var(--muted);
  font-weight: 400;
}
.faq details[open] summary::after { content: '–'; }
.faq p { margin: .6rem 0 0; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 1.8rem 0;
  margin-top: 2.5rem;
  font-size: .88rem;
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }
.legal-note { font-size: .78rem; color: var(--muted); opacity: .9; }
.legal-note span { max-width: 74ch; }

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: .35rem;
    padding: .6rem 0;
    min-height: 0;
  }
  .nav {
    justify-content: flex-start;
    gap: .85rem;
    font-size: .85rem;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
    padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .hero { padding-top: 1.8rem; }
  .hero-meta { font-size: .84rem; padding: .5rem .9rem; gap: .35rem .55rem; }
  .trust li { font-size: .77rem; padding: .25rem .6rem; }
  .trust { gap: .35rem .4rem; }
  .control-row { flex-direction: column; align-items: stretch; }
  .actions .btn { flex: 1; }
  .split { grid-template-columns: 1fr; gap: 1.2rem; }
  .finder { grid-template-columns: 1fr; }
  .sheet-preview { width: 100% !important; height: auto !important; aspect-ratio: 210 / 297; }
}

/* ==================================================================
   PRINT — everything below applies only when printing
   ================================================================== */

#print-root { display: none; }

@media print {
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }

  .site-header,
  .hero,
  .controls,
  .notice,
  .preview-frame,
  .section,
  .site-footer,
  .no-print { display: none !important; }

  #app { display: none !important; }

  #print-root { display: block !important; }

  /* Belt and braces: SVG fill already prints, this covers any CSS colour */
  #print-root, #print-root * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  .sheet {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    page-break-after: always;
    break-after: page;
    overflow: hidden;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }

  .sheet > svg {
    display: block;
    width: 100%;
    height: auto;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
