/* ═══════════════════════════════════════════════════════════════════════
   MOCK MATRIX HUB — PDFs & STUDY MATERIALS  (app + website, same file)
   Loaded AFTER /css/live-mock-style.css (tokens, app bar, tabs, live card
   v2, toasts, dark mode). Everything here is SOLID — no blur / glass.
   ═══════════════════════════════════════════════════════════════════════ */

body.pdf-page{ background:var(--bg); }
.pdf-scroll{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
    padding:14px 16px calc(112px + env(safe-area-inset-bottom)); }
@media (min-width:900px){ .pdf-scroll{ padding:18px 22px calc(112px + env(safe-area-inset-bottom)); } }
.pdf-wrap{ max-width:1180px; margin:0 auto; }

/* ── header extras ─────────────────────────────────────────────────────── */
.pdf-hdr-sub{ margin-top:1px; font-size:11.5px; font-weight:600; color:var(--text-3);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* tools row — filter (tabs) + search + progress, BELOW the header, scrolls with content */
.pdf-tools:empty{ display:none; }
.pdf-page .pdf-tools > .live-tabs{ margin:0 0 12px; }
@media (min-width:900px){ .pdf-page .pdf-tools > .live-tabs{ max-width:520px; } }
/* progress = plain text breadcrumb, current one blue, wraps to next line on small screens */
.pdf-crumbs{ display:flex; flex-wrap:wrap; align-items:center; column-gap:6px; row-gap:2px; margin:0 2px 12px;
    font-size:13px; line-height:1.45; }
.pdf-crumb{ color:var(--text-3); font-weight:600; text-decoration:none; white-space:nowrap; }
a.pdf-crumb:active{ color:var(--primary); }
@media (hover:hover){ a.pdf-crumb:hover{ color:var(--text); } }
.pdf-crumb.cur{ color:var(--primary); font-weight:700; }
.pc-sep{ color:var(--text-3); opacity:.6; font-weight:600; }

/* search */
.pdf-search{ position:relative; margin:0 0 10px; }
.pdf-search input{ width:100%; height:42px; border-radius:12px; border:1px solid var(--border);
    background:var(--surface-2); color:var(--text); font:inherit; font-size:14px; font-weight:500;
    padding:0 40px 0 40px; outline:none; -webkit-appearance:none; appearance:none; }
.pdf-search input::placeholder{ color:var(--text-3); }
.pdf-search input:focus{ border-color:var(--primary); background:var(--surface); box-shadow:0 0 0 3px var(--primary-soft); }
.pdf-search .s-ico{ position:absolute; left:13px; top:50%; transform:translateY(-50%); width:18px; height:18px; color:var(--text-3); pointer-events:none; }
.pdf-search .s-clear{ position:absolute; right:6px; top:50%; transform:translateY(-50%); width:32px; height:32px; border:0; border-radius:50%;
    background:none; color:var(--text-3); display:none; place-items:center; cursor:pointer; }
.pdf-search.has .s-clear{ display:grid; }
.pdf-search .s-clear svg{ width:16px; height:16px; }

/* ── section title ─────────────────────────────────────────────────────── */
.pdf-sec{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin:18px 2px 10px; }
.pdf-sec:first-child{ margin-top:2px; }
.pdf-sec h2{ margin:0; font-size:13px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; color:var(--text-2); }
.pdf-sec .cnt{ font-size:12px; font-weight:700; color:var(--text-3); }

/* notice banner (live JSON) */
.pdf-notice{ display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:14px; margin-bottom:14px;
    background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-card); font-size:13px; font-weight:600; color:var(--text); }
.pdf-notice b{ flex-shrink:0; font-size:10px; font-weight:800; letter-spacing:.6px; padding:3px 8px; border-radius:999px;
    background:var(--emerald-soft); color:var(--emerald-strong); }

