:root{
  --table:#14100c;
  --table-2:#1c1710;
  --edge-line:#3a2f24;
  --core-top:#f3ece0;      /* newest stratum */
  --core-bottom:#cbbba0;   /* oldest stratum */
  --ink:#211b14;
  --ink-2:#5b4f40;
  --ink-3:#8a7c69;
  --clay:#8a4b23;
  --ochre:#c08a2e;
  --slate:#6a7783;
  --rust:#a8382b;
  --plum:#7d4a63;
  --paper:#e8dfcd;
  --rule:#2b241c;
  --label:"Avenir Next Condensed","Avenir Next Condensed Demi Bold",Futura,"Helvetica Neue",sans-serif;
  --data:ui-monospace,"SF Mono",Menlo,monospace;
}
*{box-sizing:border-box}
html,body{height:100%;margin:0}
body{
  background:var(--table);
  color:var(--paper);
  font:14px/1.5 "Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  overflow:hidden;
}
button,input{font-family:inherit}
button:focus-visible,input:focus-visible,summary:focus-visible,[role="button"]:focus-visible{
  outline:2px solid var(--ochre);outline-offset:2px;
}
#mobile-nav,#rail-mobile-bar,#panel-mobile-bar,#mobile-welcome{display:none}
.mobile-copy,.mobile-only{display:none}

/* ---------------------------------------------------------- header */
#top{
  display:flex;align-items:center;gap:24px;
  padding:10px 16px;border-bottom:1px solid var(--rule);
  background:linear-gradient(180deg,#1b160f,#14100c);
}
.brand{display:flex;align-items:baseline;gap:10px}
.mark{
  width:17px;height:30px;align-self:center;flex:0 0 auto;
  background:url("assets/descent-mark-organic.png") center/contain no-repeat;
}
h1{font-size:17px;margin:0;letter-spacing:.04em;font-weight:600}
.sub{color:var(--ink-3);font-size:12px;font-style:italic}
.tools{display:flex;gap:6px;margin-left:auto}
#search{
  background:#0e0b08;border:1px solid var(--rule);color:var(--paper);
  padding:6px 10px;width:230px;font-size:12px;
}
#search:focus{border-color:var(--ochre)}
#reset,#about{
  background:transparent;border:1px solid var(--rule);color:#b2a794;
  padding:6px 10px;cursor:pointer;font-size:12px;
}
#reset:hover,#about:hover{border-color:#6b5c43;color:var(--paper)}

/* ---------------------------------------------------------- layout */
main{display:flex;height:calc(100% - 52px)}
#rail{
  width:216px;flex:0 0 216px;border-right:1px solid var(--rule);
  overflow-y:auto;padding-bottom:30px;background:#161109;
}
#stage{flex:1;min-width:0;position:relative;overflow:hidden;background:
  radial-gradient(ellipse at 50% 0%, #221a12 0%, #100d09 70%)}
#panel{
  width:390px;flex:0 0 390px;border-left:1px solid var(--rule);
  overflow-y:auto;background:#161109;
}

/* ---------------------------------------------------------- rail */
.rail-gloss{color:#9a8e7b;font-size:11.5px;font-style:italic;line-height:1.45;
  margin:0 0 10px;padding:0 17px}
