/* ================================================================
   Field Mirror — Application Styles
   ================================================================ */

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

:root {
  --bg: #fafafa;
  --text: #074835;
  --text-dim: #888;
  --text-light: #bbb;
  --border: #e4e4e4;

  --field-green: #26B464;
  --field-green-dark: #074835;

  /* Chip dimension colors */
  --c-scale: #6366f1;
  --c-scale-bg: #eef2ff;
  --c-geo: #0891b2;
  --c-geo-bg: #ecfeff;
  --c-issue: #d97706;
  --c-issue-bg: #fffbeb;
  --c-pop: #e11d48;
  --c-pop-bg: #fff1f2;
  --c-source: #6b7280;
  --c-source-bg: #f3f4f6;

  --match: var(--field-green);
  --accent: #3b82f6;
  --rest: #b0b0b0;

  /* Scale tier warm palette (browse mode) */
  --tier-grassroots: #f97316;
  --tier-small: #fb923c;
  --tier-mid: #fbbf24;
  --tier-large: #a78bfa;
  --tier-major: #6366f1;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}


/* ================================================================
   LAYOUT
   ================================================================ */

.page {
  display: grid;
  grid-template-columns: 45% 55%;
  height: 100vh;
  position: relative;
  transition: grid-template-columns 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.page.collapsed {
  grid-template-columns: 48px 1fr;
}

.left {
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: #f5f5f4;
}
.page.collapsed .left {
  padding: 16px 8px;
}
.page.collapsed .left > *:not(.collapse-btn) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.page:not(.collapsed) .left > *:not(.collapse-btn) {
  opacity: 1;
  transition: opacity 0.3s 0.15s;
}

.right {
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}


/* ================================================================
   MADLIB — Lead line
   ================================================================ */

.madlib-lead {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 32px;
  font-weight: 500;
}


/* ================================================================
   MADLIB — Sentence
   ================================================================ */

.madlib-sentence {
  font-size: 26px;
  font-weight: 300;
  line-height: 2.2;
  color: var(--text);
  letter-spacing: -0.01em;
}

.chip-slot {
  display: inline;
}

.sentence-stem {
  font-weight: 400;
}
.sentence-text {
  font-weight: 300;
}
.sentence-ellipsis {
  color: var(--text-light);
  font-weight: 300;
  letter-spacing: 0.1em;
}

.madlib-add-chips {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.madlib-add-chips .add-chip {
  font-size: 13px;
  padding: 2px 12px;
  opacity: 0.4;
  transition: opacity 0.15s;
}
.madlib-add-chips .add-chip:hover {
  opacity: 0.7;
}


/* ================================================================
   CHIPS
   ================================================================ */

.chip {
  display: inline-block;
  padding: 3px 16px;
  border-radius: 999px;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  vertical-align: baseline;
  line-height: 1.4;
  user-select: none;
  animation: chip-appear 200ms ease-out;
}

@keyframes chip-appear {
  from { transform: scale(0.9); opacity: 0.5; }
  to   { transform: scale(1); opacity: 1; }
}

.chip:hover { opacity: 0.85; }

.chip.placeholder {
  border-style: dashed;
  font-weight: 300;
}

/* All chips: grey when placeholder, outlined green when selected */
.chip:not(.placeholder) {
  background: transparent;
  color: var(--field-green-dark);
  border-color: var(--field-green);
}
.chip.placeholder {
  background: transparent;
  color: var(--text-light);
  border-color: var(--text-light);
  opacity: 0.5;
}

.chip .x {
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.4;
  font-weight: 300;
}
.chip:hover .x { opacity: 1; }


/* ================================================================
   CHIP DEFINITION TOOLTIP
   ================================================================ */

.chip-definition {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 300;
  min-height: 20px;
  margin-top: 8px;
  transition: opacity 0.3s;
}
.chip-definition.fading { opacity: 0; }


/* ================================================================
   CLEAR ALL
   ================================================================ */

.clear-all {
  margin-top: 20px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 13px;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  display: none;
  text-align: left;
  align-self: flex-start;
}
.clear-all.visible {
  display: block;
}
.clear-all:hover { color: var(--text-dim); }


/* ================================================================
   COLLAPSE BUTTON
   ================================================================ */

.collapse-btn {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 40px;
  height: 80px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-light);
  font-family: inherit;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  z-index: 10;
}
.collapse-btn:hover {
  color: var(--text);
}
.page.collapsed .collapse-btn {
  right: auto;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* ================================================================
   PICKER
   ================================================================ */

.picker-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
}
.picker-overlay.open { display: block; }

.picker {
  position: fixed;
  z-index: 1000;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  max-height: 360px;
  overflow-y: auto;
  min-width: 220px;
  display: none;
}
.picker.open { display: block; }

.picker-item {
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.picker-item:hover { background: #f5f5f5; }
.picker-item.selected { font-weight: 500; }

.picker-item .check {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}
.picker-item.selected .check {
  border-color: currentColor;
  background: currentColor;
}
.picker-item.selected .check::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}

/* Source picker uses radio style (single select) */
.picker-item.radio .check {
  border-radius: 50%;
}


/* ================================================================
   MODE TABS
   ================================================================ */

/* ----------------------------------------------------------------
   DOT NAVIGATION
   ---------------------------------------------------------------- */

.mode-dots {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 100;
}

.mode-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--text-light);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s;
  position: relative;
}
.mode-dot:hover {
  border-color: var(--text);
  transform: scale(1.3);
}
.mode-dot.active {
  background: var(--text);
  border-color: var(--text);
}

/* Tooltip on hover */
.mode-dot::before {
  content: attr(title);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(7,72,53,0.9);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.mode-dot:hover::before {
  opacity: 1;
}


/* ================================================================
   VIZ AREA
   ================================================================ */

.viz-area {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.viz-area::-webkit-scrollbar { display: none; }

.mode-panel {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  padding: 110px 40px 24px;
  position: relative;
}

.mode-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 24px 40px 20px;
  background: linear-gradient(to bottom, var(--bg) 70%, transparent);
  text-align: left;
}
.mode-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--field-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}
.mode-subtitle {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.5;
  max-width: none;
}


/* ================================================================
   INSIGHT LINE
   ================================================================ */

.insight-line {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-dim);
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
  max-width: 500px;
}


