:root {
  --bg: #000000;
  --bg-elev: #08080c;
  --bg-card: #0f0f16;
  --fg: #f5f5f7;
  --fg-dim: #9999a8;
  --accent: #ff5a36;
  --accent-2: #ffb84d;
  --accent-3: #4dd0ff;
  --good: #5af0a0;
  --warn: #ffb84d;
  --danger: #ff5a36;
  --radius: 16px;
  --radius-sm: 8px;
  --space: 16px;
  --max-w: 1100px;
  --font-display: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-3); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.ghost { background: transparent; border: 1px solid var(--fg-dim); color: var(--fg); }
.btn.ghost:hover { background: rgba(255,255,255,.06); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ========= NAV ========= */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
.nav .logo { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.nav .logo span { color: var(--accent); }
.nav .links { display: flex; gap: 4px; margin-left: auto; }
.nav .links a {
  color: var(--fg-dim); padding: 6px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 500;
}
.nav .links a:hover { color: var(--fg); background: rgba(255,255,255,.06); text-decoration: none; }
.nav .links a.active { color: var(--fg); background: rgba(255,255,255,.08); }

/* ========= INDEX / UPLOAD ========= */
.hero {
  max-width: var(--max-w); margin: 0 auto; padding: 80px 20px 40px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: 16px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 18px; color: var(--fg-dim); max-width: 560px; margin: 0 auto; }

.upload-zone {
  max-width: 700px; margin: 40px auto 0; padding: 60px 24px;
  border: 2px dashed rgba(255,255,255,.12);
  border-radius: var(--radius);
  background: var(--bg-elev);
  text-align: center;
  transition: border-color .2s ease, background .2s ease;
}
.upload-zone.drag { border-color: var(--accent); background: rgba(255,90,54,.06); }
.upload-zone .icon { font-size: 48px; margin-bottom: 8px; }
.upload-zone h2 { font-size: 22px; margin-bottom: 8px; }
.upload-zone p { color: var(--fg-dim); margin-bottom: 20px; }
.upload-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
input[type=file] { display: none; }

.progress {
  margin: 24px auto 0; max-width: 700px;
  background: var(--bg-elev); border-radius: var(--radius);
  padding: 20px; display: none;
}
.progress.active { display: block; }
.progress .bar { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.progress .bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .15s ease; }
.progress .label { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }
.progress .label .right { color: var(--fg-dim); }

.feature-grid {
  max-width: var(--max-w); margin: 80px auto 0; padding: 0 20px;
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  background: var(--bg-card); padding: 28px 24px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.04);
}
.feature .ico { font-size: 32px; margin-bottom: 12px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--fg-dim); font-size: 14px; }

footer { text-align: center; padding: 60px 20px 40px; color: var(--fg-dim); font-size: 13px; }

/* ========= DASHBOARD (scroll-snap card reel) ========= */
/* Lock the page to the viewport so only .reel scrolls — otherwise on mobile
   both <body> and .reel compete for the touch, snap misaligns, and
   currentSlideIndex() reads 0 because reel.scrollTop never moves. */
body.reel-mode {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}
body.reel-mode .nav {
  position: fixed; top: 0; left: 0; right: 0;
}

.reel {
  scroll-snap-type: y mandatory;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  height: 100vh;
  height: 100dvh;
}
.slide {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 80px 24px 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  position: relative;
}
.slide-inner { max-width: 720px; width: 100%; }
.slide .eyebrow {
  text-transform: uppercase; letter-spacing: .15em; font-size: 12px;
  color: var(--fg-dim); margin-bottom: 16px; font-weight: 600;
}
.slide h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.05; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 24px;
}
.slide .big-num {
  font-family: var(--font-display);
  font-size: clamp(72px, 18vw, 200px);
  line-height: 1; letter-spacing: -0.04em; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 12px 0;
}
.slide .unit { font-size: .35em; color: var(--fg-dim); font-weight: 600; margin-left: 8px; -webkit-text-fill-color: var(--fg-dim); }
.slide .sub { color: var(--fg-dim); font-size: 17px; margin-top: 12px; }

