/* ============================================================
   StatusTracker — Redesign
   Aesthetic: editorial aviation. Lounge-dark base, warm gold,
   serif numerals, monospace tickers, ticket-stub entries.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* THEME — set on <html data-theme="..."> */
  --bg:        oklch(0.96 0.012 75);
  --paper:     oklch(0.99 0.006 80);
  --paper-2:   oklch(0.93 0.012 75);
  --paper-3:   oklch(0.89 0.014 75);
  --ink:       oklch(0.18 0.014 70);
  --ink-2:     oklch(0.36 0.014 70);
  --muted:     oklch(0.55 0.012 70);
  --line:      oklch(0.86 0.014 75);
  --line-2:    oklch(0.78 0.016 75);
  --accent:    oklch(0.62 0.135 75);    /* gold */
  --accent-soft: oklch(0.62 0.135 75 / 0.10);
  --accent-ink:  oklch(0.18 0.014 70);  /* text on accent */
  --signal-green: oklch(0.55 0.13 150);
  --signal-amber: oklch(0.65 0.16 70);
  --signal-red:   oklch(0.55 0.18 25);

  --radius:    14px;
  --radius-sm: 8px;
  --shadow-1:  0 1px 0 oklch(0.18 0.014 70 / 0.04), 0 1px 2px oklch(0.18 0.014 70 / 0.04);
  --shadow-2:  0 2px 1px oklch(0.18 0.014 70 / 0.03), 0 12px 32px oklch(0.18 0.014 70 / 0.08);

  --density-x: 28px;
  --density-y: 22px;
}

[data-theme="dark"] {
  --bg:        oklch(0.15 0.012 70);
  --paper:     oklch(0.20 0.014 70);
  --paper-2:   oklch(0.24 0.014 70);
  --paper-3:   oklch(0.28 0.014 70);
  --ink:       oklch(0.94 0.014 80);
  --ink-2:     oklch(0.78 0.014 78);
  --muted:     oklch(0.56 0.014 75);
  --line:      oklch(0.30 0.014 70);
  --line-2:    oklch(0.38 0.016 70);
  --accent:    oklch(0.78 0.13 80);
  --accent-soft: oklch(0.78 0.13 80 / 0.12);
  --accent-ink:  oklch(0.18 0.014 70);
  --signal-green: oklch(0.78 0.14 150);
  --signal-amber: oklch(0.82 0.14 80);
  --signal-red:   oklch(0.70 0.18 25);
  --shadow-1:  0 1px 0 #00000022, 0 1px 2px #00000022;
  --shadow-2:  0 2px 1px #00000022, 0 12px 32px #00000044;
}

[data-theme="board"] {
  /* Departure-board: very dark, high contrast amber/green */
  --bg:        oklch(0.10 0.008 60);
  --paper:     oklch(0.14 0.010 65);
  --paper-2:   oklch(0.18 0.012 65);
  --paper-3:   oklch(0.22 0.012 65);
  --ink:       oklch(0.95 0.04 90);
  --ink-2:     oklch(0.82 0.04 90);
  --muted:     oklch(0.52 0.02 80);
  --line:      oklch(0.26 0.014 70);
  --line-2:    oklch(0.34 0.016 70);
  --accent:    oklch(0.85 0.17 80);
  --accent-soft: oklch(0.85 0.17 80 / 0.14);
  --accent-ink:  oklch(0.10 0.008 60);
  --signal-green: oklch(0.80 0.20 145);
  --signal-amber: oklch(0.85 0.17 80);
  --signal-red:   oklch(0.72 0.20 25);
}

/* Accent variants */
[data-accent="sage"]    { --accent: oklch(0.62 0.10 155); --accent-ink: oklch(0.98 0.008 80); }
[data-accent="cobalt"]  { --accent: oklch(0.55 0.16 250); --accent-ink: oklch(0.98 0.008 80); }
[data-accent="crimson"] { --accent: oklch(0.55 0.20 25);  --accent-ink: oklch(0.98 0.008 80); }
[data-theme="dark"][data-accent="sage"]    { --accent: oklch(0.78 0.12 155); --accent-ink: oklch(0.15 0.012 70); }
[data-theme="dark"][data-accent="cobalt"]  { --accent: oklch(0.78 0.14 250); --accent-ink: oklch(0.15 0.012 70); }
[data-theme="dark"][data-accent="crimson"] { --accent: oklch(0.74 0.18 25);  --accent-ink: oklch(0.15 0.012 70); }

