/* ===========================================================================
   Travel Passport — US passport aesthetic + top-level tabbed views
   --------------------------------------------------------------------------- */

:root {
  /* Outside-the-book backdrop */
  --bg-0: #060a1f;
  --bg-1: #0a0f2c;
  --ink-1: #e8ecff;
  --ink-2: #aab3d9;
  --ink-3: #6c75a3;
  --accent: #a78bfa;
  --accent-2: #7c3aed;

  /* US passport palette */
  --pp-cover:        #0c1c40;
  --pp-cover-2:      #07112a;
  --pp-gold:         #c8a04a;
  --pp-gold-2:       #e6c478;
  --pp-paper:        #f5ecd5;
  --pp-paper-2:      #ead9b5;
  --pp-paper-blue:   #e0e8ee;
  --pp-paper-blue-2: #cad5e0;
  --pp-bio-top:      #d8e3ee;     /* top half of bio page (blue tint) */
  --pp-bio-bottom:   #efe3ce;     /* bottom half of bio page (warm tint) */
  --pp-ink:          #1d2235;
  --pp-ink-2:        #475067;
  --pp-blue:         #2d4d9b;
  --pp-blue-deep:    #173273;
  --pp-blue-soft:    #5d7bb8;
  --pp-red:          #b32525;
  --pp-red-deep:     #7a1a1a;

  /* Stamp colors */
  --stamp-red:    #cf2a2a;
  --stamp-blue:   #245aa3;
  --stamp-green:  #2e8a55;
  --stamp-purple: #6b3a8c;
  --stamp-brown:  #6a3e1b;
  --stamp-black:  #1a1d28;

  --shadow-book: 0 40px 80px -28px rgba(0,0,0,0.65), 0 16px 36px -16px rgba(0,0,0,0.45);

  --font-display: ui-serif, "Iowan Old Style", "Apple Garamond", "Times New Roman", serif;
  --font-script:  "Snell Roundhand", "Apple Chancery", "Brush Script MT", "Lucida Handwriting", cursive;
  --font-sans:    -apple-system, BlinkMacSystemFont, "Inter", system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-stamp:   "Stencil Std", "Bebas Neue", "Impact", "Arial Narrow Bold", sans-serif;
  --font-mrz:     "OCR A Std", "Andale Mono", "Courier New", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink-1);
  background: var(--bg-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }

/* --- backdrop ------------------------------------------------------------- */
.bg-stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(124, 58, 237, 0.20), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-0));
}
.bg-stars::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 25px 35px, rgba(255,255,255,0.42) 99%, transparent),
    radial-gradient(1px 1px at 145px 80px, rgba(255,255,255,0.32) 99%, transparent),
    radial-gradient(1px 1px at 260px 200px, rgba(255,255,255,0.25) 99%, transparent),
    radial-gradient(2px 2px at 420px 320px, rgba(255,255,255,0.18) 99%, transparent);
  background-size: 480px 480px;
  opacity: 0.4;
  animation: drift 90s linear infinite;
}
@keyframes drift { from { background-position: 0 0; } to { background-position: 480px 480px; } }

/* --- shell --------------------------------------------------------------- */
.app {
  position: relative; z-index: 1;
  height: 100dvh; min-height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(0,0,0,0.30), transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 180ms, transform 180ms;
}
.brand:hover { background: rgba(255,255,255,0.04); transform: translateY(-1px); }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand svg { color: var(--accent); }

.user-meta {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 2px;
  color: var(--ink-2);
}
.user-meta .user-name {
  font-weight: 700; font-size: 13px; color: var(--ink-1);
  letter-spacing: 0.01em;
}
.user-meta .user-updated {
  font-size: 11px; color: var(--ink-3);
  font-family: var(--font-mrz); letter-spacing: 0.04em;
}

.view-tabs {
  display: flex; gap: 4px;
  background: rgba(255,255,255,0.04);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.06);
}
.view-tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  transition: background 180ms, color 180ms;
}
.view-tabs button:hover { color: var(--ink-1); }
.view-tabs button.is-active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: white;
  box-shadow: 0 4px 14px -4px rgba(124, 58, 237, 0.55);
}
.view-tabs button svg { opacity: 0.9; }

.meta { color: var(--ink-3); font-size: 13px; }
.footer {
  padding: 8px 22px 14px;
  font-size: 12px; color: var(--ink-3);
  display: flex; justify-content: center;
}
.empty {
  max-width: 640px; margin: 60px auto; padding: 32px;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
}
.empty h1 { font-family: var(--font-display); margin: 0 0 10px; font-size: 28px; }
.empty pre {
  background: rgba(0,0,0,0.40); padding: 14px; border-radius: 10px;
  overflow: auto; font-size: 13px; color: var(--ink-2);
  border: 1px solid rgba(255,255,255,0.06);
}

/* --- view stage ---------------------------------------------------------- */
.views {
  position: relative;
  min-height: 0;
  display: grid;
}
.view {
  grid-area: 1 / 1;        /* all views stacked, one shown at a time */
  min-height: 0;
  display: none;
  overflow: auto;
}
.view.is-active { display: flex; }
#view-passport.is-active { display: block; }

/* ===========================================================================
   PASSPORT VIEW — the book
   --------------------------------------------------------------------------- */
.book-wrap {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 60px;
  min-height: 0;
  height: 100%;
}
.nav-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink-1);
  display: grid; place-items: center;
  transition: background 180ms, transform 180ms;
  z-index: 30;
}
.nav-arrow:hover:not(:disabled) { background: rgba(255,255,255,0.12); transform: translateY(-50%) scale(1.05); }
.nav-arrow:disabled { opacity: 0.2; cursor: not-allowed; }
.nav-prev { left: 8px; }
.nav-next { right: 8px; }
.page-indicator {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.18em; text-transform: uppercase;
}

.book {
  position: relative;
  width: min(1080px, 96vw);
  aspect-ratio: 10 / 7;
  max-height: calc(100dvh - 160px);
  perspective: 2800px;
  perspective-origin: 50% 35%;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.45), rgba(0,0,0,0.65) 50%, rgba(0,0,0,0.45)) center/4px 100% no-repeat;
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.55));
}

