/* Restrained travel-journal detail with a slightly tighter v104 vertical rhythm. */
:root{--sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.app[data-theme]{font-weight:500}
.app[data-theme] :is(.intro h1,.section-head h2,.detail-section h2,.page-title){font-family:var(--sans);font-weight:600;letter-spacing:-.01em}
.app[data-theme] :is(.settings-card h2,.stamp-group h2){font-family:var(--sans);letter-spacing:0}
.app[data-theme] :is(.settings-card p,.setting-note,.stop-info p,.journal-text,.style i,.small-card i,.memory-card i,#detail-route){font-weight:500}
.app[data-theme] :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea){font-weight:500}
dialog:not(#share-preview):not(#media-viewer) h2{font-family:var(--sans);font-weight:600;letter-spacing:-.01em}
dialog :is(input,select,textarea,button.date-trigger){font-weight:500}
.app[data-theme] .intro{padding-top:24px;padding-bottom:12px}
.app[data-theme] .intro h1{font-size:clamp(30px,8.8vw,36px);line-height:1.22;margin:8px 0 10px;text-wrap:balance}
.app[data-theme] .trip-search{margin:14px 0}
.app[data-theme] .trip-filters{margin:0 0 16px}
.app[data-theme] .trip-filters[hidden]{display:none}
.trip-filter-fields{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:12px}
.trip-filter-fields label{display:grid;gap:7px;min-width:0;color:var(--ink);font-size:12px;line-height:1.4}
.trip-filter-fields select{width:100%;min-width:0;min-height:44px;padding:10px 24px 10px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface,var(--paper));color:var(--ink);font:inherit;font-size:16px;text-overflow:ellipsis}
.trip-filter-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:0;margin-top:4px;color:var(--ink);font-size:12px}
.trip-filter-summary button{min-height:44px;padding:8px 0 8px 12px;background:transparent;color:var(--ink);font-size:13px;text-decoration:underline;text-underline-offset:3px}
.trip-filter-summary [hidden]{display:none}
.trip-filter-fields select:focus-visible,.trip-filter-summary button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
@media(max-width:380px){.trip-filter-fields{gap:8px}}
html:lang(zh-CN) .app[data-theme] .intro h1{font-family:var(--sans);font-weight:600;letter-spacing:0;line-height:1.22}
.app[data-theme] :is(.intro p,.brand small,.page-title small,.eyebrow){font-size:12px;line-height:1.6}
.app[data-theme] :is(.small-card span,.route-list span,.route-list>p,.stop-info h3 small,.setting-note){font-size:12px;line-height:1.6}
.app[data-theme] :is(.small-card i,.stop-info p,.settings-card p,.legacy-note,.empty-copy){font-size:14px;line-height:1.65}
.app[data-theme] :is(.route-list article>b,.stop-number,#settings-stats,.note-counter){font-variant-numeric:tabular-nums}

/* Dates, flag stickers, names, routes and actions retain their own flow rows. */
.app[data-theme] .memory-card{padding:22px;gap:10px;min-height:260px;margin-bottom:14px}
.app[data-theme] .memory-card>span{font-size:12px;line-height:1.6;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.app[data-theme] .memory-card strong{font-size:clamp(32px,9.5vw,40px);line-height:1.14;margin-top:12px;text-wrap:balance}
.app[data-theme] .memory-card i{font-size:15px;line-height:1.55;letter-spacing:0}
.app[data-theme] .memory-card em{font-size:14px;line-height:1.45;letter-spacing:0;font-weight:600;padding:10px 14px;margin-top:4px}
.app[data-theme] .detail-hero h1,.app[data-theme] .style-preview .preview-copy h2{font-size:clamp(32px,9.5vw,40px);line-height:1.14;text-wrap:balance}
.app[data-theme] .detail-hero{min-height:224px;margin-top:16px}
.app[data-theme][data-cover-layout=editorial] :is(.detail-hero,.style-preview){padding-block:26px;gap:14px}
.app[data-theme][data-cover-layout=center] :is(.detail-hero,.style-preview){padding-block:28px}
.app[data-theme][data-cover-layout=bottom] :is(.detail-hero,.style-preview){padding-top:54px}
.app[data-theme] .style-preview{min-height:288px;gap:12px}
.app[data-theme] .detail-hero>span{font-size:12px;line-height:1.6;letter-spacing:.04em}
.app[data-theme] #detail-dates{font-size:12px;line-height:1.6;font-variant-numeric:tabular-nums}
.app[data-theme] #detail-route{font-size:15px;line-height:1.55}
.app[data-theme] .style-preview .preview-meta{font-size:12px;line-height:1.6;font-variant-numeric:tabular-nums}
.app[data-theme] .small-card{gap:8px;padding:20px;margin-top:16px}
.app[data-theme] .small-card b{line-height:1.25;text-wrap:balance}

/* A little paper depth; the bold top/bottom edges and cover patterns stay intact. */
.app[data-theme] :is(.memory-card,.detail-hero,.style-preview){
  box-shadow:var(--journal-cover-inset,0 0 0 0 transparent),0 4px 12px color-mix(in srgb,var(--ink) 5%,transparent);
}
.app[data-theme=film] :is(.detail-hero,.style-preview),.app[data-theme] .memory-card[data-card-theme=film]{--journal-cover-inset:inset 0 0 0 7px #ffffff55}
.app[data-theme=noir] :is(.detail-hero,.style-preview),.app[data-theme] .memory-card[data-card-theme=noir]{--journal-cover-inset:inset 0 1px 0 #98ccff25}
.app[data-theme=watercolor] :is(.detail-hero,.style-preview),.app[data-theme] .memory-card[data-card-theme=watercolor]{--journal-cover-inset:inset 0 0 22px #55b6d225}
.app[data-theme] :is(.settings-card,.style-controls,.photo-look-controls,.detail-section){padding:20px;border-color:color-mix(in srgb,var(--line) 85%,var(--surface))}
.app[data-theme] :is(.settings-card,.style-controls){gap:14px;box-shadow:0 2px 6px color-mix(in srgb,var(--ink) 4%,transparent)}
.app[data-theme] :is(.stop-card,.memory-item){padding:18px;border-color:color-mix(in srgb,var(--line) 85%,var(--surface))}
.app[data-theme] .facts{gap:12px}
.app[data-theme] .facts>div{gap:8px;padding:16px;border-color:color-mix(in srgb,var(--line) 85%,var(--surface))}
.app[data-theme] .facts small{font-size:12px;line-height:1.5}
.app[data-theme] .facts b{font-size:14px;line-height:1.55;font-weight:600;font-variant-numeric:tabular-nums}
.app[data-theme] :is(.detail-section h2,.section-head h2){line-height:1.25;text-wrap:balance}
.app[data-theme] .actions{gap:8px;margin-block:16px}
.app[data-theme] .settings-card label{gap:8px;margin-top:0}
.app[data-theme] :is(.style-controls label,.soundtrack-section label,.photo-look-controls label){gap:8px;line-height:1.5}
.app[data-theme] :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea){font-size:16px;line-height:1.5}
.app[data-theme] .style-options{gap:10px;margin-top:16px}
.app[data-theme] .style{padding:14px;gap:12px}
.app[data-theme] .style div{gap:6px}
.app[data-theme] .style i{font-size:14px;line-height:1.5}

/* Selection remains ink-led, with the existing accent marking detail sections. */
.app[data-theme] .switch{gap:8px;margin-bottom:16px}
.app[data-theme] .switch button{font-size:12px;font-weight:600;line-height:1.45;padding:12px 10px}
.app[data-theme] .switch b{font-size:11px;font-variant-numeric:tabular-nums}
.app[data-theme] .detail-tabs{margin-block:16px;padding:4px}
.app[data-theme] .detail-tabs button{padding:12px 8px;font-size:14px;line-height:1.45;font-weight:600}
.app[data-theme] nav{padding:4px;box-shadow:0 4px 16px color-mix(in srgb,var(--ink) 6%,transparent)}
.app[data-theme] nav button{padding:8px 4px;gap:4px}
.app[data-theme] :is(.actions button,.item-actions button,.wide-action,.settings-card>button,.section-head button,.relive-launch,.card-relive,.style-controls>button,.stamp-filters button){font-size:14px;line-height:1.45;font-weight:600}
.app[data-theme] .card-relive{min-height:44px}
.app[data-theme] :is(.actions button,.wide-action,.settings-card>button,.section-head button){padding:12px 16px}
.app[data-theme] :is(.actions button,.wide-action,.settings-card>button,.relive-launch){box-shadow:inset 0 1px 0 color-mix(in srgb,var(--accent-ink) 6%,transparent),0 2px 4px color-mix(in srgb,var(--ink) 4%,transparent)}
.app[data-theme] .actions button:nth-child(even){background:var(--soft);color:var(--ink);border:1px solid var(--line);box-shadow:none}

/* Centered editor rhythm; calendar target dimensions and media viewers are untouched. */
:is(#trip-editor,#stop-editor,#journal-editor) form{gap:16px}
:is(#trip-editor,#stop-editor,#journal-editor) h2{margin-bottom:4px;text-wrap:balance}
:is(#trip-editor,#stop-editor,#journal-editor) label{gap:8px;line-height:1.5}
:is(#trip-editor,#stop-editor,#journal-editor) .primary{font-size:16px;line-height:1.5;font-weight:600}
dialog:not(.date-picker):not(#media-viewer) .dialog-body button:not(.dialog-close){font-size:14px;line-height:1.45}
dialog:not(.date-picker):not(#media-viewer) p{font-size:12px;line-height:1.6;letter-spacing:.02em}
dialog:not(.date-picker):not(#media-viewer) .note-counter{font-size:12px!important;line-height:1.5}

/* Feedback moves controls only. No filters, media transforms or scroll interception. */
.app[data-theme] button,dialog:not(.date-picker):not(#media-viewer) button{transition:transform 140ms cubic-bezier(.23,1,.32,1)}
.app[data-theme] button:not(:disabled):active,dialog:not(.date-picker):not(#media-viewer) button:not(:disabled):active{transform:scale(.98)}
@media(hover:hover){
  .app[data-theme] :is(.switch button,.style,.detail-tabs button,nav button):not(:disabled):not(:focus-visible):hover{outline:1px solid var(--line);outline-offset:-1px}
}
/* Small containers preserve the 20px content rhythm without crowding 320px forms. */
@media(max-width:380px){
  .app[data-theme] :is(.memory-card,.settings-card,.style-controls,.photo-look-controls,.detail-section){padding:20px}
  .app[data-theme] :is(.stop-card,.memory-item){padding:16px}
  .app[data-theme] .facts{gap:8px}
  .app[data-theme] .facts>div{padding:12px}
  .app[data-theme] .style{padding:12px}
  .app[data-theme] .switch{gap:4px}
  .app[data-theme] .switch button{padding-inline:8px}
  .app[data-theme] .detail-tabs button{padding-inline:6px}
}
@media(max-width:340px){
  :is(#trip-editor,#stop-editor,#journal-editor) form{gap:12px}
}
/* Stored preference also reaches sibling dialogs, outside the .app element. */
.app.reduce-motion *,.app.reduce-motion *::before,.app.reduce-motion *::after,
body:has(.app.reduce-motion) dialog,body:has(.app.reduce-motion) dialog *,
body:has(.app.reduce-motion) dialog *::before,body:has(.app.reduce-motion) dialog *::after{animation:none!important;transition:none!important}
.app.reduce-motion button:active,body:has(.app.reduce-motion) dialog button:active{transform:none!important}
@media(prefers-reduced-motion:reduce){
  .app *,.app *::before,.app *::after,dialog,dialog *,dialog *::before,dialog *::after{animation:none!important;transition:none!important}
  .app button:active,dialog button:active{transform:none!important}
}

/* Shared control paper stays legible independently of a trip's accent color. */
:root{
  --control-paper:#fff;--control-ink:#26392f;--control-line:#b9c7bd;
  --control-hover:#f5f7f4;--control-selected:#e5ece6;--control-selected-line:#6f8776;
  --control-disabled:#f0f3ef;--control-muted:#626e65;--control-danger:#963d34;
  --control-scheme:light;--control-focus:#365641;--control-disabled-line:#d1d9d1;
}
.app[data-theme] :is(.actions button,.item-actions button,.wide-action,.section-head button,.relive-launch,.card-relive,.settings-card>button,.style-controls>button,.stamp-filters button,.round,.map-controls button,.relive-buttons button,.style-controls #style-reset,#relive-toggle,#add),
dialog:not(#media-viewer) :is(button,.dialog-body button){
  background:var(--control-paper);color:var(--control-ink);border:1px solid var(--control-line);
  box-shadow:none;text-shadow:none;color-scheme:var(--control-scheme,light);
}
.app[data-theme] :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea),
dialog:not(#media-viewer) :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea){
  background:var(--control-paper);color:var(--control-ink);border-color:var(--control-line);color-scheme:var(--control-scheme,light);
}
.app[data-theme] :is(input,textarea)::placeholder,dialog :is(input,textarea)::placeholder{color:var(--control-muted);opacity:1}
.app[data-theme] :is(.item-actions button[data-stop-action=delete],.item-actions button[data-memory-action=delete],button.danger),
dialog:not(#media-viewer) :is(button.danger,.dialog-body button.danger){color:var(--control-danger)!important;border-color:#cba49c!important;background:var(--control-paper)}
.app[data-theme] .stamp-filters button[aria-pressed=true],
dialog:not(#media-viewer) :is(button,.dialog-body button)[aria-pressed=true]{background:var(--control-selected);color:var(--control-ink);border-color:var(--control-selected-line);box-shadow:inset 0 0 0 1px var(--control-selected-line)}
dialog.date-picker .calendar-days button{border-color:var(--ui-edge)}
dialog.date-picker .calendar-days button[aria-pressed=true]{border-color:var(--control-selected-line)}
.app[data-theme] :is(.actions button,.item-actions button,.wide-action,.section-head button,.relive-launch,.card-relive,.settings-card>button,.style-controls>button,.stamp-filters button,.round,.map-controls button,.relive-buttons button,.style-controls #style-reset,#relive-toggle,#add):disabled,
dialog:not(#media-viewer) :is(button,.dialog-body button):disabled{
  opacity:1;background:var(--control-disabled);color:var(--control-muted);border-color:var(--control-disabled-line);box-shadow:none;cursor:default;
}
.app[data-theme] :is(.actions button,.item-actions button,.wide-action,.section-head button,.relive-launch,.card-relive,.settings-card>button,.style-controls>button,.stamp-filters button,.round,.map-controls button,.relive-buttons button,.style-controls #style-reset,#relive-toggle,#add):focus-visible,
dialog:not(#media-viewer) :is(button,input,select,textarea):focus-visible{
  outline:2px solid var(--control-focus);outline-offset:3px;box-shadow:0 0 0 5px var(--control-paper);
}
@media(hover:hover){
  .app[data-theme] :is(.actions button,.item-actions button,.wide-action,.section-head button,.relive-launch,.card-relive,.settings-card>button,.style-controls>button,.stamp-filters button,.round,.map-controls button,.relive-buttons button,.style-controls #style-reset,#relive-toggle,#add):not(:disabled):hover,
  dialog:not(#media-viewer) :is(button,.dialog-body button):not(:disabled):hover{background:var(--control-hover)}
}
/* Library tools stay compact until requested. */
.app[data-theme] [data-screen=memories]>header{gap:8px;overflow:visible}
.library-actions{display:flex;align-items:center;gap:3px;position:relative;flex-shrink:0}
.app[data-theme] .library-icon{position:relative;display:grid;place-items:center;width:40px;height:44px;min-width:40px;min-height:44px;margin:0;padding:0;border:0;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
.app[data-theme] .library-icon[hidden],.app[data-theme] .trip-search[hidden]{display:none!important}
.library-icon svg{display:block;pointer-events:none}
.app[data-theme] .library-icon:hover,.app[data-theme] .library-icon[aria-expanded=true]{background:color-mix(in srgb,var(--ink) 8%,transparent)}
.library-icon:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.library-icon.has-value:after{content:'';position:absolute;right:7px;top:8px;width:5px;height:5px;background:var(--accent,var(--ink));border-radius:50%;border:1px solid var(--paper)}
.app[data-theme] .library-actions #add{width:44px;height:44px;min-width:44px;min-height:44px;margin-left:5px}
.app[data-theme] .library-actions .trip-filters{position:absolute;z-index:50;right:0;top:calc(100% + 10px);width:min(320px,calc(100vw - 48px));padding:18px;margin:0;border:1px solid var(--line);border-radius:15px;background:var(--paper);box-shadow:0 12px 32px #142c2222;text-align:left}
.library-actions .trip-filter-fields{grid-template-columns:1fr;gap:14px}
.library-actions .trip-filter-summary{flex-wrap:wrap;margin-top:8px;gap:0 8px}
.library-actions .trip-filter-summary:has([hidden]):not(:has(:not([hidden]))){display:none}
.app[data-theme] .trip-search{margin:4px 0 18px}
.trip-search>#trip-search-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:380px){.library-actions{gap:0}.app[data-theme] .library-icon{width:36px;min-width:36px}.app[data-theme] [data-screen=memories]>header>.brand{font-size:12px;letter-spacing:.035em}.app[data-theme] .library-actions #add{margin-left:2px}}

/* Matching, compact settings destinations. Masks follow every theme's ink. */
.app[data-theme] .settings-card> :is(#footprints-settings,#stamps-open){display:flex;align-items:center;gap:10px;width:100%;min-height:44px;padding:11px 14px;margin:0;text-align:left;font:500 15px/1.4 var(--sans);letter-spacing:0;box-sizing:border-box;box-shadow:none}
.app[data-theme] .settings-card>#footprints-settings{margin-bottom:-4px}
.app[data-theme] :is(#footprints-settings,#stamps-open)::before{content:"";display:block;flex:0 0 18px;width:18px;height:18px;background:currentColor;mask:var(--entry-icon) center/contain no-repeat;-webkit-mask:var(--entry-icon) center/contain no-repeat;opacity:.8}
#footprints-settings{--entry-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 6 6-3 6 3 6-3v15l-6 3-6-3-6 3V6Z'/%3E%3Cpath d='M9 3v15M15 6v15'/%3E%3C/svg%3E")}
#stamps-open{--entry-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 13V9a3 3 0 1 1 6 0v4l3 3v2H6v-2l3-3Z'/%3E%3Cpath d='M5 21h14M8 18h8'/%3E%3C/svg%3E")}

/* 09 — Reykjavík. Large static light fields: no filters, blur layers or animation loop. */
.app[data-theme=reykjavik],.memory-card[data-card-theme=reykjavik]{--paper:#0d1016;--soft:#17202d;--surface:#171e29;--ink:#edf1fa;--muted:#b6c1d4;--line:#3b485e;--card-radius:18px;--cover-ink:#edf1fa;--cover-shade:none;--world-bg:var(--reykjavik-bg);--title-font:var(--sans);--map-water:#101a2a;--map-land:#303e55;--map-line:#91a3bd;--map-label:#edf1fa}
.app[data-theme=reykjavik]{background-color:var(--paper);background-image:var(--reykjavik-bg);background-size:min(100vw,480px) 100dvh;background-position:center top;background-repeat:no-repeat;background-attachment:fixed}
.app[data-theme=reykjavik] :is(.memory-card,.detail-hero,.style-preview),.memory-card[data-card-theme=reykjavik]{border:1px solid var(--line);box-shadow:none;background-color:var(--paper)}
.app[data-theme=reykjavik] :is(.detail-section,.style-controls,.settings-card,.photo-look-controls,.empty-copy){background:transparent;border-color:var(--line)}
.app[data-theme=reykjavik] .style{background:#fff;color:#26392f;border-color:#b9c7bd;min-height:64px}
.app[data-theme=reykjavik] #style-options .style :is(b,i,span,em){color:#263442}
.app[data-theme=reykjavik] .style.selected{background:color-mix(in srgb,var(--trip-accent) 23%,#fff);border-color:var(--trip-accent);box-shadow:inset 3px 0 var(--trip-accent)}
.app[data-theme=reykjavik] :is(nav,.detail-tabs){background:#101722}
.app[data-theme=reykjavik] nav button.active{color:#edf1fa}
.app[data-theme=reykjavik] .accent-options button{min-width:44px;min-height:44px}
.app[data-theme=reykjavik] :is(.relive-journal,.relive-route-copy){background-color:var(--paper);background-image:var(--reykjavik-bg);color:var(--ink)}
.app[data-theme=reykjavik] .template-scene.postcard{background-color:var(--paper)!important;background-image:var(--reykjavik-bg)!important;color:var(--ink)!important}
.app[data-theme=reykjavik] .template-scene.postcard .template-copy{border-color:var(--line);color:var(--ink)}
.app[data-theme=reykjavik] .template-scene.postcard .template-map{border-color:var(--line)}
.app[data-theme=reykjavik] .template-scene.gradient{background-color:var(--paper)!important;background-image:var(--reykjavik-bg)!important}
.app[data-theme=reykjavik] .relive-journal blockquote{color:var(--ink)}
.app[data-theme=reykjavik] .template-scene .template-copy{--relive-ink:#edf1fa}

/* Page headers: category above the authored Trip name, with symmetric control space. */
.app[data-theme] .trip-page-header{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:12px;align-items:center;min-height:44px;height:auto}
.app[data-theme] .trip-page-header>.round{width:44px;height:44px;min-width:44px;min-height:44px}
.app[data-theme] .trip-page-header .page-title{min-width:0;width:100%;text-align:center;font-size:18px;font-weight:500;line-height:1.25}
.app[data-theme] .trip-page-header .page-title small{display:block;margin:0 0 3px;font-size:10px;line-height:1.2;font-weight:500;letter-spacing:.08em;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app[data-theme] .trip-page-header .page-title>span{display:block;max-width:100%;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.app[data-theme] .relive-header.trip-page-header{grid-template-columns:88px minmax(0,1fr) 88px!important;gap:8px!important}
.app[data-theme] .relive-header .relive-header-actions{width:88px;gap:0}
.app[data-theme] .relive-header :is(#relive-export,.relive-header-actions .round){box-sizing:border-box;display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid var(--control-line);border-radius:50%;background:var(--control-paper);color:var(--control-ink)}
.app[data-theme] .relive-header #relive-export span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.app[data-theme] :is([data-screen=stamps]>header>.round,.footprint-header>.footprint-back){width:44px;height:44px;min-width:44px;min-height:44px}
.app[data-theme] .footprint-header{justify-content:space-between}
.app[data-theme] .footprint-header>.brand{flex:0 1 auto;text-align:left;font-size:13px;letter-spacing:.11em}
/* The home proposition alone uses a local editorial serif. Other page headings stay unchanged. */
.app[data-theme] [data-screen=memories]>.intro h1{font-family:Georgia,"Songti SC","SimSun",serif;font-weight:400;font-style:italic;font-size:clamp(32px,8.8vw,40px);line-height:1.12;letter-spacing:-.025em}
html:lang(zh-CN) .app[data-theme] [data-screen=memories]>.intro h1,html:lang(ja) .app[data-theme] [data-screen=memories]>.intro h1{font-style:normal;letter-spacing:0}

/* A little more vertical room; existing horizontal widths, type and navigation stay intact. */
.app[data-theme]>.page:not(.relive-page){padding-top:calc(24px + env(safe-area-inset-top));padding-bottom:calc(136px + env(safe-area-inset-bottom))}
.app[data-theme] .intro{padding-top:28px;padding-bottom:16px}
.app[data-theme] .detail-hero{margin-top:22px}
.app[data-theme] .detail-tabs{margin-block:22px}
.app[data-theme] :is(.settings-card,.style-controls,.photo-look-controls,.detail-section){padding-block:24px;row-gap:18px}
.app[data-theme] :is(.stop-card,.memory-item){padding-block:22px}
.app[data-theme] .settings-card{margin-top:14px}
.app[data-theme] .style-controls{margin-top:26px}
.app[data-theme] .style-options{row-gap:14px;margin-top:22px}
.app[data-theme] .trip-card-wrap{margin-bottom:19px}
.app[data-theme] .route-map-wrap{margin-top:26px}
.app[data-theme] .route-list{margin-top:22px}
.app[data-theme] .stamp-filters{margin-block:26px}
.app[data-theme] .stamp-group>h2{margin-top:36px}
.app[data-theme] .footprint-intro{margin:26px 0 22px}
.app[data-theme]>.footprint-page{padding-bottom:calc(108px + env(safe-area-inset-bottom))!important}
/* Reserve controls first; the stage uses the remaining safe viewport height. */
.app[data-theme]>.relive-page{height:100vh;height:100dvh;min-height:0;padding-top:calc(22px + env(safe-area-inset-top));padding-bottom:calc(30px + env(safe-area-inset-bottom))}
.app[data-theme]>.relive-page.active{display:flex;flex-direction:column}
.app[data-theme] .relive-header{flex:0 0 44px}
.app.relive-open{min-height:0}
.app[data-theme] .relive-header.trip-page-header{grid-template-columns:94px minmax(0,1fr) 94px!important}
.app[data-theme] .relive-header .relive-header-actions{width:94px;gap:6px}
.app[data-theme] .relive-stage{margin-top:22px;min-height:0!important;height:auto;flex:1 1 0}
.app[data-theme] .relive-controls{flex:0 0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;padding-top:24px}
.app[data-theme] .relive-controls .template-choice{grid-area:1/1;min-width:0;min-height:44px;width:100%}
.app[data-theme] .relive-controls .relive-progress{grid-column:1/-1;grid-row:2}
.app[data-theme] .relive-controls .relive-buttons{grid-column:1/-1;grid-row:3;margin-top:4px}
.app[data-theme] .relive-controls .relive-map-credit{grid-area:1/2;align-self:center;position:static;display:block;margin:0;text-align:right}
.app[data-theme] .relive-journal{padding-block:29px;gap:22px}

@media(min-width:481px){.app[data-theme]>.relive-page{height:calc(100dvh - 36px)}}
@media(max-height:650px) and (orientation:portrait){
 .app[data-theme]>.relive-page{padding-top:calc(12px + env(safe-area-inset-top));padding-bottom:calc(12px + env(safe-area-inset-bottom))}
 .app[data-theme] .relive-stage{margin-top:12px}
 .app[data-theme] .relive-controls{padding-top:12px;gap:8px}
}
@media(max-height:480px) and (orientation:landscape){
 .app[data-theme]>.relive-page{height:auto;min-height:100dvh}
 .app[data-theme] .relive-stage{flex:none;height:300px}
}

/* Calm UI: fewer nested outlines, existing content and theme palettes only.
   Scope layout/type to ordinary pages; RELIVE scenes and export composition stay independent. */
.app[data-theme]:not([data-theme=minimal]):not([data-theme=noir]):not([data-theme=berlin]):not([data-theme=reykjavik]):not(.relive-open){
 background-color:var(--paper);
 background-image:linear-gradient(180deg,var(--paper),color-mix(in srgb,var(--paper) 35%,#fff) 650px);
 background-repeat:no-repeat;background-size:100% 100%;
}
.app[data-theme]>.page:not(.relive-page){font-weight:400}
.app[data-theme]>.page:not(.relive-page) :is(.settings-card p,.setting-note,.stop-info p,.style i,.memory-card i,#detail-route){font-weight:400}
.app[data-theme]>.page:not(.relive-page) .brand{font-weight:600;letter-spacing:.035em}
.app[data-theme]>.page:not(.relive-page) :is(.intro h1,.detail-section h2,.section-head h2){font-weight:500;letter-spacing:-.02em}
.app[data-theme] [data-screen=memories]>.intro{padding:32px 0 22px}
.app[data-theme] [data-screen=memories]>.intro h1{font-size:clamp(27px,7.5vw,35px);font-weight:400;line-height:1.25;margin:0}
html:lang(zh-CN) .app[data-theme] [data-screen=memories]>.intro h1,
html:lang(ja) .app[data-theme] [data-screen=memories]>.intro h1{font-family:var(--sans);font-weight:500;letter-spacing:-.02em}
.app[data-theme]>.page:not(.relive-page) header :is(.round,#add):not(:disabled){border:1px solid var(--ui-edge);background:var(--surface);color:var(--ink);box-shadow:none}

/* One quiet surface for the status selector; selection does not add another border. */
.app[data-theme] .switch{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;padding:4px;margin:0 0 22px;border:1px solid var(--ui-edge);border-radius:16px;background:color-mix(in srgb,var(--soft) 65%,transparent)}
.app[data-theme] .switch button{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:4px 6px;min-height:44px;padding:8px 3px;border:1px solid var(--ui-edge);border-radius:12px;background:transparent;color:var(--ink);font-size:11px;font-weight:500;line-height:1.4}
.app[data-theme] .switch button.on{background:var(--surface);color:var(--ink);box-shadow:0 2px 6px color-mix(in srgb,var(--ink) 5%,transparent)}
.app[data-theme] .switch b{margin:0;font-size:11px;font-weight:500}

/* Keep all cover art, authored photos, typography and saved Style identities. */
.app[data-theme] :is(.memory-card,.detail-hero,.style-preview){border:1px solid var(--ui-edge);border-radius:24px;box-shadow:none}
.app[data-theme] .memory-card{padding:24px;gap:10px;min-height:252px}
.app[data-theme] .memory-card>span{letter-spacing:0;font-weight:400}
.app[data-theme] .memory-card strong{margin-top:12px;font-size:clamp(30px,8.6vw,38px)}
.app[data-theme] .memory-card em{border:0;border-radius:0;background:transparent;color:inherit;padding:10px 0;min-height:44px;font-size:13px;font-weight:500;box-shadow:none}
.app[data-theme] #trip-list .card-relive{right:20px;bottom:20px;padding:12px 14px;min-height:44px;border:1px solid var(--ui-edge);border-radius:14px;background:var(--control-paper);color:var(--control-ink);font-size:13px;font-weight:500;box-shadow:none}
.app[data-theme] .trip-card-wrap{margin-bottom:20px}
.app[data-theme] .country-pins{gap:6px}

/* Floating navigation is the single elevated surface; its boundaries stay unchanged. */
.app[data-theme] nav{height:68px;padding:5px;border:1px solid var(--ui-edge);border-radius:25px;background:var(--surface);box-shadow:0 8px 28px color-mix(in srgb,var(--ink) 9%,transparent);backdrop-filter:none}
.app[data-theme] nav button{border:0;border-radius:18px;background:transparent;font-weight:500;padding:7px 3px;gap:5px;box-shadow:none}
.app[data-theme] nav button.active{border:1px solid var(--ui-edge);background:var(--soft);box-shadow:none}
.app[data-theme] nav button>span{font-size:11px;font-weight:500;line-height:1.35}
.app[data-theme] nav .nav-icon svg{stroke-width:1.8}

/* Existing detail/settings sections use whitespace instead of nested boxes. */
/* Outrank the legacy grouped surface rule (including .facts > div).
   These are layout containers, not painted cards; the page owns their backdrop. */
.app[data-theme]>.page:not(.relive-page) :is(.settings-card,.detail-section){border:0;padding:0;background:transparent;box-shadow:none}
.app[data-theme] .settings-card{row-gap:18px;margin-top:8px}
.app[data-theme] .settings-card h2{font-size:19px;font-weight:500;line-height:1.4;margin-top:18px}
.app[data-theme] :is(.settings-card,.style-controls,.photo-look-controls) label{font-weight:500}
.app[data-theme] .settings-card> :is(#footprints-settings,#stamps-open){min-height:56px;padding:15px 18px;gap:12px;margin:0;border:1px solid var(--ui-edge);border-radius:16px;background:var(--surface);color:var(--ink)}
.app[data-theme] .settings-card> :is(#footprints-settings,#stamps-open)::after{content:'›';margin-left:auto;font-size:22px;font-weight:400;line-height:1}
.app[data-theme] #settings-stats{padding:18px 20px;border-radius:18px;background:var(--surface)}
.app[data-theme] #settings-stats h2{margin:0 0 14px}
.app[data-theme] #settings-stats p{margin:10px 0;font-size:13px;line-height:1.65}
.app[data-theme] .detail-section>.eyebrow{margin-top:0}
.app[data-theme] .detail-section h2{font-size:23px;line-height:1.4;margin:8px 0 18px}
.app[data-theme] .facts{gap:10px}
.app[data-theme] .facts>div{border:1px solid var(--ui-edge);border-radius:16px;padding:16px;background:var(--surface)}
.app[data-theme] :is(.stop-card,.memory-item){border:1px solid var(--ui-edge);border-radius:20px;background:var(--surface);box-shadow:none}
.app[data-theme] .detail-tabs{gap:2px;padding:4px;border:1px solid var(--ui-edge);border-radius:16px;background:var(--soft)}
.app[data-theme] .detail-tabs button{border:0;border-radius:12px;padding:11px 9px;background:transparent;font-size:13px;font-weight:500;box-shadow:none;color:var(--ink);opacity:1}
.app[data-theme] .detail-tabs button.selected{border:1px solid var(--ui-edge);background:var(--surface);box-shadow:none}
.app[data-theme]>.page:not(.relive-page) :is(.actions button,.item-actions button,.wide-action,.section-head button,.settings-card>button,.style-controls>button,#style-reset):not(:disabled){border:1px solid var(--ui-edge);border-radius:13px;box-shadow:none;font-weight:500}
.app[data-theme] #detail-content .relive-launch:not(:disabled){border:1px solid var(--ui-edge);border-radius:15px;background:var(--surface);color:var(--ink);box-shadow:none;font-weight:500}
.app[data-theme]>.page:not(.relive-page) :is(input:not([type=checkbox]):not([type=range]):not([type=color]),select,textarea){border-color:color-mix(in srgb,var(--control-line) 45%,#fff);border-radius:12px;font-weight:400}
.app[data-theme] .route-map-wrap{border:1px solid var(--ui-edge);border-radius:22px;box-shadow:none}

/* Style choice remains a list of the same nine options, with one selected row. */
.app[data-theme] .style-options{gap:6px}
.app[data-theme] #style-options .style{border:1px solid var(--ui-edge);border-radius:16px;background:transparent;color:var(--ink);box-shadow:none;padding:16px;min-height:68px}
.app[data-theme] #style-options .style :is(b,span,em){color:var(--ink)}
.app[data-theme] #style-options .style b{font-weight:500}
.app[data-theme] #style-options .style i{color:var(--muted);font-size:13px;line-height:1.5}
.app[data-theme] #style-options .style.selected{border-color:color-mix(in srgb,var(--trip-accent) 30%,transparent);background:var(--soft);box-shadow:none}
.app[data-theme] .style-controls{padding:22px;margin-top:24px;gap:20px 14px}
.app[data-theme] .accent-group legend{font-weight:500}
@media(hover:hover){
 .app[data-theme] :is(nav button,.switch button,.detail-tabs button,.style):not(:disabled):not(:focus-visible):hover{outline:0;background:var(--soft)}
}
@media(max-width:340px){
 .app[data-theme] .memory-card{padding:20px}
 .app[data-theme] #trip-list .card-relive{right:16px;bottom:20px;padding-inline:10px}
 .app[data-theme] .style-controls{padding:18px;column-gap:10px}
 .app[data-theme] nav button>span{font-size:10px}
}

/* Copenhagen needs visible paper edges: its near-white covers cannot define themselves by fill alone. */
.app[data-theme=minimal]:not(.relive-open):not(.relive-export-layout){background:#eeefe9}
.app[data-theme=minimal]>.page:not(.relive-page) :is(.memory-card,.detail-hero,.style-preview,.facts>div,.stop-card,.memory-item,#settings-stats,#footprints-settings,#stamps-open){border:1px solid #bdc6b7}
.app[data-theme=minimal] nav{border:1px solid #bdc6b7;background:var(--surface);box-shadow:0 5px 18px #263e300a}
.app[data-theme=minimal] :is(.switch,.detail-tabs){background:#e0e5da}
.app[data-theme=minimal] .switch .on,.app[data-theme=minimal] .detail-tabs .selected{box-shadow:inset 0 0 0 1px #c8d0c1}
.app[data-theme=minimal] nav button.active{background:#dfe6d8}
.app[data-theme=minimal]>.page:not(.relive-page) header :is(.round,#add):not(:disabled),
.app[data-theme=minimal]>.page:not(.relive-page) :is(.actions button,.item-actions button,.wide-action,.section-head button,.settings-card>button,.style-controls>button,#style-reset):not(:disabled){border-color:#bdc6b7}
.app[data-theme=minimal] #trip-list .card-relive{border:1px solid #bdc6b7}

/* One-pixel, theme-aware control edges. Layout containers remain transparent. */
:root{--ui-edge:color-mix(in srgb,var(--control-ink,#263c35) 36%,var(--control-paper,#fff))}
.app[data-theme]{--ui-edge:color-mix(in srgb,var(--ink) 36%,var(--surface));--control-line:var(--ui-edge)}
.app[data-theme]:not(.relive-export-layout)>.page :is(button,select,textarea,input:not([type=range]):not([type=checkbox]):not([type=color])){border-width:1px;border-style:solid;border-color:var(--ui-edge)}
.app[data-theme]>.page:not(.relive-page) :is(.facts>div,.stop-card,.memory-item,#settings-stats){border:1px solid var(--ui-edge)}
.app[data-theme]>.page:not(.relive-page) :is(.round,#add,.library-icon,.actions button,.item-actions button,.wide-action,.section-head button,.settings-card>button,.style-controls>button,#style-reset):not(:disabled){border:1px solid var(--ui-edge)}
.app[data-theme] #trip-list .card-relive{border:1px solid var(--ui-edge)}
.app[data-theme] #style-options .style{border-color:var(--ui-edge)}
.app[data-theme] #style-options .style.selected{border-color:var(--trip-accent)}
.app[data-theme] nav{border:1px solid var(--ui-edge)}
.app[data-theme] nav button.active{border:1px solid var(--ui-edge)}
dialog :is(button,select,textarea,input:not([type=range]):not([type=checkbox]):not([type=color])){border:1px solid var(--ui-edge)}
.app[data-theme] .footprint-summary button[aria-pressed=true]{border-color:var(--fp-visited)}
.app[data-theme] .footprint-countries button:focus-visible{outline:2px solid var(--fp-ink);outline-offset:3px}

/* Standalone controls: never frame a row of already outlined buttons twice. */
.app[data-theme] :is(.switch,.detail-tabs){border:0;border-radius:0;background:transparent;box-shadow:none;padding:0;gap:4px}
.app[data-theme] :is(.switch button.on,.detail-tabs button.selected){background:var(--soft);border-color:var(--trip-accent);box-shadow:none}
.app[data-theme] nav:not([hidden]){height:68px;border:1px solid var(--ui-edge);border-radius:28px;background:var(--surface);box-shadow:0 5px 18px color-mix(in srgb,var(--ink) 7%,transparent);padding:5px;gap:0;box-sizing:border-box}
.app[data-theme] nav:not([hidden]) button{border:0;border-radius:22px;background:transparent;box-shadow:none;min-height:44px;height:100%;flex:1 1 0}
.app[data-theme] nav:not([hidden]) button.active{background:var(--soft);border:0}

.app[data-theme] .detail-tabs button{min-width:0;flex:1 1 auto;padding-inline:6px}
.app[data-theme]>.page:not(.relive-page) :is(.audio-settings,.style-controls,.photo-look-controls){border:0;border-radius:0;background:transparent;box-shadow:none;padding:0}

/* Dark controls follow their page surface; Berlin's white/gray palettes stay light. */
.app:is([data-theme=noir],[data-theme=reykjavik],[data-theme=berlin][data-industrial-tone=black]){
 --control-paper:var(--surface);--control-ink:var(--ink);--control-scheme:dark;
 --control-hover:color-mix(in srgb,var(--ink) 8%,var(--surface));
 --control-selected:var(--soft);--control-selected-line:var(--line);
 --control-disabled:var(--paper);--control-muted:var(--muted);--control-danger:#ffaaa1;
 --control-focus:var(--trip-accent);--control-disabled-line:var(--line);
}
.app:is([data-theme=noir],[data-theme=reykjavik],[data-theme=berlin][data-industrial-tone=black]) #detail-content .relive-launch:not(:disabled),
.app:is([data-theme=noir],[data-theme=reykjavik],[data-theme=berlin][data-industrial-tone=black]) #relive-toggle{
 background:color-mix(in srgb,var(--trip-accent) 14%,var(--surface));color:var(--ink);border-color:var(--ui-edge);
}

/* Optional location toggle shares the template row without adding player height. */
.app[data-theme] .relive-controls{grid-template-columns:minmax(0,1fr) auto}
.app[data-theme] .relive-controls .template-choice{max-width:none}
.app[data-theme] .relive-controls .relive-location-choice{grid-area:1/2;display:flex;align-items:center;gap:6px;margin:0;padding:0 4px;min-height:44px;font:400 12px/1.3 var(--sans);color:var(--muted);white-space:nowrap;cursor:pointer}
.app[data-theme] .relive-location-choice input{width:16px;height:16px;margin:0;accent-color:var(--trip-accent)}

/* Generous, equal circular icon controls with the existing fine theme border. */
.app[data-theme] .page :is(.library-icon,.round,#add,#relive-export,.relive-buttons button,.footprint-back,.map-controls button,#footprint-zoom-in,#footprint-zoom-out){box-sizing:border-box;display:inline-grid;place-items:center;flex:0 0 52px;width:52px;height:52px;min-width:52px;min-height:52px;max-width:52px;max-height:52px;padding:0;border-radius:50%;line-height:1}
.app[data-theme] .library-actions{gap:6px}
.app[data-theme] .library-actions #add{margin-left:0}
.app[data-theme] .trip-page-header{grid-template-columns:52px minmax(0,1fr) 52px}
.app[data-theme] .relive-header.trip-page-header{grid-template-columns:52px minmax(0,1fr) 110px!important}
.app[data-theme] .relive-header .relive-header-actions{width:110px;gap:6px}
.app[data-theme] :is(.relive-buttons button,.library-icon) svg{width:23px;height:23px;display:block}
.app[data-theme] .relive-buttons button{border:1px solid var(--control-line);background:var(--control-paper);color:var(--control-ink);box-shadow:inset 0 1px 0 #ffffff16}
.app[data-theme] .relive-buttons button:not(:disabled):active{transform:scale(.96)}
.app[data-theme] :is(.actions button,.item-actions button,.wide-action,.section-head button,.settings-card>button,.style-controls>button,.segmented button,.trip-tabs button,.tab-strip button){min-height:48px}
@media(max-width:380px){.app[data-theme] .library-actions{gap:4px}.app[data-theme] [data-screen=memories]>header>.brand{font-size:11px;letter-spacing:0}.app[data-theme] .relive-header .page-title{font-size:16px}}

.app[data-theme] .library-actions #add{background:transparent}

/* Quiet, theme-aware journal scrolling and an explicit geographic-details switch. */
.app[data-theme] .journal-scroll{color-scheme:var(--control-scheme,light);scrollbar-width:thin;scrollbar-color:var(--muted) transparent}
.app[data-theme] .journal-scroll::-webkit-scrollbar{width:5px}
.app[data-theme] .journal-scroll::-webkit-scrollbar-track{background:transparent}
.app[data-theme] .journal-scroll::-webkit-scrollbar-thumb{background:var(--muted);border-radius:8px}
.app[data-theme] .journal-scroll::-webkit-scrollbar-button{display:none}
.app[data-theme] .relive-controls{grid-template-columns:minmax(0,1fr) minmax(0,43%)}
.app[data-theme] .relive-controls .relive-location-choice{white-space:normal;gap:8px;padding:0 2px 0 6px;font-size:11px;line-height:1.35}
.app[data-theme] .relive-location-choice input{appearance:none;-webkit-appearance:none;position:relative;box-sizing:border-box;flex:0 0 30px;width:30px;height:18px;min-height:0;padding:0;border:1px solid var(--ui-edge);border-radius:12px;background:var(--control-paper);color:var(--control-ink);cursor:pointer}
.app[data-theme] .relive-location-choice input::before{content:'';position:absolute;left:3px;top:3px;width:10px;height:10px;border-radius:50%;background:var(--muted)}
.app[data-theme] .relive-location-choice input:checked{border-color:var(--trip-accent);background:color-mix(in srgb,var(--trip-accent) 18%,var(--control-paper))}
.app[data-theme] .relive-location-choice input:checked::before{transform:translateX(12px);background:var(--trip-accent)}
.app[data-theme] .relive-location-choice input:focus-visible{outline:2px solid var(--control-focus);outline-offset:3px}

.caption-label [data-caption-count]{display:block;text-align:right;font-size:11px;color:var(--muted);margin-top:5px;font-variant-numeric:tabular-nums}
.caption-label input[aria-invalid="true"]{border-color:var(--control-danger)}
