﻿:root{--cream:#F3E4BD;--ink:#10232B;--ochre:#B69363;--danger:#B9513E;--teal:#78C8B5;--paper:linear-gradient(115deg,#fff6dc55,transparent 65%),repeating-linear-gradient(12deg,#10232b04 0 1px,transparent 1px 4px),#F3E4BD}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;background:var(--ink);color:var(--ink);font-family:"Noto Sans",sans-serif;-webkit-tap-highlight-color:transparent}
#map{position:absolute;inset:0}
#hud{position:absolute;inset:calc(12px + env(safe-area-inset-top)) 12px auto;z-index:2;pointer-events:none;display:flex;flex-direction:column;gap:8px}
#hud>*{pointer-events:auto}
.card{background:var(--paper);border:1px solid var(--ochre);border-radius:3px;padding:16px;box-shadow:0 6px 24px #0005,inset 0 0 0 3px #fff3;font-size:14px}
#statcard{border-top:3px solid var(--ochre)}
.eyebrow{display:flex;justify-content:space-between;font:700 11px "Roboto Condensed",sans-serif;letter-spacing:.23em;margin-bottom:2px;color:#52605a}
.eyebrow span{font-weight:500;letter-spacing:.13em}
.ttl{display:flex;align-items:center;justify-content:space-between;gap:12px;font:700 26px "Roboto Condensed",sans-serif;text-transform:uppercase;letter-spacing:.055em}
#title{overflow-wrap:anywhere}
button{font:600 13px "Noto Sans",sans-serif;min-height:44px;min-width:44px;padding:9px 13px;border:1px solid #10232b40;border-radius:2px;color:var(--ink);background:#fff4;cursor:pointer;touch-action:manipulation}
button svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
button>*{pointer-events:none}
button:hover{background:#fff8}
button.on,#iactions button{background:var(--ink);color:var(--cream);border-color:var(--ink)}
button:focus-visible,.tower-marker:focus-visible{outline:3px solid #3EAAA1;outline-offset:3px}
button.mini{font-size:12px;padding:7px 10px}
button.danger{border-color:#B9513E80;color:#953d2e}
.bar{height:5px;background:#10232b22;overflow:hidden;margin:12px 0 10px}
#barfill{height:100%;width:0;background:linear-gradient(90deg,#31583B,#698365);transition:width .6s}
.stats{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;font-size:10px;gap:3px;color:#53605a}
#s-pct{font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--ink)}
#tools{position:fixed;bottom:calc(12px + env(safe-area-inset-bottom));left:12px;right:12px;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0;padding:5px;background:#10232bf5;border-color:#b6936380;box-shadow:0 8px 25px #0007}
#tools button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:8px 0;min-width:0;min-height:59px;background:transparent;border:0;color:var(--cream);font:500 10px "Noto Sans",sans-serif}
#tools button.on{background:var(--cream);color:var(--ink)}
#tools button:hover{box-shadow:inset 0 0 0 1px #b6936380}
#more{position:fixed;left:12px;right:12px;bottom:calc(92px + env(safe-area-inset-bottom));max-height:calc(100dvh - 250px);overflow:auto}
.col{display:flex;flex-direction:column;gap:12px}
.col label{display:flex;align-items:center;gap:10px;min-height:44px;font-size:12px}
.col label>span{min-width:55px;text-transform:uppercase;font:600 13px "Roboto Condensed";letter-spacing:.07em}
.col label:last-of-type{border-top:1px solid #10232b25;padding-top:12px;justify-content:space-between}
input[type=range]{min-width:0;flex:1;width:100%;height:36px;accent-color:#31583B}
.hint{font-size:10px;line-height:1.6;color:#52605a;overflow-wrap:anywhere}
.hidden{display:none!important}
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
#sheet{position:absolute;left:12px;right:12px;bottom:calc(94px + env(safe-area-inset-bottom));z-index:3;max-width:440px;margin:auto;border-top:3px solid var(--ochre);max-height:45dvh;overflow:auto;padding:20px}
#sheet .k,.entry .z{font:600 11px "Roboto Condensed";text-transform:uppercase;letter-spacing:.13em;color:#66715e}
#sheet .n{font:700 27px "Roboto Condensed";margin:5px 0 8px;line-height:1.1}
#sheet .x{font-size:13px;line-height:1.65;white-space:pre-line}
#iactions:not(:empty){margin-top:16px}
#iactions button{width:100%}
#panel{position:absolute;top:calc(12px + env(safe-area-inset-top));right:12px;bottom:calc(94px + env(safe-area-inset-bottom));width:min(400px,calc(100% - 24px));z-index:4;display:flex;flex-direction:column;padding:0}
#panel>.ttl{padding:12px 18px;border-bottom:1px solid #10232b33;font-size:24px}
#pbody{overflow:auto;overscroll-behavior:contain;padding:0 20px 20px}
.entry{padding:20px 0;border-bottom:1px solid #10232b25}
.entry h4{font:700 21px "Roboto Condensed";margin:5px 0 8px;line-height:1.2}
.entry p{font-size:13px;line-height:1.7;margin:0}
.entry.locked{color:#7c806e}
.entry label{display:flex;gap:12px;cursor:pointer}
.entry input{flex-shrink:0;width:24px;height:24px;margin:4px 0;accent-color:#31583B}
.entry .rw{font-size:11px;line-height:1.6;margin-top:12px;color:#31583B;border-left:2px solid #B69363;padding-left:9px}
#toast{position:absolute;top:calc(155px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(400px,calc(100% - 32px));z-index:5;background:var(--paper);border:1px solid var(--ochre);border-left:4px solid #31583B;box-shadow:0 6px 24px #0005;padding:16px 20px;font:700 18px "Roboto Condensed"}
#toast small{display:block;font:400 12px/1.6 "Noto Sans";margin-top:6px}
.tower-marker{width:44px;height:44px;background:url("ui/icons/tower.svg") center/34px no-repeat;cursor:pointer;border:0}
.tower-marker.lit{background-size:38px;filter:drop-shadow(0 0 6px #f3e4bd) drop-shadow(0 0 2px #78c8b5)}
.home-marker{width:36px;height:36px;background:url("ui/icons/home.svg") center/contain no-repeat;filter:drop-shadow(0 3px 4px #0009)}
.maplibregl-ctrl-top-right{top:calc(165px + env(safe-area-inset-top))!important}
.maplibregl-ctrl-group{border:1px solid #b6936380!important;border-radius:2px!important;background:#f3e4bd!important}
.maplibregl-ctrl-group button{width:40px!important;height:40px!important;min-width:40px;min-height:40px}
.maplibregl-ctrl-bottom-right{bottom:calc(88px + env(safe-area-inset-bottom))!important}
.maplibregl-ctrl-attrib{font-size:9px!important}
@media(min-width:700px){#hud{right:auto;width:350px;left:24px;top:calc(24px + env(safe-area-inset-top))}#tools{left:24px;right:auto;width:350px;bottom:24px}#more{left:24px;right:auto;width:350px;bottom:105px}#sheet{bottom:24px;left:400px;right:24px}#panel{top:24px;right:24px;bottom:24px}#toast{top:24px;left:auto;right:24px;transform:none;width:360px}.maplibregl-ctrl-top-right{top:90px!important}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
@media(max-height:600px) and (orientation:landscape){#hud{width:300px}#panel{bottom:12px}#more{left:auto;width:330px;max-height:70dvh}#toast{top:12px;left:auto;right:12px;transform:none;width:300px}}
/* Iteration 2: compact atlas and full-width navigation. */
:root{--nav-height:60px}
#hud{inset:calc(4px + env(safe-area-inset-top)) 8px auto;width:auto}
#statcard{padding:0 8px 3px;border-top-width:1px}
.compact-stats{display:flex;align-items:center;gap:5px;white-space:nowrap;font:600 11px "Roboto Condensed",sans-serif;min-width:0}
.compact-stats strong{font-size:16px;letter-spacing:.025em;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;min-width:0;margin-right:auto}
.compact-stats>span{flex-shrink:0}
#s-pct{font-size:11px;letter-spacing:0}
#blang{padding:0;flex-shrink:0;border:0;background:transparent}
.bar{height:3px;margin:0}
#tools{left:0;right:0;bottom:0;width:auto;border-radius:0;grid-template-columns:repeat(5,minmax(0,1fr));padding:4px max(8px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));z-index:6;height:calc(var(--nav-height) + env(safe-area-inset-bottom))}
#tools button{height:52px;min-height:44px;gap:5px}
#tools #bmap{border-radius:50%;width:64px;height:64px;justify-self:center;transform:translateY(-9px);background:var(--cream);color:var(--ink);border:4px solid var(--ink);box-shadow:0 -3px 0 #b69363;font-size:9px}
#bmap svg{width:27px;height:27px}
#more{left:8px;right:8px;width:auto;bottom:calc(90px + env(safe-area-inset-bottom));max-height:calc(100dvh - 170px);z-index:4}
#sheet{left:8px;right:8px;bottom:calc(92px + env(safe-area-inset-bottom));max-width:520px;padding:12px;max-height:40dvh;display:grid;grid-template-columns:68px minmax(0,1fr);gap:10px;margin:0 auto}
#ipreview{width:68px;height:68px;padding:14px;background:var(--cream);border:1px solid var(--ochre)}
.place-copy{min-width:0}
#sheet .n{font-size:21px;margin:3px 0 6px;overflow-wrap:anywhere}
#sheet .x{font-size:12px;line-height:1.5}
#iactions{grid-column:1/-1}
#iactions:not(:empty){margin-top:0}
#panel{top:auto;left:8px;right:8px;bottom:calc(var(--nav-height) + env(safe-area-inset-bottom));width:auto;max-width:650px;margin:0 auto;height:76dvh;max-height:calc(100dvh - var(--nav-height) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 8px);border-top:3px solid var(--ochre);z-index:5}
#pdrag{height:28px;min-height:28px;width:100%;border:0;background:transparent;touch-action:none;cursor:ns-resize;flex-shrink:0;padding:10px}
#pdrag span{display:block;width:40px;height:4px;background:#10232b60;margin:auto;border-radius:2px}
#panel>.ttl{padding:0 12px 8px;font-size:24px;flex-shrink:0;touch-action:pan-x}
#pfilters{display:flex;gap:6px;overflow-x:auto;flex-shrink:0;padding:8px 12px;overscroll-behavior-x:contain}
#pfilters button{white-space:nowrap;flex-shrink:0;font-size:12px}
#pbody{min-height:0;padding:0 12px 12px}
.entry{padding:14px;margin:10px 0;border:1px solid #b6936355;background:#fff2}
.entry.locked{opacity:.65;background:#10232b08}
.lock{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;vertical-align:middle}
#toast{top:calc(76px + env(safe-area-inset-top));left:50%;right:auto;transform:translateX(-50%);width:min(450px,calc(100% - 24px));padding:18px 18px 18px 72px;font-size:21px;min-height:80px;border-left:4px solid var(--ochre)}
#toast>img{position:absolute;left:14px;top:18px;width:44px;height:44px}
#toast small{font-size:13px}
.maplibregl-ctrl-top-right{top:calc(72px + env(safe-area-inset-top))!important}
.maplibregl-ctrl-bottom-right{bottom:calc(92px + env(safe-area-inset-bottom))!important}
@media(min-width:700px){#hud{max-width:480px;left:16px;right:16px}#more{max-width:400px;left:auto;right:16px}#sheet{left:16px;right:16px}#tools{padding-left:max(16px,calc((100% - 700px)/2));padding-right:max(16px,calc((100% - 700px)/2))}}

/* navigator */
#navbar { position:absolute; left:10px; right:10px; top:calc(70px + env(safe-area-inset-top)); z-index:3; max-width:460px; margin:0 auto; background:rgba(16,35,43,.9); color:var(--cream); border:1px solid rgba(120,200,181,.5) }
#navbar .nhead { display:flex; justify-content:space-between; gap:8px; align-items:baseline; font-size:14px } #navbar .nhead span { opacity:.8; font-size:12px; text-align:right }
#navbar .nwarn { color:#E9A08F; font-size:12px; margin-top:4px }
#navbar .nstep { font:700 18px/1.2 "Roboto Condensed",sans-serif; margin:6px 0; letter-spacing:.02em }
#navbar .nbtns { display:flex; gap:6px } #navbar .nbtns button { flex:1; min-height:38px } #navbar .nfollow.on { background:var(--teal); color:var(--ink); border-color:var(--teal) }
#iactions .route { background:var(--teal); color:var(--ink); border-color:var(--teal); font-weight:700 }
/* Iteration 3 — Kohmodo: a pocket journal and a two-button map rail. */
:root{--cream:#fff4dc;--ink:#194e50;--ochre:#d89a4d;--teal:#189e9f;--paper:linear-gradient(125deg,#fffaf0,#fff0d4);--nav-height:96px}
body{background:#b7dfd5}
.card{border:1px solid #dab57780;border-radius:22px;box-shadow:0 8px 28px #27595824;background:var(--paper)}
button{border-radius:14px;border-color:#318b8733}
button.on,#iactions button{background:#128b8c;border-color:#128b8c;color:#fffaf0}
.ttl{text-transform:none;letter-spacing:0}
#map:after{content:"";position:absolute;inset:0;pointer-events:none;z-index:1;box-shadow:inset 0 0 38px 12px #fff0d42b}
#hud{inset:calc(8px + env(safe-area-inset-top)) 10px auto;max-width:none}
#statcard{padding:0 10px 5px;border:0;border-radius:0 0 12px 12px;box-shadow:none;background:#fff4dce8}
.compact-stats{gap:5px;font:500 11px/1.3 "Noto Sans",sans-serif;justify-content:center}
#s-pct{text-transform:none;font-size:11px;color:#126f70}
#blang{margin-left:auto;min-width:38px}
.bar{height:2px;background:#d6c6a7}
#barfill{background:#13999a}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
#tools{left:50%;right:auto;bottom:calc(12px + env(safe-area-inset-bottom));transform:translateX(-50%);width:170px;height:80px;display:flex;gap:10px;padding:5px;border:0;border-radius:48px;background:#fff4dce8;box-shadow:0 5px 22px #174f5033}
#tools button,#tools #bmap{width:70px;height:70px;min-height:70px;flex:none;border-radius:50%;transform:none;border:0;box-shadow:none;font-size:10px;gap:4px;background:#f1dfb9;color:var(--ink)}
#tools #bmap{background:#0d898c;color:#fff8e8}
#tools #bjournal{background:#f3d39a}
#drawer{position:fixed;left:10px;right:10px;bottom:calc(104px + env(safe-area-inset-bottom));max-width:600px;margin:auto;max-height:calc(100dvh - 180px - env(safe-area-inset-top) - env(safe-area-inset-bottom));background:var(--paper);border-radius:26px 26px 18px 18px;box-shadow:0 12px 48px #164b5040;z-index:5;padding-top:12px;overflow:hidden;pointer-events:auto}
#book-tabs{display:flex;gap:4px;padding:0 48px 0 10px;border-bottom:1px solid #d8bd8b}
#book-tabs button{flex:1;min-width:0;padding:10px 4px;font-size:11px;border:0;border-radius:12px 12px 0 0;background:#efd9b2}
#book-tabs button.on{background:#188f90;color:#fff9e8}
#book-tabs svg{display:none}
#drawer-close{position:absolute;right:3px;top:12px;border:0;background:transparent;font-size:26px}
#panel{position:relative;inset:auto;width:auto;height:57dvh;max-height:calc(100dvh - 242px - env(safe-area-inset-top) - env(safe-area-inset-bottom));margin:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#panel>.ttl{font-size:25px;color:#187b7d;padding:0 16px 8px;border:0}
#pclose{display:none}
#pbody{padding:0 16px 16px}
#pfilters button{border-radius:18px}
.entry{border:0;border-bottom:1px solid #d8bd8b70;border-radius:0;background:transparent;padding:16px 0;margin:0}
.entry.locked{background:transparent;color:#7c826e}
.entry .rw{color:#137c7c;border-color:#d59d51}
#more{position:relative;inset:auto;max-width:none;max-height:55dvh;width:auto;border:0;border-radius:0;background:transparent;box-shadow:none;margin:0;padding:16px}
input[type=range]{accent-color:#168b8b}
#sheet{border-top:0;border-radius:24px;bottom:calc(106px + env(safe-area-inset-bottom));padding:16px}
#ipreview{border:0;border-radius:20px;background:#f1dfbb}
#sheet .n{color:#167b7c}
#toast{top:calc(72px + env(safe-area-inset-top));padding:16px 18px;border:0;border-radius:22px;font-size:20px;box-shadow:0 8px 28px #27595833;min-height:0}
#toast.with-mascot{padding-left:80px;min-height:80px}
.mascot-slot{display:block;width:58px;height:58px;flex:none}
.mascot-slot img{width:100%;height:100%;object-fit:contain}
#toast .mascot-slot{position:absolute;left:12px;top:12px}
.journal-empty{padding:18px 10px;text-align:center;font-size:15px;line-height:1.7;color:#197b7b}
.journal-empty .mascot-slot{width:96px;height:96px;margin:0 auto 8px}
#sheet>.mascot-slot{grid-column:1;grid-row:1;pointer-events:none}
#sheet>.mascot-slot.loaded{background:var(--cream);border-radius:16px}
#navbar{background:var(--paper);color:var(--ink);border:1px solid #d7ad6e;border-radius:24px;padding:16px;top:calc(66px + env(safe-area-inset-top));box-shadow:0 8px 26px #27595833}
#navbar .nhead{flex-wrap:wrap;gap:4px}
#navbar .nhead b{font-size:14px}
#navbar .nhead span{text-align:left}
#navbar .nstep{font:700 25px/1.25 "Roboto Condensed",sans-serif;margin:12px 0;letter-spacing:0}
#navbar .nwarn{color:#a14e32}
#navbar .nbtns button{min-height:48px;font-size:16px;font-weight:700}
#navbar .nfollow{background:#128b8c;color:#fff9e8;border:2px solid #128b8c}
#navbar .nfollow.on{background:#08696c;color:white;border-color:#08696c}
#navbar .nstop{background:#f4dfb8;color:#88412d;border:2px solid #d8ac70}
#iactions .route{background:#158d8e;color:#fff8e8}
.maplibregl-ctrl-group{border-radius:16px!important;background:#fff4dc!important;overflow:hidden}
@media(min-width:700px){#hud{max-width:470px}#drawer{left:auto;right:20px;width:420px}#tools{left:50%;padding:5px}#sheet{max-width:460px}}