/* Sheets */
.sheet {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 50%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 850ms cubic-bezier(.62,.05,.25,1);
  will-change: transform;
}
.sheet[data-state="flipped"] { transform: rotateY(-180deg); }
.sheet[data-state="current"], .sheet[data-state="future"] { transform: rotateY(0); }
.book.no-anim .sheet { transition: none !important; }

.sheet-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Flatten everything inside the face into the face's plane so children's
     own transforms can't create separate 3D layers that ignore backface
     culling. */
  transform-style: flat;
  overflow: hidden;
  display: flex;
  box-shadow:
    -2px 0 6px rgba(0,0,0,0.20),
    inset 14px 0 28px -14px rgba(0,0,0,0.30);
}
.sheet-front {
  /* Push the front face a hair toward the viewer so the two faces don't
     z-fight during the flip transition. */
  transform: translateZ(0.5px);
}
.sheet-back {
  transform: rotateY(180deg) translateZ(0.5px);
  box-shadow:
    2px 0 6px rgba(0,0,0,0.20),
    inset -14px 0 28px -14px rgba(0,0,0,0.30);
}

/* Belt + suspenders: any transformed or animated descendant inside a sheet
   inherits backface-visibility:hidden too. Without this, things like the
   cover shimmer, the mirrored PASSPORT watermark, or the chip's pseudo-
   element get promoted to their own GPU layers and would otherwise show
   through during the flip. */
.sheet, .sheet * {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.end-paper { flex: 1; background: linear-gradient(135deg, var(--pp-paper), var(--pp-paper-2)); display: grid; place-items: center; color: var(--pp-ink-2); }

/* Page base */
.page {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Cream paper (non-bio interior pages: stamps, log) — clean, no watermark */
.paper {
  flex: 1;
  position: relative;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,255,0.45), transparent 55%),
    linear-gradient(135deg, var(--pp-paper) 0%, var(--pp-paper-2) 100%);
  color: var(--pp-ink);
}
.paper.blue {
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,0.45), transparent 55%),
    linear-gradient(135deg, var(--pp-paper-blue) 0%, var(--pp-paper-blue-2) 100%);
}

.page-num {
  position: absolute;
  bottom: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  color: rgba(179, 37, 37, 0.55);
  letter-spacing: 0.10em;
  z-index: 5;
}
.page-num-right { right: 18px; }
.page-num-left  { left: 18px; }

.page-header {
  padding: 12px 24px 6px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--pp-blue-deep);
  font-size: 18px;
  letter-spacing: 0.04em;
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid rgba(45,77,155,0.18);
  position: relative; z-index: 2;
}
.page-header small {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pp-ink-2);
}

/* ===========================================================================
   COVER — clean US passport
   --------------------------------------------------------------------------- */
.cover-page { display: flex; }
.cover {
  flex: 1; position: relative;
  background:
    radial-gradient(circle at 30% 25%, #16306a 0%, var(--pp-cover) 45%, var(--pp-cover-2) 100%);
  color: var(--pp-gold);
  display: grid; place-items: center;
  padding: 32px 26px;
  overflow: hidden;
}
.cover::before {
  content: ""; position: absolute; inset: 14px;
  border: 1.5px solid rgba(200, 160, 74, 0.45);
  border-radius: 4px; pointer-events: none;
}
.cover::after {
  content: ""; position: absolute; inset: 24px;
  border: 0.5px solid rgba(200, 160, 74, 0.30);
  border-radius: 2px; pointer-events: none;
}
.cover-shimmer {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  mix-blend-mode: screen;
  animation: shimmer 7s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { transform: translateX(-30%); opacity: 0.4; }
  50%      { transform: translateX(30%); opacity: 0.9; }
}
.cover-inner {
  display: grid; gap: 24px;
  justify-items: center; align-items: center;
  position: relative; z-index: 1; text-align: center;
}
.cover-emblem {
  width: 240px; height: 240px;
  /* Render the real seal PNG in solid gold via CSS masking. */
  background:
    radial-gradient(circle at 35% 30%, #f7e3a4 0%, #e6c478 35%, #c8a04a 65%, #7a5e1f 100%);
  -webkit-mask: url("../img/seal.png") center/contain no-repeat;
          mask: url("../img/seal.png") center/contain no-repeat;
  filter:
    drop-shadow(0 6px 18px rgba(230, 196, 120, 0.30))
    drop-shadow(0 0 1px rgba(200, 160, 74, 0.6));
}
.cover-emblem svg { width: 100%; height: 100%; }
.cover-titles { display: grid; gap: 6px; }
.cover h1 {
  font-family: var(--font-display);
  margin: 0;
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 400;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--pp-gold);
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.cover h2 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 400; font-style: italic;
  font-size: clamp(15px, 2.2vw, 18px);
  color: rgba(230, 196, 120, 0.85);
  letter-spacing: 0.20em;
}
.cover-chip {
  width: 30px; height: 24px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d6b15e, #8a6d2e);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.30);
}
.cover-chip::before {
  content: "";
  position: absolute; inset: 4px 6px;
  background-image:
    linear-gradient(0deg, rgba(0,0,0,0.5) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(0,0,0,0.5) 0 1px, transparent 1px 4px);
  background-size: 4px 4px;
  border: 0.5px solid rgba(0,0,0,0.4);
  border-radius: 1px;
}

/* ===========================================================================
   BIO PAGE — photo + fields only (the We the People / eagle / signature top
   half has been removed). A faded seal + large reversed "PASSPORT" word sit
   behind the details as background watermarks.
   --------------------------------------------------------------------------- */
.bio-page { padding: 0; }
.bio {
  flex: 1;
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  background: linear-gradient(180deg, var(--pp-bio-top) 0%, var(--pp-bio-bottom) 70%, var(--pp-bio-bottom) 100%);
  color: var(--pp-ink);
  overflow: hidden;
}

/* Faint seal watermark */
.bio-watermark {
  position: absolute; inset: 0;
  background: url("../img/seal.png") center/55% no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}
.watermark-light { opacity: 0.04; background-size: 60%; }

/* Large reversed "PASSPORT" word behind the details: blue, 10% opacity */
.bio-passport-watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scaleX(-1);  /* mirrored / "in reverse" */
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(110px, 18vw, 180px);
  letter-spacing: 0.10em;
  color: var(--pp-blue-deep);
  opacity: 0.10;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  text-transform: uppercase;
  user-select: none;
}

