/* VOICE  a quiet writing room: the manuscript is the only loud thing.
   IDEA   a bound journal on a writing desk, with a contents card on the left and a margin of notes on the right.
   COLOUR desk sand, paper ivory, iron gall ink, one gold for intent; candlelight at night.
   TYPE   EB Garamond for the text, Cormorant for headings, Source Sans 3 for every tool.
   LAYOUT contents | page | margin | lens rail; everything but the page fades while you write. */
:root{
  --page:234 228 214; --leaf:251 248 241; --ink:36 31 25; --dim:110 98 80;
  --gold:150 106 22; --ember:178 74 30; --tide:46 92 112; --rule:218 208 186;
  --desk:226 219 202; --sheet-shadow:0 1px 2px rgb(60 45 20/.06),0 12px 40px -12px rgb(60 45 20/.18);
  --display:"Cormorant Garamond",Georgia,serif; --body:"EB Garamond",Georgia,"Times New Roman",serif; --ui:"Source Sans 3",system-ui,-apple-system,"Segoe UI",sans-serif;
  --status-slot:12em;
  --status-slot-wide:20em;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --page:24 21 17; --leaf:33 29 24; --ink:230 220 198; --dim:156 142 118;
  --gold:218 176 92; --ember:236 128 70; --tide:132 176 196; --rule:66 58 47;
  --desk:19 17 14; --sheet-shadow:0 1px 2px rgb(0 0 0/.4),0 18px 50px -16px rgb(0 0 0/.7);
  color-scheme:dark;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --page:24 21 17; --leaf:33 29 24; --ink:230 220 198; --dim:156 142 118;
    --gold:218 176 92; --ember:236 128 70; --tide:132 176 196; --rule:66 58 47;
    --desk:19 17 14; --sheet-shadow:0 1px 2px rgb(0 0 0/.4),0 18px 50px -16px rgb(0 0 0/.7);
    color-scheme:dark;
  }
}
*{box-sizing:border-box}
html{font-size:17px;height:100%;overflow:hidden;overscroll-behavior:none}
body{height:100%;overflow:hidden;margin:0;background:rgb(var(--desk));color:rgb(var(--ink));font-family:var(--body);-webkit-font-smoothing:antialiased}
h1,h2,h3{text-wrap:balance}
button{font:inherit;color:inherit;cursor:pointer}
::selection{background:rgb(var(--gold)/.24)}
:focus-visible{outline:2px solid rgb(var(--gold));outline-offset:2px;border-radius:3px}
*{scrollbar-width:thin;scrollbar-color:rgb(var(--rule)) transparent}

/* ---------- Shell ---------- */
#app{position:fixed;inset:0;display:grid;grid-template-rows:auto minmax(0,1fr);grid-template-columns:minmax(0,1fr);min-height:0;overflow:hidden;padding-top:env(safe-area-inset-top,0px)}
#bar{min-width:0;display:flex;align-items:center;gap:.6rem;padding:.55rem .9rem;background:rgb(var(--page));border-bottom:1px solid rgb(var(--rule));font-family:var(--ui);font-size:.86rem;transition:opacity .6s}
.rest #bar{opacity:.28}.rest #bar:hover,.rest #bar:focus-within{opacity:1}
#bar .title{font-family:var(--display);font-weight:600;font-size:1.22rem;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:26rem}
#bar .crumb{color:rgb(var(--dim));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.spacer{flex:1}
.ib{display:inline-grid;place-items:center;width:2.2rem;height:2.2rem;border-radius:8px;border:1px solid transparent;background:none;color:rgb(var(--dim))}
.ib:hover{background:rgb(var(--ink)/.06);color:rgb(var(--ink))}
.ib[aria-pressed="true"]{color:rgb(var(--gold));background:rgb(var(--gold)/.12)}
.ib svg{width:19px;height:19px}
#status{display:inline-flex;align-items:center;justify-content:flex-end;gap:.35rem;flex:none;min-width:var(--status-slot);max-width:var(--status-slot-wide);color:rgb(var(--dim));white-space:nowrap}
#status .cap{display:inline-flex;align-items:center;gap:.4rem;flex:0 1 auto;min-width:0;padding:.1rem .55rem;border-radius:999px;border:1px solid rgb(var(--rule)/.75);background:rgb(var(--ink)/.045);line-height:1.5}
#status[data-s="idle"] .cap{opacity:0;border-color:transparent;background:none}
#status .cap .txt{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}
#status .acts{display:inline-flex;align-items:center;gap:.1rem;flex:none}
#status i{flex:none;width:.5rem;height:.5rem;border-radius:50%;background:rgb(var(--tide));display:inline-block;transition:background .3s}
#status[data-s="pending"] i,#status[data-s="saving"] i{background:rgb(var(--gold));animation:pulse 1.2s ease-in-out infinite}
#status[data-s="pending"] .cap,#status[data-s="saving"] .cap{border-color:rgb(var(--gold)/.4);background:rgb(var(--gold)/.08)}
#status[data-s="offline"] i,#status[data-s="conflict"] i{background:rgb(var(--ember))}
#status[data-s="offline"] .cap,#status[data-s="conflict"] .cap{border-color:rgb(var(--ember)/.45);background:rgb(var(--ember)/.08)}
#status button{font-weight:600;color:rgb(var(--gold));background:none;border:0;padding:0 .2rem;text-decoration:underline;text-underline-offset:3px}
#count{color:rgb(var(--dim));white-space:nowrap;font-variant-numeric:tabular-nums}
#count b{color:rgb(var(--ink));font-weight:600}
#count .plus{color:rgb(var(--tide))}

#stage{display:flex;min-height:0;position:relative}

