:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #676560;
  --soft: #efede8;
  --line: #ded8d1;
  --paper: #f4f1ea;
  --white: #ffffff;
  --black: #151515;
  --green: #232323;
  --acid: #efff73;
  --acid-soft: #f5ffc1;
  --pink: #ff4aa2;
  --coral: #ff725e;
  --orange: #ffb14f;
  --lavender: #e5ddeb;
  --blue: #8978ff;
  --sky: #e8edf8;
  --amber: #ff9d43;
  --gold: #f3e9c1;
  --rose: #ff6a72;
  --rose-soft: #ffe1df;
  --violet: #795fcb;
  --radius: 28px;
  --tile: 18px;
  --shadow: 0 24px 70px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: hidden;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  padding: 18px;
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  padding: 16px;
  background: var(--black);
  color: #fff;
  border-radius: var(--radius);
}

.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  font-size: 1.4rem;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: cover;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  border-radius: 14px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-weight: 760;
}

.side-nav a:hover,
.side-nav a.is-active {
  background: var(--acid);
  color: var(--black);
}

.workspace {
  padding: 0;
}

.workspace-head {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 0 0 18px;
  padding: 20px 24px;
  background: rgba(244, 241, 234, 0.9);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  backdrop-filter: blur(12px);
}

.head-controls {
  display: grid;
  grid-template-columns: 130px 170px;
  gap: 10px;
  align-items: end;
}

.fx-card {
  display: grid;
  gap: 2px;
  min-height: 55px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.fx-card span,
.fx-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.fx-card strong {
  font-size: 1rem;
}

.fx-card a {
  color: inherit;
}

.eyebrow,
.stat-card span,
.card-meta,
th,
.module-card small,
.legend span,
.metric-label {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

/* Editorial serif headings across the app */
h1,
h2 {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  letter-spacing: -0.01em;
  line-height: 1.02;
}

h1 {
  font-size: clamp(3rem, 7vw, 7rem);
  font-weight: 400;
}

h2 {
  font-size: clamp(2.2rem, 4.5vw, 4.25rem);
  font-weight: 400;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.hero-panel,
.stat-card,
.panel,
.module-card,
.requirement,
.option-card,
.link-card,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: var(--tile);
  background: var(--white);
  box-shadow: 0 1px 0 rgba(25, 35, 32, 0.04);
}

.hero-panel {
  min-height: 270px;
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 24px;
  color: #fff;
}

.hero-panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 14%, rgba(239, 255, 115, 0.54), transparent 26%),
    linear-gradient(90deg, rgba(13, 13, 13, 0.9), rgba(13, 13, 13, 0.26));
}

.hero-panel > div {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.hero-panel .eyebrow {
  color: var(--acid);
}

.hero-panel p:not(.eyebrow) {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.86);
}

.stat-card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.stat-card:nth-of-type(2) {
  background: var(--acid);
}

.stat-card:nth-of-type(3) {
  background: var(--lavender);
}

.stat-card:nth-of-type(4) {
  background: linear-gradient(145deg, var(--pink), var(--orange));
}

.stat-card strong {
  display: block;
  font-size: clamp(2rem, 3.1vw, 2.85rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.stat-card p,
.section-head p,
.requirement p,
.option-card p,
.link-card p,
.timeline-item p,
.finance-brief p,
.module-card p,
.notes-list p {
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.home-map-card {
  margin-bottom: 14px;
}

.map-shell--home {
  min-height: 440px;
}

.home-focus-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.62fr) minmax(0, 1.38fr);
  gap: 14px;
  align-items: start;
}

.home-brief {
  background: var(--black);
  color: #fff;
}

.home-brief .eyebrow,
.home-brief p {
  color: rgba(255, 255, 255, 0.7);
}

#homeKeyInfo {
  display: grid;
  gap: 10px;
}

.home-fact {
  display: block;
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
}

