/* The public timeline. A broadside over a timetable: the page is one fixed sheet on wide screens. */

/* Rows: masthead, filters, stage (as tall as its lanes, but it yields first), divider, readout (never under 300px). */
body.site { height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, auto) auto minmax(300px, 1fr); overflow: hidden; }

/* ---- masthead ---- */
.mast { display: flex; align-items: flex-end; gap: 18px; padding: 10px 18px 7px; border-bottom: 4px double var(--ink); }
.mast h1 { font: 900 50px/0.8 var(--display); letter-spacing: -0.005em; text-transform: uppercase; }
.mast-sub { font-size: 15px; font-style: italic; padding-bottom: 1px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mast-sub span { font-style: normal; color: var(--ink-2); }
.mast-side { display: flex; gap: 18px; padding-bottom: 3px; white-space: nowrap; }
.mast-side b { color: var(--spot); }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; padding: 6px 18px; border-bottom: 1px solid var(--ink); }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; }
.fgroup:last-child { margin-left: auto; }
.flabel { font: 11px var(--mono); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.tog { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 2px 0; cursor: pointer;
  font: 700 14px/1 var(--display); letter-spacing: 0.07em; text-transform: uppercase; }
.tog[aria-pressed="false"] { color: var(--ink-2); opacity: 0.55; text-decoration: line-through; }
.tog:hover { color: var(--spot); }
.tog .ico { color: var(--ink); }
.swatch { width: 14px; height: 4px; display: inline-block; }
.filters select, .filters input { background: transparent; border: 0; border-bottom: 1px solid var(--ink); padding: 2px 2px 3px; font: 13px var(--mono); }
.filters input { width: 220px; }
.filters input::placeholder { color: var(--ink-2); }

/* ---- stage ---- */
.stage { position: relative; display: flex; flex-direction: column; min-height: 0; user-select: none; -webkit-user-select: none; }
#chart, #mini { display: block; width: 100%; flex: none; }
#chart, #lanes { cursor: ew-resize; touch-action: pan-y; }
#lanes { display: block; }
.lanesbox { flex: 0 1 auto; min-height: 0; max-height: var(--lanes-max, none); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.divider { height: 9px; background: var(--paper-2); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); cursor: row-resize; touch-action: none; position: relative; }
.divider::after { content: ""; position: absolute; left: 50%; top: 2px; width: 44px; margin-left: -22px; height: 2px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.divider:hover, .divider:focus-visible { background: var(--ink); }
.divider:hover::after, .divider:focus-visible::after { border-color: var(--paper); }
#mini { border-top: 1px solid var(--ink); cursor: grab; touch-action: none; }
.fatal { padding: 40px 18px; font-size: 18px; font-style: italic; }

.p-ink { stroke: var(--ink); }
.band { fill: var(--paper); stroke: var(--ink); stroke-width: 1; cursor: zoom-in; }
.band-dark { fill: var(--ink); }
.t-band { font: 700 12.5px var(--display); letter-spacing: 0.09em; text-transform: uppercase; fill: var(--ink); pointer-events: none; }
.t-band.inv { fill: var(--paper); }
.earth { fill: url(#hatch); opacity: 0.5; }
.step { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: miter; }
.t-floor { font: 800 13px var(--display); letter-spacing: 0.09em; text-transform: uppercase; fill: var(--ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 3px; pointer-events: none; }
.t-floorname { font: italic 400 12.5px var(--serif); letter-spacing: 0; text-transform: none; }
.zoomhit { fill: transparent; cursor: zoom-in; }
.rule { stroke: var(--ink); stroke-width: 1; }
.rule.heavy { stroke-width: 2; }
.tick { stroke: var(--ink); stroke-width: 1; }
.guide { stroke: var(--ink); stroke-opacity: 0.13; }
.hair { stroke: var(--ink); stroke-opacity: 0.4; stroke-dasharray: 1 4; }
.leader { stroke: var(--ink); stroke-opacity: 0.55; }
.t-tick { font: 11px var(--mono); fill: var(--ink); }
.t-lane { font: 800 14px var(--display); letter-spacing: 0.12em; text-transform: uppercase; fill: var(--ink); }
.t-name { font: 900 21px var(--display); letter-spacing: 0.01em; text-transform: uppercase; }
.t-lv { font: 600 11px var(--mono); fill: var(--ink); }
.t-track { font: 9px var(--mono); fill: var(--ink-2); text-anchor: end; text-transform: uppercase; letter-spacing: 0.04em; }
.t-track.left { text-anchor: start; }
.t-step { font: 9px var(--mono); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 2.5px; }
.t-evt { font: 12px var(--serif); fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 3.5px; stroke-linejoin: round; pointer-events: none; }
.lvline { fill: none; stroke-width: 1.8; }
.lvarea { opacity: 0.12; }

.mark { cursor: pointer; }
.mark .hit { fill: transparent; }
.g-ink { fill: var(--ink); stroke: var(--ink); stroke-width: 1; }
.g-paper { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.g-line { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.g-hollow { fill: var(--paper); stroke-width: 1.4; }
.g-stroke { fill: none; stroke-width: 2.2; }
.g-flag { stroke-width: 1.4; stroke-linejoin: miter; }
.mark:hover .shape, .mark.sel .shape { stroke: var(--spot); stroke-width: 2.4; }
.ico { flex: none; overflow: visible; }
.ico .mark { cursor: inherit; }

.ph { pointer-events: none; }
.ph line { stroke: var(--spot); stroke-width: 1.6; }
.ph rect { fill: var(--spot); }
.ph text { font: 800 13px var(--display); letter-spacing: 0.1em; text-transform: uppercase; fill: var(--paper); }
.density { stroke: var(--ink); stroke-opacity: 0.5; }
.window { fill: url(#hatch-light); stroke: var(--ink); stroke-width: 1.5; }
.miniph { stroke: var(--spot); stroke-width: 1.6; }
.tip { position: absolute; z-index: 3; pointer-events: none; background: var(--ink); color: var(--paper); font: 11.5px var(--mono); padding: 3px 7px; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; }

/* ---- readout ---- */
.readout { display: grid; grid-template: auto minmax(0, 1fr) / minmax(300px, 31%) minmax(0, 1fr); min-height: 0; }
.now { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 16px; padding: 5px 18px 4px; border-bottom: 1px solid var(--ink); }
.now-day { font: 900 34px/1 var(--display); text-transform: uppercase; letter-spacing: 0.01em; color: var(--spot); min-width: 4.2ch; white-space: nowrap; }
.now-where { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.now-where b { font: 800 17px var(--display); letter-spacing: 0.08em; text-transform: uppercase; }
.now-where span { font-style: italic; }
.now-where .now-book { font-style: normal; color: var(--ink-2); }
.tools { display: flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.toolsep { width: 1px; height: 12px; background: var(--ink); align-self: center; }

.log { position: relative; overflow-y: auto; border-right: 1px solid var(--ink); scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.dayhead { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; background: var(--paper); padding: 5px 14px 3px 18px;
  border-bottom: 1px solid var(--ink); font: 800 13px var(--display); letter-spacing: 0.12em; text-transform: uppercase; }
.dayhead-floor { color: var(--ink-2); font-weight: 600; }
.entry { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 0 8px; padding: 7px 14px 8px 18px; border-bottom: 1px dotted var(--rule); border-left: 4px solid transparent; cursor: pointer; }
.entry .ico { margin-top: 3px; }
.entry h3 { font: 400 15px/1.3 var(--serif); }
.entry.major h3 { font-weight: 700; font-size: 16px; }
.entry p { font-size: 14px; line-height: 1.4; margin-top: 2px; }
.entry .meta { font: 10.5px/1.5 var(--mono); color: var(--ink-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 0 12px; }
.entry .meta .approx { color: var(--spot); }
.entry.future { opacity: 0.42; }
.entry:hover { background: var(--paper-2); opacity: 1; }
.entry.cur { border-left-color: var(--spot); background: var(--paper-2); opacity: 1; }
.empty, .absent { font-style: italic; color: var(--ink-2); }
.loglist .empty { padding: 16px 18px; }

.sheets { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); overflow-x: auto; overflow-y: hidden; min-height: 0; }
.sheet { --c: var(--ink); overflow-y: auto; min-height: 0; padding: 10px 18px 28px; border-right: 1px solid var(--ink); scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.sheet:last-child { border-right: 0; }
.sheet > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 3px solid var(--c); padding-bottom: 3px; }
.sheet h2 { font: 900 38px/0.86 var(--display); text-transform: uppercase; color: var(--c); }
.lv { text-align: right; white-space: nowrap; }
.lv span { font: 11px var(--mono); text-transform: uppercase; color: var(--ink-2); margin-right: 6px; }
.lv b { font: 900 38px/0.86 var(--display); }
.ident { font-size: 16px; font-style: italic; margin-top: 5px; }
.status { font: 12px var(--mono); margin-top: 2px; }
.summary { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.absent { margin-top: 10px; }
.absent.pad { padding: 14px 18px; }

.stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; padding: 6px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.stats div { display: flex; align-items: baseline; gap: 6px; }
.stats dt { font: 700 12px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.stats dd { font: 600 14px var(--mono); }
.stats .is-fresh dd { color: var(--spot); }

.block { margin-top: 16px; }
.block > h3 { display: flex; justify-content: space-between; align-items: baseline; font: 800 14px var(--display); letter-spacing: 0.14em; text-transform: uppercase; border-bottom: 2px solid var(--ink); padding-bottom: 1px; }
.count { font: 11px var(--mono); letter-spacing: 0; color: var(--ink-2); }
.row { border-bottom: 1px solid var(--rule); }
.row > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 0 10px; padding: 4px 0; cursor: pointer; list-style: none; font-size: 15px; }
.row > summary::-webkit-details-marker { display: none; }
.row > summary:hover .nm { color: var(--spot); }
.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm::before { content: "+"; font: 12px var(--mono); color: var(--ink-2); display: inline-block; width: 13px; }
.row[open] > summary .nm::before { content: "\2212"; }
.row[open] > summary .nm { font-weight: 700; white-space: normal; }
.val { font: 600 13px var(--mono); min-width: 2.2ch; text-align: right; }
.kind { font: 10.5px var(--mono); color: var(--ink-2); text-transform: uppercase; }
.fresh { font: 700 11px var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--spot); white-space: nowrap; }
.pips { display: inline-flex; gap: 1px; }
.pips i { width: 5px; height: 10px; border: 1px solid var(--ink); }
.pips i.on { background: var(--c); border-color: var(--c); }
.pips i:nth-child(5n):not(:last-child) { margin-right: 3px; }
.more { padding: 2px 0 9px 13px; font-size: 14px; line-height: 1.42; }
.more p + p, .more ul { margin-top: 5px; }
.tiers li { display: grid; grid-template-columns: 44px minmax(0, 1fr); color: var(--ink-2); padding: 1px 0; }
.tiers li.reached { color: var(--ink); }
.tier-lv { font: 11px/1.8 var(--mono); }
.tiers li.reached .tier-lv { font-weight: 600; color: var(--c); }
.since { font: 10.5px var(--mono); color: var(--ink-2); }
.blockrow { border-bottom: 2px solid var(--ink); }
.blockish { font: 800 14px var(--display); letter-spacing: 0.14em; text-transform: uppercase; }
.achievements li { padding: 3px 0; border-bottom: 1px dotted var(--rule); }

/* ---- dialogs ---- */
.sheetdlg { border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 22px 26px 20px; width: min(600px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); }
.sheetdlg::backdrop { background: rgba(27, 24, 20, 0.62); }
.sheetdlg h2 { font: 900 40px/0.9 var(--display); text-transform: uppercase; margin-bottom: 8px; }
.sheetdlg p { margin-bottom: 10px; }
.booklist { border-top: 2px solid var(--ink); margin-top: 14px; }
.bookbtn { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 8px 6px; cursor: pointer; }
.bookbtn:hover, .bookbtn.cur { background: var(--ink); color: var(--paper); }
.bk-n { font: 800 15px/1.5 var(--display); letter-spacing: 0.1em; text-transform: uppercase; }
.bk-t { font-size: 18px; font-style: italic; }
.bk-s { grid-column: 2; font-size: 13.5px; opacity: 0.8; }
.noscript { padding: 30px 18px; }

/* ---- narrow or short screens: let the page scroll ---- */
@media (max-width: 920px), (max-height: 640px) {
  body.site { height: auto; display: block; overflow: visible; }
  .mast { flex-wrap: wrap; }
  .mast h1 { font-size: 40px; }
  .mast-sub { flex-basis: 100%; order: 3; white-space: normal; }
  .mast-side { margin-left: auto; }
  .fgroup:last-child { margin-left: 0; }
  .now { flex-wrap: wrap; position: sticky; top: 0; z-index: 2; background: var(--paper); }
  .readout { display: block; }
  .log { max-height: 60vh; border-right: 0; border-bottom: 2px solid var(--ink); }
  .sheets { display: block; overflow: visible; }
  .sheet { border-right: 0; border-bottom: 2px solid var(--ink); overflow: visible; }
}
.sheetdlg h2:focus { outline: 0; }
@media (max-width: 920px), (max-height: 640px) {
  .now-where { flex-basis: 100%; order: 3; white-space: normal; }
}

.kinds { font: 10.5px var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); margin-top: 4px; }

/* ---- "Who" dropdown ---- */
.pick { position: relative; }
.pick > summary { display: inline-flex; align-items: baseline; gap: 8px; cursor: pointer; list-style: none; padding: 2px 0; }
.pick > summary::-webkit-details-marker { display: none; }
.pick > summary b { font: 700 14px/1 var(--display); letter-spacing: 0.07em; text-transform: uppercase; border-bottom: 1px solid var(--ink); padding-bottom: 2px; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick > summary:hover b { color: var(--spot); border-color: var(--spot); }
.caret { width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid var(--ink); border-bottom: 0; align-self: center; }
.pick-panel { position: absolute; z-index: 6; top: calc(100% + 5px); left: 0; width: max-content; min-width: 300px; max-width: min(460px, calc(100vw - 36px)); max-height: min(62vh, 520px); overflow-y: auto; background: var(--paper); border: 2px solid var(--ink); padding: 8px 12px 6px; scrollbar-width: thin; scrollbar-color: var(--ink) transparent; }
.pick-quick { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 2px 0 7px; }
.pick-list { border-top: 2px solid var(--ink); }
.pick-list label { display: grid; grid-template-columns: 16px 14px minmax(0, 1fr) auto; align-items: center; gap: 0 8px; padding: 4px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.pick-list li:last-child label { border-bottom: 0; }
.pick-list label:hover .pick-name { color: var(--spot); }
.pick-list input { width: 15px; height: 15px; margin: 0; accent-color: var(--ink); }
.pick-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-kind { font: 10px var(--mono); text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }

@media (max-width: 920px), (max-height: 640px) {
  .stage { display: block; }
  .lanesbox { max-height: none; overflow: visible; }
  .divider { height: 0; border-bottom: 0; cursor: default; }
  .divider::after { display: none; }
}