/* contents */
#nav{width:16.5rem;flex:none;overflow:hidden;background:rgb(var(--page));border-right:1px solid rgb(var(--rule));font-family:var(--ui);font-size:.88rem;transition:width .32s ease}
#nav h3{font-family:var(--ui);font-size:.7rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:rgb(var(--dim));margin:.2rem .5rem .6rem}
.nv-part{margin-top:1rem}
.nv-part>.lab{display:flex;justify-content:space-between;align-items:baseline;padding:.15rem .5rem;color:rgb(var(--dim));font-size:.74rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase}
.nv-ch{margin-top:.15rem;border-radius:8px}
.nv-ch>button.h{display:flex;width:100%;align-items:baseline;gap:.5rem;text-align:left;padding:.45rem .5rem;border:0;background:none;border-radius:8px}
.nv-ch>button.h:hover{background:rgb(var(--ink)/.05)}
.nv-ch .t{font-family:var(--display);font-weight:600;font-size:1.08rem;line-height:1.15;flex:1}
.nv-ch .no{color:rgb(var(--dim));font-size:.72rem;font-variant-numeric:tabular-nums;width:1.4rem;flex:none}
.nv-ch.on{background:rgb(var(--leaf));box-shadow:0 0 0 1px rgb(var(--rule))}
.nv-ch.on .t{color:rgb(var(--gold))}
.wc{color:rgb(var(--dim));font-size:.74rem;font-variant-numeric:tabular-nums;flex:none}
.nv-sc{display:flex;align-items:baseline;gap:.4rem;width:100%;text-align:left;border:0;background:none;padding:.3rem .5rem .3rem 2.4rem;border-radius:6px;color:rgb(var(--ink)/.86);position:relative}
.nv-sc:hover{background:rgb(var(--ink)/.05)}
.nv-sc::before{content:"";position:absolute;left:1.6rem;top:.78rem;width:.32rem;height:.32rem;border-radius:50%;background:rgb(var(--rule))}
.nv-sc.here::before{background:rgb(var(--gold))}
.nv-sc.zz{color:rgb(var(--dim));font-style:italic}
.nv-sc span:first-child{flex:1;line-height:1.3}
.nv-add{display:flex;gap:.35rem;flex-wrap:wrap;padding:.35rem .5rem .55rem 2.4rem}
.add{font-family:var(--ui);font-size:.76rem;font-weight:600;color:rgb(var(--dim));background:none;border:1px dashed rgb(var(--rule));border-radius:6px;padding:.22rem .55rem}
.add:hover{color:rgb(var(--gold));border-color:rgb(var(--gold)/.6);border-style:solid}
.add.danger:hover{color:rgb(var(--ember));border-color:rgb(var(--ember)/.6)}
.add.arm{color:rgb(var(--ember));border:1px solid rgb(var(--ember)/.7)}
@media (hover:hover){.nv-ch .add.danger{display:none}.nv-ch:hover .add.danger,.nv-ch:focus-within .add.danger,.nv-ch .add.danger.arm{display:inline-block}}
.nv-foot{margin:1.4rem .5rem 0;padding-top:1rem;border-top:1px solid rgb(var(--rule));color:rgb(var(--dim));font-size:.8rem;line-height:1.5}
.meter{height:4px;border-radius:4px;background:rgb(var(--rule));overflow:hidden;margin:.45rem 0 .2rem}
.meter i{display:block;height:100%;background:rgb(var(--gold));border-radius:4px;transition:width .6s}

/* the page */
#scroll{flex:1;min-width:0;overflow-y:auto;scroll-behavior:smooth;scroll-padding-top:3.6rem}
#sheet{position:relative;max-width:44rem;margin:2.2rem auto 7rem;background:rgb(var(--leaf));border-radius:4px;box-shadow:var(--sheet-shadow);padding:3.6rem clamp(1.4rem,6vw,4.6rem) 4rem}
.rest #sheet{box-shadow:none;background:transparent}
#vigil-wrap{font-family:var(--ui);font-size:.86rem;line-height:1.45;color:rgb(var(--dim));padding:.7rem .9rem;margin-bottom:2.6rem;border-radius:8px;background:rgb(var(--gold)/.07);border:1px solid rgb(var(--gold)/.18)}
#vigil-wrap .k{font-weight:600;color:rgb(var(--gold));margin-right:.35rem}
#vigil .chip{font-family:var(--ui);font-style:normal;font-weight:600;font-size:.84rem}
#book{font-size:1.22rem;line-height:1.75}
.chap{display:none}.chap.on{display:block;animation:fade .45s ease}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.chap>header{text-align:center;margin-bottom:3.2rem}
.chap-eb{font-family:var(--ui);font-size:.72rem;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:rgb(var(--dim));margin:0 0 .7rem}
.chap-h{font-family:var(--display);font-weight:600;font-size:clamp(2.1rem,4.5vw,2.9rem);line-height:1.05;margin:0}
.chap>header::after{content:"";display:block;width:4.5rem;height:9px;margin:1.3rem auto 0;background:radial-gradient(circle,rgb(var(--gold)) 2.2px,transparent 2.6px) center/9px 9px no-repeat,linear-gradient(rgb(var(--gold)/.5),rgb(var(--gold)/.5)) center/100% 1px no-repeat}
#book section{margin-bottom:2.6rem}
#book section+section::before{content:"⁂";display:block;text-align:center;color:rgb(var(--gold)/.7);font-size:1.1rem;margin:0 0 2.4rem;letter-spacing:.2em}
.scene-h{font-family:var(--display);font-weight:600;font-size:1.55rem;line-height:1.15;margin:0;display:flex;align-items:baseline;gap:.7rem}
.scene-h .eyebrow{font-family:var(--display);font-style:italic;font-weight:500;letter-spacing:0;text-transform:none;font-size:1.1rem;color:rgb(var(--gold));margin:0!important;display:inline}
.sky{display:flex;gap:.5rem;align-items:center;font-family:var(--ui);font-size:.8rem;color:rgb(var(--dim));margin:.45rem 0 1.4rem}
.ed{outline:none;caret-color:rgb(var(--gold))}
.ed p{margin:0 0 1.05em;transition:box-shadow .5s,background .4s}
.chap section:first-of-type .ed>p:first-child::first-letter{font-family:var(--display);font-weight:600;float:left;font-size:3.6em;line-height:.82;padding:.08em .1em 0 0;color:rgb(var(--gold))}
.ed p.song,.song{white-space:pre-line;font-style:italic}
.ed p.song{padding-left:1.1em;border-left:2px solid rgb(var(--gold)/.28);color:rgb(var(--ink)/.88)}
.ed p.curp{box-shadow:-1.6rem 0 0 -1.45rem rgb(var(--tide)/.85)}
.rest .ed p.curp{box-shadow:none}
section.asleep .ed{display:none}
section:not(.asleep) .sleepnote{display:none}
.sleepnote{font-family:var(--ui);font-size:.86rem}
.chapnav{display:flex;justify-content:space-between;gap:1rem;margin-top:3.4rem;padding-top:1.4rem;border-top:1px solid rgb(var(--rule));font-family:var(--ui);font-size:.86rem;color:rgb(var(--dim))}
.chapnav button{background:none;border:0;text-align:left;padding:.3rem 0;font-weight:500}.chapnav button:hover{color:rgb(var(--gold))}