.home-fact span {
  display: block;
  margin-bottom: 8px;
  color: var(--acid);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.home-fact strong {
  display: block;
  font-size: 1.25rem;
}

.home-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.home-link-row a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 10px 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.module-card {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.module-card strong {
  font-size: 1.55rem;
  line-height: 1.02;
}

.module-card .metric {
  margin-top: auto;
  border-radius: 14px;
  background: var(--soft);
  padding: 10px;
}

.module-card .metric span {
  display: block;
}

.module-card:nth-child(2n) .metric {
  background: var(--acid-soft);
}

.module-card:nth-child(3n) .metric {
  background: linear-gradient(145deg, #ffd4ef, #ffb46f);
}

.module-card:nth-child(4n) {
  background: var(--black);
  color: #fff;
}

.module-card:nth-child(4n) p,
.module-card:nth-child(4n) small {
  color: rgba(255, 255, 255, 0.72);
}

.module-card:nth-child(4n) .metric,
.module-card:nth-child(4n) .metric span {
  color: var(--black);
}

.money-layout,
.split-grid,
.notes-layout,
.travel-layout,
.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.panel {
  padding: 20px;
}

.panel-head,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.section-head {
  display: block;
  max-width: 780px;
}

.chart-panel {
  min-height: 520px;
}

.chart-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
}

#pieChart {
  width: min(100%, 330px);
  height: auto;
  overflow: visible;
}

#pieChart path {
  cursor: pointer;
  transition: opacity 150ms ease, transform 150ms ease, filter 150ms ease;
  transform-box: fill-box;
  transform-origin: center;
}

#pieChart path:hover,
#pieChart path.is-hovered {
  opacity: 0.9;
  transform: scale(1.035);
  filter: drop-shadow(0 8px 12px rgba(23, 23, 23, 0.22));
}

.chart-center {
  position: absolute;
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  pointer-events: none;
}

.chart-tooltip {
  position: absolute;
  display: none;
  min-width: 148px;
  max-width: 210px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--black);
  color: #fff;
  box-shadow: var(--shadow);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 3;
}

.chart-tooltip.is-visible {
  display: block;
}

.chart-tooltip strong {
  display: block;
  font-size: 1rem;
}

.chart-tooltip span {
  color: var(--acid);
  font-weight: 850;
}

.chart-center span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.chart-center strong {
  font-size: 1.35rem;
}

.legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.legend-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px;
  background: #fbfbf8;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.finance-brief {
  display: grid;
  gap: 14px;
}

.brief-metric {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.brief-metric strong {
  display: block;
  margin: 2px 0 4px;
  font-size: 1.45rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 13px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.button--primary {
  border-color: var(--black);
  background: var(--black);
  color: var(--acid);
}

.button--quiet {
  background: transparent;
}

.icon-button {
  width: 40px;
  padding: 0;
  font-size: 1.3rem;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 10px;
}

.workbook-panel {
  margin-top: 14px;
}

.dashboard-lower {
  margin-top: 14px;
}

.map-shell {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--tile);
  background:
    linear-gradient(135deg, rgba(239, 255, 115, 0.72), rgba(255, 106, 114, 0.38)),
    var(--soft);
}

.map-shell--compact {
  min-height: 270px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-bar label {
  width: min(230px, 100%);
}

.visa-link-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.visa-link-list a {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
}

.leaflet-container {
  font: inherit;
}

.travel-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.travel-summary--full {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.travel-chip,
.decision-card,
.reddit-mini,
.reddit-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px;
}

.travel-chip span,
.reddit-mini span,
.reddit-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.travel-chip strong {
  display: block;
  line-height: 1.08;
}

.travel-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.route-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.route-selector-grid label:first-child,
.route-selector-grid label:last-child {
  grid-column: 1 / -1;
}

.plan-copy {
  max-width: 680px;
  margin-top: 10px;
  color: var(--muted);
}

.endpoint-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 18px;
  background: var(--soft);
}

.travel-layout {
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.58fr);
}

.map-panel {
  grid-column: 1 / -1;
}

.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.decision-card {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 9px;
  align-items: start;
  cursor: pointer;
}

.decision-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--black);
}

.decision-card > span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 760;
  text-transform: none;
}

.decision-card > span strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.92rem;
  text-transform: none;
}

.decision-card.is-done {
  background: var(--acid);
}

.reddit-window {
  background: var(--black);
  color: #fff;
}

.reddit-window p,
.reddit-window .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.reddit-mini-list {
  display: grid;
  gap: 8px;
}

