/* ============================================
   Timeline Scan — Export / delivery detail pages
   Shared by /export/google-photos/, /export/immich/,
   and /export/download/. Extends the "Warm Heirloom
   Album" system in styles.css — no new palette, the
   design effort goes into three signature pieces:

   1. .xp-ledger  — a packing-manifest of what travels
                    with the photos and what stays behind
   2. .xp-gp / .xp-im — annotated faux app info-panels
                    ("screenshots" with fixed colors so
                    they read the same in both themes)
   3. .xp-tree    — heirloom folder trees for the
                    download-layout examples
   ============================================ */

/* ---------- Hero icon ----------
   Each /export/ page opens with the destination's logo so the jump
   from a homepage card to its page is visually obvious. Block-level
   (not inline-flex): the tagline below it is itself inline-flex, so an
   inline icon would share its line instead of sitting above it. */
.xp-hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-md);
  margin: 0 auto 1.3rem;
}

.xp-hero-icon svg,
.xp-hero-icon .xp-app-icon {
  width: 42px;
  height: 42px;
  display: block;
}

/* Timeline Scan's own app icon, theme-swapped like .nav__logo-icon. */
.xp-app-icon {
  display: block;
  width: 30px;
  height: 30px;
  background: url("../images/logo/light_nav@2x.png") center/contain no-repeat;
}

[data-theme="dark"] .xp-app-icon {
  background-image: url("../images/logo/dark_nav@2x.png");
}

/* ---------- Hero badge chips ---------- */
.xp-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.4rem auto 0;
}

.xp-badge {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  white-space: nowrap;
}

/* ---------- Section headers (shared) ---------- */
.xp-head {
  max-width: 640px;
  margin: 0 auto 2.6rem;
  text-align: center;
}

.xp-head .fix-dates-kicker {
  margin-bottom: 0.6rem;
}

.xp-head p {
  font-size: 1.02rem;
  line-height: 1.75;
}

/* ---------- Direction diagram ----------
   Two endpoints joined by labelled lanes. The Google page
   shows one gold delivery lane plus a struck-through return
   lane; the Immich page shows two live lanes. */
.xp-route {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.8rem 2rem;
}

.xp-route__row {
  display: grid;
  grid-template-columns: 1fr minmax(140px, 1.4fr) 1fr;
  align-items: center;
  gap: 1rem;
}

.xp-route__end {
  text-align: center;
}

.xp-route__end-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.55rem;
}

.xp-route__end-logo svg,
.xp-route__end-logo img {
  width: 30px;
  height: 30px;
  display: block;
}

.xp-route__end-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.xp-route__end-sub {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.xp-route__lanes {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.xp-route__lane {
  text-align: center;
}

.xp-route__lane-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.xp-route__lane-arrow {
  position: relative;
  display: block;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--accent) 18%, var(--accent) 82%, transparent);
}