/* marks in the text */
.a{border-bottom:1px solid transparent;transition:border-color .6s,background .4s,text-shadow .6s;border-radius:1px}
.tap{cursor:pointer}.tap:hover{background:rgb(var(--gold)/.08)}
.u-ink{border-bottom-color:rgb(var(--ink)/.3)}
.u-gold1{border-bottom-color:rgb(var(--gold)/.45)}
.u-gold2{border-bottom-color:rgb(var(--gold)/.9)}
.u-gold3{border-bottom:2px solid rgb(var(--gold));text-shadow:0 0 16px rgb(var(--gold)/.45)}
.u-out{border-bottom-style:double;border-bottom-width:3px}
.u-ember{border-bottom:1px dotted rgb(var(--ember))}
.u-echo{border-bottom:1px dotted rgb(var(--ember)/.55)}
.u-cold{border-bottom:1px dotted rgb(var(--dim)/.7)}
.u-tide{border-bottom:1px solid rgb(var(--tide)/.9)}
.lit{background:rgb(var(--gold)/.17)}

/* margin panel */
#panel{width:24.5rem;flex:none;overflow:hidden;background:rgb(var(--leaf));border-left:1px solid rgb(var(--rule));font-size:1rem;transition:width .32s ease}
#panel h2{letter-spacing:-.005em}
#panel .text-dim.italic{font-size:.95rem}
.ui{transition:opacity .6s ease}
.rest .ui{opacity:0;pointer-events:none}
.rest #nav,.rest #panel,.rest #dock{display:none}

/* drawers: contents on the left, margin on the right. Closing collapses the width; */
/* the markup inside rides in .in so it can fade out (and back in) at the same time. */
#nav>.in,#panel>.in{height:100%;overflow-y:auto;transition:opacity .22s ease,transform .3s ease}
#nav>.in{padding:1rem .7rem 2rem}
#panel>.in{padding:1.3rem 1.3rem 3rem}
#nav.is-closed{width:0!important;border-right-width:0}
#panel.is-closed{width:0!important;border-left-width:0}
#nav.is-closed>.in{opacity:0;transform:translateX(-.8rem);pointer-events:none}
#panel.is-closed>.in{opacity:0;transform:translateX(.8rem);pointer-events:none}
#nav>.in:focus-visible,#panel>.in:focus-visible{outline-offset:-2px}
.nv-h{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin:.1rem .5rem .7rem}
#nav .nv-h h3{margin:0}
.nv-x{display:inline-grid;place-items:center;width:1.7rem;height:1.7rem;border:1px solid transparent;border-radius:6px;background:none;color:rgb(var(--dim));flex:none}
.nv-x:hover,.nv-x:focus-visible{background:rgb(var(--ink)/.06);color:rgb(var(--ink))}
.nv-x svg{width:15px;height:15px}

/* lens rail */
#dock{width:4.4rem;flex:none;background:rgb(var(--page));border-left:1px solid rgb(var(--rule));overflow-y:auto;padding:.6rem .35rem;display:flex;flex-direction:column;gap:.15rem;font-family:var(--ui)}
#dock button{display:flex;flex-direction:column;align-items:center;gap:.2rem;padding:.5rem .1rem .45rem;border:0;border-radius:10px;background:none;color:rgb(var(--dim));font-size:.66rem;font-weight:600;letter-spacing:.01em}
#dock button svg{width:20px;height:20px}
#dock button:hover{background:rgb(var(--ink)/.06);color:rgb(var(--ink))}
#dock button[aria-pressed="true"]{background:rgb(var(--gold)/.14);color:rgb(var(--gold))}
#dock hr{border:0;border-top:1px solid rgb(var(--rule));margin:.4rem .5rem;width:auto}

/* shared elements used by the panels */
.eyebrow{font-family:var(--ui);font-size:.68rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:rgb(var(--dim))}
.btn{font-family:var(--ui);font-size:.8rem;font-weight:600;letter-spacing:.01em;color:rgb(var(--ink));border:1px solid rgb(var(--rule));border-radius:7px;padding:.38rem .7rem;background:rgb(var(--leaf));white-space:nowrap;transition:background .2s,border-color .2s,color .2s}
.btn:hover{border-color:rgb(var(--gold)/.7);background:rgb(var(--gold)/.06)}
.btn[aria-pressed="true"]{color:rgb(var(--gold));border-color:rgb(var(--gold)/.7);background:rgb(var(--gold)/.12)}
.btn.primary{background:rgb(var(--ink));color:rgb(var(--leaf));border-color:rgb(var(--ink))}
.btn.primary:hover{background:rgb(var(--gold));border-color:rgb(var(--gold))}
.btn.danger{color:rgb(var(--ember))}.btn.danger.arm{background:rgb(var(--ember));color:rgb(var(--leaf));border-color:rgb(var(--ember))}
.veil-knows{border-color:rgb(var(--gold)/.9);color:rgb(var(--gold));background:rgb(var(--gold)/.1)}
.veil-suspects{border-color:rgb(var(--tide)/.9);color:rgb(var(--tide));background:rgb(var(--tide)/.08)}
.veil-unaware{color:rgb(var(--dim))}
.inp{font-family:var(--body);font-size:1rem;width:100%;background:rgb(var(--ink)/.035);color:rgb(var(--ink));border:1px solid transparent;border-bottom-color:rgb(var(--rule));padding:.4rem .55rem;border-radius:6px 6px 0 0;transition:background .2s,border-color .2s}
.inp:hover{background:rgb(var(--ink)/.055)}
.inp:focus{outline:none;background:rgb(var(--leaf));border-color:rgb(var(--rule));border-bottom-color:rgb(var(--gold));box-shadow:0 2px 0 -1px rgb(var(--gold))}
.inp::placeholder{color:rgb(var(--dim)/.85);font-style:italic}
textarea.inp{resize:vertical;line-height:1.45}
.chip{font-family:var(--body);font-size:.95rem;font-style:italic;color:rgb(var(--gold));border:0;border-bottom:1px solid rgb(var(--gold)/.4);background:none;padding:0}
.chip:hover{border-bottom-color:rgb(var(--gold))}
.row{display:block;width:100%;text-align:left;padding:.5rem .55rem;margin:0 -.55rem;width:calc(100% + 1.1rem);border:0;border-bottom:1px solid rgb(var(--rule)/.6);background:none;border-radius:6px;transition:background .2s}
.row:hover{background:rgb(var(--gold)/.07)}
.sect{margin-top:1.4rem;display:flex;flex-direction:column;gap:.55rem}
.dot{display:inline-block;width:.5rem;height:.5rem;border-radius:50%;border:1px solid rgb(var(--gold))}
.dot.on{background:rgb(var(--gold))}
input[type=range]{width:100%;accent-color:rgb(var(--gold))}

