/* ==========================================================================
   QR Monkey — cartographic identity
   Sage map-paper, map-ink navy, mono coordinate type, a cool→warm scan-heat
   pin ramp, and topographic contour lines as the signature motif.
   Shared base for the marketing landing (jive.html) and the dashboard SPA;
   the GeckoScan "Jive" look is layered on top via jive.css.
   ========================================================================== */

/* The `hidden` attribute is the app's source of truth for view switching
   (JS toggles el.hidden). Author `display` rules like `.auth-view{display:grid}`
   would otherwise override the UA `[hidden]{display:none}`, leaving toggled
   views stuck visible — so make `hidden` authoritative everywhere. */
[hidden] { display: none !important; }

:root {
  /* Map paper & ink */
  --paper:      #E9EEE3;   /* sage topo-map paper */
  --paper-deep: #DFE5D6;
  --surface:    #FFFFFF;   /* card faces */
  --ink:        #16263F;   /* map ink — primary text / dark sections */
  --ink-soft:   #475a73;   /* secondary text */
  --ink-faint:  #7c8aa0;   /* captions */
  --line:       #D2D9C6;   /* graticule hairlines */
  --line-soft:  #E2E7D9;

  /* Scan-heat ramp (cold → hot). Also the pin + brand accent. */
  --cool:       #2C7E8C;   /* teal — cold / water */
  --cool-deep:  #1d5e6a;
  --gold:       #F2A93B;   /* mid heat */
  --pin:        #FF5630;   /* vermilion map pin — hot / primary action */
  --pin-deep:   #E0401C;

  /* Type */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code",
               "Roboto Mono", Menlo, Consolas, monospace;

  /* Geometry */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --maxw: 1160px;
  --shadow: 0 1px 2px rgba(22,38,63,.06), 0 8px 28px rgba(22,38,63,.08);
  --shadow-lg: 0 18px 60px rgba(22,38,63,.18);
  --ring: 0 0 0 3px rgba(44,126,140,.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.08; letter-spacing: -.02em; margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: var(--cool-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Eyebrow / legend label — the wayfinding voice of the type system. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cool-deep);
  display: inline-flex;
  align-items: center;
  gap: .55em;
  margin: 0 0 14px;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--cool);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .72em 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  line-height: 1;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--pin); color: #fff; box-shadow: 0 6px 18px rgba(255,86,48,.32); }
.btn-primary:hover { background: var(--pin-deep); }

.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #0d1a2d; }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: rgba(22,38,63,.05); border-color: var(--ink-soft); }

.btn-danger { background: transparent; color: var(--pin-deep); border-color: rgba(224,64,28,.4); }
.btn-danger:hover { background: rgba(224,64,28,.08); }

.btn-sm { padding: .5em .9em; font-size: .85rem; font-weight: 600; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label,
.form-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="url"], input[type="number"], select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .66em .8em;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cool);
  box-shadow: var(--ring);
}
input::placeholder { color: var(--ink-faint); }
.hint { font-size: .78rem; color: var(--ink-faint); }

/* Switch (active toggle) */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; gap: .5em; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--line); transition: background .15s; flex: none; position: relative;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s;
}
.switch input:checked + .track { background: var(--cool); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }

/* Inline error / notice */
.error-msg {
  color: var(--pin-deep);
  font-size: .85rem;
  min-height: 1em;
  font-family: var(--font-mono);
}
.error-msg:empty { display: none; }

/* ==========================================================================
   SHARED: card
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

/* ==========================================================================
   LANDING PAGE
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(233,238,227,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); border-radius: 9px;
}
.brand-mark svg { width: 18px; height: 18px; }
.site-nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.site-nav a.navlink { color: var(--ink-soft); font-weight: 550; font-size: .95rem; }
.site-nav a.navlink:hover { color: var(--ink); text-decoration: none; }
.header-cta { display: flex; gap: 10px; align-items: center; }
/* Signed-in identity chip in the landing header (light theme). */
.header-cta .user-pill {
  font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft);
  max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Hero ---------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.hero-bg svg { width: 100%; height: 100%; }
.hero .wrap { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
  padding: 84px 0 96px;
}
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.4rem);
  letter-spacing: -.035em;
}
.hero h1 .hl { color: var(--pin); }
.hero-sub {
  margin-top: 22px;
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  color: var(--ink-soft);
  max-width: 33ch;
}
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 30px;
  display: flex; gap: 26px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft);
}
.hero-meta b { color: var(--ink); font-size: 1.35rem; display: block; letter-spacing: -.02em; }

