/* timeline page: a dark room with the white chart lit in the middle */
html,body.tl{height:100%}
body.tl{background:var(--night);color:var(--on-night);overflow:hidden;display:flex;flex-direction:column;font-family:var(--sans);font-size:1rem;line-height:1.35}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.bar{display:flex;align-items:center;gap:.8rem;padding:.55rem .8rem;background:var(--night);border-bottom:1px solid #2a3a63;flex:none;position:relative;z-index:20}
.home{display:flex;align-items:center;gap:.6rem;text-decoration:none;font-family:var(--serif);font-size:1.12rem;line-height:1.1;flex:none}
.home img{width:88px;height:auto;flex:none;display:block}
@media (max-width:1080px){.home span{display:none}}

.search{position:relative;display:flex;align-items:center;gap:.3rem;flex:1;min-width:0;max-width:640px}
.search input{flex:1;min-width:0;font:inherit;font-size:1.05rem;padding:.7rem .9rem;border-radius:4px;border:2px solid #3a4c7c;background:#fff;color:var(--ink)}
.search input:focus{border-color:var(--gold);outline:none}
.count{font-size:.9rem;color:var(--on-night-soft);white-space:nowrap;min-width:4.2rem;text-align:right}
@media (max-width:620px){.count{display:none}}

.ib,.tb{font:inherit;font-weight:700;color:var(--on-night);background:var(--dusk);border:1px solid #3a4c7c;border-radius:4px;cursor:pointer}
.ib{width:2.7rem;height:2.7rem;font-size:1.5rem;line-height:1;flex:none}
.tb{padding:.62rem .9rem;white-space:nowrap}
a.tb{text-decoration:none;display:inline-block;line-height:normal}
.ib:hover:not(:disabled),.tb:hover{background:#2a3f72}
.ib:disabled{opacity:.35;cursor:default}
.tools{display:flex;gap:.5rem;align-items:center;margin-left:auto;flex:none}
.tools select{font:inherit;color:var(--on-night);background:var(--dusk);border:1px solid #3a4c7c;border-radius:4px;padding:.62rem .5rem;max-width:11.5rem}
@media (max-width:860px){#share{display:none}}
@media (max-width:620px){#present{display:none}.tools select{max-width:7.2rem}}

.results{position:absolute;top:calc(100% + 6px);left:0;right:0;margin:0;padding:.3rem;list-style:none;background:#fff;color:var(--ink);
  border-radius:6px;box-shadow:0 18px 40px rgba(0,0,0,.5);max-height:min(60vh,27rem);overflow:auto;z-index:30}
.results li{padding:.55rem .7rem;border-radius:4px;cursor:pointer;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.1rem .8rem;align-items:baseline}
.results li[aria-selected="true"],.results li:hover{background:#e7ecf8}
.results .t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.results .t b{background:#ffe48a;font-weight:700}
.results .k{font-size:.8rem;color:var(--ink-soft);white-space:nowrap}
.results .lm .t{font-weight:700}
.results .none{cursor:default;display:block;color:var(--ink-soft)}
.results .none:hover{background:none}
.results .sw{display:inline-block;width:1.1rem;height:4px;border-radius:2px;vertical-align:middle;margin-right:.35rem}

.rows{display:flex;gap:.4rem;padding:.45rem .8rem;background:#0b152a;overflow-x:auto;flex:none;scrollbar-width:thin}
.rows button{font:inherit;font-size:.92rem;color:var(--on-night);background:transparent;border:1px solid #2f406b;border-radius:99px;padding:.34rem .8rem .34rem .6rem;white-space:nowrap;cursor:pointer;display:flex;align-items:center;gap:.45rem}
.rows button:hover{background:var(--dusk)}
.rows button[aria-pressed="true"]{background:var(--dusk);border-color:var(--gold)}
.rows i{width:1.5rem;height:5px;border-radius:3px;box-shadow:0 0 0 1px rgba(255,255,255,.35)}
.rows .lab{font-size:.85rem;color:var(--on-night-soft);align-self:center;white-space:nowrap;padding-right:.2rem}

.viewer{flex:1;min-height:0;background:#0b152a;position:relative}
.viewer .openseadragon-canvas:focus{outline:none}

.hit{border:4px solid #ff2fb0;border-radius:6px;box-shadow:0 0 0 6px rgba(255,47,176,.25);pointer-events:none;animation:pulse 1.1s ease-out 2}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255,47,176,.7)}100%{box-shadow:0 0 0 26px rgba(255,47,176,0)}}

.dock{position:absolute;left:.8rem;right:.8rem;bottom:calc(.8rem + env(safe-area-inset-bottom));display:flex;align-items:flex-end;justify-content:space-between;gap:.8rem;pointer-events:none;z-index:10}
.dock>*{pointer-events:auto}
.mini-wrap{width:min(520px,58vw);aspect-ratio:20000/3479;background:#fff;border:2px solid #3a4c7c;border-radius:4px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,.5)}
.mini{width:100%;height:100%}
.zoom{display:flex;gap:.35rem;align-items:center}
@media (max-width:620px){#fit{display:none}}

.toast{position:absolute;left:50%;width:max-content;max-width:calc(100vw - 2rem);text-align:center;bottom:6.5rem;transform:translateX(-50%);background:var(--night);color:#fff;border:2px solid var(--gold);padding:.6rem 1rem;border-radius:4px;font-weight:700;opacity:0;transition:opacity .2s;pointer-events:none;z-index:40}
.toast.on{opacity:1}
.exit{position:absolute;top:.6rem;right:.6rem;z-index:50;font:inherit;font-weight:700;color:#fff;background:rgba(15,27,51,.85);border:1px solid #6b7aa6;border-radius:4px;padding:.5rem .8rem;cursor:pointer;opacity:.25}
.exit:hover,.exit:focus-visible{opacity:1}
body.presenting .bar,body.presenting .rows,body.presenting .dock{display:none}

/* phones: the search box gets a row of its own */
@media (max-width:620px){
  .bar{flex-wrap:wrap;row-gap:.5rem}
  .search{order:3;flex:1 0 100%;max-width:none}
  .tools{margin-left:auto}
  .tools select{max-width:none}
  .rows .lab{display:none}
}

.tb.gold{background:var(--gold);color:#1a1300;border-color:var(--gold)}
.tb.gold:hover{background:#ffd040}
@media (max-width:1180px){#share{display:none}}

/* the verse panel: a drawer on the right, a sheet from the bottom on phones */
.verse{position:absolute;top:7.2rem;right:.8rem;bottom:1rem;width:min(24rem,92vw);background:#fffdf7;color:var(--ink);border-radius:8px;
  box-shadow:0 20px 50px rgba(0,0,0,.55);z-index:25;display:flex;flex-direction:column;overflow:hidden}
.verse[hidden]{display:none}
.vhead,.thead{display:flex;align-items:center;justify-content:space-between;padding:.45rem .5rem .45rem 1rem;font-size:.9rem;font-weight:700}
.vhead{background:var(--night);color:var(--on-night)}
.vhead .ib,.thead .ib{width:2.3rem;height:2.3rem;font-size:1.4rem}
.vbody{padding:.4rem 1.1rem 1.2rem;overflow:auto;font-family:var(--serif);font-size:1.22rem;line-height:1.5}
.vbody h3{font-family:var(--sans);font-size:1rem;font-weight:700;margin:1.1rem 0 .3rem;color:var(--gold-deep)}
.vbody p{margin:0 0 .55em}
.vbody sup{font-family:var(--sans);font-size:.62em;color:var(--ink-soft);margin-right:.15em}
.vbody .more{font-family:var(--sans);font-size:.9rem;color:var(--ink-soft)}
@media (max-width:700px){.verse{top:auto;left:.5rem;right:.5rem;bottom:calc(.5rem + env(safe-area-inset-bottom));width:auto;max-height:46vh}}

/* the guided tour card */
.tour{position:absolute;left:.8rem;bottom:calc(.8rem + env(safe-area-inset-bottom));width:min(30rem,calc(100vw - 1.6rem));background:var(--night);color:var(--on-night);
  border:2px solid var(--gold);border-radius:8px;box-shadow:0 20px 50px rgba(0,0,0,.6);z-index:26;padding:0 1.1rem 1rem}
.tour[hidden]{display:none}
.tour .thead{padding:.4rem 0 0;color:var(--on-night-soft)}
.tour h2{font-family:var(--serif);font-size:1.7rem;margin:.1rem 0 .4rem}
.tour p{font-family:var(--serif);font-size:1.18rem;line-height:1.45;margin:0 0 .9rem;max-width:none}
.tnav{display:flex;gap:.5rem;justify-content:flex-end}
.tnav .tb:disabled{opacity:.35;cursor:default}
body.touring .dock{display:none}
body.presenting.touring .tour{display:block}
@media (max-width:700px){.tour h2{font-size:1.35rem}.tour p{font-size:1.05rem}}

@media (max-width:620px){
  .tools{flex:1;min-width:0;margin-left:0}
  .tools #tourbtn{order:-1;flex:none}
  .tools select{flex:1;min-width:0;width:100%;max-width:none}
}
a.tb{text-decoration:none;display:inline-block;line-height:1.2}
@media (max-width:1320px){#download{display:none}}

/* shown only when the chart cannot be displayed (see chartProblem in timeline.js) */
.chart-msg{position:absolute;inset:0;margin:auto;height:fit-content;max-width:34rem;padding:1.4rem 1.6rem;background:#fffaf0;color:#1b1b1b;border:2px solid #b3261e;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.35);z-index:50;font-family:var(--sans, system-ui, sans-serif);line-height:1.45}
.chart-msg h2{margin:0 0 .5rem;font-size:1.25rem;color:#8a1c14}
.chart-msg p{margin:.4rem 0}.chart-msg .small{font-size:.9rem;color:#555}.chart-msg code{background:#f1e7d0;padding:0 .25rem;border-radius:3px}

/* the keyboard keys, moved here from the home page: a small panel that opens from the "Keys" button (not shown on phones) */
.keys-help{position:relative}
.keys-help>summary{list-style:none;cursor:pointer}
.keys-help>summary::-webkit-details-marker{display:none}
.keys-pop{position:absolute;right:0;bottom:calc(100% + .55rem);width:19rem;background:#fffaf0;color:#1b1b1b;border-radius:8px;padding:.85rem 1rem;box-shadow:0 12px 30px rgba(0,0,0,.4);font-family:var(--sans);font-size:.92rem;line-height:1.75;z-index:40}
.keys-pop kbd{display:inline-block;min-width:1.5em;text-align:center;padding:0 .35em;border:1px solid #b9a67e;border-bottom-width:2px;border-radius:4px;background:#fff;font-family:inherit;font-size:.85em;line-height:1.45}
@media (pointer:coarse),(max-width:760px){.keys-help{display:none}}