.bio > *:not(.bio-watermark):not(.bio-passport-watermark) {
  position: relative;
  z-index: 1;
}

/* Main body: photo on the left, fields on the right */
.bio-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 22px 24px 16px;
  align-items: start;
}
.bio-left { display: flex; justify-content: flex-start; }
.bio-right { display: grid; gap: 10px; }

.bio-photo {
  width: 120px; height: 150px;
  border: 1px solid var(--pp-blue-deep);
  border-radius: 2px;
  background:
    linear-gradient(135deg, #f0e5cf, #d4c79a);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 56px;
  color: rgba(0,0,0,0.30);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5);
}
.bio-photo::after {
  content: ""; position: absolute; inset: 3px;
  border: 1px dashed rgba(0,0,0,0.10);
  border-radius: 1px;
}
.bio-country {
  margin: 0;
  font-family: var(--font-display);
  color: var(--pp-blue-deep);
  font-weight: 700;
  font-size: clamp(16px, 2.3vw, 20px);
  letter-spacing: 0.10em;
  border-bottom: 1px solid rgba(45,77,155,0.30);
  padding-bottom: 4px;
}

.bio-fields { display: grid; gap: 5px; align-content: start; }
.bio-fields .row { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.bio-fields .row.triple { grid-template-columns: 0.5fr 0.5fr 1fr; }
.bio-fields .row > .field:only-child { grid-column: 1 / -1; }
.bio-fields .field { display: grid; gap: 0; }
.bio-fields .field.span-2 { grid-column: span 2; }
.bio-fields dt {
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pp-blue-deep);
  font-weight: 700;
  line-height: 1.1;
}
.bio-fields dd {
  margin: 0;
  font-family: var(--font-mrz);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--pp-ink);
  line-height: 1.25;
}

.bio-mrz {
  padding: 8px 24px 14px;
  font-family: var(--font-mrz);
  font-size: 11px;
  letter-spacing: 0.10em;
  color: var(--pp-ink);
  border-top: 1px solid rgba(45,77,155,0.20);
  background: rgba(255,255,255,0.30);
  line-height: 1.55;
  word-break: break-all;
}

/* ===========================================================================
   STAMP PAGES — scatter layout (stamps placed at randomized anchor points,
   so they sit nearby with only slight overlap rather than stacking)
   --------------------------------------------------------------------------- */
.stamps-page { padding: 0; }
.stamps { padding: 0; position: relative; height: 100%; }
.stamps-inner {
  position: relative; z-index: 2;
  padding: 10px 22px 22px;
  height: 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.stamps-scatter {
  position: relative;
  flex: 1;
  margin-top: 4px;
  /* Hard clip: any anchor jitter or rotation that exceeds the safe zone is
     visually cropped here rather than spilling over the page edges. */
  overflow: hidden;
}
.stamp-anchor {
  position: absolute;
  /* The stamp inside is rendered relative to this anchor; we translate the
     stamp by -50%,-50% so the anchor point is the visual center. */
  transform: translate(-50%, -50%);
}

.stamp {
  --rot: 0deg; --c: var(--stamp-red);
  position: relative;
  display: inline-block;
  color: var(--c);
  font-family: var(--font-stamp);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(var(--rot));
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.08));
  mix-blend-mode: multiply;
  opacity: 0.92;
  background: transparent;
}
.stamp::after {
  content: ""; position: absolute; inset: -3px;
  background-image: radial-gradient(circle, rgba(0,0,0,0.04), transparent 60%);
  pointer-events: none;
}
.stamp[data-stamp-kind] { cursor: pointer; }
.stamp[data-stamp-kind]:hover {
  opacity: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.20));
}
.stamp[data-stamp-kind]:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.stamp.shape-rect {
  border: 2px solid currentColor;
  padding: 5px 10px;
  border-radius: 2px;
  min-width: 105px; max-width: 135px;
}
.stamp.shape-rect::before {
  content: ""; position: absolute; inset: 3px;
  border: 0.5px solid currentColor;
  border-radius: 1px; pointer-events: none;
}
.stamp.shape-oval {
  border: 2px solid currentColor;
  padding: 6px 14px;
  border-radius: 50% / 35%;
  min-width: 110px; max-width: 140px;
  text-align: center;
}
.stamp.shape-circle {
  border: 2px solid currentColor;
  padding: 8px;
  border-radius: 50%;
  width: 100px; height: 100px;
  display: grid; place-items: center; text-align: center;
}
.stamp.shape-circle::before {
  content: ""; position: absolute; inset: 4px;
  border: 0.5px solid currentColor; border-radius: 50%;
}
.stamp.shape-square {
  border: 2px solid currentColor;
  padding: 8px;
  border-radius: 1px;
  width: 100px; height: 100px;
  display: grid; place-items: center; text-align: center;
  clip-path: polygon(8% 0, 92% 0, 100% 8%, 100% 92%, 92% 100%, 8% 100%, 0 92%, 0 8%);
}

/* State stamps — compact rectangle with USA banner + state abbreviation */
.stamp.kind-state.shape-state {
  border: 2px double currentColor;
  padding: 4px 10px 5px;
  border-radius: 2px;
  min-width: 100px;
  max-width: 130px;
  text-align: center;
}
.stamp.kind-state .state-banner {
  font-size: 7.5px;
  letter-spacing: 0.30em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  margin-bottom: 3px;
  font-weight: 700;
}
.stamp.kind-state .country {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 2px;
  display: block;
}
.stamp.kind-state .verb {
  font-size: 9px;
  letter-spacing: 0.20em;
}
.stamp.kind-state .codes {
  font-size: 9px;
  margin-top: 2px;
}
.stamp.kind-state .date {
  font-size: 9.5px;
  margin-top: 1px;
}