[data-density="compact"] {
  --density-x: 18px;
  --density-y: 14px;
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", -apple-system, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
button { font: inherit; cursor: pointer; color: inherit; background: none; border: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
a { color: inherit; }

/* Display serif numbers & headlines */
.serif {
  font-family: "Fraunces", "Georgia", serif;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.mono {
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-feature-settings: "tnum", "zero";
  letter-spacing: 0;
}

/* ---------- TOPBAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-family: "Fraunces", serif;
  font-size: 14px;
  font-weight: 600;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border-top: 1.5px solid var(--accent);
  transform: rotate(-30deg);
}
.brand-name { font-style: italic; }
.brand-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
  margin-left: -2px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.topnav { display: flex; gap: 6px; align-items: center; }
.topnav .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.profile-switcher, .year-select, .goal-tier-select {
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 10px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.profile-switcher:hover, .year-select:hover, .goal-tier-select:hover {
  border-color: var(--line-2);
}

.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all .15s;
  font-size: 13px;
}
.icon-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--line-2); }

.btn-ghost {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--line-2); }
.btn-ghost.btn-danger:hover { background: oklch(0.55 0.18 25 / 0.08); color: var(--signal-red); border-color: var(--signal-red); }
.btn-sm { font-size: 12px; padding: 5px 10px; }

/* ---------- CONTAINER & SECTION RHYTHM ---------- */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 32px 80px;
  display: flex; flex-direction: column;
  gap: 36px;
}
@media (max-width: 720px) {
  .container { padding: 22px 18px 60px; gap: 28px; }
  .topbar { padding: 12px 18px; }
}

.section-label {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-label .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}
.section-label .title {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.section-label .sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "JetBrains Mono", monospace;
}

/* ---------- TICKER STRIP ---------- */
.ticker {
  display: flex; align-items: center; gap: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-wrap: wrap;
}
.ticker-item {
  padding: 0 14px;
  border-right: 1px dashed var(--line-2);
  white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.ticker-item:last-child { border-right: none; }
.ticker-item:first-child { padding-left: 0; }
.ticker-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 8px var(--signal-green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.ticker-item b { color: var(--ink); font-weight: 600; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px var(--density-x);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 320px; height: 320px;
  background: radial-gradient(circle at 70% 30%, var(--accent-soft), transparent 65%);
  pointer-events: none;
}
.hero-top {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 28px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
}
.hero-top .left { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-top .left .pipe { color: var(--line-2); }
.hero-top .quest {
  color: var(--ink);
  font-weight: 600;
}
.goal-tier-pill {
  background: transparent;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 3px 10px 3px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 9px) center, calc(100% - 5px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  padding-right: 22px;
  font-weight: 600;
}

.btn-whatif {
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-whatif:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
body.whatif-active .btn-whatif {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  position: relative;
}
@media (max-width: 880px) {
  .hero-body { grid-template-columns: 1fr; gap: 28px; }
  .hero { padding: 28px 22px; }
}

.hero-figure {
  display: flex; align-items: baseline; gap: 10px;
}
.hero-pct {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-weight: 500;
  font-size: clamp(88px, 16vw, 200px);
  line-height: 0.86;
  letter-spacing: -0.05em;
  color: var(--ink);
}
.hero-pct .pct-sign {
  font-size: 0.45em;
  color: var(--muted);
  font-style: italic;
  font-variation-settings: "opsz" 50;
  margin-left: 0.04em;
}
.hero-figure-meta {
  display: flex; flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.hero-figure-meta b { color: var(--ink); font-weight: 600; }

.hero-verdict-block {
  display: flex; flex-direction: column;
  gap: 16px;
}
.hero-verdict {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 24;
  font-style: italic;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-weight: 400;
  color: var(--ink);
  max-width: 36ch;
}
.hero-verdict .accent { color: var(--accent); font-style: normal; font-weight: 600; }
.hero-verdict.fc-reach .accent { color: var(--signal-green); }
.hero-verdict.fc-tight .accent { color: var(--signal-amber); }
.hero-verdict.fc-miss  .accent { color: var(--signal-red); }
.hero-verdict.fc-done  .accent { color: var(--accent); }

.hero-supports {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.support {
  display: flex; flex-direction: column;
  gap: 4px;
}
.support-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.support-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.support-value .of { color: var(--muted); font-weight: 400; }
.support-bar {
  height: 4px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin-top: 6px;
}
.support-bar .seg {
  height: 100%;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.seg-received { background: var(--accent); }
.seg-pending  { background: var(--accent); opacity: 0.55; }
.seg-booked   {
  background: repeating-linear-gradient(45deg,
    var(--accent) 0, var(--accent) 3px,
    color-mix(in oklab, var(--accent) 30%, transparent) 3px,
    color-mix(in oklab, var(--accent) 30%, transparent) 6px);
}
.seg-planned  {
  background: repeating-linear-gradient(45deg,
    var(--line-2) 0, var(--line-2) 2px,
    transparent 2px, transparent 5px);
}

.hero-delta {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px;
  background: var(--accent-soft);
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--accent);
  font-weight: 600;
}
.hero-delta .delta-up   { color: var(--signal-green); }
.hero-delta .delta-down { color: var(--signal-red); }

/* ---------- RUNWAY (year timeline) ---------- */
.runway-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--density-y) var(--density-x);
}
.runway-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
  gap: 14px;
}
.runway-title {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
}
.runway-title .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-right: 8px;
  text-transform: uppercase;
}
.runway-pace {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.runway-pace b { color: var(--ink); font-weight: 600; }

.runway {
  position: relative;
  padding: 28px 0 36px;
}
.runway-track {
  position: relative;
  height: 14px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.runway-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--accent);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}
.runway-pending {
  position: absolute;
  top: 0; bottom: 0;
  background: repeating-linear-gradient(45deg,
    var(--accent) 0, var(--accent) 4px,
    color-mix(in oklab, var(--accent) 35%, transparent) 4px,
    color-mix(in oklab, var(--accent) 35%, transparent) 8px);
  opacity: 0.8;
  transition: all .8s cubic-bezier(.4,0,.2,1);
}

.runway-now {
  position: absolute;
  top: -8px; bottom: -8px;
  width: 2px;
  background: var(--ink);
}
.runway-now::before, .runway-now::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--ink);
  border-radius: 50%;
}
.runway-now::before { top: -8px; }
.runway-now::after { bottom: -8px; }
.runway-now .label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-2);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 600;
}

