:root {
  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #16202c;
  --muted: #5b6777;
  --line: #d9dfe7;
  --brand: #1d4ed8;
  --brand-ink: #ffffff;
  --top: #0f1722;
  --ok: #0f7b4b;
  --warn: #9a5b00;
  --bad: #b42318;
  --radius: 10px;
  font-family: "Inter", "Segoe UI", "Noto Sans", "DejaVu Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
a { color: var(--brand); }
button, input { font: inherit; }
.hidden { display: none !important; }

/* top bar */
.topbar { height: 56px; background: var(--top); color: #e6edf5; display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.brand { font-weight: 700; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #3b82f6, #1e3a8a); display: inline-block; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px; border-radius: 2px; background: #0f1722; }
.spacer { flex: 1; }
.who { color: #b7c3d1; font-size: 14px; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; line-height: 1.2; text-decoration: none; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: #b6c1cf; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.btn-primary:hover { background: #1e40af; border-color: #1e40af; }
.btn-ghost { background: transparent; color: #dbe4ee; border-color: #334155; }
.btn-ghost:hover { border-color: #64748b; }
.btn-icon { width: 36px; padding: 8px 0; text-align: center; }

/* library page */
.wrap { max-width: 980px; margin: 0 auto; padding: 36px 20px 60px; }
h1.page-title { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.01em; }
.sub { color: var(--muted); margin: 0 0 26px; line-height: 1.5; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.login { max-width: 440px; }
.login label { display: block; font-weight: 600; margin-bottom: 8px; }
.login input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.login input:focus { outline: 2px solid #93c5fd; border-color: var(--brand); }
.note { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 12px 0 0; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 0 0; }
.docs { display: grid; gap: 14px; }
.doc { display: flex; gap: 18px; align-items: center; }
.doc-body { flex: 1; min-width: 0; }
.doc h3 { margin: 0 0 6px; font-size: 17px; }
.doc p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; margin-bottom: 8px; }
.badge-standard { background: #e0ecff; color: #1e40af; }
.badge-strict { background: #fde7e7; color: #9b1c1c; }
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 22px; font-size: 14px; line-height: 1.5; }
.banner-warn { background: #fff7e6; border: 1px solid #f5d29a; color: #6b4300; }
.banner-dev { background: #fdecec; border: 1px solid #f3b4b4; color: #7f1d1d; }
.howto { margin-top: 30px; }
.howto h2 { font-size: 18px; margin: 0 0 12px; }
.howto ol { margin: 0; padding-left: 20px; line-height: 1.7; color: #2b3644; }
.howto code { background: #f1f4f8; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 13px; }

/* viewer */
.viewer { display: flex; flex-direction: column; height: 100%; }
.vbar { gap: 12px; }
.vtitle { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 36vw; }
.pager, .zoom { display: flex; align-items: center; gap: 6px; }
.pager .count { min-width: 64px; text-align: center; color: #e6edf5; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 5px 11px; white-space: nowrap; }
.pill-ok { background: #d9f5e7; color: var(--ok); }
.pill-warn { background: #fff1d6; color: var(--warn); }
.pill-bad { background: #fde2e2; color: var(--bad); }
.stage { flex: 1; overflow: auto; background: #2a313b; position: relative; }
.stage-inner { min-height: 100%; min-width: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 28px; width: max-content; margin: 0 auto; }
/* decoration lives on the wrapper: the <video> itself must stay plain (no transform / opacity /
   border-radius / filter) so the browser keeps it on the protected hardware overlay */
.sheet { background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); line-height: 0; }
.sheet video { display: block; background: #fff; }
.vfoot { height: 34px; background: #151c26; color: #9fb0c3; font-size: 12.5px; display: flex; align-items: center; gap: 18px; padding: 0 20px; }
.vfoot strong { color: #dbe4ee; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: #2a313b; }
.panel { background: var(--panel); border-radius: 12px; max-width: 620px; width: 100%; padding: 26px 28px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.panel h2 { margin: 0 0 10px; font-size: 20px; }
.panel p, .panel li { color: #3a4654; line-height: 1.55; font-size: 14.5px; }
.panel ul { padding-left: 20px; margin: 8px 0 14px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #d6dde6; border-top-color: var(--brand); animation: spin 0.9s linear infinite; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { position: absolute; right: 18px; bottom: 18px; max-width: 360px; background: #ffffff; border-radius: 10px; padding: 14px 16px; font-size: 13.5px; line-height: 1.5; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); }
.hint b { display: block; margin-bottom: 4px; }
.hint .btn { margin-top: 10px; padding: 5px 10px; font-size: 13px; }
@media (max-width: 760px) {
  .vtitle, .who { display: none; }
  .topbar { padding: 0 10px; gap: 8px; }
  .stage-inner { padding: 12px; }
  .hint { left: 12px; right: 12px; max-width: none; }
}
