:root {
  --bg: #eef3f1;
  --paper: #ffffff;
  --ink: #142421;
  --muted: #4c6560;
  --line: #d3e2dd;
  --accent: #0f766e;
  --accent-ink: #083f3b;
  --good: #0f7a45;
  --bad: #a32626;
  --shadow: 0 12px 32px rgba(20, 36, 33, 0.06);
  --sans: "Segoe UI", "Avenir Next", sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.55 var(--sans);
}
body.has-anchor { padding-bottom: 116px; }
a { color: var(--accent-ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px; z-index: 9; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center;
  padding: 14px 28px; background: #10211e; color: #e7f4f1;
}
.topbar a { color: #e7f4f1; text-decoration: none; }
.brand { display: flex; gap: 10px; align-items: center; margin-right: auto; }
.mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: #1ee0b0; color: #06221c; font: 700 14px var(--mono);
}
.brand small { display: block; color: #9ec9c1; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 16px; flex-wrap: wrap; }
.topbar nav a { font-size: 15px; border-bottom: 2px solid transparent; }
.topbar nav a[aria-current="page"] { border-color: #1ee0b0; }
.langs { display: flex; gap: 8px; font: 12px var(--mono); }
.langs a { padding: 4px 6px; border: 1px solid #2d4a45; }
.langs a[aria-current="true"] { background: #1ee0b0; color: #06221c; }
.search-mini input { background: #0c1a18; color: #fff; border: 1px solid #2d4a45; padding: 8px 10px; width: 140px; }

.shell { display: grid; grid-template-columns: 232px 1fr; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }
.steps { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; }
.steps a { display: block; text-decoration: none; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); }
.steps a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.eyebrow { font: 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 12px; }
h2 { font-size: 26px; letter-spacing: -0.02em; margin: 1.4em 0 .4em; }
.lede { font-size: 19px; color: var(--muted); }
.page-intro { margin-bottom: 8px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tool-section { margin: 28px 0 10px; }
.tool-section h2 { font-size: 18px; margin: 0; letter-spacing: 0; color: var(--accent-ink); }
.tool-section p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.card, .feed-item { background: var(--paper); border: 1px solid var(--line); padding: 16px 16px 18px; box-shadow: var(--shadow); content-visibility: auto; contain-intrinsic-size: auto 180px; }
.card h2, .feed-item h2 { font-size: 20px; margin: 0 0 8px; }
.card p, .feed-item p { margin: 0 0 12px; color: var(--muted); }
.card a.button, .tool-actions button, .contact-form button {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  border: 0; padding: 12px 16px; min-height: 44px; font: 600 15px var(--sans); cursor: pointer;
}
.tool-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.tool-nav { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 18px; }
.tool-nav a { color: var(--ink); text-decoration: none; }
.tool-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.checker { background: var(--paper); border: 1px solid var(--line); padding: 18px; box-shadow: var(--shadow); }
.checker.drop-hot { outline: 2px dashed var(--accent); outline-offset: -8px; }
.drop-hint { margin: 0 0 10px; }
.grid-fields, .previews { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input, select, textarea { font: 16px var(--sans); padding: 8px; border: 1px solid #b7ccc6; background: #fff; color: var(--ink); width: 100%; }
.rules, .issue-list { list-style: none; padding: 0; margin: 16px 0 0; }
.rules li, .issue-list li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.badge { font: 700 12px var(--mono); letter-spacing: .04em; padding: 2px 6px; }
.pass .badge { background: #e5f6ec; color: var(--good); }
.fail .badge { background: #fde8e8; color: var(--bad); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 15px; }
th, td { border-bottom: 1px solid var(--line); text-align: left; padding: 8px; vertical-align: top; }
tr.fail td:nth-child(4) { color: var(--bad); font-weight: 700; }
tr.pass td:nth-child(4) { color: var(--good); font-weight: 700; }
canvas { max-width: 100%; height: auto; background: #f6faf9; border: 1px solid var(--line); }
.note { color: var(--muted); }
.explain { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin-top: 28px; }
.geo-example { background: #f4fbf8; border-left: 4px solid var(--accent); padding: 12px 16px; }
.geo-example dt { font-weight: 700; margin-top: 8px; }
footer { padding: 28px; background: #10211e; color: #d5ebe6; display: flex; flex-wrap: wrap; gap: 12px 20px; }
footer a { color: #fff; }
.contact-form { display: grid; gap: 12px; max-width: 560px; }

.ad-slot { margin: 28px 0; clear: both; }
.ad-label { margin: 0 0 6px; font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ad-pending .ad-reserved { min-height: 90px; border: 1px dashed #9db5af; display: grid; place-items: center; background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(15,118,110,.04) 8px, rgba(15,118,110,.04) 16px); }
.ad-pending .ad-rectangle .ad-reserved, .ad-pending .ad-sidebar .ad-reserved { min-height: 250px; }
.ad-pending .ad-inArticle .ad-reserved, .ad-pending .ad-multiplex .ad-reserved { min-height: 220px; }
.ad-pending .ad-inFeed .ad-reserved { min-height: 120px; }
.ads-live .ad-pending-note { display: none; }
.ad-anchor {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line); padding: 8px 48px 10px 16px;
  box-shadow: 0 -6px 20px rgba(0,0,0,.06);
}
.ad-dismiss { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.cookie-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 20px; background: #fff7e8; border-bottom: 1px solid #ead7b0; }
.cookie-bar[hidden], .ad-anchor[hidden] { display: none; }
.cookie-bar button { min-height: 40px; padding: 8px 12px; background: var(--ink); color: #fff; border: 0; cursor: pointer; }
.related { list-style: none; padding: 0; }
.related li { margin: 8px 0; }
@media (max-width: 860px) {
  .shell, .explain { grid-template-columns: 1fr; }
  .steps { position: static; }
}
@media print {
  .ad-slot, .ad-anchor, .cookie-bar, .topbar, footer, .steps { display: none !important; }
}

.convert-preview { white-space: pre-wrap; max-height: 18rem; overflow: auto; margin: 12px 0 0; }
.word-next { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
#page-order { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#page-order button { min-width: 2.4rem; cursor: grab; }
#page-order button.dragging { opacity: 0.45; }
.compare-wrap { margin: 12px 0; }
.compare-wrap canvas { width: min(100%, 720px); height: auto; background: #f6f3ec; border: 1px solid var(--line); }
/* ad-paused: units stay in HTML comments until a real publisher ID is set. */
.rail:not(:has(.ad-slot)) { display: none; }
.explain:not(:has(.ad-slot)) { grid-template-columns: 1fr; }
