/* ---------------------------------------------------------------
   Home Front — design tokens
   ------------------------------------------------------------- */
:root {
  --bg: #F4F5F8;
  --surface: #FFFFFF;
  --surface-sunken: #ECEEF3;
  --ink: #202B3B;
  --ink-muted: #5B6676;
  --ink-faint: #647086;
  --line: rgba(32, 43, 59, 0.12);
  --line-strong: rgba(32, 43, 59, 0.22);

  --accent: #3E6690;
  --accent-ink: #2C4A69;
  --accent-tint: rgba(62, 102, 144, 0.10);
  --accent-tint-strong: rgba(62, 102, 144, 0.18);

  --warm: #C4694F;
  --warm-tint: rgba(196, 105, 79, 0.12);

  --good: #4F8F6B;
  --good-tint: rgba(79, 143, 107, 0.14);

  --pending: #B8862E;
  --pending-tint: rgba(184, 134, 46, 0.14);

  --later: #5B6B7A;
  --later-tint: rgba(91, 107, 122, 0.12);

  --shadow: 0 1px 2px rgba(20, 26, 36, 0.04), 0 8px 24px -12px rgba(20, 26, 36, 0.18);

  --font-display: "Libre Franklin", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161F;
    --surface: #182231;
    --surface-sunken: #131B27;
    --ink: #E8ECF3;
    --ink-muted: #93A0B4;
    --ink-faint: #828CB0;
    --line: rgba(232, 236, 243, 0.12);
    --line-strong: rgba(232, 236, 243, 0.22);

    --accent: #7FA8CC;
    --accent-ink: #BBD3E8;
    --accent-tint: rgba(127, 168, 204, 0.12);
    --accent-tint-strong: rgba(127, 168, 204, 0.20);

    --warm: #E08B6E;
    --warm-tint: rgba(224, 139, 110, 0.14);

    --good: #6FBB90;
    --good-tint: rgba(111, 187, 144, 0.16);

    --pending: #D9A54B;
    --pending-tint: rgba(217, 165, 75, 0.16);

    --later: #93A6B8;
    --later-tint: rgba(147, 166, 184, 0.16);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px -16px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------
   Base
   ------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.tabular { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

h1, h2, h3 { text-wrap: balance; margin: 0; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------------------------------------------------------
   Masthead
   ------------------------------------------------------------- */
.masthead {
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--bg) 72%);
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.25rem 1.5rem 2.5rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.6rem;
}

.masthead h1 {
  font-size: clamp(2.25rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.masthead-sub {
  max-width: 46ch;
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
}

.countdown {
  margin-top: 2.25rem;
  padding: 1.5rem 1.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.countdown-figure {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.countdown-number {
  font-family: var(--font-mono);
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}

.countdown-label {
  font-size: 1.05rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.countdown-detail {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.overall-progress {
  margin-top: 1.5rem;
}

.overall-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

.overall-progress-head span:first-child {
  font-weight: 500;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-sunken);
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.timing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.timing-legend-item {
  font-size: 0.7rem;
}

/* ---------------------------------------------------------------
   View tabs (Checklist / Budget)
   ------------------------------------------------------------- */
.view-tabs {
  display: flex;
  gap: 0.5rem;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}

.view-tab {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.75rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.view-tab:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}

.view-tab:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.view-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.view-panel[hidden] {
  display: none;
}

/* ---------------------------------------------------------------
   Finances sub-tabs
   --------------------------------------------------------------- */
.finances-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1.75rem;
}

.finances-subtab {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.finances-subtab:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}

.finances-subtab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.finances-subpanel[hidden] {
  display: none;
}

.finances-subpanel .budget-card + .budget-card,
.finances-subpanel .budget-card + .finances-table-wrap,
.finances-subpanel .budget-grid + .budget-card,
.finances-subpanel .budget-grid + .finances-table-wrap,
.finances-subpanel .budget-summary + .bases-section,
.finances-subpanel .finances-table-wrap + .budget-summary-note,
.finances-subpanel .budget-card {
  margin-top: 1.25rem;
}

.finances-subpanel > *:first-child {
  margin-top: 0;
}

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

@media (max-width: 900px) {
  .budget-grid--three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .budget-grid--three { grid-template-columns: 1fr; }
}

.budget-dollar--suffix {
  padding: 0 0.7rem 0 0;
}

.finances-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.finances-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  white-space: nowrap;
}

.finances-table th,
.finances-table td {
  padding: 0.6rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.finances-table th:first-child,
.finances-table td:first-child {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

.finances-table thead th {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface-sunken);
}

.finances-table tbody tr:last-child td {
  border-bottom: none;
}

.finances-table tr.is-highlight td {
  background: var(--good-tint);
  font-weight: 600;
}

.finances-table input {
  width: 100%;
  min-width: 6ch;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-align: right;
  padding: 0.2rem;
}

.finances-table input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-radius: 4px;
}

.finances-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.finances-checklist li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.finances-checklist li:last-child {
  border-bottom: none;
}

.finances-checklist .item-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-ink);
  flex-shrink: 0;
}

.finances-checklist strong {
  display: block;
  margin-bottom: 0.2rem;
}

.finances-checklist span {
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.finances-reco-list {
  margin: 0;
  padding-left: 1.4rem;
}

.finances-reco-list li {
  margin-bottom: 0.75rem;
}

.finances-reco-list li:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------
   Timeline
   ------------------------------------------------------------- */
.timeline {
  max-width: 760px;
  margin: 0 auto;
}

.timeline-inner {
  overflow-x: auto;
  padding: 2.75rem 1.5rem 7.5rem;
  -webkit-overflow-scrolling: touch;
}

.timeline-track {
  position: relative;
  min-height: 2rem;
  min-width: 680px;
  margin: 0 8px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--line-strong);
}

.timeline-marker {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: max-content;
}

.marker-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid var(--bg);
  margin-top: -5px;
}

.marker-dot--accent { background: var(--accent); }
.marker-dot--warm { background: var(--warm); }
.marker-dot--pending { background: var(--pending); }
.marker-dot--today {
  background: var(--ink);
  width: 10px;
  height: 10px;
  box-shadow: 0 0 0 4px var(--accent-tint-strong);
}

.marker-label {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.35;
}

.marker-label--row2 {
  margin-top: 3.1rem;
}

/* Multi-day spans (Hotel/Flight, Exodus, tech school grad window) */
.timeline-range {
  position: absolute;
  top: -3px;
}

.range-bar {
  display: block;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

.range-bar--accent { background: var(--accent); }
.range-bar--pending { background: var(--pending); }

.range-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
}

.range-label--row2 {
  margin-top: 3.1rem;
}

#markerToday .marker-label {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 0.5rem;
  white-space: nowrap;
}

.marker-label--today {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
}

/* ---------------------------------------------------------------
   Sections / checklist
   ------------------------------------------------------------- */
.sections {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sections-toolbar {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  display: flex;
  gap: 0.6rem;
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

/* Folder / tab band */
.folder {
  position: relative;
}

.folder-band {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--folder-color);
  border: none;
  border-radius: 14px;
  padding: 0.95rem 1.25rem;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-radius 0.2s ease, filter 0.15s ease;
}

.folder-band.is-open {
  border-radius: 14px 14px 0 0;
}

.folder-band:hover {
  filter: brightness(1.07);
}

.folder-band:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}

.folder-tab-shape {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.5rem 0.9rem 0.45rem;
  border-radius: 10px 10px 6px 6px;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.35);
  color: #fff;
}

