:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eff6ff;
  --accent: #0f766e;
  --accent-soft: #f0fdfa;
  --danger: #b91c1c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { max-width: 100%; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }
:focus-visible { outline: 3px solid rgba(29, 78, 216, 0.14); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 820px; }
.muted { color: var(--text-2); }
.tiny { font-size: 13px; color: var(--muted); }
.h3 { font-size: 18px; line-height: 1.3; margin: 0 0 10px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--surface); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 10px; top: 10px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand b { color: var(--primary); font-weight: 800; }
.brand__mark { display: inline-flex; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 8px; transition: background .15s, color .15s; }
.site-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.site-nav__cta { background: var(--primary); color: var(--surface) !important; }
.site-nav__cta:hover { background: var(--primary-dark) !important; color: var(--surface) !important; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-burger { display: none; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.nav-burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; }

/* Hero */
.hero { padding: 40px 0 18px; text-align: center; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; font-size: 14px; }
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.hero__title { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.15; letter-spacing: -.02em; margin: 0 auto 12px; max-width: 860px; }
.hero__lead { font-size: 18px; color: var(--text-2); margin: 0 auto; max-width: 720px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.tool-wrap { padding-top: 16px; padding-bottom: 32px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-sm); font: 600 15px/1.2 var(--font); border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: var(--surface); box-shadow: 0 4px 14px rgba(29, 78, 216, 0.14); }
.btn--primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn--accent { background: var(--accent); color: var(--surface); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08); }
.btn--accent:hover:not(:disabled) { background: var(--accent-dark); }
.btn--outline { background: var(--surface); color: var(--primary); border-color: var(--border); }
.btn--outline:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary); }
.btn--light { background: var(--bg); color: var(--text); border-color: var(--line); min-height: 38px; padding: 8px 14px; font-size: 14px; }
.btn--light:hover:not(:disabled) { background: var(--border); }
.btn--ghost { background: var(--surface); color: var(--primary); border-color: var(--border); }
.btn--ghost:hover { background: var(--primary-soft); }
.btn--block { width: 100%; margin-top: 10px; }

/* Form controls */
.field { display: flex; flex-direction: column; gap: 6px; }
.field--grow { flex: 1; }
.field__label { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.select { width: 100%; min-height: 46px; padding: 10px 40px 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23475569' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; font: 600 15px var(--font); color: var(--text); appearance: none; cursor: pointer; }
.select:hover { border-color: var(--primary); }
.select--sm { width: auto; min-height: 44px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.hint { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.55; }

/* Tool */
.ppc { padding: 22px; }
.ppc__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; }
.ppc__toolbar { display: flex; gap: 12px; margin-bottom: 14px; }
.ppc__stage { position: relative; background: repeating-conic-gradient(var(--border) 0% 25%, var(--bg) 0% 50%) 50% / 20px 20px; border-radius: 14px; border: 1px solid var(--line); padding: 16px; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.ppc__canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 560px; border-radius: 4px; box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08); background: var(--surface); cursor: grab; touch-action: none; }
.ppc__canvas.is-dragging { cursor: grabbing; }
.ppc__drop { position: absolute; inset: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 20px; border: 2px dashed var(--border); border-radius: 12px; background: var(--surface); color: var(--primary); cursor: pointer; transition: background .15s, border-color .15s; }
.ppc__drop:hover, .ppc__drop.is-over { background: rgba(15, 23, 42, 0.08); border-color: var(--primary); }
.ppc__drop-title { margin: 6px 0 0; font-weight: 700; color: var(--text); font-size: 17px; }
.ppc__drop-sub { margin: 0 0 10px; color: var(--text-2); font-size: 14px; }
.has-photo .ppc__drop { display: none; }
.ppc__actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ppc__status { margin: 10px 0 0; font-size: 14px; color: var(--accent-dark); font-weight: 600; min-height: 1.5em; }
.ppc__status.is-error { color: var(--danger); }
.ppc__legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.ppc__legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.sw--blue { background: var(--primary); }
.sw--green { background: var(--accent); }
.sw--amber { background: var(--amber); }

.ppc__panel { display: flex; flex-direction: column; gap: 18px; }
.ppc__specs { background: var(--primary-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.ppc-specs__list { margin: 0; display: grid; gap: 6px; }
.ppc-specs__list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-bottom: 1px dashed var(--border); padding-bottom: 6px; }
.ppc-specs__list div:last-child { border-bottom: 0; padding-bottom: 0; }
.ppc-specs__list dt { color: var(--text-2); font-weight: 600; }
.ppc-specs__list dd { margin: 0; color: var(--text); font-weight: 700; text-align: right; }
.ppc-specs__note { margin: 10px 0 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }

.ppc__controls { display: grid; gap: 14px; }
.range { display: grid; gap: 6px; }
.range__head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text); }
.range__head output { color: var(--primary); font-variant-numeric: tabular-nums; }
.range input[type=range] { width: 100%; height: 28px; accent-color: var(--primary); cursor: pointer; }

.ppc__download { border-top: 1px solid var(--line); padding-top: 16px; }
.ppc__dl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ppc__dl-row .btn--primary { flex: 1; }

