/* ============================================================
   OGBE — Maximalist Poster Brand
   Inspired by maxim.html — bold, opinionated, branded
   ============================================================ */

:root[data-theme="light"] {
  --bg: #fffbf0;
  --bg-2: #f5efe0;
  --surface: #fffbf0;
  --surface-2: #f5efe0;
  --surface-hover: #ece4d2;
  --ink: #14110f;
  --text: #14110f;
  --text-soft: #2f2a25;
  --ink-soft: #5b554d;
  --muted: #7a7268;
  --border: #14110f;
  --border-strong: #14110f;
  --line-soft: rgba(20, 17, 15, 0.12);
  --primary: #5b00ff;
  --primary-hover: #4500cc;
  --primary-soft: rgba(91, 0, 255, 0.1);
  --hot: #ff3d00;
  --hot-soft: rgba(255, 61, 0, 0.1);
  --acid: #c7ff3a;
  --accent: #00d4ff;
  --accent-soft: rgba(0, 212, 255, 0.12);
  --pink: #ff3ea5;
  --moss: #5a6e3d;
  --success: #5a6e3d;
  --danger: #d12c00;
  --danger-soft: rgba(209, 44, 0, 0.1);
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hard-lg: 6px 6px 0 var(--ink);
  --shadow-hot: 6px 6px 0 var(--hot);
  --shadow-violet: 6px 6px 0 var(--primary);
  --grad: linear-gradient(95deg, var(--hot), var(--pink), var(--primary));
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
}

:root[data-theme="dark"] {
  --bg: #1a1612;
  --bg-2: #2a231e;
  --surface: #221c17;
  --surface-2: #2a231e;
  --surface-hover: #332b24;
  --ink: #fff8e8;
  --text: #fff8e8;
  --text-soft: #e8e0d0;
  --ink-soft: #b5a89a;
  --muted: #8a8278;
  --border: #fff8e8;
  --border-strong: #fff8e8;
  --line-soft: rgba(255, 248, 232, 0.18);
  --primary: #b89dff;
  --primary-hover: #cdb9ff;
  --primary-soft: rgba(184, 157, 255, 0.22);
  --hot: #ff5c1f;
  --hot-soft: rgba(255, 92, 31, 0.22);
  --acid: #d4ff52;
  --accent: #4ddffd;
  --accent-soft: rgba(77, 223, 253, 0.22);
  --pink: #ff5cb8;
  --moss: #a3c060;
  --success: #a3c060;
  --danger: #ff5a3c;
  --danger-soft: rgba(255, 90, 60, 0.22);
  --shadow-hard: 4px 4px 0 var(--ink);
  --shadow-hard-lg: 6px 6px 0 var(--ink);
  --shadow-hot: 6px 6px 0 var(--hot);
  --shadow-violet: 6px 6px 0 var(--primary);
  --grad: linear-gradient(95deg, var(--hot), var(--pink), var(--primary));
  --input-bg: #0d0a08;
  --input-bg-focus: #14110f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Paper grain overlay (subtle) */
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="240" height="240"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="240" height="240" filter="url(%23n)" opacity="0.4"/></svg>');
  opacity: 0.25;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] body::before {
  mix-blend-mode: overlay;
  opacity: 0.08;
}

/* Sign in link in topbar */
.topbar nav a.nav-signin {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
  padding: 8px 10px;
  border: 2px dashed var(--ink-soft);
  display: inline-flex; align-items: center; gap: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.topbar nav a.nav-signin:hover {
  color: var(--ink); border-color: var(--ink);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 4px solid var(--ink);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 22px; font-weight: 900; letter-spacing: -0.8px;
  color: var(--ink); text-decoration: none;
  text-transform: uppercase;
}
.brand-logo {
  width: 30px; height: 30px;
  flex-shrink: 0;
  transform: rotate(-8deg);
  display: inline-block;
  overflow: visible;
}
.brand-logo .bl-bg { fill: var(--primary); }
.brand-logo .bl-bars rect { fill: var(--acid); }
.brand span {
  color: var(--ink);
  background: none !important;
  -webkit-text-fill-color: var(--ink) !important;
}

.topbar nav { display: flex; align-items: center; gap: 10px; }

/* Mobile nav backdrop (created by JS, only visible when menu open) */
.nav-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,17,15,0.5);
  z-index: 40; /* below topbar (z:50) so topbar children (panel) stay clickable */
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s;
}
.nav-backdrop.open { opacity: 1; visibility: visible; }

/* Hamburger button (hidden on desktop) */
.nav-toggle {
  display: none;
  background: var(--bg); border: 3px solid var(--ink);
  width: 44px; height: 40px;
  cursor: pointer;
  padding: 0;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  transition: box-shadow 0.12s, transform 0.12s;
}
.nav-toggle span {
  display: block; width: 22px; height: 3px;
  background: var(--ink);
  transition: transform 0.18s, opacity 0.12s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}
.nav-toggle:hover { box-shadow: 3px 3px 0 var(--ink); }
.topbar > a.mobile-cta { display: none !important; }
.topbar nav a {
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--ink); text-decoration: none;
  padding: 8px 12px;
  transition: color 0.15s;
}
.topbar nav a:hover { color: var(--hot); }
.topbar nav a.active {
  background: var(--ink); color: var(--bg);
}
.topbar nav a.btn-primary.nav-cta,
.topbar > a.btn-primary.nav-cta {
  background: var(--acid);
  color: #14110f;
  border: 3px solid var(--ink);
  padding: 10px 22px; font-size: 13px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.2px;
  box-shadow: 4px 4px 0 var(--ink);
  border-radius: 0;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform 0.1s, box-shadow 0.1s;
}
.topbar nav a.btn-primary.nav-cta:hover,
.topbar > a.btn-primary.nav-cta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--acid); color: #14110f;
}