/* ── board tiles (grid) ────────────────────────────────────────────────── */
.pdf-tiles{ display:grid; grid-template-columns:1fr; gap:10px; }
/* t245: same columns as the Exams page boards (.nav-list): 1 → 2 (≥760) → 3 (≥1500) */
@media (min-width:760px){ .pdf-tiles{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; } }
@media (min-width:1500px){ .pdf-tiles{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.pdf-tile{ position:relative; display:flex; flex-direction:column; gap:10px; padding:14px; min-width:0;
    background:var(--surface); border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--shadow-card);
    color:var(--text); text-decoration:none; cursor:pointer; animation:cardIn .34s cubic-bezier(.22,1,.36,1) both;
    transition:transform .14s ease, border-color .15s ease; }
.pdf-tile:active{ transform:scale(.98); }
@media (hover:hover){ .pdf-tile:hover{ border-color:var(--border-strong); } }
.pdf-tile .t-ico{ width:46px; height:46px; border-radius:13px; display:grid; place-items:center; overflow:hidden; flex-shrink:0; }
.pdf-tile .t-ico img{ width:100%; height:100%; object-fit:cover; display:block; }
.pdf-tile .t-ico svg{ width:23px; height:23px; }
.pdf-tile .t-title{ font-size:14.5px; font-weight:800; line-height:1.25; letter-spacing:-.1px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pdf-tile .t-sub{ font-size:11.5px; font-weight:600; color:var(--text-3); line-height:1.35; margin-top:-6px;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pdf-tile .t-foot{ margin-top:auto; display:flex; align-items:center; justify-content:space-between; gap:6px;
    font-size:11.5px; font-weight:700; color:var(--text-2); }
.pdf-tile .t-foot svg{ width:16px; height:16px; color:var(--text-3); }
.pdf-tile .t-badge{ position:absolute; top:10px; right:10px; font-size:9.5px; font-weight:800; letter-spacing:.5px;
    padding:3px 7px; border-radius:999px; background:var(--emerald-soft); color:var(--emerald-strong); }
.pdf-tile.soon{ cursor:default; }
.pdf-tile.soon .t-ico, .pdf-tile.soon .t-title{ opacity:.55; }
.pdf-tile.soon .t-badge{ background:var(--surface-2); color:var(--text-3); }
/* t227: title+sub wrapper is invisible in the tile look (children act as before) */
.pdf-tile .t-main{ display:contents; }
.pdf-tile .t-nb, .pdf-tile .t-cnt{ display:none; }
/* t227: phones < 600 px → one card per row, same look as the exams page cards (logo · title + sub · count · chevron) */
@media all{ /* t245: list-card look on every screen size (was phones only) */
  .pdf-tile{ flex-direction:row; align-items:center; gap:13px; padding:14px; border-radius:14px; }
  .pdf-tile .t-badge{ display:none; }
  .pdf-tile .t-ico{ width:44px; height:44px; border-radius:12px; }
  .pdf-tile .t-ico svg{ width:21px; height:21px; }
  .pdf-tile .t-main{ display:block; flex:1; min-width:0; }
  .pdf-tile .t-title{ display:flex; align-items:center; gap:7px; flex-wrap:wrap; font-size:14.5px; font-weight:700; line-height:1.3; }
  .pdf-tile .t-nb{ display:inline-block; font-size:8.5px; font-weight:800; letter-spacing:.7px; text-transform:uppercase; padding:3px 7px;
      border-radius:999px; line-height:1; white-space:nowrap; background:var(--emerald-soft); color:var(--emerald-strong); }
  .pdf-tile .t-nb.soon{ background:var(--amber-soft); color:var(--amber-strong); }
  .pdf-tile .t-sub{ margin-top:3px; font-size:11.5px; -webkit-line-clamp:1; }
  .pdf-tile .t-foot{ margin:0; flex-shrink:0; gap:8px; }
  .pdf-tile .t-txt{ display:none; }
  .pdf-tile .t-cnt{ display:inline-block; font-size:10.5px; font-weight:800; color:var(--primary); background:var(--primary-soft);
      border-radius:999px; padding:4px 9px; font-variant-numeric:tabular-nums; }
  .pdf-tile .t-foot svg{ width:18px; height:18px; }
  .pdf-tile.soon .t-foot svg{ display:none; }
  .pdf-tile.soon .t-title{ opacity:1; }
  .pdf-tile.soon .t-title, .pdf-tile.soon .t-ico{ opacity:.72; }
}
body.dark-mode .pdf-tile .t-nb{ color:#34d399; }
body.dark-mode .pdf-tile .t-nb.soon{ color:#fbbf24; }

/* ── folder rows (list) ────────────────────────────────────────────────── */
.pdf-rows{ display:grid; grid-template-columns:1fr; gap:8px; }
@media (min-width:900px){ .pdf-rows{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } }
.pdf-row{ display:flex; align-items:center; gap:12px; padding:12px 12px 12px 12px; min-width:0;
    background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-card);
    color:var(--text); text-decoration:none; cursor:pointer; animation:cardIn .32s cubic-bezier(.22,1,.36,1) both; }
.pdf-row:active{ transform:scale(.99); }
.pdf-row .r-ico{ width:40px; height:40px; border-radius:11px; display:grid; place-items:center; overflow:hidden; flex-shrink:0; }
.pdf-row .r-ico img{ width:100%; height:100%; object-fit:cover; }
.pdf-row .r-ico svg{ width:20px; height:20px; }
.pdf-row .r-main{ flex:1; min-width:0; }
.pdf-row .r-title{ font-size:14.5px; font-weight:700; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pdf-row .r-sub{ font-size:12px; font-weight:600; color:var(--text-3); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pdf-row .r-end{ display:flex; align-items:center; gap:6px; flex-shrink:0; color:var(--text-3); font-size:12px; font-weight:700; }
.pdf-row .r-end svg{ width:18px; height:18px; }
.pdf-row .r-badge{ font-size:9.5px; font-weight:800; letter-spacing:.5px; padding:3px 7px; border-radius:999px; background:var(--emerald-soft); color:var(--emerald-strong); }
.pdf-row.soon{ cursor:default; }
.pdf-row.soon .r-ico, .pdf-row.soon .r-title{ opacity:.55; }
.pdf-row.soon .r-badge{ background:var(--surface-2); color:var(--text-3); }
.pdf-row .r-path{ font-size:11px; font-weight:700; color:var(--primary); margin-bottom:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* pills layout (e.g. years) */
.pdf-pills{ display:flex; flex-wrap:wrap; gap:8px; }
.pdf-pill{ display:inline-flex; align-items:center; gap:7px; height:38px; padding:0 15px; border-radius:999px;
    background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-card); color:var(--text);
    font-size:13.5px; font-weight:700; text-decoration:none; cursor:pointer; }
.pdf-pill small{ font-size:11px; font-weight:800; color:var(--text-3); }
.pdf-pill.soon{ opacity:.55; cursor:default; }

/* icon colours */
.c-blue  { background:rgba(61,90,254,.10);  color:#3d5afe; }
.c-green { background:rgba(16,185,129,.12); color:#059669; }
.c-teal  { background:rgba(20,184,166,.12); color:#0d9488; }
.c-amber { background:rgba(245,158,11,.14); color:#d97706; }
.c-rose  { background:rgba(225,29,72,.10);  color:#e11d48; }
.c-violet{ background:rgba(139,92,246,.12); color:#7c3aed; }
.c-indigo{ background:rgba(79,70,229,.11);  color:#4f46e5; }
.c-orange{ background:rgba(249,115,22,.12); color:#ea580c; }
.c-slate { background:rgba(100,116,139,.12); color:#475569; }
.c-sky   { background:rgba(14,165,233,.12); color:#0284c7; }
body.dark-mode .c-blue{ color:#8ea0ff; } body.dark-mode .c-green{ color:#34d399; } body.dark-mode .c-teal{ color:#2dd4bf; }
body.dark-mode .c-amber{ color:#fbbf24; } body.dark-mode .c-rose{ color:#fb7185; } body.dark-mode .c-violet{ color:#a78bfa; }
body.dark-mode .c-indigo{ color:#a5b4fc; } body.dark-mode .c-orange{ color:#fb923c; } body.dark-mode .c-slate{ color:#94a3b8; }
body.dark-mode .c-sky{ color:#38bdf8; }

/* ── PDF card (live-mock card v2 language, solid) ──────────────────────── */
.pdf-cards{ display:grid; grid-template-columns:1fr; gap:10px; }
@media (min-width:900px){ .pdf-cards{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; } }
@media (min-width:1500px){ .pdf-cards{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
.pc-card{ display:flex; flex-direction:column; min-width:0; padding:14px 16px 0; overflow:hidden;
    background:var(--surface); border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--shadow-card);
    animation:cardIn .36s cubic-bezier(.22,1,.36,1) both; }
.pc-top{ display:flex; align-items:flex-start; gap:12px; }
.pc-thumb{ position:relative; width:46px; height:54px; border-radius:10px; flex-shrink:0; overflow:hidden;
    display:grid; place-items:center; background:rgba(225,29,72,.08); color:#e11d48; border:1px solid rgba(225,29,72,.14); }
.pc-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.pc-thumb svg{ width:22px; height:22px; margin-top:-8px; }
.pc-thumb b{ position:absolute; bottom:6px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:900; letter-spacing:.6px; }
.pc-card.is-paid .pc-thumb{ background:rgba(217,119,6,.09); color:#d97706; border-color:rgba(217,119,6,.18); }
body.dark-mode .pc-thumb{ background:rgba(251,113,133,.12); color:#fb7185; border-color:rgba(251,113,133,.2); }
body.dark-mode .pc-card.is-paid .pc-thumb{ background:rgba(251,191,36,.12); color:#fbbf24; border-color:rgba(251,191,36,.22); }
.pc-info{ flex:1; min-width:0; }
.pc-top.solo{ align-items:center; }   /* no sub / path → title sits in the middle of the PDF icon */
.pc-title{ font-size:13px; font-weight:600; line-height:1.32; letter-spacing:-.1px; color:#0b1220;
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pc-sub{ margin-top:2px; font-size:11.5px; font-weight:500; line-height:1.35; color:var(--text-2);
    display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pc-path{ font-size:10.5px; font-weight:700; color:var(--primary); margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pc-badges{ display:flex; flex-direction:column; align-items:flex-end; gap:5px; flex-shrink:0; }
.pc-badges .badge-type{ font-size:9.5px; padding:2px 7px; }
.pc-new{ font-size:9.5px; font-weight:800; letter-spacing:.5px; padding:2px 7px; border-radius:6px; background:var(--primary-soft); color:var(--primary); }
.pc-card .lv-meta{ margin-top:10px; }
.pc-actions{ display:flex; gap:8px; padding-top:14px; margin-top:auto; }
.pc-btn{ flex:1; min-width:0; box-sizing:border-box; display:inline-flex; align-items:center; justify-content:center; gap:7px;
    height:42px; border-radius:999px; border:0; font:inherit; font-size:13.5px; font-weight:700; letter-spacing:.1px;
    cursor:pointer; text-decoration:none; position:relative; overflow:hidden; transition:transform .12s ease, filter .15s ease;
    -webkit-tap-highlight-color:transparent; white-space:nowrap; }
.pc-btn svg{ width:17px; height:17px; flex-shrink:0; }
.pc-btn:active{ transform:scale(.97); }
.pc-btn.open{ background:var(--primary-soft); color:var(--primary); }
.pc-btn.dl{ background:var(--primary); color:#fff; box-shadow:0 4px 12px rgba(61,90,254,.26); }
.pc-btn.saved{ background:var(--emerald-soft); color:var(--emerald-strong); box-shadow:none; }
.pc-btn.upd{ background:#d97706; color:#fff; box-shadow:0 4px 12px rgba(217,119,6,.26); }
.pc-btn.buy{ background:#d97706; color:#fff; box-shadow:0 4px 12px rgba(217,119,6,.28); }
body.dark-mode .pc-btn.buy, body.dark-mode .pc-btn.upd{ background:#fbbf24; color:#111827; }
.pc-btn.danger{ background:rgba(225,29,72,.09); color:var(--red); }
.pc-btn.ghost{ background:var(--surface-2); color:var(--text-2); }
.pc-btn[disabled]{ opacity:.6; pointer-events:none; }
.pc-btn .prog{ position:absolute; left:0; top:0; bottom:0; width:0; background:rgba(255,255,255,.22); transition:width .2s ease; }
.pc-btn.busy{ pointer-events:none; }
@media (hover:hover){ .pc-btn.dl:hover, .pc-btn.buy:hover, .pc-btn.upd:hover{ filter:brightness(1.06); } .pc-btn.open:hover{ filter:brightness(.97); } }
.pc-card .lv-foot{ margin-top:14px; }
.pc-state{ display:inline-flex; align-items:center; gap:6px; min-width:0; font-size:12px; font-weight:600; color:var(--text-2);
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pc-state svg{ width:14px; height:14px; flex-shrink:0; color:var(--text-3); }
.pc-state.ok{ color:var(--emerald-strong); } .pc-state.ok svg{ color:var(--emerald-strong); }
.pc-state.warn{ color:var(--amber-strong); } .pc-state.warn svg{ color:var(--amber-strong); }
.pc-state.bad{ color:var(--red); } .pc-state.bad svg{ color:var(--red); }
.pc-foot-btns{ display:flex; align-items:center; gap:2px; flex-shrink:0; }

/* ── skeleton ──────────────────────────────────────────────────────────── */
.pdf-skel{ height:74px; border-radius:var(--r-card); background:var(--surface); border:1px solid var(--border); position:relative; overflow:hidden; }
.pdf-skel::after{ content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent,var(--surface-2),transparent); animation:shimmer 1.2s infinite; }

/* ── empty / info states ───────────────────────────────────────────────── */
.pdf-empty{ text-align:center; padding:48px 18px 30px; }
.pdf-empty .e-ico{ width:68px; height:68px; margin:0 auto 14px; border-radius:50%; display:grid; place-items:center; background:var(--primary-soft); color:var(--primary); }
.pdf-empty .e-ico svg{ width:30px; height:30px; }
.pdf-empty h3{ margin:0 0 6px; font-size:17px; font-weight:700; color:var(--text); }
.pdf-empty p{ margin:0 auto; max-width:300px; font-size:13.5px; line-height:1.5; color:var(--text-2); }
.pdf-empty .pc-btn{ display:inline-flex; flex:none; min-width:180px; margin-top:18px; padding:0 22px; }

/* ── downloads page ────────────────────────────────────────────────────── */
.dl-usage{ display:flex; align-items:center; gap:14px; padding:14px 16px; margin-bottom:12px; background:var(--surface);
    border:1px solid var(--border); border-radius:var(--r-card); box-shadow:var(--shadow-card); }
.dl-usage .u-ico{ width:44px; height:44px; border-radius:13px; display:grid; place-items:center; flex-shrink:0; }
.dl-usage .u-ico svg{ width:22px; height:22px; }
.dl-usage .u-main{ flex:1; min-width:0; }
.dl-usage .u-title{ font-size:15px; font-weight:800; }
.dl-usage .u-sub{ font-size:12px; font-weight:600; color:var(--text-3); margin-top:2px; }
.dl-usage .u-bar{ height:6px; border-radius:99px; background:var(--surface-2); margin-top:8px; overflow:hidden; display:flex; }
.dl-usage .u-bar i{ display:block; height:100%; }
.dl-usage .u-del{ flex-shrink:0; height:36px; padding:0 13px; border-radius:999px; border:1px solid var(--border); background:var(--surface);
    color:var(--red); font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.dl-legend{ display:flex; gap:12px; margin-top:6px; font-size:11px; font-weight:700; color:var(--text-3); }
.dl-legend span{ display:inline-flex; align-items:center; gap:5px; }
.dl-legend i{ width:8px; height:8px; border-radius:50%; display:inline-block; }
.dl-note{ display:flex; gap:10px; align-items:flex-start; margin:14px 2px 0; font-size:12px; line-height:1.5; color:var(--text-3); font-weight:500; }
.dl-note svg{ width:16px; height:16px; flex-shrink:0; margin-top:1px; }
.pc-icon-btn{ width:38px; height:38px; border:0; border-radius:999px; background:none; display:grid; place-items:center; color:var(--text-2); cursor:pointer; }
.pc-icon-btn svg{ width:18px; height:18px; }
.pc-icon-btn:active{ background:var(--surface-2); }
.pc-icon-btn.del{ color:var(--red); }
@media (hover:hover){ .pc-icon-btn:hover{ background:var(--surface-2); } }

/* ── bottom dock (same language as reports / upload docks) ─────────────── */
.pdf-dock{ position:fixed; left:50%; transform:translateX(-50%); bottom:calc(12px + env(safe-area-inset-bottom)); z-index:1200;
    display:flex; align-items:stretch; justify-content:space-between; width:min(calc(100vw - 20px), 520px);
    background:var(--surface); border:1px solid var(--border); border-radius:26px; padding:8px 10px;
    box-shadow:0 18px 40px rgba(15,23,42,.16); }
body.dark-mode .pdf-dock{ box-shadow:0 18px 44px rgba(0,0,0,.5); }
.pdf-dock a, .pdf-dock button{ position:relative; flex:1; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
    gap:3px; padding:9px 2px 11px; border-radius:16px; color:var(--text-3); text-decoration:none; font:inherit; font-size:10.5px; font-weight:700;
    letter-spacing:.2px; background:none; border:0; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.pdf-dock svg{ width:22px; height:22px; }
.pdf-dock .active{ color:var(--primary); }
.pdf-dock .active::after{ content:''; position:absolute; bottom:3px; left:50%; transform:translateX(-50%); width:4px; height:4px; border-radius:50%; background:var(--primary); }
.pdf-dock .d-badge{ position:absolute; top:4px; left:calc(50% + 6px); min-width:16px; height:16px; padding:0 4px; border-radius:99px;
    background:var(--red); color:#fff; font-size:9.5px; font-weight:800; line-height:16px; text-align:center; }
.pdf-dock .d-get{ color:var(--emerald-strong); }
@media (max-width:379.98px){ .pdf-dock{ padding:7px 6px; border-radius:22px; } .pdf-dock a, .pdf-dock button{ font-size:9.5px; } }

/* ── bottom sheet (solid, dim only — no blur) ──────────────────────────── */
.pdf-sheet-layer{ position:fixed; inset:0; z-index:3000; display:flex; align-items:flex-end; justify-content:center; }
.pdf-sheet-dim{ position:absolute; inset:0; background:rgba(8,12,26,.48); animation:fade .18s ease both; }
.pdf-sheet{ position:relative; width:100%; max-width:520px; background:var(--surface); color:var(--text);
    border-radius:22px 22px 0 0; padding:10px 20px calc(20px + env(safe-area-inset-bottom));
    box-shadow:0 -10px 40px rgba(0,0,0,.18); animation:sheetUp .26s cubic-bezier(.22,1,.36,1) both; }
@media (min-width:640px){ .pdf-sheet-layer{ align-items:center; } .pdf-sheet{ border-radius:22px; padding-bottom:20px; } }
.pdf-sheet .grab{ width:40px; height:4px; border-radius:99px; background:var(--border-strong); margin:0 auto 14px; }
.pdf-sheet .s-ico{ width:60px; height:60px; border-radius:18px; display:grid; place-items:center; margin:4px auto 12px; }
.pdf-sheet .s-ico svg{ width:28px; height:28px; }
.pdf-sheet .s-ico img{ width:60px; height:60px; border-radius:16px; }
.pdf-sheet h3{ margin:0; text-align:center; font-size:17.5px; font-weight:800; letter-spacing:-.2px; line-height:1.3; }
.pdf-sheet p{ margin:8px auto 0; text-align:center; font-size:13.5px; line-height:1.55; color:var(--text-2); max-width:380px; }
.pdf-sheet .s-body{ margin-top:12px; }
.pdf-sheet .s-acts{ display:flex; flex-direction:column; gap:9px; margin-top:18px; }
.pdf-sheet .s-acts .pc-btn{ flex:none; width:100%; height:46px; font-size:14.5px; }
.pdf-sheet .s-file{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:14px; background:var(--surface-2); border:1px solid var(--border); margin-top:14px; text-align:left; }
.pdf-sheet .s-file .pc-thumb{ width:40px; height:46px; }
.pdf-sheet .s-file .f-t{ font-size:14px; font-weight:700; line-height:1.3; }
.pdf-sheet .s-file .f-s{ font-size:12px; color:var(--text-3); font-weight:600; margin-top:2px; }
.play-btn{ display:flex; align-items:center; justify-content:center; gap:10px; height:52px; border-radius:14px; background:#0e1428; color:#fff;
    text-decoration:none; font-weight:700; }
body.dark-mode .play-btn{ background:#fff; color:#0e1428; }
.play-btn svg{ width:26px; height:26px; }
.play-btn span{ display:flex; flex-direction:column; line-height:1.1; text-align:left; }
.play-btn small{ font-size:10px; font-weight:600; opacity:.8; letter-spacing:.3px; }
.play-btn b{ font-size:16px; }
.pdf-sheet .s-list{ list-style:none; margin:14px 0 0; padding:0; display:grid; gap:8px; }
.pdf-sheet .s-list li{ display:flex; gap:10px; align-items:flex-start; font-size:13px; font-weight:600; color:var(--text-2); line-height:1.4; }
.pdf-sheet .s-list li svg{ width:18px; height:18px; flex-shrink:0; color:var(--emerald-strong); }
.pdf-sheet input.s-input{ width:100%; height:46px; border-radius:12px; border:1px solid var(--border); background:var(--surface-2);
    color:var(--text); font:inherit; font-size:16px; font-weight:700; text-align:center; outline:none; margin-top:14px; }

/* ═══ VIEWER (PDF.js viewer component — pages shown exactly as uploaded) ═══ */
body.pdf-viewer{ background:#e9ecf3; }
body.pdf-viewer.dark-mode{ background:#060a16; }
.pv-head{ position:relative; }
.pv-progress{ position:absolute; left:0; bottom:-1px; height:2px; width:0; background:var(--primary); transition:width .2s ease, opacity .3s; z-index:2; }
.pv-stage{ position:relative; flex:1; min-height:0; overflow:hidden; }
.pv-scroll{ position:absolute; inset:0; overflow:auto; -webkit-overflow-scrolling:touch; touch-action:pan-x pan-y;
    scrollbar-width:none; padding:0; }
.pv-scroll::-webkit-scrollbar{ display:none; }
.pv-scroll .pdfViewer{ padding:10px 0 calc(110px + env(safe-area-inset-bottom)); }
.pv-scroll .pdfViewer.removePageBorders .page{ margin:0 auto 10px; box-shadow:0 1px 3px rgba(0,0,0,.08), 0 6px 18px rgba(15,23,42,.08); }
body.dark-mode .pv-scroll .pdfViewer .page{ box-shadow:0 1px 3px rgba(0,0,0,.5); }
.pv-scroll .pdfViewer .page .loadingIcon{ background:none; }
body.pv-night .pdfViewer .page canvas{ filter:invert(1) hue-rotate(180deg); }
body.pv-night .pdfViewer .page{ background:#111 !important; }
.pdfViewer .textLayer .highlight{ background-color:rgba(255,196,0,.45); border-radius:2px; }
.pdfViewer .textLayer .highlight.selected{ background-color:rgba(61,90,254,.45); }
body.pv-premium .pdfViewer .textLayer{ -webkit-user-select:none; user-select:none; }     /* premium: no copy */
.pv-pages{ position:absolute; inset:0; overflow:auto; background:inherit; z-index:3; }
.pv-pages:empty{ display:none; }
.pv-skel{ width:min(860px, calc(100% - 16px)); aspect-ratio:1/1.414; margin:10px auto; border-radius:4px;
    background:linear-gradient(90deg,#fff,#f3f5fb,#fff); background-size:200% 100%; animation:shimmer 1.2s infinite; }
body.dark-mode .pv-skel{ background:linear-gradient(90deg,#141a2b,#1b2338,#141a2b); background-size:200% 100%; }
.pv-pagechip{ display:inline-flex; align-items:center; gap:4px; height:30px; padding:0 11px; border-radius:999px; border:1px solid var(--border);
    background:var(--surface-2); color:var(--text); font:inherit; font-size:12.5px; font-weight:800; cursor:pointer; font-variant-numeric:tabular-nums; flex-shrink:0; }
.pv-lock, .pv-sess{ display:inline-flex; align-items:center; gap:5px; font-size:11.5px; font-weight:700; color:var(--emerald-strong); }
.pv-sess{ color:var(--text-3); }
.pv-lock svg, .pv-sess svg{ width:13px; height:13px; }
.pv-center{ min-height:100%; display:flex; align-items:center; justify-content:center; padding:20px; box-sizing:border-box; }
.pv-center .pc-card{ width:100%; max-width:420px; padding-bottom:16px; }
.pv-obar{ height:6px; border-radius:99px; background:var(--surface-2); overflow:hidden; margin:16px 0 8px; }
.pv-obar i{ display:block; height:100%; width:4%; border-radius:99px; background:var(--grad-primary); transition:width .2s; }
.pv-otxt{ text-align:center; font-size:12.5px; font-weight:700; color:var(--text-3); }

/* search inside the PDF (row under the app bar) */
.pv-find{ display:flex; align-items:center; gap:4px; padding:0 10px 10px; }
body.pdf-viewer .appbar-actions{ gap:6px; }
.pv-sbtn{ width:38px; height:38px; flex-shrink:0; }
.pv-sbtn svg{ width:20px; height:20px; }
.pv-sbtn.on{ background:var(--primary-soft); color:var(--primary); border-color:transparent; }
.pv-find{ animation:pvFindIn .16s ease; }
@keyframes pvFindIn{ from{ opacity:0; transform:translateY(-6px); } to{ opacity:1; transform:none; } }
.pv-find-box{ position:relative; flex:1; min-width:0; }
.pv-find-box input{ width:100%; height:40px; border-radius:12px; border:1px solid var(--border); background:var(--surface-2); color:var(--text);
    font:inherit; font-size:14px; font-weight:500; padding:0 78px 0 38px; outline:none; -webkit-appearance:none; appearance:none; box-sizing:border-box; }
.pv-find-box input:focus{ border-color:var(--primary); background:var(--surface); box-shadow:0 0 0 3px var(--primary-soft); }
.pv-find-box input::-webkit-search-cancel-button{ display:none; }
.pv-find-box .s-ico{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:17px; height:17px; color:var(--text-3); pointer-events:none; }
.pv-find-count{ position:absolute; right:12px; top:50%; transform:translateY(-50%); font-size:12px; font-weight:800; color:var(--text-3); font-variant-numeric:tabular-nums; }
.pv-find-count.none{ color:#e11d48; }
.pv-find .icon-btn{ width:38px; height:38px; flex-shrink:0; }
.pv-find .icon-btn svg{ width:20px; height:20px; }

/* Drive-style side scroller: half-round tab on the right edge (⌃⌄) + "3 / 6" pill.
   Shown ONLY while the user scrolls by hand; hides 2 s after the finger is lifted. */
.pv-scrub{ position:absolute; top:12px; right:0; bottom:calc(96px + env(safe-area-inset-bottom)); width:56px; z-index:4; pointer-events:none;
    opacity:0; transition:opacity .25s ease; }
.pv-scrub.show{ opacity:1; }
.pv-thumb{ position:absolute; right:0; top:0; width:42px; height:64px; border-radius:32px 0 0 32px; pointer-events:auto; touch-action:none; cursor:grab;
    background:#e3e9fb; color:#1f2a44; box-shadow:0 1px 4px rgba(15,23,42,.10); display:grid; place-items:center; -webkit-tap-highlight-color:transparent; }
.pv-scrub:not(.show) .pv-thumb{ pointer-events:none; }
.pv-grip{ display:grid; place-items:center; margin-left:3px; }
.pv-grip svg{ width:22px; height:22px; }
.pv-scrub.drag .pv-thumb{ cursor:grabbing; background:#d6defa; }
.pv-bubble{ position:absolute; right:52px; top:50%; transform:translateY(-50%); white-space:nowrap; pointer-events:none;
    background:#e3e9fb; color:#1f2a44; font-size:13.5px; font-weight:500; padding:5px 13px; border-radius:999px; font-variant-numeric:tabular-nums;
    box-shadow:0 1px 4px rgba(15,23,42,.10); }
body.dark-mode .pv-thumb, body.dark-mode .pv-bubble{ background:#26324f; color:#e5e9f5; box-shadow:0 1px 4px rgba(0,0,0,.4); }
body.dark-mode .pv-scrub.drag .pv-thumb{ background:#2f3d61; }

/* page not drawn yet (jump to a far page / slow net) → spinner + "Loading page N…", never an error */
.pdfViewer .page.loadingIcon::after{ background:none; }
.pdfViewer .page.loading::before, .pdfViewer .page.pv-wait::before{ content:""; position:absolute; left:50%; top:calc(50% - 26px); width:34px; height:34px; margin-left:-17px;
    border-radius:50%; border:3px solid rgba(61,90,254,.18); border-top-color:#3d5afe; animation:pvSpin .8s linear infinite; z-index:6; }
.pdfViewer .page.loading::after, .pdfViewer .page.pv-wait::after{ content:"Loading page " attr(data-page-number) "…"; display:flex; align-items:center; justify-content:center;
    padding-top:52px; box-sizing:border-box; font-size:13px; font-weight:600; color:#64748b; }
.pdfViewer .page.pv-wait::after{ position:absolute; inset:0; z-index:5; }
@keyframes pvSpin{ to{ transform:rotate(360deg); } }

/* blue ☰ options button (tilts open, options float up as blue buttons) */
.pv-scrim{ position:fixed; inset:0; z-index:1190; background:rgba(8,12,24,.28); opacity:0; pointer-events:none; transition:opacity .2s; }
.pv-scrim.on{ opacity:1; pointer-events:auto; }
.pv-fab{ position:fixed; right:16px; bottom:calc(18px + env(safe-area-inset-bottom)); z-index:1200; display:flex; flex-direction:column; align-items:flex-end; }
.pv-fab-main{ width:56px; height:56px; border-radius:50%; border:0; cursor:pointer; color:#fff; background:var(--grad-primary);
    display:grid; place-items:center; box-shadow:0 8px 22px rgba(48,80,232,.45); transition:transform .28s cubic-bezier(.34,1.56,.64,1); -webkit-tap-highlight-color:transparent; }
.pv-fab-main svg{ width:24px; height:24px; }
.pv-fab.open .pv-fab-main{ transform:rotate(90deg); }
.pv-fab-main:active{ filter:brightness(.95); }
.pv-fab-items{ display:flex; flex-direction:column-reverse; align-items:flex-end; gap:10px; margin-bottom:12px; pointer-events:none; }
.pv-fab-item{ pointer-events:none; }
.pv-fab.open .pv-fab-item{ pointer-events:auto; }
.pv-fab-item{ display:flex; align-items:center; gap:10px; border:0; background:none; padding:0; cursor:pointer; font:inherit;
    opacity:0; transform:translateY(14px) scale(.6); transition:opacity .18s ease, transform .22s cubic-bezier(.34,1.56,.64,1);
    transition-delay:0s; -webkit-tap-highlight-color:transparent; }
.pv-fab.open .pv-fab-item{ opacity:1; transform:none; transition-delay:calc(var(--i) * 28ms); }
.pv-fab-item .dot{ width:46px; height:46px; margin-right:5px; border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--grad-primary);
    box-shadow:0 6px 16px rgba(48,80,232,.38); }
.pv-fab-item .dot svg{ width:21px; height:21px; }
.pv-fab-item .lbl{ background:var(--surface); color:var(--text); font-size:13px; font-weight:700; padding:7px 12px; border-radius:10px;
    box-shadow:0 4px 14px rgba(15,23,42,.16); white-space:nowrap; }
.pv-fab-item:active .dot{ transform:scale(.92); }
body.pv-finding .pv-fab{ display:none; }

/* ── tabs: premium tab colour ──────────────────────────────────────────── */
.live-tab svg{ flex-shrink:0; }
.live-tab.active[data-tab="paid"]{ background:linear-gradient(135deg,#f59e0b,#d97706); box-shadow:0 4px 12px rgba(217,119,6,.30); }
.pdf-page .live-tabs a.live-tab{ text-decoration:none; }
/* viewer header: keep the title readable on small phones */
@media (max-width:420px){ body.pdf-viewer .appbar .brand-title{ font-size:15px; } body.pdf-viewer .pv-pagechip{ padding:0 9px; font-size:12px; } }
/* PDF.js component css sets .pdfViewer .page border/margins; keep our toasts above the FAB */
body.pdf-viewer #toastRoot{ bottom:calc(88px + env(safe-area-inset-bottom)); }
.pdf-page [hidden]{ display:none !important; }
.pdf-search input::-webkit-search-cancel-button, .pdf-search input::-webkit-search-decoration{ -webkit-appearance:none; appearance:none; display:none; }
/* toasts sit above the dock / viewer tools */
body.pdf-page #toastRoot{ bottom:calc(104px + env(safe-area-inset-bottom)); z-index:3100; }
.pc-btn.busy{ font-size:12.5px; }
/* file box also used outside the sheet (viewer panels) */
.s-file{ display:flex; align-items:center; gap:12px; padding:12px; border-radius:14px; background:var(--surface-2); border:1px solid var(--border); margin-top:14px; text-align:left; }
.s-file .pc-thumb{ width:40px; height:46px; }
.s-file .f-t{ font-size:14px; font-weight:700; line-height:1.3; color:var(--text); }
.s-file .f-s{ font-size:12px; color:var(--text-3); font-weight:600; margin-top:2px; }
.pv-center .pc-actions{ flex-direction:column; }
.pv-center .pc-actions .pc-btn, .pv-center .pc-actions .play-btn{ flex:none; width:100%; height:46px; }
.pv-center .pc-actions .play-btn{ height:52px; }
/* wide screens: header rows line up with the 1180px content column */
/* (t217 v2) tools moved out of the header — no header alignment rules needed */


body.dark-mode .pc-title{ color:#f8fafc; }