#ribbon,#map{touch-action:none;width:100%;display:block}
.rl{font:600 8.5px var(--ui);letter-spacing:.1em;text-transform:uppercase;fill:rgb(var(--dim))}
.rm{font:italic 8px var(--body);fill:rgb(var(--dim))}
.rg{stroke:rgb(var(--rule));stroke-width:.6}
.ra{fill:rgb(var(--tide)/.12)}
.rw{fill:none;stroke:rgb(var(--tide));stroke-width:1.6;stroke-linecap:round}
.ri{fill:none;stroke:rgb(var(--gold)/.85);stroke-width:1.1;stroke-dasharray:3 3}
.rc{stroke:rgb(var(--ink)/.3);stroke-width:.8}
.rd{fill:rgb(var(--tide))}
#map{border:1px solid rgb(var(--rule));border-radius:8px;background:rgb(var(--page)/.5)}
.ms{fill:none;stroke:rgb(var(--tide)/.75);stroke-width:1.3;stroke-linecap:round;stroke-linejoin:round}
.mr{stroke:rgb(var(--gold)/.8);stroke-width:1;stroke-dasharray:2 3}
.mt{font:italic 500 10px var(--display);fill:rgb(var(--ink))}
.md{font:8px var(--ui);fill:rgb(var(--gold))}

/* floating pieces */
#selbar{background:rgb(var(--ink));border:0;border-radius:10px;padding:.3rem;box-shadow:0 10px 30px -8px rgb(0 0 0/.4)}
#selbar .btn{background:transparent;border-color:transparent;color:rgb(var(--leaf))}
#selbar .btn:hover{background:rgb(var(--leaf)/.14)}
#toast{font-family:var(--ui);font-size:.9rem;line-height:1.45;background:rgb(var(--ink));color:rgb(var(--leaf));border-radius:10px;padding:.7rem 1rem;box-shadow:0 14px 34px -10px rgb(0 0 0/.45);text-align:center}
#wander{background:rgb(var(--leaf));border:1px solid rgb(var(--gold)/.4);border-radius:12px;box-shadow:0 18px 40px -14px rgb(0 0 0/.35)}
#sigil{opacity:0;pointer-events:none;transition:opacity 1.2s ease;background:rgb(var(--leaf)/.7);border:0}
.rest #sigil{opacity:.45;pointer-events:auto}.rest #sigil:hover{opacity:1}
#whisper{opacity:.7;font-family:var(--body)}