.lang-btn, .theme-btn {
  background: var(--bg);
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 7px 12px;
  font-size: 12px; font-weight: 900;
  letter-spacing: 1.2px; text-transform: uppercase;
  cursor: pointer; font-family: inherit;
  border-radius: 0;
  transition: background 0.15s;
}
.theme-btn {
  width: 38px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
}
.lang-btn:hover, .theme-btn:hover { background: var(--ink); color: var(--bg); }
.theme-btn .icon-sun, .theme-btn .icon-moon { display: none; }
:root[data-theme="light"] .theme-btn .icon-moon { display: block; }
:root[data-theme="dark"] .theme-btn .icon-sun { display: block; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 800;
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 14px 26px;
  border: 3px solid var(--ink);
  border-radius: 0;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink); color: var(--bg);
  box-shadow: 4px 4px 0 var(--primary);
}
.btn-primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--primary);
  background: var(--ink); color: var(--bg);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--primary);
}
.btn-primary.big {
  padding: 18px 32px; font-size: 14px;
  box-shadow: 6px 6px 0 var(--primary);
}
.btn-primary.big:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0 var(--primary);
}
.btn-secondary {
  background: var(--bg); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.btn-secondary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--acid);
}
.btn-ghost {
  background: transparent; color: var(--ink);
  box-shadow: none;
  border: 3px solid var(--ink);
}
.btn-ghost:hover {
  background: var(--ink); color: var(--bg);
}
.btn-ghost.big { padding: 18px 32px; font-size: 14px; }
.btn-ghost.btn-sm, .btn-sm {
  padding: 8px 14px; font-size: 11.5px;
}

/* ============================================================
   CONTAINER + PAGE
   ============================================================ */
.container {
  max-width: 1280px; margin: 0 auto; padding: 32px 28px;
}

.hero {
  max-width: 1100px; margin: 0 auto;
  padding: 60px 28px 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(48px, 8vw, 100px);
  font-weight: 900; letter-spacing: -3px; line-height: 0.95;
  margin-bottom: 20px;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .lead {
  font-size: 19px; color: var(--ink-soft);
  max-width: 620px; margin: 0 auto 36px;
  line-height: 1.5; font-weight: 500;
}

/* Generic .grad helper */
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   FORMS
   ============================================================ */
.shorten-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  text-align: left;
}
.form-block {
  background: var(--bg);
  border: 3px solid var(--ink);
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: 5px 5px 0 var(--ink);
}
.form-block-url { box-shadow: 5px 5px 0 var(--acid); }
.form-block-personalize { box-shadow: 5px 5px 0 var(--primary); }
.form-block:last-of-type { margin-bottom: 0; }
.form-block .field:last-child { margin-bottom: 0; }
.form-block .submit-block { width: 100%; margin-top: 8px; padding: 18px; font-size: 14px; letter-spacing: 1.5px; }