/* Hero map panel (the signature) */
.hero-map {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #fff, #eef2ea);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.hero-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-legend-chip {
  position: absolute; left: 16px; bottom: 16px; z-index: 3;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  font-family: var(--font-mono); font-size: .72rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
}
.heat-ramp { width: 64px; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--cool), var(--gold), var(--pin)); }

/* Pin drop animation */
.drop { transform-box: fill-box; transform-origin: 50% 100%; opacity: 0;
  animation: drop .7s cubic-bezier(.2,.85,.3,1.2) forwards; }
.drop.d1 { animation-delay: .25s; }
.drop.d2 { animation-delay: .65s; }
.drop.d3 { animation-delay: 1.05s; }
.drop.d4 { animation-delay: 1.45s; }
.drop.d5 { animation-delay: 1.85s; }
@keyframes drop {
  0%   { opacity: 0; transform: translateY(-26px) scale(.6); }
  70%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ping { transform-box: fill-box; transform-origin: center; animation: ping 2.8s ease-out infinite; }
@keyframes ping { 0% { opacity:.5; transform: scale(.4);} 80%,100% { opacity:0; transform: scale(2.6);} }

@media (prefers-reduced-motion: reduce) {
  .drop, .ping { animation: none; opacity: 1; }
}

/* Section scaffolding ------------------------------------------------------- */
section.band { padding: 86px 0; }
.section-head { max-width: 60ch; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.section-head p { margin-top: 14px; color: var(--ink-soft); font-size: 1.08rem; }

/* How it works — a genuine 3-step sequence, so numbered markers earn their place */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step {
  position: relative; padding: 30px 26px 28px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r);
}
.step .num {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .12em;
  color: var(--pin); font-weight: 700;
}
.step h3 { margin: 14px 0 8px; font-size: 1.22rem; }
.step p { color: var(--ink-soft); font-size: .98rem; }
.step .rule { height: 2px; background: var(--line-soft); margin-top: 18px; position: relative; }
.step .rule::before { content:""; position:absolute; left:0; top:0; height:2px; width:34px; background: var(--cool); }

/* Feature cards (the 3 selling points) */
.bg-ink { background: var(--ink); color: #fff; }
.bg-ink .eyebrow { color: #8fd3d8; }
.bg-ink .eyebrow::before { background: #8fd3d8; }
.bg-ink .section-head p { color: #c2ccda; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r);
  padding: 28px 26px;
}
.feature .ficon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 18px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.feature .ficon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 1.24rem; }
.feature p { margin-top: 10px; color: #b9c4d2; font-size: .98rem; }
.feature .ftag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #7fb9bf; margin-bottom: 4px; display:block; }

/* Closing CTA */
.cta-band { text-align: center; }
.cta-band .card { padding: 56px 32px; max-width: 760px; margin: 0 auto; }
.cta-band h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.cta-band p { color: var(--ink-soft); margin: 14px auto 28px; max-width: 44ch; font-size: 1.08rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; color: var(--ink-faint); font-size: .9rem; }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--ink); color: #fff;
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.topbar .brand { color: #fff; }
.topbar .brand-mark { background: rgba(255,255,255,.12); }
.topbar .spacer { flex: 1; }
.topbar .user-email { font-family: var(--font-mono); font-size: .85rem; color: #c2ccda; max-width: 36vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-badge {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(143,211,216,.16); color: #aee0e4; border: 1px solid rgba(143,211,216,.35);
  padding: 3px 8px; border-radius: 999px;
}
.topbar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.1); }

/* Auth view */
.auth-view {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(44,126,140,.12), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(255,86,48,.1), transparent 60%),
    var(--paper);
}
.auth-card { width: 100%; max-width: 410px; padding: 34px 32px 30px; }
.auth-card .brand { font-size: 1.25rem; justify-content: center; margin-bottom: 4px; }
.auth-tagline { text-align: center; color: var(--ink-soft); font-size: .92rem; margin-bottom: 22px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--paper-deep); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.tab {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; background: transparent;
  color: var(--ink-soft); padding: .55em; border-radius: 999px; transition: background .15s, color .15s;
}
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.auth-form { display: grid; gap: 16px; }
.auth-form[hidden] { display: none; }

/* Dashboard layout */
.dash { padding: 26px 0 80px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { font-size: 1.7rem; }
.dash-head p { color: var(--ink-soft); font-size: .95rem; margin-top: 4px; }

/* Timeframe filter for the stat strip (reuses .segmented/.seg). */
.stat-period { display: flex; align-items: center; gap: 10px; }
.stat-period .opt-label { margin: 0; }

/* "Your posters" (2/3) + "Scan alerts" (1/3), side by side. */
.dash-row { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; margin-bottom: 22px; align-items: start; }
@media (max-width: 860px) { .dash-row { grid-template-columns: 1fr; } }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px 20px; }
.stat .k { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.stat .v { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.stat .v .sub { font-size: .85rem; font-weight: 600; color: var(--ink-faint); font-family: var(--font-mono); }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 22px; }
.panel { padding: 22px 22px 24px; }
.panel > h2 { font-size: 1.15rem; margin-bottom: 4px; }
.panel > .panel-sub { color: var(--ink-faint); font-size: .85rem; margin-bottom: 18px; }

/* Scan-alerts (ntfy) subscription panel ------------------------------------- */
.notify-panel { border-left: 3px solid var(--cool); }
.notify-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.notify-head h2 { margin: 0; }
.notify-status {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
  background: rgba(44,126,140,.12); color: var(--cool-deep); border: 1px solid rgba(44,126,140,.3);
  padding: 3px 8px; border-radius: 999px;
}
.notify-sub { margin-top: 4px; }
.notify-sub .opt-label { display: block; margin-bottom: 6px; font-weight: 600; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row input#notify-url {
  flex: 1; min-width: 220px; font-size: .82rem;
  background: var(--paper); border-color: var(--line); color: var(--ink-soft);
}
.notify-sub .hint code {
  font-family: var(--font-mono); font-size: .82rem; color: var(--ink);
  background: var(--paper-deep); padding: 1px 6px; border-radius: var(--r-sm);
  word-break: break-all;
}
@media (max-width: 560px) {
  .copy-row input#notify-url { min-width: 100%; }
}
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.checkrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Batch: visual QR placer + details, side by side
   -------------------------------------------------------------------------- */
.batch-layout {
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
  gap: 34px;
  align-items: start;
}
.batch-fields { display: grid; gap: 14px; align-content: start; }
.batch-design { display: grid; gap: 12px; }

/* The stage = a scaled stand-in for the printed SHEET. JS sets its aspect ratio
   to the page (portrait/landscape) and positions 1–2 artwork frames inside it,
   so the preview mirrors the printed sheet (orientation, 2-up, padding). */
.placer-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 210 / 297;            /* JS overrides to the page ratio */
  background:
    linear-gradient(var(--paper-deep) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, var(--paper-deep) 1px, transparent 1px) 0 0 / 28px 100%,
    var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;                   /* clip frames to the sheet edge */
}
.placer-stage.drop-hover { border-color: var(--cool); box-shadow: var(--ring); }

/* One letterboxed artwork rectangle within a cell. Sits on the gridded "sheet",
   so the gutter around it is the visible image padding. JS sets its position. */
.placer-frame {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(22, 38, 63, .12);
}
.placer-stage:not(.has-art) .placer-frame { display: none; }

.placer-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;                /* frame already matches the artwork ratio */
  pointer-events: none;
}