.reddit-mini {
  display: block;
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.reddit-mini strong,
.reddit-card strong {
  display: block;
}

.reddit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reddit-card {
  display: grid;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.reddit-card p {
  color: var(--muted);
}

.reddit-brief {
  display: grid;
  gap: 18px;
  background: var(--black);
  color: #fff;
}

.field-note-lede {
  max-width: 920px;
}

.field-note-lede span,
.field-note-list span {
  display: block;
  margin-bottom: 8px;
  color: var(--acid);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field-note-lede h3 {
  font-size: clamp(1.7rem, 3vw, 3rem);
}

.field-note-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.field-note-list section {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr) minmax(240px, 0.55fr);
  gap: 16px;
  padding: 18px;
  background: #fff;
  color: var(--ink);
}

.field-note-list p {
  color: var(--muted);
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-strip a {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 850;
}

.reddit-action {
  border-radius: 16px;
  background: var(--black);
  color: #fff;
  padding: 12px;
}

.reddit-action span {
  color: var(--acid);
}

.reddit-card:nth-child(2n) {
  background: var(--acid-soft);
}

.reddit-card:nth-child(3n) {
  background: var(--lavender);
}

.documents-panel {
  grid-column: 2;
}

.drop-zone {
  min-height: 160px;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: var(--tile);
  background: var(--soft);
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.drop-zone input {
  display: none;
}

.drop-zone span {
  display: block;
  color: var(--ink);
  font-size: 1.2rem;
}

.drop-zone small {
  color: var(--muted);
}

.drop-zone.is-over {
  background: var(--acid);
  border-color: var(--black);
}

.doc-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.doc-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--white);
}

.doc-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.workbook-controls {
  width: min(260px, 100%);
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

table {
  width: 100%;
  min-width: 1460px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

td input,
td select,
td textarea {
  min-width: 96px;
  border-color: transparent;
  background: #f5f7f4;
  font-size: 0.9rem;
}

td:nth-child(3) input {
  min-width: 300px;
}

td:nth-child(4) input,
td:nth-child(5) input {
  min-width: 110px;
}

td textarea {
  min-width: 420px;
  min-height: 38px;
  resize: vertical;
}

.delete-row {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 14px;
  background: var(--rose-soft);
  color: #7d2d27;
  cursor: pointer;
}

.requirements,
.option-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.requirement,
.option-card,
.link-card {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.requirement ul,
.option-card ul {
  margin: 0;
  padding-left: 18px;
}

.pill {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--mint);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 850;
}

.option-score,
.quick-list {
  display: grid;
  gap: 8px;
}

.option-score {
  grid-template-columns: repeat(3, 1fr);
}

.option-score span,
.quick-list span {
  border-radius: 14px;
  background: var(--soft);
  padding: 9px;
  font-size: 0.85rem;
  font-weight: 760;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  overflow: hidden;
}

.timeline-item {
  position: relative;
  overflow: hidden;
  background: var(--white);
  padding: 18px;
}

.timeline-item:nth-child(2n) {
  background: var(--lavender);
}

.timeline-item:nth-child(3n) {
  background: var(--acid-soft);
}

.timeline-item.is-past {
  opacity: 0.72;
}

.timeline-index {
  display: block;
  margin-bottom: 28px;
  color: rgba(23, 23, 23, 0.18);
  font-size: 4.2rem;
  font-weight: 900;
  line-height: 0.8;
}

.timeline-item time {
  display: block;
  margin-bottom: 8px;
  color: var(--black);
  font-weight: 850;
}

.timeline-feature {
  margin-bottom: 14px;
}

.timeline-progress {
  height: 18px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: repeating-linear-gradient(135deg, #ded8d1 0 8px, #f4f1ea 8px 16px);
}

.timeline-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--black), var(--violet), var(--coral));
}

.timeline-feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.timeline-feature-grid .timeline-item {
  min-height: 150px;
}

#dashboardTimeline .timeline-item p {
  display: none;
}

#dashboardTimeline .timeline-index {
  margin-bottom: 18px;
  font-size: 3.4rem;
}

#view-timeline .timeline {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  overflow: visible;
  padding-left: 28px;
}

#view-timeline .timeline::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 8px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(var(--black), var(--violet), var(--coral), var(--acid));
}