.stamp .country {
  font-size: 14px; font-weight: 800;
  letter-spacing: 0.10em;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px; margin-bottom: 4px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.stamp.shape-circle .country, .stamp.shape-square .country {
  border-bottom: 0; padding-bottom: 0; display: block; font-size: 13px;
}
.stamp .verb { font-size: 10px; letter-spacing: 0.16em; font-weight: 700; }
.stamp .date { font-family: var(--font-mrz); font-size: 11px; letter-spacing: 0.08em; margin-top: 3px; }
.stamp .codes { font-family: var(--font-mrz); font-size: 9px; margin-top: 3px; letter-spacing: 0.14em; opacity: 0.9; }
.stamp .plane { position: absolute; top: 4px; left: 4px; font-size: 11px; opacity: 0.85; }
.stamp.shape-circle .plane { position: static; display: block; font-size: 15px; margin-bottom: 2px; }

.stamp.color-red    { --c: var(--stamp-red); }
.stamp.color-blue   { --c: var(--stamp-blue); }
.stamp.color-green  { --c: var(--stamp-green); }
.stamp.color-purple { --c: var(--stamp-purple); }
.stamp.color-brown  { --c: var(--stamp-brown); }
.stamp.color-black  { --c: var(--stamp-black); }
.stamp.dense .country { font-size: 12px; letter-spacing: 0.06em; }

/* ===========================================================================
   FLIGHT LOG PAGE
   --------------------------------------------------------------------------- */
.log-page { padding: 0; }
.log {
  position: relative; z-index: 2;
  padding: 8px 22px 22px;
  height: calc(100% - 40px);
  display: flex; flex-direction: column; gap: 8px;
  color: var(--pp-ink);
}
.inner-scroll { flex: 1; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(45,77,155,0.30) transparent; }
.inner-scroll::-webkit-scrollbar { width: 6px; }
.inner-scroll::-webkit-scrollbar-thumb { background: rgba(45,77,155,0.30); border-radius: 3px; }

.log table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-family: var(--font-mrz);
}
.log th {
  text-align: left;
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--pp-blue-deep);
  padding: 6px 4px;
  border-bottom: 1px solid rgba(45,77,155,0.30);
  position: sticky; top: 0; background: var(--pp-paper);
  font-family: var(--font-sans); font-weight: 700;
}
.log td {
  padding: 4px 4px;
  border-bottom: 1px dashed rgba(45,77,155,0.18);
  color: var(--pp-ink);
}
.log td.route { font-weight: 700; letter-spacing: 0.08em; color: var(--pp-blue-deep); }
.log td.airline { color: var(--pp-ink-2); }
.log td.miles { text-align: right; font-variant-numeric: tabular-nums; }

/* ===========================================================================
   STATS VIEW (standalone tab)
   --------------------------------------------------------------------------- */
.view-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  color: var(--ink-1);
}
.view-header { margin-bottom: 18px; }
.view-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 3.8vw, 38px);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}
.view-header .muted { font-size: 13px; }

.hero-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.hero {
  padding: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.hero .num {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.hero .label {
  margin-top: 6px;
  font-size: 10px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--ink-2);
}
.hero .sub { margin-top: 4px; font-size: 12px; color: var(--ink-3); }

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.card {
  padding: 16px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.span-2,
.card.span-2 { grid-column: 1 / -1; }
.card h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink-1);
}
.card h2 .muted { font-size: 11px; margin-left: 4px; }

.weekday-chart {
  display: flex; align-items: end; gap: 8px;
  height: 140px;
}
.weekday-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
}
.weekday-labels {
  display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 8px;
  text-align: center; color: var(--ink-3); font-size: 11px; letter-spacing: 0.10em;
}

.distance-bars { display: grid; gap: 12px; }
.distance-bars .row {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center;
  font-size: 13px;
}
.distance-bars .track {
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}
.distance-bars .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
}
.distance-bars .mul { font-family: var(--font-mrz); color: var(--ink-1); }

.rank-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rank-list li {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center; gap: 10px;
  font-size: 13px;
}
.rank-list code { font-family: var(--font-mrz); font-size: 12px; color: var(--ink-1); }
.rank-list .rank-bar {
  height: 14px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 7px; min-width: 2%;
}
.rank-list .v { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); }
.rank-list.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}

.extremes-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.extreme-label { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.flight-extreme {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}
.flight-extreme .leg { font-weight: 700; }
.flight-extreme .meta { font-size: 11px; color: var(--ink-3); }
.flight-extreme .val { font-family: var(--font-mrz); font-weight: 700; color: var(--accent); }

/* ===========================================================================
   WORLD & USA VIEWS
   --------------------------------------------------------------------------- */
.map-stage {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px;
}
.map-svg { width: 100%; height: 100%; }
/* The actual show/hide is driven by inline style.display from views.js — these
   rules only handle sizing for each map type. */
.world-svg.world-flat  { aspect-ratio: 2 / 1; height: auto; width: 100%; }
.world-svg.world-globe { aspect-ratio: 1 / 1; height: auto; max-width: 640px; margin: 0 auto; }
.us-svg                { display: block; aspect-ratio: 8 / 5; height: auto; width: 100%; }

/* Map / Globe toggle (in the World view) */
.world-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
}
.world-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  transition: background 180ms, color 180ms;
}
.world-toggle button:hover { color: var(--ink-1); }
.world-toggle button.is-active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: white;
  box-shadow: 0 4px 12px -4px rgba(124, 58, 237, 0.55);
}

/* Globe-specific styles */
.world-globe .land   { fill: rgba(255,255,255,0.10); stroke: rgba(255,255,255,0.18); stroke-width: 0.5; }
.world-globe .land.visited { fill: var(--accent); stroke: var(--accent-2); stroke-width: 0.6; opacity: 0.85; }
.world-globe .graticule { fill: none; stroke: rgba(167, 139, 250, 0.10); stroke-width: 0.5; }
.world-globe .arc       { fill: none; stroke-linecap: round; }
.world-globe .airport-dot { stroke: white; stroke-width: 0.8; }
.world-globe .globe-sphere { transition: none; }

