/* Physical objects and small screens share one set of dimensions. */
.overlay-shell,.overlay-head,.art-layout,.earth-layout,.object-info,.instrument-panel,.earth-stage,.object-stage{min-width:0}
#boardOverlay,#objectOverlay,#letterOverlay,#earthOverlay{background:#191917f5;backdrop-filter:blur(8px)}
#boardOverlay .overlay-shell,#objectOverlay .overlay-shell,#letterOverlay .overlay-shell,#earthOverlay .overlay-shell{width:100%;max-width:1600px;margin:auto;height:100dvh;overflow:hidden;padding:20px 24px;gap:14px}
#boardOverlay .overlay-head,#objectOverlay .overlay-head,#letterOverlay .overlay-head,#earthOverlay .overlay-head{align-items:center;gap:12px}
#boardOverlay .overlay-head h2,#objectOverlay .overlay-head h2,#letterOverlay .overlay-head h2,#earthOverlay .overlay-head h2{font-size:clamp(22px,2.5vw,36px)!important;font-weight:500;line-height:1.15!important;letter-spacing:-.035em;white-space:normal!important;overflow-wrap:anywhere}
#boardOverlay .overlay-head>div:first-child,#objectOverlay .overlay-head>div:first-child,#letterOverlay .overlay-head>div:first-child,#earthOverlay .overlay-head>div:first-child{flex:1;min-width:0}
.object-controls{flex-shrink:0;align-items:center}
#boardOverlay button:not(.board-item),#objectOverlay button,#letterOverlay button,#earthOverlay .instrument-btn{font-size:11px!important;font-weight:500!important;letter-spacing:0!important;text-transform:none!important;border-radius:8px;min-height:44px;color:#f0ece3;border-color:#49473f;background:#2a2a25}
#boardOverlay .close,#objectOverlay .close,#letterOverlay .close,#earthOverlay .close{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;border-radius:10px!important;flex-shrink:0}
.overlay button:focus-visible{outline:2px solid #d4b58c;outline-offset:3px}
.overlay-shell>.micro:last-child{font-size:10px;letter-spacing:.05em;font-weight:500;color:#9e9c90}

/* Fit gives an overview on phones. Zoom and pinch preserve the logical arrangement. */
#boardOverlay .board-viewport{height:auto!important;min-height:0;background:radial-gradient(ellipse at 50% 35%,#36342a,#22211c);border-color:#464439;border-radius:14px!important}
#boardOverlay .corkboard{width:1800px!important;height:1100px!important;min-width:0!important;min-height:0!important;transform-origin:0 0;border-width:18px!important;box-shadow:0 20px 80px #0005!important}
#corkboard .board-item{will-change:auto;transition:box-shadow .15s;transform:rotate(var(--item-rotation)) scale(var(--item-scale))!important}
#corkboard .board-item.dragging-item{transform:rotate(var(--item-rotation)) scale(var(--item-scale))!important;filter:brightness(1.035)}
#corkboard .board-photobooth,#corkboard .board-photobooth .photo-strip{width:110px!important}
#corkboard .board-photobooth .strip-front{padding:7px 7px 9px!important}
#corkboard .board-photobooth .strip-frames{gap:4px!important}
#corkboard .board-photobooth footer{font-size:10px!important;gap:2px!important;padding-top:5px!important}
#corkboard .board-photo img{width:100%;height:220px;object-fit:cover;display:block}
.board-navigation{position:absolute;z-index:10;bottom:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:5px;padding:5px;border:1px solid #6b6655;border-radius:12px;background:#24231fee;box-shadow:0 5px 22px #0003}
.board-navigation .icon-only{width:44px;height:44px}
.board-navigation #boardFit{padding:0 16px}
.board-view-hint{position:absolute;z-index:9;left:12px;right:12px;bottom:76px;text-align:center;pointer-events:none;color:#c2b99e;font:11px/1.5 var(--font-interface)!important;margin:0}
.board-viewport.item-focused .board-navigation,.board-viewport.item-focused .board-view-hint{visibility:hidden}
.board-focus-compose{min-width:0;gap:20px;padding:68px 30px 24px!important}
.board-focus-details{border-radius:10px;background:#f4ecdb;color:#403429}
.board-focus-details h3{font-size:26px;overflow-wrap:anywhere}

/* Warm stationery: a quiet ivory sheet, cotton fibres, faint rules and soft ink. */
#letterOverlay{background:radial-gradient(ellipse at 45% 25%,#655d4d,#292823 75%)}
#letterOverlay .letter-wrap{min-height:0;padding:8px 0 16px;align-items:center}
#letterOverlay .paper-scene{width:min(780px,90vw)!important;height:100%!important;max-height:900px;filter:drop-shadow(0 24px 36px #0003)}
#letterOverlay .paper-card{width:100%!important;height:100%!important}
#letterOverlay .paper-card>.paper{max-width:none!important;max-height:none!important;border-radius:2px!important;border:1px solid #c7b39488!important;background-color:#f3e7ce!important;color:#51402f;padding:56px 64px!important;box-shadow:inset 0 0 54px #ac8b5320,inset 0 1px #fff9e9,inset 0 -2px #a88b5155;scrollbar-width:thin;scrollbar-color:#b7a485 #eee1c7}
#letterOverlay .paper::before{background:url('../public/assets/textures/paper-fibres.svg') repeat 0 0/180px 180px;mix-blend-mode:multiply;opacity:.4}
#letterOverlay .paper[data-style="ruled-notebook"],#letterOverlay .paper[data-style="index-card"]{background-image:repeating-linear-gradient(to bottom,transparent 0 35px,#81939824 35px 36px)!important;background-position:0 4px!important}
#letterOverlay .paper h3{font:400 clamp(30px,3vw,44px)/1.14 Georgia,serif!important;letter-spacing:-.025em!important;color:#65452e;margin:0 0 30px}
#letterOverlay .paper{--letter-font:var(--font-annotation)}
#letterOverlay .paper[data-font="beth-ellen"],#letterOverlay .paper[data-font="Beth Ellen"]{--letter-font:var(--font-beth)}
#letterOverlay .paper[data-font="gloria-hallelujah"],#letterOverlay .paper[data-font="Gloria Hallelujah"]{--letter-font:var(--font-gloria)}
#letterOverlay .paper[data-font="mansalva"],#letterOverlay .paper[data-font="Mansalva"]{--letter-font:var(--font-mansalva)}
#letterOverlay .paper[data-font="yuyu-short"],#letterOverlay .paper[data-font="Yuyu Short"]{--letter-font:var(--font-yuyu)}
#letterOverlay .paper[data-font="lacquer"],#letterOverlay .paper[data-font="Lacquer"]{--letter-font:var(--font-lacquer)}
#letterOverlay .letter-body{font:18px/2 Georgia,serif!important;letter-spacing:.005em;text-shadow:.2px .2px #8b69432b}
#letterOverlay .letter-body p{margin:0 0 24px;transform:none!important}
#letterOverlay .letter-signature{font:22px/1.8 Georgia,serif!important;margin-top:34px;color:#76553a}
#letterOverlay .paper-back{background-color:#eee0c4!important;background-image:none!important}
#letterOverlay .letter-reverse{font:22px/1.8 Georgia,serif!important;margin:24px 0;color:#785a3f;white-space:pre-wrap}
#letterOverlay .paper :is(h3,.letter-body,.letter-signature,.letter-reverse){font-family:var(--letter-font)!important;font-weight:400!important;font-style:normal!important;letter-spacing:0!important}
#letterOverlay .paper-back .micro{font-family:var(--font-interface)!important;color:#aa9271;font-size:10px}
#letterOverlay .paper-scene:has(.paper-card[data-style="small-note"]){max-width:600px;height:min(100%,680px)!important}

/* The inspector keeps the complete painting in view at every aspect ratio. */
#objectOverlay .art-layout{grid-template-columns:minmax(0,1fr) 280px}
#objectOverlay .object-stage{background:radial-gradient(ellipse at 50% 36%,#494439,#24231f 70%);border-radius:14px;border-color:#48453b}
#objectOverlay .object-info{background:#24241f;border-color:#48453b;border-radius:12px;overflow:auto;scrollbar-width:thin;color:#e9e1d2}
#objectOverlay .object-info h3{font-size:25px;font-weight:500;margin:10px 0 14px;letter-spacing:-.035em}
#objectOverlay .object-info p{font-size:12px;line-height:1.75;color:#b8b3a5}
#objectOverlay .object-info ul{padding:0;list-style:none;display:grid;gap:7px}
#objectOverlay .reverse-item-button{font-size:12px!important;padding:12px!important}
#objectOverlay .frame-artifact-focus{padding:64px 18px 18px}
.inspected-note{font:26px/1.6 var(--font-annotation)!important;color:#2b2f45;padding:30px;background:#f0e1b9;white-space:pre-wrap}
.inspected-label{font:12px/1.6 var(--font-interface);padding:24px;background:#efe7d5}

/* Atlas: clear land/water, a readable place marker, restrained floating photos. */
#earthOverlay .earth-layout{grid-template-columns:270px minmax(0,1fr);gap:12px}
#earthOverlay .earth-control-panel{background:#252720;border-color:#454a3e;border-radius:12px;max-height:none;scrollbar-width:thin}
#earthOverlay .earth-control-panel h3{font-size:25px!important;line-height:1.2;letter-spacing:-.035em}
#earthOverlay .earth-control-panel p{font-size:12px;line-height:1.65;color:#b8bcaf}
#earthOverlay .earth-control-panel .micro{font-size:10px;font-weight:500;letter-spacing:.09em}
#earthOverlay .earth-control-panel .instrument-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:auto;padding:10px 8px;min-height:44px;white-space:normal;line-height:1.35;background:#2a2e26;border-color:#4b5143}
#earthOverlay .earth-control-panel .instrument-btn .solar-icon{width:18px;height:18px;flex-shrink:0}
#earthOverlay .earth-control-panel .instrument-btn.active{background:#e1dfc9;border-color:#e1dfc9;color:#30362a}
#earthOverlay .map-style-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#earthOverlay .earth-stage{background:#e6e8de;border-radius:14px;border-color:#50594b;min-width:0}
#earthOverlay #earthChart,#earthOverlay #earthMap{min-width:0!important;min-height:0!important;width:100%!important;height:100%!important}
#earthChart[data-globe-style="night"]{background:#121b23}
.earth-place-badge{position:absolute;z-index:24;left:16px;top:16px;display:grid;gap:5px;padding:12px 14px;border-radius:10px;background:#f8f6e9ed;color:#334037;border:1px solid #7d8c722e;pointer-events:none;max-width:calc(100% - 96px);box-shadow:0 5px 20px #28392410}
.earth-place-badge span{font:600 14px/1.2 var(--font-interface)}
.earth-place-badge small{font:10px/1.3 var(--font-interface);font-variant-numeric:tabular-nums;color:#717868}
.earth-stage-controls{top:14px!important;right:14px!important;bottom:auto!important;gap:7px}
.earth-stage-controls .icon-only{width:44px!important;height:44px!important;background:#29382cf2;border:1px solid #7d8c7266;border-radius:10px!important}
.earth-tile-status{position:absolute;z-index:26;top:86px;left:16px;max-width:calc(100% - 96px);background:#2b352dee;color:#f4f0df;border-radius:8px;padding:9px 12px;font:11px/1.5 var(--font-interface)!important}
#earthStage .floating-location-gallery{inset:auto 78px 20px 20px!important;height:144px!important;width:auto!important;display:flex!important;gap:12px;align-items:center;overflow-x:auto!important;overflow-y:hidden!important;pointer-events:none!important}
#earthStage .floating-location-gallery .floating-photo{position:relative!important;left:auto!important;top:auto!important;flex:0 0 auto;width:98px!important;height:128px!important;transform:rotate(var(--photo-rotation,0deg)) scale(.96)!important;pointer-events:auto!important}
#earthStage .floating-location-gallery .floating-photo:hover,#earthStage .floating-location-gallery .floating-photo:focus-visible{transform:rotate(0deg) scale(1)!important}
#earthStage .floating-location-gallery .floating-photo:nth-child(n){display:grid!important}
#earthStage .floating-location-gallery .floating-photo>span{font-size:10px!important}
#earthOverlay .location-photo-focus{padding:58px 14px 16px}
#earthOverlay .location-photo-focus figure{max-width:100%;max-height:100%;overflow:auto}
#earthOverlay .leaflet-control-attribution{display:block!important;max-width:100%;background:#f8f6e9ed;font-size:10px!important;color:#5d6555;border-radius:5px 0 0 0;padding:3px 6px;line-height:1.4}
#earthOverlay .leaflet-control-attribution a{color:#405b44}

@media(max-width:980px){
  #earthOverlay .earth-layout{grid-template-columns:230px minmax(0,1fr)}
  #objectOverlay .art-layout{grid-template-columns:minmax(0,1fr) 240px}
}
@media(max-width:760px){
  #boardOverlay .overlay-shell,#objectOverlay .overlay-shell,#letterOverlay .overlay-shell,#earthOverlay .overlay-shell{width:100%!important;padding:max(10px,env(safe-area-inset-top)) 10px max(10px,env(safe-area-inset-bottom))!important;gap:10px!important}
  #boardOverlay .overlay-head,#objectOverlay .overlay-head,#letterOverlay .overlay-head,#earthOverlay .overlay-head{gap:8px!important;min-height:52px!important;padding:0!important}
  #boardOverlay .overlay-head .micro,#objectOverlay .overlay-head .micro,#letterOverlay .overlay-head .micro,#earthOverlay .overlay-head .micro{font-size:10px!important;letter-spacing:.1em}
  #boardOverlay .overlay-head h2,#objectOverlay .overlay-head h2,#letterOverlay .overlay-head h2,#earthOverlay .overlay-head h2{font-size:22px!important;white-space:normal!important}
  #boardOverlay #resetBoardLayout{font-size:10px!important;padding:0 9px!important;max-width:96px}
  #objectOverlay .object-toolbar button:not(.close){font-size:11px!important;padding:0 11px!important}
  #objectOverlay .art-layout{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,68%) minmax(0,32%)!important;gap:10px!important}
  #objectOverlay .object-info{padding:14px!important;max-height:none!important}
  #objectOverlay .object-info h3{font-size:22px!important}
  #letterOverlay .letter-wrap{padding:0!important}
  #letterOverlay .paper-scene{width:100%!important;max-width:620px}
  #letterOverlay .paper-card>.paper{padding:32px 24px 40px!important;border-radius:3px!important}
  #letterOverlay .paper h3{font-size:30px!important;margin-bottom:24px}
  #letterOverlay .letter-body{font-size:16px!important;line-height:2.1!important}
  #letterOverlay .letter-signature{font-size:20px!important}
  #boardOverlay .board-focus-compose{padding:62px 14px 14px!important;grid-template-rows:minmax(0,55%) minmax(0,45%)!important;gap:12px}
  #boardOverlay .focused-board-item:not(.board-photobooth){width:100%!important;min-height:0!important}
  #boardOverlay .focused-board-item .photo-placeholder{height:220px}
  #earthOverlay .earth-layout{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,62%) minmax(0,38%)!important;gap:0!important}
  #earthOverlay .earth-stage{grid-row:1!important;border-radius:14px 14px 0 0!important}
  #earthOverlay .earth-control-panel{grid-row:2!important;border-radius:0 0 14px 14px!important;padding:14px!important}
  #earthOverlay .earth-control-panel h3{font-size:21px!important}
  #earthOverlay .earth-mode-grid,#earthOverlay .earth-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #earthOverlay .earth-control-panel>.micro:first-child,#earthOverlay .earth-control-panel>p:not(#earthObserverStatus):not(#locationPhotoCount){display:none}
  #earthOverlay .earth-control-panel .instrument-btn{font-size:12px!important}
  #earthStage .floating-location-gallery{inset:auto 65px 22px 12px!important;height:104px!important;padding:0!important;gap:8px;pointer-events:auto!important;scrollbar-width:none}
  #earthStage .floating-location-gallery .floating-photo{width:72px!important;min-width:72px!important;height:92px!important;padding:5px 5px 19px!important}
  .earth-place-badge{top:12px;left:12px;padding:10px 12px;max-width:calc(100% - 76px)}
  .earth-place-badge span{font-size:13px}
  .earth-stage-controls{top:12px!important;right:12px!important}
  #skyOverlay .loading-note{display:none}
  #skyOverlay .sky-layout>.instrument-panel:not(.collapsed){max-height:44dvh!important;bottom:max(8px,env(safe-area-inset-bottom))!important}
  #skyOverlay .sky-layout>.instrument-panel.collapsed{max-height:56px!important;width:126px!important;padding:6px!important}
  #skyOverlay .sky-panel-toggle{font-size:12px!important;min-height:44px!important;height:44px!important;width:88px}
  #skyOverlay .instrument-btn{min-height:44px!important}
  #skyOverlay .sky-search{font-size:16px!important;min-height:44px!important}
  .top-tools .visual-settings-trigger,.top-tools .quality{font-size:10px!important;min-height:44px!important}
  .plaque-actions button{font-size:10px!important;letter-spacing:.02em!important;min-height:44px!important}
  .brand strong{font-size:10px!important;letter-spacing:.06em!important;max-width:94px;line-height:1.4!important}
  .memory-plaque .micro{font-size:10px!important;letter-spacing:.06em!important}
  .memory-plaque .meta-grid span{font-size:10px!important;letter-spacing:.02em!important;line-height:1.6}
}
@media(max-width:380px){
  #objectOverlay .overlay-head{flex-wrap:wrap}
  #objectOverlay .overlay-head>div:first-child{flex-basis:100%}
  #objectOverlay .object-controls{margin-left:auto}
  .top-tools{gap:4px!important}
  .top-tools .visual-settings-trigger{padding:0 8px!important}
}
@media(max-height:540px) and (orientation:landscape){
  #earthOverlay .earth-layout{grid-template-columns:220px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}
  #earthOverlay .earth-control-panel{grid-column:1!important;grid-row:1!important}
  #earthOverlay .earth-stage{grid-column:2!important;grid-row:1!important}
  #objectOverlay .art-layout{grid-template-columns:minmax(0,1fr) 220px!important;grid-template-rows:minmax(0,1fr)!important}
  #earthStage .floating-location-gallery{height:76px!important}
  #earthStage .floating-location-gallery .floating-photo{width:54px!important;min-width:54px!important;height:70px!important}
  #skyOverlay .sky-layout>.instrument-panel:not(.collapsed){max-height:calc(100% - 84px)!important;max-width:330px!important}
}

#earthOverlay[data-earth-mode="globe"] .map-surface-panel,#earthOverlay[data-earth-mode="globe"] .map-filter-panel,#earthOverlay[data-earth-mode="map"] .globe-filter-panel{display:none}

#earthOverlay .globe-style-grid .instrument-btn,#earthOverlay .map-style-grid .instrument-btn,#earthOverlay .map-filter-grid .instrument-btn{grid-column:auto!important}
#earthOverlay .globe-style-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}

#letterOverlay .paper .letter-body p{font-family:inherit!important}
#letterOverlay .object-controls button:not(.close){display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;padding:0 12px!important}

.board-workspace{min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr)}
.board-index{display:none}
@media(max-width:760px){
  .board-workspace{grid-template-rows:minmax(0,54%) minmax(0,46%);gap:12px}
  #boardOverlay .board-workspace .board-viewport{height:100%!important}
  .board-index{display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px;min-height:0;padding:12px 4px 0}
  .board-index-heading{font:500 15px/1.3 var(--font-interface);color:#d6cbbb;display:flex;align-items:center;justify-content:space-between;padding:0 5px}
  .board-index-heading span{font-size:11px;color:#998f7d}
  #boardItemIndex{overflow:auto;display:grid;align-content:start;gap:8px;scrollbar-width:thin}
  #boardOverlay .board-index-item{display:flex;align-items:center;gap:13px;padding:10px 14px!important;text-align:left;min-height:58px!important;background:#2b2a24!important;border-color:#48453b;border-radius:10px}
  .board-index-item .solar-icon{width:20px;height:20px;color:#b8a486;flex-shrink:0}
  .board-index-item>span{min-width:0;display:grid;gap:5px}
  .board-index-item small{font-size:10px;color:#ad9e88;text-transform:uppercase;letter-spacing:.06em}
  .board-index-item strong{font-size:12px;font-weight:400;color:#e1d7c6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .board-workspace:has(.item-focused){grid-template-rows:minmax(0,1fr)}
  .board-workspace:has(.item-focused) .board-index{display:none}
  .board-navigation{bottom:10px;padding:3px}
  .board-view-hint{display:none}
}
@media(max-height:540px) and (orientation:landscape){
  .board-workspace{grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:minmax(0,1fr)}
  .board-index{display:grid;min-height:0}
  .board-workspace:has(.item-focused){grid-template-columns:minmax(0,1fr)}
}

#corkboard .board-photobooth .photo-strip footer span{font:400 13px/1.4 var(--font-annotation)!important;letter-spacing:0!important;text-transform:none!important}
.focused-board-item.board-photobooth .photo-strip footer span{font:400 13px/1.4 var(--font-annotation)!important;letter-spacing:0!important;text-transform:none!important}

#boardOverlay .corkboard{background-size:100% 100%,100% 100%,cover!important;background-position:center!important;background-repeat:no-repeat!important}

/* Keep the tap area separate from the circular memory indicator. */
.memory-nav .dots{gap:0!important;padding:0 3px!important;min-height:44px;align-items:center}
.memory-nav .memory-dot{display:grid;place-items:center;flex:0 0 32px;width:32px!important;height:44px!important;min-width:32px;min-height:44px;padding:0!important;background:transparent!important;opacity:1!important;transform:none!important;border-radius:8px!important;box-shadow:none!important}
.memory-dot>span{display:block;width:6px;height:6px;border-radius:50%;background:#a8a39b;opacity:.5;transition:background .18s,opacity .18s,transform .18s}
.memory-dot.active>span{background:#26221c;opacity:1;transform:scale(1.5)}
.memory-nav .memory-dot:hover>span{opacity:1}
.memory-nav .memory-dot:focus-visible{outline:2px solid #796b59;outline-offset:-3px}
@media(max-width:760px){.memory-nav{gap:4px!important;padding:5px!important;max-width:calc(100vw - 20px)}.memory-nav .nav-arrow{flex:0 0 44px}}

/* Read the complete memory while its actions remain in their own footer. */
@media(max-width:760px),(max-width:980px) and (max-height:540px) and (orientation:landscape){
  .memory-plaque{display:grid!important;grid-template-rows:auto minmax(0,1fr) auto!important;overflow:hidden!important}
  .memory-plaque::before{margin-bottom:10px!important}
  .plaque-content{grid-row:2;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-right:4px;padding-bottom:4px}
  .memory-plaque .plaque-actions{grid-row:3;position:static!important;bottom:auto!important;margin:0!important;padding:8px 0 0!important;background:#fcf9f3!important;border-top:1px solid #ded8cd}
  .memory-plaque .plaque-actions button{min-height:44px!important}
  .memory-plaque .plaque-actions .sky{grid-column:auto!important}
}
