/* ─────────────────────────────────────────────────────────────
   AllFiles file viewer — an immersive dark shell; documents sit on it as white paper.
   ───────────────────────────────────────────────────────────── */
.vw {
  --vw-bg: #0b0c11; --vw-bar: rgba(16,17,24,.86); --vw-line: rgba(255,255,255,.08); --vw-text: #eef1f8; --vw-muted: #9aa3b5;
  --vw-chip: rgba(255,255,255,.08); --vw-acc: #8b8cff;
  position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; background: var(--vw-bg); color: var(--vw-text);
  font-family: var(--font, Inter, system-ui, sans-serif); animation: vwIn .22s var(--ease, ease) both; overscroll-behavior: contain;
}
@keyframes vwIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
body.vw-open .scrim { z-index: 96; }
body.vw-open .sheet { z-index: 97; }
body.vw-open .toasts { z-index: 99; }

/* top bar */
.vw-top {
  flex: none; display: flex; align-items: center; gap: 10px; height: calc(60px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 10px 0; background: var(--vw-bar); border-bottom: 1px solid var(--vw-line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); position: relative; z-index: 5;
}
.vw-ib { width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--vw-text); display: grid; place-items: center; flex: none; transition: background .15s; }
.vw-ib:hover { background: var(--vw-chip); }
.vw-ib .ic { width: 22px; height: 22px; }
.vw-ib.sm { width: 34px; height: 34px; border-radius: 10px; }
.vw-ib.sm .ic { width: 18px; height: 18px; }
.vw-tile span { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 20%, transparent); }
.vw-tile .ic { width: 21px; height: 21px; }
.vw-title { flex: 1; min-width: 0; display: grid; }
.vw-title b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-title small { font-size: 12px; color: var(--vw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vw-acts { display: flex; gap: 2px; flex: none; }

.vw-stage { flex: 1; min-height: 0; position: relative; overflow: auto; overscroll-behavior: contain; }

/* prev / next */
.vw-side {
  position: absolute; top: 50%; z-index: 4; width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(20,21,30,.7); color: #fff; backdrop-filter: blur(8px); transform: translateY(-50%); transition: background .15s, opacity .2s;
}
.vw-side:hover { background: rgba(40,42,58,.9); }
.vw-side.prev { left: 14px; } .vw-side.next { right: 14px; }
.vw-side .ic { width: 22px; height: 22px; }
.vw[data-kind="pdf"] .vw-side, .vw[data-kind="docx"] .vw-side, .vw[data-kind="odt"] .vw-side, .vw[data-kind="rtf"] .vw-side,
.vw[data-kind="sheet"] .vw-side, .vw[data-kind="slides"] .vw-side, .vw[data-kind="code"] .vw-side, .vw[data-kind="md"] .vw-side,
.vw[data-kind="json"] .vw-side, .vw[data-kind="zip"] .vw-side, .vw[data-kind="tar"] .vw-side, .vw[data-kind="gz"] .vw-side { top: auto; bottom: 86px; width: 40px; height: 40px; opacity: .8; }
@media (max-width: 649px) {
  .vw-side { width: 38px; height: 38px; background: rgba(20,21,30,.55); }
  .vw-side.prev { left: 8px; } .vw-side.next { right: 8px; }
  .vw[data-kind="video"] .vw-side, .vw[data-kind="audio"] .vw-side { display: none; }
  /* phones: except on pictures, the arrows sit at the bottom beside the tool dock, never over text */
  .vw:not([data-kind="image"]) .vw-side { top: auto; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: none; opacity: .9; }
  .vw-tile { display: none; }
  .vw-top { gap: 4px; padding-left: 4px; padding-right: 4px; }
}

/* floating tool dock */
.vw-dock {
  position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 16px; background: rgba(22,23,32,.92); border: 1px solid var(--vw-line);
  box-shadow: 0 14px 40px -12px rgba(0,0,0,.7); backdrop-filter: blur(14px); max-width: calc(100% - 24px);
}
.vw[data-kind="video"] .vw-dock, .vw[data-kind="audio"] .vw-dock { display: none; }
.vw-db { height: 36px; min-width: 36px; padding: 0 8px; border-radius: 11px; border: 0; background: transparent; color: var(--vw-text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 600; font-size: 13px; }
.vw-db:hover { background: var(--vw-chip); }
.vw-db.on { background: rgba(139,140,255,.22); color: #c7c8ff; }
.vw-db .ic { width: 19px; height: 19px; }
.vw-dl { font-size: 12.5px; font-weight: 700; color: var(--vw-muted); padding: 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vw-sep { width: 1px; height: 22px; background: var(--vw-line); margin: 0 4px; }
.vw-pg { width: 52px; height: 32px; border-radius: 9px; border: 1px solid var(--vw-line); background: rgba(255,255,255,.06); color: var(--vw-text); text-align: center; font: 700 13px var(--font); -moz-appearance: textfield; }
.vw-pg::-webkit-inner-spin-button, .vw-pg::-webkit-outer-spin-button { -webkit-appearance: none; }

/* loading skeletons with a shimmer */
.shimmer { position: relative; overflow: hidden; background: rgba(255,255,255,.06); }
.shimmer::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.09), transparent); animation: vwShim 1.3s infinite;
}
@keyframes vwShim { to { transform: translateX(100%); } }
.vw-skel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; }
.sk { width: min(880px, 100%); }
.sk-img { height: min(70vh, 560px); width: min(92vw, 820px); border-radius: 16px; }
.sk-media { aspect-ratio: 16 / 9; border-radius: 16px; max-height: 60vh; }
.sk-doc { width: min(760px, 100%); padding: 36px 34px; border-radius: 6px; background: rgba(255,255,255,.04); display: grid; gap: 12px; }
.sk-doc i, .sk-code i, .sk-list i { display: block; height: 12px; border-radius: 6px; }
.sk-sheet { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.sk-sheet i { height: 30px; display: block; }
.sk-code { width: min(900px, 100%); display: grid; gap: 11px; padding: 20px; }
.sk-list { width: min(760px, 100%); display: grid; gap: 12px; }
.sk-list div { display: flex; gap: 12px; align-items: center; }
.sk-list div i:first-child { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.sk-list div i:last-child { flex: 1; }
.vw-load { display: grid; gap: 10px; justify-items: center; font-size: 13px; color: var(--vw-muted); font-weight: 600; }
.vw-lbar { width: 220px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.1); overflow: hidden; }
.vw-lbar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #a855f7, #22d3ee); transition: width .3s; }

/* info / fallback card */
.vw-card { max-width: 440px; margin: 0 auto; min-height: 100%; padding: 32px 22px 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; animation: fadeUp .3s ease both; }
.vw-card-ic { width: 96px; height: 96px; border-radius: 28px; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 18%, transparent); margin-bottom: 10px; }
.vw-card-ic .ic { width: 52px; height: 52px; }
.vw-card h2 { margin: 0; font: 800 20px var(--font-display, inherit); letter-spacing: -.02em; }
.vw-card p { margin: 0; color: var(--vw-muted); line-height: 1.55; }
.vw-card p b { color: var(--vw-text); }
.vw-card small { color: var(--vw-muted); font-size: 12px; margin-top: 6px; word-break: break-all; }
.vw-card-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.vw-card .btn.soft, .mp-err .btn.soft { background: rgba(255,255,255,.1); color: #fff; }
.vw-note { display: flex; gap: 8px; align-items: flex-start; text-align: left; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: rgba(245,158,11,.12); color: #fcd34d; font-size: 13px; line-height: 1.45; }
.vw-note .ic-sm { flex: none; margin-top: 1px; }
.vw-hint { display: flex; gap: 8px; align-items: flex-start; justify-content: center; font-size: 12.5px; line-height: 1.5; color: var(--vw-muted); padding: 10px 14px; text-align: left; text-wrap: pretty; }
.vw-hint .ic-sm { flex: none; margin-top: 2px; }

/* ── image ──────────────────────────────────────────────────── */
.vw-zoom { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.vw-zoom.zoomed { cursor: grab; }
.vw-zoom.zoomed:active { cursor: grabbing; }
.vw-img { max-width: calc(100% - 24px); max-height: calc(100% - 24px); object-fit: contain; border-radius: 4px; box-shadow: 0 18px 60px -20px rgba(0,0,0,.8); transform-origin: center center; animation: vwFade .25s ease both; will-change: transform; }
@keyframes vwFade { from { opacity: 0; } to { opacity: 1; } }
.vw[data-kind="image"] .vw-img[src$=".svg"], .vw[data-kind="image"] .vw-img { background: repeating-conic-gradient(rgba(255,255,255,.05) 0 25%, transparent 0 50%) 0 0 / 20px 20px; }

/* ── media players ─────────────────────────────────────────── */
.mp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; }
.mp-v { background: #000; }
.mp-v .mp-media { width: 100%; height: 100%; object-fit: contain; background: #000; }
.mp-hit { position: absolute; inset: 0; z-index: 1; }
.mp-big {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 76px; height: 76px; border-radius: 50%; border: 0; transform: translate(-50%, -50%);
  background: rgba(20,20,28,.55); color: #fff; display: grid; place-items: center; backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.mp-big .ic { width: 38px; height: 38px; margin-left: 4px; }
.mp-v.paused:not(.buffering):not(.failed) .mp-big { opacity: 1; pointer-events: auto; }
.mp-spin { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s; }
.mp-spin .ic { width: 46px; height: 46px; }
.mp.buffering .mp-spin { opacity: 1; }
.mp-ripple { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 2; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.mp-ripple.l { left: 0; border-radius: 0 50% 50% 0 / 0 50% 50% 0; }
.mp-ripple.r { right: 0; border-radius: 50% 0 0 50% / 50% 0 0 50%; }
.mp-ripple div { display: grid; justify-items: center; gap: 4px; color: #fff; font-weight: 700; font-size: 13px; }
.mp-ripple .ic { width: 30px; height: 30px; }
.mp-ripple.on { animation: mpRip .7s ease-out; }
@keyframes mpRip { 0% { opacity: 0; background: rgba(255,255,255,0); } 15% { opacity: 1; background: rgba(255,255,255,.12); } 100% { opacity: 0; background: rgba(255,255,255,0); } }
.mp-resume { position: absolute; left: 50%; top: 18px; z-index: 5; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 99px;
  background: rgba(20,21,30,.85); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; white-space: nowrap; animation: fadeUp .25s ease both; }
.mp-resume button { border: 0; border-radius: 99px; padding: 5px 11px; background: rgba(255,255,255,.14); color: #fff; font-weight: 700; font-size: 12.5px; }

/* control bar */
.mp-v .mp-ui {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 26px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.35) 60%, transparent); transition: opacity .25s, transform .25s;
}
.mp-v.idle .mp-ui { opacity: 0; transform: translateY(8px); pointer-events: none; }
.mp-v.idle { cursor: none; }
.mp-seek { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.mp-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.22); transition: height .15s; }
.mp-seek:hover .mp-track, .mp-seek.drag .mp-track, .mp-seek:focus-visible .mp-track { height: 6px; }
.mp-buf, .mp-played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; width: 0; }
.mp-buf { background: rgba(255,255,255,.3); }
.mp-played { background: linear-gradient(90deg, #6366f1, #a855f7, #22d3ee); }
.mp-knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%) scale(0); transition: transform .15s; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.mp-seek:hover .mp-knob, .mp-seek.drag .mp-knob, .mp-a .mp-knob { transform: translate(-50%, -50%) scale(1); }
.mp-tip { position: absolute; bottom: 22px; transform: translateX(-50%); padding: 3px 8px; border-radius: 7px; background: rgba(0,0,0,.8); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .15s; font-variant-numeric: tabular-nums; }
.mp-seek:hover .mp-tip, .mp-seek.drag .mp-tip { opacity: 1; }
.mp-row { display: flex; align-items: center; gap: 2px; margin-top: 4px; }
.mp-grow { flex: 1; }
.mp-b { position: relative; height: 40px; min-width: 40px; padding: 0 6px; border: 0; border-radius: 11px; background: transparent; color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; }
.mp-b:hover { background: rgba(255,255,255,.12); }
.mp-b .ic { width: 23px; height: 23px; }
.mp-b em { position: absolute; font-style: normal; font-size: 8.5px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.mp-b.on { color: #a5a6ff; }
.mp .pz, .mp.paused .pl { display: block; } .mp .pl, .mp.paused .pz { display: none; }
.mp .mu, .mp.muted .vo { display: none; } .mp.muted .mu { display: block; }
.mp .fi, .mp.fs .fo { display: none; } .mp.fs .fi { display: block; }
.mp-time { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.92); padding: 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mp-rate { min-width: 46px; font-variant-numeric: tabular-nums; }
.mp-vol { display: flex; align-items: center; }
.mp-vr { -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; border-radius: 4px; transition: width .2s, opacity .2s; cursor: pointer;
  background: linear-gradient(90deg, #fff var(--v, 100%), rgba(255,255,255,.28) var(--v, 100%)); }
.mp-vol:hover .mp-vr, .mp-vr:focus { width: 80px; opacity: 1; margin: 0 8px 0 2px; }
.mp-vr::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.mp-vr::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.mp-err { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 24px; background: rgba(8,9,14,.92); }
.mp-err b { font-size: 18px; }
.mp-err p { max-width: 420px; margin: 0; color: var(--vw-muted); line-height: 1.5; }
.mp.fs .mp-ui { padding-bottom: 18px; }
@media (max-width: 649px) {
  .mp-v .mp-row { flex-wrap: wrap; }
  .mp-v .mp-vol { display: none; }
  .mp-v [data-mp="back"], .mp-v [data-mp="fwd"] { display: none; }   /* double-tap the sides instead */
  .mp-time { font-size: 12px; padding: 0 4px; }
  .mp-big { width: 68px; height: 68px; }
}

/* audio */
.mp-a { background: radial-gradient(120% 90% at 50% 0%, #1d1a3a 0%, #0b0c11 62%); overflow-y: auto; }
.ap-card { width: min(440px, 100%); padding: 22px 22px calc(26px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; margin: auto; }
.ap-art { position: relative; width: min(280px, 64vw); aspect-ratio: 1; margin: 6px 0 24px; display: grid; place-items: center; }
.ap-viz { position: absolute; inset: -18%; width: 136%; height: 136%; }
.ap-disc { width: 58%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: conic-gradient(from 210deg, #4f46e5, #8b5cf6, #22d3ee, #4f46e5); box-shadow: 0 24px 60px -18px rgba(99,102,241,.8), inset 0 0 0 10px rgba(255,255,255,.08);
  animation: apSpin 14s linear infinite; animation-play-state: paused; }
.mp-a:not(.paused) .ap-disc { animation-play-state: running; }
@keyframes apSpin { to { transform: rotate(360deg); } }
.ap-disc .ic { width: 42%; height: 42%; }
.ap-name { font: 800 20px var(--font-display, inherit); letter-spacing: -.02em; text-align: center; overflow-wrap: anywhere; line-height: 1.25; }
.ap-sub { color: var(--vw-muted); font-size: 13px; margin: 4px 0 18px; }
.mp-a .mp-ui { width: 100%; }
.ap-times { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--vw-muted); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.ap-ctl { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.ap-ctl .mp-b { height: 48px; min-width: 48px; }
.ap-ctl .mp-b .ic { width: 26px; height: 26px; }
.ap-play { width: 72px; height: 72px !important; border-radius: 50% !important; color: #fff; background: linear-gradient(135deg, #4f46e5, #8b5cf6 60%, #22d3ee 130%) !important; box-shadow: 0 14px 30px -10px rgba(99,102,241,.9); }
.ap-play .ic { width: 32px !important; height: 32px !important; }
.ap-volrow { display: flex; justify-content: center; }
.mp-a .mp-vr { width: 140px; opacity: 1; margin: 0 8px; }

/* ── PDF ───────────────────────────────────────────────────── */
.pdf-wrap { position: absolute; inset: 0; overflow: auto; padding: 18px 0 110px; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: min-content; padding: 0 16px; }
.pdf-page { background: #fff; box-shadow: 0 10px 34px -12px rgba(0,0,0,.7); border-radius: 2px; flex: none; }
.pdf-page.shimmer { background: rgba(255,255,255,.08); }
.pdf-page canvas { display: block; }
@media (max-width: 649px) { .pdf-wrap { padding-top: 10px; } .pdf-pages { gap: 10px; padding: 0 8px; } }

/* ── documents (Word / ODT / RTF / Markdown) ───────────────── */
.doc-wrap { padding: 22px 14px 120px; }
.doc-page {
  --z: 1; max-width: 816px; margin: 0 auto; background: #fff; color: #1f2328; border-radius: 4px; padding: 56px 64px; box-shadow: 0 18px 50px -18px rgba(0,0,0,.75);
  font: 400 calc(15.5px * var(--z))/1.65 Georgia, "Times New Roman", serif; overflow-wrap: anywhere; animation: fadeUp .3s ease both;
}
.doc-page.md, .doc-page.plain { font-family: Inter, system-ui, sans-serif; font-size: calc(15px * var(--z)); }
.doc-page h1, .doc-page h2, .doc-page h3, .doc-page h4 { font-family: Inter, system-ui, sans-serif; color: #111827; line-height: 1.3; margin: 1.2em 0 .5em; letter-spacing: -.01em; }
.doc-page h1 { font-size: 1.9em; } .doc-page h2 { font-size: 1.45em; } .doc-page h3 { font-size: 1.2em; }
.doc-page > :first-child { margin-top: 0; }
.doc-page p { margin: 0 0 .8em; }
.doc-page img { max-width: 100%; height: auto; border-radius: 4px; }
.doc-page table { border-collapse: collapse; margin: 1em 0; width: 100%; font-size: .92em; display: block; overflow-x: auto; }
.doc-page td, .doc-page th { border: 1px solid #d0d7de; padding: 6px 10px; vertical-align: top; }
.doc-page th { background: #f6f8fa; }
.doc-page a { color: #4f46e5; }
.doc-page ul, .doc-page ol { padding-left: 1.6em; margin: 0 0 .9em; }
.doc-page blockquote { margin: 1em 0; padding: .4em 1em; border-left: 4px solid #d0d7de; color: #57606a; }
.doc-page code { font: .88em ui-monospace, Consolas, monospace; background: #f3f4f6; padding: .15em .4em; border-radius: 5px; }
.doc-page pre { background: #0f1117; color: #e6edf3; padding: 14px 16px; border-radius: 10px; overflow-x: auto; }
.doc-page pre code { background: none; padding: 0; color: inherit; }
.doc-page hr { border: 0; border-top: 1px solid #d0d7de; margin: 1.6em 0; }
.doc-page .vw-hint { color: #57606a; background: #f6f8fa; border-radius: 10px; margin-bottom: 18px; }
.doc-empty { color: #8b949e; text-align: center; }
@media (max-width: 649px) { .doc-wrap { padding: 10px 8px 110px; } .doc-page { padding: 26px 20px; font-size: calc(15px * var(--z)); } }

/* ── spreadsheet ───────────────────────────────────────────── */
.xl { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; color: #1f2328; }
.xl-scroll { flex: 1; overflow: auto; padding-bottom: 80px; }
.xl-grid { border-collapse: separate; border-spacing: 0; font: 13px/1.35 Inter, system-ui, sans-serif; }
.xl-grid th, .xl-grid td { border-right: 1px solid #e4e7ec; border-bottom: 1px solid #e4e7ec; padding: 5px 9px; white-space: nowrap; max-width: 340px; overflow: hidden; text-overflow: ellipsis; height: 28px; }
.xl-grid thead th { position: sticky; top: 0; z-index: 2; background: #f3f4f6; color: #57606a; font-weight: 600; text-align: center; min-width: 64px; }
.xl-grid tbody th { position: sticky; left: 0; z-index: 1; background: #f3f4f6; color: #57606a; font-weight: 600; text-align: center; min-width: 46px; }
.xl-grid .xl-corner { left: 0; z-index: 3; }
.xl-grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.xl-grid tbody tr:hover td { background: #f5f7ff; }
.xl-empty { padding: 30px !important; color: #8b949e; }
.xl-more { padding: 14px; }
.xl-more .btn.soft { background: #eef0f6; color: #1f2328; }
.xl-tabs { flex: none; display: flex; gap: 2px; overflow-x: auto; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: #f3f4f6; border-top: 1px solid #e4e7ec; scrollbar-width: none; }
.xl-tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font: 600 13px Inter, system-ui, sans-serif; color: #57606a; white-space: nowrap; }
.xl-tabs button.on { background: #fff; color: #107c41; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.vw[data-kind="sheet"] .vw-side { bottom: 72px; }

/* ── slides ────────────────────────────────────────────────── */
.sl-wrap { padding: 16px 14px 120px; display: grid; gap: 16px; justify-items: center; }
.sl-card { position: relative; width: min(880px, 100%); aspect-ratio: 16 / 9; background: #fff; color: #111827; border-radius: 10px; padding: 34px 40px; overflow: hidden;
  box-shadow: 0 16px 44px -16px rgba(0,0,0,.75); display: flex; flex-direction: column; gap: 10px; animation: fadeUp .3s ease both; }
.sl-no { position: absolute; right: 14px; bottom: 10px; font-size: 12px; font-weight: 700; color: #9ca3af; }
.sl-card h3 { margin: 0; font: 800 clamp(18px, 3.2vw, 30px)/1.2 Inter, system-ui, sans-serif; letter-spacing: -.02em; }
.sl-card ul { margin: 0; padding-left: 1.2em; font-size: clamp(13px, 1.8vw, 18px); line-height: 1.5; color: #374151; overflow: hidden; }
.sl-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.sl-imgs img { max-height: 30%; max-width: 45%; height: auto; min-height: 60px; object-fit: contain; border-radius: 6px; }
.sl-empty { color: #9ca3af; margin: auto; }
@media (max-width: 649px) { .sl-card { aspect-ratio: auto; min-height: 180px; padding: 20px 18px; } }

/* ── code / text ───────────────────────────────────────────── */
.code-wrap { min-height: 100%; background: #0d1017; padding-bottom: 100px; }
.code-box { display: flex; font: 13px/1.6 ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace; min-width: min-content; }
.code-ln { margin: 0; padding: 16px 12px 16px 16px; text-align: right; color: #4b5263; user-select: none; position: sticky; left: 0; background: #0d1017; border-right: 1px solid rgba(255,255,255,.06); z-index: 1; }
.code-src { margin: 0; padding: 16px 20px; color: #d6deeb; tab-size: 4; white-space: pre; flex: 1; }
.code-src code { font: inherit; background: none; padding: 0; }
.code-wrap.wrap .code-src { white-space: pre-wrap; word-break: break-word; }
.code-wrap.wrap .code-ln { display: none; }
.code-wrap .vw-hint { background: rgba(245,158,11,.1); color: #fcd34d; }
@media (max-width: 649px) { .code-box { font-size: 12px; } .code-ln { padding: 12px 8px 12px 10px; } .code-src { padding: 12px 14px; } }
/* highlight.js colours (dark) */
.hljs-comment, .hljs-quote { color: #6b7394; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #c3e88d; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #f78c6c; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #82aaff; }
.hljs-title.class_, .hljs-type, .hljs-built_in { color: #ffcb6b; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable, .hljs-property { color: #89ddff; }
.hljs-name, .hljs-tag, .hljs-selector-id, .hljs-selector-class { color: #f07178; }
.hljs-meta, .hljs-params { color: #d6deeb; }
.hljs-deletion { color: #ff5370; }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }

/* ── fonts ─────────────────────────────────────────────────── */
.ft-wrap { padding: 22px 14px 110px; }
.ft-card { max-width: 820px; margin: 0 auto; background: #fff; color: #111827; border-radius: 14px; padding: 34px 32px; box-shadow: 0 18px 50px -18px rgba(0,0,0,.75); overflow-wrap: anywhere; }
.ft-aa { font-size: 110px; line-height: 1; }
.ft-name { font-family: Inter, system-ui, sans-serif; font-weight: 700; color: #6b7280; margin: 6px 0 18px; }
.ft-try { font-size: 34px; line-height: 1.3; padding: 12px 14px; border-radius: 10px; background: #f5f6fb; outline: none; margin-bottom: 18px; }
.ft-try:focus { box-shadow: 0 0 0 3px rgba(91,91,246,.25); }
.ft-card p { margin: 0 0 12px; line-height: 1.3; }
.ft-glyphs { font-size: 22px; line-height: 1.6; color: #374151; border-top: 1px solid #e5e7eb; padding-top: 16px; margin-top: 8px; }

/* ── archives ──────────────────────────────────────────────── */
.ar-wrap { max-width: 820px; margin: 0 auto; padding: 16px 14px 110px; display: grid; gap: 12px; }
.ar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ar-sum { display: grid; }
.ar-sum b { font: 800 18px var(--font-display, inherit); }
.ar-sum span { color: var(--vw-muted); font-size: 13px; }
.ar-find { background: rgba(255,255,255,.06); border-color: var(--vw-line); color: var(--vw-text); }
.ar-find input { color: var(--vw-text); }
.ar-list { display: grid; background: rgba(255,255,255,.04); border: 1px solid var(--vw-line); border-radius: 16px; overflow: hidden; }
.ar-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px 9px 12px; border-top: 1px solid var(--vw-line); cursor: pointer; transition: background .15s; }
.ar-row:first-child { border-top: 0; }
.ar-row:hover { background: rgba(255,255,255,.05); }
.ar-ic { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; color: var(--tc); background: color-mix(in srgb, var(--tc) 18%, transparent); }
.ar-ic .ic { width: 20px; height: 20px; }
.ar-name { flex: 1; min-width: 0; display: grid; }
.ar-name b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-name small { font-size: 12px; color: var(--vw-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ar-size { font-size: 12.5px; color: var(--vw-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ar-wrap .vw-hint { justify-content: flex-start; text-align: left; background: rgba(255,255,255,.04); border-radius: 12px; }

@media (prefers-reduced-motion: reduce) { .vw, .shimmer::after, .ap-disc { animation: none !important; } }