.runway-projected {
  position: absolute;
  top: -2px; bottom: -2px;
  width: 2px;
  background: var(--accent);
}
.runway-projected .label {
  position: absolute;
  bottom: -28px;
  left: 50%; transform: translateX(-50%);
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--accent);
  white-space: nowrap;
  font-weight: 600;
}

.runway-months {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.runway-months .month {
  flex: 1;
  text-align: center;
  position: relative;
}
.runway-months .month::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--line-2);
}

/* ---------- TIER STRIP ---------- */
.tier-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 720px) { .tier-strip { grid-template-columns: 1fr; } }
.tier-mini {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
}
.tier-mini:hover { border-color: var(--line-2); }
.tier-mini.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%);
}
.tier-mini.is-active::before {
  content: "";
  position: absolute;
  top: 0; left: 20px; right: 20px;
  height: 2px;
  background: var(--accent);
}
.mini-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
}
.mini-name {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.mini-pct {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.tier-mini.is-active .mini-pct { color: var(--accent); }
.mini-bar {
  height: 3px;
  background: var(--paper-2);
  border-radius: 999px;
  margin: 8px 0 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ink-2);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.tier-mini.is-active .progress-fill { background: var(--accent); }
.mini-figures {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; gap: 12px; flex-wrap: wrap;
}

/* ---------- WHAT-IF BAR ---------- */
.whatif-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--accent-soft);
  border: 1px dashed var(--accent);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--ink);
}
.whatif-bar strong { color: var(--accent); font-weight: 600; }
.whatif-bar .muted { color: var(--ink-2); }
.entry.is-whatif {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
body.whatif-active .entry-status {
  cursor: pointer;
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
}

/* ---------- BANNER ---------- */
.banner {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.banner strong { color: var(--ink); }
.banner .link-btn {
  background: none; border: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  cursor: pointer;
}

/* ---------- DUAL GRID (form + entries) ---------- */
.dual {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 1.3fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1080px) { .dual { grid-template-columns: 1fr; } }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--density-y) var(--density-x);
}
.panel-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 18px;
}
.panel-title {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 17px;
  font-weight: 500;
}
.panel-title .num {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-right: 8px;
  text-transform: uppercase;
}
.head-actions { display: flex; gap: 6px; align-items: center; }