.lg span[title]{cursor:help}
.rail-head{
  font-family:var(--label);font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:#9a8e7b;
  padding:14px 14px 6px;border-bottom:1px solid #221c14;margin-bottom:6px;
}
.motif{
  display:grid;grid-template-columns:28px 1fr;gap:0 8px;align-items:baseline;
  width:100%;text-align:left;background:transparent;border:0;
  color:#a89c88;padding:7px 17px;cursor:pointer;font-size:13px;line-height:1.35;
  transition:color .12s linear;
}
.motif:hover{color:#e8dfcd}
.motif.on{color:#f2e9d7}
.motif.on .sig{color:var(--ochre)}
.motif.on .nm{font-weight:600}
.motif .fam{display:block;font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:#6d6152;margin-top:2px}
.motif .sig{color:#7d6c4f;font-family:var(--data);font-size:10.5px;letter-spacing:.04em}
.motif:hover .sig,.motif.on .sig{color:var(--ochre)}
.motif.proposed{font-style:italic;color:#9a8e7b}
.motif.proposed .nm::after{content:" ◇";color:#6d6152;font-style:normal}
#legend{padding:2px 14px 10px}
.lg{display:flex;align-items:center;gap:9px;font-size:12px;color:#b2a794}
.lg svg line{stroke-width:2}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.dot.v-echo{background:transparent;box-shadow:0 0 0 1.5px #a08a63 inset}
.lgy{width:16px;height:16px;flex:0 0 16px}
.lgy .glyph{fill:var(--ochre);stroke:#6f6045;stroke-width:1.2}
.lgy .glyph.faint{fill-opacity:.35}
#guide{border-top:1px solid #221c14;margin-top:8px}
#guide > summary{
  cursor:pointer;list-style:none;padding:13px 14px;color:#b2a794;
  font-family:var(--label);font-size:11px;letter-spacing:.16em;text-transform:uppercase;
}
#guide > summary::-webkit-details-marker{display:none}
#guide > summary::after{content:"+";float:right;color:var(--ochre)}
#guide[open] > summary::after{content:"−"}
.guide-body{border-top:1px solid #221c14;padding-top:10px}

/* ---------------------------------------------------------- canvas */
#canvas-wrap{position:absolute;inset:0}
#canvas{
  width:100%;height:100%;cursor:grab;display:block;touch-action:none;
  user-select:none;-webkit-user-select:none
}
#canvas *,body.map-dragging{
  user-select:none;-webkit-user-select:none
}
#canvas.dragging{cursor:grabbing}
#hint{
  position:absolute;left:164px;bottom:10px;color:#9a8e7b;font-size:11px;
  pointer-events:none;letter-spacing:.03em;
}
#map-controls{
  position:absolute;right:12px;bottom:12px;display:flex;gap:4px;z-index:5;
  background:#100d09;border:1px solid var(--rule);padding:3px;
}
#map-controls button{
  min-width:30px;height:28px;border:0;background:transparent;color:#b2a794;
  cursor:pointer;font:11px var(--data);text-transform:uppercase;
}
#map-controls button:hover,#map-controls button[aria-pressed="true"]{background:#241c11;color:var(--paper)}

.band rect{fill:var(--core-top)}
.band line{stroke:#000;stroke-opacity:.10;stroke-width:1}
.band text{fill:#7a6b55;font-size:9.5px;letter-spacing:.12em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.ledger-bg{fill:#0d0a07}
.ledger-rule{stroke:#3a3025;stroke-width:1}
.colhead .sigil{fill:#c08a2e;font-family:var(--data);font-size:11px;font-weight:600;letter-spacing:.06em}
.colhead .cname text{fill:#9d907b;font-family:var(--label);font-size:10.5px;letter-spacing:.09em}
.colhead .tick{stroke:#5a4a35;stroke-width:1}
.colhead:hover .sigil{fill:#f0dcae}
.colhead:hover .cname text{fill:#e8dfcd}
.colhead.on .sigil{fill:#f2c467}
.colhead.on .cname text{fill:#f2e9d7}
.colhead.on .tick{stroke:#c08a2e;stroke-width:2}

line.e-transmission,path.e-transmission{stroke:var(--clay);fill:none}
line.e-convergence,path.e-convergence{stroke:var(--slate);fill:none;stroke-dasharray:5 4}
line.e-refutation,path.e-refutation{stroke:var(--rust);fill:none}
line.e-inversion,path.e-inversion{stroke:var(--plum);fill:none}
path.edge{stroke-width:1.4;stroke-opacity:.5}
path.edge.c-documented{stroke-width:1.9;stroke-opacity:.78}
path.edge.c-probable{stroke-width:1.4;stroke-opacity:.46}
path.edge.c-speculative{stroke-width:1.1;stroke-opacity:.26;stroke-dasharray:2 3}
path.edge.lit{stroke-opacity:1;stroke-width:2.6}
path.edge.dim{stroke-opacity:.06}

g.node{cursor:pointer;outline:none}
g.node .tap-target{fill:transparent;stroke:none;pointer-events:all}
g.node:focus .glyph{stroke:var(--rust);stroke-width:2.4}
g.node:focus text.ttl{display:block!important;fill:#000;font-weight:700}
g.node .glyph{stroke:#6f6045;stroke-width:1.2}
g.node .glyph{fill:var(--ochre)}
g.node text.ttl{fill:#4b4032;font-size:10.5px;pointer-events:none}
g.node:hover text.ttl{fill:#000}
g.node.dim{opacity:.16}
g.node.lit .glyph{stroke:#000;stroke-width:1.8}
g.node.lit text.ttl{fill:#000;font-weight:600}
g.node.sel .glyph{stroke:var(--rust);stroke-width:2.4}





/* ---------------------------------------------------------- panel */
/* An entry in a catalogue, not a stack of cards. Nothing is boxed and nothing
   carries an accent bar. Citations hang off a margin mark that says, in the same
   visual language as the map, what kind of descent this is. */
#panel-body{padding:18px 22px 60px}
.panel-return{
  display:block;border:0;background:transparent;color:#8f826f;padding:0;margin:0 0 18px;
  cursor:pointer;font:10.5px var(--label);letter-spacing:.06em
}
.panel-return:hover{color:#d8cdb8}
.placeholder p{color:#7d715f;font-size:13px;max-width:40ch}
.placeholder strong{color:#a2977f}
.p-kicker{font-family:var(--label);font-size:10.5px;letter-spacing:.2em;text-transform:uppercase;
  color:#9a8e7b;margin-bottom:7px}
.p-title{font-size:22px;line-height:1.22;margin:0 0 5px;color:#f2e9d7;font-weight:600}
.p-meta{color:#8a7c69;font-size:12.5px;margin:0 0 4px}
.p-meta .yr{color:var(--ochre);font-family:var(--data);font-size:12px}
.p-actions{display:flex;align-items:center;gap:10px;min-height:28px;margin:9px 0 2px}
.panel-action{
  border:0;border-bottom:1px solid #6d5124;background:transparent;color:var(--ochre);
  padding:2px 0;cursor:pointer;font:10.5px var(--label);letter-spacing:.08em;text-transform:uppercase
}
.panel-action:hover{color:#f0c46c;border-color:#f0c46c}
.share-feedback{color:#9a8e7b;font:10.5px var(--label);letter-spacing:.05em}
.jump-map{display:none}
.p-note{color:#c3b8a3;font-size:14.5px;line-height:1.62;font-style:italic;margin:16px 0 4px}
.p-note::before{content:"";display:block;width:36px;height:1px;background:#4a3c2b;margin-bottom:12px}
.p-sec{font-family:var(--label);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;
  color:#6d6152;margin:26px 0 4px}

/* cross-reference to a lineage: same sigil the rail and the map use */
.mref{display:grid;grid-template-columns:30px 1fr auto;gap:0 8px;align-items:baseline;
  width:calc(100% + 12px);padding:6px 12px 6px 0;margin:0 -12px 0 0;cursor:pointer;
  border:0;background:transparent;text-align:left;
}
.mref:hover{background:#191410}
.mref .ms{font-family:var(--data);font-size:11px;color:#7d6c4f}
.mref:hover .ms{color:var(--ochre)}
.mref .mn{color:#d8cdb8;font-size:13.5px}
.mref .mr{font-family:var(--label);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#6d6152}

/* a cited descent */
.cite{display:grid;grid-template-columns:30px 1fr;column-gap:10px;
  width:calc(100% + 12px);padding:12px 12px 12px 0;margin-right:-12px;cursor:pointer;
  border:0;background:transparent;text-align:left;color:inherit;
}
.claim + .claim{border-top:1px solid #1e1811}
.cite:hover{background:#191410}
.c-head{grid-column:2;grid-row:1;display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.c-title{color:#e8dfcd;font-size:15px}
.cite:hover .c-title{color:#fff}
.c-year{color:#6d6152;font-family:var(--data);font-size:11px;white-space:nowrap}
.c-mark{grid-column:1;grid-row:2;padding-top:7px}
.c-mark line{stroke-width:2.4;stroke-opacity:.95}
.c-meta{grid-column:2;grid-row:2;font-family:var(--label);font-size:10.5px;letter-spacing:.14em;
  text-transform:uppercase;padding-top:3px}
.c-ev{grid-column:2;grid-row:3;color:#8a7c69;font-size:12.5px;line-height:1.55;
  font-style:italic;margin-top:5px}

/* the chain of a lineage, read as an index */
.chain-row{display:grid;grid-template-columns:56px 1fr auto;gap:0 10px;align-items:baseline;
  width:calc(100% + 12px);padding:6px 12px 6px 0;margin-right:-12px;cursor:pointer;
  border:0;background:transparent;text-align:left;
}
.chain-row + .chain-row{border-top:1px solid #191410}
.chain-row:hover{background:#191410}
.chain-row .cy{font-family:var(--data);font-size:11px;color:#6d6152;text-align:right}
.chain-row:hover .cy{color:var(--ochre)}
.chain-row .ct{color:#d8cdb8;font-size:13.5px}
.chain-row .cr{font-family:var(--label);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#5c5244}
.none{color:#5c5244;font-size:12.5px;font-style:italic;margin:6px 0 0}
#panel::-webkit-scrollbar,#rail::-webkit-scrollbar{width:8px}
#panel::-webkit-scrollbar-thumb,#rail::-webkit-scrollbar-thumb{background:#2c2419}
.colhead.on text{fill:var(--ochre);font-weight:700}
g.node .glyph{paint-order:stroke}

/* ------------------------------------------------ one work, several lineages */
/* The echo is the same work seen from another lineage. It stays quiet until
   that lineage is the one you are reading. */
g.node.echo .glyph{fill:none;stroke:#a08a63;stroke-width:1.1;opacity:.7}
g.node.echo text.ttl{display:none}
g.node.echo.in-focus text.ttl,
g.node.echo.lit text.ttl{display:block}
g.node.echo.in-focus .glyph,
g.node.echo.lit .glyph{fill:#c9bca4;opacity:1;stroke-width:1.4}
g.node.home.in-focus text{display:block}
path.tie{fill:none;stroke:#6b5c43;stroke-width:1;stroke-opacity:.16;stroke-dasharray:1 3}
path.tie.lit{stroke:#c08a2e;stroke-opacity:.45;stroke-dasharray:none;stroke-width:1}
path.tie.dim{stroke-opacity:.05}

/* ------------------------------------------------ channel and survey */
.tag.via{color:#7f8f9c}
.tag.via::before{content:"via "}

/* ------------------------------------------------ how a claim can be checked */
/* how a connection reads: the relationship in words, then how it is known */
.c-meta{grid-column:2;grid-row:2;padding-top:3px;display:flex;align-items:baseline;
  gap:0 8px;flex-wrap:wrap;font-family:var(--label);font-size:11px;letter-spacing:.1em;
  text-transform:uppercase}
.c-meta .rel.transmission{color:var(--clay)}
.c-meta .rel.convergence{color:var(--slate)}
.c-meta .rel.refutation{color:var(--rust)}
.c-meta .rel.inversion{color:#a06d86}
.c-meta .sure,.c-meta .chan{color:#9a8e7b}
.c-meta .sure::before,.c-meta .chan::before{content:"· ";color:#4a3f31;margin-right:6px}
.c-how{grid-column:2;display:flex;align-items:baseline;gap:9px;margin-top:7px;flex-wrap:wrap}
.hk{font-family:var(--label);font-size:9.5px;letter-spacing:.14em;text-transform:uppercase;
  color:#14100c;background:#6b5c43;padding:1px 7px;white-space:nowrap}
.hk.h-paratext,.hk.h-authorial{background:#9a7a3a}
.hk.h-documentary{background:#7f8f9c;color:#0d1113}
.hk.h-scholarly{background:#5f6b74;color:#0d1113}
.hk.h-structural{background:#4b4234;color:#c9bca4}
.c-how .source-kind{color:#c3b8a3;font-family:var(--label);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase}
.c-how .src{color:#9a8e7b;font-size:12px;font-style:italic}
.claim-test{margin:0 0 10px 40px;color:#9a8e7b;font-size:11.5px}
.claim-test summary{cursor:pointer;color:#b2a794}
.claim-test p{margin:6px 0 0;line-height:1.55}
.claim-test a{color:var(--ochre)}

#briefs 
/* ------------------------------------------------ the line further back */
.p-behind{margin:20px 0 0;padding-top:14px;border-top:1px solid #241d15}
.pb-head{font-family:var(--label);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;
  color:#6d6152;margin-bottom:10px}
.pb-step{display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  width:100%;padding:3px 0;cursor:pointer;position:relative;border:0;background:transparent;text-align:left}
.pb-step:hover .pb-t{color:#fff}
.pb-step::before{content:"";position:absolute;left:-8px;top:0;bottom:0;width:1px;background:#2c2419}
.pb-step:first-child::before{top:9px}
.pb-step:last-child::before{bottom:auto;height:9px}
.pb-t{color:#b2a794;font-size:13px}
.pb-y{color:#5c5244;font-family:var(--data);font-size:10.5px;white-space:nowrap}
.pb-note{color:#9a8e7b;font-size:11.5px;font-style:italic;margin:10px 0 0}

/* ------------------------------------------------ legend */
.lg-sub{font-size:11px;font-style:italic;color:#9a8e7b;margin:15px 0 6px;line-height:1.35}
#legend .lg-sub:first-child{margin-top:2px}
.lg{align-items:center}

/* arriving at a mark you were sent to */
@keyframes ping{from{r:5;stroke-opacity:.9}to{r:30;stroke-opacity:0}}
g.node .ping{fill:none;stroke:var(--rust);stroke-width:1.6;pointer-events:none;
  animation:ping .85s cubic-bezier(.2,.7,.3,1) forwards}
@media (prefers-reduced-motion:reduce){g.node .ping{animation-duration:.01ms}}

/* ------------------------------------------------ the finder */
.findwrap{position:relative}
#ac{
  position:absolute;top:calc(100% + 5px);left:0;right:0;z-index:40;
  background:#0d0a07;border:1px solid var(--rule);box-shadow:0 14px 34px rgba(0,0,0,.55);
  max-height:340px;overflow-y:auto;
}
.ac-row{
  display:grid;grid-template-columns:0 1fr;gap:0;align-items:baseline;
  padding:8px 13px;cursor:pointer;
}
.ac-row + .ac-row{border-top:1px solid #191410}
.ac-row.on{background:#1c1610}
#ac.has-sigil .ac-row{grid-template-columns:26px 1fr;gap:0 8px}
.ac-k{font-family:var(--data);font-size:10.5px;color:#7d6c4f;line-height:1.5}
.ac-row.on .ac-k{color:var(--ochre)}
.ac-t{color:#d8cdb8;font-size:13.5px;line-height:1.35}
.ac-row.on .ac-t{color:#fff}
.ac-s{grid-column:2;color:#6d6152;font-size:11px;font-style:italic;margin-top:2px}

/* ------------------------------------------------ the opening */
.o-lead{font-size:21px;line-height:1.3;margin:2px 0 10px;color:#f2e9d7;font-weight:600}
.o-sub{color:#a2977f;font-size:14px;line-height:1.6;margin:0}
.o-p{color:#8a7c69;font-size:13px;line-height:1.65;margin:0 0 9px;max-width:44ch}
.door{
  display:flex;align-items:baseline;justify-content:space-between;gap:12px;
  width:calc(100% + 12px);padding:9px 12px 9px 0;margin-right:-12px;cursor:pointer;
  border:0;background:transparent;text-align:left;
}
.door + .door{border-top:1px solid #1e1811}
.door:hover{background:#191410}
.d-t{color:#d8cdb8;font-size:14px}
.door:hover .d-t{color:#fff}
.d-w{color:#9a8e7b;font-size:11.5px;font-style:italic;text-align:right;flex:0 1 auto}
.o-foot{color:#9a8e7b;font-size:12.5px;line-height:1.6;margin:22px 0 0;
  padding-top:14px;border-top:1px solid #241d15}
.o-foot b{color:var(--ochre);font-family:var(--data);font-weight:400}
.o-p b{color:#c3b8a3;font-weight:600}
.text-action{border:0;background:transparent;color:var(--ochre);padding:0;cursor:pointer;text-decoration:underline}

/* selection: a highlighter on the page rather than the browser's blue, and it
   carries its own text colour so it reads on the dark chrome and the parchment */
::selection{background:var(--ochre);color:#191308}
::-moz-selection{background:var(--ochre);color:#191308}

/* the sheet */
g.paper{pointer-events:none}
g.paper .p-mottle{mix-blend-mode:multiply;opacity:.17}
g.paper .p-grain{mix-blend-mode:multiply}
g.paper .p-vig{mix-blend-mode:multiply}

/* legend rows as controls */
.lg[data-f]{cursor:pointer;border-radius:1px;transition:background .12s linear}
.lg[data-f]{margin:1px -8px;padding:4px 8px}
.lg[data-f]:hover{background:#1c1610}
.lg[data-f]:focus-visible{outline:1px solid var(--ochre);outline-offset:0}
.lg[data-f].on{background:#241c11}
.lg[data-f].on > span{color:#f2e9d7}
#hint.counting{color:var(--ochre)}
#hint .dim{color:#9a8e7b}

/* list and methodology views */
.story-index{display:grid;gap:0}
.story-row{
  display:grid;grid-template-columns:58px 1fr;gap:0 12px;width:100%;padding:8px 4px;
  border:0;border-bottom:1px solid #211a13;background:transparent;text-align:left;cursor:pointer;
}
.story-row:hover{background:#191410}
.story-row .sy{font:11px var(--data);color:#9a8e7b;text-align:right}
.story-row .st{color:#d8cdb8}
.story-row .sm{grid-column:2;color:#9a8e7b;font-size:11px}
.method-stat{display:grid;grid-template-columns:72px 1fr;gap:10px;padding:6px 0;border-bottom:1px solid #211a13}
.method-stat b{font:16px var(--data);color:var(--ochre)}
.method-stat span{color:#b2a794}
.method-note{color:#a2977f;line-height:1.65}

body.list-mode #stage{display:none}
body.list-mode #panel{flex:1;width:auto}

@media (max-width: 900px){
  html,body{width:100%;height:100%;min-height:100%;overflow:hidden}
  body{overscroll-behavior:none}

  #top{
    position:relative;z-index:80;height:104px;display:flex;flex-wrap:wrap;
    align-content:center;gap:6px;padding:7px 12px;background:#17120d
  }
  .brand{width:100%;height:38px;display:flex;align-items:center;min-width:0;overflow:hidden}
  .mark{width:18px;height:32px}
  h1{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sub{display:none}
  .tools{width:100%;height:42px;margin:0;display:block}
  .findwrap{width:100%;height:100%}
  #search{width:100%;height:100%;padding:9px 12px;font-size:16px;border-color:#3a3025}
  #about,#reset{display:none}
  #ac{
    position:fixed;top:100px;left:8px;right:8px;max-height:calc(100dvh - 170px);
    border-color:#4a3c2b
  }
  .ac-row{min-height:48px;padding:10px 13px}

  main{
    display:block;position:relative;width:100%;
    height:calc(100vh - 162px);height:calc(100dvh - 162px - env(safe-area-inset-bottom))
  }
  #stage{position:relative;width:100%;height:100%;min-width:0;overflow:hidden}
  #canvas-wrap{inset:0}
  #canvas{touch-action:none}

  #mobile-nav{
    position:fixed;z-index:90;left:0;right:0;bottom:0;
    height:calc(58px + env(safe-area-inset-bottom));
    display:grid;grid-template-columns:repeat(3,1fr);
    padding:5px 8px calc(5px + env(safe-area-inset-bottom));
    background:rgba(15,12,8,.98);border-top:1px solid #3a3025
  }
  #mobile-nav button{
    border:0;background:transparent;color:#8f826f;min-height:46px;
    font:11px var(--label);letter-spacing:.12em;text-transform:uppercase
  }
  #mobile-nav button[aria-pressed="true"]{color:#f2e9d7;background:#241c11}

  #panel,#rail{
    display:none;position:fixed;left:0;right:0;width:100%;height:auto;z-index:70;
    overflow-y:auto;-webkit-overflow-scrolling:touch;
    background:#161109
  }
  #panel{
    top:24vh;top:24dvh;bottom:calc(58px + env(safe-area-inset-bottom));
    border:1px solid #3a3025;border-bottom:0;
    border-radius:16px 16px 0 0;box-shadow:0 -14px 42px rgba(0,0,0,.62)
  }
  #rail{top:104px;bottom:calc(58px + env(safe-area-inset-bottom));border:0}
  body.mobile-panel #panel,body.mobile-rail #rail{
    display:block
  }
  body.mobile-panel #stage::after,body.mobile-rail #stage::after{
    content:"";position:absolute;inset:0;background:rgba(0,0,0,.34);pointer-events:none
  }
  #panel-mobile-bar,#rail-mobile-bar{
    position:sticky;top:0;z-index:4;display:flex;align-items:center;
    justify-content:space-between;min-height:48px;padding:7px 14px;
    background:rgba(22,17,9,.98);border-bottom:1px solid #2b241c;
    color:#9a8e7b;font:10.5px var(--label);letter-spacing:.14em;text-transform:uppercase
  }
  #panel-mobile-bar::before{
    content:"";position:absolute;left:50%;top:6px;width:38px;height:3px;
    transform:translateX(-50%);border-radius:3px;background:#4b4032
  }
  #panel-mobile-bar button,#rail-mobile-bar button{
    border:0;background:transparent;color:var(--ochre);min-height:44px;padding:4px 2px 4px 12px;
    font:11px var(--label);letter-spacing:.06em
  }
  #panel-body{padding:18px 18px calc(34px + env(safe-area-inset-bottom))}
  #rail .rail-head{display:none}
  #rail .rail-gloss{padding-top:14px}
  .motif{min-height:48px;padding:10px 18px;font-size:15px}
  #guide > summary{min-height:48px;padding:15px 18px}
  #legend{padding-left:18px;padding-right:18px}
  .lg[data-f]{min-height:44px}

  #mobile-welcome{
    position:absolute;z-index:6;left:12px;right:12px;bottom:58px;
    display:block;padding:14px 15px;background:rgba(20,16,12,.94);
    border:1px solid #493a29;box-shadow:0 10px 30px rgba(0,0,0,.38)
  }
  body.has-selection #mobile-welcome{display:none}
  #mobile-welcome strong{display:block;color:#f2e9d7;font-size:17px;margin-bottom:3px}
  #mobile-welcome > span{display:block;color:#a2977f;font-size:13px}
  #mobile-welcome > div{display:flex;gap:8px;margin-top:11px}
  #mobile-welcome button{
    min-height:42px;border:1px solid #5b472e;background:#211910;color:#d8cdb8;
    padding:8px 12px;font:11px var(--label);letter-spacing:.07em;text-transform:uppercase
  }
  #mobile-welcome button:first-child{background:#8a5c20;border-color:#b77e2a;color:#fff6e4}

  #map-controls{right:10px;bottom:10px;padding:3px}
  #map-controls button{min-width:42px;height:42px;font-size:12px}
  #hint{
    left:12px;right:196px;bottom:17px;white-space:nowrap;overflow:hidden;
    text-overflow:ellipsis;font-size:10px
  }
  .jump-map{display:none}
  .p-title{font-size:25px}
  .p-actions{min-height:44px;margin-top:7px}
  .panel-action{min-height:44px;padding:10px 0}
  .p-note{font-size:15px}
  .p-sec{margin-top:24px}
  .mref{min-height:48px;padding-top:10px;padding-bottom:10px}
  .cite{min-height:68px;padding-top:14px;padding-bottom:14px}
  .c-ev,.c-how{display:none}
  .desktop-copy{display:none}
  .mobile-copy{display:inline}
  .mobile-only{display:block}
  .claim-test summary{display:flex;align-items:center;min-height:44px}
  .chain-row{min-height:48px;padding-top:10px;padding-bottom:10px}
  .story-row{min-height:56px;padding-top:10px;padding-bottom:10px}
  .claim-test{margin-left:40px}
  .panel-return{min-height:44px;margin-bottom:10px}
  .d-w{display:none}

  body.list-mode #stage{display:block}
  body.list-mode #panel{width:100%;flex:none}
}

@media (max-width: 380px){
  h1{font-size:16px}
  #mobile-welcome > div{display:grid;grid-template-columns:1fr 1fr}
  .c-head{display:grid}
  .c-year{margin-top:2px}
}
