/* ===== Công cụ thực hành Word / Excel ===== */
main.tools-main { max-width: none; padding: 0; }
.tl { display: flex; flex-direction: column; height: calc(100vh - 56px); background: #f3f3f3; color: #1f1f1f; font-size: 13px; position: relative; }
.tl:fullscreen { height: 100vh; }
.tl button { font-family: inherit; }
.tl-title { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #fff; border-bottom: 1px solid #e1e1e1; }
.tl-app { width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.tl-app.word { background: #185abd; } .tl-app.excel { background: #107c41; }
.tl-name { border: 1px solid transparent; background: transparent; font-weight: 600; font-size: 14px; padding: 3px 6px; border-radius: 4px; width: min(360px, 40vw); }
.tl-name:hover, .tl-name:focus { border-color: #c8c8c8; background: #fff; outline: none; }
.tl-saved { color: #6b6b6b; font-size: 12px; white-space: nowrap; }
.tl-title-sp, .tl-tabs-sp, .tl-status-sp { flex: 1; }
.tl-title .btn.sm { padding: 3px 10px; }

.tl-tabs { display: flex; align-items: flex-end; gap: 2px; padding: 0 8px; background: #fff; border-bottom: 1px solid #e1e1e1; overflow-x: auto; }
.tl-tab { border: 0; background: transparent; padding: 7px 12px 6px; font-size: 13px; cursor: pointer; color: #333; border-bottom: 3px solid transparent; white-space: nowrap; }
.tl-tab:hover { background: #f3f3f3; }
.wp .tl-tab.on { border-bottom-color: #185abd; color: #185abd; font-weight: 600; }
.ss .tl-tab.on { border-bottom-color: #107c41; color: #107c41; font-weight: 600; }
.tl-tab.file { color: #fff; border-radius: 4px 4px 0 0; margin-right: 6px; }
.wp .tl-tab.file { background: #185abd; } .ss .tl-tab.file { background: #107c41; }
.tl-tab.file.on { color: #fff !important; border-bottom-color: transparent !important; filter: brightness(1.12); }
.tl-tab.ctx { color: #8a4b08; } .tl-tab.ctx.on { color: #8a4b08 !important; border-bottom-color: #d97706 !important; }
.tl-collapse { color: #777; }
.rb-collapsed .tl-ribbon { display: none; } .rb-collapsed .tl-collapse { transform: rotate(180deg); }

.tl-ribbon { background: #fff; border-bottom: 1px solid #d6d6d6; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.tl-panel { display: none; gap: 0; padding: 4px 6px 0; overflow-x: auto; min-height: 92px; align-items: stretch; }
.tl-panel.on { display: flex; }
.tl-grp { display: flex; flex-direction: column; border-right: 1px solid #e3e3e3; padding: 0 6px; flex-shrink: 0; }
.tl-grp-in { display: flex; gap: 2px; align-items: flex-start; flex: 1; }
.tl-grp-l { text-align: center; font-size: 11px; color: #666; padding: 2px 0 3px; white-space: nowrap; }
.tl-col { display: flex; flex-direction: column; gap: 2px; justify-content: flex-start; }
.tl-row { display: flex; gap: 1px; align-items: center; }
.tl-b { border: 1px solid transparent; background: transparent; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px; min-height: 26px; color: #222; font-size: 12.5px; line-height: 1; white-space: nowrap; position: relative; }
.tl-b:hover { background: #f0f0f0; border-color: #e0e0e0; }
.tl-b.on { background: #d6e4f7; border-color: #a9c4ea; }
.ss .tl-b.on { background: #d3eadb; border-color: #9fcfb0; }
.tl-b .ic { font-size: 15px; display: inline-flex; align-items: center; justify-content: center; min-width: 16px; }
.tl-b .dd { font-size: 9px; color: #666; margin-left: 1px; }
.tl-b.big { flex-direction: column; justify-content: flex-start; padding: 4px 6px; min-width: 48px; height: 66px; gap: 4px; }
.tl-b.big .ic { font-size: 24px; height: 28px; }
.tl-b.big .lb { font-size: 11.5px; text-align: center; white-space: normal; max-width: 70px; line-height: 1.15; }
.tl-b.big .dd { position: absolute; right: 2px; bottom: 3px; }
.tl-b sup { font-size: 8px; } .tl-b sub { font-size: 8px; }
.clr { position: relative; display: inline-flex; flex-direction: column; align-items: center; font-weight: 700; }
.clr .bar { display: block; width: 16px; height: 4px; margin-top: 1px; border: 1px solid rgba(0,0,0,.15); }
.tl-sel { padding: 3px 5px; font-size: 12.5px; border-radius: 3px; border: 1px solid #c8c8c8; height: 26px; background: #fff; }
.tl-sel.wide { width: 140px; }
.tl-num { width: 56px; padding: 3px 5px; font-size: 12.5px; border-radius: 3px; border: 1px solid #c8c8c8; height: 26px; }
.tl-lbl { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 400; margin: 0; font-size: 12px; }
.tl-lbl .tl-num, .tl-lbl .tl-sel { width: 64px; height: 24px; }
.tl-styles { display: grid; grid-template-columns: repeat(3, 88px); gap: 3px; }
.tl-style { height: 30px; border: 1px solid #e0e0e0; background: #fff; border-radius: 3px; cursor: pointer; overflow: hidden; text-align: left; padding: 0 6px; color: #222; }
.tl-style:hover { border-color: #9cb8e2; } .tl-style.on { border-color: #185abd; box-shadow: inset 0 0 0 1px #185abd; }
.tl-style span { font-size: 12px; }
.tl-style.s-title span { font-size: 15px; font-family: 'Times New Roman'; } .tl-style.s-h1 span { font-weight: 700; color: #1f3864; } .tl-style.s-h2 span { font-weight: 700; color: #2e74b5; font-size: 11.5px; } .tl-style.s-h3 span { font-weight: 700; font-style: italic; color: #1f3864; font-size: 11.5px; } .tl-style.s-blockquote span { font-style: italic; color: #555; }

.tl-status { display: flex; align-items: center; gap: 14px; padding: 3px 12px; font-size: 12px; color: #444; background: #f3f3f3; border-top: 1px solid #dcdcdc; }
.tl-sb { border: 0; background: transparent; cursor: pointer; padding: 1px 6px; border-radius: 3px; font-size: 13px; }
.tl-sb:hover { background: #e3e3e3; }
.tl-zoom { width: 110px; accent-color: #555; }
.tl-zoomv { width: 38px; text-align: right; }

.tl-pop { position: fixed; z-index: 120; background: #fff; border: 1px solid #c8c8c8; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; min-width: 180px; max-height: 70vh; overflow: auto; font-size: 13px; }
.tl-pop.wide { min-width: 280px; }
.tl-pop-i { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; color: #222; font-weight: 400; margin: 0; }
.tl-pop-i:hover { background: #eef3fb; }
.tl-pop-i .ic { min-width: 22px; text-align: center; }
.tl-pop-i kbd { margin-left: auto; font-size: 11px; color: #777; border: 0; font-family: inherit; }
.tl-pop-i small { color: #666; font-weight: 400; }
.tl-pop-sep { height: 1px; background: #e5e5e5; margin: 4px 2px; }
.tl-pop-head { font-size: 11px; font-weight: 700; color: #666; padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .03em; }
.tl-colors { display: grid; grid-template-columns: repeat(7, 22px); gap: 4px; padding: 6px; }
.tl-colors button { width: 22px; height: 22px; border: 1px solid rgba(0,0,0,.2); border-radius: 3px; cursor: pointer; padding: 0; }
.tl-colors button:hover { outline: 2px solid #185abd; }
.tl-pop-i input[type=color] { width: 34px; height: 22px; padding: 0; border: 0; margin-left: auto; }
.tl-syms { display: grid; grid-template-columns: repeat(10, 30px); gap: 2px; padding: 4px; }
.tl-syms button { height: 30px; border: 1px solid #e5e5e5; background: #fff; border-radius: 3px; cursor: pointer; font-size: 16px; }
.tl-syms button:hover { background: #eef3fb; border-color: #9cb8e2; }
.tl-tgrid-l { font-size: 12px; padding: 4px 6px; color: #333; }
.tl-tgrid { display: grid; grid-template-columns: repeat(10, 18px); gap: 2px; padding: 4px 6px; }
.tl-tgrid i { width: 18px; height: 18px; border: 1px solid #bbb; background: #fff; cursor: pointer; display: block; }
.tl-tgrid i.on { background: #d6e4f7; border-color: #185abd; }

.tl-modal .modal-box { padding: 0; }
.tl-dlg-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; }
.tl-dlg-h h3 { margin: 0; }
.tl-dlg-b { padding: 4px 18px 0; }
.tl-modal .row-btns { padding: 0 18px 16px; }
.tl-x { border: 0; background: transparent; cursor: pointer; font-size: 16px; color: #666; border-radius: 4px; padding: 2px 6px; }
.tl-x:hover { background: #eee; }
.tl-form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tl-form2 label { margin: 8px 0 2px; font-size: 13px; }
.tl-preview { border: 1px solid #ddd; padding: 12px; margin-top: 12px; background: #fafafa; text-align: center; font-size: 13pt; }
.tl-files { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow: auto; }
.tl-file { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; border: 1px solid #e5e5e5; border-radius: 6px; padding: 8px 10px; }
.tl-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tl-tpl { border: 1px solid #ddd; background: #fff; border-radius: 8px; padding: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.tl-tpl:hover { border-color: #185abd; box-shadow: 0 2px 8px rgba(24,90,189,.15); }
.tl-tpl.xl:hover { border-color: #107c41; }
.tl-tpl-pg { height: 110px; background: linear-gradient(#fff, #fff) padding-box, repeating-linear-gradient(#fff 0 10px, #eef1f5 10px 12px); border: 1px solid #e1e1e1; display: grid; place-items: center; font-size: 13px; color: #1f3864; font-weight: 700; text-align: center; padding: 8px; }
.tl-tpl.xl .tl-tpl-pg { font-size: 40px; color: #107c41; background: repeating-linear-gradient(90deg, #fff 0 28px, #e6efe9 28px 29px), #fff; }
.tl-tpl small { color: #666; font-size: 11.5px; }
.tl-help kbd { white-space: nowrap; }
.tl-find { position: absolute; right: 18px; top: 150px; z-index: 40; background: #fff; border: 1px solid #c8c8c8; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px 12px; width: 300px; display: flex; flex-direction: column; gap: 6px; }
.tl-find input:not([type=checkbox]) { width: 100%; padding: 5px 8px; }
.painting .wp-body, .painting .ss-grid td { cursor: copy !important; }

/* ===== Word ===== */
.wp-main { flex: 1; display: flex; min-height: 0; }
.wp-side { width: 260px; background: #fff; border-right: 1px solid #ddd; display: flex; flex-direction: column; }
.wp-side[hidden] { display: none; }
.wp-side-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eee; }
.wp-side-b { overflow: auto; padding: 8px 10px; flex: 1; }
.wp-nav { display: block; padding: 4px 6px; border-radius: 4px; cursor: pointer; color: #222; font-size: 13px; }
.wp-nav:hover { background: #eef3fb; text-decoration: none; }
.wp-nav.l1 { font-weight: 600; } .wp-nav.l2 { padding-left: 18px; } .wp-nav.l3 { padding-left: 30px; font-size: 12px; }
.wp-cm { border: 1px solid #f0d77d; background: #fffbea; border-radius: 6px; padding: 8px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px; }
.wp-scroll { flex: 1; overflow: auto; background: #e6e6e6; }
.wp-canvas { padding: 24px 20px 60px; width: max-content; min-width: 100%; box-sizing: border-box; }
.wp-page { --pw: 210mm; --ph: 297mm; width: var(--pw); min-height: var(--ph); margin: 0 auto; box-sizing: border-box; padding: var(--mt) var(--mr) var(--mb) var(--ml); position: relative; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  background-color: #fff; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--ph) - 7px), #e6e6e6 calc(var(--ph) - 7px), #e6e6e6 calc(var(--ph) + 7px), transparent calc(var(--ph) + 7px)); background-position: 0 0; background-size: 100% var(--ph); }
.wp-body { outline: none; min-height: calc(var(--ph) - var(--mt) - var(--mb)); position: relative; word-wrap: break-word; display: flow-root; }
.wp-body:empty::before { content: 'Bắt đầu soạn thảo…'; color: #aaa; }
.wp-hdr, .wp-ftr { display: none; position: absolute; left: var(--ml); right: var(--mr); outline: none; min-height: 1.4em; color: #333; }
.wp-hdr { top: max(6mm, calc(var(--mt) - 12mm)); } .wp-ftr { top: calc(var(--ph) - var(--mb) + 4mm); }
.show-hf .wp-hdr, .show-hf .wp-ftr { display: block; }
.show-hf .wp-hdr:empty::before, .show-hf .wp-ftr:empty::before { content: attr(data-ph); color: #9aa4b2; font-style: italic; }
.show-hf .wp-hdr:focus, .show-hf .wp-ftr:focus { outline: 1px dashed #185abd; outline-offset: 3px; }
.wp-body .wp-pb { display: block; position: relative; margin: 0 -1px; user-select: none; }
.wp-body .wp-pb::after { content: '········ Ngắt trang ········'; position: absolute; top: 0; left: 0; right: 0; text-align: center; font: 11px Arial; color: #7a8699; border-top: 1px dashed #9aa4b2; padding-top: 2px; }
.wp-body .wp-toc { border: 1px dashed transparent; padding: 4px; margin: 0 0 8pt; cursor: default; }
.wp-body .wp-toc:hover { border-color: #9cb8e2; background: #f7faff; }
.wp-body img { cursor: pointer; } .wp-body img.sel { outline: 2px solid #185abd; outline-offset: 1px; }
.wp-body mark.wp-cmt { background: #fff2a8; border-bottom: 2px solid #f0c419; color: inherit; cursor: help; }
.wp-body sup.wp-fnref { color: #185abd; }
.wp-body .wp-fns { margin-top: 18pt; font-size: 0.85em; }
.wp-body .wp-fn { margin: 0 0 2pt; }
.show-marks .wp-body p::after, .show-marks .wp-body h1::after, .show-marks .wp-body h2::after, .show-marks .wp-body h3::after, .show-marks .wp-body li::after, .show-marks .wp-body blockquote::after { content: '¶'; color: #7a9cc6; font-weight: 400; font-style: normal; margin-left: 2px; }
.show-marks .wp-body br { content: ''; }
.wp.web .wp-page { width: auto; max-width: none; background-image: none; min-height: calc(100vh - 260px); padding: 28px 40px; margin: 0; }
.wp.web .wp-canvas { width: auto; padding: 16px; }
.wp-imgbar { position: absolute; z-index: 30; display: flex; gap: 2px; align-items: center; background: #fff; border: 1px solid #c8c8c8; border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.18); padding: 3px; }
.wp-imgbar[hidden] { display: none; }
.wp-imgbar button { border: 0; background: transparent; cursor: pointer; padding: 3px 7px; border-radius: 4px; font-size: 12px; }
.wp-imgbar button:hover { background: #eef3fb; }
.wp-imgbar .sep { width: 1px; height: 18px; background: #ddd; margin: 0 2px; }
.wp-imgh { position: absolute; width: 12px; height: 12px; background: #185abd; border: 2px solid #fff; border-radius: 2px; cursor: nwse-resize; box-shadow: 0 0 0 1px #185abd; }

/* ===== Excel ===== */
.ss-fbar { display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid #d6d6d6; height: 28px; }
.ss-name { width: 96px; border: 0; border-right: 1px solid #d6d6d6; border-radius: 0; font-size: 12.5px; padding: 0 8px; text-align: left; }
.ss-fx { border: 0; border-right: 1px solid #e3e3e3; background: transparent; font-style: italic; font-family: Cambria, serif; font-size: 15px; color: #555; padding: 0 12px; cursor: pointer; }
.ss-fx:hover { background: #eee; }
.ss-input { flex: 1; border: 0; border-radius: 0; resize: none; font: 13px Consolas, Menlo, monospace; padding: 5px 8px; outline: none; height: 28px; min-height: 0; overflow: hidden; white-space: pre; }
.ss-input:focus { height: auto; min-height: 28px; max-height: 120px; overflow: auto; white-space: pre-wrap; box-shadow: 0 2px 8px rgba(0,0,0,.15); position: relative; z-index: 20; background: #fff; }
.ss-wrap { flex: 1; overflow: auto; position: relative; background: #fff; outline: none; min-height: 0; }
.ss-inner { position: relative; width: max-content; }
.ss-grid { border-collapse: collapse; table-layout: fixed; font-family: Calibri, Carlito, Arial, sans-serif; font-size: 11pt; user-select: none; background: #fff; }
.ss-grid th { background: #f3f3f3; color: #444; font-weight: 400; font-size: 12px; border: 1px solid #d4d4d4; padding: 0; text-align: center; position: relative; overflow: hidden; }
.ss-grid thead th { position: sticky; top: 0; z-index: 3; height: 22px; }
.ss-grid tbody th { position: sticky; left: 0; z-index: 3; }
.ss-grid th.ss-corner { left: 0; z-index: 5; background: #e9e9e9; cursor: cell; }
.ss-grid th.ss-corner::after { content: ''; position: absolute; right: 2px; bottom: 2px; border: 5px solid transparent; border-right-color: #b5b5b5; border-bottom-color: #b5b5b5; }
.ss-grid th.hl { background: #d2d2d2; color: #107c41; font-weight: 600; border-bottom-color: #107c41; }
.ss-grid tbody th.hl { border-bottom-color: #d4d4d4; border-right: 2px solid #107c41; }
.ss-grid th.flt { color: #1d4ed8; }
.ss-grid th .rz { position: absolute; right: -2px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 2; }
.ss-grid th .rzr { position: absolute; left: 0; right: 0; bottom: -2px; height: 6px; cursor: row-resize; z-index: 2; }
.ss-grid td { border: 1px solid #e1e1e1; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: clip; cursor: cell; line-height: 1.25; background: transparent; }
.ss .nogrid .ss-grid td, .ss.nogrid .ss-grid td { border-color: transparent; }
.ss.noheads .ss-grid thead, .ss.noheads .ss-grid tbody th { visibility: collapse; }
.ss-grid td.err { color: #c00000; }
.ss-grid td.note { position: relative; } .ss-grid td.note::after { content: ''; position: absolute; top: 0; right: 0; border: 4px solid transparent; border-top-color: #e81123; border-right-color: #e81123; }
.ss-grid td.fx { color: #0b3b8c; font-family: Consolas, Menlo, monospace; font-size: 10pt; }
.ss-grid td.fz { position: sticky; z-index: 2; background-color: #fff; }
.ss-grid td.fzb, .ss-grid th.fzb { border-bottom: 2px solid #9a9a9a; } .ss-grid td.fzrt, .ss-grid th.fzrt { border-right: 2px solid #9a9a9a; }
.ss-grid tbody th.fz { z-index: 4; } .ss-grid thead th.fz { z-index: 4; }
.ss-selbox { position: absolute; border: 2px solid #107c41; pointer-events: none; z-index: 2; box-sizing: border-box; margin: -1px 0 0 -1px; }
.ss-selbox.multi { background: rgba(16,124,65,.08); }
.ss-selx div { position: absolute; background: rgba(16,124,65,.12); border: 1px solid #107c41; pointer-events: none; z-index: 2; box-sizing: border-box; }
.ss-selbox.multi::after { content: ''; position: absolute; left: calc(var(--ax) - 1px); top: calc(var(--ay) - 1px); width: var(--aw); height: var(--ah); box-shadow: inset 0 0 0 1px #107c41; background: rgba(255,255,255,.55); }
.ss-fillh { position: absolute; width: 7px; height: 7px; background: #107c41; border: 1px solid #fff; z-index: 3; cursor: crosshair; margin: -1px 0 0 -1px; }
.ss-fillbox { position: absolute; border: 2px dashed #6b6b6b; pointer-events: none; z-index: 2; box-sizing: border-box; }
.ss-copybox { position: absolute; pointer-events: none; z-index: 2; box-sizing: border-box; border: 2px dashed #107c41; animation: ants .6s linear infinite; }
@keyframes ants { 50% { border-color: #9fd6b3; } }
.ss-copybox[hidden], .ss-fillbox[hidden] { display: none; }
.ss-refs .ss-ref { position: absolute; border: 2px solid var(--rc); background: color-mix(in srgb, var(--rc) 10%, transparent); pointer-events: none; z-index: 2; box-sizing: border-box; }
.ss-editor { position: absolute; z-index: 6; border: 2px solid #107c41; outline: none; resize: none; padding: 1px 3px; font-family: Calibri, Carlito, Arial, sans-serif; font-size: 11pt; line-height: 1.25; box-sizing: border-box; overflow: hidden; white-space: pre; box-shadow: 0 2px 8px rgba(0,0,0,.18); margin: -1px 0 0 -1px; border-radius: 0; }
.ss-editor.idle { opacity: 0; pointer-events: none; z-index: -1; border: 0; box-shadow: none; }
.ss-ac, .ss-tip { position: fixed; z-index: 130; background: #fff; border: 1px solid #c8c8c8; border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.18); font-size: 12px; max-width: 460px; }
.ss-ac[hidden], .ss-tip[hidden] { display: none; }
.ss-ac div { padding: 4px 10px; cursor: pointer; display: flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.ss-ac div small { color: #666; overflow: hidden; text-overflow: ellipsis; }
.ss-ac div.on, .ss-ac div:hover { background: #e6f2ea; }
.ss-tip { padding: 5px 10px; line-height: 1.45; } .ss-tip u { font-weight: 700; text-decoration: none; background: #e6f2ea; }
.ss-tip small { color: #555; }
.ss-fbtns .ss-fbtn { position: absolute; z-index: 2; width: 17px; height: 17px; border: 1px solid #b5b5b5; background: #fff; border-radius: 2px; font-size: 10px; line-height: 1; padding: 0; cursor: pointer; color: #333; }
.ss-fbtns .ss-fbtn.on { background: #dbeafe; border-color: #1d4ed8; color: #1d4ed8; }
.ss-chart { position: absolute; z-index: 2; background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 2px 10px rgba(0,0,0,.15); display: flex; flex-direction: column; border-radius: 2px; }
.ss-chart:hover { border-color: #107c41; }
.ss-chart-h { display: flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; cursor: move; font-size: 12px; color: #555; border-bottom: 1px solid #eee; user-select: none; }
.ss-chart-h span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ss-chart-h button { border: 0; background: transparent; cursor: pointer; padding: 1px 6px; border-radius: 3px; }
.ss-chart-h button:hover { background: #eee; }
.ss-chart-b { flex: 1; min-height: 0; padding: 6px; position: relative; }
.ss-chart-rz { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #9a9a9a 50%, #9a9a9a 60%, transparent 60%, transparent 72%, #9a9a9a 72%, #9a9a9a 82%, transparent 82%); }
.ss-tabs { display: flex; align-items: stretch; background: #f3f3f3; border-top: 1px solid #d6d6d6; height: 30px; }
.ss-addsheet { border: 0; background: transparent; font-size: 18px; color: #555; width: 36px; cursor: pointer; }
.ss-addsheet:hover { background: #e5e5e5; }
.ss-sheets { display: flex; overflow-x: auto; }
.ss-tab { border: 0; border-right: 1px solid #ddd; background: transparent; padding: 0 16px; cursor: pointer; font-size: 12.5px; color: #333; white-space: nowrap; }
.ss-tab:hover { background: #e9e9e9; }
.ss-tab.on { background: #fff; color: #107c41; font-weight: 600; box-shadow: inset 0 -3px 0 #107c41; }
.ss-mode { min-width: 70px; }
.ss-flt { padding: 4px; display: flex; flex-direction: column; gap: 4px; width: 300px; }
.ss-flt input:not([type=checkbox]), .ss-flt select { padding: 4px 6px; font-size: 12.5px; }
.ss-flt .row { gap: 4px; flex-wrap: nowrap; }
.ss-flt select { flex: 1; min-width: 0; }
.ss-fall { font-weight: 400; margin: 2px 4px; display: flex; gap: 6px; }
.ss-fvals { max-height: 220px; overflow: auto; border: 1px solid #e5e5e5; border-radius: 4px; padding: 4px 6px; }
.ss-fvals label { display: flex; gap: 6px; font-weight: 400; margin: 2px 0; font-size: 12.5px; }
.ss-fnlist { height: 280px; overflow: auto; border: 1px solid #e5e5e5; border-radius: 6px; margin-top: 10px; }
.ss-fnlist div { padding: 5px 10px; cursor: pointer; } .ss-fnlist div:hover { background: #f3f8f5; } .ss-fnlist div.on { background: #d3eadb; }
.ss-fnlist small { color: #666; }
.ss-fninfo { min-height: 60px; padding: 8px 2px; } .ss-fninfo code { font-size: 13px; background: #eef1f6; padding: 2px 6px; border-radius: 4px; }

/* ===== Trang chọn công cụ ===== */
.tools-home h1 { margin-bottom: 4px; }
.tools-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 18px 0; }
.tool-card { display: flex; gap: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; color: var(--ink); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16,24,40,.12); text-decoration: none; }
.tool-card .big { width: 56px; height: 56px; border-radius: 12px; color: #fff; font-weight: 800; font-size: 28px; display: grid; place-items: center; flex-shrink: 0; }
.tool-card.word .big { background: #185abd; } .tool-card.excel .big { background: #107c41; }
.tool-card h2 { margin: 0 0 4px; } .tool-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; } .tool-card li { margin: 2px 0; }
#topbar .nav-dd { position: relative; }
.tools-menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 6px; min-width: 260px; }
.tools-menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.tools-menu a:hover { background: var(--brand-soft); text-decoration: none; }
.tools-menu .ico { width: 28px; height: 28px; border-radius: 6px; color: #fff; display: grid; place-items: center; font-weight: 800; }
.tools-menu small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 860px) {
  .tl { height: calc(100vh - 56px); font-size: 12px; }
  .tl-panel { min-height: 0; }
  .tl-name { width: 40vw; }
  .tl-title .btn.sm:not(.primary) { display: none; }
  .wp-canvas { padding: 10px 6px 40px; }
  .tl-zoom { width: 70px; }
  .tl-status .ss-agg { display: none; }
}
@media print { .tl { display: none; } }