/* World map fills */
.world-svg .land   { fill: rgba(255,255,255,0.10); stroke: rgba(255,255,255,0.18); stroke-width: 0.5; }
.world-svg .land.visited { fill: var(--accent); stroke: var(--accent-2); stroke-width: 0.6; }
.world-svg .graticule { fill: none; stroke: rgba(255,255,255,0.06); stroke-width: 0.4; }
.world-svg .arc       { fill: none; stroke: var(--accent-2); stroke-width: 1; opacity: 0.55; stroke-linecap: round; }
.world-svg .airport-dot { fill: #b32525; stroke: white; stroke-width: 1; }
.world-svg .airport-dot.big { fill: #c8a04a; stroke: #7a1a1a; stroke-width: 1.2; }

/* US map fills */
.us-svg .land { fill: rgba(255,255,255,0.10); stroke: rgba(255,255,255,0.20); stroke-width: 0.7; }
.us-svg .land.visited { fill: var(--accent); stroke: var(--accent-2); stroke-width: 0.7; }
.us-svg .label { font-size: 11px; fill: rgba(255,255,255,0.95); font-family: var(--font-mrz); font-weight: 700; pointer-events: none; letter-spacing: 0.04em; }
.us-svg .label.unvisited { fill: rgba(255,255,255,0.30); font-weight: 500; }

.map-legend {
  margin-top: 10px;
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 11px; color: var(--ink-2);
  letter-spacing: 0.10em; text-transform: uppercase;
}
.map-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }

.us-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px;
}
.us-side { display: grid; gap: 14px; align-content: start; }
.us-tally {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.us-tally .cell {
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
}
.us-tally .cell .big {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1;
}
.us-tally .cell .lbl {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-2);
}

.us-airports li code { color: var(--accent); }

/* ===========================================================================
   ACHIEVEMENTS VIEW
   --------------------------------------------------------------------------- */
.ach-view {
  max-width: 1280px;
}

.ach-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.ach-summary-cell {
  padding: 18px 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
}
.ach-summary-cell .lbl {
  font-size: 10px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--ink-3);
}
.ach-summary-cell .num {
  font-family: var(--font-display);
  font-size: 32px; font-weight: 700; color: var(--ink-1);
  line-height: 1; margin-top: 6px;
}
.ach-summary-cell .num .den {
  font-size: 18px; color: var(--ink-3); font-weight: 500;
}
.ach-progress-bar {
  margin-top: 10px;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden;
}
.ach-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 600ms ease;
}

.ach-filters {
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 18px; padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  flex-wrap: wrap;
}
.ach-filters label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2);
}
.ach-filters label span:first-child {
  letter-spacing: 0.10em; text-transform: uppercase; font-size: 10px;
  color: var(--ink-3);
}
.ach-filters select {
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink-1);
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
}
.ach-filters label.toggle { margin-left: auto; }
.ach-filters input[type="checkbox"] { accent-color: var(--accent); }

.ach-section { margin-bottom: 28px; }
.ach-section-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-1);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ach-card {
  position: relative;
  padding: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  display: grid;
  gap: 8px;
  transition: transform 200ms, background 200ms, border-color 200ms, box-shadow 200ms;
  cursor: pointer;
}
.ach-card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 10px 24px -16px rgba(0,0,0,0.5);
}
.ach-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ach-card.is-locked { opacity: 0.65; }
.ach-card.is-unlocked { background: rgba(167, 139, 250, 0.06); }
.ach-card.is-unlocked:hover { transform: translateY(-2px); }