.xp-route__lane-arrow::after {
  content: '';
  position: absolute;
  right: 8%;
  top: 50%;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

.xp-route__lane--back .xp-route__lane-arrow {
  background: linear-gradient(to left, transparent, var(--accent) 18%, var(--accent) 82%, transparent);
}

.xp-route__lane--back .xp-route__lane-arrow::after {
  right: auto;
  left: 8%;
  border: none;
  border-bottom: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  transform: translateY(-50%) rotate(45deg);
}

/* Blocked return lane (Google page): muted, dashed, sealed. */
.xp-route__lane--blocked .xp-route__lane-label {
  color: var(--text-muted);
}

.xp-route__lane--blocked .xp-route__lane-arrow {
  background: none;
  border-top: 2px dashed var(--border);
  height: 0;
}

.xp-route__lane--blocked .xp-route__lane-arrow::after {
  content: '\00D7';
  right: auto;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  transform: translate(-50%, -50%) rotate(0);
}

.xp-route__foot {
  margin: 1.4rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Transfer ledger (packing manifest) ---------- */
.xp-ledger {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.xp-ledger__group {
  padding: 0.4rem 0 0.9rem;
}

.xp-ledger__group + .xp-ledger__group {
  border-top: 1px solid var(--border-light);
  background: var(--bg-warm); /* fallback for older browsers */
  background: color-mix(in srgb, var(--bg-warm) 55%, transparent);
}

.xp-ledger__caption {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1.1rem 1.6rem 0.35rem;
}

.xp-ledger__group--stays .xp-ledger__caption {
  color: var(--text-muted);
}

.xp-ledger__row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.85rem 1.6rem;
}

.xp-ledger__row + .xp-ledger__row {
  border-top: 1px dashed var(--border-light);
}

.xp-ledger__stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  align-self: start;
  margin-top: 0.1rem;
  color: var(--green);
  background: var(--green-light);
  border: 1px solid var(--green-light); /* fallback for older browsers */
  border-color: color-mix(in srgb, var(--green) 35%, transparent);
}

.xp-ledger__row--stays .xp-ledger__stamp {
  color: var(--text-muted);
  background: var(--bg-accent);
  border-color: var(--border);
}

.xp-ledger__term {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.15rem;
}

.xp-ledger__detail {
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

.xp-ledger__detail a {
  font-weight: 600;
}

/* ---------- Annotated app-panel mocks ----------
   The mock is a "screenshot": fixed colors, deliberately NOT
   theme-aware, framed like a photograph of someone else's app.
   Numbered gold markers inside pair with the key list beside it. */
.xp-shotgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(240px, 1fr);
  gap: 2.2rem;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.xp-shot {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.xp-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #B8860B;
  color: #FFFDF8;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(61, 43, 31, 0.35);
}

.xp-keys {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.xp-keys__item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.xp-keys__item .xp-marker {
  align-self: start;
  margin-top: 0.15rem;
}

.xp-keys__title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.15rem;
}

.xp-keys__body {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.xp-shot-caption {
  max-width: 960px;
  margin: 1.2rem auto 0;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
}

/* ── Marker ↔ key linking ──
   Pointing at (or tapping) a numbered explanation highlights the same
   number inside the app panel, and vice versa (js/export-pages.js). */
.xp-keys__item {
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.55rem;
  margin: -0.4rem -0.55rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.xp-keys__item.is-linked {
  background: var(--accent-glow);
}

.xp-marker {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.is-linked .xp-marker,
.xp-marker.is-linked {
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 1px 6px rgba(61, 43, 31, 0.4);
}

/* Rows keyed inside the mock glow when their explanation is pointed at.
   The outline colors are fixed like the mocks themselves. */
.xp-gp__row[data-xp-key].is-linked,
.xp-gp__field[data-xp-key].is-linked,
.xp-im__row[data-xp-key].is-linked,
.xp-im__desc[data-xp-key].is-linked,
.xp-im__people[data-xp-key].is-linked {
  border-radius: 6px;
  outline: 2px solid #B8860B;
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(184, 134, 11, 0.45);
}

/* Keep absolutely-positioned markers pinned while scaled. */
.xp-gp__row .xp-marker.is-linked,
.xp-im__row .xp-marker.is-linked {
  transform: translateY(-50%) scale(1.35);
}

/* Marker placement variants (replace one-off inline styles). */
.xp-marker--pin {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.xp-marker--pin.is-linked {
  transform: translateY(-50%) scale(1.35);
}

.xp-marker--flex {
  position: static;
  transform: none;
}

/* ── Google Photos info-panel mock (always light, Material-ish) ── */
.xp-gp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  background: #202124;
  font-family: var(--font-ui);
}

.xp-gp__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  min-height: 300px;
}

.xp-gp__photo {
  max-width: 100%;
  max-height: 280px;
  border-radius: 2px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  display: block;
}

.xp-gp__stage-bar {
  position: absolute;
  top: 0.8rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  color: #E8EAED;
  font-size: 0.8rem;
  opacity: 0.85;
}

.xp-gp__panel {
  background: #FFFFFF;
  color: #3C4043;
  padding: 1rem 1.1rem 1.2rem;
  font-size: 0.78rem;
  line-height: 1.45;
  border-left: 1px solid #DADCE0;
}

.xp-gp__panel-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #202124;
  margin: 0 0 0.9rem;
}

.xp-gp__field {
  border: 1px solid #DADCE0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  color: #9AA0A6;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.xp-gp__section {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5F6368;
  margin: 1rem 0 0.45rem;
}

.xp-gp__row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.45rem 26px 0.45rem 0; /* right padding clears the marker */
  position: relative;
}

.xp-gp__row-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #5F6368;
}

.xp-gp__row-primary {
  color: #202124;
  font-weight: 500;
}

.xp-gp__row-secondary {
  color: #5F6368;
  font-size: 0.72rem;
  margin-top: 1px;
}

.xp-gp__row .xp-marker,
.xp-im__row .xp-marker {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ── Immich detail-panel mock (always dark) ── */
.xp-im {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  background: #0F172A;
  font-family: var(--font-ui);
}

.xp-im__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.6rem;
  min-height: 300px;
}

.xp-im__photo {
  max-width: 100%;
  max-height: 280px;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  display: block;
}

.xp-im__panel {
  background: #1E293B;
  color: #CBD5E1;
  padding: 1rem 1.1rem 1.2rem;
  font-size: 0.78rem;
  line-height: 1.5;
  border-left: 1px solid #334155;
}

.xp-im__panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #F1F5F9;
  margin: 0 0 0.9rem;
}