.slide.tinted-1 { background: radial-gradient(ellipse at top, rgba(255,90,54,.18), transparent 60%); }
.slide.tinted-2 { background: radial-gradient(ellipse at top, rgba(255,184,77,.16), transparent 60%); }
.slide.tinted-3 { background: radial-gradient(ellipse at top, rgba(77,208,255,.18), transparent 60%); }
.slide.tinted-4 { background: radial-gradient(ellipse at top, rgba(90,240,160,.14), transparent 60%); }
.slide.tinted-5 { background: radial-gradient(ellipse at top, rgba(255,90,54,.15), rgba(77,208,255,.12) 60%); }

.kv-row { display: flex; gap: 32px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.kv { text-align: center; }
.kv .v { font-family: var(--font-display); font-size: clamp(28px, 5vw, 44px); font-weight: 800; }
.kv .k { color: var(--fg-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; margin: 32px auto; max-width: 600px; }
.bars .bar {
  flex: 1; min-height: 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 4px 4px 0 0; position: relative;
}
.bars .bar .lbl { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--fg-dim); }
.bars-wrap { padding-bottom: 30px; }

.heatmap { display: grid; gap: 4px; max-width: 600px; margin: 24px auto; }
.heatmap.h24 { grid-template-columns: repeat(24, 1fr); }
.heatmap .cell {
  aspect-ratio: 1; border-radius: 3px; background: rgba(255,255,255,.05);
}
.hour-labels { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; max-width: 600px; margin: 0 auto; }
.hour-labels span { text-align: center; font-size: 10px; color: var(--fg-dim); }

.dow-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 600px; margin: 24px auto; }
.dow-bars .day { text-align: center; }
.dow-bars .day .bar { width: 100%; background: rgba(255,255,255,.08); border-radius: 6px; overflow: hidden; height: 120px; display: flex; align-items: flex-end; }
.dow-bars .day .bar .fill { width: 100%; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 6px 6px 0 0; }
.dow-bars .day .lbl { font-size: 12px; color: var(--fg-dim); margin-top: 6px; }
.dow-bars .day .v { font-size: 13px; font-weight: 600; margin-top: 2px; }

.mini-map {
  width: 100%; max-width: 600px; height: 280px;
  margin: 24px auto; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-elev); border: 1px solid rgba(255,255,255,.06);
}

.scroll-hint {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: var(--fg-dim); font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50% { transform: translate(-50%, 6px); opacity: 1; }
}

/* ========= SAVE-AS-IMAGE FAB ========= */
/* z-index must beat Leaflet's panes (popup pane is 700) on the map page. */
.save-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.save-fab .main-btn {
  background: transparent;
  border: none; padding: 10px 12px;
  font-size: 40px; line-height: 1;
  /* Double drop-shadow acts like a dark outline so the emoji stays readable
     on top of CARTO dark_all tiles (which are almost black). */
  filter: drop-shadow(0 0 3px rgba(0,0,0,.9)) drop-shadow(0 2px 8px rgba(0,0,0,.6));
  transition: transform .15s ease, filter .15s ease;
  touch-action: manipulation;
}
.save-fab .main-btn:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 0 4px rgba(0,0,0,1)) drop-shadow(0 4px 12px rgba(0,0,0,.8));
}
.save-fab .menu {
  display: none; flex-direction: column; gap: 6px;
  background: var(--bg-card); padding: 8px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,.08); min-width: 180px;
  box-shadow: 0 10px 24px rgba(0,0,0,.4);
}
.save-fab.open .menu { display: flex; }
.save-fab .menu button {
  padding: 10px 14px; border-radius: var(--radius-sm); text-align: left;
  font-size: 14px; font-weight: 500;
  transition: background .15s ease;
}
.save-fab .menu button:hover { background: rgba(255,255,255,.08); }
.save-fab .menu button:disabled { opacity: .55; cursor: not-allowed; }
.save-fab .toast {
  position: absolute; bottom: 68px; right: 0;
  background: rgba(0,0,0,.8); color: #fff; padding: 8px 14px;
  border-radius: 999px; font-size: 13px; white-space: nowrap;
  opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
.save-fab .toast.show { opacity: 1; }

/* ---- In-capture overrides ----
   html2canvas can't render `background-clip: text`, so gradient-filled text
   would come out as a solid box. We swap to a plain accent color while
   capturing. The `.capturing` class is only added to the *cloned* document
   via html2canvas's onclone hook, so the live page never flickers. */
.capturing .save-fab,
.capturing .scroll-hint,
.capturing .nav { display: none !important; }

.capturing .big-num,
.capturing .grad,
.capturing [style*="background-clip"] {
  background: none !important;
  background-image: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}
.capturing .big-num .unit {
  color: var(--fg-dim) !important;
  -webkit-text-fill-color: var(--fg-dim) !important;
}

/* ========= MAP PAGE ========= */
.map-shell { display: flex; height: calc(100vh - 53px); }
.map-side {
  width: 320px; flex-shrink: 0; background: var(--bg-elev);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto; padding: 16px;
}
.map-side h3 {
  font-size: 14px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--fg-dim); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.map-side h3::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255,90,54,.5);
}