/* Numbered chip distinguishing the two QRs — shown only in 2-up. */
.placer-badge {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  display: none; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: .72rem; font-weight: 700; line-height: 1;
  color: #fff; background: var(--pin);
  border-radius: 999px; box-shadow: 0 1px 3px rgba(22, 38, 63, .4);
}
.placer-stage.is-2up .placer-badge { display: inline-flex; }

.placer-empty {
  position: absolute; inset: 0; margin: 8px;
  display: grid; place-content: center; gap: 4px; text-align: center;
  padding: 16px; cursor: pointer; color: var(--ink-soft);
  border: 2px dashed var(--line); border-radius: var(--r-sm);
  transition: border-color .15s, color .15s;
}
.placer-empty:hover { border-color: var(--cool); color: var(--ink); }
.placer-empty-ic { font-size: 1.9rem; }
.placer-empty p { font-size: .9rem; line-height: 1.3; }

/* The draggable / resizable QR. Square via aspect-ratio, so JS only sets width. */
.placer-qr {
  position: absolute;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 2px solid var(--pin);
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(22,38,63,.28);
  cursor: grab;
  touch-action: none;
}
.placer-qr:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255,86,48,.4), 0 6px 18px rgba(22,38,63,.28); }
.placer-stage.dragging .placer-qr { cursor: grabbing; }
.placer-qr-svg { width: 100%; height: 100%; display: block; padding: 7%; }