#view-timeline .timeline-item {
  display: grid;
  grid-template-columns: 110px minmax(120px, 0.3fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 150px;
}

#view-timeline .timeline-item::before {
  content: "";
  position: absolute;
  left: -26px;
  top: 28px;
  width: 18px;
  height: 18px;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--black);
}

#view-timeline .timeline-index {
  margin: 0;
}

.notes-panel {
  display: grid;
  gap: 12px;
}

.note {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.note time {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.link-card {
  text-decoration: none;
}

@media (max-width: 1180px) {
  .module-grid,
  .home-focus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    grid-column: 1 / -1;
  }

  .requirements,
  .option-grid,
  .link-grid,
  .reddit-grid,
  .timeline,
  .timeline-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
    border-radius: 0 0 24px 24px;
  }

  .brand {
    margin-bottom: 10px;
  }

  .side-nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .side-nav a {
    white-space: nowrap;
  }

  .workspace-head {
    position: static;
    display: block;
    margin-top: 0;
    border-radius: 0;
  }

  .head-controls,
  .money-layout,
  .split-grid,
  .notes-layout,
  .travel-layout,
  .dashboard-lower,
  .home-focus-grid,
  .module-grid,
  .requirements,
  .option-grid,
  .link-grid,
  .reddit-grid,
  .timeline,
  .timeline-feature-grid,
  .legend,
  .travel-form,
  .route-selector-grid,
  .endpoint-strip,
  .decision-grid,
  .travel-summary,
  .travel-summary--full,
  .field-note-list section,
  #view-timeline .timeline-item {
    grid-template-columns: 1fr;
  }

  #view-timeline .timeline {
    padding-left: 22px;
  }

  .head-controls {
    margin-top: 16px;
  }
}

/* ============================================================
   Mobile-first simplification layer (Now / 4-tab nav)
   ============================================================ */

/* --- Back affordance for grouped sub-views --- */
.back-bar {
  display: none;
  padding: 12px 20px 0;
}
.back-bar.is-visible {
  display: block;
}
.back-bar a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 760;
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
}

/* --- Now landing --- */
.now-hero {
  padding: 6px 20px 0;
}
.now-count {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.now-count strong {
  font-size: clamp(3rem, 17vw, 5rem);
  line-height: 0.95;
  font-weight: 850;
  letter-spacing: -0.03em;
}
.now-count span {
  color: var(--muted);
  font-weight: 650;
}
.now-progress {
  margin-top: 14px;
  height: 8px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}
.now-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.now-next {
  margin: 18px 20px 0;
}
.now-next #nowNext h2 {
  margin: 0.2em 0 0.3em;
  font-size: 1.3rem;
}
.now-next #nowNext p {
  margin: 0 0 16px;
  color: var(--muted);
}

.now-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}
.now-stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 13px 14px;
}
.now-stat span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 800;
}
.now-stat strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 1rem;
  line-height: 1.2;
}
.now-stat small {
  color: var(--muted);
  font-size: 0.8rem;
}

.now-jump,
.group-menu {
  display: grid;
  gap: 10px;
  padding: 18px 20px 0;
}
.now-jump-card,
.group-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--tile);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
}
.now-jump-card strong,
.group-card strong {
  font-size: 1.05rem;
}
.now-jump-card span,
.group-card span {
  color: var(--muted);
  font-size: 0.9rem;
}
.now-jump-card:active,
.group-card:active {
  background: var(--acid-soft);
}

/* --- Collapsible budget workbook --- */
.workbook-collapse {
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.workbook-collapse > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 0 12px;
}
.workbook-collapse > summary::-webkit-details-marker {
  display: none;
}
.workbook-collapse > summary strong {
  font-size: 1.1rem;
}
.workbook-collapse > summary strong::after {
  content: " ▾";
  color: var(--muted);
}
.workbook-collapse[open] > summary strong::after {
  content: " ▴";
}

/* --- Bottom tab bar (mobile only) --- */
.tab-bar {
  display: none;
}

