body.scrapbook[data-wallpaper] {
  background: linear-gradient(180deg, var(--wallpaper-tint), #fffdfd 55%, var(--wallpaper-tint));
}
body.scrapbook[data-wallpaper]::before {
  background-image: var(--wallpaper-image);
  background-size: 254px 215px;
  opacity: .38;
}
body[data-wallpaper="hearts"] { --wallpaper-tint: #fff2f5; --wallpaper-image: url('patterns/hearts.svg'); }
body[data-wallpaper="stars"] { --wallpaper-tint: #f5f0ff; --wallpaper-image: url('patterns/stars.svg'); }
body[data-wallpaper="leaves"] { --wallpaper-tint: #eef8f2; --wallpaper-image: url('patterns/leaves.svg'); }
body[data-wallpaper="waves"] { --wallpaper-tint: #eef7fd; --wallpaper-image: url('patterns/waves.svg'); }
body[data-wallpaper="daisies"] { --wallpaper-tint: #fff8e9; --wallpaper-image: url('patterns/daisies.svg'); }
.wallpaper-preview { display: flex; flex-wrap: wrap; gap: .4rem .85rem; align-items: center; }
.wallpaper-preview a[aria-current="true"] { font-weight: bold; text-decoration: underline; }

body[data-wallpaper="hearts"] {
  --theme-paper: #fff4f7; --theme-soft: #fce3ec; --theme-line: #e5b4c7;
  --theme-ink: #854760; --theme-accent: #a95375;
}
body[data-wallpaper="stars"] {
  --theme-paper: #f7f1ff; --theme-soft: #eee2fa; --theme-line: #cfb9e8;
  --theme-ink: #58416f; --theme-accent: #78549e;
}
body[data-wallpaper="leaves"] {
  --theme-paper: #f1faf4; --theme-soft: #e1f2e6; --theme-line: #afd3bc;
  --theme-ink: #365c46; --theme-accent: #477959;
}
body[data-wallpaper="waves"] {
  --theme-paper: #f0f8fe; --theme-soft: #e0effa; --theme-line: #afd0e7;
  --theme-ink: #35556d; --theme-accent: #45769a;
}
body[data-wallpaper="daisies"] {
  --theme-paper: #fff9ed; --theme-soft: #fff0d3; --theme-line: #e2c68e;
  --theme-ink: #644c26; --theme-accent: #886323;
}
body.scrapbook[data-wallpaper] {
  --ink: var(--theme-ink); --muted: var(--theme-accent);
  --paper: var(--theme-paper); --bg: var(--wallpaper-tint);
  --rose: var(--theme-accent); --sage: var(--theme-accent);
  --rose-light: var(--theme-soft); --line: var(--theme-line);
  --shadow: 3px 6px 0 var(--theme-soft);
}
body[data-wallpaper] :is(.card, .scrap-sheet, .login-card, .flash, .album-card, dialog, .mobile-nav) {
  color: var(--theme-ink); background: var(--theme-paper);
  border-color: var(--theme-line); box-shadow: var(--shadow);
}
body[data-wallpaper] :is(.journal-action, .button, .journal-ribbon, .scrap-tabs > a, .scrap-note, .note-sticker, .footprint-home-link, .drop-zone, .album-cover, .album-create, .identity-picker span, .page-back, .together-banner, .tiny-label, .date-icon, .pill) {
  color: var(--theme-ink); background: var(--theme-paper);
  border-color: var(--theme-line);
}
body[data-wallpaper] :is(.button, .journal-action, .scrap-tabs > a, .journal-ribbon, .scrap-note, .album-cover) {
  box-shadow: 2px 3px 0 var(--theme-soft);
}
body[data-wallpaper] :is(.primary, .button:hover, .journal-action:hover, .journal-action > span, .scrap-tabs > a.selected, .mobile-nav a.selected, .identity-picker input:checked + span, .privacy-note, .daily-answer, .file-summary, .paper-tape) {
  color: var(--theme-ink); background: var(--theme-soft);
  border-color: var(--theme-line);
}
body[data-wallpaper] :is(h1, h2, h3, .counter-label, .counter-unit, .journal-subtitle, .journal-scribble, .journal-scribble span, .scrap-brand strong, .scrap-date-row strong, .login-story > p) {
  color: var(--theme-ink);
}
body[data-wallpaper] :is(.journal-counter strong, .journal-greeting > span, .eyebrow, .journal-date, .journal-date > span, .subtle-link, .text-button, .helper, .muted, .scrap-date-row b, .scrap-date-row small, .scrap-date-row > span, .scrap-tabs .icon, .mobile-nav a, .journal-ribbon .icon) {
  color: var(--theme-accent);
}
body[data-wallpaper] :is(.journal-ribbon .icon, .scrap-tabs .tab-bow) {
  fill: var(--theme-soft);
}
body[data-wallpaper] .stack :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  color: var(--theme-ink); background: var(--theme-paper); border-color: var(--theme-line);
}
body[data-wallpaper] :focus-visible { outline-color: var(--theme-accent); }
body[data-wallpaper] :is(.intro-sticker.three, .intro-sticker.four, .corner-bow) .icon {
  color: var(--theme-line);
  fill: var(--theme-soft);
}
body[data-wallpaper] .date-edit {
  color: var(--theme-accent);
  border-color: var(--theme-line);
}

/* Guest notices and login content are stacked in the same reading order. */
.guest main {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}
.guest main > * { min-width: 0; max-width: 100%; }
.guest .login-layout { width: 100%; }
.guest .identity-picker > label { min-width: 0; }
.guest .identity-picker span { white-space: normal; overflow-wrap: anywhere; }

body[data-wallpaper]:not([data-wallpaper="hearts"]) :is(
  .travel-stats > div, .map-board, .map-search-results, .map-controls,
  .selected-city, .travel-city, .manual-city-fields
) {
  background: var(--theme-paper);
  border-color: var(--theme-line);
  box-shadow: var(--shadow);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) :is(
  .travel-stats strong, .travel-stats .icon, .map-heading .icon,
  .travel-city b, .together-banner em, .anniversary-count strong,
  .heading-dot, .scrap-footer a
) { color: var(--theme-accent); }
body[data-wallpaper]:not([data-wallpaper="hearts"]) :is(
  .travel-stats span, .map-legend, .map-search > label, .map-controls button,
  .selected-city strong, .selected-city p, .map-footnote, .map-footnote a,
  .travel-city p, .travel-city > span, .travel-wish p, .travel-wish h3 span,
  .travel-timeline-item > time, .travel-timeline-item p,
  .anniversary-count > span, .anniversary-note, .together-banner p,
  .stack > label, .form-row > label
) { color: var(--theme-ink); }
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-search > input {
  color: var(--theme-ink); background: var(--theme-paper); border-color: var(--theme-line);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-legend i {
  background: var(--theme-paper); border-color: var(--theme-line);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-legend i.visited {
  background: var(--theme-accent); border-color: var(--theme-accent);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-legend i.wished {
  background: var(--theme-soft); border-color: var(--theme-accent);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-land,
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region {
  fill: var(--theme-paper); stroke: var(--theme-line);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region:hover,
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region.wished:not(.visited),
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region.selected:not(.visited) {
  fill: var(--theme-soft); stroke: var(--theme-accent);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region.visited {
  fill: var(--theme-line); stroke: var(--theme-accent);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-region.revisited {
  fill: var(--theme-accent);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) :is(.map-region.selected, .map-region:focus) {
  stroke: var(--theme-ink);
}
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-province-line { stroke: var(--theme-accent); }
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-city-dot { fill: var(--theme-accent); }
body[data-wallpaper]:not([data-wallpaper="hearts"]) .map-city-label {
  fill: var(--theme-ink); stroke: var(--theme-paper);
}