.folder-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: 0.9;
}

.folder-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.folder-meta {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-shrink: 0;
}

.folder-note {
  margin: 1.1rem 1.5rem 0;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
  max-width: 56ch;
}

.folder-progress {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.folder-chevron {
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-right: 2px;
}

.folder-band.is-open .folder-chevron {
  transform: rotate(45deg);
  margin-right: 0;
}

.folder-body-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.folder-body-wrap.is-open {
  grid-template-rows: 1fr;
}

.folder-body-inner {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--folder-color);
  border-top: none;
  border-radius: 0 0 14px 14px;
}

/* Nested category folders inside a Civilian/Active Duty folder */
.subfolder-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem 1.25rem 1.25rem;
}

.folder--sub .folder-band {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  box-shadow: none;
}

.folder--sub .folder-band.is-open {
  border-radius: 10px 10px 0 0;
}

.folder--sub .folder-tab-shape {
  padding: 0.35rem 0.7rem 0.3rem;
  transform: translateY(-2px);
}

.folder--sub .folder-icon {
  width: 14px;
  height: 14px;
}

.folder--sub .folder-title {
  font-size: 0.88rem;
}

.folder--sub .folder-progress {
  font-size: 0.76rem;
}

.folder--sub .folder-chevron {
  width: 7px;
  height: 7px;
}

.folder--sub .folder-body-inner {
  border-radius: 0 0 10px 10px;
}

.item-list {
  display: flex;
  flex-direction: column;
}

.item {
  display: flex;
  gap: 0.9rem;
  padding: 1.1rem 1.5rem 1.1rem 1.35rem;
  border-left: 3px solid var(--cat-color, transparent);
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}

.item:last-child { border-bottom: none; }

.item.is-done { background: var(--good-tint); }

.item-check {
  flex-shrink: 0;
  appearance: none;
  width: 21px;
  height: 21px;
  margin-top: 0.15rem;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-content: center;
  cursor: pointer;
}

.item-check::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--good);
  transform: scale(0);
  transition: transform 0.12s ease;
}

.item-check:checked::after { transform: scale(1); }

.item-check:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.item-body { flex: 1; min-width: 0; }

.item-title {
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
}

.is-done .item-title {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.item-why {
  margin: 0.3rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 58ch;
}

.item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.item-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: var(--warm);
  background: var(--warm-tint);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.item-timing {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
}

.item-timing--now { color: var(--good); background: var(--good-tint); }
.item-timing--after-ship { color: var(--pending); background: var(--pending-tint); }
.item-timing--after-assign { color: var(--later); background: var(--later-tint); }

.item-resource {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.item-resource a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-tint-strong);
}

