/* trackinglinkgenerator.com: switchboard utility. Warm paper, ink, signal orange; Bricolage Grotesque + DM Mono. */
:root {
  --paper: #f6f3ec;
  --panel: #fffdf8;
  --ink: #1d1b16;
  --muted: #6b665b;
  --line: #e2dccd;
  --line-strong: #1d1b16;
  --signal: #ff5a1f;
  --signal-ink: #c2410c;
  --signal-tint: #fff1ea;
  /* role colours for the URL anatomy */
  --r-host: #1d1b16;
  --r-partner: #7c3aed;
  --r-campaign: #0369a1;
  --r-adset: #0e7490;
  --r-creative: #047857;
  --r-click: #ff5a1f;
  --r-sub: #b45309;
  --r-device: #be185d;
  --r-other: #6b665b;
  --ok: #047857;
  --warn: #b45309;
  --bad: #b91c1c;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--signal-ink); text-underline-offset: 3px; }
a:hover { color: var(--signal); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
code { overflow-wrap: anywhere; }
.sources a, .prose a, .facts li, .lint li, .fit { overflow-wrap: anywhere; }
.explain { table-layout: fixed; }
.explain td { overflow-wrap: anywhere; }
.explain th:first-child, .explain td:first-child { width: 34%; }

/* nav */
.nav { border-bottom: 2px solid var(--line-strong); background: var(--paper); }
.nav .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; font-size: 17px; white-space: nowrap; }
.brand .plug { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--ink); position: relative; flex: none; }
.brand .plug::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--signal); }
.nav-links { display: flex; gap: 18px; margin-left: auto; }
.nav-links a { color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--signal-ink); text-decoration: underline; }

/* hero */
.hero { padding: 44px 0 20px; }
h1 { font-size: clamp(32px, 4.6vw, 54px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 12px; font-weight: 800; }
h1 em { font-style: normal; color: var(--signal); }
.lede { font-size: 18px; color: var(--muted); max-width: 700px; margin: 0; }
.crumb { font: 13px var(--mono); color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--muted); }
.answer { margin: 22px 0 0; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--signal); padding: 14px 18px; max-width: 900px; }
.answer b.lbl { display: block; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--signal-ink); margin-bottom: 4px; }
.answer p { margin: 0; }