.xp-im__section {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #94A3B8;
  margin: 1rem 0 0.45rem;
}

.xp-im__row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.45rem 26px 0.45rem 0; /* right padding clears the marker */
  position: relative;
}

.xp-im__row-icon {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: #94A3B8;
}

.xp-im__row-primary {
  color: #F1F5F9;
  font-weight: 500;
}

.xp-im__row-secondary {
  color: #94A3B8;
  font-size: 0.72rem;
  margin-top: 1px;
}

.xp-im__desc {
  background: #0F172A;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 0.55rem 30px 0.55rem 0.7rem; /* right padding clears the marker */
  color: #E2E8F0;
  font-style: italic;
  position: relative;
}

.xp-im__people {
  display: flex;
  gap: 0.7rem;
  padding: 0.45rem 0;
  position: relative;
}

.xp-im__person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #CBD5E1;
  font-size: 0.68rem;
}

.xp-im__person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #334155;
}

/* ---------- Download layout cards + folder trees ---------- */
.xp-layouts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  max-width: 980px;
  margin: 0 auto;
}

.xp-layout-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
}

.xp-layout-card::before {
  content: '';
  position: absolute;
  inset: 16px auto 16px 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(to bottom, transparent, var(--accent), transparent);
  opacity: 0.5;
}

.xp-layout-card__tag {
  position: absolute;
  top: 1.15rem;
  right: 1.3rem;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
}

.xp-layout-card__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.45rem;
  padding-right: 5.5rem;
}

