@font-face{font-family:'Sarabun';src:url(../fonts/Sarabun-Regular.woff) format('woff');font-weight:400;font-display:swap}
@font-face{font-family:'Sarabun';src:url(../fonts/Sarabun-Bold.woff) format('woff');font-weight:700;font-display:swap}
@font-face{font-family:'Kanit';src:url(../fonts/Kanit-Medium.woff) format('woff');font-weight:500;font-display:swap}

:root{
  --app-bg:#f3f6fb;--app-ink:#17233f;--app-muted:#5b6780;--app-line:#dde4f0;
  --brand:#1f5fbf;--brand-2:#0f9d8a;--accent:#e4572e;
  --bs-body-font-family:'Sarabun',system-ui,-apple-system,'Segoe UI',Tahoma,sans-serif;
  --bs-primary:#1f5fbf;--bs-primary-rgb:31,95,191;--bs-link-color:#1f5fbf;--bs-link-color-rgb:31,95,191;
  --bs-border-radius:.7rem;--bs-border-radius-lg:1rem
}
body{background:var(--app-bg);color:var(--app-ink);font-size:16.5px;min-height:100vh;display:flex;flex-direction:column}
main{flex:1}
h1,h2,h3,h4,.h1,.h2,.h3,.h4,.navbar-brand b{font-family:'Kanit','Sarabun',sans-serif;font-weight:500}
.btn-primary{--bs-btn-bg:#1f5fbf;--bs-btn-border-color:#1f5fbf;--bs-btn-hover-bg:#184e9e;--bs-btn-hover-border-color:#184e9e;--bs-btn-active-bg:#143f80}
.btn{font-weight:700}
.app-nav{background:linear-gradient(110deg,#0f3d91,#1f6fd1 60%,#2f9be8);box-shadow:0 2px 12px rgba(10,30,70,.18)}
.role-student .app-nav{background:linear-gradient(110deg,#00695c,#00a07a 60%,#26b6c9)}
.brand-logo{height:42px;width:auto;background:#fff;border-radius:10px;padding:2px 4px}
.navbar-brand small{font-size:.75rem;opacity:.9}
.app-nav .nav-link{font-weight:700;border-radius:.6rem;padding:.4rem .75rem!important}
.app-nav .nav-link.active{background:rgba(255,255,255,.18)}
.app-footer{color:var(--app-muted);font-size:.85rem;padding:18px 0 26px;text-align:center}
.page-head{margin-bottom:1.1rem}
.page-head h1{font-size:1.6rem;margin:0}
.card{border:1px solid var(--app-line);border-radius:1rem;box-shadow:0 4px 18px rgba(23,35,63,.05)}
.card-header{background:#fff;border-bottom:1px solid var(--app-line);font-family:'Kanit';font-weight:500;border-radius:1rem 1rem 0 0!important}
.stat{display:flex;gap:14px;align-items:center}
.stat .ic{width:52px;height:52px;border-radius:14px;display:flex;align-items:center;justify-content:center;font-size:1.5rem;color:#fff;flex:none}
.stat b{font-family:'Kanit';font-weight:500;font-size:1.6rem;line-height:1}
.empty-state{text-align:center;padding:48px 16px;color:var(--app-muted)}
.empty-state i{font-size:2.8rem;display:block;margin-bottom:8px;opacity:.6}
.subject-banner{background:linear-gradient(115deg,var(--sc,#1f5fbf),color-mix(in srgb,var(--sc,#1f5fbf) 55%,#26c6da));color:#fff;border-radius:1rem;padding:16px 20px;margin-bottom:12px}
.subject-tabs{gap:4px;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
@media (min-width:1200px){.subject-tabs{flex-wrap:wrap;overflow:visible}}
.subject-tabs .nav-link{white-space:nowrap;font-weight:700;color:var(--app-ink);background:#fff;border:1px solid var(--app-line)}
.subject-tabs .nav-link.active{background:var(--brand);border-color:var(--brand);color:#fff}
.subject-card{border-top:5px solid var(--sc,#1f5fbf);height:100%}
.subject-card .badge{font-weight:600}
.table{--bs-table-bg:transparent}
.table thead th{font-family:'Kanit';font-weight:500;background:#eef3fb;border-bottom-width:1px;white-space:nowrap}
.table-sm td,.table-sm th{padding:.4rem .5rem}
.form-label{font-weight:700;margin-bottom:.25rem}
.form-text{color:var(--app-muted)}
kbd{display:inline-block;font-family:'Sarabun';font-weight:700;font-size:.85em;line-height:1.2;padding:.05em .45em;margin:0 .05em;border:1px solid #9aa7b8;border-bottom-width:3px;border-radius:6px;background:#fff;color:#17233f}
.md h3,.md h4,.md h5{margin:1rem 0 .5rem;color:var(--sc,#1f5fbf)}
.md p{margin:.4rem 0}
.md ol.md-steps{list-style:none;padding:0;margin:.3rem 0 .6rem;counter-reset:none}
.md ol.md-steps li{position:relative;padding:.15rem 0 .45rem 2.4rem}
.md ol.md-steps li::before{content:attr(data-n);position:absolute;left:0;top:.1rem;width:1.75rem;height:1.75rem;border-radius:50%;background:var(--sc,#1f5fbf);color:#fff;font-weight:700;font-size:.85rem;display:flex;align-items:center;justify-content:center}
.md-note{background:#fff8e1;border:1px solid #ffcc80;border-radius:.7rem;padding:.5rem .8rem;margin:.6rem 0}
.challenge{background:linear-gradient(90deg,#fff4d6,#ffe9f1);border:1.5px dashed #f29fb8;border-radius:.8rem;padding:.6rem .9rem}
.video-wrap{position:relative;aspect-ratio:16/9;border-radius:.8rem;overflow:hidden;background:#0f2a5c}
.video-wrap iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.media-item{display:flex;gap:12px;align-items:center;padding:10px;border:1px solid var(--app-line);border-radius:.8rem;background:#fff;text-decoration:none;color:inherit}
.media-item:hover{border-color:var(--brand)}
.media-item .thumb{width:112px;flex:none;aspect-ratio:16/9;border-radius:.5rem;background:#1f3f7a center/cover no-repeat;display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.6rem}
.lesson-row{display:flex;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--app-line);text-decoration:none;color:inherit}
.lesson-row:last-child{border-bottom:0}
.lesson-row:hover{background:#f7faff}
.lesson-row .no{width:42px;height:42px;border-radius:12px;background:#eef3fb;color:var(--brand);font-family:'Kanit';display:flex;align-items:center;justify-content:center;flex:none}
.lesson-row.done .no{background:#e3f6ec;color:#1a8f55}
.q-card{border:1px solid var(--app-line);border-radius:1rem;background:#fff;padding:16px;margin-bottom:12px}
.q-card .opt{display:flex;gap:10px;align-items:flex-start;border:1.5px solid var(--app-line);border-radius:.7rem;padding:.55rem .75rem;margin:.35rem 0;cursor:pointer}
.q-card .opt:hover{border-color:var(--brand)}
.q-card .opt input{margin-top:.3rem}
.q-card .opt.ok{border-color:#1a8f55;background:#e7f7ee}
.q-card .opt.no{border-color:#c62828;background:#fdecec}
.code-big{font-family:'Kanit';font-size:clamp(3rem,12vw,7rem);letter-spacing:.3em;line-height:1;color:var(--brand);text-align:center;padding:16px 0 8px}
.att-radio .btn{min-width:56px}
.att-present{color:#1a8f55}.att-late{color:#e08a00}.att-leave{color:#1f5fbf}.att-absent{color:#c62828}
.sig{text-align:center;line-height:1.9}
.progress{height:.55rem;border-radius:1rem}
.login-wrap{min-height:calc(100vh - 80px);display:flex;align-items:center;justify-content:center;padding:24px 12px}
.login-card{max-width:440px;width:100%}
.login-card .logo{height:110px;width:auto;display:block;margin:0 auto 6px}
.nav-tabs .nav-link{font-weight:700}
textarea.mono{font-family:Consolas,'Courier New',monospace;font-size:.92rem}
.pill{display:inline-block;border-radius:999px;padding:.05rem .6rem;font-size:.8rem;font-weight:700;background:#eef3fb;color:var(--app-muted)}
.gb th,.gb td{text-align:center;vertical-align:middle;font-size:.9rem}
.gb td.nm,.gb th.nm{text-align:left;white-space:nowrap}
.gb .ms{color:#c62828;font-weight:700}
@media (max-width:576px){body{font-size:16px}.page-head h1{font-size:1.35rem}.brand-logo{height:36px}}
@media print{
  body{background:#fff}
  .card{box-shadow:none}
  main{padding:0!important}
  a{text-decoration:none;color:inherit}
}
.code-input{font-size:2.4rem;letter-spacing:.6em;font-family:Kanit,Sarabun,sans-serif;font-weight:500;padding-left:.6em}

/* แถบเลือกหลายรายการ */
.bulk-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;padding:.55rem 1rem;background:#f6f9ff;border-bottom:1px solid var(--bs-border-color);position:sticky;top:76px;z-index:4;border-radius:var(--bs-card-inner-border-radius,.9rem) var(--bs-card-inner-border-radius,.9rem) 0 0}
.bulk-bar.bulk-plain{border:1px solid var(--bs-border-color);border-radius:.8rem;margin-bottom:.75rem}
.bulk-bar .form-check-input{width:1.15em;height:1.15em;cursor:pointer}
.bulk-cell{width:2.6rem;text-align:center;cursor:pointer}
.bulk-item{width:1.15em;height:1.15em;cursor:pointer}
tr.bulk-selected>td,tr.bulk-selected>th{background:#e8f0ff!important}
.bulk-row.bulk-selected .media-item,.list-group-item.bulk-selected{background:#e8f0ff}
@media print{.bulk-bar,.bulk-cell,.bulk-item{display:none!important}}
.subject-card.bulk-selected{box-shadow:0 0 0 3px #1f6fd1}
.card.bulk-row.bulk-selected{box-shadow:0 0 0 3px #1f6fd1}
/* ผู้พัฒนา */
.app-credit a{color:inherit;text-decoration:none;border-bottom:1px dotted currentColor}
.app-credit a:hover{color:var(--bs-primary)}
.brand-tag{display:inline-block;background:rgba(255,255,255,.22);border-radius:.4rem;padding:0 .35rem;font-weight:700;letter-spacing:.02em}
.about-hero{background:linear-gradient(120deg,#0f3d91,#1f6fd1 60%,#2f9be8);color:#fff;border-radius:1.2rem;padding:2rem}
.about-hero .ver{background:rgba(255,255,255,.2);border-radius:2rem;padding:.15rem .7rem;font-size:.9rem}
.pw-full{display:none}.pw-show-full .pw-full{display:inline}.pw-show-full .pw-short{display:none}
.pw-toggle{border-top-left-radius:0;border-bottom-left-radius:0}
.app-nav .nav-link{white-space:nowrap}
/* บัตรเข้าใช้งานนักเรียน (ตัดแจก) */
.login-slip{border:1.5px dashed #9aa7b8;border-radius:.6rem;padding:.55rem .7rem;font-size:.82rem;break-inside:avoid;background:#fff}
.login-slip .slip-row{display:flex;justify-content:space-between;align-items:center;gap:.5rem;border-top:1px solid #eef1f5;padding:.25rem 0}
.login-slip .slip-val{font-family:ui-monospace,Consolas,monospace;font-size:1.15rem;letter-spacing:.06em;text-align:right}
.login-slip .slip-val b{font-size:1.15rem}
.login-slip .slip-foot{font-size:.7rem;color:#6b7785;border-top:1px solid #eef1f5;padding-top:.25rem;word-break:break-all}
@media print{.login-slip{border-color:#777}}

/* บันทึกหลังการจัดการเรียนรู้ */
.text-purple{color:#7a3db8}
.ref-ss .form-control{min-width:4.5rem}
.rem-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:.35rem .75rem}
.rem-item{display:flex;gap:.5rem;align-items:flex-start;border:1px solid var(--app-line,#e3e8f0);border-radius:.6rem;padding:.4rem .6rem;cursor:pointer;font-size:.92rem;background:#fff}
.rem-item:has(input:checked){border-color:#1f6fd1;background:#eef4ff}
.rem-item input{margin-top:.25rem;flex:none}
.rf-sheet{background:#fff;max-width:210mm;margin:0 auto 1.5rem;padding:8mm 9mm;border:1px solid #dfe5ef;border-radius:.8rem;font-size:15px;line-height:1.42;color:#1d2b4f;display:flex;flex-direction:column}
.rf-head{display:flex;gap:4mm;align-items:center;border:1.6px dashed #f3a5a8;border-radius:14px;padding:1.6mm 4mm;margin-bottom:2.6mm}
.rf-head img{height:16mm;width:auto}
.rf-head>div{flex:1;min-width:0}
.rf-head h1{font-family:'Kanit',sans-serif;font-weight:500;font-size:1.1rem;text-align:center;margin:0 0 .6mm}
.rf-r{display:flex;justify-content:space-between;gap:3mm}
.rf-box-sec{border:1.4px solid #c9d3e6;border-radius:10px;padding:1.4mm 3mm 1.6mm;margin-bottom:2.2mm;break-inside:avoid;page-break-inside:avoid}
.rf-box-sec h2{font-size:.96rem;font-weight:700;margin:0 0 .6mm;color:#173a7a}
.rf-grow{display:flex;flex-direction:column}
.rf-tab{width:100%;border-collapse:collapse;font-size:.92em}
.rf-tab th,.rf-tab td{border:1px solid #9fb3c8;padding:.2mm 1.4mm;vertical-align:middle}
.rf-tab th{background:#eef5ff;text-align:center;line-height:1.2;font-weight:700}
.rf-tab td.c{text-align:center}.rf-tab td.blank{height:1.75em}
.rf-tab td.kp{text-align:center;font-weight:700;color:#7a3db8;width:6%}
.rf-text,.rf-fill{background:repeating-linear-gradient(to bottom,transparent 0,transparent calc(1.75em - 1px),#a9b7ca calc(1.75em - 1px),#a9b7ca 1.75em)}
.rf-text{padding:0 .5mm;line-height:1.75em}
.rf-fill{flex:1;min-height:calc(var(--n,2) * 1.75em)}
.rf-sign{display:grid;grid-template-columns:1fr 1fr;gap:3mm;break-inside:avoid;page-break-inside:avoid}
.rf-sign .sig{line-height:1.75}
.rf-sign>.rf-box-sec{margin-bottom:0;display:flex;flex-direction:column;justify-content:center}
.rf-opts{margin:.3mm 0 .6mm}
.rf-box{display:inline-block;width:1.1em;height:1.1em;border:1.3px solid #45526e;border-radius:3px;text-align:center;line-height:1.05;font-weight:700;vertical-align:-2px;color:#1a8f55}
@media print{
  @page{size:A4;margin:8mm}
  .rf-sheet{border:0;border-radius:0;padding:0;margin:0;max-width:none;font-size:14.5px;min-height:271mm;break-after:page;page-break-after:always}
  .rf-sheet:last-of-type{break-after:auto;page-break-after:auto}
  .rf-grow{flex:var(--g,1) 1 auto}
  main.container-xl{padding-top:0!important;padding-bottom:0!important}
}
/* v2.0: ตัวกรองรายการ · คลังวิชาแบบชำระเงิน · QR พร้อมเพย์ */
.filter-bar .form-select-sm{min-width:7.5rem}
.filter-bar{border-style:dashed}
.subject-card.tpl-locked{background:linear-gradient(180deg,#fffdf5,#fff 60%)}
.subject-card.tpl-locked h2{color:#5a4a1a}
.pp-qr svg{width:100%;height:auto;display:block;border:1px solid #e5e7eb;border-radius:12px;padding:6px;background:#fff}
[data-qr] svg{width:100%;height:auto}
/* แถบเมนูแคบลงเมื่อเมนูครบ (ผู้ดูแล/เจ้าของระบบ) — กันล้นแนวนอนบนจอ 1200–1599px */
.navbar-brand .brand-school{display:inline-block;max-width:13rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
@media (min-width:1200px) and (max-width:1599.98px){
  .app-nav .nav-link{padding:.4rem .45rem!important;font-size:.92rem}
  .role-staff .app-nav .navbar-nav.me-auto .nav-link > .bi{display:none}
  .navbar-brand .brand-school{max-width:9.5rem}
}
.tpl-head-text{flex:1 1 360px;min-width:0}
/* v2.2 แผนการจัดการเรียนรู้ (ภาพ) · เครดิตคลิป · ตารางในเนื้อหา */
.plan-pages{display:flex;flex-direction:column;gap:14px;align-items:center;background:#e9edf3;padding:14px;border-radius:12px;user-select:none;-webkit-user-select:none;min-height:240px}
.plan-page{width:100%;max-width:794px;height:auto;box-shadow:0 2px 12px rgba(16,34,74,.18);background:#fff;-webkit-user-drag:none}
.plan-tabs .btn.active{background:var(--bs-primary);color:#fff}
.plan-nav{max-height:70vh;overflow:auto}
.yt-credit{border-left:3px solid #c62828;padding:.25rem .6rem;background:#fff7f7;border-radius:0 8px 8px 0}
.md-hr{margin:1.4rem 0;border-top:2px dashed #b8c4d6;opacity:1}.md-table{width:auto;min-width:60%}.md-table th{background:#eef3fb;font-family:'Kanit';font-weight:500}
@media print{.plan-tabs,.plan-nav,.page-head .btn,.page-head form{display:none!important}.plan-pages{background:none;padding:0;gap:0}.plan-page{box-shadow:none;max-width:none;break-after:page}}

/* v2.3 เจ้าของระบบเข้าดูโรงเรียน (อ่านอย่างเดียว) */
.owner-view-bar { background: #20243f; color: #fff; font-size: .95rem; }
.owner-view-bar .bi-eye-fill { color: #ffd166; }
body.owner-view form[method="post" i]:not([data-view-ok]):not([action*="plan_word.php"]) :is(button:not([type="button"]), input[type="submit"]) { opacity: .55; cursor: not-allowed; }
.view-only-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #20243f; color: #fff; padding: .6rem 1rem; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2000; max-width: calc(100% - 32px); }
.view-only-toast.show { opacity: 1; transform: translate(-50%, 0); }
.perm-switch .form-check-input { cursor: pointer; }

/* ── v2.4 ใบงานออนไลน์ ── */
.ws-type-card{display:flex;flex-direction:column;gap:2px;height:100%;border:1.5px solid var(--app-line);border-radius:.8rem;padding:.6rem .75rem;background:#fff;color:inherit;text-decoration:none}
.ws-type-card i{font-size:1.35rem;color:var(--brand)}
.ws-type-card b{font-family:'Kanit';font-weight:500}
.ws-type-card small{color:#6b7280;line-height:1.3}
a.ws-type-card:hover,.ws-type-card.active{border-color:var(--brand);background:#eef3fb}
.ws-q .ws-num{width:34px;height:34px;flex:none;border-radius:10px;background:#eef3fb;color:var(--brand);font-family:'Kanit';display:flex;align-items:center;justify-content:center}
.ws-q-text{white-space:normal;margin-bottom:.25rem}
.ws-opts{display:flex;flex-wrap:wrap;gap:.35rem;margin:.25rem 0}
.ws-opt{border:1px solid var(--app-line);border-radius:.5rem;padding:.1rem .5rem;font-size:.92rem}
.ws-opt.ok{border-color:#1a8f55;background:#e7f7ee;color:#11603a;font-weight:600}
.ws-blank{display:inline-block;border-bottom:2px solid #1a8f55;color:#11603a;font-weight:600;padding:0 .3rem;background:#e7f7ee;border-radius:.3rem .3rem 0 0}
.ws-actions form{margin:0}
.ws-q-body{padding-left:calc(34px + .5rem)}
@media (max-width:576px){.ws-q-body{padding-left:0}}
.ws-thumb{max-height:64px;max-width:120px;border-radius:.4rem;border:1px solid var(--app-line)}
.ws-tbl{max-width:560px}
.min-w-0{min-width:0}
.q-img{margin:.25rem 0 .6rem}.q-img img{max-width:100%;max-height:360px;border-radius:.6rem;border:1px solid var(--app-line)}
.q-img-sm img{max-height:140px}
.q-answer-img{max-width:100%;max-height:420px;border:1px solid var(--app-line);border-radius:.5rem;background:#fff}
.q-tf .opt{flex:1 1 9rem;justify-content:center;font-weight:600}
.q-card .opt.picked{border-color:var(--brand);background:#eef3fb}
.q-fill{line-height:2.4}.q-blank{width:auto;min-width:8rem;max-width:14rem;margin:0 .25rem;vertical-align:baseline}
.q-match-l{font-weight:500}
.q-order-item{border:1.5px solid var(--app-line);border-radius:.6rem;padding:.35rem .5rem;margin:.3rem 0;background:#fff}
.q-rows td{vertical-align:middle}
.q-draw-tools .btn.active{color:#fff}
.q-canvas{display:block;width:100%;height:auto;border:1.5px dashed #9aa7bd;border-radius:.6rem;background:#fff;touch-action:none;cursor:crosshair}
/* พิมพ์ใบงาน */
.pw-body{background:#e9edf3}
.pw-bar{position:sticky;top:0;z-index:5;display:flex;gap:.5rem;justify-content:center;padding:.6rem;background:#fff;border-bottom:1px solid #d7dde7}
.pw-page{width:210mm;min-height:297mm;margin:12px auto;background:#fff;padding:14mm 16mm;font-family:'Sarabun',sans-serif;font-size:15.5px;color:#111;box-shadow:0 2px 12px rgba(0,0,0,.08)}
.pw-head{border-bottom:2px solid #0b2e6b;padding-bottom:6px;margin-bottom:8px}
.pw-title{font-family:'Kanit';font-size:1.35rem;color:#0b2e6b;text-align:center}
.pw-sub{text-align:center;color:#444;font-size:.92rem}
.pw-meta{display:flex;flex-wrap:wrap;gap:.4rem 1.2rem;justify-content:space-between;margin-top:8px;font-size:.95rem}
.pw-score{border:1.5px solid #0b2e6b;border-radius:6px;padding:0 .5rem}
.pw-desc{background:#f6f8fb;border-radius:6px;padding:.35rem .6rem;margin-bottom:8px}
.pw-q{break-inside:avoid;page-break-inside:avoid;margin:10px 0 12px}
.pw-qt{margin-bottom:4px}.pw-pts{color:#666;font-size:.85rem}
.pw-opts{padding-left:1.3rem}.pw-inline{display:flex;gap:2.5rem}
.pw-opt{margin:2px 0}
.pw-box{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border:1.5px solid #333;border-radius:50%;vertical-align:-2px}
.pw-box.sq{border-radius:3px}
.pw-key{color:#c62828;font-weight:600}
.pw-under{display:inline-block;border-bottom:1.5px solid #333;min-width:3rem;padding:0 .3rem;line-height:1.2}
.pw-paren{white-space:nowrap}
.pw-line{border-bottom:1.5px dotted #777;height:28px;margin-left:1.3rem}
.pw-frame{border:1.5px solid #555;border-radius:6px;margin-left:1.3rem;display:flex;align-items:flex-start;justify-content:flex-end;padding:4px 8px;color:#999;font-size:.85rem}
.pw-note{font-size:.88rem;color:#555;margin-left:1.3rem}
.pw-ans{margin-left:1.3rem}
.pw-img img{max-width:70%;max-height:220px;margin:4px 0 4px 1.3rem;border:1px solid #ccc;border-radius:4px}
.pw-match .pw-opt{padding-left:.3rem}
@media print{.pw-body{background:#fff}.pw-page{margin:0;box-shadow:none;width:auto;min-height:0;padding:0}@page{size:A4;margin:12mm 14mm}}
@media (max-width:820px){.pw-page{width:auto;padding:12px;margin:8px}}
/* เปิดดูเอกสารในหน้าเว็บ */
.doc-viewer{border:1px solid var(--app-line);border-radius:.8rem;background:#fff;overflow:hidden}
.dv-bar{display:flex;align-items:center;gap:.5rem;padding:.4rem .6rem;background:#f4f6fa;border-bottom:1px solid var(--app-line);min-width:0}
.dv-bar>i{font-size:1.2rem;color:var(--brand)}.dv-name{max-width:55%}
.dv-body{height:var(--dv-h,640px);overflow:auto;background:#e9edf3;position:relative;-webkit-overflow-scrolling:touch}
.dv-msg{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:180px;height:100%;padding:1rem;color:#555}
.dv-pages{padding:8px;overflow-x:auto}
.dv-page{margin:0 auto 10px;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18)}
.dv-page canvas{display:block}
.dv-docx .docx-wrapper{background:#e9edf3!important;padding:10px!important}
.dv-docx .docx-wrapper>section.docx{margin-bottom:10px!important;box-shadow:0 1px 4px rgba(0,0,0,.18)!important}
.dv-pptx{padding:6px;display:flex;justify-content:center}
.dv-tabs{display:flex;flex-wrap:wrap;gap:4px;padding:6px;background:#fff;border-bottom:1px solid var(--app-line);position:sticky;top:0;z-index:2}
.dv-tabs .btn{border:1px solid var(--app-line);background:#fff}.dv-tabs .btn.active{background:var(--brand);color:#fff;border-color:var(--brand)}
.dv-sheet{background:#fff;min-height:100%}
.dv-sheet table{border-collapse:collapse;font-size:.9rem}
.dv-sheet td,.dv-sheet th{border:1px solid #d6dbe4;padding:2px 6px;white-space:nowrap;max-width:28rem;overflow:hidden;text-overflow:ellipsis}
.dv-sheet tr:first-child td{background:#eef3fb;font-weight:600}
.dv-img{display:block;max-width:100%;margin:0 auto;padding:8px}
.dv-media{display:block;width:100%;max-height:100%;background:#000}
.dv-audio{display:block;width:calc(100% - 24px);margin:24px auto}
.dv-text{white-space:pre-wrap;padding:12px;margin:0;background:#fff;min-height:100%;font-size:.92rem}
.doc-viewer:fullscreen{display:flex;flex-direction:column;border-radius:0}
.doc-viewer:fullscreen .dv-body{height:auto;flex:1}
@media (max-width:576px){.dv-body{height:min(var(--dv-h,640px),75vh)}.dv-name{max-width:none;flex:1 1 0}.dv-info{display:none}}