/* generator */
.gen { display: grid; grid-template-columns: 380px 1fr; gap: 0; border: 2px solid var(--line-strong); background: var(--panel); margin: 26px 0 8px; }
.gen-left { border-right: 2px solid var(--line-strong); padding: 18px; }
.gen-right { padding: 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step { font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.step:first-child { margin-top: 0; }
.step i { font-style: normal; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 10px; }
.mmp-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.mmp-pick button { display: flex; align-items: center; gap: 8px; padding: 7px 8px; background: var(--paper); border: 1px solid var(--line); font: 600 14px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.mmp-pick button img { width: 18px; height: 18px; border-radius: 3px; }
.mmp-pick button[aria-pressed="true"] { border-color: var(--ink); background: var(--signal-tint); box-shadow: inset 3px 0 0 var(--signal); }
.syntax { display: flex; flex-wrap: wrap; gap: 6px; }
.syntax button { font: 500 13px var(--mono); padding: 5px 9px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; color: var(--ink); }
.syntax button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.field { margin-bottom: 9px; }
.field label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.field label code { font-weight: 500; color: var(--muted); font-size: 12px; }
.field input { width: 100%; font: 14px var(--mono); padding: 7px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.field input:focus { outline: 2px solid var(--signal); outline-offset: -1px; border-color: var(--signal); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.field.role-click label::before { content: ""; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.out-label { display: flex; justify-content: space-between; align-items: center; font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.copy { font: 600 13px var(--sans); background: var(--signal); color: #fff; border: 0; padding: 8px 14px; cursor: pointer; }
.copy:hover { background: var(--signal-ink); }
.anatomy { font: 15px/1.9 var(--mono); word-break: break-all; background: #fff; border: 1px dashed var(--line); padding: 14px; min-height: 90px; }
.anatomy span { border-bottom: 3px solid currentColor; padding-bottom: 1px; cursor: help; }
.anatomy .sep { border: 0; color: var(--muted); }
.anatomy .k { opacity: 0.75; border: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.lint { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lint li { padding: 8px 0 8px 26px; border-bottom: 1px solid var(--line); position: relative; font-size: 14.5px; }
.lint li::before { position: absolute; left: 0; top: 7px; font: 700 13px var(--mono); }
.lint li.ok::before { content: "OK"; color: var(--ok); font-size: 10px; top: 10px; }
.lint li.warn::before { content: "!"; color: var(--warn); left: 6px; }
.lint li.bad::before { content: "x"; color: var(--bad); left: 6px; }
.lint li.info::before { content: "i"; color: var(--r-campaign); left: 6px; }
.explain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.explain th, .explain td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.explain th { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.explain td:first-child { font-family: var(--mono); }
.note { font-size: 13px; color: var(--muted); margin: 0; }

/* sections */
section.block { padding: 44px 0; border-top: 2px solid var(--line-strong); }
h2 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 8px; font-weight: 800; }
h3 { font-size: 18px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 20px; max-width: 720px; }
.scroller { overflow-x: auto; border: 2px solid var(--line-strong); background: var(--panel); }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; }
table.grid th, table.grid td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid thead th { background: var(--ink); color: var(--paper); font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
table.grid td:first-child, table.grid th:first-child { position: sticky; left: 0; background: var(--panel); box-shadow: 6px 0 8px -6px rgba(0,0,0,0.18); font-weight: 700; min-width: 140px; }
table.grid thead th:first-child { background: var(--ink); }
table.grid td code { white-space: nowrap; }
.vh { display: flex; align-items: center; gap: 8px; }
.vh img { width: 20px; height: 20px; border-radius: 4px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 2px solid var(--line-strong); }
.cards a { display: block; padding: 16px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.cards a:hover { background: var(--signal-tint); }
.cards a b { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.cards a b img { width: 20px; height: 20px; border-radius: 4px; }
.cards a span { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.prose { max-width: 760px; }
.prose p, .prose li { font-size: 16.5px; }
.prose h2 { font-size: 26px; margin-top: 34px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.prose pre { background: var(--ink); color: #f6f3ec; padding: 14px; overflow-x: auto; font: 13.5px/1.6 var(--mono); }
.facts { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--line-strong); }
.facts li { padding: 12px 0 12px 22px; border-bottom: 1px solid var(--line); position: relative; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 21px; width: 8px; height: 8px; background: var(--signal); }
.sources { font-size: 13.5px; color: var(--muted); }
.sources a { color: var(--muted); }
.faq { max-width: 820px; border-top: 2px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--signal); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.fit { background: var(--signal-tint); border: 1px solid #ffd2bf; padding: 14px 16px; max-width: 820px; }

footer.site { border-top: 2px solid var(--line-strong); padding: 36px 0 50px; font-size: 14px; color: var(--muted); margin-top: 40px; }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; }
footer.site h4 { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); margin: 0 0 8px; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site li { margin: 5px 0; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--signal-ink); text-decoration: underline; }

@media (max-width: 900px) {
  .gen { grid-template-columns: 1fr; }
  .gen-left { border-right: 0; border-bottom: 2px solid var(--line-strong); }
  .cards { grid-template-columns: 1fr 1fr; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .nav-links { gap: 12px; }
  .nav-links a.hide-sm { display: none; }
  .brand .txt { font-size: 15px; }
  .mmp-pick { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: 1fr; }
  .explain td:first-child { white-space: normal; word-break: break-all; }
  footer.site .cols { grid-template-columns: 1fr; }
}