/* ================================================================
   MODE 1: PROPORTION — Stacked Bar
   ================================================================ */

.proportion-viz {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stacked-bar {
  width: 220px;
  height: min(420px, 55vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bar-match {
  background: var(--match);
  transition: flex 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 4px;
}

.bar-rest {
  background: var(--rest);
  transition: flex 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 4px;
}

.bar-label {
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  text-align: center;
  padding: 8px;
  opacity: 0;
  transition: opacity 0.3s;
}
.bar-label.visible { opacity: 1; }
.bar-rest .bar-label { color: var(--text-dim); }

.bar-label-amount {
  font-size: 20px;
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

.bar-label-count {
  font-size: 11px;
  font-weight: 300;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.punchline {
  margin-top: 24px;
  text-align: center;
}

.punchline-pct {
  font-size: 56px;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -2px;
  transition: color 0.3s;
}
.punchline-pct.is-all { color: var(--text-light); }

.punchline-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}


/* ================================================================
   MODE 2: GEOGRAPHY
   ================================================================ */

.geography-viz {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.geo-map-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 4px;
  overflow: hidden;
  touch-action: none;
}

/* Leaflet overrides for clean look */
.geo-map-container .leaflet-container {
  background: transparent;
  font-family: 'Poppins', sans-serif;
  touch-action: none;
}
.geo-map-container .leaflet-control-attribution { display: none; }
.geo-map-container .leaflet-control-zoom { display: none; }

.geo-tooltip {
  font-family: 'Poppins', sans-serif !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
  padding: 8px 12px !important;
}
.geo-tooltip strong {
  font-weight: 500;
}
.geo-tooltip .geo-tt-amount {
  color: var(--field-green);
  font-weight: 500;
}
.geo-tooltip .geo-tt-pops {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 2px;
}

.geo-side-summary {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  z-index: 400;
  max-width: 50%;
}

.geo-side-block {
  padding: 3px 8px;
  text-align: center;
  border: 1px solid var(--border);
  background: #fff;
  transition: background-color 0.4s ease, border-color 0.4s ease;
  min-width: 0;
}
.geo-side-block .label {
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.geo-side-block .value {
  font-size: 10px;
  font-weight: 400;
  color: var(--text);
  margin-top: 0;
}


/* ================================================================
   MODE 3: SCATTER — Who are you betting on?
   ================================================================ */

.scatter-viz {
  width: 100%;
  display: flex;
  justify-content: center;
}

.scatter-svg {
  width: 100%;
  max-width: 600px;
  height: 500px;
}

.scatter-dot {
  transition: fill 0.4s ease, opacity 0.4s ease;
}

.scatter-axis-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  fill: var(--text-dim);
}

.scatter-tier-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.scatter-tier-def {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 300;
  fill: var(--text-light);
}


/* ================================================================
   MODE 4: WEIGHT — How heavy is your dollar?
   ================================================================ */

.weight-viz {
  width: 100%;
  display: flex;
  justify-content: center;
}

.weight-svg {
  width: 100%;
  max-width: 640px;
  height: 500px;
}

.weight-dot {
  transition: fill 0.4s ease, opacity 0.4s ease;
}

.weight-grid {
  stroke: var(--border);
  stroke-dasharray: 2 3;
  opacity: 0.5;
}

.weight-grid-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 400;
  fill: var(--text-light);
}

.weight-tier-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  fill: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.weight-tier-def {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 300;
  fill: var(--text-light);
}

.weight-axis-label {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 400;
  fill: var(--text-dim);
  letter-spacing: 0.12em;
}

.weight-tooltip {
  position: fixed;
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 800;
  pointer-events: none;
  font-size: 12px;
  line-height: 1.5;
  display: none;
}
.weight-tooltip.visible { display: block; }


/* ================================================================
   MODE 5: CONSTELLATION — What connects?
   ================================================================ */

.constellation-viz {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
}

.constellation-svg {
  width: 100%;
  max-width: 660px;
  height: 100%;
  max-height: 100%;
}

.issue-bar-label {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 400;
  fill: var(--text);
  transition: fill 0.3s;
}

.issue-bar-bg, .issue-bar-match {
  transition: width 0.4s ease, fill 0.4s ease, opacity 0.4s ease;
}

.issue-bar-value {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  fill: var(--text-dim);
}


/* ================================================================
   RECEIPT MODAL
   ================================================================ */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 499;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 440px;
  max-height: 85vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.18);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: 'Courier New', 'Courier', monospace;
  display: flex;
  flex-direction: column;
}
.drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.drawer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 18px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  z-index: 2;
}
.drawer-close:hover { color: #333; }

/* Receipt header — sticky top */
.receipt-header {
  text-align: center;
  padding: 28px 24px 16px;
  border-bottom: 2px dashed #ccc;
  flex-shrink: 0;
}
.receipt-logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #333;
  margin-bottom: 4px;
}
.receipt-subtitle {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.04em;
}