/* library */
#library{position:fixed;inset:0;z-index:60;background:rgb(var(--desk)/.72);backdrop-filter:blur(6px);display:grid;place-items:start center;overflow-y:auto;padding:4vh 1rem}
#library.hidden{display:none}
.lib{width:min(58rem,100%);background:rgb(var(--leaf));border-radius:14px;box-shadow:var(--sheet-shadow);padding:1.8rem clamp(1.1rem,4vw,2.4rem) 2.2rem;font-family:var(--ui)}
.lib h2{font-family:var(--display);font-weight:600;font-size:2rem;margin:0;line-height:1.1}
.lib .sub{color:rgb(var(--dim));margin:.3rem 0 0;font-size:.92rem}
.tabs{display:flex;gap:.3rem;margin:1.3rem 0 1.1rem;border-bottom:1px solid rgb(var(--rule))}
.tabs button{border:0;background:none;padding:.55rem .8rem;font-weight:600;font-size:.88rem;color:rgb(var(--dim));border-bottom:2px solid transparent;margin-bottom:-1px}
.tabs button[aria-selected="true"]{color:rgb(var(--ink));border-bottom-color:rgb(var(--gold))}
.books{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:1rem}
.bk{position:relative;display:flex;flex-direction:column;gap:.5rem;padding:1.1rem 1.1rem 1rem 1.35rem;border-radius:4px 10px 10px 4px;background:rgb(var(--page));border:1px solid rgb(var(--rule));min-height:11rem}
.bk::before{content:"";position:absolute;left:0;top:0;bottom:0;width:.45rem;border-radius:4px 0 0 4px;background:rgb(var(--gold)/.75)}
.bk.cur{box-shadow:0 0 0 2px rgb(var(--gold)/.55)}
.bk h4{font-family:var(--display);font-weight:600;font-size:1.32rem;line-height:1.12;margin:0}
.bk p{margin:0;color:rgb(var(--dim));font-size:.84rem;line-height:1.4;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.bk .meta{margin-top:auto;font-size:.76rem;color:rgb(var(--dim));font-variant-numeric:tabular-nums}
.bk .acts{display:flex;gap:.35rem;flex-wrap:wrap}
.bk.new{background:none;border-style:dashed;justify-content:center}
.bk.new::before{display:none}
.revs{display:flex;flex-direction:column}
.rev{display:grid;grid-template-columns:1fr auto auto;gap:.8rem;align-items:center;padding:.65rem .2rem;border-bottom:1px solid rgb(var(--rule)/.7);font-size:.88rem}
.rev .when{font-variant-numeric:tabular-nums}.rev .lbl{color:rgb(var(--dim))}
.rev .w{color:rgb(var(--dim));font-variant-numeric:tabular-nums;white-space:nowrap}
.note{font-size:.84rem;color:rgb(var(--dim));line-height:1.5}
.err{padding:1rem;border-radius:10px;background:rgb(var(--ember)/.08);border:1px solid rgb(var(--ember)/.3);color:rgb(var(--ink));font-size:.9rem;line-height:1.5}
code{font-size:.85em;background:rgb(var(--ink)/.07);padding:.08em .35em;border-radius:4px}


/* writing toolbar */
#tools{position:sticky;top:0;z-index:20;display:flex;justify-content:center;padding:.55rem .8rem;background:linear-gradient(rgb(var(--desk)) 70%,rgb(var(--desk)/0));transition:opacity .5s}
#tools .tbar{display:flex;align-items:center;gap:.15rem;padding:.25rem;background:rgb(var(--leaf));border:1px solid rgb(var(--rule));border-radius:12px;box-shadow:0 4px 18px -10px rgb(60 45 20/.35);font-family:var(--ui);max-width:100%;overflow-x:auto}
#tools button{display:inline-flex;align-items:center;gap:.35rem;height:2.15rem;padding:0 .6rem;border:0;border-radius:8px;background:none;color:rgb(var(--ink)/.8);font-size:.8rem;font-weight:600;white-space:nowrap}
#tools button:hover:not(:disabled){background:rgb(var(--ink)/.06);color:rgb(var(--ink))}
#tools button[aria-pressed="true"]{background:rgb(var(--gold)/.15);color:rgb(var(--gold))}
#tools button:disabled{opacity:.35;cursor:default}
#tools button svg{width:17px;height:17px}
#tools .sep{width:1px;height:1.3rem;background:rgb(var(--rule));margin:0 .25rem;flex:none}
#tools .lbl{font-size:.68rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:rgb(var(--dim));padding:0 .3rem 0 .4rem}
#tools .tlselstat{font:500 .72rem var(--ui);color:rgb(var(--dim));padding:0 .35rem;align-self:center;max-width:19rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rest #tools{opacity:.3}.rest #tools:hover,.rest #tools:focus-within{opacity:1}
.rest #sheet{margin-top:.6rem}

/* layers in the text */
/* Block carriers own the left-gutter dot bar; inline carriers get a quiet mark after the text. */
.ed p[data-layers]{position:relative}
.ed p[data-layers]::after{content:"";position:absolute;left:-2.9rem;top:.62em;height:.4rem;border-radius:.2rem;width:calc(var(--lym-count,0) * .62rem);background-repeat:no-repeat;background-size:.4rem .4rem;background-position:.1rem 0,.72rem 0,1.34rem 0,1.96rem 0;background-image:radial-gradient(circle,var(--lym1,transparent) 0 .2rem,transparent .2rem),radial-gradient(circle,var(--lym2,transparent) 0 .2rem,transparent .2rem),radial-gradient(circle,var(--lym3,transparent) 0 .2rem,transparent .2rem),radial-gradient(circle,var(--lym4,transparent) 0 .2rem,transparent .2rem)}
.ed [data-layers]:not(p)::after{content:"";display:inline-block;vertical-align:baseline;width:calc(var(--lym-count,0) * .34rem);height:.26rem;margin-left:.28rem;border-radius:.13rem;background-repeat:no-repeat;background-size:.24rem .26rem;background-position:0 .04rem,.34rem .04rem,.68rem .04rem,1.02rem .04rem;background-image:radial-gradient(circle,var(--lym1,transparent) 0 .12rem,transparent .12rem),radial-gradient(circle,var(--lym2,transparent) 0 .12rem,transparent .12rem),radial-gradient(circle,var(--lym3,transparent) 0 .12rem,transparent .12rem),radial-gradient(circle,var(--lym4,transparent) 0 .12rem,transparent .12rem)}
.pv-off{display:none}
[data-pv-faint] .pv-off{display:block;opacity:.25}
.previewing #nav,.previewing #panel,.previewing #dock,.previewing #tools,.previewing #vigil-wrap,.previewing .scene-meta,.previewing #selbar{display:none!important}
#pvbar{font-family:var(--ui);font-size:.86rem;line-height:1.5;padding:.85rem 1rem;margin-bottom:2.4rem;border-radius:10px;background:rgb(var(--tide)/.08);border:1px solid rgb(var(--tide)/.25)}
#pvbar b{color:rgb(var(--tide))}
.seg{display:inline-flex;padding:.18rem;border-radius:9px;background:rgb(var(--ink)/.06);gap:.1rem}
.seg button{border:0;background:none;padding:.32rem .6rem;border-radius:7px;font:600 .78rem var(--ui);color:rgb(var(--dim))}
.seg button:hover{color:rgb(var(--ink))}
.seg button[aria-pressed="true"]{background:rgb(var(--leaf));color:rgb(var(--ink));box-shadow:0 1px 3px rgb(0 0 0/.12)}
.seg .lbl{white-space:nowrap;font:600 .66rem var(--ui);letter-spacing:.08em;text-transform:uppercase;color:rgb(var(--dim));padding:0 .4rem;align-self:center}

/* scene status and layer pills */
.scene-meta{display:flex;gap:.4rem;margin:-.9rem 0 1.4rem;min-height:1.6rem}
.pill{appearance:none;-webkit-appearance:none;font:600 .74rem var(--ui);border-radius:999px;border:1px solid rgb(var(--rule));background:rgb(var(--leaf));color:rgb(var(--ink)/.8);padding:.22rem 1.5rem .22rem .65rem;cursor:pointer;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 11px) 55%,calc(100% - 7px) 55%;background-size:4px 4px;background-repeat:no-repeat}
.pill:hover{border-color:rgb(var(--gold)/.6)}
.st-idea{--st:var(--dim)}.st-draft{--st:var(--ink)}.st-revise{--st:var(--ember)}.st-review{--st:var(--tide)}.st-final{--st:var(--gold)}
.pill[class*="st-"]{color:rgb(var(--st));border-color:rgb(var(--st)/.45);background-color:rgb(var(--st)/.08)}
.ly{--ly:var(--dim)}
.pill.ly{color:rgb(var(--ly))}
.nv-sc::before{background:rgb(var(--st,var(--rule)))!important;opacity:.85}
.nv-sc.here::before{box-shadow:0 0 0 2px rgb(var(--leaf)),0 0 0 3.5px rgb(var(--gold))}

/* rules */
::highlight(rule-issue){text-decoration:underline wavy rgb(var(--ember));text-decoration-thickness:1.2px;text-underline-offset:4px;text-decoration-skip-ink:none}
::highlight(rule-focus){background-color:rgb(var(--ember)/.22)}
#dock button{position:relative}
.bdg{position:absolute;top:.25rem;right:.55rem;min-width:1.05rem;height:1.05rem;padding:0 .25rem;border-radius:999px;background:rgb(var(--ember));color:rgb(var(--leaf));font:700 .6rem/1.05rem var(--ui);text-align:center}
.rk{font:600 .64rem var(--ui);letter-spacing:.08em;text-transform:uppercase;color:rgb(var(--dim));border:1px solid rgb(var(--rule));border-radius:5px;padding:.08rem .3rem;vertical-align:.12em}
.rulegrp{border:1px solid rgb(var(--rule));border-radius:10px;padding:.8rem .9rem;display:flex;flex-direction:column;gap:.4rem;background:rgb(var(--page)/.4)}
.issue{display:flex;flex-direction:column;gap:.35rem;padding-bottom:.5rem;border-bottom:1px dashed rgb(var(--rule))}
.issue:last-child{border-bottom:0;padding-bottom:0}
.issue .row{border-bottom:0}
mark{background:rgb(var(--ember)/.18);color:inherit;border-bottom:1.5px solid rgb(var(--ember));padding:0 .1em;font-style:normal}
.rulerow{display:flex;gap:.4rem;align-items:flex-start;padding:.5rem 0;border-bottom:1px solid rgb(var(--rule)/.6)}
.rulerow.off{opacity:.5}
.rulerow input[type=checkbox]{margin-top:.3rem;accent-color:rgb(var(--gold));width:1rem;height:1rem;flex:none}
.addrule{display:flex;flex-direction:column;gap:.5rem;margin-top:1rem;padding:.9rem;border-radius:10px;background:rgb(var(--gold)/.06);border:1px solid rgb(var(--gold)/.2)}
details>summary{list-style:none}details>summary::before{content:"▸ ";color:rgb(var(--gold))}details[open]>summary::before{content:"▾ "}

