/* Warm sepia: scoped to Memories; shared site chrome keeps its original theme. */
body.memories-page { background: #f3e7d3; }
.memories-main {
    --memory-page: #f3e7d3; --memory-terrain: #e8d5b7; --memory-paper: #fff7e9;
    --memory-ink: #49382f; --memory-muted: #6f5646; --memory-edge: #b5a18a;
    --memory-accent: #8e4b32; --memory-water: #cdbaa4; --memory-contour: #bc9b7a;
    --memory-trees: #9c9274; --memory-personal: #627151; --memory-travel: #456f7b; --memory-dining: var(--memory-accent);
    --memory-tape: #c9aa7a99;
    --chapter-ink: var(--memory-ink); --chapter-muted: var(--memory-muted);
    --chapter-line: var(--memory-edge); --chapter-paper: var(--memory-paper); --chapter-wash: var(--memory-terrain);
    --accent-cool: var(--memory-accent);
    padding: 120px 0 28px; color: var(--memory-ink);
}
/* The selected palette also owns paper surfaces; calendar layout and motion stay shared. */
.memories-main .calendar-portrait { background: var(--memory-terrain); border-color: var(--memory-paper); box-shadow: none; }
.memories-main .calendar-album,.memories-main .calendar-keepsake { background: var(--memory-terrain); }
.memories-main .album-print,.memories-main .keepsake-photo { background: var(--memory-paper); border-color: var(--memory-edge); box-shadow: none; }
.memories-main .keepsake-photo::before { background: var(--memory-tape); border-color: var(--memory-edge); }
.memories-main .memory-reader::backdrop { background: #25252580; }
/* Keep the positioned form heading from covering the Close button's hit area. */
.memories-main .modal-close { z-index: 1; }
.memories-main .container { max-width: 1400px; padding: 0 36px; }
.memories-main :is(button,input,select,textarea,a):focus-visible { outline-color: var(--memory-accent); }
.memories-main .desktop-only { display: block; }
.memories-main .mobile-only { display: none; }
.memories-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 24px 48px; padding: 0 0 24px; margin: 0; text-align: left; }
.memories-header h1 { font-size: clamp(48px,5.5vw,76px); letter-spacing: -.04em; line-height: 1.05; margin: 0 0 24px; }
.memories-header p { color: var(--memory-ink); font-size: 16px; line-height: 1.6; }
.memories-header .memories-description { max-inline-size: 54ch; text-wrap: pretty; }
.memories-main .chapter-eyebrow { font: 10px/1.6 monospace; letter-spacing: .14em; }
.path-collection { display: flex; flex-direction: column; align-items: end; text-align: right; }
.collection-count { margin: 0; }
.collection-count>span:first-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.memories-header .memories-action-buttons { margin: 0; max-width: none; justify-content: end; }
.memories-header .add-memory-btn,.memories-header .add-mutual-memory-btn { margin-top: 16px; padding: 12px 20px; border: 0; border-radius: 0; font-size: 14px; line-height: 1.4; transition: transform .16s ease-out; }
.memories-header .add-memory-btn:active,.memories-header .add-mutual-memory-btn:active { transform: translateY(1px); }
.add-memory-btn,.add-mutual-memory-btn { background: var(--memory-accent); border-color: var(--memory-accent); border-radius: 2px; }
.add-memory-btn:hover,.add-mutual-memory-btn:hover { background: var(--memory-ink); }
.path-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 20px; padding: 24px 0 17px; }
.path-search { flex: 1; min-width: 240px; }
.path-search>label { display: block; font-size: 11px; color: var(--memory-muted); margin-bottom: 6px; }
.path-search>div { display: flex; gap: 10px; }
.path-search input { min-width: 0; }
.path-tools .filter-input,.path-tools .filter-select { border-radius: 2px; background: transparent; }
.path-search button { background: var(--memory-accent); color: var(--memory-paper); border: 1px solid var(--memory-accent); padding: 8px 17px; white-space: nowrap; font-size: 12px; border-radius: 2px; }
.path-tools .filter-clear { border: 0; background: none; text-decoration: underline; text-underline-offset: 4px; padding-inline: 5px; }
.path-threads { display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid var(--memory-edge); padding-bottom: 17px; }
.path-threads button { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 2px; padding: 8px 13px; color: var(--memory-muted); font-size: 12px; }
.path-threads button[aria-pressed="true"] { background: var(--memory-ink); border-color: var(--memory-ink); color: var(--memory-paper); }
.path-threads button:hover { border-color: var(--memory-edge); }
.path-threads i,.path-bottom i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.personal-dot { background: var(--memory-personal); }.travel-dot { background: var(--memory-travel); }.dining-dot { background: var(--memory-dining); }
.path-threads button[aria-pressed="true"] i { outline: 1px solid var(--memory-paper); outline-offset: 2px; }
#pathExplorer { scroll-margin-top: 100px; padding: 0; position: relative; }
.memories-main .path-loading-overlay { position: absolute; top: 44px; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--memory-edge); background: var(--memory-paper); box-shadow: 0 3px 12px #69584424; font-size: 12px; }
.path-loading-overlay .spinner { width: 18px; height: 18px; margin: 0; border-width: 2px; }
.path-loading-overlay p { margin: 0; }
#chapterContents[inert] { cursor: progress; }
#chapterContents { position: relative; overflow-anchor: none; }
.path-outgoing { position: absolute; top: 0; left: 0; width: 100%; z-index: 1; pointer-events: none; user-select: none; transform-origin: 50% 35%; }
#pathWorkspace,#memoriesGrid { transform-origin: 50% 35%; }
#pathBreadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 12px; font-size: 11px; color: var(--memory-muted); }
#pathBreadcrumbs button { background: none; border: 0; padding: 8px; color: inherit; min-width: 44px; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
#pathBreadcrumbs span { padding: 8px; }
.path-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 10px 0 24px; }
.path-heading h2 { font: normal 34px/1.15 Georgia,serif; letter-spacing: -.03em; margin: 0 0 10px; scroll-margin-top: 100px; }
.path-heading p { color: var(--memory-muted); font-size: 13px; line-height: 1.6; margin: 0; }
.path-heading #memoryResultCount { font: 11px/1.7 monospace; max-width: 225px; text-align: right; }
.path-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 34px; align-items: start; }
.map-board { height: 640px; position: relative; background: var(--memory-terrain); border: 1px solid var(--memory-edge); border-radius: 3px; overflow: hidden; }
.map-field,.map-routes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-routes { opacity: .75; }
.map-routes path { vector-effect: non-scaling-stroke; }
.map-caption { position: absolute; top: 21px; left: 25px; font: 9px/1.7 monospace; letter-spacing: .08em; color: var(--memory-muted); max-width: 80%; }
.path-compass { position: absolute; width: 25px; height: 44px; right: 24px; top: 20px; color: var(--memory-muted); }
.memories-main .map-stop { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%,-50%); width: 115px; height: 112px; background: none; color: var(--memory-ink); border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; isolation: isolate; }
.stop-art { position: relative; display: block; flex-shrink: 0; width: 52px; height: 52px; border: 3px solid var(--memory-paper); outline: 1px solid var(--route); border-radius: 50%; box-shadow: 0 3px 9px #69584424; margin-bottom: 8px; transition: transform .18s; }
.path-art-wrap { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--memory-page); }
.stop-art>.path-art-wrap { border-radius: 50%; }
.path-art-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .22s ease-out; }
.path-art-wrap img.cover-ready { opacity: 1; }
.path-art-wrap .chapter-art { width: 100%; height: 100%; }
.stop-order { position: absolute; bottom: -4px; right: -7px; display: grid; place-items: center; width: 20px; height: 20px; background: var(--route); color: #fff; border: 1px solid var(--memory-paper); border-radius: 50%; font: 9px monospace; }
.stop-name { font: 12px/1.4 Georgia,serif; max-width: 115px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; background: var(--memory-terrain); padding: 1px 3px; }
.map-stop:hover .stop-art { transform: translateY(-3px); }
.map-stop[aria-current="true"] .stop-art { outline: 2px solid var(--memory-accent); outline-offset: 4px; }
.map-stop[aria-current="true"] .stop-name { color: var(--memory-accent); text-decoration: underline; text-underline-offset: 3px; }
.memories-main .map-stop.group-stop { height: auto; min-height: 112px; }
.group-stop .stop-art { width: 72px; height: 72px; border: 4px solid transparent; outline: 1px solid var(--memory-edge); background: var(--threads); padding: 3px; background-origin: border-box; }
.group-stop .stop-name { font: normal 23px/1.15 Georgia,serif; overflow: visible; display: block; }
.group-count { font: 10px/1.6 monospace; color: var(--memory-muted); margin-top: 5px; background: var(--memory-terrain); }
.month-map .group-stop .stop-art { width: 56px; height: 56px; }
.month-map .group-stop .stop-name { font-size: 19px; }
.map-board.sparse-map { height: 520px; }
.path-aside { min-width: 0; padding-top: 11px; }
.path-postcard { position: relative; background: var(--memory-paper); border: 1px solid var(--memory-edge); padding: 13px 13px 22px; box-shadow: 4px 5px 0 #69584424; transform: rotate(1deg); }
.path-postcard:before { content: ''; position: absolute; top: -12px; left: calc(50% - 37px); width: 74px; height: 26px; background: var(--memory-tape); transform: rotate(-6deg); z-index: 1; }
.path-postcard>.path-art-wrap { height: 170px; }
.postcard-copy { padding: 22px 11px 0; }
.postcard-copy small { font: 9px/1.8 monospace; text-transform: uppercase; letter-spacing: .05em; color: var(--memory-muted); }
.postcard-copy h3 { font: normal 31px/1.12 Georgia,serif; letter-spacing: -.025em; margin: 13px 0 18px; overflow-wrap: anywhere; }
.postcard-copy p { font: 14px/1.8 Georgia,serif; color: var(--memory-muted); margin: 0 0 16px; overflow-wrap: anywhere; }
.postcard-copy .postcard-contributor { font: 11px/1.7 monospace; }
.path-read { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; gap: 10px; padding: 12px 0 0; background: none; border: 0; border-top: 1px solid var(--memory-edge); color: var(--memory-accent); font-size: 12px; }
.path-read span { font-size: 20px; }
.path-aside-note { font: italic 16px/1.7 Georgia,serif; color: var(--memory-muted); margin: 25px 8px 0; }
.pagination { justify-content: space-between; gap: 16px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--memory-edge); }
.pagination:empty { display: none; }
.pagination button { font-size: 12px; border-radius: 2px; background: transparent; }
.pagination form { display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 11px; }
.pagination input { width: 72px; padding: 8px 5px; text-align: center; border: 1px solid var(--memory-edge); border-radius: 2px; color: var(--memory-ink); background: var(--memory-paper); }
.pagination .path-last,.pagination form button { border: 0; text-decoration: underline; text-underline-offset: 4px; }
.path-bottom { border-top: 1px solid var(--memory-edge); margin-top: 25px; padding: 20px 0 0; display: flex; justify-content: space-between; gap: 20px; color: var(--memory-muted); font: 10px/1.8 monospace; }
.path-bottom i { width: 6px; height: 6px; margin: 0 3px; }
.path-bottom p { margin: 0; }
.memory-search-item { min-width: 0; }.memory-search-item>.path-read { margin-top: 12px; }
.memory-reader { border-radius: 3px; }.memory-reader .modal-content { background: var(--memory-paper); }
.memory-reader[aria-busy="true"] .modal-content { min-height: 280px; }
.memory-reader[open] { animation: memory-reader-enter .24s cubic-bezier(.22,1,.36,1); }
.memory-reader[open]::backdrop { animation: memory-backdrop-enter .24s ease-out; }
@keyframes memory-reader-enter { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes memory-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
.reader-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--memory-edge); padding-top: 16px; margin-top: 25px; }
.reader-pager button { border: 0; background: none; padding: 8px 0; color: var(--memory-accent); font-size: 12px; }
.reader-pager span { font: 10px/1.5 monospace; text-align: center; color: var(--memory-muted); }
@media(max-width:1100px) {
    .path-layout { grid-template-columns: minmax(0,1fr) 230px; gap: 20px; }.map-board { height: 660px; }
    .memories-main .map-stop { width: 104px; height: 108px; }.group-stop .stop-art { width: 60px; height: 60px; }
    .path-postcard>.path-art-wrap { height: 144px; }.postcard-copy h3 { font-size: 27px; }.map-caption { font-size: 8px; }
    .pagination { gap: 10px; }.pagination>button { padding: 8px 10px; }
}
@media(max-width:900px) {
    .memories-main .container { padding: 0 24px; }
    .memories-header { gap: 24px; }
    .path-layout { grid-template-columns: 1fr; }.path-postcard { display: grid; grid-template-columns: 220px 1fr; gap: 22px; transform: none; }
    .path-postcard>.path-art-wrap { height: 100%; min-height: 220px; }.postcard-copy { padding: 10px 5px 0; }.path-postcard:before { left: 90px; }
    .path-aside-note { margin: 14px 0 0; text-align: right; }.memories-main .map-stop { width: 112px; height: 112px; }
    .group-stop .stop-art { width: 68px; height: 68px; }.pagination { flex-wrap: wrap; }.pagination form { order: 3; width: 100%; }.pagination .path-last { margin-left: auto; }
}
@media(max-width:600px) {
    .memories-main { padding-top: 95px; }.memories-main .container { padding: 0 18px; }
    .memories-header { grid-template-columns: minmax(0,1fr); padding-bottom: 12px; }
    .memories-header h1 { margin-bottom: 20px; }
    .path-collection { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; text-align: left; }
    .memories-header .collection-count { font-size: 14px; }
    .memories-header .memories-action-buttons { justify-content: start; }
    .memories-header .add-memory-btn,.memories-header .add-mutual-memory-btn { margin-top: 0; }
    .path-tools { gap: 12px; padding-top: 18px; }.path-search { min-width: 0; flex-basis: 100%; }.path-tools .filter-group { flex: 1; }.path-tools .filter-select { min-width: 0; padding-inline: 8px; }
    .path-threads { gap: 0; }.path-threads button { font-size: 10px; padding: 7px 8px; gap: 5px; }.path-threads i { width: 6px; height: 6px; }
    .path-heading { display: block; padding: 13px 0 18px; }.path-heading h2 { font-size: 28px; }.path-heading p { font-size: 12px; }.path-heading #memoryResultCount { text-align: left; max-width: none; margin-top: 12px; font-size: 10px; }
    #pathBreadcrumbs { gap: 0; font-size: 10px; }#pathBreadcrumbs button,#pathBreadcrumbs span { padding-inline: 6px; }
    .map-board { height: 780px; }.map-board.sparse-map { height: 550px; }.map-caption { left: 14px; top: 15px; font-size: 7px; max-width: 78%; }.path-compass { right: 13px; top: 13px; width: 21px; }
    .memories-main .map-stop { left: var(--mx); top: var(--my); width: 116px; height: 108px; }.stop-art { width: 49px; height: 49px; }.stop-name { font-size: 11px; max-width: 109px; }
    .group-stop .stop-art { width: 59px; height: 59px; }.group-stop .stop-name { font-size: 19px; }.group-stop .group-count { font-size: 10px; }
    .memories-main .desktop-only { display: none; }.memories-main .mobile-only { display: block; }
    .path-postcard { grid-template-columns: 1fr; gap: 0; padding: 13px 13px 20px; }.path-postcard>.path-art-wrap { height: 180px; min-height: 0; }.path-postcard:before { left: calc(50% - 37px); }.postcard-copy { padding: 19px 10px 0; }.postcard-copy h3 { font-size: 29px; }
    .path-aside-note { font-size: 14px; max-width: 280px; margin-left: auto; }.pagination>button { font-size: 11px; padding: 8px 7px; }.pagination .path-last { padding-inline: 0; }
    .path-bottom { flex-direction: column; gap: 7px; font-size: 9px; }.reader-pager button { font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) { .memories-main * { animation: none!important; transition: none!important; scroll-behavior: auto!important; } .memory-reader::backdrop { animation: none!important; } }