/* ---------- FORM ---------- */
.entry-form { display: flex; flex-direction: column; gap: 14px; }
.seg-toggle {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--paper-2);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--line);
  position: relative;
}
.seg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.seg-toggle label {
  text-align: center;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all .15s;
  letter-spacing: 0.04em;
}
.seg-toggle input:checked + label {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.form-row:has(.swap-btn) {
  grid-template-columns: 1fr auto 1fr;
}
.form-row:has(.field.full) { grid-template-columns: 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.field .opt {
  text-transform: none;
  letter-spacing: 0;
  font-family: "Inter Tight", sans-serif;
  font-size: 11px;
  color: var(--muted);
}
.field input, .field select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  transition: all .15s;
  width: 100%;
  font-size: 13px;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  min-height: 14px;
  text-transform: uppercase;
}
.field .inline-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.swap-btn {
  align-self: end;
  margin-bottom: 0;
  width: 36px; height: 38px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 8px;
  color: var(--muted);
  transition: all .15s;
  font-size: 14px;
}
.swap-btn:hover { color: var(--accent); border-color: var(--accent); }

.via-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.via-row .remove-via {
  width: 36px; height: 38px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--signal-red);
  border-radius: 8px;
  transition: all .15s;
}
.via-row .remove-via:hover { background: oklch(0.55 0.18 25 / 0.08); border-color: var(--signal-red); }

.link-btn {
  background: none; border: none;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  padding: 0;
  cursor: pointer;
  font-size: 12.5px;
  align-self: flex-start;
}

.estimate {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  background: var(--paper-2);
  border: 1px dashed var(--line-2);
  padding: 12px 14px;
  border-radius: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.estimate b { color: var(--ink); font-weight: 600; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: all .15s;
}
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--line-2); cursor: not-allowed; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 13px;
  transition: all .15s;
}
.btn-outline:hover { background: var(--ink); color: var(--bg); }