/* overview */
#overview{position:fixed;inset:0;z-index:58;background:rgb(var(--desk));overflow-y:auto;padding:1.4rem clamp(.8rem,3vw,2.2rem) 3rem;font-family:var(--ui)}
#overview.hidden{display:none}
#overview h2{font-family:var(--display);font-weight:600;font-size:2.2rem;line-height:1.05;margin:0}
#overview .sub{color:rgb(var(--dim));margin:.35rem 0 0;font-size:.92rem}
.ovtop{align-items:start;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:1.4rem;margin:1.4rem 0 1.6rem}
.ovprog,.ovmap{background:rgb(var(--leaf));border:1px solid rgb(var(--rule));border-radius:14px;padding:1.1rem 1.2rem}
.stack{display:flex;height:12px;border-radius:6px;overflow:hidden;background:rgb(var(--rule));margin:.5rem 0 .8rem}
.stack i{display:block;height:100%;background:rgb(var(--st))}
.stack i.st-draft{background:rgb(var(--ink)/.55)}
.legend{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:.45rem}
.chipb{display:inline-flex;align-items:center;gap:.4rem;border:1px solid rgb(var(--rule));background:rgb(var(--leaf));border-radius:999px;padding:.3rem .65rem;font:600 .78rem var(--ui);color:rgb(var(--ink)/.85)}
.chipb i{width:.55rem;height:.55rem;border-radius:50%;background:rgb(var(--st,var(--ly,var(--dim))))}
.chipb span{color:rgb(var(--dim));font-weight:500;font-variant-numeric:tabular-nums}
.chipb:hover{border-color:rgb(var(--gold)/.6)}
.chipb.on{background:rgb(var(--gold)/.14);border-color:rgb(var(--gold)/.7);color:rgb(var(--gold))}
#ovmap{width:100%;display:block;border-radius:10px;background:rgb(var(--page)/.6)}
.mp{cursor:pointer}.mp:focus{outline:none}
.mpc{fill:rgb(var(--gold)/.18);stroke:rgb(var(--gold));stroke-width:1}
.mp:hover .mpc,.mp:focus-visible .mpc{fill:rgb(var(--gold)/.35)}
.mp.on .mpc{fill:rgb(var(--gold));}
.mp.on .mpn{fill:rgb(var(--leaf))}
.mpn{font:700 7px var(--ui);fill:rgb(var(--gold));text-anchor:middle}
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(15.5rem,19rem);gap:.9rem;overflow-x:auto;padding-bottom:1rem;align-items:start}
.col{background:rgb(var(--page)/.7);border:1px solid rgb(var(--rule));border-radius:14px;padding:.7rem;display:flex;flex-direction:column;gap:.6rem;min-height:6rem}
.colh{display:flex;justify-content:space-between;gap:.5rem;font-weight:600;font-size:.84rem;margin:.1rem .25rem .2rem;color:rgb(var(--ink))}
.colh span:last-child{color:rgb(var(--dim));font-variant-numeric:tabular-nums}
.colh[class*="st-"]{color:rgb(var(--st))}
.card{background:rgb(var(--leaf));border:1px solid rgb(var(--rule));border-left:4px solid rgb(var(--st));border-radius:10px;padding:.7rem .8rem;display:flex;flex-direction:column;gap:.35rem;box-shadow:0 1px 2px rgb(0 0 0/.04)}
.card.st-draft{border-left-color:rgb(var(--ink)/.45)}
.card.zz{opacity:.6}
.card .ttl{border:0;background:none;padding:0;text-align:left;font-family:var(--display);font-weight:600;font-size:1.2rem;line-height:1.15;color:rgb(var(--ink))}
.card .ttl:hover{color:rgb(var(--gold))}
.card .pur{margin:0;color:rgb(var(--dim));font-size:.8rem;line-height:1.4}
.card .meta{display:flex;flex-wrap:wrap;gap:.2rem .7rem;font-size:.74rem;color:rgb(var(--dim))}
.card .pill{font-size:.7rem}
.iss{font:700 .68rem var(--ui);color:rgb(var(--leaf));background:rgb(var(--ember));border-radius:999px;padding:.1rem .45rem}

