/* BASE R74 Step 2 CSS extraction: original head style block. */
:root{
  --bg:#f4f7fb;--panel:#fff;--ink:#0f172a;--muted:#64748b;--line:#dbe4ef;--soft:#f1f5f9;
  --blue:#2563eb;--blue-soft:#eaf2ff;--green:#16a34a;--amber:#f59e0b;--red:#ef4444;--shadow:0 12px 34px rgba(15,23,42,.08);
  --radius:18px;--topbar:#0f172a;--topbar-height:132px;--updatebar-height:0px;--fixed-offset:calc(var(--topbar-height) + var(--updatebar-height));
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg)}

.hidden{display:none!important}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:28px;background:
  radial-gradient(circle at top left,rgba(37,99,235,.18),transparent 36%),
  linear-gradient(135deg,#0f172a 0%,#1e293b 48%,#f8fafc 48%,#eef2f7 100%)}
.login-card{width:min(760px,100%);background:rgba(255,255,255,.96);border:1px solid rgba(226,232,240,.9);border-radius:24px;box-shadow:0 30px 90px rgba(15,23,42,.28);padding:30px}
.login-company-identity{display:flex;gap:16px;align-items:center;justify-content:center;margin-bottom:20px}
.login-company-identity img{width:74px;height:74px;object-fit:contain;border-radius:18px;background:white;border:1px solid #e2e8f0;padding:6px}
.login-company-name .vn{font-weight:750;color:#0f172a;line-height:1.2;white-space:nowrap;font-size:15px;letter-spacing:.01em}
.login-company-name .en{font-size:12.5px;color:#475569;margin-top:4px;text-transform:uppercase;white-space:nowrap}
.login-company-name .short{font-size:13px;color:#1d4ed8;font-weight:700;margin-top:3px}
.login-lang{display:flex;gap:8px;margin:6px 0 18px}
.login-lang button{border:1px solid #cbd5e1;background:#f8fafc;border-radius:999px;padding:8px 13px;cursor:pointer;font-weight:650}
.login-lang button.active{background:#0f172a;color:#fff;border-color:#0f172a}
.login-title{font-size:28px;line-height:1.15;margin:0 0 8px;color:#0f172a}
.login-subtitle{margin:0 0 18px;color:#64748b;line-height:1.5}
.login-card label{display:block;font-size:14px;color:#334155;font-weight:650;margin:12px 0 6px}
.login-card input,.login-card select{width:100%;border:1px solid #cbd5e1;border-radius:13px;padding:12px 14px;font-size:15px;background:#fff;outline:none}
.login-card input:focus,.login-card select:focus{border-color:#2563eb;box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.login-card .primary{width:100%;margin-top:18px;border:0;background:#2563eb;color:white;border-radius:13px;padding:13px 16px;font-size:16px;font-weight:750;cursor:pointer}
.login-card .primary:hover{background:#1d4ed8}
.error{margin-top:12px;color:#b91c1c;background:#fee2e2;border:1px solid #fecaca;border-radius:12px;padding:10px 12px;font-size:14px}
.security-box{margin-top:18px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:13px;color:#475569;font-size:13px;line-height:1.5}
.security-title{color:#0f172a}
.user-badge{display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(255,255,255,.24);color:#e5e7eb;background:rgba(255,255,255,.08);padding:8px 12px;border-radius:999px;font-size:13px}
.logout-btn{border:1px solid rgba(255,255,255,.24);background:rgba(255,255,255,.08);color:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;font-weight:650}

.diagram-image-wrap{margin:16px auto 4px;max-width:100%;overflow:auto;text-align:center;background:#fff;border:1px solid #e2e8f0;border-radius:14px;padding:12px}
.diagram-image-wrap img{display:block;margin:0 auto;max-width:100%;height:auto;object-fit:contain}


.topbar{position:fixed;top:0;left:0;right:0;height:var(--topbar-height);z-index:1000;background:var(--topbar);color:white;box-shadow:0 10px 24px rgba(15,23,42,.18);display:flex;flex-direction:column}
.topbar-inner{height:100%;padding:8px 18px 10px;display:flex;flex-direction:column;gap:8px}
.header-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.header-row-top{min-height:68px}
.header-row-bottom{min-height:40px;border-top:1px solid rgba(255,255,255,.12);padding-top:7px}
.header-doc-block{min-width:260px;max-width:760px}
.doc-title{margin:0;font-size:clamp(17px,1.55vw,23px);line-height:1.12;font-weight:600;letter-spacing:.005em}
.doc-meta{margin-top:5px;color:#d3d8e2;font-size:12.8px;line-height:1.4}
.doc-meta .meta-line{display:flex;gap:14px;flex-wrap:wrap}
.top-actions{display:flex;align-items:center;gap:7px;white-space:nowrap;flex-wrap:wrap;justify-content:flex-end}
.bottom-actions{display:flex;align-items:center;gap:8px;white-space:nowrap;flex-wrap:wrap;width:100%}
.header-update-area{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.app-update-notice{display:inline-flex;align-items:center;gap:7px;max-width:min(520px,100%);border:1px solid rgba(191,219,254,.55);border-radius:999px;padding:6px 10px;background:rgba(37,99,235,.28);color:#eff6ff;font-size:12.5px;font-weight:800;white-space:nowrap}
.app-update-notice.hidden{display:none}
.app-update-notice.success{background:rgba(22,163,74,.25);border-color:rgba(187,247,208,.55);color:#dcfce7}
.app-update-notice.warn{background:rgba(245,158,11,.22);border-color:rgba(253,230,138,.65);color:#fffbeb}
.app-update-notice button{border:0;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:900;cursor:pointer;background:#fff;color:#1d4ed8}
.log-header-btn{border:1px solid rgba(255,255,255,.26);border-radius:999px;padding:8px 13px;cursor:pointer;font-weight:800;font-size:12.5px;display:inline-flex;align-items:center;gap:7px;background:rgba(245,158,11,.18);color:#ffedd5}
.log-header-btn.acked{background:rgba(22,163,74,.20);color:#dcfce7;border-color:rgba(187,247,208,.45)}
.log-header-btn.pending{background:rgba(245,158,11,.20);color:#ffedd5;border-color:#fed7aa}
.log-header-btn.history{background:rgba(37,99,235,.18);color:#dbeafe;border-color:rgba(191,219,254,.55)}
.log-header-btn.refresh{background:rgba(14,165,233,.20);color:#e0f2fe;border-color:rgba(186,230,253,.58)}
.log-header-btn.refresh.needs-sync{background:rgba(245,158,11,.22);color:#ffedd5;border-color:#fed7aa;box-shadow:0 0 0 2px rgba(245,158,11,.20)}
.log-header-btn.refresh.syncing{opacity:.75;cursor:wait}
.update-history-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 18px;padding:14px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}.update-history-form label{display:grid;gap:5px;font-size:12px;font-weight:800;color:#475569}.update-history-form input,.update-history-form textarea,.update-history-form select{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:9px 10px;font:inherit}.update-history-form textarea{min-height:72px;resize:vertical}.update-history-form .full{grid-column:1/-1}.modal-body .table-scroll{overflow-y:auto;overflow-x:hidden;max-height:65vh;border:1px solid var(--line);border-radius:12px;width:100%;box-sizing:border-box}.table-scroll table{width:100%;min-width:0;margin:0;table-layout:fixed}.table-scroll th,.table-scroll td{white-space:normal;overflow-wrap:anywhere;word-break:break-word}.history-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 14px}@media(max-width:760px){.update-history-form{grid-template-columns:1fr}.modal{width:98vw;max-width:98vw}.modal-body{padding:14px}.table-scroll table{min-width:0}}

.update-status-bar{display:none!important}
.update-status-inner{width:100%;padding:8px 22px;display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap}
.update-left,.update-right{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.status-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #e2e8f0;background:white;color:#334155;border-radius:999px;padding:7px 11px;font-size:12.5px;font-weight:600;white-space:nowrap}
.status-chip.update{border-color:#fdba74;background:#fffbeb;color:#92400e}
.status-chip.online{border-color:#bbf7d0;background:#f0fdf4;color:#166534}
.status-chip.offline{border-color:#fecaca;background:#fef2f2;color:#991b1b}
.sync-btn{border:1px solid #cbd5e1;background:white;color:#0f172a;border-radius:999px;padding:8px 12px;cursor:pointer;font-weight:700;font-size:12.5px;display:inline-flex;align-items:center;gap:6px}
.sync-btn.needs-sync{background:#fff7ed;border-color:#fb923c;color:#9a3412;box-shadow:0 0 0 3px rgba(251,146,60,.22),0 0 16px rgba(245,158,11,.45)}
.sync-btn.syncing{opacity:.75;cursor:wait}
.jump-update-btn{border:1px solid #bfdbfe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:8px 12px;cursor:pointer;font-weight:700;font-size:12.5px}

.header-update-area{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.read-status-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:7px 11px;font-size:12.2px;font-weight:800;border:1px solid rgba(255,255,255,.22)}
.read-status-badge.pending{background:#fff7ed;color:#ffedd5;border-color:#fed7aa;box-shadow:0 0 0 2px rgba(245,158,11,.18)}
.read-status-badge.acked{background:rgba(22,163,74,.18);color:#dcfce7;border-color:rgba(187,247,208,.45)}
.header-update-btn{border:1px solid rgba(253,186,116,.55);background:#fff7ed;color:#9a3412;border-radius:999px;padding:7px 10px;cursor:pointer;font-weight:800;font-size:12px;display:inline-flex;align-items:center;gap:5px}
.header-update-btn:hover{background:#ffedd5}
.header-conn{border:1px solid rgba(255,255,255,.24);border-radius:999px;padding:7px 10px;font-size:12px;font-weight:700}
.header-conn.online{background:rgba(22,163,74,.18);color:#dcfce7}
.header-conn.offline{background:rgba(239,68,68,.18);color:#fee2e2}
.update-card{background:#fffbeb;border:1px solid #fed7aa;border-radius:16px;margin:0 0 18px;padding:16px 18px;box-shadow:0 8px 22px rgba(245,158,11,.08);scroll-margin-top:calc(var(--fixed-offset) + 88px)}
.update-card h2{margin:0 0 8px;font-size:18px;color:#92400e}
.update-card table{width:100%;border-collapse:collapse;margin:10px 0;background:white;border-radius:12px;overflow:hidden}
.update-card th,.update-card td{border:1px solid #fde68a;padding:8px 10px;text-align:left;font-size:13.5px;vertical-align:top}
.update-card th{background:#fff7ed;color:#92400e;width:150px}
.update-card p{margin:6px 0;line-height:1.55;color:#475569}

.update-note{background:#fffbeb;border:1px solid #fed7aa;border-radius:16px;margin:0 0 18px;padding:16px 18px;box-shadow:0 8px 22px rgba(245,158,11,.08);scroll-margin-top:calc(var(--fixed-offset) + 90px)}
.update-note h2{margin:0 0 8px;font-size:18px;color:#92400e}.update-note p{margin:5px 0;color:#475569;font-size:14px;line-height:1.55}
.doc-line{margin:0 0 11px;line-height:1.78;color:#1f2937}
.doc-line.lead{margin-top:16px;font-weight:600;color:#0f172a}
.doc-line.list-like{padding-left:22px;text-indent:-14px}

.pill{border:1px solid rgba(255,255,255,.24);color:#e5e7eb;background:rgba(255,255,255,.08);padding:9px 15px;border-radius:999px;font-size:14px}
.lang-switch{display:flex;gap:6px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:4px}
.lang-btn{border:0;background:transparent;color:#dbe4ef;padding:7px 12px;border-radius:999px;cursor:pointer;font-weight:600}
.lang-btn.active{background:#fff;color:#0f172a}
.layout{display:grid;grid-template-columns:345px minmax(0,1fr);min-height:calc(100vh - var(--fixed-offset));margin-top:var(--fixed-offset)}
.sidebar{position:sticky;top:var(--fixed-offset);height:calc(100vh - var(--fixed-offset));background:rgba(255,255,255,.95);border-right:1px solid var(--line);overflow:auto;padding:18px 16px}
.search{width:100%;padding:13px 14px;border:1px solid #cbd5e1;border-radius:13px;font-size:15px;outline:none;background:white;margin-bottom:16px}
.search:focus{border-color:var(--blue);box-shadow:0 0 0 4px rgba(37,99,235,.12)}
.search-results{display:none;margin:-8px 0 14px;border:1px solid #dbe4ef;background:#fff;border-radius:14px;box-shadow:0 8px 20px rgba(15,23,42,.08);overflow:hidden}
.search-results.show{display:block}
.search-result{width:100%;border:0;background:white;text-align:left;padding:10px 12px;cursor:pointer;border-bottom:1px solid #eef2f7}
.search-result:last-child{border-bottom:0}
.search-result:hover{background:#f8fafc}
.search-result .sr-code{display:inline-block;font-weight:800;color:#1d4ed8;margin-right:6px}
.search-result .sr-title{font-weight:650;color:#0f172a}
.search-result .sr-snippet{display:block;margin-top:3px;color:#64748b;font-size:12.5px;line-height:1.35}
.search-empty{padding:10px 12px;color:#64748b;font-size:13px}
mark.search-hit, mark{background:#fef3c7;color:#92400e;border-radius:4px;padding:0 2px}
.isc-item{margin-bottom:8px}
.isc-head{width:100%;border:0;background:#fff;color:#111827;display:grid;grid-template-columns:24px 1fr;gap:8px;align-items:center;padding:13px 12px;border-radius:14px;cursor:pointer;text-align:left;border:1px solid transparent}
.isc-head:hover{background:#f8fafc;border-color:var(--line)}
.isc-head.active{background:var(--blue-soft);color:#1d4ed8;border-color:#bfdbfe}
.isc-code{display:inline-block;font-weight:620;font-size:15px;margin-right:8px}
.isc-name{display:inline-block;color:#64748b;font-weight:450;font-size:13px}
.tree{margin:8px 0 10px 12px;padding:0 0 0 8px;list-style:none;border-left:1px dashed #cbd5e1}
.tree.hidden{display:none}.tree li{margin:1px 0}
.nav-link{width:100%;border:0;background:transparent;color:#243044;text-align:left;cursor:pointer;border-radius:12px;padding:7px 10px;line-height:1.38;font-size:14px;font-weight:430}
.nav-link .num{color:#0f172a;font-weight:550;margin-right:5px}.nav-link.level-1{font-size:14.8px;padding-top:9px;padding-bottom:9px;font-weight:500}
.nav-link.level-2{padding-left:22px;color:#334155}.nav-link.level-3{padding-left:42px;color:#475569;font-size:13.5px}.nav-link.level-4{padding-left:58px;color:#64748b;font-size:13px}
.nav-link:hover{background:#f1f5f9}.nav-link.active{background:var(--blue-soft);color:#1d4ed8;box-shadow:inset 3px 0 0 var(--blue)}.nav-link.active .num{color:#1d4ed8}
.sidebar-note{margin-top:18px;color:var(--muted);font-size:12.5px;line-height:1.45;padding:12px;background:#f8fafc;border:1px solid var(--soft);border-radius:12px}
.main{min-width:0;padding:28px 38px 60px}.content-wrap{width:min(100%,1040px);margin:0 auto}
.actionbar{position:sticky;top:var(--fixed-offset);z-index:35;background:rgba(244,247,251,.94);backdrop-filter:blur(10px);padding:14px 0;margin-bottom:12px}
.action-card{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:12px;box-shadow:var(--shadow)}
.action-left,.action-right{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.btn{border:1px solid var(--line);background:white;color:#1f2937;border-radius:12px;padding:10px 14px;font-weight:560;font-size:14px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:8px}
.btn:hover{background:#f8fafc}.btn.primary{background:var(--blue);border-color:var(--blue);color:white}.btn.green{background:var(--green);border-color:var(--green);color:white}
.doc-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}
.section{padding:30px 46px;border-bottom:1px solid var(--line);scroll-margin-top:calc(var(--fixed-offset) + 88px)}
.section:last-child{border-bottom:0}
.section h1,.section h2,.section h3,.section h4{margin:0 0 18px;color:#0f172a;line-height:1.18;display:flex;gap:10px;align-items:baseline;letter-spacing:.005em}
.section h1{font-size:29px;font-weight:620}.section h2{font-size:24px;font-weight:590}.section h3{font-size:20px;font-weight:560}.section h4{font-size:17px;font-weight:540}
.section h1:before,.section h2:before,.section h3:before,.section h4:before{content:"";display:inline-block;width:5px;height:1.1em;background:var(--blue);border-radius:6px;align-self:center}
.page-tag{font-size:13px;color:var(--muted);font-weight:560;white-space:nowrap}
.section-body{font-size:16px;line-height:1.75;color:#1f2937;max-width:900px}.section-body p{margin:0 0 12px}.section-body p.empty{color:#94a3b8;font-style:italic}
mark{background:#fef3c7;border-radius:3px;padding:0 2px}
.org-chart{margin:18px 0 6px;display:grid;gap:14px;max-width:900px}
.org-row{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.org-box{border:1px solid #cbd5e1;background:#f8fafc;border-radius:14px;padding:12px 14px;min-width:170px;text-align:center;box-shadow:0 6px 18px rgba(15,23,42,.05)}
.org-box.top{background:#0f172a;color:white;border-color:#0f172a;font-weight:650}.org-box.primary{background:#eaf2ff;border-color:#bfdbfe;color:#1d4ed8;font-weight:610}.org-box small{display:block;color:#64748b;font-weight:400;margin-top:4px}.org-box.top small{color:#cbd5e1}

.org-svg-wrap{margin:18px auto 8px;max-width:820px;overflow:visible;background:white;border:1px solid #e2e8f0;border-radius:16px;padding:10px}
.org-svg{width:100%;max-width:800px;height:auto;display:block;margin:0 auto}
.org-svg text{font-family:Arial,"Times New Roman",serif;fill:#111827}
.org-svg .box{fill:#fff;stroke:#111827;stroke-width:1.6}
.org-svg .dash{fill:#fff;stroke:#111827;stroke-width:1.6;stroke-dasharray:8 6}
.org-svg .line{stroke:#111827;stroke-width:1.6;fill:none}
.org-svg .small{font-size:16px}
.org-svg .med{font-size:18px}
.org-svg .bold{font-weight:700}
.log-table{width:100%;border-collapse:collapse;font-size:13px;table-layout:fixed}
.log-table th,.log-table td{border:1px solid #dbe4ef;padding:8px;text-align:left;vertical-align:top;white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.log-table th{background:#f8fafc;color:#334155}
.log-tools{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.log-note{font-size:13px;color:#64748b;margin:0 0 12px;line-height:1.5}

.ack-block{margin:38px 0 0;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:20px}
.ack-block h2{margin:0 0 8px;font-size:22px}.ack-log{margin-top:12px;color:#475569;font-size:14px;line-height:1.55}
.modal-backdrop{display:none;position:fixed;top:var(--fixed-offset);left:0;right:0;bottom:0;background:rgba(15,23,42,.52);z-index:900;align-items:flex-start;justify-content:center;padding:18px 24px 24px;overflow-y:auto;overflow-x:hidden}
.modal-backdrop.show{display:flex}
.modal{background:white;width:min(1280px,96vw);max-width:96vw;max-height:calc(100vh - var(--fixed-offset) - 42px);overflow-y:auto;overflow-x:hidden;border-radius:20px;box-shadow:0 24px 80px rgba(0,0,0,.28);margin-top:0;box-sizing:border-box}
.modal-head{display:flex;justify-content:space-between;align-items:center;padding:18px 20px;border-bottom:1px solid var(--line)}.modal-head h2{margin:0;font-size:20px}
.modal-body{padding:18px 20px}.file-list{display:grid;gap:12px}.file-card{display:grid;grid-template-columns:1fr auto;gap:16px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:14px;background:#f8fafc}
.file-card h3{margin:0 0 5px;font-size:16px;font-weight:600}.file-card p{margin:0;color:var(--muted);font-size:13px}.file-actions{display:flex;gap:8px;flex-wrap:wrap}
.modal.viewer-modal{width:min(1180px,96vw)}.doc-viewer-frame{width:100%;height:calc(100vh - var(--fixed-offset) - 164px);min-height:520px;border:0;border-radius:12px;background:white}.fallback-note{font-size:12px;color:#64748b;margin-left:6px}.file-actions .btn{white-space:nowrap}
.badge{display:inline-flex;margin-right:8px;border:1px solid #cbd5e1;background:white;border-radius:999px;padding:3px 8px;font-size:11px;color:#475569;vertical-align:middle}

@media(max-width:760px){
  .login-card{width:100%;padding:22px}
  .login-company-identity{align-items:center;gap:12px}
  .login-company-name .vn{white-space:normal;font-size:13.2px}
  .login-company-name .en{white-space:normal;font-size:11.8px}
}

@media(max-width:900px){:root{--topbar-height:118px;--updatebar-height:82px}.topbar-inner{align-items:flex-start;flex-direction:column;gap:8px}.update-status-inner{align-items:flex-start}.layout{grid-template-columns:1fr}.sidebar{position:relative;top:0;height:auto;max-height:50vh}.main{padding:20px 16px}.section{padding:28px 22px}.actionbar{top:var(--fixed-offset)}.update-status-bar{display:none!important}}

/* === V13 FIX: robust fixed header/layout offsets === */
:root{
  --topbar-height:132px;
  --fixed-offset:var(--topbar-height);
}
.topbar{
  height:auto !important;
  min-height:118px;
  max-height:55vh;
  overflow:visible;
  background:#0f172a !important;
  isolation:isolate;
}
.topbar-inner{
  height:auto !important;
  min-height:118px;
}
.header-row-top{
  min-height:0 !important;
  align-items:flex-start;
}
.header-row-bottom{
  min-height:0 !important;
  align-items:flex-start;
}
.header-doc-block{
  flex:1 1 420px;
  min-width:260px;
  max-width:none;
  overflow:visible;
}
.top-actions{
  flex:0 1 auto;
  max-width:70vw;
  row-gap:7px;
}
.bottom-actions{
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:5px;
  scrollbar-width:thin;
}
.layout{
  margin-top:calc(var(--fixed-offset) + 2px) !important;
  min-height:calc(100vh - var(--fixed-offset) - 2px) !important;
}
.sidebar{
  top:calc(var(--fixed-offset) + 2px) !important;
  height:calc(100vh - var(--fixed-offset) - 2px) !important;
}
.actionbar{
  top:calc(var(--fixed-offset) + 2px) !important;
}
.section,
#contentTop,
.ack-block,
.update-card{
  scroll-margin-top:calc(var(--fixed-offset) + 90px) !important;
}
.modal-backdrop{
  top:calc(var(--fixed-offset) + 2px) !important;
  bottom:0 !important;
  max-height:calc(100vh - var(--fixed-offset) - 2px) !important;
  align-items:flex-start !important;
}
.modal{
  max-height:calc(100vh - var(--fixed-offset) - 30px) !important;
  overflow:auto !important;
}
@media(max-width:900px){
  .top-actions{max-width:100%;justify-content:flex-start}
  .header-row{align-items:flex-start}
}


/* ISC-03 exact appendix tables */
.isc03-table-block{font-family:"Times New Roman",Times,serif;color:#000;margin:22px 0 28px 0}
.isc03-table-title{text-align:center;font-size:24px;font-weight:700;text-transform:uppercase;letter-spacing:.3px;margin:8px 0 24px 0}
.isc03-table-wrap{overflow:auto;background:#fff;padding:0}
.isc03-table{border-collapse:collapse;width:100%;table-layout:fixed;border:2px solid #000;background:#fff}
.isc03-table th,.isc03-table td{border:1px solid #000;vertical-align:middle;text-align:center;padding:7px 8px;line-height:1.18;font-size:20px;color:#000}
.isc03-table th{font-weight:700}
.isc03-table .left{text-align:left}
.isc03-table .red{color:red}
.isc03-medical .stt{width:5%}.isc03-medical .facility{width:13%}.isc03-medical .address{width:14%}.isc03-medical .phone{width:14%}.isc03-medical .consult{width:20%}.isc03-medical .email{width:24%}.isc03-medical .note{width:12%}
.isc03-emergency{max-width:1010px;margin-left:auto;margin-right:auto}
.isc03-emergency .isc03-table{border:3px solid #000}
.isc03-emergency th,.isc03-emergency td{font-size:24px}
.isc03-emergency .stt{width:7%}.isc03-emergency .name{width:27%}.isc03-emergency .rank{width:20%}.isc03-emergency .office{width:17%}.isc03-emergency .home{width:13%}.isc03-emergency .mobile{width:15%}
.isc03-emergency .name-cell{text-align:left;padding-left:10px}
@media(max-width:900px){.isc03-table th,.isc03-table td{font-size:15px}.isc03-emergency th,.isc03-emergency td{font-size:16px}.isc03-table-title{font-size:20px}}


/* Responsive table tuning for ISC-03 and ISC-10 */
.isc03-table-wrap,.isc10-table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border:0}
.isc03-table,.isc10-table{border-collapse:collapse;background:#fff;max-width:100%}
.isc03-table{table-layout:fixed;min-width:980px}
.isc03-medical-table{min-width:1080px}
.isc03-emergency-table{min-width:920px}
.isc03-table th,.isc03-table td{word-break:normal;overflow-wrap:anywhere;hyphens:auto}
.isc03-medical-table th,.isc03-medical-table td{font-size:16px;line-height:1.18;padding:6px 6px}
.isc03-emergency-table th,.isc03-emergency-table td{font-size:17px;line-height:1.18;padding:6px 7px}
.isc03-table-title{font-size:21px;margin:8px 0 16px 0}
.isc03-medical col.stt{width:5%}.isc03-medical col.facility{width:15%}.isc03-medical col.address{width:17%}.isc03-medical col.phone{width:13%}.isc03-medical col.consult{width:20%}.isc03-medical col.email{width:18%}.isc03-medical col.note{width:12%}
.isc03-emergency col.stt{width:6%}.isc03-emergency col.name{width:24%}.isc03-emergency col.rank{width:22%}.isc03-emergency col.office{width:18%}.isc03-emergency col.home{width:13%}.isc03-emergency col.mobile{width:17%}
.isc10-table-block{font-family:"Times New Roman",Times,serif;color:#000;margin:18px 0 26px}
.isc10-table{width:100%;min-width:860px;border:2px solid #000;table-layout:fixed}
.isc10-table th,.isc10-table td{border:1px solid #000;vertical-align:top;text-align:left;padding:7px 8px;line-height:1.18;font-size:16px;color:#000;overflow-wrap:anywhere}
.isc10-table th{text-align:center;font-weight:700}
.isc10-secure-table th:nth-child(1),.isc10-secure-table td:nth-child(1){width:24%}
.isc10-secure-table th:nth-child(2),.isc10-secure-table td:nth-child(2){width:30%}
.isc10-secure-table th:nth-child(3),.isc10-secure-table td:nth-child(3){width:16%;text-align:center}
.isc10-secure-table th:nth-child(4),.isc10-secure-table td:nth-child(4){width:30%}
.isc10-log-table th,.isc10-log-table td{text-align:center}
.isc10-note{font-family:"Times New Roman",Times,serif;font-size:15px;margin:8px 0 0;color:#000}
@media(max-width:900px){
 .isc03-table-title{font-size:18px}
 .isc03-medical-table th,.isc03-medical-table td,.isc03-emergency-table th,.isc03-emergency-table td{font-size:14px;padding:5px}
 .isc10-table th,.isc10-table td{font-size:14px;padding:5px}
}


/* ISC-11 reference table and responsive table handling */
.isc11-table-block{margin:16px 0 8px;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden}
.isc11-table-wrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.isc11-ref-table{width:100%;min-width:900px;border-collapse:collapse;table-layout:fixed;font-size:13px;line-height:1.35}
.isc11-ref-table th,.isc11-ref-table td{border:1px solid #cbd5e1;padding:8px 10px;vertical-align:top;text-align:left;word-break:break-word}
.isc11-ref-table th{background:#f8fafc;color:#0f172a;font-weight:800;text-align:center}
.isc11-ref-table th:nth-child(1),.isc11-ref-table td:nth-child(1){width:54px;text-align:center}
.isc11-ref-table th:nth-child(2),.isc11-ref-table td:nth-child(2){width:28%}
.isc11-ref-table th:nth-child(3),.isc11-ref-table td:nth-child(3){width:38%}
.isc11-ref-table th:nth-child(4),.isc11-ref-table td:nth-child(4){width:24%}
.isc03-table-wrap,.isc10-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.isc03-table{max-width:100%;font-size:clamp(11px,0.86vw,14px)}
.isc03-medical-table{min-width:1040px}
.isc03-emergency-table{min-width:860px}


.header-external-links{display:inline-flex;align-items:center;gap:8px;margin-left:2px;margin-right:2px}
.external-link-btn{border:1px solid rgba(255,255,255,.24);background:rgba(255,255,255,.08);color:#fff;border-radius:999px;padding:8px 12px;cursor:pointer;font-weight:800;font-size:12.5px;letter-spacing:.2px;display:inline-flex;align-items:center;gap:6px;text-decoration:none;white-space:nowrap}
.external-link-btn:hover{background:rgba(255,255,255,.16);transform:translateY(-1px)}
.external-link-btn.pms{border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8}
.external-link-btn.report{border-color:#fed7aa;background:#fff7ed;color:#c2410c}
.external-link-btn.disabled{opacity:.45;cursor:not-allowed;filter:grayscale(.2)}
@media(max-width:900px){.header-external-links{gap:5px}.external-link-btn{padding:7px 9px;font-size:11.5px}.external-link-label{display:none}}


.audit-table.compact-audit-table{
  table-layout:fixed;
  width:100%;
  min-width:1180px;
  border-collapse:collapse;
}
.audit-table.compact-audit-table th,
.audit-table.compact-audit-table td{
  vertical-align:top;
  padding:10px 12px;
  line-height:1.35;
}
.modal-body .table-scroll{
  overflow-x:auto !important;
  overflow-y:auto;
}
.audit-table .nowrap,
.log-table .nowrap{white-space:nowrap;word-break:normal}
.audit-table .time-cell{
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
  text-align:left;
  min-width:0;
}
.audit-table .time-cell .audit-date{
  display:block;
  font-weight:800;
  color:#0f172a;
  line-height:1.25;
  white-space:nowrap;
}
.audit-table .time-cell .audit-time{
  display:block;
  color:#475569;
  line-height:1.25;
  margin-top:4px;
  white-space:nowrap;
}
.audit-table .status-cell{
  white-space:nowrap;
  word-break:normal;
  overflow-wrap:normal;
  text-align:center;
  min-width:0;
}
.audit-table .status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:6px 12px;
  min-width:54px;
  font-weight:800;
  background:#dcfce7;
  color:#166534;
  border:1px solid #86efac;
}
.audit-table.compact-audit-table th{
  white-space:normal;
  word-break:normal;
  overflow-wrap:normal;
  font-size:13px;
}
.audit-table.compact-audit-table td{
  font-size:13px;
}
.audit-table.compact-audit-table th:nth-child(1),
.audit-table.compact-audit-table td:nth-child(1){text-align:center}
.audit-table.compact-audit-table th:nth-child(7),
.audit-table.compact-audit-table td:nth-child(7){text-align:center}


/* LayoutFix electronic viewer */
.doc-viewer-frame{background:#fff}
.modal.viewer-modal .modal-body{overflow:hidden}


/* Compliance V2: compact audit log and revision history */
.section.update-highlight{
  outline:3px solid rgba(245,158,11,.45);
  background:linear-gradient(90deg, rgba(255,251,235,.95), rgba(255,255,255,.98));
  border-radius:18px;
  padding-left:18px;
  padding-right:18px;
  box-shadow:0 0 0 1px rgba(245,158,11,.35), 0 10px 26px rgba(245,158,11,.08);
}
.section.update-highlight h1,
.section.update-highlight h2,
.section.update-highlight h3{color:#9a3412}
.audit-log-compact{
  width:100%;
  table-layout:fixed;
  border-collapse:collapse;
  font-size:12.5px;
}
.audit-log-compact th,
.audit-log-compact td{
  padding:8px 9px;
  line-height:1.32;
  vertical-align:top;
  word-break:normal;
  overflow-wrap:break-word;
}
.audit-log-compact .small-muted{display:block;color:#64748b;font-size:11.5px;margin-top:3px}
.audit-log-compact .time-pair{font-size:12px;line-height:1.35}
.audit-log-compact .time-pair strong{font-size:11px;color:#475569}
.audit-log-compact .status-badge{padding:5px 10px;min-width:44px}
.audit-log-wrap{overflow-x:hidden!important;overflow-y:auto}
.revision-history-table{
  width:100%;
  table-layout:fixed;
  border-collapse:collapse;
  font-size:13px;
}
.revision-history-table th,
.revision-history-table td{
  padding:9px 10px;
  line-height:1.35;
  vertical-align:top;
  overflow-wrap:break-word;
  word-break:normal;
}
.revision-history-table .reason-col{
  white-space:pre-wrap;
  min-width:0;
}


.lang-badge{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:4px 8px;border-radius:999px;background:#e0f2fe;color:#075985;font-weight:800;font-size:12px}
.audit-log-compact th,.audit-log-compact td{font-size:14px;line-height:1.35}
.audit-log-compact .time-pair{white-space:normal;font-size:13px;line-height:1.35}
.audit-log-compact .status-badge{white-space:nowrap}

/* PDF-first main viewer */
.pdf-main-section{padding:0;background:transparent;border:0;box-shadow:none}
.pdf-main-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:12px 16px;border:1px solid #dbe4ef;border-radius:16px;background:#fff}
.pdf-main-title{font-weight:900;color:#0f172a}
.pdf-viewer-frame{width:100%;height:calc(100vh - var(--fixed-offset, 150px) - 110px);min-height:760px;border:1px solid #dbe4ef;border-radius:16px;background:#f8fafc;box-shadow:0 10px 28px rgba(15,23,42,.08)}
.pdf-switcher{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.pdf-switcher .btn.active{background:#1d4ed8;color:#fff;border-color:#1d4ed8}
.pdf-empty{padding:28px;border:1px dashed #cbd5e1;border-radius:16px;background:#f8fafc;color:#64748b}


.related-procedure-panel{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;margin:0 0 10px;border:1px solid var(--line);border-radius:14px;background:#fff}
.related-procedure-panel strong{color:#334155;margin-right:4px}
.related-procedure-panel .btn.mini{padding:8px 10px;font-size:12px}
.related-procedure-panel .btn.active{background:#2563eb;color:#fff;border-color:#2563eb}
.pdf-main-section{padding:14px!important}
.pdf-viewer-frame{width:100%;min-height:78vh;border:1px solid var(--line);border-radius:14px;background:#fff}
.pdf-main-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}
.pdf-main-title{font-weight:800;font-size:16px;color:#0f172a}
.pdf-switcher{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.pdf-empty{padding:28px;border:1px dashed var(--line);border-radius:18px;background:#fff;color:#64748b}


/* === PATCH V4: compact PDF-first layout === */
:root{
  --topbar-height:82px;
  --fixed-offset:var(--topbar-height);
}
.topbar{
  min-height:0 !important;
  max-height:none !important;
  overflow:visible !important;
}
.topbar-inner{
  min-height:0 !important;
  padding:5px 12px 5px !important;
  gap:3px !important;
}
.header-row{
  gap:8px !important;
}
.header-row-top{
  align-items:center !important;
}
.header-row-bottom{
  border-top:0 !important;
  padding-top:0 !important;
  min-height:0 !important;
}
.header-doc-block{
  min-width:220px !important;
}
.doc-title{
  font-size:clamp(16px,1.35vw,20px) !important;
  line-height:1.08 !important;
  font-weight:800 !important;
}
.doc-meta{
  margin-top:3px !important;
  font-size:11.5px !important;
  line-height:1.28 !important;
}
.doc-meta .meta-line{
  gap:10px !important;
}
.top-actions,.bottom-actions,.header-update-area{
  gap:5px !important;
}
.lang-switch{
  padding:3px !important;
  gap:3px !important;
}
.lang-btn{
  padding:5px 10px !important;
  font-size:12px !important;
  font-weight:800 !important;
}
.header-conn,.sync-btn,.external-link-btn,.log-header-btn,.header-update-btn,.logout-btn,.user-badge{
  padding:6px 9px !important;
  font-size:11.5px !important;
  line-height:1.15 !important;
}
.user-badge{
  max-width:210px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
.layout{
  margin-top:var(--fixed-offset) !important;
  min-height:calc(100vh - var(--fixed-offset)) !important;
}
.sidebar{
  top:var(--fixed-offset) !important;
  height:calc(100vh - var(--fixed-offset)) !important;
  padding-top:14px !important;
}
.actionbar{
  top:var(--fixed-offset) !important;
  padding:8px 0 !important;
  margin-bottom:8px !important;
}
.action-card{
  padding:8px 10px !important;
  border-radius:14px !important;
}
.btn{
  padding:8px 11px !important;
  font-size:13px !important;
}
.pdf-main-section{
  padding:8px !important;
}
.pdf-main-toolbar{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  margin:0 0 6px !important;
  padding:6px 8px !important;
  border:0 !important;
  background:transparent !important;
}
.pdf-main-title{
  display:none !important;
}
.pdf-switcher{
  margin:0 !important;
  gap:5px !important;
}
.related-procedure-panel{
  margin:0 0 6px !important;
  padding:7px 9px !important;
  border-radius:12px !important;
}
.related-procedure-panel .btn.mini{
  padding:6px 8px !important;
  font-size:11.5px !important;
}
.pdf-viewer-frame{
  height:calc(100vh - var(--fixed-offset) - 76px) !important;
  min-height:calc(100vh - var(--fixed-offset) - 76px) !important;
  border-radius:12px !important;
}
.section,#contentTop,.ack-block,.update-card{
  scroll-margin-top:calc(var(--fixed-offset) + 18px) !important;
}
@media(max-width:1100px){
  :root{--topbar-height:104px}
  .header-row-top{align-items:flex-start !important}
  .top-actions{max-width:100% !important}
}
@media(max-width:900px){
  :root{--topbar-height:116px}
  .topbar-inner{padding:6px 10px !important}
  .pdf-viewer-frame{min-height:70vh !important;height:70vh !important}
}

.count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;margin-left:4px;padding:0 5px;border-radius:999px;background:#e0f2fe;color:#075985;font-size:11px;font-weight:900;border:1px solid #bae6fd}
.btn.ghost{opacity:.62;background:#f8fafc;border-color:#e2e8f0;color:#64748b}

/* V15 PDF.js exact navigation + compact reading area */
.pdf-main-section.pdfjs-mode{padding:0;margin:0;border:0;background:transparent;box-shadow:none}
.pdf-js-viewer{height:calc(100vh - var(--fixed-offset) - 18px);min-height:620px;width:100%;overflow:auto;background:#525659;border:1px solid #cbd5e1;border-radius:12px;padding:10px;scroll-behavior:smooth}
.pdf-js-page{position:relative;margin:0 auto 14px auto;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.25)}
.pdf-js-page canvas{display:block;width:100%;height:auto}
.pdf-js-loading,.pdf-js-error{background:#fff;color:#0f172a;border:1px solid #dbe4ef;border-radius:12px;padding:18px;margin:0}
.pdf-fallback-frame{width:100%;height:calc(100vh - var(--fixed-offset) - 18px);min-height:620px;border:0;border-radius:12px;background:#fff}



/* V18 Word HTML main content */
.word-html-main-section{padding:0!important;overflow:hidden;background:#fff}
.word-html-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid #dbe3ef;background:#f8fafc;position:sticky;top:0;z-index:2}
.word-html-frame{width:100%;height:calc(100vh - var(--fixed-offset) - 90px);min-height:720px;border:0;background:#fff}


/* === V20 FIX: no outer page scroll + Word HTML fits one landscape page width === */
html, body{
  height:100%;
  overflow:hidden !important;
}
#appView{
  height:100vh;
  overflow:hidden !important;
}
.layout{
  height:calc(100vh - var(--fixed-offset) - 2px) !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.sidebar{
  height:100% !important;
  max-height:none !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}
.main{
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  padding:16px 18px 18px !important;
}
.content-wrap{
  width:100% !important;
  max-width:none !important;
  height:100% !important;
  margin:0 !important;
  display:flex !important;
  flex-direction:column !important;
  min-width:0 !important;
  min-height:0 !important;
}
.actionbar{
  flex:0 0 auto !important;
  margin-bottom:8px !important;
  padding:8px 0 !important;
}
.action-card{
  padding:8px 10px !important;
}
.doc-card{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}
#content{
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.word-html-main-section{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  background:#fff !important;
}
.word-html-toolbar{
  flex:0 0 auto !important;
  position:relative !important;
  top:auto !important;
  padding:8px 12px !important;
}
.word-html-frame{
  flex:1 1 auto !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  border:0 !important;
  display:block !important;
  overflow:hidden !important;
  background:#fff !important;
}
#acknowledgement{
  flex:0 0 auto !important;
  padding:10px 16px !important;
  max-height:72px !important;
  overflow:hidden !important;
  border-top:1px solid var(--line) !important;
}
#acknowledgement .ack-block{
  padding:0 !important;
}
#acknowledgement h2{
  font-size:16px !important;
  margin:0 0 4px !important;
}
#acknowledgement p{
  margin:0 0 6px !important;
  font-size:13px !important;
}
#acknowledgement .btn{
  padding:7px 10px !important;
  font-size:12.5px !important;
}
.table-scroll,
.bottom-actions{
  overflow-x:hidden !important;
}
@media(max-width:900px){
  html,body,#appView{height:auto;overflow:auto !important}
  .layout{height:auto !important;overflow:visible !important}
  .main,.content-wrap,.doc-card,#content{height:auto !important;overflow:visible !important}
  .word-html-frame{height:72vh !important;min-height:520px !important}
}

/* === V21 FIX: move related-file toolbar to the fixed topbar, maximize document area, hide read confirmation until the user reaches the end === */
.header-row-bottom{
  align-items:flex-end!important;
  justify-content:space-between!important;
  gap:12px!important;
}
.header-action-dock{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
  min-width:0!important;
  flex:1 1 auto!important;
}
.header-action-dock .action-left,
.header-action-dock .action-right{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:8px!important;
  flex-wrap:wrap!important;
  min-width:0!important;
}
.header-action-dock .btn{
  min-height:36px!important;
  padding:8px 12px!important;
  border-radius:12px!important;
  font-size:13px!important;
  font-weight:800!important;
  box-shadow:none!important;
}
.header-action-dock .btn.primary{
  background:#2563eb!important;
  border-color:#2563eb!important;
  color:#fff!important;
}
.header-action-dock .count-badge{
  margin-left:4px!important;
}
.actionbar{display:none!important}
.main{
  padding:0!important;
}
.content-wrap{
  padding:0!important;
}
.doc-card{
  border-radius:0!important;
  border-top:0!important;
  border-right:0!important;
  border-bottom:0!important;
  box-shadow:none!important;
}
.word-html-main-section{
  padding:0!important;
  border-bottom:0!important;
}
.word-html-toolbar{
  display:none!important;
}
.word-html-frame{
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
#content:not(.reading-complete) #acknowledgement{
  display:none!important;
}
#content.reading-complete #acknowledgement{
  display:block!important;
  flex:0 0 auto!important;
}
#acknowledgement{
  max-height:none!important;
  overflow:visible!important;
}
#acknowledgement .ack-block{
  margin:0!important;
  border-radius:0!important;
  border-left:0!important;
  border-right:0!important;
  border-bottom:0!important;
  padding:16px 18px!important;
}
@media(max-width:1120px){
  .header-row-bottom{align-items:flex-start!important;flex-direction:column!important}
  .header-action-dock{width:100%!important;justify-content:flex-start!important}
  .header-action-dock .action-left,.header-action-dock .action-right{justify-content:flex-start!important}
}



/* === V27 FIX: PDF-generated HTML viewer must not replace ACK/read-confirmation panel === */
#content{
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
}
#content.reading-complete #acknowledgement,
#content #acknowledgement.ack-visible{
  display:block !important;
  flex:0 0 auto !important;
}
#content #acknowledgement.ack-visible{
  max-height:132px !important;
  overflow:auto !important;
  border-top:1px solid var(--line) !important;
  background:#f8fafc !important;
}
#content #acknowledgement.ack-visible .ack-block{
  margin:0 !important;
}
.word-html-main-section{
  flex:1 1 auto !important;
  min-height:0 !important;
}


/* === V30 COMPACT WORD HTML WIDTH + SINGLE ACK BUTTON + FULL UPDATE TEXT === */
.word-html-main-section{
  background:#eef2f7 !important;
  align-items:center !important;
  padding:8px 0 !important;
}
.word-html-frame{
  width:900px !important;
  max-width:calc(100vw - 36px) !important;
  margin:0 auto !important;
  align-self:center !important;
  border:0 !important;
  background:#fff !important;
  box-shadow:0 10px 28px rgba(15,23,42,.12) !important;
}
#content #acknowledgement.ack-visible,
#content.reading-complete #acknowledgement,
#acknowledgement{
  display:block !important;
  flex:0 0 auto !important;
  max-height:54px !important;
  min-height:0 !important;
  overflow:hidden !important;
  padding:6px 8px !important;
  background:#f8fafc !important;
  border-top:1px solid var(--line) !important;
}
#acknowledgement .ack-block{
  margin:0 !important;
  padding:0 !important;
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
  min-height:0 !important;
}
#acknowledgement h2,
#acknowledgement p,
#acknowledgement .ack-log,
#acknowledgement .btn:not(.green){
  display:none !important;
}
#acknowledgement .btn.green,
#acknowledgement #ackConfirmBtn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:8px 18px !important;
  min-height:36px !important;
  line-height:1.15 !important;
  font-size:13px !important;
  border-radius:12px !important;
  white-space:nowrap !important;
}
.status-chip,
.read-status-badge,
.header-update-btn,
.jump-update-btn{
  white-space:normal !important;
  max-width:100% !important;
  overflow:visible !important;
  text-overflow:clip !important;
  line-height:1.25 !important;
}
.header-update-area,
.header-action-dock,
.top-actions,
.update-left,
.update-right{
  min-width:0 !important;
  flex-wrap:wrap !important;
}
.modal,
.modal-body,
.update-history-modal,
#historyModal .modal,
#updateHistoryModal .modal{
  overflow:visible !important;
}
.table-scroll{
  overflow:auto !important;
}
.table-scroll th,
.table-scroll td{
  white-space:normal !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
@media(max-width:980px){
  .word-html-frame{width:calc(100vw - 26px) !important;}
}

/* V32 compact update history and file cards */
.revision-history-table th,.revision-history-table td{padding:6px 8px!important;line-height:1.25!important;vertical-align:top!important;font-size:13px!important;}
.revision-history-table tr{height:auto!important;min-height:unset!important;}
.revision-history-table .reason-col{max-width:460px!important;}
.file-card{padding:10px 12px!important;gap:10px!important;}
.file-card h3{margin:0 0 4px!important;font-size:15px!important;}
.file-card p{margin:0!important;font-size:12px!important;line-height:1.35!important;}
.file-actions{display:flex!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important;justify-content:flex-end!important;}



/* V33: compact audit/update rows and permission-safe delete buttons */
.audit-log-compact th,.audit-log-compact td,
.revision-history-table th,.revision-history-table td{
  padding:4px 6px!important;
  line-height:1.18!important;
  vertical-align:top!important;
  font-size:12px!important;
}
.audit-log-compact .time-pair,
.revision-history-table .reason-col{
  line-height:1.16!important;
}
.history-actions{
  gap:6px!important;
  margin:6px 0 8px!important;
}
.log-note{
  margin:0 0 8px!important;
  line-height:1.25!important;
}

/* V34 compact file list / history / update notice */
.file-card.file-card-compact{padding:9px 12px!important;min-height:0!important;gap:10px}
.file-card.file-card-compact h3{font-size:14px!important;margin:0 0 4px!important;line-height:1.25!important}
.file-card.file-card-compact p{font-size:12px!important;margin:0!important;line-height:1.25!important;word-break:break-all}
.file-card.file-card-compact .file-actions{display:flex!important;gap:8px!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important}
.file-card.file-card-compact .file-actions .btn{white-space:nowrap!important;padding:7px 12px!important;font-size:12px!important}
.revision-history-table th,.revision-history-table td{padding:5px 7px!important;font-size:12px!important;line-height:1.2!important;vertical-align:top!important}
.revision-history-table tr{height:auto!important;min-height:0!important}
.revision-history-table .reason-col{max-width:360px!important;white-space:normal!important}
.audit-log-compact th,.audit-log-compact td{padding:5px 7px!important;font-size:12px!important;line-height:1.2!important}
.update-card.update-card-compact{padding:10px 12px!important;margin:0 0 10px!important;border-radius:12px!important}
.update-card.update-card-compact h2{font-size:15px!important;margin:0 0 5px!important}
.update-card.update-card-compact p{font-size:12.5px!important;line-height:1.35!important;margin:3px 0!important}


/* === V35 FINAL COMPACT PATCH === */
.update-card,.update-note{display:none!important}
.header-update-area{display:flex!important;gap:8px!important;flex-wrap:wrap!important;align-items:center!important}
.header-update-btn{padding:6px 12px!important;font-size:12px!important;line-height:1!important;border-radius:999px!important}
.file-list{display:grid!important;gap:8px!important}
.file-card.file-card-compact{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;padding:8px 10px!important;gap:10px!important;border-radius:12px!important}
.file-card.file-card-compact h3{font-size:13.5px!important;line-height:1.18!important;margin:0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.file-card.file-card-compact p{font-size:11.5px!important;line-height:1.18!important;margin:3px 0 0!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;word-break:normal!important}
.file-card.file-card-compact .file-actions{display:flex!important;gap:6px!important;align-items:center!important;justify-content:flex-end!important;flex-wrap:nowrap!important}
.file-card.file-card-compact .file-actions .btn{padding:6px 10px!important;font-size:12px!important;line-height:1!important;min-height:30px!important;white-space:nowrap!important}
.revision-history-table{table-layout:fixed!important;font-size:11.5px!important;border-collapse:collapse!important}
.revision-history-table th,.revision-history-table td{padding:3px 5px!important;line-height:1.12!important;vertical-align:middle!important;min-height:0!important;height:auto!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.revision-history-table .reason-col{white-space:nowrap!important;max-width:260px!important;overflow:hidden!important;text-overflow:ellipsis!important}
.revision-history-table .btn{padding:3px 7px!important;font-size:11px!important;line-height:1!important;min-height:22px!important}
.revision-history-table tr{height:28px!important;min-height:0!important}
.history-actions{margin:4px 0 6px!important;gap:6px!important}
.log-note{font-size:11.5px!important;line-height:1.18!important;margin:0 0 6px!important}


/* V36 compact file list and history layout */
.file-list{display:grid!important;gap:8px!important}
.file-card.file-card-compact{grid-template-columns:minmax(0,1fr) auto!important;padding:10px 12px!important;border-radius:12px!important;gap:12px!important}
.file-card.file-card-compact h3{font-size:14px!important;line-height:1.25!important;margin:0 0 3px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important}
.file-card.file-card-compact p{font-size:12px!important;line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-width:100%!important}
.file-actions{gap:6px!important;flex-wrap:nowrap!important}
.file-actions .btn{padding:7px 12px!important;font-size:13px!important;white-space:nowrap!important}
.revision-history-table{font-size:12px!important;table-layout:fixed!important}
.revision-history-table th,.revision-history-table td{padding:4px 6px!important;line-height:1.18!important;vertical-align:middle!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;max-height:34px!important}
.revision-history-table .reason-col{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.table-scroll{max-height:calc(100vh - var(--fixed-offset,140px) - 170px)!important;overflow:auto!important}
.history-actions{margin:6px 0!important}
.log-note{font-size:12px!important;line-height:1.25!important;margin:0 0 6px!important}


.remote-update-banner{position:fixed;right:18px;bottom:18px;z-index:9999;display:flex;align-items:center;gap:10px;max-width:min(520px,calc(100vw - 36px));padding:12px 14px;border:1px solid rgba(37,99,235,.28);border-radius:16px;background:rgba(15,23,42,.96);color:#fff;box-shadow:0 14px 40px rgba(15,23,42,.28);font-weight:700}
.remote-update-banner.hidden{display:none}
.remote-update-banner button{border:0;border-radius:999px;padding:7px 12px;font-weight:800;cursor:pointer}
.remote-update-banner button:first-of-type{background:#2563eb;color:#fff}
.remote-update-banner button:last-of-type{background:rgba(255,255,255,.14);color:#fff}

/* === R64 ACK ACTION ROW + CATEGORY BUTTONS FIX === */
#content #acknowledgement.ack-visible,
#content.reading-complete #acknowledgement,
#acknowledgement{
  max-height:92px !important;
  overflow:visible !important;
}
#acknowledgement .ack-action-card{
  display:flex !important;
  flex-wrap:wrap !important;
  justify-content:center !important;
  align-items:center !important;
  gap:8px !important;
}
#acknowledgement .ack-related-actions{
  display:inline-flex !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
}
#acknowledgement .ack-related-actions .btn,
#acknowledgement .ack-related-actions .ack-file-btn{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:8px 12px !important;
  min-height:36px !important;
  line-height:1.15 !important;
  font-size:12.5px !important;
  border-radius:12px !important;
  white-space:nowrap !important;
}
#acknowledgement .btn:not(.green){
  display:inline-flex !important;
}


/* === STEP 16: consolidate ISC update notices into one Update status button; hide success update pill === */
.app-update-notice{display:none!important}
.header-update-area{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.header-update-status-btn{
  border:1px solid rgba(253,186,116,.72);
  background:#fff7ed;
  color:#9a3412;
  border-radius:999px;
  padding:7px 11px;
  cursor:pointer;
  font-weight:900;
  font-size:12.5px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  box-shadow:0 0 0 2px rgba(245,158,11,.13);
}
.header-update-status-btn:hover{background:#ffedd5}
.header-update-status-btn strong{
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#0f172a;
  color:#fff;
  font-size:12px;
  line-height:1;
}
.update-status-panel{display:grid;gap:12px}
.update-status-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  border:1px solid #e2e8f0;
  background:#f8fafc;
  border-radius:14px;
  padding:10px 12px;
  color:#334155;
  font-size:13px;
}
.update-status-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.update-status-list{display:grid;gap:10px}
.update-status-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border:1px solid #fed7aa;
  background:#fffbeb;
  border-radius:16px;
  padding:12px;
}
.update-status-main{min-width:0;display:grid;gap:4px}
.update-status-code{font-size:13px;font-weight:950;color:#9a3412;letter-spacing:.02em}
.update-status-title{font-size:14px;font-weight:850;color:#0f172a}
.update-status-meta{display:flex;gap:8px;flex-wrap:wrap;color:#64748b;font-size:12px;font-weight:700}
.update-status-meta span{
  display:inline-flex;
  align-items:center;
  border:1px solid #e2e8f0;
  background:#fff;
  border-radius:999px;
  padding:3px 7px;
}
.update-status-summary{color:#475569;font-size:12.5px;line-height:1.45}
.update-status-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end;flex:0 0 auto}
.update-status-empty{
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#166534;
  border-radius:16px;
  padding:14px;
  font-weight:850;
}
@media(max-width:720px){
  .update-status-row{display:grid}
  .update-status-actions{justify-content:flex-start}
}



/* BASE R74 Step 17: Refresh button moved beside language selector. */
.header-refresh-btn{
  margin-left:2px;
  flex:0 0 auto;
}
.top-actions .header-refresh-btn{
  order:2;
}
.top-actions .header-conn{
  order:3;
}


/* STEP24: đồng bộ chiều cao nút header bằng nút Login/Logout và đặt Login/Logout ngay bên phải Online */
:root{
  --esms-header-pill-height:30px;
}

.topbar .top-actions{
  align-items:center!important;
}

.topbar .top-actions .lang-switch{order:1;}
.topbar .top-actions .header-external-links{order:2;}
.topbar .top-actions .user-badge{order:3;}
.topbar .top-actions .header-refresh-btn{order:4;}
.topbar .top-actions .header-conn{order:5;}
.topbar .top-actions .logout-btn{order:6;}

.topbar .logout-btn,
.topbar .header-conn,
.topbar .external-link-btn,
.topbar .log-header-btn,
.topbar .header-update-btn,
.topbar .header-update-status-btn,
.topbar .user-badge,
.header-row-bottom .log-header-btn,
.header-row-bottom .header-update-status-btn,
.header-action-dock .btn{
  height:var(--esms-header-pill-height)!important;
  min-height:var(--esms-header-pill-height)!important;
  box-sizing:border-box!important;
  padding-top:0!important;
  padding-bottom:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  border-radius:999px!important;
}

.topbar .logout-btn,
.topbar .header-conn,
.topbar .external-link-btn,
.topbar .log-header-btn,
.topbar .header-update-btn,
.topbar .header-update-status-btn,
.topbar .user-badge,
.header-row-bottom .log-header-btn,
.header-row-bottom .header-update-status-btn{
  padding-left:10px!important;
  padding-right:10px!important;
  font-size:11.5px!important;
}

.header-action-dock .btn{
  padding-left:12px!important;
  padding-right:12px!important;
  font-size:12px!important;
}

.topbar .lang-switch{
  height:var(--esms-header-pill-height)!important;
  min-height:var(--esms-header-pill-height)!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  padding:3px!important;
  gap:3px!important;
  border-radius:999px!important;
}

.topbar .lang-switch .lang-btn{
  height:calc(var(--esms-header-pill-height) - 8px)!important;
  min-height:calc(var(--esms-header-pill-height) - 8px)!important;
  padding:0 10px!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  border-radius:999px!important;
}

.topbar .header-external-links{
  display:inline-flex!important;
  align-items:center!important;
}

.header-update-status-btn strong,
.header-action-dock .count-badge{
  height:20px!important;
  min-height:20px!important;
  min-width:20px!important;
  padding:0 6px!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  border-radius:999px!important;
}

#acknowledgement #ackConfirmBtn,
#acknowledgement .main-isc-delete-btn,
#acknowledgement .ack-related-actions .btn,
#acknowledgement .ack-related-actions .ack-file-btn{
  min-height:var(--esms-header-pill-height)!important;
  height:var(--esms-header-pill-height)!important;
  padding-top:0!important;
  padding-bottom:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  line-height:1!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
}