@media (max-width: 820px) {
  /* swap sidebar for bottom tabs */
  .sidebar {
    display: none;
  }

  .tab-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--black);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgba(23, 23, 23, 0.18);
  }
  .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 4px;
    border-radius: 14px;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    font-weight: 760;
  }
  .tab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tab.is-active {
    color: var(--acid);
  }

  /* keep content clear of the fixed tab bar */
  .workspace {
    padding-bottom: 92px;
  }

  /* one stat per row reads better on a phone */
  .now-stats {
    grid-template-columns: 1fr;
  }

  /* header is just the page title on mobile; FX + move date move into settings later */
  .workspace-head {
    padding: 18px 20px 14px;
  }
  .head-controls {
    display: none;
  }
}

/* ============================================================
   Quick capture + living update feed
   ============================================================ */
.capture {
  padding: 14px 22px 4px;
}
.capture-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 16px 16px 12px;
  box-shadow: 0 18px 50px rgba(23, 23, 23, 0.10);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.capture-card:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px var(--acid-soft), 0 22px 60px rgba(23, 23, 23, 0.14);
}
.capture-input {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
  min-height: 60px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px 2px 0;
}
.capture-input::placeholder {
  color: var(--muted);
}
.capture-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.capture-tag {
  margin-right: auto;
  font-size: 0.82rem;
  font-weight: 850;
  color: var(--ink);
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.capture-tag.is-visible {
  opacity: 1;
  transform: none;
}
.capture-mic,
.capture-send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, background 0.2s ease;
}
.capture-mic {
  background: var(--soft);
  color: var(--ink);
}
.capture-mic svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.capture-mic.is-listening {
  background: var(--rose);
  color: #fff;
  animation: micPulse 1.1s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 106, 114, 0.45); }
  50% { box-shadow: 0 0 0 9px rgba(255, 106, 114, 0); }
}
.capture-send {
  background: var(--ink);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}
.capture-mic:active,
.capture-send:active {
  transform: scale(0.92);
}

.now-feed-wrap {
  padding: 14px 20px 0;
}
.now-feed {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.feed-empty {
  margin: 8px 0 0;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--tile);
}
.feed-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
}
.feed-item:active {
  background: var(--acid-soft);
}
.feed-item p {
  margin: 5px 0 0;
  font-size: 0.95rem;
}
.feed-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
}
.feed-top time {
  margin-left: auto;
  color: var(--muted);
  font-weight: 650;
}
.who {
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.who--mike {
  color: var(--blue);
}
.who--stella {
  color: var(--pink);
}
.feed-chip {
  background: var(--soft);
  border-radius: 999px;
  padding: 2px 9px;
  font-weight: 760;
  color: var(--ink);
}
.feed-money { border-left-color: var(--amber); }
.feed-pets { border-left-color: var(--coral); }
.feed-housing { border-left-color: var(--orange); }
.feed-visa { border-left-color: var(--blue); }
.feed-travel { border-left-color: var(--violet); }
.feed-note { border-left-color: var(--lavender); }
.feed-decision { border-left-color: var(--ink); }

/* ============================================================
   Calm "Now" landing — greeting + prose briefing
   ============================================================ */
.now-greeting {
  padding: 30px 22px 4px;
}
.now-dateline {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
#nowGreeting {
  margin: 0;
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(3rem, 15vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
}
.who-switch {
  margin-top: 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 760;
  cursor: pointer;
}
.who-switch:active {
  background: var(--soft);
}

/* soft atmosphere behind the landing — adds depth without clutter */
#view-now {
  position: relative;
  overflow: hidden;
}
#view-now::before {
  content: "";
  position: absolute;
  inset: -8% 0 auto 0;
  height: 340px;
  background: radial-gradient(120% 80% at 28% 0%, rgba(239, 255, 115, 0.55), rgba(229, 221, 235, 0.28) 45%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
#view-now > * {
  position: relative;
  z-index: 1;
}

/* gentle staggered entrance */
.now-greeting { animation: riseIn 0.5s ease both; }
.capture { animation: riseIn 0.5s ease 0.06s both; }
.now-brief { animation: riseIn 0.5s ease 0.12s both; }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.now-brief {
  padding: 20px 22px 12px;
}
.now-brief p {
  margin: 0 0 18px;
  font-size: 1.12rem;
  line-height: 1.62;
  color: var(--ink);
}
.now-brief-lead {
  color: var(--ink);
}
.now-brief a {
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--acid);
}
.now-brief a:active {
  text-decoration-color: var(--muted);
}