.map-side .summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.map-side .summary .item {
  background: var(--bg-card); padding: 12px; border-radius: var(--radius-sm);
}
.map-side .summary .item:nth-child(1) .v { color: var(--accent); }
.map-side .summary .item:nth-child(2) .v { color: var(--accent-2); }
.map-side .summary .item:nth-child(3) .v { color: var(--accent-3); }
.map-side .summary .item:nth-child(4) .v { color: var(--good); }
.map-side .summary .item .v { font-weight: 700; font-size: 18px; }
.map-side .summary .item .k { font-size: 11px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .08em; }

.map-side .toggles { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.map-side .toggle {
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.06); font-size: 13px;
  transition: background .15s ease, box-shadow .15s ease;
}
.map-side .toggle.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; box-shadow: 0 2px 10px rgba(255,90,54,.35);
}

#trackHeader { gap: 4px; }
.info-tip {
  position: relative; display: inline-flex; align-items: center;
  cursor: help; outline: none;
}
.info-tip .info-ico {
  width: 12px; height: 12px; border-radius: 50%;
  background: transparent; color: var(--fg-dim);
  border: 1px solid currentColor;
  font-size: 9px; font-weight: 700; font-family: serif; font-style: italic;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; letter-spacing: 0; text-transform: none;
  transition: color .15s ease;
}
.info-tip:hover .info-ico,
.info-tip:focus .info-ico {
  color: var(--fg);
}
.info-tip .info-pop {
  position: fixed;
  width: 240px; max-width: calc(100vw - 24px); padding: 10px 12px;
  background: var(--bg-card); color: var(--fg);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.5; font-weight: 400;
  letter-spacing: normal; text-transform: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 9999; pointer-events: none;
}
.info-tip:hover .info-pop,
.info-tip:focus .info-pop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.map-side .track-list { display: flex; flex-direction: column; gap: 4px; }
.map-side .track-item {
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-card); cursor: pointer;
  border-left: 3px solid rgba(255,90,54,.35);
  display: flex; flex-direction: column; gap: 2px;
  transition: background .15s ease, border-left-color .15s ease, transform .15s ease;
}
.map-side .track-item:hover {
  background: rgba(255,255,255,.08);
  border-left-color: var(--accent);
  transform: translateX(2px);
}
.map-side .track-item.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-left-color: var(--accent-3);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255,90,54,.28);
}
.map-side .track-item .name { font-size: 13px; font-weight: 600; }
.map-side .track-item .meta { font-size: 11px; color: var(--fg-dim); }
.map-side .track-item.active .meta { color: rgba(255,255,255,.9); }

/* Custom scrollbar so the sidebar picks up the palette too */
.map-side::-webkit-scrollbar { width: 8px; }
.map-side::-webkit-scrollbar-track { background: transparent; }
.map-side::-webkit-scrollbar-thumb { background: rgba(255,90,54,.3); border-radius: 4px; }
.map-side::-webkit-scrollbar-thumb:hover { background: rgba(255,90,54,.55); }