.ach-card-head {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
}
.ach-icon {
  font-size: 26px;
  filter: grayscale(0.0);
}
.ach-card.is-locked .ach-icon { filter: grayscale(0.85); opacity: 0.6; }
.ach-meta { display: grid; gap: 2px; }
.ach-name {
  font-weight: 700; font-size: 14px; color: var(--ink-1);
  line-height: 1.2;
}
.ach-tier {
  font-size: 9px; letter-spacing: 0.18em; font-weight: 700;
}
.ach-card.tier-bronze   .ach-tier { color: #cd7f32; }
.ach-card.tier-silver   .ach-tier { color: #b8c0cc; }
.ach-card.tier-gold     .ach-tier { color: #d4af37; }
.ach-card.tier-platinum .ach-tier { color: #e6e6ea; }
.ach-card.tier-diamond  .ach-tier { color: #7bd9ea; }

.ach-card.is-unlocked.tier-bronze   { border-left: 3px solid #cd7f32; }
.ach-card.is-unlocked.tier-silver   { border-left: 3px solid #b8c0cc; }
.ach-card.is-unlocked.tier-gold     { border-left: 3px solid #d4af37; }
.ach-card.is-unlocked.tier-platinum { border-left: 3px solid #e6e6ea; }
.ach-card.is-unlocked.tier-diamond  { border-left: 3px solid #7bd9ea; box-shadow: 0 0 18px -8px rgba(123, 217, 234, 0.45); }

.ach-points {
  font-family: var(--font-mrz);
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  background: rgba(124, 58, 237, 0.15);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.30);
}
.ach-card.is-locked .ach-points { color: var(--ink-3); background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }

.ach-desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.4;
}

.ach-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.ach-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 600ms ease;
}
.ach-card.is-unlocked .ach-bar-fill {
  background: linear-gradient(90deg, var(--accent), #50e3c2);
}
.ach-progress {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mrz);
  letter-spacing: 0.06em;
}
.ach-card.is-unlocked .ach-progress { color: #4ade80; }

/* ===========================================================================
   Airline logos (Jxck-S/airline-logos)
   --------------------------------------------------------------------------- */
.airline-logo {
  width: 22px; height: 22px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  vertical-align: middle;
}
.airline-logo.is-missing { display: none; }

.airline-banner {
  max-width: 100%;
  max-height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.airline-banner.is-missing { display: none; }
.flight-airline-banner {
  display: flex; justify-content: center;
  padding: 8px 0 14px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
  margin-bottom: 14px;
}

/* Rank list: logo + code packed into the first column so the bar still uses
   its own 1fr column. Keeps the grid consistent across logo/no-logo rows. */
.rank-list .logo-code {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mrz);
}
.rank-list .logo-code .airline-logo { width: 20px; height: 20px; }
.rank-list .logo-code code { font-size: 11px; }
.rank-list .rank-sub { grid-column: 1 / -1; }

/* Log table: keep the table-cell display intact, use a flex wrapper instead. */
.log-table td.airline {
  font-family: var(--font-mrz);
  white-space: nowrap;
}
.log-table td.airline .airline-logo {
  display: inline-block;
  width: 20px; height: 20px;
  vertical-align: middle;
  margin-right: 8px;
}
.stamp-flight-table td.airline {
  font-family: var(--font-mrz);
  white-space: nowrap;
}
.stamp-flight-table .airline-logo {
  display: inline-block;
  width: 18px; height: 18px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Notable flights extreme cards */
.flight-extreme {
  align-items: center;
}
.extreme-info {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.extreme-info > div { min-width: 0; }

/* ===========================================================================
   Stats — new sections (cadence, aviation, geography)
   --------------------------------------------------------------------------- */

.section-head {
  /* Always span both columns of the parent grid */
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 18px 0 -6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(var(--cols, 12), 1fr);
  gap: 4px;
  align-items: end;
  height: 140px;
  margin-top: 6px;
}
.bar-chart .bar-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: end;
}
.bar-chart .bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 4px 4px 1px 1px;
  min-height: 2px;
  transition: opacity 200ms;
}
.bar-chart .bar:hover { opacity: 0.85; }
.bar-chart .bar-val {
  font-size: 9px;
  font-family: var(--font-mrz);
  color: var(--ink-3);
}
.bar-chart .bar-lbl {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.kpi {
  display: flex; align-items: baseline; gap: 8px;
  margin-top: 4px;
}
.kpi .big {
  font-family: var(--font-display);
  font-size: 40px; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.kpi .den { font-size: 14px; color: var(--ink-3); }
.kpi-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.kpi-row .lbl { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.kpi-row .val { font-family: var(--font-mrz); font-size: 13px; color: var(--ink-1); margin-top: 2px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.small { font-size: 11px; }

/* Calendar heatmap */
.heatmap {
  display: grid; gap: 6px;
  margin-top: 6px;
}
.hm-row {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 6px;
  align-items: center;
}
.hm-year {
  font-family: var(--font-mrz);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.hm-grid {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 2px;
  overflow-x: auto;
}
.hm-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 2px;
  background: rgba(255,255,255,0.04);
  min-width: 9px;
  max-width: 14px;
}
.hm-cell[data-c="0"] { background: rgba(255,255,255,0.04); }
.hm-cell[data-c="1"] { background: rgba(167, 139, 250, 0.22); }
.hm-cell[data-c="2"] { background: rgba(167, 139, 250, 0.45); }
.hm-cell[data-c="3"] { background: rgba(167, 139, 250, 0.70); }
.hm-cell[data-c="4"] { background: rgba(167, 139, 250, 1.0); }
.hm-empty { background: transparent; }
.hm-legend {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.10em; text-transform: uppercase;
  justify-content: flex-end;
  margin-top: 6px;
}
.hm-legend .hm-cell { width: 12px; min-width: 12px; aspect-ratio: 1; }

/* Aircraft list - subtitle below each bar */
.rank-list .rank-sub {
  grid-column: 1 / -1;
  padding-left: 64px;
  margin-top: -2px; margin-bottom: 4px;
  font-size: 10px;
}

/* Enrichment hint card */
.enrich-hint {
  border-left: 3px solid var(--accent);
}
.enrich-hint p {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
  line-height: 1.55;
}
.enrich-hint code {
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--ink-1);
  font-family: var(--font-mrz);
}
.enrich-hint em { color: var(--accent); font-style: normal; font-weight: 600; }

/* Cabin class chart */
.class-bar {
  display: flex;
  width: 100%; height: 28px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 6px;
}
.class-seg { height: 100%; }
.class-legend {
  list-style: none; padding: 0; margin: 10px 0 0;
  display: grid; gap: 4px;
  font-size: 12px;
}
.class-legend li {
  display: flex; align-items: center; gap: 8px;
}
.class-legend .sw {
  width: 10px; height: 10px; border-radius: 2px;
}
.class-legend strong { color: var(--ink-1); margin-left: auto; font-variant-numeric: tabular-nums; }

/* Geography grid */
.geo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.geo-cell {
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
}
.geo-cell .lbl { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.geo-cell .big-line {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-top: 6px;
}

/* Major hubs */
.hub-bar {
  height: 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.hub-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  transition: width 600ms ease;
}
.hub-stats { font-size: 13px; color: var(--ink-1); margin-top: 8px; }
.hub-chip-grid {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 12px;
}
.hub-chip {
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mrz);
  font-size: 10px;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-3);
}
.hub-chip.is-visited {
  background: rgba(167, 139, 250, 0.20);
  border-color: rgba(167, 139, 250, 0.40);
  color: var(--ink-1);
}

/* ===========================================================================
   Country flag strip (World view)
   --------------------------------------------------------------------------- */
.flags-card { margin-top: 14px; }
.flag-strip {
  display: flex; flex-wrap: wrap;
  gap: 8px;
}
.flag-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-1);
  transition: background 180ms, transform 180ms;
}
.flag-chip:hover { background: rgba(167, 139, 250, 0.15); transform: translateY(-1px); }
.flag-chip .flag {
  font-size: 18px;
  line-height: 1;
}
.flag-chip .flag-name { font-weight: 600; }
.flag-chip .flag-count {
  font-family: var(--font-mrz);
  font-size: 11px;
  color: var(--ink-3);
  background: rgba(255,255,255,0.05);
  padding: 2px 6px;
  border-radius: 999px;
}

/* ===========================================================================
   Carbon footprint card (Stats view)
   --------------------------------------------------------------------------- */
.carbon-card {
  border-left: 3px solid #50e3c2;
}
.carbon-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 18px;
  align-items: start;
}
.carbon-headline .num {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1;
  color: #50e3c2;
}
.carbon-headline .num .den {
  font-size: 24px; color: var(--ink-3); font-weight: 500; margin-left: 2px;
}
.carbon-headline .label {
  margin-top: 6px;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-2);
}
.carbon-headline .sub { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

.carbon-context { display: grid; gap: 8px; }
.carbon-context .row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 13px;
}
.carbon-context .row .emoji { font-size: 18px; line-height: 1.4; }
.carbon-context .row strong { color: var(--ink-1); }
.carbon-context .row.caveat {
  font-size: 11px;
  background: transparent;
  border: 0;
}

/* ===========================================================================
   Flight Log view (own tab)
   --------------------------------------------------------------------------- */
.log-view .log-filters {
  margin-bottom: 12px;
}
.log-view #log-search {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink-1);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
}
.log-view #log-search::placeholder { color: var(--ink-3); }
.log-view #log-search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.log-card { padding: 0; overflow: hidden; }
.log-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.log-table th {
  text-align: left;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  position: sticky; top: 0; z-index: 1;
}
.log-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--ink-1);
}
.log-table tbody tr {
  cursor: pointer;
  transition: background 150ms;
}
.log-table tbody tr:hover, .log-table tbody tr:focus {
  background: rgba(167, 139, 250, 0.10);
  outline: none;
}
.log-table td.date { font-family: var(--font-mrz); color: var(--ink-2); white-space: nowrap; }
.log-table td.route {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mrz); letter-spacing: 0.04em;
}
.log-table td.route .arrow { color: var(--ink-3); }
.log-table td.route .cities { font-family: var(--font-sans); font-size: 11px; }
.log-table td.airline { color: var(--ink-2); font-family: var(--font-mrz); }
.log-table td.miles { text-align: right; font-variant-numeric: tabular-nums; color: var(--accent); }
.log-table td.duration { color: var(--ink-3); font-family: var(--font-mrz); }

/* ===========================================================================
   Flight detail modal
   --------------------------------------------------------------------------- */
.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 10, 31, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 200ms ease;
}
.modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  background: linear-gradient(180deg, #0e1535 0%, #0a0f2c 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: slideUp 240ms cubic-bezier(.2, .9, .3, 1);
  transition: width 220ms ease;
}
.modal-panes {
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
  max-height: calc(100dvh - 40px);
}
.modal-body, .modal-side {
  padding: 24px;
  overflow: auto;
}
.modal-side {
  border-left: 1px solid rgba(255,255,255,0.08);
  position: relative;
  background: rgba(0,0,0,0.10);
}
.modal-side-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  background: rgba(255,255,255,0.05);
}
.modal-side-close:hover { background: rgba(255,255,255,0.12); color: var(--ink-1); }
.modal.has-side .modal-card {
  width: min(1080px, calc(100% - 32px));
}
.modal.has-side .modal-panes {
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
}
@media (max-width: 760px) {
  .modal.has-side .modal-card { width: 100%; max-height: 100dvh; }
  .modal.has-side .modal-panes { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .modal-side { border-left: 0; border-top: 1px solid rgba(255,255,255,0.08); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  background: rgba(255,255,255,0.04);
  transition: background 180ms, color 180ms;
}
.modal-close:hover { background: rgba(255,255,255,0.10); color: var(--ink-1); }

.flight-detail-head {
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.route-big {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.route-big .airport { text-align: center; }
.route-big .airport .code {
  font-family: var(--font-display);
  font-weight: 700; font-size: 36px;
  color: var(--accent); line-height: 1;
}
.route-big .airport .city {
  font-size: 13px;
  color: var(--ink-1);
  margin-top: 4px;
}
.route-big .airport .muted { font-size: 11px; }
.route-big .arrow-big {
  color: var(--accent-2);
  display: grid; place-items: center;
  text-align: center;
}
.route-big .arrow-big .small {
  font-size: 11px; letter-spacing: 0.10em; margin-top: 2px;
}
.flight-detail-head h2 {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.flight-details {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 18px;
}
.detail-row {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.detail-row dt {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3);
}
.detail-row dd {
  margin: 0;
  font-size: 13px;
  color: var(--ink-1);
}

/* ===========================================================================
   Stamp detail modal
   --------------------------------------------------------------------------- */
.stamp-detail-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 14px;
}
.stamp-flag {
  font-size: 56px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.30));
}
.stamp-region {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3);
}
.stamp-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  color: var(--ink-1);
  margin: 4px 0 0;
}

