/* Quiet, consistent touch targets; scene imagery stays unobstructed. */
.tools{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;align-items:center;gap:2px;max-height:calc(100dvh - 38px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;scrollbar-width:none;overscroll-behavior:contain}
.tools::-webkit-scrollbar{display:none}
.tools>.corner,.pages>.corner{min-width:44px;min-height:44px;border:1px solid transparent;border-radius:12px;box-sizing:border-box;touch-action:manipulation}
.tools>.corner{flex:0 0 44px;transition:color .2s,background-color .2s,border-color .2s,opacity .3s}
.tools>.corner:active,.tools>.corner[aria-expanded="true"]{color:#fff;background:rgba(17,38,43,.48);border-color:rgba(227,237,218,.23)}
.corner:focus-visible,.coast-choice:focus-visible{outline:2px solid #e0dbc1!important;outline-offset:2px!important}
@media(hover:hover){.tools>.corner:hover,.pages>.corner:hover{color:#fff;background:rgba(17,38,43,.35)}}
.eo-choice-menu{position:fixed;z-index:14;right:calc(65px + env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));width:min(276px,calc(100vw - 88px));max-height:calc(100dvh - 48px - env(safe-area-inset-top));overflow:auto;padding:9px;border:1px solid #dbe3d03b;border-radius:16px;background:rgba(13,28,32,.97);box-shadow:0 12px 45px #0005;touch-action:pan-y;overscroll-behavior:contain}
.eo-choice-menu[hidden]{display:none}.eo-choice-menu button{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:11px 13px;font:500 15px/1.4 Georgia,serif;color:#e9ecdc;text-align:left;background:none;border:1px solid transparent;border-radius:9px;cursor:pointer}
.eo-choice-menu button[aria-checked="true"]{background:#cbdab114;color:#fff7d9}.eo-choice-menu button[aria-checked="true"]::after{content:'·';font:26px/1 Georgia,serif;margin-left:12px;color:#e6d7a9}
.eo-choice-menu button:hover,.eo-choice-menu button:focus-visible{background:#cbdab11c;outline:1px solid #d4dbb788;outline-offset:-1px}
.eo-choice-title{margin:7px 13px 9px;font:11px/1.5 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.14em;color:#a9beb8}
#coast-menu{touch-action:pan-y;overscroll-behavior:contain}.coast-choice{min-height:44px}
#wname{max-width:calc(100vw - 92px);white-space:normal!important;text-wrap:balance;line-height:1.4}
.journal-note{grid-column:1/-1;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 12px 8px;color:#c9c4b3;font-size:.95rem;line-height:1.5}
.journal-panel{scrollbar-width:thin;scrollbar-color:#88795d transparent}.journal-panel input,.journal-panel textarea{font-size:max(16px,1.05rem)}
@media(prefers-reduced-motion:reduce){.corner,.tools>.corner,.eo-choice-menu{transition:none!important;animation:none!important}}

/* ---- v36: where you are, and what each control does ----
   The pages are two labelled tabs at the bottom left, the one you are on lit.
   The scene's controls stand in one column at the bottom right, on the same
   quiet glass; on Sculpt the dredge stands apart above them. A tap on any of
   them opens a small chooser beside it, every choice named and shown. */
.pages{gap:2px;padding:4px;border-radius:16px;background:rgba(8,18,24,.34);border:1px solid rgba(232,240,230,.13);
  -webkit-backdrop-filter:blur(10px) saturate(1.1);backdrop-filter:blur(10px) saturate(1.1);box-shadow:0 6px 24px rgba(0,0,0,.18)}
.page-tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-width:58px;min-height:52px;padding:6px 8px 5px;
  border-radius:12px;color:rgba(255,255,255,.72);text-decoration:none;font:500 10.5px/1 system-ui,-apple-system,"Segoe UI",sans-serif;letter-spacing:.14em;text-transform:uppercase;
  transition:background-color .25s,color .25s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.page-tab svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.page-tab.here{color:#fff;background:rgba(255,255,255,.14);cursor:default}
a.page-tab:hover,a.page-tab:focus-visible{color:#fff;background:rgba(255,255,255,.08)}
.page-tab:focus-visible{outline:2px solid #e0dbc1;outline-offset:1px}
.page-name{display:block;text-indent:.14em}
.tools{padding:4px;border-radius:16px;background:rgba(8,18,24,.30);border:1px solid rgba(232,240,230,.12);
  -webkit-backdrop-filter:blur(10px) saturate(1.1);backdrop-filter:blur(10px) saturate(1.1);box-shadow:0 6px 24px rgba(0,0,0,.18)}
.tools .ico svg{filter:none}
.tools-gap{display:block;flex:0 0 9px;width:60%;margin:0 auto;border-top:1px solid rgba(232,240,230,.18);transform:translateY(4px)}
body.rest-quiet .pages,body.rest-quiet .tools{opacity:.22;transition:opacity 1.6s ease}
.pages,.tools{transition:opacity .4s ease}
body.rest-quiet .pages:hover,body.rest-quiet .tools:hover,body.rest-quiet .pages:focus-within,body.rest-quiet .tools:focus-within{opacity:1}
body.rest-quiet .corner{opacity:1}
/* the choosers */
.eo-choice-menu,#coast-menu{right:calc(76px + env(safe-area-inset-right))!important;left:auto!important;width:min(300px,calc(100vw - 96px))!important}
.eo-choice-menu button{display:grid!important;grid-template-columns:24px minmax(0,1fr) auto;align-items:center;gap:12px;justify-content:stretch!important}
.eo-choice-ico svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;overflow:visible;opacity:.92}
.eo-choice-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.eo-choice-name{font:500 15px/1.25 Georgia,serif}
.eo-choice-desc{font:11.5px/1.35 system-ui,-apple-system,sans-serif;color:#b6cbc4}
#coast-menu .eo-choice-title{margin:7px 12px 6px}
@media (max-width:380px){.page-tab{min-width:52px}.eo-choice-menu,#coast-menu{width:calc(100vw - 92px)!important}}
@media (prefers-reduced-motion:reduce){.page-tab,.pages,.tools{transition:none}}

/* ---- v38: every control in the column stands in the column (none fixed over another),
   and the page you are on is shown by its lit tab alone, with no stray dot beneath */
.tools>.corner,.tools>.ico{position:relative!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important}
.pages .here::after,.page-tab.here::after{content:none!important;display:none!important}

/* the journal, shared by Rest and Sculpt */
body.journal-open{touch-action:pan-y}
.journal-overlay[hidden]{display:none}
.journal-overlay{position:fixed;inset:0;z-index:12;background:rgba(3,12,16,.42);display:flex;align-items:center;justify-content:center;padding:20px;touch-action:pan-y}
.journal-panel{width:min(420px,100%);max-height:82dvh;overflow:auto;overscroll-behavior:contain;background:linear-gradient(145deg,#2b2119,#171c1c);border:1px solid #766148;border-radius:12px;padding:24px;color:#e8dfc9;box-shadow:0 18px 65px #0007;outline:none;touch-action:pan-y;user-select:text}
.journal-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.journal-heading h2{font-size:1.65rem;font-weight:400;margin:0}
.journal-intro,.journal-footnote,.journal-empty{color:#bcb8a8;font-size:1rem;line-height:1.5}.journal-footnote{font-size:.85rem;margin-bottom:0}
.journal-panel label{display:block;font-size:.95rem;margin:14px 0 6px;color:#cec2ab}
.journal-panel input,.journal-panel textarea{display:block;width:100%;font:1.05rem/1.4 var(--serif);background:#111b1c;color:#ece5d4;border:1px solid #64706a;border-radius:5px;padding:9px 11px;user-select:text;touch-action:auto}
.journal-button{font:1.05rem/1.3 var(--serif);color:#e8dfc9;background:#ffffff05;border:1px solid #8c7858;border-radius:5px;padding:10px 14px;cursor:pointer;min-height:44px;margin-top:12px}
.journal-button:hover{background:#e5d1a011}.journal-button:focus-visible,.journal-panel input:focus-visible,.journal-panel textarea:focus-visible{outline:2px solid #d3b987;outline-offset:3px}
.journal-heading .journal-button{margin-top:0;font:1.5rem var(--serif);padding:5px 12px}.journal-status{min-height:1.2em;font-size:.9rem;color:#c6d2bc}
.journal-entry{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:0 8px;border-top:1px solid #98856640;padding:5px 0 10px}.journal-return{text-align:left;border-color:transparent;min-width:0;overflow-wrap:anywhere;white-space:normal}.journal-remove{border-color:transparent;font-size:1.3rem}
.journal-note{grid-column:1/-1;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 14px;color:#c6bdac;font-size:.98rem;line-height:1.4}.journal-reflect{width:100%;margin-top:20px}

/* v39: the buttons fade right away after a quiet spell, and are out of the way while gone */
body.rest-quiet .pages,body.rest-quiet .tools{opacity:0!important;pointer-events:none;transition:opacity 1.8s ease}
.pages,.tools,#eo-map{transition:opacity .35s ease}
#dim{display:none!important}

/* v39: the places, grouped, each beside a small chart of itself */
#coast-menu .coast-group{margin:12px 13px 4px;font:10.5px/1.4 system-ui,sans-serif;text-transform:uppercase;letter-spacing:.14em;color:#8fa7a1}
#coast-menu .coast-choice{display:grid!important;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:12px;text-align:left}
#coast-menu .coast-thumb{width:44px;height:44px;border-radius:9px;background:#163847 center/cover no-repeat;box-shadow:inset 0 0 0 1px rgba(232,240,230,.16)}
#coast-menu .coast-thumb-surprise{background:radial-gradient(circle at 30% 30%,#e6d7a9 0 12%,transparent 13%),radial-gradient(circle at 70% 64%,#7fb7a8 0 14%,transparent 15%),#163847}
#coast-menu .coast-text{display:flex;flex-direction:column;gap:2px;min-width:0}
#coast-menu .coast-text strong{font:500 15px/1.25 Georgia,serif}
#coast-menu .coast-text span{font:11.5px/1.35 system-ui,-apple-system,sans-serif;color:#b6cbc4}
/* v51: the two page tabs the same width, evenly spaced */
.pages{gap:4px!important}
.page-tab{flex:1 1 0;min-width:72px;box-sizing:border-box;padding:6px 10px 5px;letter-spacing:.1em}
@media (max-width:380px){.page-tab{min-width:64px}}
