/* =========================================================================
 * UTM Link Builder — styles.
 * Professional, flat, deep teal (#2a9d8f) identity. Amber (#b45309)
 * only as a small accent — never as a gradient, never on large text.
 *
 * COLOURS ARE LITERAL VALUES, not var() references: the review browser
 * used by the site owner does not resolve CSS custom properties, so every
 * rule that paints a button, header, input, border or text uses a hex
 * value directly. The :root block below only documents the palette (and
 * keeps the --brand/--brand-2 declarations the cross-tool accent scan
 * looks for); no rule depends on it.
 *
 * Palette: bg #f6f7fb · surface #ffffff · surface-2 #eef1f8 ·
 * ink #141a2e · ink-soft #4b5573 · ink-faint #8a93ad ·
 * hairline #e2e7f2 · visible border #c9d2e0 · input border #b6bfce ·
 * brand #2a9d8f · brand hover #1f7a6d · brand-soft #e3f4f1 ·
 * amber #b45309 · ok #0f9d58 / #e5f6ec · warn #b45309 / #fef3e2 ·
 * err #dc2626 / #fdecec.
 * All motion disabled under prefers-reduced-motion.
 * ========================================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --ink: #141a2e;
  --ink-soft: #4b5573;
  --ink-faint: #8a93ad;
  --line: #e2e7f2;
  --brand: #2a9d8f;
  --brand-2: #b45309;
  --brand-soft: #e3f4f1;
  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
  --shadow-lg: 0 18px 50px rgba(42, 157, 143, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: #f6f7fb;
  color: #141a2e;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: #141a2e; color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid #dbe2ec;
  box-shadow: 0 1px 6px rgba(20, 26, 46, 0.06);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #141a2e; font-weight: 800; font-size: 1.05rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: #2a9d8f;
  box-shadow: 0 10px 30px rgba(20, 26, 46, 0.08);
}
.brand-mark svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2; }
.nav { display: flex; gap: 4px; }
.nav a {
  color: #4b5573; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 12px; border-radius: 10px; transition: background 0.18s, color 0.18s;
}
.nav a:hover, .nav a:focus-visible { background: #eef1f8; color: #141a2e; outline: none; }

/* ---------------- hero ---------------- */
.hero {
  padding: 26px 0 12px;
  background: radial-gradient(600px 280px at 15% 0%, rgba(42, 157, 143, 0.10), transparent 60%);
}
.hero h1 {
  font-size: clamp(1.65rem, 3.4vw, 2.25rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 6px; max-width: none;
}
.hero h1 .accent { color: #2a9d8f; }
.lede { font-size: 1rem; color: #4b5573; max-width: none; margin: 0 0 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.trust-row li {
  display: inline-flex; align-items: center; gap: 7px;
  background: #ffffff; border: 1px solid #c9d2e0; border-radius: 999px;
  padding: 5px 11px; font-size: 0.82rem; font-weight: 600; color: #3f4a63;
  box-shadow: 0 1px 3px rgba(20, 26, 46, 0.05);
}
.trust-row .dot { width: 7px; height: 7px; border-radius: 50%; background: #0f9d58; box-shadow: 0 0 0 3px #e5f6ec; }

/* ---------------- tool card ---------------- */
.tool-section { padding: 8px 0 32px; }
.tool-card {
  background: #ffffff; border: 1.5px solid #c9d2e0;
  border-radius: 18px; box-shadow: 0 18px 50px rgba(42, 157, 143, 0.16);
  padding: clamp(20px, 3vw, 30px);
}
.tool-title { font-size: 1.3rem; letter-spacing: -0.01em; margin: 0 0 4px; }

/* ---------------- mode tabs ---------------- */
.mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.mode-tab {
  border: 1.5px solid #c9d2e0; background: #ffffff; color: #4b5573;
  border-radius: 999px; padding: 8px 16px; font: inherit; font-weight: 700;
  font-size: 0.9rem; cursor: pointer;
}
.mode-tab[aria-selected="true"] { background: #2a9d8f; border-color: #2a9d8f; color: #ffffff; }
.mode-tab:focus-visible { outline: 3px solid rgba(42, 157, 143, 0.35); outline-offset: 2px; }

/* ---------------- presets ---------------- */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.preset-btn {
  border: 1.5px solid #c9d2e0; background: #ffffff; color: #141a2e;
  border-radius: 999px; padding: 7px 13px; font: inherit; font-weight: 600;
  font-size: 0.86rem; cursor: pointer;
}
.preset-btn:hover { background: #e3f4f1; border-color: #2a9d8f; }
.preset-btn[aria-pressed="true"] { background: #e3f4f1; border-color: #2a9d8f; color: #1f7a6d; }
.preset-btn:focus-visible { outline: 3px solid rgba(42, 157, 143, 0.35); outline-offset: 2px; }
.preset-note { font-size: 0.88rem; color: #4b5573; margin: 0 0 14px; min-height: 1.3em; }

/* ---------------- form ---------------- */
.form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.field { min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.field label .req { color: #dc2626; }
.field label .opt { color: #8a93ad; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid #b6bfce;
  border-radius: 10px; background-color: #ffffff; color: #141a2e; min-width: 0;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 3px solid rgba(42, 157, 143, 0.35); outline-offset: 2px; border-color: #2a9d8f;
}
.field .ctl-hint { display: block; margin-top: 4px; font-size: 0.85rem; color: #8a93ad; }
.field textarea { resize: vertical; min-height: 110px; font-size: 0.92rem; line-height: 1.5; }
.url-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; overflow-wrap: anywhere; }

.adv-toggle {
  background: none; border: none; padding: 0; margin: 14px 0 0;
  color: #2a9d8f; font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.adv-fields { margin-top: 14px; }

.options-row {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #e2e7f2; font-size: 0.92rem; color: #4b5573;
}
.options-row label { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; cursor: pointer; }
.options-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: #2a9d8f; }
.options-row select {
  font: inherit; padding: 6px 10px; border: 1.5px solid #b6bfce; border-radius: 8px;
  background: #ffffff; color: #141a2e;
}

/* ---------------- output ---------------- */
.output-block { margin-top: 20px; }
.output-label { display: block; font-weight: 700; margin-bottom: 8px; }
.output-box {
  background: #eef1f8; border: 1.5px solid #c9d2e0; border-radius: 12px;
  padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem; line-height: 1.6; overflow-wrap: anywhere; word-break: break-all;
  min-height: 58px; color: #141a2e;
}
.output-box.empty { color: #8a93ad; }
.channel-line { margin: 10px 0 0; font-size: 0.95rem; }
.channel-badge {
  display: inline-block; background: #e3f4f1; color: #1f7a6d; border: 1px solid #2a9d8f;
  border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 0.85rem;
}
.channel-badge.unassigned { background: #fef3e2; color: #b45309; border-color: #b45309; }
.channel-note { color: #4b5573; font-size: 0.88rem; }
.warn-list { margin: 10px 0 0; padding: 0; list-style: none; }
.warn-list li {
  background: #fef3e2; border: 1px solid #f3c1c1; border-left: 4px solid #b45309;
  border-radius: 8px; padding: 8px 12px; margin: 6px 0; font-size: 0.9rem; color: #4b5573;
}
.warn-list li.err { background: #fdecec; border-left-color: #dc2626; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  padding: 10px 18px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.btn-primary { background: #2a9d8f; color: #fff; box-shadow: 0 4px 14px rgba(42, 157, 143, 0.28); }
.btn-primary:hover:not(:disabled) { background: #1f7a6d; transform: translateY(-1px); }
.btn-primary:disabled { background: #9aa5b5; color: #fff; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: #ffffff; border: 1.5px solid #c9d2e0; color: #141a2e; }
.btn-ghost:hover:not(:disabled) { background: #eef1f8; border-color: #b6bfce; }
.btn-ghost:disabled { background: #eef1f8; color: #8a93ad; border-color: #c9d2e0; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid rgba(42, 157, 143, 0.4); outline-offset: 2px; }

/* batch bar */
.batch-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  border-top: 1px solid #e2e7f2; margin-top: 18px; padding-top: 16px;
}
.bb-text { font-weight: 700; }
.bb-text small { display: block; font-weight: 400; color: #8a93ad; font-size: 0.84rem; }
.bb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- results ---------------- */
.results { margin-top: 20px; display: grid; gap: 22px; min-width: 0; }
.res-sec h3 { margin: 0 0 6px; font-size: 1.1rem; }
.res-hint { color: #4b5573; font-size: 0.92rem; line-height: 1.6; margin: 4px 0 10px; overflow-wrap: anywhere; }

.bulk-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; }
.bulk-table th, .bulk-table td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid #e2e7f2;
  vertical-align: top; overflow-wrap: anywhere; word-break: break-all;
}
.bulk-table th { color: #4b5573; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.bulk-table th:nth-child(1) { width: 42%; }
.bulk-table th:nth-child(2) { width: 42%; }
.bulk-table th:nth-child(3) { width: 16%; }
.bulk-table td .copy-one {
  background: none; border: none; padding: 0; color: #2a9d8f; font: inherit;
  font-weight: 700; font-size: 0.85rem; cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.bulk-err { color: #dc2626; font-weight: 600; }

.saved-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.saved-row .ctl-hint { flex: 1 1 100%; }
.saved-chip {
  display: inline-flex; align-items: center; gap: 6px; background: #eef1f8;
  border: 1px solid #c9d2e0; border-radius: 999px; padding: 5px 6px 5px 12px;
  font-size: 0.86rem; font-weight: 600;
}
.saved-chip button {
  background: none; border: none; cursor: pointer; font: inherit; font-weight: 700;
  color: #2a9d8f; padding: 2px 8px; border-radius: 999px;
}
.saved-chip button:hover { background: #e3f4f1; }
.saved-chip .del { color: #dc2626; }

/* ---------------- how it works ---------------- */
.scoring { padding: 4px 0 40px; }
.settings {
  background: #eef1f8; border: 1px solid #dbe2ec; border-radius: 18px;
  padding: clamp(20px, 3vw, 28px);
}
.settings-title { font-weight: 800; font-size: 1.25rem; margin: 0 0 8px; }
.settings .ctl-hint { font-size: 0.92rem; color: #4b5573; margin: 0 0 4px; }
.scoring-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 32px; margin-top: 14px; }
.signal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.signal-list li { font-size: 0.9rem; line-height: 1.5; color: #4b5573; padding-left: 16px; position: relative; }
.signal-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 7px; height: 7px; border-radius: 50%; background: #b45309; }
.signal-list li strong { color: #141a2e; }
.png-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.png-facts li { font-size: 0.92rem; color: #4b5573; padding-left: 18px; position: relative; }
.png-facts li::before {
  content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px;
  border-radius: 50%; background: #2a9d8f;
}
.png-facts li strong { color: #141a2e; }
.png-alt { font-size: 0.92rem; color: #4b5573; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid #dbe2ec; }
.png-alt a { color: #2a9d8f; font-weight: 700; }
.png-alt a:hover { color: #b45309; }

/* ---------------- privacy ---------------- */
.privacy { padding: 8px 0 44px; }
.privacy-card {
  background: linear-gradient(135deg, #0f2e2a, #2a9d8f);
  color: #e7f0e8; border-radius: 22px; padding: clamp(22px, 3vw, 36px);
  box-shadow: 0 18px 50px rgba(42, 157, 143, 0.16);
}
.privacy-card h2 { color: #fff; margin: 0 0 10px; font-size: 1.4rem; }
.privacy-card p { margin: 0 0 16px; }
.net-meter {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px; padding: 9px 16px; font-weight: 700; color: #fff;
}
.net-meter b { font-size: 1.15rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #34d399; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}
.verify-steps { margin: 16px 0 0; padding-left: 20px; }
.verify-steps li { margin: 6px 0; }
kbd {
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 0.85em;
}
.tool-card kbd, .content kbd {
  background: #eef1f8; border-color: #e2e7f2; color: #141a2e;
}

/* ---------------- guide + FAQ ---------------- */
.content { padding: 20px 0 44px; }
.content .wrap { max-width: 68ch; }
.content h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 0 0 12px; }
.content h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.content p, .content li { color: #4b5573; }
.content ol, .content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.content code { background: #eef1f8; border: 1px solid #e2e7f2; border-radius: 6px; padding: 1px 6px; font-size: 0.88em; }
.prose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.prose-card { background: #ffffff; border: 1px solid #dbe2ec; border-radius: 16px; padding: 16px 18px; }
.prose-card h3 { margin: 0 0 6px; }
.prose-card p { margin: 0; font-size: 0.93rem; }

.faq details {
  background: #ffffff; border: 1px solid #dbe2ec; border-radius: 12px;
  padding: 12px 16px; margin: 8px 0;
}
.faq summary { font-weight: 700; cursor: pointer; }
.faq summary:focus-visible { outline: 3px solid rgba(42, 157, 143, 0.35); outline-offset: 2px; border-radius: 6px; }
.faq details p { margin: 10px 0 2px; }

/* ---------------- footer ---------------- */
.site-footer { background: #eef1f8; border-top: 1px solid #c9d2e0; padding: 22px 0 30px; color: #4b5573; font-size: 0.85rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: baseline; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer p:first-child { font-weight: 700; color: #141a2e; }
.site-footer .footer-note { color: #4b5573; }
.site-footer a { color: #2a9d8f; font-weight: 600; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------------- responsive ---------------- */
@media (max-width: 860px) {
  .scoring-grid { grid-template-columns: minmax(0, 1fr); }
  .settings { padding: 18px 20px; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .hero { padding: 20px 0 8px; }
  .batch-bar { flex-direction: column; align-items: stretch; }
  .bb-actions { display: grid; grid-template-columns: 1fr; }
  .bb-actions .btn { width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .bulk-table th:nth-child(3), .bulk-table td:nth-child(3) { display: none; }
  .bulk-table th:nth-child(1) { width: 48%; }
  .bulk-table th:nth-child(2) { width: 52%; }
  .site-footer .wrap { flex-direction: column; gap: 2px; }
}

/* reduced motion: kill every animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