/* compare */
.cmp{border:1px solid rgb(var(--rule));border-radius:10px;padding:.7rem .9rem;margin-top:.5rem;display:flex;flex-direction:column;gap:.45rem;align-items:flex-start}
.cmp .ck{font:600 .66rem var(--ui);letter-spacing:.08em;text-transform:uppercase}
.cmp.changed .ck{color:rgb(var(--tide))}.cmp.added .ck{color:rgb(var(--gold))}.cmp.removed .ck{color:rgb(var(--ember))}
.cmp.removed p{text-decoration:line-through;text-decoration-color:rgb(var(--ember)/.6);color:rgb(var(--dim))}
.cmp del{background:rgb(var(--ember)/.14);color:rgb(var(--ember));text-decoration:line-through}
.cmp ins{background:rgb(var(--tide)/.16);text-decoration:none;border-bottom:1px solid rgb(var(--tide))}
.rev{grid-template-columns:1fr auto auto auto!important}
@media (max-width: 900px){ .ovtop{grid-template-columns:minmax(0,1fr)} .ed p[data-layers]::after{left:auto;right:-.4rem;top:-.6rem} .ed [data-layers]:not(p)::after{margin-left:.2rem} #pvlayers .lbl{display:none} }
@media (max-width: 600px){ #bar{flex-wrap:wrap} #pvlayers{order:9;width:100%} #pvlayers button{flex:1;padding:.32rem .45rem} #ovbtn{display:none} }


/* series and switching */
.titlebtn{display:inline-flex;align-items:baseline;gap:.45rem;border:0;background:none;padding:.2rem .45rem;margin-left:-.45rem;border-radius:8px;min-width:0;color:rgb(var(--ink))}
.titlebtn:hover{background:rgb(var(--ink)/.06)}
.titlebtn svg{align-self:center;color:rgb(var(--dim));flex:none}
.titlebtn .ser{font:600 .74rem var(--ui);letter-spacing:.06em;text-transform:uppercase;color:rgb(var(--gold));white-space:nowrap}
.titlebtn .ser::after{content:" /";color:rgb(var(--dim))}
#switch{position:fixed;z-index:65;top:3.1rem;left:3.6rem;width:min(22rem,92vw);max-height:70vh;overflow-y:auto;background:rgb(var(--leaf));border:1px solid rgb(var(--rule));border-radius:12px;box-shadow:0 18px 40px -14px rgb(0 0 0/.35);padding:.45rem;font-family:var(--ui)}
#switch.hidden{display:none}
#switch .gh{font:600 .66rem var(--ui);letter-spacing:.08em;text-transform:uppercase;color:rgb(var(--dim));padding:.6rem .6rem .25rem}
#switch button{display:flex;width:100%;align-items:baseline;justify-content:space-between;gap:.6rem;border:0;background:none;text-align:left;padding:.5rem .6rem;border-radius:8px;font-size:.9rem}
#switch button:hover,#switch button:focus-visible{background:rgb(var(--gold)/.1)}
#switch button[aria-current="true"]{color:rgb(var(--gold));font-weight:600}
#switch button span:last-child{color:rgb(var(--dim));font-size:.76rem;font-variant-numeric:tabular-nums;white-space:nowrap}
#switch hr{border:0;border-top:1px solid rgb(var(--rule));margin:.35rem .2rem}
.serblock{border:1px solid rgb(var(--rule));border-radius:14px;padding:1rem 1.1rem 1.1rem;margin-bottom:1.1rem;background:rgb(var(--page)/.45)}
.serblock.loose{border-style:dashed;background:none}
.serhead{display:flex;gap:1rem;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;margin-bottom:.9rem}
.serin{font-family:var(--display);font-weight:600;font-size:1.55rem;line-height:1.1;border:0;border-bottom:1px solid transparent;background:none;color:rgb(var(--ink));padding:.1rem 0;width:100%}
.serin:hover,.serin:focus{border-bottom-color:rgb(var(--rule));outline:none}
.serdesc{font-family:var(--ui);font-size:.86rem;color:rgb(var(--dim));border:0;border-bottom:1px solid transparent;background:none;width:100%;padding:.15rem 0}
.serdesc:hover,.serdesc:focus{border-bottom-color:rgb(var(--rule));outline:none;color:rgb(var(--ink))}
.sermeta{font-size:.78rem;color:rgb(var(--dim));margin-top:.35rem}
.shared{display:inline-flex;gap:.3rem;flex-wrap:wrap;margin-top:.45rem}
.shared span{font:600 .68rem var(--ui);color:rgb(var(--tide));background:rgb(var(--tide)/.09);border-radius:999px;padding:.12rem .5rem}
.bk .pill{align-self:flex-start;max-width:100%}
.newser{display:flex;gap:.5rem;align-items:flex-end;flex-wrap:wrap;padding:1rem 1.1rem;border-radius:14px;background:rgb(var(--gold)/.06);border:1px solid rgb(var(--gold)/.22)}
@media (max-width: 900px){ .titlebtn .ser{display:none} #switch{left:.5rem} }


/* spotlight */
.spot{position:relative;z-index:61;outline:3px solid rgb(var(--gold));outline-offset:4px;border-radius:10px;animation:spot 1.1s ease-in-out 2}
@keyframes spot{0%,100%{outline-color:rgb(var(--gold))}50%{outline-color:rgb(var(--gold)/.2);outline-offset:9px}}

/* guide */
#guide,#welcome{position:fixed;inset:0;z-index:62;background:rgb(var(--desk)/.78);backdrop-filter:blur(6px);overflow-y:auto;padding:4vh 1rem;display:grid;place-items:start center;font-family:var(--ui)}
#guide.hidden,#welcome.hidden{display:none}
.gd{width:min(64rem,100%);background:rgb(var(--leaf));border-radius:16px;box-shadow:var(--sheet-shadow);padding:1.8rem clamp(1rem,4vw,2.4rem) 2.4rem}
.gd h2,.welc h2{font-family:var(--display);font-weight:600;font-size:2.1rem;line-height:1.08;margin:0}
.gd .sub{color:rgb(var(--dim));margin:.35rem 0 0}
.gd-map{display:grid;grid-template-columns:1.1fr 2.4fr 1.5fr .55fr;grid-template-rows:auto auto minmax(7rem,auto);grid-template-areas:"bar bar bar bar" "nav tools panel rail" "nav page panel rail";gap:.4rem;margin:1.4rem 0;padding:.5rem;border-radius:14px;background:rgb(var(--desk));border:1px solid rgb(var(--rule))}
.ga{display:flex;flex-direction:column;gap:.15rem;text-align:left;border:1px solid rgb(var(--rule));border-radius:9px;padding:.55rem .65rem;background:rgb(var(--page));font-size:.76rem;line-height:1.35;color:rgb(var(--dim));transition:border-color .2s,background .2s}
.ga b{color:rgb(var(--ink));font-size:.84rem}
.ga:hover,.ga:focus-visible{border-color:rgb(var(--gold));background:rgb(var(--gold)/.08)}
.ga-bar{grid-area:bar}.ga-nav{grid-area:nav}.ga-tools{grid-area:tools}.ga-page{grid-area:page;background:rgb(var(--leaf))}.ga-panel{grid-area:panel;background:rgb(var(--leaf))}.ga-rail{grid-area:rail}
.ga-page b{font-family:var(--display);font-size:1.1rem}
.gd-start{padding:1rem 1.2rem;border-radius:12px;background:rgb(var(--gold)/.07);border:1px solid rgb(var(--gold)/.22)}
.gd-start ol{list-style:decimal;margin:.5rem 0 0;padding-left:1.2rem;display:flex;flex-direction:column;gap:.35rem;line-height:1.5}
.gd-grp{margin-top:1.8rem}
.gd-grp h3{font-family:var(--display);font-weight:600;font-size:1.35rem;margin:0 0 .7rem}
.gd-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(19rem,1fr));gap:.6rem}
.gf{display:grid;grid-template-columns:auto minmax(0,1fr);gap:.2rem .8rem;align-items:start;padding:.8rem .9rem;border:1px solid rgb(var(--rule));border-radius:12px;background:rgb(var(--page)/.5)}
.gf.on{border-color:rgb(var(--gold));box-shadow:0 0 0 3px rgb(var(--gold)/.18)}
.gf .gi{display:grid;place-items:center;width:2.3rem;height:2.3rem;border-radius:9px;background:rgb(var(--leaf));border:1px solid rgb(var(--rule));color:rgb(var(--gold))}
.gf .gi svg{width:19px;height:19px}
.gf h4{margin:0;font-size:.95rem;font-weight:600}
.gf p{margin:.2rem 0 0;font-size:.83rem;line-height:1.45;color:rgb(var(--ink)/.8)}
.gf .wh{color:rgb(var(--tide));font-weight:600;font-size:.76rem}
.gf .btn{grid-column:2;justify-self:start;margin-top:.45rem;padding:.3rem .65rem;font-size:.76rem}
.gf .gi{grid-row:span 2}
.keys{display:grid;grid-template-columns:repeat(auto-fill,minmax(19rem,1fr));gap:.1rem 1.2rem}
.keys>div{display:flex;justify-content:space-between;gap:1rem;padding:.45rem 0;border-bottom:1px solid rgb(var(--rule)/.7);font-size:.86rem}
kbd{font:600 .74rem var(--ui);padding:.12rem .42rem;border-radius:5px;border:1px solid rgb(var(--rule));border-bottom-width:2px;background:rgb(var(--page))}

/* welcome */
#welcome{place-items:center}
.welc{width:min(34rem,100%);background:rgb(var(--leaf));border-radius:18px;box-shadow:var(--sheet-shadow);padding:2rem clamp(1.2rem,4vw,2.2rem)}
.welc h2{margin-top:.4rem}
.welc ol{list-style:none;padding:0;margin:1.3rem 0 1rem;display:flex;flex-direction:column;gap:.8rem}
.welc li{display:flex;gap:.8rem;align-items:flex-start;line-height:1.5;font-size:.95rem}
.welc li>span{display:grid;place-items:center;flex:none;width:1.8rem;height:1.8rem;border-radius:50%;background:rgb(var(--gold)/.14);color:rgb(var(--gold));font-weight:700}

/* wander */
.wkinds{display:flex;flex-wrap:wrap;gap:.35rem;margin-top:1rem}
.wkinds .chipb:disabled{opacity:.45;cursor:default}
.wcard{margin-top:1rem;border-radius:14px;padding:1.1rem 1.1rem 1rem;background:rgb(var(--page)/.6);border:1px solid rgb(var(--rule));position:relative;overflow:hidden}
.wcard::before{content:"";position:absolute;inset:0 auto 0 0;width:4px;background:rgb(var(--gold))}
.wcard.k-lone::before{background:rgb(var(--tide))}.wcard.k-wait::before{background:rgb(var(--ember))}.wcard.k-deep::before{background:rgb(var(--dim))}
.wcard .wk{margin:0 0 .7rem;font:600 .7rem var(--ui);letter-spacing:.09em;text-transform:uppercase;color:rgb(var(--dim))}
.wq{margin:0}
.wq blockquote,.wdeep{margin:0;font-family:var(--body);font-size:1.18rem;line-height:1.55;font-style:italic;color:rgb(var(--ink))}
.wq figcaption{margin-top:.35rem;font:500 .74rem var(--ui);color:rgb(var(--dim))}
.wq mark{background:rgb(var(--gold)/.2);border-bottom:1.5px solid rgb(var(--gold));font-style:normal}
.wjoin{display:flex;align-items:center;gap:.6rem;margin:.7rem 0;font:600 .72rem var(--ui);color:rgb(var(--gold));letter-spacing:.04em}
.wjoin::before,.wjoin::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,transparent,rgb(var(--gold)/.6),transparent)}
.wcard .why{margin:.9rem 0 0;font:.86rem/1.5 var(--ui);color:rgb(var(--ink)/.8)}
.wacts{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.9rem}
.wcard.empty p{font:.9rem/1.5 var(--ui);color:rgb(var(--ink)/.8);margin:0}
.wnext{display:flex;align-items:center;justify-content:center;gap:.45rem;width:100%;margin-top:.7rem;padding:.6rem}
.wnext svg{width:17px;height:17px}
@media (max-width: 760px){ .gd-map{grid-template-columns:1fr 1fr;grid-template-areas:"bar bar" "nav rail" "tools tools" "page panel"} }

