/* SyncRoof — mobile-first, no external dependencies */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1d232b;
  --ink-2: #4a5563;
  --line: #e3e0d9;
  --brand: #26323f;
  --accent: #d9822b;
  --accent-ink: #8a4a0c;
  --good: #2f7d4f;
  --warn: #b5541c;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 4px 16px rgba(20, 24, 30, .05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --anchor-h: 0px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.6 var(--font); color: var(--ink); background: var(--bg);
  padding-bottom: var(--anchor-h);
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; color: var(--brand); }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: .2em 0 .4em; }
h2 { font-size: clamp(1.3rem, 3vw, 1.6rem); margin: 1.6em 0 .5em; }
h3 { font-size: 1.1rem; margin: 1.3em 0 .4em; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 99; }

/* Header */
.site-header { background: var(--brand); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.logo:hover { color: #fff; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px 16px; flex-wrap: wrap; font-size: .95rem; }
.nav a { color: #e9edf2; text-decoration: none; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }

/* Ad slots — fixed reserved space so pasted ad code causes zero layout shift (CLS 0) */
.ad { position: relative; display: flex; align-items: center; justify-content: center; margin-inline: auto; overflow: hidden; contain: layout; }
.ad::before { content: "Advertisement"; position: absolute; top: 4px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #9aa3ad; }
.ad-leaderboard { width: 100%; max-width: 728px; height: 100px; margin-block: 16px; }
.ad-native { width: 100%; min-height: 280px; height: 280px; margin-block: 28px; background: #efede8; border-radius: var(--radius); }
.ad-sidebar { width: 300px; height: 600px; }
.ad-anchor { display: none; }
@media (min-width: 768px) { .ad-leaderboard { height: 90px; } }
@media (max-width: 1023px) {
  :root { --anchor-h: 60px; }
  .ad-anchor { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(60px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: #fff; border-top: 1px solid var(--line); z-index: 50; }
  .ad-anchor::before { top: 2px; }
}

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-block: 8px 48px; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.sidebar { display: none; }
@media (min-width: 1024px) { .sidebar { display: block; } .sidebar .sticky { position: sticky; top: 16px; } }
.sidebar .card { margin-bottom: 20px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.hero { padding-block: 12px 4px; }
.hero p.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 62ch; margin-top: 0; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }

/* Tool */
.tool h2 { margin-top: 0; }
.grid-form { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 600px) { .grid-form { grid-template-columns: 1fr 1fr; } }
label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--ink-2); font-size: .82rem; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #cfcac0; border-radius: 8px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 11px 18px; cursor: pointer; background: var(--accent); color: #1b1206; text-decoration: none; }
.btn:hover { filter: brightness(1.06); color: #1b1206; }
.btn.secondary { background: #e8e5de; color: var(--brand); }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.result { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 18px; min-height: 190px; }
.result .big { font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: #f3f1ec; border-radius: 8px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .8rem; color: var(--ink-2); }

.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
td.num { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.tag.low { background: #fde9dc; color: var(--warn); }
.tag.ok { background: #dff1e6; color: var(--good); }
.tag.high { background: #fde9dc; color: var(--warn); }
.tag.best { background: var(--brand); color: #fff; }
.empty { color: var(--ink-2); font-size: .92rem; }

/* Articles & content */
.prose { max-width: 72ch; }
.prose p, .prose li { color: #2b333d; }
.prose table { margin: 10px 0 18px; }
.meta { color: var(--ink-2); font-size: .88rem; }
.callout { background: #fff7ec; border-left: 4px solid var(--accent); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 18px 0; }
.guide-list { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0; list-style: none; }
@media (min-width: 700px) { .guide-list { grid-template-columns: 1fr 1fr; } }
.guide-list a { text-decoration: none; color: inherit; display: block; height: 100%; }
.guide-list a:hover h3 { color: var(--accent-ink); }
.guide-list h3 { margin-top: 0; }
.guide-list p { margin-bottom: 0; color: var(--ink-2); font-size: .94rem; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--brand); }
.crumbs { font-size: .85rem; color: var(--ink-2); padding-top: 8px; }
.crumbs a { color: var(--ink-2); }

/* Footer */
.site-footer { background: #1b232d; color: #c9d0d8; font-size: .9rem; padding-block: 28px; }
.site-footer a { color: #e9edf2; }
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.disclaimer { font-size: .8rem; color: #96a1ad; margin-top: 14px; max-width: 80ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
