/* Valor Tools — navigation (Sep 29, 2026). Loaded after valor.css and light.css on every page with the masthead.
   From the navigation mock-up ("Valor Tools — Navigation"): two clear levels (tool tabs with icons; a context bar under them
   with the page's name and its sections), one World switcher (the crest), an account menu that holds the app settings, a Go to
   search (Ctrl/⌘ K), and a Back button that names where it goes. On phones (≤760 px) the tabs move to a bar at the bottom,
   the masthead becomes a slim top bar, and the World and account menus open as sheets from the bottom.
   The scripts: assets/nav.js (tabs, account menu, Go to, phone title), assets/mast.js (the World crest), assets/back.js (Back). */

:root{--tab:#C4AE83;--ctx-bg:#0F0E0D}
html[data-theme=light]{--tab:#6F5A33;--ctx-bg:#F9F7F3}
body{overflow-x:clip}

/* ---------- level 1: the masthead and the tool tabs ---------- */
.mast{height:78px;padding:10px 28px 0;gap:14px;align-items:center}
.mast::after{content:"";position:absolute;left:calc(50% - 50vw);width:100vw;bottom:0;height:1px;background:var(--g-body);pointer-events:none;z-index:1}
.mast .wordmark{font-size:28px}
.mast .tagline{font-size:9px}
.mast .tabs{align-self:flex-end;margin:0 0 0 14px;gap:4px;align-items:flex-end;position:relative;z-index:2}
.mast .tabs a{display:inline-flex;align-items:center;gap:9px;height:52px;padding:0 18px;border:1px solid transparent;border-bottom:0;border-radius:7px 7px 0 0;
  font:600 13.5px/1 var(--title);letter-spacing:.1em;color:var(--tab)}
.mast .tabs a[hidden]{display:none}
.mast .tabs a .tl .short{display:none}
.mast .tabs a svg{width:19px;height:19px;color:var(--g-text);flex:none}
.mast .tabs a:hover{color:var(--g-hi);background:rgba(173,132,69,.07)}
.mast .tabs a.on{color:#F6E7B8;border-color:var(--g-body);background:linear-gradient(180deg,rgba(173,132,69,.26) 0%,rgba(173,132,69,.08) 55%,var(--ctx-bg) 100%)}
.mast .tabs a.on svg{color:var(--g-hi)}
.mast .tabs a.on::before{content:"";position:absolute;left:50%;top:-5px;bottom:auto;width:9px;height:9px;margin-left:-4.5px;transform:rotate(45deg);
  background:linear-gradient(135deg,#D65B43,#5A1712);border:1px solid var(--g-hi)}
.mast .tabs a.on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--ctx-bg)}
.mast .tabs .n{min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:linear-gradient(180deg,#C2513A,#6E1E17);border:1px solid var(--g-body);
  color:#fff;font:600 12.5px/18px var(--text);letter-spacing:0;text-align:center}
.mast .tabs .n:empty,.mast .tabs .n[hidden]{display:none}
html[data-theme=light] .mast .tabs a{color:var(--tab)}
html[data-theme=light] .mast .tabs a.on{color:#4A3713;background:linear-gradient(180deg,rgba(154,117,53,.22) 0%,rgba(154,117,53,.07) 55%,var(--ctx-bg) 100%)}
html[data-theme=light] .mast .tabs a.on svg{color:var(--g-text)}
html[data-theme=light] .mast .tabs a.on::before{background:linear-gradient(135deg,#D65B43,#5A1712)}

/* what the new masthead replaces: the name block and the loose theme / time medallions (both in the account menu now) */
.mast .who,.mast #themeBtn,.mast #timeBtn{display:none!important}
/* the pages around the tools (Account, Admin, Discord bot, Get the app, Privacy, Terms): the same masthead without the tabs
   (no account menu: the theme medallion stays), and a context bar with Back top left and the page's name */
.mast.side #themeBtn{display:inline-grid!important}
body.side{padding-bottom:0!important}

/* the World crest (assets/mast.js): the one world switcher, for every tab */
.wcw{position:relative;flex:none}
.wcw[hidden]{display:none}
.wcrest{display:flex;align-items:center;gap:10px;height:46px;padding:0 12px 0 5px;border:1px solid var(--g-dim);border-radius:23px;
  background:linear-gradient(180deg,#1B1A19,#0E0D0C);cursor:pointer;color:var(--cream-t);text-align:left;font:inherit}
html[data-theme=light] .wcrest{background:linear-gradient(180deg,#FFFFFF,#F2EEE7)}
.wcrest .medal{--s:36px}
.wcrest .wt b{display:block;font:600 14px/1 var(--title);letter-spacing:.1em;color:var(--g-hi);text-transform:uppercase;white-space:nowrap}
html[data-theme=light] .wcrest .wt b{color:var(--g-text)}
.wcrest .wt small{display:block;font:500 12.5px/1 var(--text);color:var(--grey);margin-top:4px;white-space:nowrap}
.wcrest .wt .short{display:none}
.wcrest .chev{width:14px;height:14px;color:var(--g-text)}
.wcrest:hover,.wcrest[aria-expanded=true]{border-color:var(--g-body)}
.wcrest[aria-expanded=true]{box-shadow:0 0 0 3px rgba(173,132,69,.15)}

/* the account button: name + menu (the menu holds Account, Alerts, the theme, text size and times) */
.mast .menu-btn.acct{display:flex!important;align-items:center;gap:9px;width:auto;height:46px;padding:0 10px 0 4px;border:1px solid transparent;border-radius:23px;
  background:transparent;color:var(--cream);cursor:pointer;font:500 16px/1 var(--text);box-shadow:none}
.mast .menu-btn.acct::before,.mast .menu-btn.acct::after{display:none}
.mast .menu-btn.acct .medal{--s:38px}
.mast .menu-btn.acct .anm{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (min-width:1401px) and (max-width:1520px){.mast .menu-btn.acct .anm{max-width:84px}}
/* five tool tabs (Defense, Sep 29, 2026): a little tighter until there's room */
@media (min-width:1401px) and (max-width:1600px){.mast .tabs a{padding:0 12px;gap:7px}.mast .tabs{margin-left:8px}.mast{gap:10px}}
.mast .menu-btn.acct .chev{width:14px;height:14px;color:var(--g-text)}
.mast .menu-btn.acct:hover,.mast .menu-btn.acct[aria-expanded=true]{border-color:var(--g-dim);background:var(--ctx-bg)}

/* popovers: the World list, the account menu, Go to */
.vpop{position:absolute;z-index:80;padding:16px 14px 14px;box-shadow:0 18px 40px rgba(0,0,0,.7)}
.vpop[hidden]{display:none}
.vpop .ph{padding:0 8px 10px;border-bottom:1px solid var(--g-inner);margin-bottom:6px}
.vpop .ph b{display:block;font:600 13px/1.2 var(--title);letter-spacing:.14em;text-transform:uppercase;color:var(--g-text)}
.vpop .ph span{display:block;font-size:14px;color:var(--grey);margin-top:5px;line-height:1.3}
.wrow{display:flex;align-items:center;gap:12px;width:100%;padding:10px 8px;border:0;border-radius:4px;background:transparent;color:var(--cream);text-align:left;cursor:pointer;font:500 16px/1.2 var(--text)}
.wrow:hover,.wrow:focus-visible{background:rgba(173,132,69,.1);outline:none}
.wrow .wn{font:600 13.5px/1 var(--title);letter-spacing:.08em;color:var(--cream-t);min-width:78px;text-transform:uppercase}
.wrow .src{flex:1;font-size:14.5px;color:var(--grey);line-height:1.3}
.wrow .src b{color:var(--cream);font-weight:500}
.wrow .ck{width:18px;height:18px;color:var(--g-hi);flex:none}
.wrow.on{background:rgba(173,132,69,.14)}
.wrow.on .wn{color:var(--g-hi)}
.vpop .foot2{display:flex;gap:8px;align-items:center;padding:10px 8px 2px;border-top:1px solid var(--g-inner);margin-top:6px}
.vpop .foot2 .lbl{white-space:nowrap}
.vpop .foot2 input{width:90px;height:34px;background:var(--field);border:1px solid var(--g-inner);color:var(--cream-t);border-radius:3px;padding:0 8px;font:500 16px/1 var(--text)}
.vpop .note{font-size:13.5px;color:var(--grey);padding:8px 8px 0;line-height:1.35}

/* the account menu (#menuPop), grouped: You / This app / Admin / Sign out */
.mast .menu-pop{right:28px;top:calc(100% + 8px);width:320px;padding:16px 12px 12px;z-index:80;box-shadow:0 18px 40px rgba(0,0,0,.7)}
.menu-pop .mgroup{font:600 9.5px/1 var(--caps);letter-spacing:.18em;text-transform:uppercase;color:var(--grey);padding:12px 10px 6px}
.menu-pop .mrow2{display:flex;align-items:center;gap:12px;padding:8px 10px;color:var(--cream);font:500 16px/1.2 var(--text)}
.menu-pop .mrow2 svg{width:18px;height:18px;color:var(--g-text);flex:none}
.menu-pop .mrow2 .grow{flex:1}
.menu-pop .seg2{display:inline-flex;border:1px solid var(--g-dim);border-radius:16px;overflow:hidden}
.menu-pop .seg2 button{width:auto;padding:0 12px;height:30px;border:0;border-radius:0;background:transparent;color:var(--grey);font:500 14.5px/1 var(--text);cursor:pointer;display:inline-flex;align-items:center}
.menu-pop .seg2 button.on{color:var(--g-hi);background:rgba(173,132,69,.22)}
html[data-theme=light] .menu-pop .seg2 button.on{color:var(--g-text)}
.menu-pop .mgo{display:none}

/* ---------- level 2: the context bar (the page's name, its sections, Back, Go to) ---------- */
.ctx{position:relative;z-index:6;background:var(--ctx-bg);border-bottom:1px solid var(--g-inner);box-shadow:0 8px 18px rgba(0,0,0,.35)}
html[data-theme=light] .ctx{box-shadow:0 8px 18px rgba(60,45,20,.08)}
.ctx[hidden]{display:none}
.ctx-in{max-width:1560px;margin:0 auto;display:flex;align-items:center;gap:20px;min-height:66px;padding:8px 28px;flex-wrap:wrap}
html[data-text] .ctx-in{max-width:calc(1560px / var(--tzf,1))}
.crumb{display:flex;flex-direction:column;gap:5px;min-width:0}
.crumb .eyebrow{font:600 10px/1 var(--caps);letter-spacing:.22em;text-transform:uppercase;color:var(--grey)}
.crumb h1{margin:0;font:600 20px/1.1 var(--title);letter-spacing:.06em;color:var(--cream-t);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:460px}
.crumb h1 .tag{font:600 11px/1 var(--caps);letter-spacing:.14em;color:var(--g-text);border:1px solid var(--g-dim);border-radius:3px;padding:3px 5px;margin-left:8px;vertical-align:3px}
.vsep{width:1px;align-self:stretch;margin:6px 0;background:var(--g-inner);flex:none}
.subnav{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.subnav a,.subnav button{position:relative;display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 15px;border:1px solid transparent;border-radius:20px;background:transparent;
  font:500 17px/1 var(--text);color:var(--cream);text-decoration:none;white-space:nowrap;cursor:pointer;letter-spacing:0;text-transform:none}
.subnav a svg,.subnav button svg{width:17px;height:17px;color:var(--g-text);display:inline}
.subnav a:hover,.subnav button:hover{border-color:var(--g-inner);color:var(--cream-t)}
.subnav .on{color:var(--g-hi)!important;border-color:var(--g-body)!important;background:linear-gradient(180deg,rgba(173,132,69,.24),rgba(173,132,69,.08))}
.subnav .on::after,.subnav .on::before{display:none}
html[data-theme=light] .subnav .on{color:#4A3713!important}
.subnav .on svg{color:var(--g-hi)}
.subnav .ct,.subnav .n{font:500 13.5px/1 var(--text);color:var(--grey);background:var(--row);border:1px solid var(--g-inner);border-radius:10px;padding:3px 7px;letter-spacing:0}
.subnav .on .ct,.subnav .on .n{color:var(--g-hi);border-color:var(--g-dim)}
.subnav .short{display:none}
.subnav .dot{position:absolute;top:5px;right:5px;width:8px;height:8px;border-radius:50%;background:#D65B43;box-shadow:0 0 0 2px var(--ctx-bg)}
.ctx .right{margin-left:auto;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ctx .right .s,.ctx .right select{height:36px}
.ctx .sel{display:inline-flex;align-items:center;gap:10px}
.ctx .sel .lbl{margin-right:2px}
.ctx .sel select{min-width:220px;max-width:340px}
.goto{display:flex;align-items:center;gap:10px;width:230px;height:40px;padding:0 10px 0 12px;border:1px solid var(--g-inner);border-radius:20px;
  background:var(--field);color:var(--grey);font:500 15px/1 var(--text);cursor:pointer;text-align:left}
.goto svg{width:17px;height:17px;color:var(--g-text);flex:none}
.goto .gl{flex:1}
.goto:hover{border-color:var(--g-dim);color:var(--cream)}
@media (min-width:1261px){.ctx-in{flex-wrap:nowrap}.ctx .crumb{flex:0 1 auto}.ctx .subnav{flex-wrap:nowrap;min-width:0}.ctx .right{flex:none}}
@media (min-width:1261px) and (max-width:1500px){.goto{width:180px}}
/* sections that don't fit scroll sideways and say so (assets/nav.js cue()): a fade and an arrow on the side with more */
.subwrap{position:relative;display:flex;min-width:0}
.subwrap::before,.subwrap::after{content:"";position:absolute;top:0;bottom:0;width:46px;pointer-events:none;opacity:0;transition:opacity .15s;z-index:2}
.subwrap::before{left:0;background:linear-gradient(90deg,var(--ctx-bg) 20%,transparent)}
.subwrap::after{right:0;background:linear-gradient(270deg,var(--ctx-bg) 20%,transparent)}
.subwrap.xl::before,.subwrap.xr::after{opacity:1}
.subwrap .xarr{position:absolute;top:50%;margin-top:-13px;z-index:3;display:none;width:26px;height:26px;padding:0;border-radius:50%;border:1px solid var(--g-frame);background:var(--ctx-bg);
  color:var(--g-hi);font:600 16px/1 var(--title);cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.5);place-items:center}
html[data-theme=light] .subwrap .xarr{color:var(--g-text);box-shadow:0 2px 6px rgba(60,45,20,.18)}
.subwrap .xarr:hover{border-color:var(--g-hi)}
.subwrap.xl .xarr.l,.subwrap.xr .xarr.r{display:grid}
.subwrap .xarr.l{left:0}.subwrap .xarr.r{right:0}
.ctx-in.wrapped>.vsep{display:none}
.ctx-in.wrapped>.subwrap{order:5;flex:1 1 100%}
.ctx-in.wrapped>.right{order:3}
.kbd{font:600 11px/1 var(--text);color:var(--cream);border:1px solid var(--g-inner);border-bottom-width:2px;border-radius:4px;padding:3px 6px;background:var(--row)}

/* Back (.bk) itself is in assets/back.css (the other pages use it too); its ▾ and the trail: */
.bkc{width:36px;display:grid;place-items:center;border:1px solid var(--g-body);border-left:1px solid var(--g-dim);border-radius:0 25px 25px 0;
  background:linear-gradient(180deg,#242322,#11100F);color:var(--g-text);cursor:pointer;padding:0}
.bkc svg{width:14px;height:14px}
.bkc:hover,.bkc[aria-expanded=true]{color:var(--g-hi);border-color:var(--g-hi)}
.trail{left:0;top:calc(100% + 8px);width:380px}
.trail .trow{display:flex;align-items:center;gap:12px;width:100%;padding:9px 10px;border:0;border-radius:4px;background:transparent;color:var(--cream);text-align:left;font:500 16px/1.2 var(--text);text-decoration:none;cursor:pointer}
.trail .trow svg{width:17px;height:17px;color:var(--g-text);flex:none}
.trail .trow .b{flex:1;min-width:0}
.trail .trow .b span{display:block;font-size:13px;color:var(--grey);margin-top:2px}
.trail .trow .k{font:600 9.5px/1 var(--caps);letter-spacing:.14em;text-transform:uppercase;color:var(--grey);white-space:nowrap}
.trail .trow:hover{background:rgba(173,132,69,.1)}
.trail .trow.here{background:rgba(173,132,69,.14);cursor:default}
.trail .trow.here .k{color:var(--g-hi)}
.youwere{animation:youwere 2.4s ease-out 1;outline:2px solid transparent}
@keyframes youwere{0%{box-shadow:0 0 0 2px var(--g-hi),0 0 22px rgba(237,214,157,.55)}100%{box-shadow:0 0 0 0 transparent}}

/* Go to: search every tab (Ctrl/⌘ K) */
.gotopop{position:fixed;left:50%;top:90px;transform:translateX(-50%);width:min(560px,calc(100vw - 24px));max-height:min(70vh,560px);display:flex;flex-direction:column;z-index:90}
.gotopop .gq{display:flex;align-items:center;gap:10px;padding:0 6px 10px;border-bottom:1px solid var(--g-inner)}
.gotopop .gq svg{width:18px;height:18px;color:var(--g-text);flex:none}
.gotopop .gq input{flex:1;background:transparent;border:0;color:var(--cream-t);font:500 18px/1.3 var(--text);outline:none;min-width:0}
.gotopop .glist{overflow:auto;padding-top:4px}
.gotopop .mgroup{font:600 9.5px/1 var(--caps);letter-spacing:.18em;text-transform:uppercase;color:var(--grey);padding:12px 10px 6px}
.gorow{display:flex;align-items:center;gap:12px;width:100%;padding:9px 10px;border:0;border-radius:4px;background:transparent;color:var(--cream);font:500 16px/1.2 var(--text);text-align:left;cursor:pointer}
.gorow svg{width:17px;height:17px;color:var(--g-text);flex:none}
.gorow .gt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gorow .where{margin-left:auto;font:600 9.5px/1 var(--caps);letter-spacing:.14em;text-transform:uppercase;color:var(--grey);white-space:nowrap}
.gorow.on{background:rgba(173,132,69,.16);color:var(--cream-t)}
.gorow mark{background:none;color:var(--g-hi);font-weight:600}
html[data-theme=light] .gorow mark{color:var(--g-text)}
.gotopop .empty{padding:16px 10px;color:var(--grey)}
.gotopop .note{font-size:13px;color:var(--grey);padding:8px 10px 0;border-top:1px solid var(--g-inner);margin-top:6px}
.vscrim{position:fixed;inset:0;z-index:79;background:rgba(1,2,4,.55)}
.vscrim[hidden]{display:none}
html[data-theme=light] .vscrim{background:rgba(40,30,15,.25)}

/* ---------- in between: 761–1260 px ---------- */
@media (min-width:761px) and (max-width:1260px){
  .mast .wm{display:none}
  .wcrest .wt small{display:none}
  .mast .menu-btn.acct .anm{display:none}
  .goto{width:auto}.goto .gl{display:none}
  .ctx-in{gap:12px;padding:8px 20px}
  .ctx .sel .lbl{display:none}
  .ctx .sel select{min-width:160px}
  .crumb h1{max-width:240px}
}
/* up to 1400 px the tabs fold under the masthead's first row (valor.css folds them up to 1315; the crest and account need more) */
@media (min-width:761px) and (max-width:1400px){
  .mast{height:auto;flex-wrap:wrap;padding-top:8px;row-gap:6px}
  .mast .tabs{order:5;flex-basis:100%;margin:0;justify-content:center}
  .mast .spacer{flex:1}
}
/* bigger text in a laptop window folds the masthead like a narrower window (theme.js sets tz-mwrap) */
html.tz-mwrap .mast{height:auto;flex-wrap:wrap;row-gap:6px}
html.tz-mwrap .mast .tabs{order:5;flex-basis:100%;margin:0;justify-content:center}

/* ---------- phones (≤760 px): a top bar, the tabs at the bottom, sheets ---------- */
.ptl{display:none}
@media (max-width:760px){
  .mast{height:62px;padding:6px 14px 0;gap:10px;flex-wrap:nowrap}
  .mast::after{background:var(--g-inner)}
  .mast>.medal.glow{--s:38px!important}
  .mast .wm,.mast .spacer{display:none!important}
  .ptl{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}
  .ptl b{font:600 16px/1 var(--title);letter-spacing:.1em;text-transform:uppercase;color:var(--g-hi);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html[data-theme=light] .ptl b{color:var(--g-text)}
  .ptl span{font:500 14px/1 var(--text);color:var(--grey);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .ptl span:empty{display:none}
  .wcrest{height:38px;padding:0 10px 0 4px;gap:6px}
  .wcrest .medal{--s:28px;border-width:1.5px}
  .wcrest .wt small,.wcrest .wt .long{display:none}
  .wcrest .wt .short{display:inline}
  .wcrest .wt b{font-size:13px;letter-spacing:.08em}
  /* the page's name gets the room: the World crest drops its ▾ (it still opens its list), the gaps tighten */
  .wcrest .chev{display:none}
  .mast{gap:8px}
  .ptl b{font-size:15px;letter-spacing:.07em}
  .mast .medal{--s:40px!important}
  .mast .menu-btn.acct{padding:0;border:0;height:auto}
  .mast .menu-btn.acct .anm,.mast .menu-btn.acct .chev{display:none}
  .mast .menu-btn.acct .medal{--s:40px}
  /* the tool tabs: a bar at the bottom, under the thumb */
  .mast .tabs{position:fixed;left:0;right:0;bottom:0;z-index:60;height:calc(66px + env(safe-area-inset-bottom));margin:0;padding:6px 8px env(safe-area-inset-bottom);
    display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:4px;align-items:stretch;
    background:linear-gradient(180deg,#131211,#0A0908);border-top:1px solid var(--g-body);box-shadow:0 -10px 24px rgba(0,0,0,.6)}
  html[data-theme=light] .mast .tabs{background:linear-gradient(180deg,#FFFFFF,#F2EEE7);box-shadow:0 -8px 20px rgba(60,45,20,.15)}
  .mast .tabs a{flex-direction:column;justify-content:center;gap:5px;height:auto;padding:0;border:0;border-radius:10px;background:none!important;
    font:600 10.5px/1 var(--caps);letter-spacing:.08em;text-align:center}
  .mast .tabs a .tl{display:block;white-space:nowrap}
  .mast .tabs a svg{width:23px;height:23px;padding:4px 18px;box-sizing:content-box;border-radius:16px}
  .mast .tabs a.on svg{background:linear-gradient(180deg,rgba(173,132,69,.34),rgba(173,132,69,.1));box-shadow:inset 0 0 0 1px var(--g-body)}
  .mast .tabs a.on::before{top:-12px}
  .mast .tabs a.on::after{display:none}
  .mast .tabs .n{position:absolute;top:0;left:calc(50% + 10px);min-width:18px;height:18px;font-size:11.5px;line-height:16px}
  .mast .tabs a .tl .short{display:inline} .mast .tabs a .tl .long{display:none}
  body{padding-bottom:calc(66px + env(safe-area-inset-bottom))}
  html.embed body{padding-bottom:0}
  /* the context bar: no crumb (the top bar has the name); sections as buttons that always fit */
  .ctx-in{padding:10px 14px 12px;min-height:0;gap:10px}
  .ctx .crumb,.ctx .vsep,.ctx .goto{display:none!important}
  .ctx .subnav{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:6px;width:100%}
  .ctx .subnav a,.ctx .subnav button{flex-direction:column;justify-content:center;gap:4px;height:50px;padding:0 2px;border:1px solid var(--g-inner);border-radius:10px;font-size:15px}
  .ctx .subnav a svg,.ctx .subnav button svg{display:none}
  .ctx .subnav .ct,.ctx .subnav .n{background:none;border:0;padding:0;font-size:12.5px}
  .ctx .subnav .icon-only svg{display:inline;width:19px;height:19px}
  .ctx .subnav .short{display:inline}.ctx .subnav .long{display:none}
  .ctx .subnav .icon-only{flex:0 0 auto}.ctx .subnav .icon-only .l{display:none}
  .ctx .right{margin-left:0;width:100%}
  .subwrap{width:100%}
  .bkg{width:100%}
  .bk{flex:1;max-width:none;height:50px}
  /* popovers become sheets */
  .vpop,.mast .menu-pop{position:fixed!important;left:0!important;right:0!important;top:auto!important;bottom:0!important;width:auto!important;max-height:78vh;overflow:auto;
    border-radius:16px 16px 0 0;padding:10px 14px calc(20px + env(safe-area-inset-bottom));z-index:95;transform:none}
  .vpop::before,.mast .menu-pop::before{inset:5px 5px 0}
  .vpop .grab,.menu-pop .grab{display:block;width:44px;height:5px;border-radius:3px;background:var(--g-dim);margin:0 auto 12px}
  .menu-pop .mgo{display:flex}
  .gotopop{top:12px;bottom:auto!important;border-radius:12px;max-height:calc(100vh - 110px)}
  .trail{width:auto}
  .toast{bottom:calc(80px + env(safe-area-inset-bottom))!important}
}
.grab{display:none}
@media (max-width:380px){ .mast .tabs a svg{padding:4px 12px} .wcrest .wt b{font-size:12px} }

/* ---------- the Planner: five steps in a rail, one step on screen at a time ---------- */
.stepped{display:grid;grid-template-columns:290px minmax(0,1fr);gap:22px;align-items:start}
.stepped .steps{min-width:0}
.stepped .steps>section[data-step]{display:none}
.stepped[data-on="1"] section[data-step="1"],.stepped[data-on="2"] section[data-step="2"],.stepped[data-on="3"] section[data-step="3"],
.stepped[data-on="4"] section[data-step="4"],.stepped[data-on="5"] section[data-step="5"]{display:block}
.stepped[data-on="all"] section[data-step]{display:block}
nav.rail{position:sticky;top:12px;padding:20px 16px 30px;border-radius:6px}
.rail .rh{padding:0 8px 12px;border-bottom:1px solid var(--g-inner);margin-bottom:8px}
.rail .rh .eyebrow{font:600 10.5px/1 var(--caps);letter-spacing:.22em;text-transform:uppercase;color:var(--g-text)}
.rail .rsum{font-size:15px;color:var(--grey);margin-top:6px}
.rsteps{position:relative;display:flex;flex-direction:column;gap:2px}
.rsteps::before{content:"";position:absolute;left:25px;top:22px;bottom:22px;width:1px;background:var(--g-inner)}
.step{position:relative;display:flex;gap:13px;align-items:flex-start;padding:11px 10px;border:0;border-radius:5px;background:transparent;text-decoration:none;color:var(--cream);text-align:left;cursor:pointer;font:inherit;width:100%}
.step:hover{background:rgba(173,132,69,.07)}
.step .num{width:30px;height:30px;flex:none;border-radius:50%;display:grid;place-items:center;border:1px solid var(--g-dim);font:600 13px/1 var(--title);color:var(--g-text);background:var(--page);position:relative;z-index:1}
.step .num svg{width:15px;height:15px}
.step.done .num{background:linear-gradient(145deg,#3B4A2F,#1D2618);border-color:rgba(110,168,89,.6);color:var(--green-ink,#94C680)}
html[data-theme=light] .step.done .num{background:linear-gradient(145deg,#E4F0DD,#CFE3C4)}
.step.on{background:linear-gradient(90deg,rgba(173,132,69,.2),rgba(173,132,69,.04));box-shadow:inset 0 0 0 1px var(--g-dim)}
.step.on .num{border-color:var(--g-hi);color:var(--g-hi);box-shadow:0 0 10px rgba(173,132,69,.5)}
.step .t{display:block;font:600 13px/1.2 var(--title);letter-spacing:.1em;text-transform:uppercase;color:var(--tab);margin-top:2px}
.step.on .t{color:var(--g-hi)}
html[data-theme=light] .step.on .t,html[data-theme=light] .step.on .num{color:var(--g-text)}
.step .s{display:block;font-size:14.5px;color:var(--grey);margin-top:4px;line-height:1.3}
.step .s b{color:var(--cream);font-weight:500}
.step .s .warn{color:var(--amber-ink)}
.rfoot{border-top:1px solid var(--g-inner);margin:14px 4px 0;padding-top:16px;display:flex;flex-direction:column;gap:8px}
.rfoot .btn{width:100%;height:46px}
.rnext{display:flex;justify-content:space-between;font-size:14.5px;color:var(--grey);padding:0 2px}
.rnext b{color:var(--g-hi);font-weight:600}
.rwhat{font-size:13.5px;color:var(--grey);padding:0 2px;line-height:1.35}
.rwhat:empty{display:none}
.steprow{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:4px}
.stepbtn{display:inline-flex;align-items:center;gap:10px;height:44px;padding:0 14px;border:1px dashed var(--g-dim);border-radius:6px;background:transparent;color:var(--cream);text-decoration:none;cursor:pointer;font:500 16px/1 var(--text)}
.stepbtn .sn{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--g-dim);font:600 11.5px/1 var(--caps);color:var(--g-text)}
.stepbtn svg{width:14px;height:14px;color:var(--g-text);display:inline;flex:none}
.stepbtn{white-space:nowrap;min-width:0}
.stepbtn small{font:600 9.5px/1 var(--caps);letter-spacing:.14em;text-transform:uppercase;color:var(--grey);margin-right:2px}
.stepbtn.fwd{border-style:solid;border-color:var(--g-body);background:linear-gradient(180deg,rgba(173,132,69,.2),rgba(173,132,69,.06));color:var(--g-hi)}
html[data-theme=light] .stepbtn.fwd{color:var(--g-text)}
.stepbtn.fwd .sn{border-color:var(--g-hi);color:var(--g-hi)}
.stepbtn .sn,.stepbtn svg{flex:none} .stepbtn .stx{min-width:0;overflow:hidden;text-overflow:ellipsis}   /* the step label gives way (ellipsis) before the number or chevron do */
.stepbtn[hidden]{display:none}
.psteps{display:none}
body.simtab #planCtx,body.guildtab #planCtx,body.dashtab #planCtx,body.simtab .psteps,body.guildtab .psteps,body.dashtab .psteps{display:none!important}
@media (max-width:1100px){ .stepped{grid-template-columns:minmax(0,1fr)} nav.rail{display:none} .psteps{display:grid} }
@media (max-width:1100px) and (min-width:761px){ .psteps{max-width:1400px;margin:14px auto 0;padding:0 28px} }
.psteps{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:10px 12px 12px;background:var(--ctx-bg);border-bottom:1px solid var(--g-inner)}
.psteps button{display:flex;flex-direction:column;align-items:center;gap:5px;height:54px;justify-content:center;border-radius:9px;border:1px solid transparent;background:transparent;color:var(--grey);font:500 13px/1 var(--text);cursor:pointer;padding:0}
.psteps .num{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--g-dim);font:600 12px/1 var(--caps);color:var(--g-text)}
.psteps .num svg{width:14px;height:14px}
.psteps .done .num{background:linear-gradient(145deg,#3B4A2F,#1D2618);border-color:rgba(110,168,89,.6);color:#94C680}
.psteps .done{color:var(--cream)}
.psteps .on{border-color:var(--g-body);background:linear-gradient(180deg,rgba(173,132,69,.22),rgba(173,132,69,.06));color:var(--g-hi)}
.psteps .on .num{border-color:var(--g-hi);color:var(--g-hi)}
@media (max-width:760px){
  .psteps{position:sticky;top:0;z-index:20}
  .simwrap{bottom:calc(66px + env(safe-area-inset-bottom))!important}
  .mbar{bottom:calc(74px + env(safe-area-inset-bottom))!important;left:10px!important;right:10px!important;border-radius:10px;border:1px solid var(--g-dim)!important;padding:10px 10px 10px 16px!important}
  main{padding-bottom:150px!important}
  .steprow .stepbtn{flex:1 1 auto;justify-content:center;height:48px;padding:0 10px;gap:8px}
  .steprow .stepbtn small{display:none}
}

/* ---------- the header stays on screen (Sep 30, 2026) ----------
   nav.js sets html.pinhead on the tool pages (and in their frames) and measures --mast-stick (the masthead) and --head-stick
   (the masthead + the context bar). The masthead is pinned everywhere but a phone on its side; the context bar is pinned on
   computers and tablets (≥761 px wide, ≥560 px tall), not on phones. In the app a framed tab (Sim, Guild, Dashboard) scrolls
   inside its frame, so the app's own page is held still (html.frametab, set by app.js) and can't slide under the masthead. */
html.pinhead{scroll-padding-top:calc(var(--head-stick,0px) + 8px)}
@media (min-height:420px){
  html.pinhead .mast{position:sticky;top:0;z-index:45}
  html.pinhead .mast::before{content:"";position:absolute;top:0;bottom:0;left:calc(50% - 50vw);width:100vw;z-index:-1;pointer-events:none;
    background:radial-gradient(ellipse 80% 55% at 12% -8%,#171615 0%,#080706 55%,#050403 100%) fixed,var(--page)}
  html[data-theme=light].pinhead .mast::before{background:radial-gradient(ellipse 80% 55% at 12% -8%,var(--hilite) 0%,var(--page) 60%) fixed,var(--page)}
  /* an open sheet (World, account menu) sits over the dimmed page (.vscrim, 79) */
  html.pinhead .mast:has(.vpop:not([hidden]),.menu-pop:not([hidden])){z-index:96}
}
@media (min-width:761px) and (min-height:560px){
  html.pinhead .ctx{position:sticky;top:var(--mast-stick,0px);z-index:44}
}
html.pinhead nav.rail{top:calc(var(--head-stick,0px) + 12px)}
@media (max-width:760px){ html.pinhead .psteps{top:var(--head-stick,0px)} }
html.frametab,html.frametab body{overflow:hidden;overscroll-behavior:none}
html.frametab{height:100%} html.frametab body{height:100%;min-height:0;padding-bottom:0!important}   /* nothing left to scroll (iPhone Safari drags a taller page even when it's held) */

/* Small phones (Oct 7, 2026): at 360px wide the five bottom tabs were 7px wider than the screen ("DASHBOARD" + the icon's
   pill), and the section buttons' labels ("Movement") touched their edges. Narrower pills and labels so everything fits. */
@media (max-width:400px){
  .mast .tabs{padding-left:4px;padding-right:4px;gap:2px}
  .mast .tabs a{font-size:9.5px;letter-spacing:.03em}
  .mast .tabs a svg{padding:4px 12px}
  .ctx .subnav{gap:4px}
  .ctx .subnav a,.ctx .subnav button{font-size:13.5px}
  .ctx .subnav a>span,.ctx .subnav button>span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
@media (max-width:350px){
  .mast .tabs a{font-size:8.5px;letter-spacing:0}
  .mast .tabs a svg{padding:4px 6px}
}