/* narrow screens: contents and margin become drawers, the rail a bottom bar */
@media (max-width: 1100px){ #panel{width:21rem} #nav{width:14.5rem} }
@media (max-width: 900px){
  #nav{position:absolute;z-index:35;inset:0 auto 0 0;width:min(18rem,86vw);box-shadow:12px 0 40px -18px rgb(0 0 0/.4);transition:transform .3s}
  #stage{flex-direction:column}
  /* the contents drawer slides in and out on narrow screens */
  #nav.is-closed{width:min(18rem,86vw)!important;transform:translateX(-102%);box-shadow:none}
  #nav.is-closed>.in{transform:translateX(0)}
  #panel{position:absolute;z-index:34;left:0;right:0;bottom:3.9rem;width:auto;max-height:58%;overflow-y:auto;border-left:0;border-top:1px solid rgb(var(--rule));border-radius:14px 14px 0 0;box-shadow:0 -14px 40px -18px rgb(0 0 0/.4);transition:max-height .32s ease}
  /* the margin sheet rises from the bottom edge instead of collapsing a width */
  #panel.is-closed{max-height:0;border-top-width:0;box-shadow:none;overflow:hidden}
  #dock{width:auto;flex-direction:row;border-left:0;border-top:1px solid rgb(var(--rule));overflow-x:auto;padding:.3rem;order:3}
  #dock button{min-width:3.6rem}
  #dock hr{border-top:0;border-left:1px solid rgb(var(--rule));margin:.4rem .2rem}
  #sheet{margin:0 auto 4rem;border-radius:0;box-shadow:none;padding-top:2rem}
  #bar .title{max-width:46vw}#bar .crumb,#count .sess{display:none}
  #stage,#scroll{min-width:0;width:100%}
}
@media (max-width: 600px){ #count{display:none} #status{min-width:0} #status .cap{padding:.1rem .3rem} #status .cap .txt{display:none} #status[data-s=conflict] .cap .txt,#status[data-s=backup] .cap .txt,#status[data-s=offline] .cap .txt{display:inline-block} #bar{gap:.25rem;padding:.45rem .5rem} }
@media (prefers-reduced-motion: reduce){ *{transition:none!important;animation:none!important;scroll-behavior:auto!important} #nav,#panel{transition-duration:.01s!important} }