.stamp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stamp-stat {
  padding: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  text-align: center;
}
.stamp-stat .lbl { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.stamp-stat .val { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--accent); margin-top: 4px; line-height: 1; }

.stamp-dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  font-size: 12px; color: var(--ink-2);
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 12px;
}
.stamp-dates .lbl { color: var(--ink-3); letter-spacing: 0.10em; text-transform: uppercase; font-size: 10px; margin-right: 6px; }
.stamp-dates .val { color: var(--ink-1); font-family: var(--font-mrz); }

.stamp-section-h {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 14px 0 8px;
  font-weight: 700;
}

.ap-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 4px;
}
.ap-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  font-size: 12px;
}
.ap-list code { font-family: var(--font-mrz); color: var(--accent); font-weight: 600; }
.ap-list .ap-name { color: var(--ink-1); }
.ap-list .ap-city { font-size: 11px; }
.ap-list .ap-count { margin-left: auto; font-family: var(--font-mrz); color: var(--accent); }

.stamp-flight-table-wrap {
  max-height: 240px;
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.stamp-flight-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mrz);
}
.stamp-flight-table th {
  text-align: left;
  font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-3);
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  font-family: var(--font-sans);
  position: sticky; top: 0;
}
.stamp-flight-table td {
  padding: 5px 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.06);
  color: var(--ink-1);
}
.stamp-flight-table td.route { color: var(--accent); letter-spacing: 0.04em; }
.stamp-flight-table td.airline { color: var(--ink-2); }
.stamp-flight-table td.miles { text-align: right; font-variant-numeric: tabular-nums; }

/* ===========================================================================
   Achievement detail modal
   --------------------------------------------------------------------------- */
