/* Small-screen print detail. Decorations never sit beneath control labels. */
.app[data-theme=berlin],.memory-card[data-card-theme=berlin]{--paper:#202020;--soft:#323232;--ink:#f2f2ed;--line:#626262;--surface:#292929;--muted:#c2c2bb;--cover-ink:#f2f2ed;--card-radius:14px;--title-font:var(--sans);--title-weight:750;--world-bg:repeating-linear-gradient(0deg,transparent 0 35px,#ffffff09 35px 36px),linear-gradient(115deg,#393939,#202020);--map-water:#e8e8e8;--map-land:#c5c5c5}
.app[data-theme=berlin][data-industrial-tone=white],.memory-card[data-card-theme=berlin][data-industrial-tone=white]{--paper:#f0f0ed;--soft:#dcdcd8;--ink:#242424;--line:#9e9e98;--surface:#fcfcf7;--muted:#555550;--cover-ink:#242424;--world-bg:repeating-linear-gradient(0deg,transparent 0 35px,#00000009 35px 36px),linear-gradient(115deg,#eeeeea,#d6d6d2)}
.app[data-theme=berlin][data-industrial-tone=gray],.memory-card[data-card-theme=berlin][data-industrial-tone=gray]{--paper:#d0d0ca;--soft:#bdbdb7;--ink:#222222;--line:#868680;--surface:#e6e6df;--muted:#494943;--cover-ink:#222222;--world-bg:repeating-linear-gradient(0deg,transparent 0 35px,#0000000c 35px 36px),linear-gradient(115deg,#c5c5bf,#e1e1dc)}
.app[data-theme=guanajuato],.memory-card[data-card-theme=guanajuato]{--paper:#faf0dc;--soft:#efd9bc;--ink:#342d3c;--line:#c29c82;--surface:#fff9eb;--muted:#70545b;--cover-ink:#342d3c;--card-radius:22px;--title-font:Georgia,"Songti SC",serif;--world-bg:linear-gradient(90deg,#e6ab4750 0 25%,#c7507040 25% 50%,#4a929140 50% 75%,#896c9b40 75%);--map-water:#afdad5;--map-land:#f2e4c7}
.app[data-theme=berlin] :is(.memory-card,.detail-hero,.style-preview){border-top-width:2px;border-bottom:5px double var(--line)}
.app[data-theme=guanajuato] :is(.memory-card,.detail-hero,.style-preview){border-top-width:6px;border-bottom:6px solid #226c69}
.app[data-theme=guanajuato] :is(.actions button,.wide-action,.settings-card>button,#style-reset){background-image:radial-gradient(circle at 93% 9%,#f5cc733d 0 6px,transparent 7px),radial-gradient(circle at 88% 16%,#f5cc733d 0 6px,transparent 7px),radial-gradient(circle at 95% 24%,#f5cc733d 0 6px,transparent 7px);background-repeat:no-repeat}
.app[data-theme] :is(.actions button,.section-head button,.wide-action,.relive-launch,.settings-card>button,#style-reset){color:var(--accent-ink,#fff);border-radius:14px;min-height:44px}
.app[data-theme] :is(h1,h2,h3,strong,b,p,label,small){overflow-wrap:anywhere}
.app[data-theme] :is(.style div,.brand,.section-head>*,.form-row>*,.facts>div,.route-list article div){min-width:0}
.app[data-theme] .brand{font-size:12px;letter-spacing:.12em;line-height:1.35}
.app[data-theme] .brand small{font-size:10px;letter-spacing:.08em;line-height:1.5}
.app[data-theme] .intro{padding-top:32px;padding-bottom:18px}
.app[data-theme] .intro h1{font-size:clamp(30px,8.8vw,40px);line-height:1.18;letter-spacing:-.035em;margin:12px 0 18px}
.app[data-theme] .intro p{font-size:11px;line-height:1.6;letter-spacing:.1em}
.app[data-theme] :is(.style-controls,.settings-card,.photo-look-controls,.detail-section){border:1px solid var(--line);border-radius:22px;padding:20px}
.app[data-theme] .style{padding:15px 16px;border:1px solid var(--line);border-radius:17px;gap:14px}
.app[data-theme] .style div{gap:6px}.app[data-theme] .style b{font-size:16px;line-height:1.3}.app[data-theme] .style i{font-size:12px;line-height:1.45;font-weight:400}
.app[data-theme] .style>span{font-family:monospace;font-size:12px;flex-shrink:0}
.app[data-theme] .style.selected{box-shadow:inset 3px 0 var(--trip-accent)}
.app[data-theme] .settings-card label{display:grid;gap:9px;margin-top:20px;line-height:1.5}
.app[data-theme] :is(input:not([type=checkbox]):not([type=range]),select,textarea){min-width:0;max-width:100%;border-radius:13px;line-height:1.45;font:inherit;padding:12px 14px}
.app[data-theme] :is(.item-actions button,.stamp-filters button){min-height:40px;padding:10px 13px;border:1px solid var(--line);border-radius:12px;background:var(--soft);color:var(--ink)}
.app[data-theme] .item-actions button:last-child{background:#fae8e2;color:#8a302b;border-color:#d9aba1}
.app[data-theme] .detail-tabs{padding:4px;border:1px solid var(--line);border-radius:14px;gap:3px}.app[data-theme] .detail-tabs button{border-radius:10px;opacity:1;min-width:0;line-height:1.4}
.app[data-theme] .detail-tabs button.selected{border-bottom:0;box-shadow:inset 0 -2px var(--trip-accent)}
.app[data-theme] .facts{gap:10px}.app[data-theme] .facts>div{padding:13px 14px;border:1px solid var(--line)}
.app[data-theme] .section-head{gap:12px;flex-wrap:wrap}.app[data-theme] .section-head h2{font-size:25px;line-height:1.15}
.app[data-theme] .stop-card{padding:18px;gap:15px}.app[data-theme] .stop-number{font:13px/1.5 monospace;color:var(--muted);padding-top:4px}
.app[data-theme] .stop-info h3{font-size:22px;line-height:1.25}.app[data-theme] .stop-info h3 small{color:var(--muted)}
.app[data-theme] .journal-text{line-height:1.7;font-size:18px}.app[data-theme] .memory-card strong{max-width:100%;line-height:1.08}
.app[data-theme] .switch button{color:var(--ink);background:var(--soft);font-size:11px;padding:12px 10px;line-height:1.4;min-width:0}.app[data-theme] .switch .on{background:var(--ink);color:var(--paper)}
.app[data-theme] nav{height:68px;border:1px solid var(--line);background:var(--surface);box-shadow:0 4px 24px #0000000c}.app[data-theme] nav button{border-radius:13px;min-width:0;line-height:1.3}.app[data-theme] nav button.active{background:var(--soft)}
.app[data-theme] nav button>span{height:auto;min-height:15px;font-size:11px}.app[data-theme] nav .nav-icon{width:23px;height:23px}
.app[data-theme] .stamp{padding:17px;gap:10px;min-height:185px}.app[data-theme] .stamp strong{line-height:1.35}.app[data-theme] .stamp.locked{opacity:1;color:var(--muted);filter:grayscale(1)}
.stamp-hidden-hint{padding:22px 16px;border-top:1px dashed var(--line);text-align:center;margin-top:28px;font-style:italic}
dialog{padding:20px;border:1px solid #c7cdbf;box-shadow:0 24px 80px #11291e30}dialog .dialog-body{min-width:0}dialog :is(h2,label,p){overflow-wrap:anywhere}dialog h2{font-size:30px;line-height:1.2;padding-right:40px;margin-bottom:18px}
dialog :is(input:not([type="checkbox"]):not([type="range"]),select,textarea){width:100%;min-width:0;font-size:16px}dialog :is(button,label){line-height:1.45}dialog button{min-height:44px}
@media(max-width:380px){.page{padding-inline:16px}.app[data-theme] :is(.style-controls,.settings-card,.photo-look-controls,.detail-section){padding:16px}.stamp-grid{gap:9px}.app[data-theme] .stamp{padding:14px}.app[data-theme] .style{padding:13px}.app[data-theme] .intro h1{font-size:30px}.app[data-theme] .actions button{flex:1 1 130px}}

.app[data-theme] .memory-card strong{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;font-size:clamp(29px,9vw,42px)}
.app[data-theme] .memory-card i{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}

/* v99: metadata occupies its own rows, even with long localized dates. */
.app[data-theme] .memory-card{display:flex;flex-direction:column;align-items:stretch;gap:12px;height:auto;min-height:280px}
.app[data-theme] .memory-card>span{position:static;line-height:1.55;white-space:normal}
.app[data-theme] .memory-card .country-pins{position:static;inset:auto;margin:0;max-width:100%;flex-shrink:0}
.app[data-theme] .memory-card strong{position:static;margin-top:22px}
.app[data-theme] .memory-card i{position:static;margin-top:0}
.app[data-theme] .memory-card em{position:static;align-self:flex-start;margin-top:6px}
.accent-group{border:0;padding:0;margin:0;min-width:0}
.accent-group legend{font-size:14px;font-weight:700;color:var(--muted);padding:0;margin-bottom:10px}
.accent-options button{flex:0 0 44px;padding:0;display:grid;place-items:center;position:relative;touch-action:manipulation}

/* Dialogs live outside .app: do not rely on app-scoped sizing or tokens. */
body:has(dialog[open]){overflow:hidden;overscroll-behavior:none}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-x:hidden;overscroll-behavior:contain;padding:18px}
dialog form,dialog .dialog-body{width:100%;min-width:0;padding:6px;gap:14px;text-align:center}
dialog :is(label,input,textarea,select,button){min-width:0;max-width:100%;text-align:center}
dialog label{justify-items:stretch}
dialog :is(h2,p){margin-inline:0;text-align:center}
dialog h2{padding-inline:36px;font-size:clamp(23px,7vw,30px);line-height:1.25}
dialog .form-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
dialog :is(input,select,textarea){box-sizing:border-box;font-size:16px!important;line-height:1.4}
dialog input::placeholder,dialog textarea::placeholder{font-size:14px;color:#647569;opacity:1}
dialog textarea{resize:none}
dialog button.date-trigger{display:block;width:100%;min-height:46px;margin:0;padding:10px 4px;border:1px solid #a9b9aa;border-radius:10px;background:#fff;color:#18372a;font:400 14px/1.4 var(--sans);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
dialog form>button.dialog-close,dialog .dialog-body>button.dialog-close{width:44px;height:44px;right:0;top:0;min-height:44px;display:grid;place-items:center}
dialog .dialog-body>button:not(.dialog-close){text-align:center}
dialog .note-counter{font-size:11px!important;line-height:1.5;text-align:center}
.date-picker .calendar-head button,.date-picker .calendar-actions button{padding:8px;background:#e0e8df;color:#17352d}
.date-picker .calendar-days button{padding:0;background:transparent;color:#17352d;min-width:0;min-height:44px;font-size:15px;font-weight:400}
.date-picker .calendar-days button[aria-pressed=true]{background:#17352d;color:#fff}
.date-picker .calendar-head strong{font-size:16px;text-align:center}
.date-picker{width:min(390px,calc(100vw - 8px));max-width:calc(100vw - 8px);padding:12px}
.date-picker :is(.calendar-week,.calendar-days){gap:2px}
@media(max-width:360px){
  .date-picker{padding:0}
  .date-picker :is(.calendar-week,.calendar-days){gap:0}
  .date-picker :is(.calendar-head,.calendar-actions){margin:8px}
}
.app[data-theme] .relive-media .relive-place :is(small,span){color:#dbe5ef}
.app[data-theme] .route-list b{color:var(--muted)}
#share-preview .dialog-body{gap:10px}
#share-preview #share-template-control{margin:0}
#share-preview #share-error:empty{display:none}
#share-preview #share-image{max-height:max(140px,calc(100dvh - 410px));margin:4px 0}
@media(max-width:340px){dialog{padding:12px}dialog form,dialog .dialog-body{gap:10px}dialog .form-row{gap:6px}dialog .date-trigger{font-size:13px}dialog h2{font-size:23px}dialog label{font-size:14px!important}}


.upload-feedback{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;overflow-wrap:anywhere;color:var(--ink)}
.upload-feedback p{margin:4px 0}
.upload-feedback ul{margin:8px 0 0;padding-inline-start:20px}
.upload-feedback li{margin-block:8px}

/* v101: comfortable touch actions without changing the travel-paper layout. */
.app[data-theme] :is(.item-actions button,.stamp-filters button){min-height:44px}