.placer-handle {
  position: absolute; right: -8px; bottom: -8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--pin); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(22,38,63,.45);
  cursor: nwse-resize; touch-action: none;
}
.placer-handle:hover { transform: scale(1.12); }

.placer-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.placer-readout { margin-left: auto; font-size: .76rem; color: var(--ink-faint); }

/* The 2-up mirror QR is illustrative only — no dragging. */
.placer-qr.is-mirror { cursor: default; pointer-events: none; }

/* Layout options: orientation / per-page toggles + image-padding slider. */
.placer-opts {
  display: grid; gap: 12px;
  margin-top: 4px; padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: opacity .15s;
}
.placer-opts.is-disabled { opacity: .5; pointer-events: none; }
.opt-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opt-label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.opt-val { color: var(--ink-faint); font-weight: 500; }
.opt-group .segmented { margin-left: auto; }
.opt-pad { display: grid; gap: 6px; }
.opt-pad .opt-label { display: flex; justify-content: space-between; }
.opt-pad input[type="range"] { width: 100%; accent-color: var(--pin); }
.opt-hint { margin: 0; }

.segmented {
  display: inline-flex; background: #fff;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.seg {
  appearance: none; border: 0; background: transparent;
  padding: 6px 14px; font: inherit; font-size: .82rem; font-weight: 600; line-height: 1;
  color: var(--ink-soft); cursor: pointer;
}
.seg + .seg { border-left: 1px solid var(--line); }
.seg:hover { color: var(--ink); }
.seg.is-on { background: var(--pin); color: #fff; }

/* Map */
.map-panel { padding: 0; overflow: hidden; position: relative; }
.map-panel .map-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.map-panel .map-head h2 { font-size: 1.15rem; }
#map { width: 100%; height: 440px; min-height: 360px; background: var(--paper-deep); z-index: 1; }
.map-empty {
  position: absolute; inset: 0; top: 60px; z-index: 2;
  display: grid; place-items: center; text-align: center; padding: 24px;
  pointer-events: none; color: var(--ink-soft);
}
.map-empty .ic { font-size: 2rem; margin-bottom: 8px; }
.map-legend {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .72rem; color: var(--ink-soft);
}

/* ---- Live scan activity (top map + replay) ------------------------------- */
.livemap-panel { padding: 0; overflow: hidden; }
.livemap-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 18px 22px 14px; flex-wrap: wrap;
}
.livemap-head h2 { font-size: 1.15rem; }
.livemap-head .panel-sub { margin: 4px 0 0; max-width: 62ch; }
.livemap-livebtn { display: inline-flex; align-items: center; gap: 7px; flex: none; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.livemap-livebtn.is-on { border-color: rgba(255,86,48,.45); color: var(--pin-deep); }
.livemap-livebtn.is-on .live-dot { background: var(--pin); animation: lm-blink 1.4s ease-in-out infinite; }
@keyframes lm-blink { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,86,48,.5); } 50% { opacity: .45; box-shadow: 0 0 0 5px rgba(255,86,48,0); } }

.livemap-wrap { position: relative; }
#livemap { width: 100%; height: 420px; min-height: 320px; background: var(--paper-deep); z-index: 1; }
.livemap-empty {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center;
  text-align: center; padding: 24px; pointer-events: none; color: var(--ink-soft);
}
.livemap-empty .ic { font-size: 2rem; margin-bottom: 8px; }
.livemap-ticker {
  position: absolute; left: 14px; bottom: 14px; z-index: 3; max-width: calc(100% - 28px);
  background: rgba(22,38,63,.92); color: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: .82rem; font-weight: 600;
  box-shadow: 0 8px 22px rgba(22,38,63,.28); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

/* Radar ping dropped on the map for each event (Leaflet divIcon). */
.lm-ping { pointer-events: none; }
.lm-ping i {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,86,48,.95), rgba(255,86,48,0) 70%);
}
.lm-ping i::before, .lm-ping i::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px;
  margin: -6px 0 0 -6px; border-radius: 50%;
  border: 2px solid var(--pin); animation: lm-ring 1.3s ease-out forwards;
}
.lm-ping i::after { animation-delay: .28s; }
.lm-ping--poster i { width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: radial-gradient(circle, rgba(242,169,59,.98), rgba(242,169,59,0) 70%); }
.lm-ping--poster i::before, .lm-ping--poster i::after { border-color: var(--gold); }
@keyframes lm-ring { from { transform: scale(.35); opacity: .9; } to { transform: scale(3.6); opacity: 0; } }