.drawer-title {
  font-size: 11px;
  font-weight: 400;
  color: #999;
  text-align: center;
  padding: 10px 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

/* Receipt items — scrollable middle */
.grant-list {
  padding: 4px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.receipt-separator {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 8px 0;
}

.grant-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 0;
  gap: 8px;
}
.grant-item:hover { background: rgba(0,0,0,0.02); }

.grant-name {
  font-weight: 400;
  font-size: 11px;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #333;
  text-transform: uppercase;
}

.grant-dots {
  flex: 1;
  min-width: 16px;
  border-bottom: 1px dotted #ccc;
  margin: 0 4px;
  align-self: baseline;
  height: 0.85em;
}

.grant-amount {
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: #333;
  text-align: right;
}

.grant-detail {
  display: none;
  padding: 4px 0 12px;
  font-size: 10px;
  color: #888;
  line-height: 1.5;
  border-bottom: 1px dotted #ddd;
}
.grant-detail.open { display: block; }

.grant-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 400;
  margin: 1px 2px 1px 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'Courier New', monospace;
}
.grant-tag.issue { background: #f0efe8; color: #8a7530; }
.grant-tag.pop   { background: #f0e8ea; color: #a04050; }
.grant-tag.cat   { background: #eee;    color: #777; }

/* Receipt footer — sticky bottom */
.receipt-footer {
  border-top: 2px dashed #ccc;
  padding: 14px 24px 24px;
  flex-shrink: 0;
}
.receipt-total {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.receipt-count {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.04em;
}
.receipt-thankyou {
  text-align: center;
  font-size: 10px;
  color: #bbb;
  margin-top: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.receipt-barcode {
  text-align: center;
  margin-top: 12px;
  font-size: 28px;
  letter-spacing: 2px;
  color: #333;
  line-height: 1;
  overflow: hidden;
}


/* ================================================================
   DRAWER TOGGLE — now in left panel
   ================================================================ */

.drawer-toggle {
  position: absolute;
  bottom: 24px;
  left: 56px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 12px;
  font-weight: 300;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  z-index: 100;
}
.drawer-toggle:hover { color: var(--text-dim); }
.drawer-toggle .arrow {
  display: inline-block;
  transition: transform 0.3s;
  margin-left: 4px;
  font-size: 10px;
}
.drawer-toggle.open .arrow { transform: rotate(180deg); }


/* ================================================================
   WATERMARK
   ================================================================ */

.watermark {
  position: fixed;
  bottom: 14px;
  right: 24px;
  font-size: 10px;
  color: var(--text-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 300;
  z-index: 60;
}


/* ================================================================
   MAP DATA LABELS
   ================================================================ */

.geo-label {
  background: none !important;
  border: none !important;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  text-align: center;
  white-space: nowrap;
}


/* ================================================================
   FOCUSED STATE — Expanded viz when left panel collapses
   ================================================================ */

.page.collapsed .right {
  padding: 0;
}

/* All viz containers fill available space in focused mode */
.page.collapsed .viz-area {
  flex: 1;
  min-height: 0;
}

.page.collapsed .mode-panel.active {
  height: 100%;
}
.page.collapsed .mode-panel {
  padding-top: 120px;
  padding-bottom: 40px;
}
.page.collapsed .mode-header {
  text-align: center;
}

/* Proportion: bigger bar + percentage */
.page.collapsed .proportion-viz {
  width: 100%;
  align-items: center;
}
.page.collapsed .stacked-bar {
  width: 80%;
  max-width: 900px;
  height: 160px;
  flex-direction: row;
}
.page.collapsed .bar-match,
.page.collapsed .bar-rest {
  height: 100%;
}
.page.collapsed .punchline-pct {
  font-size: 80px;
}
.page.collapsed .bar-label-amount {
  font-size: 28px;
}

/* Geography: fill within padded area */
.page.collapsed .geography-viz {
  flex: 1;
  min-height: 0;
}
.page.collapsed .geo-map-container {
  max-width: none;
}

/* Scatter: fill within padded area */
.page.collapsed .scatter-viz {
  width: 100%;
  flex: 1;
  min-height: 0;
}
.page.collapsed .scatter-svg {
  max-width: none;
  height: 100%;
}

/* Weight: fill within padded area */
.page.collapsed .weight-viz {
  width: 100%;
  flex: 1;
  min-height: 0;
}
.page.collapsed .weight-svg {
  max-width: none;
  height: 100%;
}

/* Constellation: fill within padded area */
.page.collapsed .constellation-viz {
  width: 100%;
  flex: 1;
  min-height: 0;
}
.page.collapsed .constellation-svg {
  max-width: none;
  height: 100%;
}

/* ================================================================
   Gate — Passcode Screen
   ================================================================ */

.gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

.gate-form {
  width: 100%;
  max-width: 320px;
  padding: 0 24px;
}

.gate-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  font-size: 18px;
  color: var(--text);
  padding: 12px 0;
  text-align: center;
  letter-spacing: 0.08em;
  outline: none;
  transition: border-color 0.3s ease;
}

.gate-input::placeholder {
  color: var(--text-light);
  font-weight: 300;
}

.gate-input:focus {
  border-color: var(--text);
}

.gate-field-wrap.shake {
  animation: gate-shake 0.3s ease;
}

@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ================================================================
   Your Time — Eisenhower Matrix
   ================================================================ */

.time-page {
  display: grid;
  grid-template-columns: 1fr 2fr;
  height: 100vh;
  background: var(--bg);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  position: relative;
}

.time-left {
  padding: 48px 32px 32px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.time-header { margin-bottom: 24px; }

.time-label {
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.time-add-form { margin-bottom: 20px; }

.time-add-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: var(--text);
  padding: 10px 0;
  outline: none;
  transition: border-color 0.3s ease;
}

.time-add-input::placeholder { color: var(--text-light); font-weight: 300; }
.time-add-input:focus { border-color: var(--text); }

.time-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.time-card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 12px 16px;
  font-weight: 400;
  font-size: 15px;
  cursor: grab;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.time-card:hover { border-color: var(--text-dim); }
.time-card:active { cursor: grabbing; }

.time-card.sorted {
  background: transparent;
  border-color: #e8e8e8;
  color: #ccc;
}

.time-card.dragging { opacity: 0.4; }

.time-card-text { display: block; }

.time-counter {
  padding-top: 16px;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin-top: 16px;
}

/* Right panel — the matrix */

.time-right {
  padding: 40px 32px 32px;
  display: flex;
  align-items: stretch;
}

.time-matrix {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.time-quadrant {
  border: 1px solid var(--border);
  padding: 20px;
  position: relative;
  overflow-y: auto;
  transition: background-color 0.2s ease;
}

/* Top row = important: green top border accent */
.time-q-ui  { border-right: none; border-bottom: none; border-top: 2px solid var(--field-green); }
.time-q-nui { border-bottom: none; border-top: 2px solid var(--field-green); }
/* Bottom row = not important */
.time-q-uni { border-right: none; }

.time-quadrant.drag-over { background-color: #f0fdf4; }

.time-quadrant-label {
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.time-quadrant-action {
  font-weight: 300;
  font-size: 20px;
  color: var(--text-light);
  display: block;
}

.time-quadrant-cards {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.time-card-placed {
  background: #fff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-weight: 400;
  font-size: 14px;
  cursor: grab;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.time-card-placed:hover { border-color: var(--text-dim); }
.time-card-placed:active { cursor: grabbing; }

/* Important row cards: green-tinted */
.time-q-ui .time-card-placed,
.time-q-nui .time-card-placed {
  color: var(--field-green-dark);
}

/* Not important row cards: gray */
.time-q-uni .time-card-placed,
.time-q-nuni .time-card-placed {
  color: #9ca3af;
}

.time-watermark {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
}

/* ================================================================
   Your Time — Mirror (Facilitator) Views
   ================================================================ */

.time-mirror {
  max-width: 900px;
  margin: 0 auto;
  padding: 64px 48px;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  position: relative;
}

.time-mirror-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
}

.time-mirror-title { font-weight: 300; font-size: 28px; color: var(--text); }

.time-mirror-meta {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.time-mirror-tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 48px; }

.time-mirror-tab {
  background: none;
  border: none;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}

.time-mirror-tab:hover { color: var(--text); }

.time-mirror-tab.active {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.time-mirror-tab-sep { color: var(--text-light); font-size: 11px; }
.time-mirror-panel.hidden { display: none; }

.time-mirror-question {
  font-weight: 300;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 40px;
}

.time-mirror-insight {
  font-weight: 300;
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 32px;
}

/* The Split */

.time-split-bar-wrap { margin-bottom: 24px; }

.time-split-bar { width: 100%; height: 48px; background: #e8e8e8; }

.time-split-bar-yes {
  height: 100%;
  background: var(--field-green);
  transition: width 0.6s ease-out;
}

.time-split-legend { margin-bottom: 16px; }

.time-split-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 300;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.time-split-swatch { width: 12px; height: 12px; display: inline-block; flex-shrink: 0; }
.time-split-swatch.yes { background: var(--field-green); }
.time-split-swatch.no { background: #e8e8e8; }

.time-split-pct {
  font-weight: 300;
  font-size: 72px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

/* The Cloud */

.time-cloud-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  min-height: 400px;
}

.time-cloud-quadrant { border: 1px solid var(--border); padding: 20px; }
.time-cloud-quadrant:nth-child(1) { border-right: none; border-bottom: none; }
.time-cloud-quadrant:nth-child(2) { border-bottom: none; }
.time-cloud-quadrant:nth-child(3) { border-right: none; }

.time-cloud-qlabel {
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  display: block;
  margin-bottom: 12px;
}

.time-cloud-quadrant ul { list-style: none; }
.time-cloud-quadrant li { font-weight: 300; font-size: 13px; padding: 2px 0; }

.time-cloud-ui li, .time-cloud-nui li { color: var(--field-green-dark); }
.time-cloud-uni li, .time-cloud-nuni li { color: #9ca3af; }

.time-cloud-dot { font-size: 11px; margin-right: 4px; }

.time-cloud-legend { font-weight: 300; font-size: 12px; color: var(--text-light); margin-top: 16px; }

/* The Gap */

.time-gap-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.time-gap-row { display: flex; align-items: center; gap: 12px; }
.time-gap-bar { flex: 1; height: 28px; background: #e8e8e8; }

.time-gap-bar-yes {
  height: 100%;
  background: var(--field-green);
  transition: width 0.6s ease-out;
}

.time-gap-pct {
  font-weight: 300;
  font-size: 13px;
  color: var(--text-dim);
  min-width: 36px;
  text-align: right;
}

.time-gap-legend { margin-bottom: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .time-page {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
  }
  .time-left { border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
}