.ppc__sheet { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.ppc__sheet-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.ppc__sheet-head p { margin: 0; font-size: 14px; }
.ppc__sheet-preview { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; justify-content: center; margin-bottom: 14px; }
.ppc__sheet-preview canvas { display: block; max-height: 460px; width: auto; height: auto; background: var(--surface); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08); }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg__btn { min-height: 38px; padding: 6px 16px; border: 0; border-radius: 8px; background: transparent; font: 600 14px var(--font); color: var(--text-2); cursor: pointer; }
.seg__btn:hover { color: var(--primary); }
.seg__btn[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08); }

.pro { margin-top: 26px; display: flex; gap: 20px; justify-content: space-between; align-items: center; padding: 20px 22px; border-radius: 14px; background: linear-gradient(135deg, var(--accent-soft) 0%, var(--primary-soft) 100%); border: 1px solid var(--border); }
.pro p { margin: 0; color: var(--text-2); font-size: 15px; }
.pro__cta { flex-shrink: 0; max-width: 260px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--accent-dark); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }

/* Content */
.prose { padding-top: 24px; padding-bottom: 56px; max-width: 880px; }
.prose--page { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px 36px; margin-bottom: 56px; }
.prose h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.01em; margin: 40px 0 14px; }
.prose h3 { font-size: 19px; margin: 26px 0 10px; }
.prose p, .prose li { color: var(--text); font-size: 16.5px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { color: var(--text); }
.prose .answer { font-size: 18px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); color: var(--text); }
.prose .note { background: var(--primary-soft); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 15px; color: var(--text); }
.prose ol.steps { counter-reset: s; list-style: none; padding: 0; }
.prose ol.steps > li { counter-increment: s; position: relative; padding: 14px 16px 14px 60px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
.prose ol.steps > li::before { content: counter(s); position: absolute; left: 16px; top: 13px; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: var(--surface); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); margin: 16px 0; }
table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg); color: var(--text); font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg); }
td a { font-weight: 600; }

.faq { margin-top: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 700; font-size: 16.5px; position: relative; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--primary); font-weight: 600; }
.faq details[open] summary::after { content: "–"; }
.faq summary:hover { color: var(--primary); }
.faq details > div { padding: 0 18px 16px; }
.faq details > div p { margin: 0 0 8px; }

.page-head { padding: 44px 0 20px; }
.page-head__title { font-size: clamp(28px, 4vw, 38px); margin: 0 0 8px; letter-spacing: -.02em; }

/* Footer */
.site-footer { background: var(--surface); color: var(--text); padding: 44px 0 20px; margin-top: 20px; }
.site-footer .brand__name { color: var(--surface); }
.site-footer .brand b { color: var(--border); }
.site-footer .muted { color: var(--border); font-size: 15px; }
.site-footer .tiny { color: var(--muted); }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 32px; }
.footer-h { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--surface); margin: 4px 0 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 8px 0; }
.footer-links a { color: var(--border); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--surface); text-decoration: underline; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--text); margin-top: 28px; padding-top: 16px; font-size: 13.5px; color: var(--muted); }

/* Responsive */
@media (max-width: 960px) {
  .ppc__grid { grid-template-columns: 1fr; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .site-footer__grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .nav-burger { display: inline-flex; }
  .site-nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px 16px; box-shadow: var(--shadow); display: none; }
  .site-nav a { padding: 12px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .hero { padding: 26px 0 10px; }
  .hero__lead { font-size: 16px; }
  .ppc { padding: 14px; border-radius: 14px; }
  .ppc__stage { padding: 10px; min-height: 280px; }
  .ppc__drop { inset: 10px; }
  .ppc__canvas { max-height: 440px; }
  .ppc__dl-row .btn { flex: 1 1 100%; }
  .ppc__dl-row .select--sm { flex: 1 1 100%; width: 100%; }
  .pro { flex-direction: column; align-items: stretch; }
  .pro__cta { max-width: none; }
  .pro__cta .btn { width: 100%; }
  .prose h2 { font-size: 22px; }
  .prose--page { padding: 22px 18px; }
  .prose ol.steps > li { padding-left: 54px; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .ppc-specs__list div { flex-direction: column; gap: 2px; }
  .ppc-specs__list dd { text-align: left; }
}

/* Printing a sheet: only the generated sheet is printed, at exact size */
#ppc-print { display: none; }
@media print {
  html.ppc-printing body > *:not(#ppc-print) { display: none !important; }
  html.ppc-printing #ppc-print { display: block !important; }
  html.ppc-printing #ppc-print img { display: block; max-width: none; }
  html.ppc-printing body { background: var(--surface); margin: 0; }
  html:not(.ppc-printing) .site-header, html:not(.ppc-printing) .site-footer, html:not(.ppc-printing) .ppc { display: none; }
}

/* Explicit high-contrast overrides */
.prose .note { background: var(--primary-soft); color: var(--text); border-left: 4px solid var(--primary); }
.site-footer { background: var(--surface); color: var(--text); border-top: 1px solid var(--border); }
.site-footer a { color: var(--primary); }
.site-footer .muted, .site-footer .tiny { color: var(--muted); }