/* Replay control bar under the map. */
.replay-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface);
}
.replay-play { flex: none; min-width: 104px; }
.replay-scrub { flex: 1 1 220px; min-width: 180px; display: grid; gap: 4px; }
.replay-scrub input[type="range"] { width: 100%; margin: 0; }
.replay-times { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-soft); }
.replay-opt { display: flex; align-items: center; gap: 8px; flex: none; }
.replay-opt .opt-label { white-space: nowrap; }
.replay-speed { flex-direction: column; align-items: flex-start; gap: 4px; min-width: 150px; }
.replay-speed .opt-label { display: flex; gap: 8px; align-items: baseline; }
.replay-speed input[type="range"] { width: 150px; margin: 0; }
.replay-speed .opt-val { color: var(--cool-deep); font-size: .72rem; }
.lm-mute { flex: none; font-size: 1rem; line-height: 1; padding: 7px 11px; }
@media (max-width: 640px) {
  .replay-scrub { order: 5; flex-basis: 100%; }
}

/* Leaflet popup tune */
.leaflet-popup-content { font-family: var(--font-sans); margin: 12px 14px; }
.lp-title { font-weight: 700; font-size: 1rem; }
.lp-slug { font-family: var(--font-mono); font-size: .78rem; color: var(--cool-deep); }
.lp-stats { display: flex; gap: 14px; margin: 8px 0; font-family: var(--font-mono); font-size: .8rem; }
.lp-stats b { display: block; font-size: 1.1rem; color: var(--ink); }

/* Trackers list */
.t-list { display: grid; gap: 14px; }
.t-card { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; padding: 16px 18px; align-items: start; }
.t-qr { width: 76px; height: 76px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.t-qr img { width: 100%; height: 100%; }
.t-main { min-width: 0; }
.t-title { font-weight: 700; font-size: 1.08rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.t-slug { font-family: var(--font-mono); font-size: .78rem; color: var(--cool-deep); }
.t-url-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; max-width: 100%; }
.t-url {
  font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 4px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.copy-btn { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; padding: 5px 7px; color: var(--ink-soft); }
.copy-btn:hover { background: var(--paper); color: var(--ink); }
.t-stats { display: flex; gap: 18px; margin-top: 12px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink-soft); flex-wrap: wrap; }
.t-stats b { color: var(--ink); }
.t-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.t-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; }
.pill.pinned { background: rgba(44,126,140,.12); color: var(--cool-deep); border-color: rgba(44,126,140,.3); }
.pill.unpinned { background: var(--paper); color: var(--ink-faint); border-color: var(--line); }
.pill.paused { background: rgba(224,64,28,.1); color: var(--pin-deep); border-color: rgba(224,64,28,.3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* inline destination editor */
.t-dest-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.t-dest-form[hidden] { display: none; }
.t-edit-label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.t-edit-actions { display: flex; gap: 8px; }

/* UTM / campaign-tracking block (batch form + per-tracker edit) */
.utm-block { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.utm-block > summary { cursor: pointer; font-weight: 600; font-size: .9rem; list-style: none; display: flex; align-items: center; gap: 8px; }
.utm-block > summary::-webkit-details-marker { display: none; }
.utm-block > summary::before { content: "▸"; color: var(--ink-faint); display: inline-block; transition: transform .15s ease; }
.utm-block[open] > summary::before { transform: rotate(90deg); }
.utm-auto { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cool); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.utm-block .hint { margin: 8px 0 10px; }
.utm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .utm-grid { grid-template-columns: 1fr; } }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .ic { font-size: 2rem; }

/* --------------------------------------------------------------------------
   Creations ("Your posters") — saved poster designs grid
   Reuses .card, .btn, .t-slug, .t-stats, .t-url-row, .utm-block, .empty-state.
   -------------------------------------------------------------------------- */
.creations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.creations-grid .empty-state { grid-column: 1 / -1; }

.creation-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 14px; min-width: 0;
}

/* Thumbnail: artwork or stock swatch, fixed aspect, clickable (→ PDF). */
.creation-thumb {
  display: block; position: relative;
  aspect-ratio: 210 / 297;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.creation-thumb:hover { border-color: var(--cool); box-shadow: var(--ring); }
/* The thumb's aspect-ratio is set per-card to the artwork's, so the image fills
   it exactly and the QR overlay's fractions land where they print. */
.creation-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* QR overlaid on the artwork at its saved placement — a white scan target with
   a print-style dashed gutter, mirroring the landing placer's box. The element
   is positioned/sized inline (left/top/width); height follows via aspect-ratio. */
.creation-thumb-overlay {
  position: absolute; aspect-ratio: 1 / 1;
  background: #fff; border: 1.5px dashed var(--ink-soft); border-radius: 4px;
  padding: 4%; box-shadow: 0 4px 12px rgba(22,38,63,.18);
  pointer-events: none;
}
.creation-thumb-overlay svg { width: 100%; height: 100%; display: block; }

/* Stock "SCAN ME" placeholder when there's no uploaded artwork. */
.creation-thumb-stock {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 10px;
  background:
    linear-gradient(var(--paper-deep) 1px, transparent 1px) 0 0 / 100% 22px,
    linear-gradient(90deg, var(--paper-deep) 1px, transparent 1px) 0 0 / 22px 100%,
    var(--paper);
}
.creation-thumb-qr {
  width: 44%; aspect-ratio: 1 / 1; margin: 0 auto;
  background: #fff; border: 2px solid var(--pin); border-radius: 6px; padding: 6%;
  box-shadow: 0 6px 18px rgba(22,38,63,.18);
}
.creation-thumb-label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-soft); text-align: center;
}

