/* OnTrack O&M manual viewer (6th of November 2026) */
:root { --char: #262626; --terra: #B15533; --ivory: #F4F3F1; --line: #E2E0DC; --muted: #6b6b6b; --side: 320px; --vw-z: 1; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: #e9e7e3; color: var(--char); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
button { font: inherit; color: inherit; cursor: pointer; }
.vw { display: grid; grid-template-rows: auto 1fr; grid-template-columns: var(--side) 1fr; grid-template-areas: "top top" "side main"; height: 100vh; }
.vw-top { grid-area: top; display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--char); color: #fff; flex-wrap: wrap; }
.vw-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.vw-title b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-title span { font-size: 12px; opacity: .75; }
.vw-ico { background: rgba(255,255,255,.1); border: 0; border-radius: 6px; width: 34px; height: 34px; font-size: 18px; line-height: 1; color: #fff; }
.vw-ico:hover { background: rgba(255,255,255,.2); }
.vw-find { display: flex; flex: 1 1 260px; max-width: 420px; }
.vw-find input { flex: 1; min-width: 0; border: 0; border-radius: 6px 0 0 6px; padding: 8px 10px; font: inherit; }
.vw-find button { border: 0; border-radius: 0 6px 6px 0; background: var(--terra); color: #fff; padding: 0 14px; font-weight: 600; }
.vw-nav, .vw-zoom { display: flex; align-items: center; gap: 6px; }
.vw-nav input { width: 56px; text-align: center; border: 0; border-radius: 6px; padding: 7px 4px; font: inherit; }
.vw-nav span { font-size: 13px; opacity: .8; white-space: nowrap; }
.vw-btn { background: #fff; color: var(--char); text-decoration: none; border-radius: 6px; padding: 8px 12px; font-weight: 600; white-space: nowrap; }
.vw-side { grid-area: side; background: #fff; border-right: 1px solid var(--line); overflow: auto; display: none; }
.vw-side.open { display: block; }
.vw:not(:has(.vw-side.open)) { grid-template-columns: 0 1fr; }
.vw-tabs { position: sticky; top: 0; display: flex; background: #fff; border-bottom: 1px solid var(--line); z-index: 2; }
.vw-tabs button { flex: 1; border: 0; background: none; padding: 10px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.vw-tabs button.on { color: var(--char); border-bottom-color: var(--terra); }
.vw-toc { padding: 6px 0 40px; }
.vw-sec-h, .vw-doc { display: flex; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; gap: 8px; align-items: baseline; }
.vw-sec-h { font-weight: 700; flex-wrap: wrap; }
.vw-sec-h .t, .vw-doc .t { flex: 1; min-width: 0; }
.vw-sec-h .pg, .vw-doc .pg { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.vw-count { flex-basis: 100%; font-weight: 400; font-size: 12px; color: var(--muted); }
.vw-docs { display: none; padding-bottom: 4px; }
.vw-sec.open .vw-docs, .vw-sec.here .vw-docs { display: block; }
.vw-doc { padding-left: 26px; font-size: 13px; }
.vw-sec-h:hover, .vw-doc:hover, .vw-hit:hover { background: var(--ivory); }
.vw-sec-h.on, .vw-doc.on { background: #f6e9e3; box-shadow: inset 3px 0 0 var(--terra); }
.vw-res { padding: 8px 0 40px; }
.vw-total { margin: 4px 14px 8px; color: var(--muted); font-size: 13px; }
.vw-hit { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.vw-hit .s { display: block; font-weight: 700; font-size: 12px; color: var(--terra); margin-bottom: 2px; }
.vw-hit .x { display: block; font-size: 13px; color: #444; }
.vw-hit mark { background: #fbe3a1; color: inherit; border-radius: 2px; }
.vw-main { grid-area: main; overflow: auto; padding: 0 16px 60px; outline: none; }
.vw-where { position: sticky; top: 0; z-index: 3; margin: 0 -16px 12px; padding: 7px 16px; background: rgba(244,243,241,.96); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-page { position: relative; width: calc(min(100%, 900px) * var(--vw-z)); max-width: none; margin: 0 auto 14px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); aspect-ratio: 1 / 1.414; }
.vw-page img { display: block; width: 100%; height: 100%; object-fit: contain; }
.vw-page:not(.in) img { opacity: 0; }
.vw-num { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 8px; }
.vw-hl { position: absolute; z-index: 2; background: rgba(255, 205, 64, .42); border-radius: 3px; pointer-events: none; mix-blend-mode: multiply; }
.vw-empty { max-width: 560px; margin: 15vh auto; background: #fff; padding: 28px; border-radius: 10px; }
@media (max-width: 899px) {
  .vw, .vw:not(:has(.vw-side.open)) { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .vw-side { position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 360px); z-index: 10; box-shadow: 4px 0 18px rgba(0,0,0,.25); }
  .vw-zoom, .vw-title span { display: none; }
  .vw-main { padding: 0 8px 60px; }
  .vw-where { margin: 0 -8px 10px; }
}
@media print { .vw-top, .vw-side, .vw-where { display: none; } .vw { display: block; } .vw-main { overflow: visible; } .vw-page { box-shadow: none; page-break-after: always; } }
/* 7th of November 2026: Ask This Building in the viewer, and the way back to the building's home page */
.vw-home { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.vw-askbtn { background: var(--terra); color: #fff; border: 0; }
.vw-ask { display: flex; flex-direction: column; height: calc(100% - 42px); }
.vw-ask[hidden] { display: none; }
.vw-alog { flex: 1; overflow: auto; padding: 10px 12px; }
.vw-msg { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; }
.vw-msg p { margin: 0 0 6px; } .vw-msg ol { margin: 4px 0 6px 18px; padding: 0; }
.vw-msg.q { background: var(--char); color: #fff; margin-left: 28px; }
.vw-msg.a { background: var(--ivory); }
.vw-think { color: var(--muted); font-style: italic; }
.vw-safety { background: #fdeee8; border-left: 3px solid var(--terra); padding: 6px 8px; margin: 6px 0; font-weight: 600; }
.vw-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.vw-src { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 10px; font-size: 12px; text-align: left; color: var(--char); text-decoration: none; }
.vw-src:hover { border-color: var(--terra); }
.vw-src.draw { border-color: #c9d6cf; background: #f2f7f4; }
.vw-sugg { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.vw-sugg button { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.vw-disc { font-size: 11.5px; color: var(--muted); margin: 6px 0 0 !important; }
.vw-aform { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; position: sticky; bottom: 0; }
.vw-aform input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
.vw-aform button { border: 0; border-radius: 8px; background: var(--terra); color: #fff; font-weight: 700; padding: 0 14px; }
.vw-hl.q { background: rgba(255, 196, 0, .45); box-shadow: 0 0 0 1px rgba(177, 85, 51, .35); }
@media (max-width: 899px) { .vw-askbtn { order: 3; } }
/* 7th of November 2026: every asset reference is a link */
.vw-x { position: absolute; border: 0; padding: 0; margin: 0; background: transparent; border-bottom: 1.5px dotted rgba(177, 85, 51, .75); cursor: pointer; z-index: 2; }
.vw-x:hover, .vw-x:focus { background: rgba(177, 85, 51, .14); outline: none; }
.vw-pop { position: fixed; z-index: 30; background: #fff; border-radius: 14px; box-shadow: 0 18px 50px rgba(20,20,20,.28), 0 0 0 1px rgba(0,0,0,.04); max-height: min(72vh, 520px); display: flex; flex-direction: column; font-size: 13px; overflow: hidden; animation: vwpop .14s ease-out; }
@keyframes vwpop { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.vw-pop.sheet { top: auto !important; bottom: 8px; max-height: 70vh; border-radius: 16px; }
.vw-pop-h { display: flex; align-items: flex-start; gap: 10px; padding: 14px 14px 12px; background: var(--char); color: #fff; }
.vw-pop-ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vw-pop-ht b { font-size: 16px; letter-spacing: .01em; }
.vw-pop-ht span { color: rgba(255,255,255,.72); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-pop-x { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 28px; height: 28px; border-radius: 50%; font-size: 17px; line-height: 1; flex: none; }
.vw-pop-l { overflow: auto; padding: 4px 0 6px; }
.vw-pop-g { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 10px 14px 4px; }
.vw-pop-i { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 7px 14px; text-decoration: none; color: var(--char); }
.vw-pop-i .tx { display: flex; flex-direction: column; min-width: 0; }
.vw-pop-i .tx b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-pop-i .tx span { color: var(--muted); font-size: 12px; }
.vw-pop-i:hover, .vw-pop-i:focus { background: #f6efe9; outline: none; }
.vw-pop-i .ico { flex: none; width: 28px; height: 28px; border-radius: 8px; background: #f1ece6; position: relative; }
.vw-pop-i .ico::after { content: ""; position: absolute; inset: 7px; border: 2px solid var(--terra); border-radius: 2px; }
.vw-pop-i .ico.d { background: #e8f1ec; } .vw-pop-i .ico.d::after { border-color: #2f6b4f; border-radius: 50%; }
.vw-pop-i .ico.f::after { border-style: dashed; }
.vw-pop-n { margin: 10px 14px; color: var(--muted); }
.vw-pop-ask { display: flex; flex-direction: column; align-items: flex-start; border: 0; border-top: 1px solid var(--line); background: #fbf7f4; color: var(--terra); font-weight: 700; padding: 11px 14px; text-align: left; }
.vw-pop-ask small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.vw-pop-ask:hover { background: #f6ece5; }
.vw-x.hi { background: rgba(251, 199, 64, .5); outline: 1.5px solid var(--terra); border-radius: 2px; }

/* 7th of November 2026: pages drawn sharp by pdf.js over the index picture; the microphone; a calmer frame */
.vw-page { border-radius: 2px; overflow: hidden; }
.vw-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; animation: vwin .18s ease-out; }
@keyframes vwin { from { opacity: 0; } }
.vw-num { z-index: 3; }
.vw-x { z-index: 2; }
.vw-page:not(.in) { background: linear-gradient(90deg, #fff 0%, #f5f3f0 50%, #fff 100%); background-size: 200% 100%; animation: vwshim 1.4s linear infinite; }
@keyframes vwshim { to { background-position: -200% 0; } }
.vw-top { background: #1f1f20; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 10px rgba(0,0,0,.2); }
.vw-btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.vw-mic { flex: none; width: 40px; border: 1px solid var(--line) !important; background: #fff !important; color: var(--char) !important; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 !important; }
.vw-mic[hidden] { display: none; }
.vw-mic.on { background: var(--terra) !important; color: #fff !important; border-color: var(--terra) !important; animation: vwmic 1.2s ease-in-out infinite; }
@keyframes vwmic { 50% { box-shadow: 0 0 0 6px rgba(177,85,51,.18); } }
.vw-empty { text-align: center; color: var(--muted); }
@media (max-width: 899px) {
  .vw-top { gap: 6px; padding: 6px 8px; }
  .vw-find { order: 9; flex-basis: 100%; max-width: none; }
  .vw-nav input { width: 46px; }
  .vw-btn { padding: 7px 10px; font-size: 13px; }
  .vw-btn.ghost { display: none; }
}
/* 8th of November 2026: turn a page a quarter turn (A4 landscape documents). Screen only. */
.vw-sheet { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform-origin: 50% 50%; }
.vw-turn { position: absolute; top: 8px; right: 8px; z-index: 4; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.vw-page:hover .vw-turn, .vw-page.turned .vw-turn, .vw-turn:focus-within { opacity: 1; }
.vw-turn button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.94); color: var(--char); font-size: 16px; line-height: 1; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.vw-turn button:hover { background: #fff; border-color: var(--terra); color: var(--terra); }
@media (hover: none) { .vw-turn { opacity: .9; } .vw-turn button { width: 34px; height: 34px; } }
@media print { .vw-turn { display: none; } }
/* 8th of November 2026: sideways pages turn themselves, marked "Turned to read" */
.vw-autotag { display: none; align-items: center; height: 24px; align-self: center; padding: 0 9px; border-radius: 12px; background: rgba(255,255,255,.94); border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.vw-page.auto .vw-autotag { display: inline-flex; }