.ach-detail-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 14px;
}
.ach-detail-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
}
.ach-detail-icon.tier-bronze   { border-color: #cd7f32; box-shadow: inset 0 0 0 1px rgba(205,127,50,0.30); }
.ach-detail-icon.tier-silver   { border-color: #b8c0cc; box-shadow: inset 0 0 0 1px rgba(184,192,204,0.30); }
.ach-detail-icon.tier-gold     { border-color: #d4af37; box-shadow: inset 0 0 0 1px rgba(212,175,55,0.40); }
.ach-detail-icon.tier-platinum { border-color: #e6e6ea; box-shadow: inset 0 0 0 1px rgba(230,230,234,0.40); }
.ach-detail-icon.tier-diamond  { border-color: #7bd9ea; box-shadow: inset 0 0 0 1px rgba(123,217,234,0.40); }

.ach-detail-cat {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.ach-detail-name {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  color: var(--ink-1);
  margin: 4px 0 4px;
}
.ach-detail-desc { font-size: 13px; color: var(--ink-2); }

.ach-detail-progress {
  margin: 12px 0 16px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}
.ach-detail-progress.unlocked {
  background: rgba(74, 222, 128, 0.10);
  border: 1px solid rgba(74, 222, 128, 0.30);
  color: #86efac;
  font-weight: 700;
  text-align: center;
}
.ach-detail-bar {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.ach-detail-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  border-radius: 999px;
}
.ach-detail-numbers {
  margin-top: 8px;
  font-size: 13px; color: var(--ink-1);
  text-align: center;
}

.ach-earned, .ach-needs, .ach-items {
  margin-top: 14px;
}
.ach-earned .lbl, .ach-needs .lbl, .ach-items .lbl {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.earned-flight {
  padding: 10px 12px;
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mrz);
  font-size: 13px;
}
.earned-flight .earned-left {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.earned-flight .earned-left .airline-logo {
  width: 32px; height: 32px;
}
.earned-flight .earned-text { display: flex; flex-direction: column; min-width: 0; }
.earned-flight .route { color: var(--accent); font-weight: 700; }
.earned-flight .earned-date {
  font-size: 11px;
  white-space: nowrap;
}

.ach-items-list {
  display: flex; flex-wrap: wrap;
  gap: 4px;
}
.ach-item {
  padding: 4px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-1);
  display: inline-flex; align-items: center; gap: 4px;
}
.ach-item code {
  font-family: var(--font-mrz);
  color: var(--accent);
}
.ach-item.is-visited { background: rgba(74, 222, 128, 0.10); border-color: rgba(74, 222, 128, 0.30); }
.ach-item.is-missing { opacity: 0.45; }
.ach-item-date { color: var(--ink-3); font-size: 11px; font-family: var(--font-mrz); margin-left: 4px; }

/* Compact flight row inside achievement modals (clickable to side pane) */
.ach-flight-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.20);
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}
.ach-flight-row:hover {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.40);
}
.ach-flight-row.is-active {
  background: rgba(167, 139, 250, 0.22);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.30) inset;
}
.ach-flight-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.ach-flight-row[data-fi=""] { cursor: default; }
.ach-flight-row[data-fi=""]:hover { background: rgba(167, 139, 250, 0.06); border-color: rgba(167, 139, 250, 0.20); }
.ach-flight-row .airline-logo { width: 24px; height: 24px; }
.ach-flight-info {
  min-width: 0;    /* let the meta line shrink+ellipsis instead of pushing layout */
  overflow: hidden;
}
.ach-flight-route {
  font-family: var(--font-mrz);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.ach-flight-meta {
  font-size: 11px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ach-flight-side {
  text-align: right;
  font-family: var(--font-mrz);
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.ach-flight-side .muted.small { font-size: 10px; }

/* Rank rows (airline / route / year / etc.) inside maxof sections */
.ach-rank-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}
.ach-rank-row code {
  font-family: var(--font-mrz);
  color: var(--accent);
  font-weight: 600;
}
.ach-rank-name { color: var(--ink-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-rank-v { font-family: var(--font-mrz); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ach-rank-row .logo-code { display: inline-flex; align-items: center; gap: 6px; }
.ach-rank-row .airline-logo { width: 18px; height: 18px; }

/* Layover Legend — paired arrival + departure flights */
.ach-layover-pair {
  display: grid; gap: 8px;
  padding: 10px;
  background: rgba(167, 139, 250, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 10px;
}
.ach-layover-label {
  font-size: 13px;
  color: var(--ink-1);
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(167, 139, 250, 0.25);
}
.ach-layover-step { display: grid; gap: 4px; }
.ach-layover-arrow {
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-3);
  padding-left: 4px;
}

/* Multi-Leg Monster trip detail */
.ach-trip-detail {
  display: grid; gap: 6px;
}
.ach-trip-summary {
  padding: 10px 12px;
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 8px;
  color: var(--ink-1);
  margin-bottom: 4px;
}
.ach-trip-leg {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
}
.ach-trip-leg-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.40);
  color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-mrz);
  font-size: 12px;
  font-weight: 700;
}
.ach-trip-leg .ach-flight-row { margin-bottom: 0; }

/* Yearly Commitment / streak detail */
.ach-streak-detail { display: grid; gap: 10px; }
.ach-streak-window {
  padding: 10px 12px;
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.30);
  border-radius: 8px;
  text-align: center;
  color: var(--ink-1);
}
.ach-streak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.ach-streak-cell {
  text-align: center;
  padding: 6px 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  font-size: 11px;
}
.ach-streak-cell .m {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-1);
  font-size: 13px;
}
.ach-streak-cell .y { font-size: 10px; }
.ach-streak-cell .c {
  font-family: var(--font-mrz);
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

/* ===========================================================================
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; padding: 10px 14px; }
  .view-tabs { order: 3; flex-basis: 100%; justify-content: center; }
  .book-wrap { padding: 4px 12px; }
  .nav-arrow { width: 40px; height: 40px; }
  .nav-prev { left: 0; }
  .nav-next { right: 0; }
  .hero-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2col { grid-template-columns: 1fr; }
  .extremes-grid { grid-template-columns: 1fr; }
  .us-grid { grid-template-columns: 1fr; }
  .rank-list.two-col { grid-template-columns: 1fr; }
  .carbon-grid { grid-template-columns: 1fr; }
  .flight-details { grid-template-columns: 1fr; }
  .log-table td.route { font-size: 12px; }
  .log-table td.route .cities { display: none; }
}
@media (max-width: 720px) {
  .stamps-grid { grid-template-columns: 1fr; }
  .hero-row { grid-template-columns: 1fr 1fr; }
  .book { aspect-ratio: 10 / 8; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-stars::after, .cover-shimmer { animation: none; }
  .sheet { transition: none; }
}