.creation-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.creation-title { font-weight: 700; font-size: 1.04rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.creation-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Inline rename (mirrors .t-dest-form) */
.creation-rename,
.creation-dest-form { display: flex; flex-direction: column; gap: 10px; }
.creation-rename[hidden],
.creation-dest-form[hidden] { display: none; }

.creation-card .t-stats { gap: 12px; margin-top: 0; }
.creation-card .t-url-row { margin-top: 0; }
.creation-card .t-actions { justify-content: flex-start; }

/* Spotlight the saved-posters panel right after a landing-page signup, so the
   visitor immediately spots the printable-PDF button they came back for. */
#creations-panel.just-claimed {
  box-shadow: 0 0 0 2px var(--pin), var(--shadow);
  animation: claimGlow 2.4s ease-out 1;
}
@keyframes claimGlow {
  0% { box-shadow: 0 0 0 5px rgba(255,86,48,.5), var(--shadow); }
  100% { box-shadow: 0 0 0 2px var(--pin), var(--shadow); }
}
@media (prefers-reduced-motion: reduce) { #creations-panel.just-claimed { animation: none; } }

/* ==========================================================================
   MODAL (analytics + QR)
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,24,40,.55);
  backdrop-filter: blur(3px);
  display: grid; place-items: start center;
  padding: 28px 16px; overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 860px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: rise .2s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.4rem; }
.modal-head .slug { font-family: var(--font-mono); font-size: .82rem; color: var(--cool-deep); margin-top: 4px; }
.modal-close { border: 0; background: var(--paper); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1.2rem; color: var(--ink-soft); flex: none; }
.modal-close:hover { background: var(--paper-deep); color: var(--ink); }
.modal-body { padding: 24px 26px 28px; }

/* analytics innards */
.headline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.hnum { background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 14px 16px; }
.hnum .k { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.hnum .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }

.an-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.an-section-title { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 26px 0 12px; }

/* CSS bar chart (timeseries) */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 10px 2px 0; border-bottom: 1px solid var(--line); }
.chart .bar { flex: 1 1 0; min-width: 3px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart .bar .fill { width: 100%; background: linear-gradient(var(--cool), var(--cool-deep)); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.chart .bar:hover .fill { background: var(--pin); }
.chart-x { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .68rem; color: var(--ink-faint); margin-top: 6px; }

/* breakdown lists */
.bd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.bd-list { display: grid; gap: 8px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.bd-label { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-meter { grid-column: 1 / -1; height: 6px; background: var(--paper-deep); border-radius: 999px; overflow: hidden; }
.bd-meter .fill { height: 100%; background: var(--cool); border-radius: 999px; }
.bd-count { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); }

/* destination editor + history */
.dest-editor { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.dest-editor input { flex: 1 1 280px; }
.hist { display: grid; gap: 8px; }
.hist-row { font-size: .85rem; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.hist-row .ts { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-faint); }
.hist-row .urls { font-family: var(--font-mono); font-size: .8rem; word-break: break-all; }
.hist-row .arr { color: var(--pin); }

.qr-view { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.qr-view .qr-box { width: 220px; height: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; flex: none; }
.qr-view .qr-meta { min-width: 0; }
.qr-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.an-actions { display: flex; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.muted { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; padding: 56px 0 64px; }
  .hero-map { max-width: 460px; }
  .hero-sub { max-width: none; }
  .steps, .features { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .batch-layout { grid-template-columns: 1fr; gap: 22px; }
  .batch-design { max-width: 460px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .headline { grid-template-columns: 1fr 1fr; }
  .bd-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 18px; }
  .site-nav .navlink { display: none; }
  .t-card { grid-template-columns: 1fr; }
  .t-qr { width: 64px; height: 64px; }
  .t-side { align-items: flex-start; }
  .t-actions { justify-content: flex-start; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  section.band { padding: 56px 0; }
  .topbar .user-email { display: none; }
  .header-cta .user-pill { display: none; }
}

/* ==========================================================================
   LANDING BUILDER — "generate real posters before signup" (jive.html landing)
   Appended rules. Reuses the existing tokens, .card, .batch-layout, .placer*,
   .modal-*, .tabs, .auth-form, #toast — only genuinely-new surfaces are styled.
   ========================================================================== */

/* Compact hero lead above the working builder */
.hero .wrap { padding: 52px 0 84px; }
.hero-lead { max-width: 720px; margin: 0 0 36px; }
.hero-lead h1 { font-size: clamp(2.3rem, 5vw, 3.9rem); letter-spacing: -.035em; }
.hero-lead h1 .hl { color: var(--pin); }
.hero-lead .hero-sub { margin-top: 20px; max-width: 60ch; }

/* The builder is the star: a wide card holding the placer + batch fields */
.builder { padding: 26px 26px 28px; }
.builder-head { margin-bottom: 20px; }
.builder-head h2 { font-size: 1.5rem; }
.builder-head .panel-sub { color: var(--ink-soft); font-size: .96rem; margin-top: 6px; max-width: 64ch; }
.builder-note {
  background: var(--paper); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: 10px 12px; line-height: 1.45;
}
.builder .batch-fields #b-generate { margin-top: 4px; }

/* ----- Done: progress bar → DONE → sign-up-to-download ----- */
.done-band {
  background:
    radial-gradient(820px 460px at 88% -12%, rgba(44,126,140,.12), transparent 60%),
    radial-gradient(680px 460px at 6% 116%, rgba(255,86,48,.1), transparent 60%),
    var(--paper-deep);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.done-card { max-width: 620px; margin: 0 auto; text-align: center; padding: 34px 32px 38px; }

/* The progress bar that fills as the PDF builds, then reads DONE */
.done-bar {
  height: 14px; width: 100%; margin: 14px 0 12px;
  background: var(--paper-deep); border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
}
.done-fill {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cool), var(--gold) 55%, var(--pin));
  border-radius: 999px;
}
.done-status {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; color: var(--ink-soft);
  transition: color .2s;
}
.done-progress.is-done .done-status { color: var(--cool-deep); font-weight: 700; letter-spacing: .2em; }
.done-progress.is-done .done-status::before { content: "✓ "; }

/* The sign-up-to-download prompt, revealed once the bar completes */
.done-cta { margin-top: 26px; }
.done-cta h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.done-cta p { margin: 12px auto 22px; max-width: 46ch; color: var(--ink-soft); font-size: 1.05rem; }

/* Closing CTA — two buttons */
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Auth modal sits narrower than the analytics modal */
.auth-modal-card { max-width: 440px; }
.auth-modal-card .modal-body .tabs { margin-bottom: 20px; }
.auth-modal-card .auth-form { display: grid; gap: 16px; }

/* Landing responsive */
@media (max-width: 620px) {
  .builder { padding: 20px 16px 22px; }
}