.xp-layout-card__desc {
  font-family: var(--font-body);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.xp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

/* Pills are real buttons: tap one and the example tree below animates
   to that layout (js/export-pages.js). */
.xp-pill {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.xp-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.xp-pill:active {
  transform: scale(0.96);
}

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

.xp-pill--active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Tree swap animation: the arriving tree fades in and settles upward. */
@keyframes xp-tree-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.xp-tree--enter {
  animation: xp-tree-enter 0.35s ease both;
}

.xp-tree[hidden] {
  display: none;
}

/* Folder tree — evokes the dashboard's "What you'll get" preview.
   Inside a layout card the tree follows the description directly and
   grows to the card's bottom edge, so the example boxes in a row end
   level with each other instead of floating apart. */
.xp-tree {
  list-style: none;
  margin: 0;
  flex: 1 0 auto;
  padding: 1rem 1.1rem;
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.xp-tree ul {
  list-style: none;
  margin: 0.15rem 0 0.3rem;
  padding-left: 1.05rem;
  border-left: 1px dotted var(--border);
}

.xp-tree li {
  padding: 0.14rem 0;
}

.xp-tree__icon {
  margin-right: 0.4rem;
}

.xp-tree__folder > .xp-tree__label {
  font-weight: 600;
}

.xp-tree__count {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  margin-left: 0.45rem;
  white-space: nowrap;
}

.xp-tree__file {
  color: var(--text-secondary);
}

.xp-tree__more {
  color: var(--text-muted);
  font-style: italic;
}

.xp-tree__note {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.08rem 0.55rem;
  margin-left: 0.45rem;
  white-space: nowrap;
}

.xp-layout-card__foot {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0.9rem 0 0;
}

/* ---------- Immich library-scan finder card ----------
   A small "results sheet": the badge-and-summary bar sits above a
   reused .xp-tree list of photos stuck on their scan date. */
.xp-finder {
  max-width: 640px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.6rem 1.5rem;
}

.xp-finder__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.xp-finder__summary {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.xp-finder__foot {
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Good-to-know card grid ---------- */
.xp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.3rem;
  max-width: 980px;
  margin: 0 auto;
}

.xp-cards .card h3 {
  font-size: 1.15rem;
}

.xp-cards .card p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0;
}

.xp-cards .card p + p {
  margin-top: 0.6rem;
}

/* ---------- Sibling cross-links ---------- */
.xp-next {
  max-width: 760px;
  margin: 0 auto;
}

.xp-next__title {
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 1.1rem;
}

.xp-next__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.xp-next__card {
  flex: 1 1 240px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem 1.1rem;
  color: var(--text-primary);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.xp-next__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.xp-next__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.xp-next__logo svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* The text column between the logo and the arrow: name on its own line,
   subtitle below (the spans are inline by default, which let the subtitle
   flow into and wrap over the title line). */
.xp-next__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.xp-next__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.xp-next__sub {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.xp-next__arrow {
  margin-left: auto;
  color: var(--accent);
  font-size: 1.05rem;
}

/* ---------- Attribution small print ---------- */
.xp-attribution {
  max-width: 640px;
  margin: 2.4rem auto 0;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ---------- Immich page feature gate ----------
   Fail closed, mirroring scanning.html: if config.js never runs,
   data-immich-enabled is absent, the live page stays hidden and
   the closed-state notice renders. A bottom-of-page script also
   removes the inactive block from the DOM. */
html:not([data-immich-enabled="true"]) .xp-immich-live {
  display: none;
}

html[data-immich-enabled="true"] .xp-immich-closed {
  display: none;
}

.xp-closed {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.xp-closed__badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1.1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .xp-shotgrid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .xp-layouts {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .xp-cards {
    grid-template-columns: 1fr;
    max-width: 560px;
  }
}

@media (max-width: 640px) {
  .xp-route {
    padding: 1.4rem 1.2rem;
  }

  .xp-route__row {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  /* Stack endpoints above/below the lanes on phones; rotate the
     lane arrows' reading order implicitly via the labels. */
  .xp-route__lanes {
    order: 2;
  }

  .xp-route__end--from {
    order: 1;
  }

  .xp-route__end--to {
    order: 3;
  }

  .xp-gp,
  .xp-im {
    grid-template-columns: 1fr;
  }

  .xp-gp__panel {
    border-left: none;
    border-top: 1px solid #DADCE0;
  }

  .xp-im__panel {
    border-left: none;
    border-top: 1px solid #334155;
  }

  .xp-finder {
    padding: 1.2rem 1.1rem 1.3rem;
  }

  .xp-ledger__row {
    padding: 0.85rem 1.1rem;
  }

  .xp-ledger__caption {
    padding: 1rem 1.1rem 0.3rem;
  }
}