/* ---------- ENTRY ACCORDIONS ---------- */
.entry-accordion {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-2);
  overflow: hidden;
}
.entry-accordion > summary {
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  user-select: none;
}
.entry-accordion > summary::after {
  content: "+"; color: var(--muted);
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  transition: transform .2s;
}
.entry-accordion[open] > summary::after { transform: rotate(45deg); }
.entry-accordion[open] > summary {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.acc-icon {
  font-size: 14px;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--paper);
  border-radius: 6px;
  border: 1px solid var(--line);
}
.acc-hint {
  font-weight: 400;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.entry-accordion > form { padding: 16px; }

/* ---------- ENTRIES LIST (TICKET STUBS) ---------- */
.entries-panel { display: flex; flex-direction: column; gap: 14px; }
.entries-meta {
  display: flex; gap: 12px; align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.entries-meta .totals {
  margin-left: auto;
  color: var(--ink);
  font-weight: 600;
}

.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center;
}
.search {
  flex: 1; min-width: 180px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 13px;
}
.search:focus { outline: none; border-color: var(--accent); }
.sort-select {
  padding: 9px 28px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 12.5px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 9px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.filter-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.active {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.chip-sm { padding: 4px 10px; font-size: 10px; }

.entries {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 10px;
}

.entry {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px 16px 24px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: all .15s;
}
.entry:hover {
  border-color: var(--line-2);
  background: var(--paper-3);
}

/* Perforation strip on left edge — ticket stub */
.entry::before {
  content: "";
  position: absolute;
  left: 8px; top: 14px; bottom: 14px;
  width: 1px;
  background-image: linear-gradient(to bottom, var(--line-2) 50%, transparent 50%);
  background-size: 1px 6px;
  background-repeat: repeat-y;
}

.entry-icon {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 8px;
  font-size: 14px;
  flex-shrink: 0;
  background: var(--paper);
  border: 1px solid var(--line);
}
.entry-icon.flight { color: var(--accent); }
.entry-icon.hotel  { color: oklch(0.6 0.14 350); }
.entry-icon.rail   { color: var(--signal-green); }
.entry-icon.bonus  { color: var(--signal-amber); }

.entry-main { min-width: 0; }
.entry-title {
  display: flex; align-items: baseline; gap: 10px;
  flex-wrap: wrap;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.entry-title .arrow {
  color: var(--muted);
  font-weight: 400;
}
.entry-title .return-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.entry-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 4px;
  text-transform: uppercase;
}
.entry-sub .pts { color: var(--ink); font-weight: 600; }
.entry-sub .sep { color: var(--line-2); margin: 0 6px; }

.entry-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
}
.entry-status::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.entry-status.received { color: var(--signal-green); border-color: color-mix(in oklab, var(--signal-green) 35%, var(--line)); }
.entry-status.pending  { color: var(--signal-amber); border-color: color-mix(in oklab, var(--signal-amber) 35%, var(--line)); }
.entry-status.booked   { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.entry-status.planned  { color: var(--muted); }

.entry-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.entry:hover .entry-actions, .entry:focus-within .entry-actions { opacity: 1; }
.entry-actions button {
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  transition: all .15s;
  display: grid; place-items: center;
}
.entry-actions button:hover { background: var(--paper-3); color: var(--ink); border-color: var(--line-2); }
.entry-actions .btn-del:hover {
  background: oklch(0.55 0.18 25 / 0.10);
  color: var(--signal-red);
  border-color: var(--signal-red);
}

.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--muted);
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 15px;
}

/* ---------- WORLD MAP ---------- */
.map-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--density-y) var(--density-x);
}
.map-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 16px;
}
#worldMap {
  width: 100%;
  aspect-ratio: 21 / 9;
  background: var(--paper-2);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
#worldMap svg { width: 100%; height: 100%; display: block; }
#worldMap .landmass { fill: color-mix(in oklab, var(--ink) 8%, transparent); stroke: var(--line); stroke-width: 0.5; }
#worldMap .grid-line { stroke: var(--line); stroke-width: 0.3; fill: none; opacity: 0.5; }
#worldMap .pin {
  fill: var(--accent);
  stroke: var(--paper);
  stroke-width: 1.5;
  transition: r .2s;
  cursor: pointer;
}
#worldMap .pin:hover { fill: var(--ink); r: 5; }
#worldMap .arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.8;
  opacity: 0.55;
  stroke-linecap: round;
}
#worldMap .arc.highlight { opacity: 1; stroke-width: 1.4; }
.map-legend {
  margin-top: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- STATS ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0 22px;
}
@media (max-width: 720px) { .stats-grid { grid-template-columns: 1fr 1fr; } }
.stats-kpi {
  padding: 18px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.kpi-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.kpi-value {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
}
.kpi-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stats-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .stats-sections { grid-template-columns: 1fr; } }
.stats-section h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.stats-list { list-style: none; padding: 0; margin: 0; }
.stats-list li {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--line);
  gap: 12px;
}
.stats-list li:last-child { border-bottom: none; }
.stats-list .name { color: var(--ink-2); }
.stats-list .count {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- CALCULATOR ---------- */
.calc-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--density-y) var(--density-x);
}
.calc-card details > summary {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
}
.calc-card details > summary::after {
  content: "+"; color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  transition: transform .2s;
}
.calc-card details[open] > summary::after { transform: rotate(45deg); }
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 720px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-grid label {
  display: flex; flex-direction: column; gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.calc-grid select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-family: "Inter Tight", sans-serif;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.calc-result {
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--line));
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
}
.calc-result strong { color: var(--accent); font-weight: 700; }
.calc-result b { font-family: "JetBrains Mono", monospace; font-weight: 600; }