/* Each view owns its chapter header on mobile — drop the global page header */
@media (max-width: 820px) {
  .workspace-head {
    display: none;
  }
  /* breathing room at the top of each chapter */
  .story-eyebrow {
    padding-top: 24px;
  }
  /* inset the detail content below each chapter so cards don't go edge-to-edge */
  .filter-bar,
  .option-grid,
  .requirements,
  .link-grid,
  .split-grid,
  .notes-layout,
  .travel-layout,
  #view-timeline .timeline {
    padding-left: 22px;
    padding-right: 22px;
  }
  #view-reddit .reddit-brief {
    margin-left: 22px;
    margin-right: 22px;
  }
}

/* ============================================================
   Motion — springy view changes, tab pop, capture confirmation
   ============================================================ */

/* Each view springs in when it becomes active (Now keeps its own stagger) */
.view.is-active:not(#view-now) {
  animation: viewIn 0.44s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Active tab icon gives a little spring pop on change */
.tab.is-active svg {
  animation: tabPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tabPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* Capture confirmation — the card pulses the routed tag's colour on send */
.capture-card.is-sent {
  animation: cardSent 0.6s ease;
}
@keyframes cardSent {
  0% { box-shadow: 0 0 0 0 var(--flash, var(--acid)), 0 18px 50px rgba(23, 23, 23, 0.10); border-color: var(--flash, var(--ink)); }
  45% { box-shadow: 0 0 0 6px var(--flash, var(--acid)), 0 22px 60px rgba(23, 23, 23, 0.16); border-color: var(--flash, var(--ink)); }
  100% { box-shadow: 0 18px 50px rgba(23, 23, 23, 0.10); border-color: var(--line); }
}

/* The briefing's lead line highlights as it rewrites itself */
.now-brief-lead {
  border-radius: 8px;
  box-decoration-break: clone;
}
.now-brief-lead.just-updated {
  animation: leadHighlight 1.2s ease;
}
@keyframes leadHighlight {
  0% { background: var(--acid); }
  60% { background: var(--acid-soft); }
  100% { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .view.is-active:not(#view-now),
  .tab.is-active svg,
  .capture-card.is-sent,
  .now-brief-lead.just-updated,
  .now-greeting,
  .capture,
  .now-brief {
    animation: none !important;
  }
}

/* ============================================================
   Narrative "story" blocks — prose-first, hyperlinked chapters
   ============================================================ */
.story {
  padding: 16px 22px 6px;
}
.story p {
  margin: 0 0 18px;
  font-size: 1.14rem;
  line-height: 1.62;
  color: var(--ink);
}
.story p:last-child {
  margin-bottom: 8px;
}
.story a {
  font-weight: 760;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  text-decoration-color: var(--acid);
}
.story a:active {
  text-decoration-color: var(--muted);
}
.story em {
  font-style: italic;
}
.story-eyebrow {
  padding: 6px 22px 0;
}
.chapter-title {
  padding: 2px 22px 6px;
  margin: 0;
}

/* The one recommended next action — dark card, can't miss it */
.next-move {
  display: block;
  position: relative;
  margin: 16px 22px 0;
  padding: 16px 44px 16px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.next-move .next-move-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--acid);
  margin-bottom: 5px;
}
.next-move strong {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.next-move .next-move-why {
  display: block;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
}
.next-move::after {
  content: "→";
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--acid);
  font-weight: 800;
  font-size: 1.1rem;
}
.next-move:active {
  transform: scale(0.99);
}

/* Chapter index — informative nav list under a chapter's narrative */
.chapter-index {
  margin: 8px 22px 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.index-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  text-decoration: none;
  color: var(--ink);
  border-top: 1px solid var(--line);
}
.index-row:first-child {
  border-top: none;
}
.index-row:active {
  background: var(--acid-soft);
}
.index-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.index-label {
  font-weight: 780;
  font-size: 1rem;
}
.index-meta {
  color: var(--muted);
  font-size: 0.86rem;
}
.index-arrow {
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1;
}

/* Recommended route */
.option-card.is-recommended {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}
.rec-badge {
  display: inline-block;
  background: var(--acid);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