#leaflet-map { flex: 1; }
.leaflet-container { background: #0a0a12; }

/* Leaflet dark tweaks */
.leaflet-control-attribution { background: rgba(0,0,0,.6) !important; color: var(--fg-dim) !important; }
.leaflet-control-attribution a { color: var(--accent-3) !important; }

/* ========= MAP OVERVIEW POSTER (rendered off-screen, captured by html2canvas) =========
   The element is positioned at left: -99999px so it's laid out (height: auto,
   flex works) but never visible. html2canvas rasterises it via its own clone.
   16:9 landscape — info panel on the left, map hero on the right. */
.poster {
  position: fixed; left: -99999px; top: 0;
  background: radial-gradient(ellipse at top left, #0f0f16 0%, #000000 55%);
  color: var(--fg);
  font-family: var(--font-body);
  box-sizing: border-box;
}
.poster.landscape {
  width: 1920px; height: 1080px;
  display: grid;
  grid-template-columns: 680px 1fr;
}
.poster .poster-left {
  padding: 56px 48px 40px;
  display: flex; flex-direction: column;
  gap: 32px;
  border-right: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.poster .poster-left::before {
  content: '';
  position: absolute; top: 0; left: 48px; right: 48px;
  height: 4px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--good));
}
.poster .poster-head { display: flex; flex-direction: column; gap: 20px; }
.poster .brand-row { display: flex; justify-content: space-between; align-items: baseline; }
.poster .brand {
  font-family: var(--font-display);
  font-weight: 800; font-size: 26px; letter-spacing: -0.02em;
}
.poster .brand span { color: var(--accent); margin: 0 3px; }
.poster .date-range { font-size: 18px; color: var(--fg-dim); }
.poster h1 {
  font-family: var(--font-display);
  font-size: 96px; font-weight: 900; letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--accent);
}
.poster h1 .dim { color: var(--fg); }