.item-resource a:hover { border-bottom-color: var(--accent-ink); }

/* ---------------------------------------------------------------
   Budget
   ------------------------------------------------------------- */
.budget {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}

.budget-intro h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.budget-intro p {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
  max-width: 62ch;
}

.budget-intro a {
  color: var(--accent-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-tint-strong);
}

.budget-intro a:hover { border-bottom-color: var(--accent-ink); }

.budget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .budget-grid { grid-template-columns: 1fr; }
}

.budget-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}

.budget-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.budget-fields {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.budget-row label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.budget-hint {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.budget-row select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.92rem;
}

.budget-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.budget-dollar {
  padding: 0 0 0 0.7rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
}

.budget-input input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.55rem 0.7rem 0.55rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.budget-input input:focus,
.budget-row select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.budget-row--checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin-bottom: 0;
}

.budget-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.budget-total .tabular {
  font-size: 1.1rem;
  color: var(--accent-ink);
}

.budget-summary {
  margin-top: 1.25rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.budget-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.budget-summary-row .tabular {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--good);
}

.budget-summary-row .tabular.is-negative {
  color: var(--warm);
}

.budget-summary-row--total {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.budget-summary-row--total .tabular {
  font-size: 1.3rem;
}

.budget-summary-note {
  margin: 0.6rem 0 0;
  color: var(--ink-muted);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------
   Bases
   ------------------------------------------------------------- */
.bases-explainer {
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 68ch;
}

.bases-section {
  margin-top: 1.75rem;
}

.bases-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.bases-section-note {
  margin: 0.4rem 0 1rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  max-width: 62ch;
}

.bases-glossary {
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1rem;
}

.bases-glossary p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.83rem;
  max-width: 68ch;
}

.bases-shred-group {
  margin-top: 1.5rem;
}

.bases-shred-group:first-child {
  margin-top: 0;
}

.bases-shred-heading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 0.5rem;
}

.bases-shred-note {
  margin-top: -0.3rem;
}

.bases-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bases-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.bases-item:last-child {
  border-bottom: none;
}

.bases-rank {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-content: center;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 0.85rem;
}

.bases-item-body {
  flex: 1;
  min-width: 0;
}

.bases-item-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.bases-item-name {
  font-weight: 700;
  font-size: 0.98rem;
}

.bases-item-place {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.bases-item-why {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
  max-width: 62ch;
}

.bases-detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 0.85rem;
}

.bases-detail-toggle:hover {
  text-decoration: underline;
}

.bases-detail-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.bases-detail-toggle.is-open .bases-detail-chevron {
  transform: rotate(45deg);
}

.bases-detail-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.bases-detail-wrap.is-open {
  grid-template-rows: 1fr;
}

.bases-detail-inner {
  overflow: hidden;
}

.bases-detail-list {
  margin: 0.75rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
  max-width: 62ch;
}

.bases-detail-row {
  margin-bottom: 0.65rem;
}

.bases-detail-row:last-child {
  margin-bottom: 0;
}

.bases-detail-row dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}

.bases-detail-row dd {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

/* ---------------------------------------------------------------
   Toolbelt / footer
   ------------------------------------------------------------- */
.toolbelt {
  border-top: 1px solid var(--line);
  background: var(--surface-sunken);
}

.toolbelt-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.toolbelt-copy h2 {
  font-size: 1.05rem;
  font-weight: 700;
}

.toolbelt-copy p {
  margin: 0.4rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 48ch;
}

.toolbelt-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-ink); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink-muted); }

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------
   Import banner / toast
   ------------------------------------------------------------- */
.import-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.import-banner[hidden] {
  display: none;
}

.import-banner p { margin: 0; font-size: 0.9rem; }

.import-actions { display: flex; gap: 0.5rem; }

.import-banner .btn-primary {
  background: #fff;
  color: var(--accent-ink);
}

.import-banner .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 12px);
  background: var(--ink);
  color: var(--bg);
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------
   Print
   ------------------------------------------------------------- */
@media print {
  .import-banner, .toolbelt, .toast, .view-tabs, .finances-subtabs, .sections-toolbar { display: none !important; }
  body { background: #fff; color: #000; }
  .countdown { box-shadow: none; border-color: #ccc; }
  .folder-band { box-shadow: none; }
  .folder-body-wrap { grid-template-rows: 1fr !important; }
  .folder-chevron { display: none; }
  .view-panel[hidden], .finances-subpanel[hidden] { display: block !important; }
  .budget-card, .budget-summary, .bases-list, .finances-table-wrap, .finances-checklist { box-shadow: none; border-color: #ccc; }
  .bases-detail-wrap { grid-template-rows: 1fr !important; }
  .bases-detail-toggle { display: none; }
}

@media (max-width: 560px) {
  .folder-band { flex-wrap: wrap; row-gap: 0.6rem; }
  .folder-meta { margin-left: auto; }
}