/* ---------- LEADERBOARD ---------- */
.leaderboard-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.leaderboard-controls {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.leaderboard-controls select {
  padding: 7px 28px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-family: "Inter Tight", sans-serif;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 9px) center;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.leaderboard-row.is-self {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 50%);
}
.lb-rank {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144;
  font-weight: 500;
  font-size: 32px;
  color: var(--muted);
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
}
.leaderboard-row.lb-1 .lb-rank { color: var(--accent); }
.leaderboard-row.lb-2 .lb-rank { color: var(--ink-2); }
.leaderboard-row.lb-3 .lb-rank { color: color-mix(in oklab, var(--accent) 60%, var(--muted)); }
.lb-name {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
}
.lb-self-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 1px 8px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-left: 8px;
  font-style: normal;
  vertical-align: 2px;
}
.lb-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}
.lb-value {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.lb-progress {
  grid-column: 1 / -1;
  height: 2px;
  background: var(--line);
  border-radius: 999px;
  margin-top: 6px;
  overflow: hidden;
}
.lb-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* ---------- IO ROW ---------- */
.io-row {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  padding: 16px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.io-row .io-help {
  margin-left: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 380px;
  text-align: right;
}

/* ---------- REFERENCE TABLE ---------- */
.ref-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--density-y) var(--density-x);
}
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
}
.ref-table th, .ref-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.ref-table th {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.ref-table tbody tr:last-child td { border-bottom: none; }
.ref-table .row-label { color: var(--ink); font-weight: 600; }
.ref-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- MODAL ---------- */
.modal {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 560px;
  width: 92%;
  box-shadow: var(--shadow-2);
  background: var(--paper);
  color: var(--ink);
}
.modal::backdrop { background: oklch(0 0 0 / 0.5); backdrop-filter: blur(4px); }
.modal-body { padding: 24px 28px 22px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.modal-head h3 {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
}
.modal-x {
  font-size: 22px;
  color: var(--muted);
}
.modal-x:hover { color: var(--ink); }
.modal fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
}
.modal fieldset legend {
  padding: 0 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
}
.modal label {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.modal label input[type="number"] {
  width: 110px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  text-align: right;
  font-family: "JetBrains Mono", monospace;
}
.modal label.checkbox { justify-content: flex-start; }
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin: 0; padding: 0;
}

/* ---------- CSV PREVIEW ---------- */
.csv-preview {
  margin-top: 12px;
  padding: 10px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 200px;
  overflow: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.csv-preview table { width: 100%; border-collapse: collapse; }
.csv-preview td, .csv-preview th {
  padding: 3px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.csv-preview th { color: var(--muted); font-weight: 600; }
#csvMappingGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
#csvMappingGrid label {
  display: flex; flex-direction: column; gap: 4px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
#csvMappingGrid select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  font-family: "Inter Tight", sans-serif;
  font-size: 12.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}

/* ---------- FOOTER ---------- */
.footnote {
  text-align: center;
  padding: 32px 20px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex; justify-content: center; gap: 20px;
  align-items: center;
}
.footnote .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--line-2);
}

/* ---------- TWEAKS PANEL ---------- */
.tweaks-panel {
  position: fixed;
  bottom: 80px; right: 24px;
  width: 280px;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  z-index: 200;
  overflow: hidden;
  font-size: 13px;
}
.tweaks-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.tweaks-head .title {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 15px;
}
.tweaks-close {
  font-size: 18px;
  color: var(--muted);
  line-height: 1;
}
.tweaks-body {
  padding: 14px 16px 18px;
  display: flex; flex-direction: column; gap: 16px;
  max-height: 70vh;
  overflow: auto;
}
.tweak-group { display: flex; flex-direction: column; gap: 8px; }
.tweak-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tweak-options { display: flex; gap: 6px; flex-wrap: wrap; }
.tweak-opt {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-2);
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  min-width: 64px;
}
.tweak-opt:hover { border-color: var(--line-2); }
.tweak-opt.active {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.tweak-swatches { display: flex; gap: 8px; }
.tweak-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  outline: 1px solid var(--line);
  cursor: pointer;
  transition: all .15s;
}
.tweak-swatch.active {
  outline: 2px solid var(--ink);
  transform: scale(1.05);
}

/* ---------- UTILS ---------- */
.muted { color: var(--muted); }
.small { font-size: 12px; }
[hidden] { display: none !important; }