.poster-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-content: start;
}
.poster-stats .stat {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-left: 4px solid;
  border-radius: var(--radius);
  padding: 20px 22px;
}
.poster-stats .stat:nth-child(1) { grid-column: 1 / -1; padding: 26px 24px; }
.poster-stats .stat:nth-child(1) { border-left-color: var(--accent); }
.poster-stats .stat:nth-child(2) { border-left-color: var(--accent-2); }
.poster-stats .stat:nth-child(3) { border-left-color: var(--accent-3); }
.poster-stats .stat:nth-child(4) { border-left-color: var(--good); }
.poster-stats .stat:nth-child(5) { border-left-color: #b28bff; }
.poster-stats .stat:nth-child(1) .v { color: var(--accent); }
.poster-stats .stat:nth-child(2) .v { color: var(--accent-2); }
.poster-stats .stat:nth-child(3) .v { color: var(--accent-3); }
.poster-stats .stat:nth-child(4) .v { color: var(--good); }
.poster-stats .stat:nth-child(5) .v { color: #b28bff; }
.poster-stats .v {
  font-family: var(--font-display);
  font-size: 36px; font-weight: 800;
  line-height: 1;
}
.poster-stats .stat:nth-child(1) .v { font-size: 60px; }
.poster-stats .v .unit {
  font-size: 16px; color: var(--fg-dim); margin-left: 6px; font-weight: 600;
}
.poster-stats .stat:nth-child(1) .v .unit { font-size: 20px; }
.poster-stats .k {
  font-size: 13px; color: var(--fg-dim);
  text-transform: uppercase; letter-spacing: .1em;
  margin-top: 10px;
}

.poster-map {
  margin: 40px 40px 40px 28px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: #08080c;
  box-shadow: 0 0 60px rgba(255,90,54,.1), 0 20px 60px rgba(0,0,0,.4);
}
.poster-footer {
  color: var(--fg-dim);
  font-size: 14px; letter-spacing: .06em;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* ========= EXPORT OVERRIDES =========
   Viewer slides use viewport-proportional `clamp()` sizes that look fine on a
   phone but feel timid when rendered into the fixed 1080×1920 export canvas.
   These rules only apply inside html2canvas's clone (body gets `.capturing`)
   *and* only to the slide being exported (`data-export-target="1"`), so the
   live reel isn't affected. */
.capturing .slide[data-export-target="1"] .slide-inner { max-width: 960px; }
.capturing .slide[data-export-target="1"] .eyebrow {
  font-size: 22px; letter-spacing: .22em; margin-bottom: 28px;
}
.capturing .slide[data-export-target="1"] h2 {
  font-size: 80px; line-height: 1.35; margin-bottom: 36px;
}
.capturing .slide[data-export-target="1"] .big-num {
  font-size: 240px; margin: 24px 0;
}
.capturing .slide[data-export-target="1"] .unit { font-size: .32em; }
.capturing .slide[data-export-target="1"] .sub { font-size: 28px; margin-top: 28px; }
.capturing .slide[data-export-target="1"] .kv-row { gap: 64px; margin-top: 44px; }
.capturing .slide[data-export-target="1"] .kv .v { font-size: 72px; }
.capturing .slide[data-export-target="1"] .kv .k { font-size: 18px; margin-top: 8px; }
.capturing .slide[data-export-target="1"] .heatmap,
.capturing .slide[data-export-target="1"] .hour-labels {
  max-width: 960px; gap: 6px;
}
.capturing .slide[data-export-target="1"] .hour-labels span { font-size: 18px; }
.capturing .slide[data-export-target="1"] .bars {
  max-width: 960px; height: 380px; gap: 6px;
}
.capturing .slide[data-export-target="1"] .bars .bar .lbl {
  font-size: 18px; bottom: -32px;
}
.capturing .slide[data-export-target="1"] .bars-wrap { padding-bottom: 44px; }
.capturing .slide[data-export-target="1"] .dow-bars {
  max-width: 960px; gap: 14px;
}
.capturing .slide[data-export-target="1"] .dow-bars .day .bar { height: 280px; }
.capturing .slide[data-export-target="1"] .dow-bars .day .lbl { font-size: 22px; margin-top: 10px; }
.capturing .slide[data-export-target="1"] .dow-bars .day .v { font-size: 22px; }

/* Hero arrow between the two date lines — match the live page look: same
   display font weight as the h2 itself, just slightly dimmed so the dates win. */
.capturing .slide[data-export-target="1"] h2 .hero-arrow {
  display: inline-block;
  font-size: 1em;
  line-height: 1;
  color: var(--fg);
  -webkit-text-fill-color: var(--fg);
}

/* slideHours — heatmap is small-ish, so the caption does the heavy lifting; bump it. */
.capturing .slide[data-export-target="1"].hours-slide h2 {
  font-size: 104px; line-height: 1.15;
}
.capturing .slide[data-export-target="1"].hours-slide .sub { font-size: 34px; margin-top: 36px; }
.capturing .slide[data-export-target="1"].hours-slide .hour-labels span { font-size: 22px; }
.capturing .slide[data-export-target="1"].hours-slide .heatmap .cell {
  aspect-ratio: auto; height: 52px;
}

/* slideEarlyLate has no .big-num — its kv pair IS the hero, so pump the size. */
.capturing .slide[data-export-target="1"].early-late .kv-row { gap: 96px; margin-top: 56px; }
.capturing .slide[data-export-target="1"].early-late .kv .v { font-size: 140px; line-height: 1; }
.capturing .slide[data-export-target="1"].early-late .kv .k { font-size: 26px; margin-top: 14px; }
.capturing .slide[data-export-target="1"].early-late .sub { font-size: 28px; margin-top: 44px; }

/* Portrait A — title+stats on top, map hero below. 1080×1920. */
.poster.portrait-split {
  width: 1080px; height: 1920px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.poster.portrait-split .poster-top {
  padding: 56px 48px 28px;
  display: flex; flex-direction: column; gap: 24px;
  position: relative;
}
.poster.portrait-split .poster-top::before {
  content: ''; position: absolute; top: 0; left: 48px; right: 48px;
  height: 4px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3), var(--good));
}
.poster.portrait-split h1 { font-size: 84px; }
.poster.portrait-split .poster-stats {
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.poster.portrait-split .poster-stats .stat { padding: 18px 16px; }
.poster.portrait-split .poster-stats .stat:nth-child(1) { grid-column: auto; padding: 18px 16px; }
.poster.portrait-split .poster-stats .v { font-size: 30px; }
.poster.portrait-split .poster-stats .stat:nth-child(1) .v { font-size: 34px; }
.poster.portrait-split .poster-stats .v .unit { font-size: 14px; }
.poster.portrait-split .poster-stats .stat:nth-child(1) .v .unit { font-size: 16px; }
.poster.portrait-split .poster-stats .k { font-size: 11px; margin-top: 8px; }
.poster.portrait-split .poster-map {
  margin: 8px 48px 16px;
  border-radius: 20px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: #08080c;
  box-shadow: 0 0 60px rgba(255,90,54,.1), 0 20px 60px rgba(0,0,0,.4);
}
.poster.portrait-split .poster-footer {
  margin: 0; padding: 16px 48px 28px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Portrait B — map fills the canvas, stats float on a gradient band. 1080×1920. */
.poster.portrait-fill {
  width: 1080px; height: 1920px;
  position: fixed; left: -99999px; top: 0;
}
.poster.portrait-fill .poster-map {
  position: absolute; inset: 0;
  margin: 0; border-radius: 0; border: none; box-shadow: none;
  background: #08080c;
}
/* Single overlay block anchored to the bottom-right: brand → title → stats → footer,
   stacked top-to-bottom, right-aligned, no background — text sits directly on the map. */
.poster.portrait-fill .poster-overlay {
  position: absolute; right: 0; bottom: 0;
  width: 720px; max-width: 80%;
  padding: 56px 48px 56px;
  background: none;
  display: flex; flex-direction: column; gap: 22px;
  text-align: right;
}
.poster.portrait-fill .poster-overlay .brand-row {
  justify-content: flex-end; gap: 20px;
}
.poster.portrait-fill h1 { font-size: 76px; line-height: 1; margin: 0; }
.poster.portrait-fill .poster-stats {
  display: flex; flex-direction: column;
  grid-template-columns: none;
  gap: 10px;
}
.poster.portrait-fill .poster-stats .stat {
  grid-column: auto;
  background: transparent;
  border: none; border-right: 3px solid;
  border-radius: 0;
  padding: 6px 16px 6px 0;
  display: flex; justify-content: flex-end; align-items: baseline;
  gap: 14px;
}
.poster.portrait-fill .poster-stats .stat:nth-child(1) { padding: 6px 16px 6px 0; }
.poster.portrait-fill .poster-stats .k {
  order: 1; width: auto; flex: 0 0 auto;
  font-size: 14px; margin-top: 0;
}
.poster.portrait-fill .poster-stats .v {
  order: 2; flex: 0 0 auto; text-align: right;
  font-size: 40px;
}
.poster.portrait-fill .poster-stats .stat:nth-child(1) .v { font-size: 40px; }
.poster.portrait-fill .poster-stats .v .unit { font-size: 16px; }
.poster.portrait-fill .poster-stats .stat:nth-child(1) .v .unit { font-size: 16px; }
.poster.portrait-fill .poster-footer {
  margin: 0; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
  text-align: right;
}

/* ========= EMPTY STATES ========= */
.empty {
  text-align: center; padding: 120px 24px;
  max-width: 480px; margin: 0 auto;
}
.empty .ico { font-size: 56px; margin-bottom: 16px; }
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--fg-dim); margin-bottom: 24px; }

@media (max-width: 700px) {
  .map-shell { flex-direction: column; height: calc(100vh - 53px); }
  .map-side { width: 100%; max-height: 40vh; border-right: none; border-bottom: 1px solid rgba(255,255,255,.06); }
  .nav .logo { font-size: 16px; }

  /* Dashboard reel: tighter padding, smaller numbers, chart heights that fit */
  .slide { padding: 72px 16px 48px; }
  .slide h2 { font-size: clamp(26px, 7vw, 40px); margin-bottom: 16px; }
  .slide .big-num { font-size: clamp(56px, 22vw, 110px); margin: 8px 0; }
  .slide .sub { font-size: 15px; }
  .kv-row { gap: 20px; margin-top: 16px; }
  .kv .v { font-size: clamp(24px, 7vw, 32px); }
  .bars { height: 160px; margin: 24px auto; }
  .dow-bars { gap: 6px; margin: 20px auto; }
  .dow-bars .day .bar { height: 100px; }
  .mini-map { height: 220px; margin: 16px auto; }
  .heatmap, .hour-labels { max-width: 100%; }
  .hour-labels span { font-size: 9px; }

  /* Save FAB: tuck to corner, smaller emoji */
  .save-fab { bottom: 16px; right: 16px; }
  .save-fab .main-btn { font-size: 34px; padding: 4px 6px; }
  .save-fab .toast { bottom: 56px; font-size: 12px; }
}