.field { display: block; margin-bottom: 20px; }
.field span {
  display: block;
  font-size: 11px; font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.field em {
  font-style: normal; color: var(--ink-soft);
  text-transform: uppercase; font-weight: 700;
  font-size: 10px; letter-spacing: 1px;
  margin-left: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--input-bg, #ffffff);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-left-width: 8px;
  border-left-color: var(--ink-soft);
  border-radius: 0;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit; font-weight: 600;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder, .field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.55;
  font-weight: 500;
}
/* Empty fields = strong orange tab on the left to signal "fill me" */
.field input:placeholder-shown, .field textarea:placeholder-shown {
  border-left-color: var(--hot);
}
.field input:focus, .field textarea:focus, .field select:focus {
  box-shadow: 5px 5px 0 var(--primary);
  border-left-color: var(--primary);
  background: var(--input-bg-focus, #ffffff);
}
/* Numbered label badges — make "1.", "2."… visually prominent */
.field > span {
  display: flex; align-items: center; gap: 8px;
}
.row { display: flex; gap: 16px; }
.flex-1 { flex: 1; min-width: 0; }

.shorten-card .btn-primary {
  width: 100%;
  padding: 18px; margin-top: 8px;
  font-size: 14px; letter-spacing: 1.5px;
}

.field-help {
  display: block;
  font-size: 12px; color: var(--ink-soft);
  line-height: 1.5;
  margin-top: 8px; font-weight: 500;
}
.field-help code {
  background: var(--bg-2);
  border: 2px solid var(--ink);
  padding: 1px 6px;
  font-family: "SF Mono", monospace;
  font-size: 11px;
  color: var(--ink);
}
.field-help strong { color: var(--ink); font-weight: 800; }

/* UTM groups */
.utm-group {
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 22px 22px 6px;
  margin-bottom: 20px;
  background: var(--bg);
}
.utm-group-required {
  background: var(--bg);
  box-shadow: 4px 4px 0 var(--hot);
}
.utm-group-optional {
  background: var(--bg-2);
  border-style: dashed;
}
.utm-group-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.utm-group-label {
  font-size: 12px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.5px;
  background: var(--ink); color: var(--bg);
  padding: 4px 10px;
}
.utm-group-required .utm-group-label { background: var(--hot); color: var(--bg); }
.utm-group-optional .utm-group-label { background: var(--ink-soft); color: var(--bg); }
.utm-group-hint {
  font-size: 12px; color: var(--ink-soft); font-weight: 600;
}

.utm-field {
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 16px;
  margin-bottom: 14px !important;
}
.utm-field.required { border-color: var(--ink); }

.req-badge, .opt-badge, .auto-badge {
  display: inline-block;
  font-size: 10px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.2px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  margin-left: 8px; font-style: normal;
  vertical-align: middle;
}
em.req-badge, .req-badge { background: var(--hot); color: #ffffff !important; }
:root[data-theme="dark"] em.req-badge, :root[data-theme="dark"] .req-badge { color: #14110f !important; }
.opt-badge { background: var(--bg-2); color: var(--ink); }
.auto-badge { background: var(--acid); color: #14110f; border-color: #14110f; }

/* Chip suggestions */
.chip-suggestions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.chip-suggestions:empty { margin-top: 0; }
.suggestion-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg);
  border: 2px solid var(--ink);
  color: var(--ink);
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.suggestion-chip:hover { background: var(--ink); color: var(--bg); }
.suggestion-chip.active { background: var(--acid); color: #14110f; border-color: #14110f; }
.suggestion-chip .chip-dot {
  width: 5px; height: 5px; background: var(--hot);
  display: inline-block;
}
.suggestion-chip .chip-remove {
  background: none; border: none; color: inherit;
  cursor: pointer; padding: 0; margin-left: 2px;
  font-size: 13px; line-height: 1;
}
.suggestion-chip .chip-remove:hover { color: var(--danger); }

/* Live preview */
.live-preview {
  background: var(--acid);
  border: 3px solid #14110f;
  padding: 16px 18px;
  margin-bottom: 18px;
  color: #14110f;
}
.live-preview-header {
  font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 12px;
  color: #14110f;
}
.live-preview-row {
  display: grid; grid-template-columns: 80px 1fr; gap: 12px;
  margin-bottom: 8px; font-size: 12px;
}
.live-preview-row:last-child { margin-bottom: 0; }
.lp-label {
  font-weight: 900; text-transform: uppercase;
  font-size: 10px; letter-spacing: 1px;
  color: #14110f; padding-top: 4px;
}
.live-preview code {
  background: #fffbf0; color: #14110f;
  border: 2px solid #14110f;
  padding: 6px 10px;
  font-family: "SF Mono", monospace;
  font-size: 12px; font-weight: 600;
  word-break: break-all;
}

/* UTM note + intro */
.form-intro, .utm-note {
  background: var(--bg-2);
  border: 3px solid var(--ink);
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 13px; font-weight: 500;
  line-height: 1.5;
}
.utm-note { margin: 18px 0 20px; font-size: 12px; }
.form-intro code, .utm-note code {
  background: var(--bg);
  border: 2px solid var(--ink);
  padding: 1px 6px;
  font-family: "SF Mono", monospace;
  font-size: 11px;
}

/* Variants */
.variants-section { margin-bottom: 20px; }
.variant-add-btn {
  width: 100%;
  background: transparent;
  border: 3px dashed var(--ink);
  color: var(--ink);
  padding: 14px;
  font-size: 12px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1.2px;
  white-space: normal; text-align: center;
  flex-wrap: wrap; line-height: 1.4; gap: 6px;
  box-shadow: none;
}
.variant-add-btn:hover {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.variant-add-btn small {
  font-size: 10.5px;
  flex-basis: 100%; margin: 0; display: block;
  font-weight: 600; letter-spacing: 0.6px;
}
.variant-row {
  background: var(--bg);
  border: 3px solid var(--ink);
  padding: 16px 18px;
  margin-bottom: 12px;
  position: relative;
}
.variant-row .field { margin-bottom: 0; }
.variant-remove {
  position: absolute; top: 8px; right: 8px;
  background: var(--bg); border: 2px solid var(--ink);
  color: var(--ink); cursor: pointer;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
}
.variant-remove:hover { background: var(--hot); color: var(--bg); }
em.variant-label-badge, .variant-label-badge {
  background: var(--hot); color: #ffffff !important;
  font-size: 10px; font-weight: 900;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 3px 8px; border: 2px solid var(--ink);
}
:root[data-theme="dark"] em.variant-label-badge,
:root[data-theme="dark"] .variant-label-badge { color: #14110f !important; }
.variants-info-banner {
  background: var(--acid);
  border: 3px solid #14110f;
  padding: 12px 14px; margin-bottom: 14px;
  font-size: 12px; font-weight: 600;
  color: #14110f;
}
.variants-info-banner strong { color: #14110f; font-weight: 900; }
.variants-info-banner code {
  background: #fffbf0;
  border: 2px solid #14110f;
  padding: 1px 5px;
  font-size: 11px;
  font-family: "SF Mono", monospace;
  color: #14110f;
}
.vb-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.vb-summary {
  display: inline-block; margin-left: 6px;
  font-family: "SF Mono", monospace; font-weight: 700;
  font-size: 11px; opacity: 0.85;
}
.vb-reset {
  background: #14110f; color: #fffbf0;
  border: 2px solid #14110f;
  font-family: inherit; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 5px 10px; cursor: pointer;
  transition: transform 0.08s;
}
.vb-reset:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 #14110f; background: var(--hot); }
.weights-bar {
  display: flex;
  height: 44px;
  border: 3px solid #14110f;
  background: #fffbf0;
  overflow: hidden;
  margin-bottom: 6px;
}
.weight-seg {
  display: flex; align-items: center; justify-content: center;
  gap: 2px;
  border-right: 3px solid #14110f;
  min-width: 0;
  font-weight: 900; font-size: 13px;
  position: relative;
  transition: flex 0.18s ease;
}
.weight-seg:last-child { border-right: none; }
.weight-seg[data-letter="A"] { background: var(--hot); color: #fffbf0; }
.weight-seg[data-letter="B"] { background: var(--primary); color: #fffbf0; }
.weight-seg[data-letter="C"] { background: var(--accent); color: #14110f; }
.weight-seg[data-letter="D"] { background: var(--pink); color: #14110f; }
.weight-letter {
  font-family: "SF Mono", monospace;
  font-size: 14px;
  border: 2px solid currentColor;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.weight-input {
  background: rgba(255,251,240,0.15);
  border: 2px dashed currentColor;
  font: inherit; color: inherit;
  font-weight: 900;
  text-align: center; width: 42px;
  padding: 2px 0; margin: 0;
  outline: none;
  -moz-appearance: textfield;
}
.weight-input::-webkit-outer-spin-button,
.weight-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.weight-input:focus { background: rgba(255,251,240,0.35); border-style: solid; }
.weight-pct { font-weight: 700; opacity: 0.85; }
.vb-hint {
  display: block; font-size: 11px; opacity: 0.75; font-weight: 600;
  letter-spacing: 0.3px;
}
@media (max-width: 600px) {
  .weight-seg { gap: 1px; font-size: 11px; }
  .weight-letter { width: 18px; height: 18px; font-size: 11px; border-width: 1px; }
  .weight-input { width: 32px; font-size: 11px; }
  .weights-bar { height: 38px; }
}

/* Errors */
.error {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--hot); color: var(--bg);
  border: 3px solid var(--ink);
  padding: 12px 14px;
  margin-top: 14px; line-height: 1.4;
  font-size: 13px; font-weight: 700;
  box-shadow: 3px 3px 0 var(--ink);
}
.error::before { content: "⚠"; font-size: 18px; flex-shrink: 0; }

.field-error-input { border-color: var(--hot) !important; box-shadow: 3px 3px 0 var(--hot) !important; }
.field-error-msg {
  display: flex; align-items: center; gap: 6px;
  color: var(--hot); font-size: 12px;
  font-weight: 700; margin-top: 8px;
}
.field-error-msg::before {
  content: "✕";
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px;
  background: var(--hot); color: var(--bg);
  font-size: 9px; font-weight: 900;
  flex-shrink: 0;
}

/* ============================================================
   RESULT CARD
   ============================================================ */
.result-card {
  background: var(--acid);
  border: 4px solid #14110f;
  padding: 24px;
  margin-top: 24px;
  box-shadow: 6px 6px 0 #14110f;
  color: #14110f;
}
.result-card .label, .result-card .short-link { color: #14110f; }
.result-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.result-info { flex: 1; min-width: 200px; }
.result-info .label {
  display: block; font-size: 10px;
  font-weight: 900; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--ink);
  margin-bottom: 6px;
}
.short-link {
  font-size: 22px; font-weight: 900;
  color: var(--ink); word-break: break-all;
  letter-spacing: -0.5px;
}
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qr-container {
  margin-top: 20px; padding-top: 20px;
  border-top: 3px solid var(--ink);
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.qr-container img {
  width: 200px; height: 200px;
  background: var(--bg);
  padding: 12px;
  border: 3px solid var(--ink);
}
.qr-modal-content { max-width: 420px; }
.qr-modal-body {
  display: flex; flex-direction: column;
  align-items: center; gap: 14px; padding: 24px;
}
.qr-modal-body img {
  width: 260px; height: 260px;
  background: #fffbf0;
  padding: 14px;
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}
.qr-modal-url {
  margin: 0; text-align: center; word-break: break-all;
  font-size: 12px;
}
.qr-modal-url code {
  background: var(--bg-2); padding: 4px 8px;
  border: 2px solid var(--ink);
  font-family: "SF Mono", monospace; font-weight: 700;
  color: var(--ink);
}
.qr-modal-hint {
  margin: 0; font-size: 12px; color: var(--ink-soft);
  text-align: center; line-height: 1.4;
}

/* ============================================================
   FEATURES (LANDING)
   ============================================================ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-top: 60px;
}
.feature {
  background: var(--bg);
  border: 3px solid var(--ink);
  margin: -1.5px;
  padding: 28px 24px;
  transition: transform 0.15s, background 0.15s;
}
.feature:hover { transform: scale(1.03); z-index: 2; background: var(--acid); color: #14110f; }
.feature:hover h3, .feature:hover p { color: #14110f; }
.feat-icon { font-size: 28px; margin-bottom: 12px; }
.feature h3 {
  font-size: 18px; font-weight: 900;
  margin-bottom: 8px; letter-spacing: -0.5px;
  text-transform: uppercase;
}
.feature p { color: var(--ink-soft); font-size: 14px; font-weight: 500; line-height: 1.5; }

/* ============================================================
   DASHBOARD / PAGES
   ============================================================ */
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 16px;
  padding-bottom: 20px;
  border-bottom: 4px solid var(--ink);
}
.page-header h1 {
  font-size: 36px; font-weight: 900;
  letter-spacing: -1px; text-transform: uppercase;
}
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg);
  border: 3px solid var(--ink);
  margin: -1.5px;
  padding: 22px 24px;
  transition: background 0.15s;
}
.stat-card:hover { background: var(--acid); color: #14110f; }
.stat-card:hover .stat-num, .stat-card:hover .stat-label { color: #14110f; }
.stat-num {
  font-size: 38px; font-weight: 900;
  color: var(--ink); letter-spacing: -1.5px; line-height: 1;
}
.stat-label {
  color: var(--ink); font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-top: 8px; font-weight: 800;
}

/* Filters bar */
.filters-bar {
  display: flex; gap: 12px;
  margin-bottom: 16px;
  align-items: center; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 240px; }
.search-wrap svg {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink); pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: var(--bg); color: var(--ink);
  border: 3px solid var(--ink);
  padding: 10px 14px 10px 38px;
  font-size: 14px; font-family: inherit; font-weight: 500;
  outline: none;
}
.search-wrap input:focus { box-shadow: 4px 4px 0 var(--primary); }

.filter-group {
  display: inline-flex;
  background: var(--bg);
  border: 3px solid var(--ink);
  padding: 0;
}
.chip {
  background: transparent; color: var(--ink);
  border: none; border-right: 2px solid var(--ink);
  padding: 9px 16px;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.chip:last-child { border-right: none; }
.chip:hover { background: var(--acid); color: #14110f; }
.chip.active { background: var(--ink); color: var(--bg); }

.sort-select {
  background: var(--bg); color: var(--ink);
  border: 3px solid var(--ink);
  padding: 9px 32px 9px 14px;
  font-size: 13px; font-family: inherit;
  font-weight: 700; cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2314110f' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.sort-select:focus { box-shadow: 4px 4px 0 var(--primary); }

#toggle-advanced, .btn-ghost.btn-sm {
  font-size: 11px; padding: 9px 14px;
  font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase;
}
.active-count {
  background: var(--hot); color: var(--bg);
  padding: 2px 7px; font-size: 11px; font-weight: 900;
  margin-left: 6px;
}
.advanced-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 16px;
  margin-bottom: 16px;
  background: var(--bg-2);
  border: 3px solid var(--ink);
  align-items: center;
}
.advanced-filters .sort-select { flex: 1 0 auto; min-width: max-content; }
.filter-info {
  margin-top: 12px;
  color: var(--ink-soft); font-size: 12px;
  font-weight: 600; text-align: center;
}

.date-range {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 240px;
}
.date-range input[type="date"] {
  flex: 1;
  background: var(--bg); color: var(--ink);
  border: 3px solid var(--ink);
  padding: 8px 10px;
  font-size: 13px; font-family: inherit; font-weight: 500;
  outline: none; min-width: 0;
}
.date-range input[type="date"]:focus { box-shadow: 3px 3px 0 var(--primary); }
.date-range .date-sep { color: var(--ink); font-weight: 900; }

/* Multi-select */
.multi-select { position: relative; flex: 1 0 auto; min-width: max-content; }
.multi-select-button {
  width: 100%;
  background: var(--bg); color: var(--ink);
  border: 3px solid var(--ink);
  padding: 9px 14px;
  font-size: 13px; font-family: inherit;
  font-weight: 700;
  cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 0.8px;
  white-space: nowrap;
}
.multi-select-button:hover { background: var(--bg-2); }
.multi-select-button.has-selection { background: var(--acid); color: #14110f; }
.ms-label { flex: 1; white-space: nowrap; }
.ms-count {
  background: var(--hot); color: var(--bg);
  font-size: 10px; font-weight: 900;
  padding: 1px 7px;
  min-width: 18px; text-align: center;
}
.ms-chevron { flex-shrink: 0; transition: transform 0.15s; }
.multi-select.open .ms-chevron { transform: rotate(180deg); }
.multi-select-popup {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 100%; max-width: 280px;
  background: var(--bg);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  z-index: 100; max-height: 320px;
  display: flex; flex-direction: column;
}
.multi-select-options { overflow-y: auto; padding: 6px 0; max-height: 260px; }
.multi-select-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; cursor: pointer;
  font-size: 13px; font-weight: 600;
  user-select: none;
}
.multi-select-option:hover { background: var(--acid); color: #14110f; }
.multi-select-option input[type="checkbox"] {
  accent-color: var(--primary);
  width: 14px; height: 14px; margin: 0;
}
.multi-select-empty {
  padding: 16px; text-align: center;
  color: var(--ink-soft); font-size: 12px;
  font-weight: 600;
}
.multi-select-footer {
  border-top: 2px solid var(--ink);
  padding: 8px;
  display: flex; justify-content: space-between; gap: 8px;
}
.multi-select-footer button {
  background: transparent; border: none;
  color: var(--ink); font-size: 11px; font-weight: 800;
  cursor: pointer; padding: 4px 8px; font-family: inherit;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.multi-select-footer button:hover { background: var(--ink); color: var(--bg); }
.multi-select-footer .ms-apply { color: var(--hot); }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap {
  background: var(--bg);
  border: 3px solid var(--ink);
  overflow-x: auto;
}
.links-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.links-table th, .links-table td {
  padding: 14px 14px;
  text-align: left;
  border-bottom: 2px solid var(--ink);
  vertical-align: middle;
}
.links-table th {
  font-weight: 900;
  color: var(--bg);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.2px;
  background: var(--ink);
  border-bottom: 3px solid var(--ink);
}
.links-table tbody tr:last-child td { border-bottom: none; }
.links-table tbody tr:hover { background: var(--bg-2); }
.links-table tr.row-disabled { opacity: 0.55; }
.links-table tr.row-disabled .short-cell a {
  text-decoration: line-through;
  color: var(--ink-soft);
}
.links-table .short-cell { font-weight: 800; white-space: nowrap; }
.links-table .short-cell a {
  color: var(--primary);
  font-weight: 800;
}
.links-table .target {
  color: var(--ink-soft);
  word-break: break-all;
  font-size: 12.5px;
  line-height: 1.45;
  display: block;
  max-width: 480px;
}
.links-table .click-count {
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
}
.links-table .click-count.zero { color: var(--ink-soft); font-weight: 600; }
.links-table .date-cell {
  color: var(--ink-soft);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}
.links-table .empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 48px;
  font-weight: 600;
}

.actions-cell {
  white-space: nowrap;
  text-align: right;
  padding-right: 14px !important;
}
.actions-row {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: nowrap;
}
.icon-btn {
  background: var(--bg);
  border: 2px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--ink); color: var(--bg); text-decoration: none; }
.icon-btn.danger:hover { background: var(--hot); color: var(--bg); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px; height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg);
  border: 3px solid var(--ink);
  transition: background 0.15s;
}
.toggle-slider::before {
  position: absolute; content: "";
  height: 12px; width: 12px;
  left: 2px; bottom: 2px;
  background: var(--ink);
  transition: 0.15s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--acid); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: var(--ink);
}

.ab-badge {
  display: inline-block;
  background: var(--hot); color: var(--bg);
  font-size: 10px; font-weight: 900;
  padding: 2px 7px;
  margin-left: 8px; letter-spacing: 1px;
  border: 2px solid var(--ink);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(20, 17, 15, 0.55);
}
.modal-content {
  position: relative;
  background: var(--bg);
  border: 4px solid var(--ink);
  width: min(560px, 92vw);
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 8px 8px 0 var(--hot);
  overflow: hidden;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px; border-bottom: 3px solid var(--ink);
  background: var(--ink); color: var(--bg);
}
.modal-header h2 {
  font-size: 18px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1px;
  margin: 0;
}
.modal-close {
  background: var(--bg); color: var(--ink);
  border: 2px solid var(--ink);
  cursor: pointer; padding: 6px;
  display: inline-flex;
}
.modal-close:hover { background: var(--hot); color: var(--bg); }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body .field { margin-bottom: 16px; }
.modal-body .field:last-of-type { margin-bottom: 0; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 22px;
  border-top: 3px solid var(--ink);
  background: var(--bg-2);
}

/* ============================================================
   ANALYTICS
   ============================================================ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink); font-size: 12px;
  margin-bottom: 16px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.2px;
  text-decoration: none;
}
.back-link:hover { color: var(--hot); }

.analytics-top-actions {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 16px;
  gap: 12px; flex-wrap: wrap;
}
.analytics-top-actions .back-link { margin-bottom: 0; }

.analytics-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 28px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 4px solid var(--ink);
}
.analytics-header h1 {
  font-size: 36px; margin-bottom: 8px;
  letter-spacing: -1px; font-weight: 900;
  text-transform: uppercase;
}
.analytics-header .short-link { font-size: 18px; }
.analytics-header .muted {
  color: var(--ink-soft); font-size: 13px;
  margin-top: 8px; word-break: break-all;
  font-weight: 600;
}
.analytics-header .muted a { color: var(--ink-soft); }
.big-stats { display: flex; gap: 0; flex-shrink: 0; }
.big-stats .stat-card { min-width: 140px; text-align: center; padding: 16px; }
.big-stats .stat-num { font-size: 28px; }

.chart-section {
  background: var(--bg);
  border: 3px solid var(--ink);
  padding: 24px;
  margin-bottom: 20px;
}
.chart-section h2 {
  font-size: 13px; margin-bottom: 16px;
  font-weight: 900; color: var(--ink);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.chart-canvas {
  position: relative; width: 100%; height: 280px;
}
.chart-canvas.tall { height: 220px; }
.chart-canvas.short { height: 180px; }
.chart-canvas canvas { width: 100% !important; height: 100% !important; }

.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin-bottom: 20px;
}
.grid-2 .chart-section { margin-bottom: 0; margin: -1.5px; }

/* A/B variant results */
.variants-results { display: grid; gap: 10px; }
.variant-result-row {
  display: grid; grid-template-columns: 60px 1fr 100px 70px;
  align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 3px solid var(--ink);
}
.variant-result-letter {
  background: var(--hot); color: var(--bg);
  border: 2px solid var(--ink);
  font-size: 16px; font-weight: 900;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.variant-result-url {
  font-family: "SF Mono", monospace;
  font-size: 12px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0;
}
.variant-result-url a { color: var(--primary); font-weight: 700; }
.variant-result-bar-wrap {
  height: 10px;
  background: var(--bg);
  border: 2px solid var(--ink);
  overflow: visible;
  min-width: 80px;
  position: relative;
}
.variant-result-bar {
  height: 100%; background: var(--hot);
  transition: width 0.3s;
}
.variant-target-marker {
  position: absolute; top: -3px; bottom: -3px;
  width: 3px; background: var(--ink);
  transform: translateX(-50%);
  pointer-events: none;
}
.variant-target-marker::after {
  content: "▾"; position: absolute; top: -11px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px; color: var(--ink); line-height: 1;
}
.variant-result-count {
  font-weight: 900; color: var(--ink);
  text-align: right; font-size: 15px;
}
.variant-result-count small {
  display: block; font-size: 11px;
  font-weight: 700; color: var(--ink-soft);
}
.variant-target-chip {
  display: inline-block; margin-top: 4px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--ink-soft);
}
.variant-target-chip .drift {
  font-style: normal; color: var(--hot);
  font-weight: 800; margin-left: 2px;
}
.variant-winner {
  background: var(--acid);
  border-color: var(--ink);
}
.variant-winner .variant-result-letter { background: var(--moss); }
.variant-winner .variant-result-bar { background: var(--moss); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .container { padding: 24px 18px; }
  .topbar { padding: 12px 18px; }
  .links-table .target { max-width: 280px; }
  .chart-canvas { height: 240px; }
  .chart-canvas.tall { height: 200px; }
}

/* Charts collapse to 1 column only on narrow screens */
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 18px; }

  /* Hamburger menu — stays on top of panel via z-index so user can close */
  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 70;
  }
  .nav-toggle[aria-expanded="true"] { background: var(--bg); }
  .topbar > a.mobile-cta { display: inline-flex !important; margin-left: auto; padding: 9px 14px; font-size: 11px; }
  .topbar nav {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(320px, 88vw);
    background: var(--bg);
    border-left: 4px solid var(--ink);
    flex-direction: column; align-items: stretch;
    gap: 6px;
    padding: 80px 22px 30px;
    transform: translateX(100%);
    transition: transform 0.22s ease-out;
    z-index: 60;
    box-shadow: -10px 0 0 var(--ink);
    overflow-y: auto;
  }
  .topbar nav.open { transform: translateX(0); }
  .topbar nav a, .topbar nav button {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    font-size: 14px;
    border-width: 3px;
  }
  .topbar nav a.nav-signin { font-size: 14px; padding: 14px 16px; border-style: dashed; }
  .topbar nav a.btn-primary.nav-cta { font-size: 13px; padding: 14px 16px; justify-content: flex-start; }
  .topbar nav .lang-btn,
  .topbar nav .theme-btn {
    align-self: flex-start;
    width: 48px; height: 48px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  body.nav-open { overflow: hidden; }

  .container { padding: 22px 14px; }

  .page-header { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-header h1 { font-size: 28px; }
  .page-actions { flex-direction: column; width: 100%; }
  .page-actions .btn-primary,
  .page-actions .btn-secondary { width: 100%; }

  .stats-summary { grid-template-columns: 1fr 1fr; }
  .stat-num { font-size: 28px; }

  .filters-bar { flex-direction: column; align-items: stretch; }
  .search-wrap, .filter-group, .sort-select, #toggle-advanced { width: 100%; }
  .filter-group .chip { flex: 1; text-align: center; }
  .advanced-filters { flex-direction: column; align-items: stretch; }
  .advanced-filters .sort-select,
  .advanced-filters .date-range,
  .advanced-filters .multi-select { width: 100%; }
  #reset-filters { width: 100%; }

  /* Table → cards on mobile */
  .table-wrap { background: transparent; border: none; overflow: visible; }
  .links-table, .links-table tbody, .links-table tr, .links-table td { display: block; }
  .links-table thead { display: none; }
  .links-table tr {
    background: var(--bg);
    border: 3px solid var(--ink);
    margin-bottom: 12px;
    padding: 14px 16px;
    box-shadow: 4px 4px 0 var(--ink);
  }
  .links-table tr.row-disabled { opacity: 0.55; }
  .links-table tr:hover { background: var(--bg); }
  .links-table td {
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 2px dashed var(--line-soft);
    padding: 9px 0; gap: 12px; text-align: right;
  }
  .links-table td:first-child { padding-top: 0; border-top: none; }
  .links-table td:last-child {
    border-bottom: none; padding-top: 14px; padding-bottom: 0;
  }
  .links-table td::before {
    content: attr(data-label);
    font-weight: 900; color: var(--ink);
    font-size: 10px; text-transform: uppercase;
    letter-spacing: 1.2px; flex-shrink: 0; text-align: left;
  }
  .links-table td:not([data-label])::before { display: none; }
  .links-table td .target {
    display: inline; word-break: break-all;
    text-align: right; max-width: 100%; line-height: 1.4;
  }
  .links-table .actions-cell {
    text-align: right !important; padding-right: 0 !important;
  }
  .links-table .actions-cell::before { display: none; }
  .links-table .actions-row { width: 100%; justify-content: flex-end; gap: 8px; }
  .links-table .icon-btn { width: 36px; height: 36px; }

  .analytics-header { flex-direction: column; gap: 16px; }
  .analytics-header h1 { font-size: 28px; }
  .big-stats { width: 100%; }
  .big-stats .stat-card { flex: 1; min-width: 0; padding: 14px; }
  .big-stats .stat-num { font-size: 22px; }

  .chart-section { padding: 18px; }
  .chart-canvas { height: 220px; }
  .chart-canvas.tall { height: 180px; }

  .variant-result-row {
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
  }
  .variant-result-url { grid-column: 2; font-size: 11px; }
  .variant-result-bar-wrap { grid-column: 1 / -1; }
  .variant-result-count { grid-column: 1 / -1; text-align: right; }

  .shorten-card { padding: 24px 18px; }
  .form-intro { padding: 12px; font-size: 12px; }
  .utm-group { padding: 16px 16px 4px; }
  .utm-field { padding: 14px; }
  .live-preview-row { grid-template-columns: 70px 1fr; }

  .result-row { flex-direction: column; align-items: stretch; }
  .result-actions { flex-direction: column; }
  .result-actions .btn-primary,
  .result-actions .btn-secondary { width: 100%; }

  .modal-content { width: 95vw; max-height: 92vh; }
  .modal-header, .modal-body, .modal-footer { padding: 14px 18px; }

  .multi-select-popup { left: 0; right: 0; max-width: none; width: 100%; }

  .features { grid-template-columns: 1fr; }
  .hero h1 { letter-spacing: -2px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 44px; letter-spacing: -1.5px; }
  .hero .lead { font-size: 16px; }
  .stats-summary { grid-template-columns: 1fr; }
  .big-stats { flex-direction: column; }
  .big-stats .stat-card { width: 100%; }
}

/* Tablet portrait override: 2 filters per row (placed AFTER mobile rule
   so it wins the cascade at 640-900px) */
@media (min-width: 640px) and (max-width: 900px) {
  .advanced-filters { flex-direction: row; flex-wrap: wrap; }
  .advanced-filters .multi-select,
  .advanced-filters .sort-select {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
  }
  .advanced-filters .date-range { flex: 1 1 100%; width: 100%; }
  #reset-filters, #af-reset { flex: 1 1 100%; width: 100%; }
}

/* Hide auto-fill flash from i18n */
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }

/* ============================================================
   SIMPLE UX (/new) — Hero card + Personnaliser accordion
   ============================================================ */
.simple-main {
  max-width: 760px; margin: 0 auto;
  padding: 36px 18px 60px;
}
.simple-form { display: flex; flex-direction: column; gap: 16px; }

/* HERO QUICK CARD */
.quick-card {
  background: var(--bg);
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 var(--acid);
  padding: clamp(28px, 5vw, 42px) clamp(20px, 4vw, 36px);
  text-align: center;
}
.quick-h {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 900; letter-spacing: -0.5px;
  margin-bottom: 22px;
  line-height: 1.2;
}
.quick-field {
  position: relative;
  display: block;
  margin-bottom: 16px;
}
.quick-field input {
  width: 100%;
  background: #ffffff;
  color: var(--ink);
  border: 3px solid var(--ink);
  border-left: 8px solid var(--hot);
  padding: 18px 22px;
  font-size: clamp(15px, 2vw, 17px);
  font-weight: 600;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
}
:root[data-theme="dark"] .quick-field input { background: #0d0a08; color: var(--ink); }
.quick-field input:focus {
  border-left-color: var(--primary);
  box-shadow: 5px 5px 0 var(--primary);
}
.quick-field input:placeholder-shown { border-left-color: var(--hot); }
.quick-field .auto-badge {
  position: absolute; top: -12px; right: 16px;
  margin: 0;
}
.btn-shorten-big {
  width: 100%;
  background: var(--ink); color: var(--bg);
  border: 3px solid var(--ink);
  padding: 22px 24px;
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 6px 6px 0 var(--hot);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn-shorten-big:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--hot);
}
.btn-shorten-big:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--hot); }
.quick-mention {
  margin-top: 14px;
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
}

/* PERSONNALISER toggle */
.customize-bar {
  background: var(--bg-2);
  border: 3px dashed var(--ink);
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ink);
  width: 100%;
  text-align: left;
}
.customize-bar:hover {
  background: var(--ink); color: var(--bg);
}
.customize-bar .cb-label strong {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.customize-bar .cb-label small {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-left: 4px;
}
.customize-bar:hover .cb-label small { color: var(--acid); }
.customize-bar .cb-chev {
  font-size: 24px; font-weight: 900;
  transition: transform 0.18s;
  flex-shrink: 0;
}
.customize-bar.open .cb-chev { transform: rotate(90deg); }

/* ACCORDION */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.accordion[hidden] { display: none !important; }
.acc-item {
  background: var(--bg);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  overflow: hidden;
}
.acc-header {
  list-style: none;
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
  background: var(--bg);
  font-family: inherit;
  user-select: none;
}
.acc-header::-webkit-details-marker,
.acc-header::marker { display: none; }
.acc-icon-tile {
  width: 42px; height: 42px;
  background: var(--acid); color: var(--ink);
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.acc-icon-tile.utm-tile { background: var(--hot); color: #fff; }
.acc-icon-tile.ab-tile { background: var(--acid); color: var(--ink); }
.acc-icon-tile.alias-tile { background: var(--primary); color: #fff; }
.acc-title-wrap { flex: 1; min-width: 0; text-align: left; }
.acc-title {
  font-weight: 900; font-size: 14px;
  text-transform: uppercase; letter-spacing: 0.8px;
  display: block;
}
.acc-sub {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 2px;
  display: block;
}
.acc-toggle {
  margin-left: auto;
  font-size: 22px; font-weight: 900;
  color: var(--ink-soft);
  transition: transform 0.18s, color 0.18s;
  flex-shrink: 0;
  width: 24px; text-align: center;
}
.acc-item[open] .acc-toggle {
  transform: rotate(45deg);
  color: var(--hot);
}
.acc-item[open] .acc-header { border-bottom: 3px solid var(--ink); }
.acc-content {
  padding: 22px 22px 22px;
  background: var(--bg-2);
}
:root[data-theme="dark"] .acc-content { background: var(--bg-2); }
.acc-content .field { margin-bottom: 16px; }
.acc-content .field:last-child { margin-bottom: 0; }
.acc-content .field input {
  border-left-width: 6px;
  padding: 11px 14px;
  font-size: 14px;
}
.acc-content .field span {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}

/* UTM more (Term/Content) collapsible */
.utm-more {
  margin-top: 10px;
  background: var(--bg);
  border: 2px dashed var(--ink);
  padding: 12px 16px;
}
.utm-more > summary {
  cursor: pointer;
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  list-style: none;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.utm-more[open] > summary { color: var(--ink); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px dashed var(--line-soft); }
.utm-more > summary::-webkit-details-marker { display: none; }
.utm-more .field { margin-bottom: 12px; }
.utm-more .field:last-child { margin-bottom: 0; }

/* UTM preview inside the panel */
.acc-content .utm-preview-wrap {
  margin-top: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 14px;
  border: 2px solid var(--ink);
  font-family: "SF Mono", monospace;
}
.acc-content .utm-preview-label {
  display: block;
  color: var(--acid);
  font-size: 10px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 6px;
  font-family: inherit;
}
.acc-content .utm-preview {
  display: block; color: var(--bg);
  font-size: 12px; word-break: break-all;
  background: transparent; border: none; padding: 0;
}

/* Variants section inside A/B accordion */
.acc-content .variants-section { margin: 0; }
.acc-content .variant-add-btn { width: 100%; }

/* Live preview in alias accordion */
.acc-content .live-preview {
  margin-top: 16px;
  background: var(--bg);
  border: 2px dashed var(--ink);
  padding: 14px;
}

/* Mobile */
@media (max-width: 600px) {
  .simple-main { padding: 20px 14px 40px; }
  .quick-card { box-shadow: 6px 6px 0 var(--acid); }
  .btn-shorten-big { padding: 18px; letter-spacing: 1.5px; }
  .customize-bar { padding: 14px 18px; }
  .customize-bar .cb-label small { display: block; margin-left: 0; margin-top: 2px; }
  .acc-header { padding: 14px 16px; gap: 12px; }
  .acc-icon-tile { width: 36px; height: 36px; font-size: 16px; }
  .acc-content { padding: 18px 16px; }
}
