/* app.css — Microsoft Word recreation styles */
@font-face { font-family: 'Calibri'; src: local('Calibri'), url('../fonts/carlito-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Calibri'; src: local('Calibri Bold'), url('../fonts/carlito-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Calibri'; src: local('Calibri Italic'), url('../fonts/carlito-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Calibri'; src: local('Calibri Bold Italic'), url('../fonts/carlito-700i.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Calibri Light'; src: local('Calibri Light'), local('Calibri'), url('../fonts/carlito-400.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cambria'; src: local('Cambria'), url('../fonts/caladea-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cambria'; src: local('Cambria Bold'), url('../fonts/caladea-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cambria'; src: local('Cambria Italic'), url('../fonts/caladea-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --word-blue: #185ABD;
  --word-blue-d: #12408C;
  --chrome-bg: #F3F3F3;
  --ribbon-bg: #FFFFFF;
  --tab-active: #FFFFFF;
  --border: #D2D2D2;
  --canvas: #E9EBEE;
  --sel: rgba(23, 98, 175, 0.28);
  --hover: rgba(0,0,0,0.055);
  --pressed: rgba(0,0,0,0.11);
  --ink: #252423;
  --sub: #605E5C;
  --ui-font: 'Segoe UI', -apple-system, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: var(--ui-font); font-size: 12px; color: var(--ink); background: var(--chrome-bg); user-select: none; -webkit-user-select: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; user-select: text; -webkit-user-select: text; }
.ic { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }
.ic svg { width: 100%; height: 100%; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 26px; height: 26px; }

/* ============ title bar ============ */
#titlebar { height: 48px; background: var(--word-blue); display: flex; align-items: center; color: #fff; position: relative; z-index: 60; }
#titlebar .tb-left { display: flex; align-items: center; gap: 2px; padding-left: 6px; }
#titlebar .tb-logo { width: 28px; height: 28px; margin: 0 4px; display: flex; align-items: center; }
#titlebar .tb-logo svg { width: 26px; height: 26px; }
#titlebar .qat { display: flex; align-items: center; gap: 1px; margin-left: 4px; }
#titlebar .qat button { background: none; border: none; color: #fff; width: 28px; height: 28px; border-radius: 3px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
#titlebar .qat button:hover { background: rgba(255,255,255,0.18); }
#titlebar .qat button:active { background: rgba(255,255,255,0.3); }
#titlebar .qat button:disabled { opacity: 0.45; }
#titlebar .qat .ic { width: 16px; height: 16px; }
#titlebar .qat-sep { width: 1px; height: 20px; background: rgba(255,255,255,0.35); margin: 0 4px; }
#titlebar .tb-doc { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; min-width: 0; }
#titlebar .tb-doc .dname { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
#titlebar .tb-doc .dsaved { font-size: 11px; opacity: 0.85; white-space: nowrap; }
#titlebar .tb-search { position: absolute; left: 50%; transform: translateX(-50%); top: -19px; }
.tb-right { margin-left: auto; display: flex; align-items: center; height: 100%; }
.tb-right .wctl { width: 46px; height: 100%; border: none; background: none; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tb-right .wctl:hover { background: rgba(255,255,255,0.16); }
.tb-right .wctl.close:hover { background: #E81123; }
.tb-right .wctl .ic { width: 14px; height: 14px; }
.tb-user { width: 30px; height: 30px; border-radius: 50%; background: #0E3B8C; color: #fff; font-size: 11px; display: flex; align-items: center; justify-content: center; margin: 0 8px; font-weight: 600; }

/* search pill under title (Word's search is in title bar center on M365) */
#tbsearch { position: absolute; left: 50%; transform: translateX(-50%); top: 6px; width: 360px; display: flex; align-items: center; background: rgba(255,255,255,0.2); border-radius: 4px; height: 26px; padding: 0 8px; gap: 6px; cursor: text; }
#tbsearch:hover { background: rgba(255,255,255,0.28); }
#tbsearch input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 12px; }
#tbsearch input::placeholder { color: rgba(255,255,255,0.75); }
#tbsearch .ic { width: 14px; height: 14px; color: #fff; }
#titlebar .tb-doc { top: 26px; }

/* ============ ribbon ============ */
#ribbonWrap { background: var(--chrome-bg); position: relative; z-index: 50; }
#tabs { display: flex; align-items: center; height: 33px; padding: 0 8px; gap: 0; position: relative; }
#tabs .tab { border: none; background: none; font-size: 12px; padding: 8px 13px 7px; cursor: pointer; color: var(--ink); position: relative; font-weight: 400; border-radius: 4px 4px 0 0; }
#tabs .tab:hover { background: rgba(0,0,0,0.045); }
#tabs .tab.active { background: var(--ribbon-bg); font-weight: 600; color: var(--ink); box-shadow: inset 0 2px 0 var(--word-blue); }
#tabs .tab.file { color: var(--word-blue); font-weight: 600; }
#tabs .tab.ctx { color: #2B7A2B; font-weight: 600; }
#tabs .tab.ctx2 { color: #A64F00; font-weight: 600; }
#tabs .ctx-label { font-size: 11px; color: var(--sub); padding: 0 6px 0 12px; font-style: italic; }
#tabs .rb-collapse { margin-left: auto; width: 26px; height: 24px; border: none; background: none; cursor: pointer; border-radius: 3px; display: flex; align-items: center; justify-content: center; color: var(--sub); }
#tabs .rb-collapse:hover { background: var(--hover); }
#ribbon { background: var(--ribbon-bg); height: 92px; border-bottom: 1px solid var(--border); display: flex; padding: 4px 6px 0; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
#ribbon.collapsed { height: 0; border-bottom: none; overflow: hidden; }
.rgroup { display: flex; flex-direction: column; border-right: 1px solid #E3E3E3; padding: 0 3px; position: relative; }
.rgroup:last-child { border-right: none; }
.rgroup .gbody { flex: 1; display: flex; align-items: stretch; gap: 1px; padding-bottom: 2px; }
.rgroup .gname { font-size: 11px; color: var(--sub); text-align: center; padding: 2px 4px 1px; height: 16px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.rgroup .gname .launcher { border: none; background: none; cursor: pointer; color: var(--sub); width: 14px; height: 14px; display: inline-flex; padding: 0; }
.rgroup .gname .launcher:hover { color: var(--word-blue); }
.rgroup .gname .launcher .ic { width: 11px; height: 11px; }
.rcol { display: flex; flex-direction: column; justify-content: flex-start; gap: 0; }
.rrow { display: flex; align-items: center; gap: 1px; }

/* ribbon buttons */
.rbtn { border: none; background: none; cursor: pointer; border-radius: 3px; color: var(--ink); position: relative; display: flex; align-items: center; }
.rbtn:hover { background: var(--hover); }
.rbtn:active, .rbtn.on { background: var(--pressed); }
.rbtn.on { box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.rbtn:disabled { opacity: 0.42; cursor: default; }
.rbtn:disabled:hover { background: none; }
.rbtn.big { flex-direction: column; width: 46px; padding: 4px 2px 2px; height: 74px; justify-content: flex-start; gap: 3px; }
.rbtn.big .ic { width: 28px; height: 28px; }
.rbtn.big .lbl { font-size: 11px; line-height: 1.05; text-align: center; max-width: 46px; overflow: hidden; }
.rbtn.big .sub-arrow { font-size: 8px; margin-top: -2px; }
.rbtn.mid { flex-direction: column; width: 38px; height: 74px; padding: 4px 1px 2px; justify-content: flex-start; gap: 2px; }
.rbtn.mid .ic { width: 22px; height: 22px; }
.rbtn.mid .lbl { font-size: 10.5px; line-height: 1.0; text-align: center; }
.rbtn.small { height: 21px; padding: 0 5px 0 3px; gap: 4px; font-size: 11.5px; }
.rbtn.small .ic { width: 16px; height: 16px; flex: none; }
.rbtn.small .lbl { white-space: nowrap; }
.rbtn .caret-arrow { margin-left: 2px; font-size: 8px; color: var(--sub); display: inline-flex; }
.rbtn .caret-arrow .ic { width: 9px; height: 9px; }
.rbtn.split { padding-right: 2px; }
.rbtn .split-sep { width: 1px; align-self: stretch; }
.rbtn .split-main { display: flex; align-items: center; gap: 4px; }
.rbtn .split-arrow { display: flex; align-items: center; padding: 0 2px; align-self: stretch; border-radius: 0 3px 3px 0; }
.rbtn.small.split { padding-right: 0; }
.rbtn.small.split:hover { background: none; }
.rbtn.small.split .split-main { padding: 0 2px 0 3px; border-radius: 3px 0 0 3px; align-self: stretch; align-items: center; display: flex; gap: 4px; }
.rbtn.small.split .split-main:hover { background: var(--hover); }
.rbtn.small.split .split-arrow:hover { background: var(--hover); }

/* combos in ribbon (font name/size) */
.rcombo { display: flex; align-items: center; height: 21px; border: 1px solid transparent; border-radius: 3px; font-size: 11.5px; position: relative; }
.rcombo:hover { border-color: #C8C8C8; background: #fff; }
.rcombo.open { border-color: #A0A0A0; background: #fff; }
.rcombo input { border: none; outline: none; background: none; font-size: 11.5px; height: 19px; padding: 0 2px 0 5px; color: var(--ink); }
.rcombo input::selection { background: #BDD7F0; }
.rcombo .carrow { width: 16px; height: 19px; display: flex; align-items: center; justify-content: center; border-radius: 0 3px 3px 0; cursor: pointer; }
.rcombo .carrow:hover { background: var(--hover); }
.rcombo .carrow .ic { width: 9px; height: 9px; }
#rcFont input { width: 118px; }
#rcSize input { width: 38px; }

/* styles gallery (in-ribbon row) */
.stylestrip { display: flex; align-items: center; gap: 2px; height: 74px; }
.stylestrip .st-view { display: flex; gap: 2px; overflow: hidden; max-width: 480px; padding: 1px; }
.stylechip { min-width: 62px; max-width: 92px; height: 68px; border: 1px solid #D8D8D8; background: #fff; border-radius: 2px; cursor: pointer; padding: 4px 6px; overflow: hidden; position: relative; text-align: left; }
.stylechip:hover { border-color: #0078D4; box-shadow: 0 0 0 1px #0078D4; }
.stylechip.cur { border-color: #0078D4; box-shadow: inset 0 0 0 1px #0078D4; }
.stylechip .st-t { font-size: 15px; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.stylechip .st-p { font-size: 10px; color: #777; white-space: nowrap; overflow: hidden; margin-top: 3px; }
.st-arrows { display: flex; flex-direction: column; width: 15px; }
.st-arrows button { border: none; background: none; height: 22px; cursor: pointer; font-size: 8px; color: #555; border-radius: 2px; }
.st-arrows button:hover { background: var(--hover); }

/* ============ dropdowns / menus ============ */
.dropdown { position: absolute; background: #fff; border: 1px solid #C6C6C6; box-shadow: 0 4px 14px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.03); border-radius: 3px; padding: 4px; z-index: 500; animation: dpop 0.11s ease-out; min-width: 120px; }
@keyframes dpop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; } }
.dropdown .mi { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 7px; font-size: 12px; border-radius: 2px; cursor: pointer; white-space: nowrap; color: var(--ink); }
.dropdown .mi:hover { background: #E8F1FB; }
.dropdown .mi.sel { background: #D5E6F7; }
.dropdown .mi.dis { opacity: 0.4; pointer-events: none; }
.dropdown .mi .ic { width: 16px; height: 16px; flex: none; }
.dropdown .mi .chk { width: 16px; text-align: center; }
.dropdown .mi .accel { margin-left: auto; color: #888; font-size: 11px; padding-left: 20px; }
.dropdown .mi .sub { margin-left: auto; }
.dropdown .msep { height: 1px; background: #E1E1E1; margin: 3px 6px; }
.dropdown .mhead { font-size: 10.5px; color: #777; padding: 4px 8px 2px; font-weight: 600; }
.dropdown .grid { display: grid; gap: 1px; padding: 4px; }
.swatch { width: 16px; height: 16px; border: 1px solid rgba(0,0,0,0.18); cursor: pointer; border-radius: 1px; }
.swatch:hover { outline: 1.5px solid #0078D4; outline-offset: 1px; }
.swatch.big { width: 20px; height: 20px; }
.colorgrid { display: grid; grid-template-columns: repeat(10, 20px); gap: 2px; padding: 4px 6px; }
.colorgrid .swatch { width: 20px; height: 20px; }
.dd-sec { font-size: 11px; color: #444; font-weight: 600; padding: 5px 8px 3px; border-top: 1px solid #eee; }
.dd-sec:first-child { border-top: none; }

/* font gallery */
.fontlist { max-height: 340px; overflow-y: auto; min-width: 230px; }
.fontlist .fi { padding: 4px 10px; cursor: pointer; font-size: 14px; white-space: nowrap; display: flex; align-items: baseline; gap: 8px; }
.fontlist .fi:hover { background: #E8F1FB; }
.fontlist .fi .fn-tag { font-size: 9px; color: #999; margin-left: auto; }
.fontlist .fi.cur { background: #D5E6F7; }
.sizelist { max-height: 300px; overflow-y: auto; min-width: 70px; }
.sizelist .si { padding: 3px 12px; cursor: pointer; }
.sizelist .si:hover { background: #E8F1FB; }
.sizelist .si.cur { background: #D5E6F7; }

/* styles dropdown panel */
.stylespanel { width: 300px; padding: 6px; }
.stylespanel .sp-grid { display: flex; flex-wrap: wrap; gap: 3px; max-height: 300px; overflow-y: auto; }
.stylespanel .stylechip { width: 88px; }

/* table grid picker */
.tpicker { padding: 8px; }
.tpicker .tg { display: grid; gap: 2px; }
.tpicker .tc { width: 16px; height: 16px; border: 1px solid #B9B9B9; background: #fff; }
.tpicker .tc.on { background: #8AB4E8; border-color: #0078D4; }
.tpicker .tlab { text-align: center; font-size: 11px; color: #444; margin-top: 6px; }

/* tooltip */
#wtip { position: fixed; z-index: 900; background: #fff; border: 1px solid #B9B9B9; box-shadow: 0 3px 10px rgba(0,0,0,0.16); padding: 8px 10px; max-width: 280px; border-radius: 2px; pointer-events: none; font-size: 12px; }
#wtip .t-t { font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; }
#wtip .t-d { color: #444; margin-top: 4px; line-height: 1.35; }
#wtip .t-k { color: #777; margin-top: 4px; font-size: 11px; }
#wtip .t-f1 { color: #999; margin-top: 6px; font-size: 10.5px; border-top: 1px solid #eee; padding-top: 4px; }

/* ============ editor surface ============ */
#workarea { position: relative; flex: 1; overflow: hidden; display: flex; }
#ruler-v { width: 0; }
.ed-root { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; outline: none; }
.ed-scroll { flex: 1; overflow: auto; background: var(--canvas); position: relative; overscroll-behavior: contain; }
.ed-scroll::-webkit-scrollbar { width: 14px; height: 14px; }
.ed-scroll::-webkit-scrollbar-thumb { background: #BFBFBF; border: 3px solid var(--canvas); border-radius: 8px; min-height: 40px; }
.ed-scroll::-webkit-scrollbar-thumb:hover { background: #A6A6A6; }
.ed-scroll::-webkit-scrollbar-track { background: transparent; }
.ed-scroll::-webkit-scrollbar-corner { background: var(--canvas); }
.ed-canvas { position: relative; min-height: 100%; padding: 0 0 60px; }
.ed-pages { position: relative; width: max-content; margin: 0 auto; }
.ed-page { position: relative; background: #fff; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,0.28), 0 0 0 0.5px rgba(0,0,0,0.06); }
.ed-page:first-child { margin-top: 0; }
.ed-page + .ed-page { margin-top: 28px; }
.ed-page.web { box-shadow: none; }
.ed-pgbody { position: absolute; overflow: hidden; }
.ed-ln { position: absolute; white-space: pre; }
.ed-r { position: absolute; white-space: pre; }
.ed-tab { position: absolute; top: 0; height: 100%; }
.ed-tab.dots::after { content: ''; position: absolute; left: 2px; right: 2px; bottom: 24%; border-bottom: 1.5px dotted #666; }
.ed-num { position: absolute; left: 0; white-space: pre; color: inherit; }
.ed-fld { background: rgba(0,0,0,0.06); }
.ed-fnref { position: absolute; font-size: 65%; vertical-align: super; }
.ed-img { display: block; }
.ed-img-run { position: absolute; }
.ed-pgheader, .ed-pgfooter { position: absolute; z-index: 2; }
.ed-pgheader.active, .ed-pgfooter.active { outline: none; }
.ed-page.hdr-editing .ed-pgbody { opacity: 0.45; }
.ed-watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; overflow: hidden; }
.ed-watermark { font-family: 'Calibri Light', Calibri, sans-serif; font-size: 110px; color: rgba(190,190,190,0.35); transform: rotate(-38deg); font-weight: 600; letter-spacing: 4px; white-space: nowrap; }
.ed-pdeco { position: absolute; pointer-events: none; z-index: -1; }
.ed-trow { position: absolute; }
.ed-tcell { position: absolute; overflow: hidden; }
.ed-tcell .ed-tcell-in { position: absolute; }
.ed-tcell.grid { }
.ed-footnotes { position: absolute; }
.ed-fn-sep { width: 30%; border-top: 0.75px solid #666; margin-bottom: 6px; }
.ed-linenum-layer { position: absolute; left: 0; top: 0; }
.ed-linenum-layer .lnn { position: absolute; font-size: 10px; color: #999; right: 100%; margin-right: 12px; font-family: var(--ui-font); }

/* selection/caret/highlight layers */
.ed-sel, .ed-hl { position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; z-index: 5; }
.ed-hl { z-index: 4; }
.ed-sel-rect { position: absolute; background: var(--sel); }
.ed-hl-rect { position: absolute; background: rgba(255, 213, 0, 0.5); }
.ed-hl-rect.cur { background: rgba(255, 140, 0, 0.65); }
.ed-cmt-rect { position: absolute; background: rgba(255, 122, 89, 0.18); border-bottom: 1.5px solid #E8865B; }
.ed-squig { position: absolute; height: 3px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='3'%3E%3Cpath d='M0 2.5 Q1.5 0.5 3 2.5 T6 2.5' fill='none' stroke='%23E81123' stroke-width='0.9'/%3E%3C/svg%3E"); background-repeat: repeat-x; background-size: 6px 3px; }
.ed-caret { position: absolute; width: 1.6px; background: #1a1a1a; z-index: 6; pointer-events: none; }
.ed-caret.blink-restart { animation: caretblink 1.06s step-end infinite; }
@keyframes caretblink { 0%, 54% { opacity: 1; } 55%, 100% { opacity: 0; } }
.ed-input { position: absolute; width: 30px; height: 20px; opacity: 0.01; border: none; outline: none; resize: none; padding: 0; z-index: -1; caret-color: transparent; }
.ed-ink { position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; }
.ed-canvas.dragging { cursor: default; }

/* image selection handles */
.img-sel { position: absolute; border: 1.5px solid #0078D4; z-index: 8; pointer-events: none; }
.img-sel .h { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid #0078D4; border-radius: 50%; pointer-events: auto; }
.img-sel .h.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.img-sel .h.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.img-sel .h.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.img-sel .h.se { right: -6px; bottom: -6px; cursor: nwse-resize; }

/* ============ ruler ============ */
#ruler-h { height: 26px; background: var(--chrome-bg); border-bottom: 1px solid #D8D8D8; position: relative; overflow: hidden; z-index: 40; flex: none; }
#ruler-h .r-inner { position: absolute; top: 0; height: 100%; }
#ruler-h .tick { position: absolute; top: 14px; width: 1px; height: 6px; background: #888; }
#ruler-h .tick.big { top: 8px; height: 12px; }
#ruler-h .tnum { position: absolute; top: 4px; font-size: 8.5px; color: #777; transform: translateX(-50%); }
#ruler-h .marginzone { position: absolute; top: 0; bottom: 0; background: #DDDDDF; }
#ruler-h .marginzone.first { border-right: 1px solid #fff; }
#ruler-h .rmarker { position: absolute; cursor: ew-resize; z-index: 3; }
#ruler-h .rmarker .tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; position: absolute; left: -5px; }
#ruler-h .rmarker.firstline .tri { top: 4px; border-top: 6px solid #6E6E6E; }
#ruler-h .rmarker.hang .tri { bottom: 3px; border-bottom: 6px solid #6E6E6E; }
#ruler-h .rmarker.leftind .sq { position: absolute; bottom: 2px; left: -5px; width: 10px; height: 5px; background: #6E6E6E; border-radius: 1px; }
#ruler-h .rmarker.rightind .tri { bottom: 3px; border-bottom: 6px solid #6E6E6E; }
#ruler-h .rmarker:hover .tri, #ruler-h .rmarker:hover .sq { filter: brightness(0.6); }
#ruler-v { position: absolute; left: 0; top: 0; width: 26px; bottom: 0; background: var(--chrome-bg); border-right: 1px solid #D8D8D8; z-index: 39; display: none; }

/* ============ status bar ============ */
#statusbar { height: 24px; background: var(--word-blue); color: #fff; display: flex; align-items: center; font-size: 11.5px; padding: 0 8px; gap: 2px; z-index: 55; position: relative; }
#statusbar .st { padding: 0 8px; height: 100%; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
#statusbar .st.clickable { cursor: pointer; }
#statusbar .st.clickable:hover { background: rgba(255,255,255,0.16); }
#statusbar .spacer { flex: 1; }
#statusbar .viewbtns { display: flex; align-items: center; gap: 1px; }
#statusbar .viewbtns button { background: none; border: none; color: rgba(255,255,255,0.8); width: 30px; height: 22px; border-radius: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#statusbar .viewbtns button:hover { background: rgba(255,255,255,0.16); }
#statusbar .viewbtns button.on { background: rgba(255,255,255,0.28); color: #fff; }
#statusbar .viewbtns .ic { width: 16px; height: 16px; }
#zoomwrap { display: flex; align-items: center; gap: 6px; }
#zoomwrap button { background: none; border: none; color: #fff; width: 20px; height: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; border-radius: 2px; }
#zoomwrap button:hover { background: rgba(255,255,255,0.18); }
#zoomwrap input[type=range] { -webkit-appearance: none; width: 110px; height: 3px; background: rgba(255,255,255,0.5); border-radius: 2px; outline: none; }
#zoomwrap input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #fff; cursor: pointer; }
#zoomwrap .zlab { min-width: 36px; text-align: right; cursor: pointer; }
#zoomwrap .zlab:hover { text-decoration: underline; }

/* ============ backstage ============ */
#backstage { position: absolute; inset: 0; background: #fff; z-index: 200; display: none; }
#backstage.open { display: flex; }
#backstage .bs-nav { width: 210px; background: var(--word-blue); color: #fff; padding-top: 12px; display: flex; flex-direction: column; }
#backstage .bs-nav .bs-back { width: 40px; height: 40px; border: none; background: none; color: #fff; font-size: 18px; cursor: pointer; border-radius: 50%; margin: 0 0 8px 14px; }
#backstage .bs-nav .bs-back:hover { background: rgba(255,255,255,0.15); }
#backstage .bs-item { border: none; background: none; color: #fff; text-align: left; padding: 10px 20px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
#backstage .bs-item:hover { background: rgba(255,255,255,0.13); }
#backstage .bs-item.on { background: rgba(255,255,255,0.22); font-weight: 600; }
#backstage .bs-item .ic { width: 17px; height: 17px; }
#backstage .bs-spacer { flex: 1; }
#backstage .bs-body { flex: 1; overflow: auto; padding: 26px 34px; background: #fff; }
#backstage h1 { font-size: 20px; font-weight: 600; margin-bottom: 18px; color: #252423; }
#backstage h2 { font-size: 13px; font-weight: 600; margin: 20px 0 10px; color: #444; }
.tpl-grid { display: flex; gap: 16px; flex-wrap: wrap; }
.tpl-card { width: 160px; cursor: pointer; }
.tpl-card .tpl-thumb { width: 160px; height: 200px; border: 1px solid #D8D8D8; background: #fff; padding: 14px; overflow: hidden; transition: box-shadow 0.12s; }
.tpl-card:hover .tpl-thumb { border-color: #0078D4; box-shadow: 0 2px 10px rgba(0,120,212,0.25); }
.tpl-card .tpl-name { font-size: 12px; margin-top: 6px; color: #333; }
.tpl-thumb .tt { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.tpl-thumb .tl { height: 4px; background: #E3E3E3; margin-bottom: 5px; border-radius: 2px; }
.tpl-thumb .tl.b { background: #B4C6E7; }
.tpl-thumb .blank-ic { display: flex; align-items: center; justify-content: center; height: 100%; }
.doclist .drow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 3px; cursor: pointer; }
.doclist .drow:hover { background: #F0F6FD; }
.doclist .drow .dic { width: 30px; height: 36px; border: 1px solid #2B579A; background: #fff; color: #2B579A; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border-radius: 2px; flex: none; }
.doclist .drow .dn { font-size: 13px; color: #1a1a1a; }
.doclist .drow .dm { font-size: 11px; color: #777; margin-top: 1px; }
.info-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; max-width: 900px; }
.prop-table { width: 100%; font-size: 12.5px; }
.prop-table .pr { display: flex; padding: 5px 0; border-bottom: 1px solid #F0F0F0; }
.prop-table .pr .pk { width: 190px; color: #555; }
.prop-table .pr .pv { flex: 1; color: #222; }
.bs-actions { display: flex; flex-direction: column; gap: 8px; }
.bs-btn { display: flex; align-items: center; gap: 10px; border: 1px solid #D1D1D1; background: #fff; padding: 10px 14px; font-size: 12.5px; border-radius: 3px; cursor: pointer; text-align: left; }
.bs-btn:hover { background: #F3F8FD; border-color: #0078D4; }
.bs-btn .ic { width: 18px; height: 18px; color: #555; }
.bs-btn .bd { font-size: 10.5px; color: #777; }
.print-layout { display: flex; gap: 30px; height: 100%; }
.print-settings { width: 300px; flex: none; }
.print-settings .pbtn { width: 100%; background: var(--word-blue); color: #fff; border: none; padding: 10px; font-size: 14px; border-radius: 3px; cursor: pointer; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.print-settings .pbtn:hover { background: #0F4CBD; }
.print-settings .prow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 12.5px; }
.print-settings select, .print-settings input[type=number] { border: 1px solid #C8C8C8; padding: 4px 6px; font-size: 12px; border-radius: 2px; width: 160px; }
.print-preview { flex: 1; background: #E9EBEE; border: 1px solid #ddd; overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.print-preview .p-page { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.3); flex: none; position: relative; overflow: hidden; }
.saveas-list { display: flex; flex-direction: column; gap: 8px; max-width: 460px; }
.saveas-list .bs-btn { padding: 12px 16px; }
.saveas-list .bs-btn .bt { font-size: 13.5px; font-weight: 600; }

/* ============ dialog ============ */
#dlgwrap { position: fixed; inset: 0; z-index: 700; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.14); }
#dlgwrap.open { display: flex; }
.dlg { background: #fff; border: 1px solid #ABABAB; box-shadow: 0 8px 30px rgba(0,0,0,0.28); min-width: 380px; max-width: 560px; border-radius: 2px; animation: dpop 0.12s ease-out; }
.dlg .d-title { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #E8E8E8; font-size: 13px; font-weight: 600; }
.dlg .d-title .dx { border: none; background: none; cursor: pointer; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 2px; color: #666; }
.dlg .d-title .dx:hover { background: #E81123; color: #fff; }
.dlg .d-tabs { display: flex; border-bottom: 1px solid #E8E8E8; padding: 0 12px; }
.dlg .d-tabs .dt { border: none; background: none; padding: 8px 14px; font-size: 12px; cursor: pointer; border-bottom: 2px solid transparent; }
.dlg .d-tabs .dt.on { border-bottom-color: var(--word-blue); font-weight: 600; }
.dlg .d-body { padding: 14px; font-size: 12.5px; max-height: 60vh; overflow: auto; }
.dlg .d-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dlg .d-row label { width: 110px; color: #444; flex: none; }
.dlg .d-row input[type=text], .dlg .d-row input[type=number], .dlg .d-row select { flex: 1; border: 1px solid #BFBFBF; padding: 5px 7px; font-size: 12.5px; border-radius: 2px; min-width: 0; }
.dlg .d-row input:focus, .dlg .d-row select:focus { border-color: #0078D4; outline: none; box-shadow: 0 0 0 1px #0078D4; }
.dlg .d-sect { border: 1px solid #E0E0E0; border-radius: 2px; padding: 10px 12px; margin-bottom: 12px; position: relative; }
.dlg .d-sect .ds-t { position: absolute; top: -8px; left: 8px; background: #fff; padding: 0 5px; font-size: 11.5px; color: #333; font-weight: 600; }
.dlg .d-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid #E8E8E8; }
.dlg .d-foot button { padding: 6px 20px; font-size: 12.5px; border-radius: 2px; cursor: pointer; border: 1px solid #ADADAD; background: #fff; }
.dlg .d-foot button.primary { background: var(--word-blue); border-color: var(--word-blue); color: #fff; }
.dlg .d-foot button.primary:hover { background: #0F4CBD; }
.dlg .d-foot button:hover:not(.primary) { background: #F0F0F0; }
.dlg .chk { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.dlg .chk input { accent-color: var(--word-blue); }
.symgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; max-height: 260px; overflow: auto; }
.symgrid .sym { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer; border: 1px solid transparent; font-family: 'Segoe UI Symbol', 'Cambria Math', serif; }
.symgrid .sym:hover { background: #E8F1FB; border-color: #0078D4; }

/* ============ find pane ============ */
#findpane { width: 260px; background: #F5F5F5; border-right: 1px solid #DADADA; display: none; flex-direction: column; flex: none; z-index: 30; }
#findpane.open { display: flex; }
#findpane .fp-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; }
#findpane .fp-head .fp-t { font-size: 13px; font-weight: 600; }
#findpane .fp-head button { border: none; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 2px; color: #666; }
#findpane .fp-head button:hover { background: #ddd; }
#findpane .fp-tabs { display: flex; padding: 0 10px; gap: 0; border-bottom: 1px solid #E0E0E0; }
#findpane .fp-tabs button { border: none; background: none; padding: 6px 10px; font-size: 11.5px; cursor: pointer; border-bottom: 2px solid transparent; color: #555; }
#findpane .fp-tabs button.on { border-bottom-color: var(--word-blue); font-weight: 600; color: #222; }
#findpane .fp-search { padding: 10px; }
#findpane .fp-box { display: flex; align-items: center; background: #fff; border: 1px solid #C8C8C8; border-radius: 3px; padding: 0 4px; }
#findpane .fp-box:focus-within { border-color: #0078D4; }
#findpane .fp-box input { flex: 1; border: none; outline: none; padding: 6px; font-size: 12.5px; background: none; min-width: 0; }
#findpane .fp-box button { border: none; background: none; cursor: pointer; width: 24px; height: 24px; color: #555; display: flex; align-items: center; justify-content: center; border-radius: 2px; }
#findpane .fp-box button:hover { background: #eee; }
#findpane .fp-count { font-size: 11px; color: #666; padding: 6px 10px 0; }
#findpane .fp-results { flex: 1; overflow: auto; padding: 6px 4px; }
#findpane .fp-res { padding: 6px 10px; font-size: 12px; border-radius: 3px; cursor: pointer; line-height: 1.35; }
#findpane .fp-res:hover { background: #E9E9E9; }
#findpane .fp-res.cur { background: #DBE9F8; }
#findpane .fp-res b { background: #FFE377; font-weight: 700; }
#findpane .fp-res.cur b { background: #FFC02E; }
#findpane .fp-opts { padding: 0 10px 8px; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; }
#findpane .fp-opts .chk { display: flex; gap: 6px; align-items: center; }

/* ============ mini toolbar / context menu ============ */
#minibar { position: fixed; z-index: 600; background: #fff; border: 1px solid #C9C9C9; box-shadow: 0 2px 8px rgba(0,0,0,0.16); border-radius: 3px; display: flex; align-items: center; padding: 2px; opacity: 0; transition: opacity 0.16s; pointer-events: none; }
#minibar.show { opacity: 1; pointer-events: auto; }
#minibar button { border: none; background: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 2px; color: #333; }
#minibar button:hover { background: var(--hover); }
#minibar button.on { background: var(--pressed); }
#minibar .mb-sep { width: 1px; height: 18px; background: #E0E0E0; margin: 0 2px; }
#minibar select { border: none; font-size: 11px; background: none; outline: none; max-width: 74px; }
#ctxmenu { position: fixed; z-index: 800; background: #fff; border: 1px solid #C6C6C6; box-shadow: 0 4px 14px rgba(0,0,0,0.2); border-radius: 3px; padding: 3px; min-width: 190px; animation: dpop 0.1s ease-out; }
#ctxmenu .mi { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 12px; border-radius: 2px; cursor: pointer; color: var(--ink); }
#ctxmenu .mi:hover { background: #E8F1FB; }
#ctxmenu .mi.dis { opacity: 0.42; pointer-events: none; }
#ctxmenu .mi .ic { width: 15px; height: 15px; }
#ctxmenu .mi .accel { margin-left: auto; color: #999; font-size: 10.5px; padding-left: 24px; }
#ctxmenu .msep { height: 1px; background: #E5E5E5; margin: 3px 5px; }
#ctxmenu .mhead { font-size: 10px; color: #888; padding: 4px 10px 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
#ctxmenu .sub-arrow { margin-left: auto; font-size: 9px; color: #888; }

/* comments pane */
#cmtpane { width: 250px; background: #fff; border-left: 1px solid #DDD; display: none; flex-direction: column; flex: none; }
#cmtpane.open { display: flex; }
#cmtpane .cp-h { font-size: 13px; font-weight: 600; padding: 12px 14px 8px; border-bottom: 1px solid #EEE; }
#cmtpane .cp-list { flex: 1; overflow: auto; padding: 8px; }
#cmtpane .cp-card { border: 1px solid #E2D4CE; border-left: 3px solid #E8865B; border-radius: 3px; padding: 8px 10px; margin-bottom: 8px; font-size: 12px; }
#cmtpane .cp-card .ca { font-weight: 600; font-size: 11.5px; }
#cmtpane .cp-card .cd { color: #999; font-size: 10px; margin-left: 6px; }
#cmtpane .cp-card .ct { margin-top: 4px; line-height: 1.4; user-select: text; }
#cmtpane .cp-card .cx { float: right; border: none; background: none; color: #999; cursor: pointer; font-size: 11px; }

/* nav pane (navigation) */
#navpane { width: 240px; background: #F5F5F5; border-right: 1px solid #DADADA; display: none; flex-direction: column; flex: none; }
#navpane.open { display: flex; }
#navpane .np-h { padding: 10px 12px; font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
#navpane .np-h button { border: none; background: none; cursor: pointer; width: 22px; height: 22px; border-radius: 2px; color: #666; }
#navpane .np-h button:hover { background: #ddd; }
#navpane .np-list { flex: 1; overflow: auto; padding: 4px; }
#navpane .np-item { padding: 5px 10px; font-size: 12.5px; cursor: pointer; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#navpane .np-item:hover { background: #E9E9E9; }
#navpane .np-item.h1 { font-weight: 600; }
#navpane .np-item.h2 { padding-left: 24px; }
#navpane .np-item.h3 { padding-left: 40px; color: #555; }

/* toast */
#toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: #323130; color: #fff; padding: 9px 18px; border-radius: 4px; font-size: 12.5px; z-index: 950; opacity: 0; transition: opacity 0.2s; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
#toast.show { opacity: 1; }

/* read mode */
.ed-root.readmode .ed-pages { display: flex; gap: 30px; width: max-content; }
.ed-root.readmode .ed-page + .ed-page { margin-top: 0; }
#readbar { display: none; height: 40px; background: #FBFBFB; border-bottom: 1px solid #E2E2E2; align-items: center; padding: 0 14px; gap: 10px; z-index: 45; }
#readbar.open { display: flex; }
#readbar .rb-t { font-size: 13px; font-weight: 600; margin-right: auto; }
#readbar button { border: 1px solid #C8C8C8; background: #fff; border-radius: 3px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
#readbar button:hover { background: #F0F0F0; }

/* hidden utility */
[hidden] { display: none !important; }

/* focus rings */
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 1.6px solid #0078D4; outline-offset: 1px; }
#tabs .tab:focus-visible { outline-offset: -1px; }

@media print {
  body > * { display: none !important; }
  #printzone { display: block !important; }
}
#printzone { display: none; }

/* ============ app-shell additions ============ */
#workarea .doccol { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.ed-host { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ed-zoomwrap { position: relative; }
.ed-scroll.sidescroll .ed-pages { display: flex; gap: 28px; width: max-content; padding: 28px 24px; margin: 0; }
.ed-scroll.sidescroll .ed-page { margin: 0; }
.ed-page.nows { box-shadow: none; border-top: 1px solid #D8D8D8; border-bottom: 1px solid #D8D8D8; }
.ed-page.nows + .ed-page { margin-top: 0; }
.ed-link { color: #0563C1; text-decoration: underline; cursor: pointer; }
.ed-tcell.grid { outline: 1px dashed #BFBFBF; outline-offset: -0.5px; }
.ed-canvas.drawing { cursor: crosshair; }
.ed-canvas.drawing .ed-input { pointer-events: none; }

/* read mode */
body.reading #ribbonWrap { display: none; }
body.reading #ruler-h { display: none !important; }
body.reading #titlebar { height: 32px; }
body.reading #titlebar .tb-doc { top: 4px; }

/* print zone */
#printzone { background: #fff; }
.pz-page { position: relative; background: #fff; margin: 0 auto 18px; overflow: hidden; }
@media print { .pz-page { margin: 0; box-shadow: none; page-break-after: always; } }

/* ribbon spin controls */
.rspin { display: flex; flex-direction: column; font-size: 10.5px; color: #444; gap: 1px; }
.rspin .rlab { white-space: nowrap; }
.rspin input { width: 52px; border: 1px solid #BFBFBF; border-radius: 2px; padding: 2px 4px; font-size: 11px; }
.rspin input:focus { border-color: #0078D4; outline: none; }
.rspin { position: relative; }
.rspin .rarrows { position: absolute; right: 2px; top: 14px; display: flex; flex-direction: column; }
.rspin .rarrows button { border: none; background: none; font-size: 6px; line-height: 1; padding: 1px 2px; cursor: pointer; color: #666; }
.rspin .rarrows button:hover { color: #0078D4; }

/* minibar extras */
#minibar .mbcombo { height: 24px; }
#minibar .mbcombo.sm { max-width: 46px; }
#ctxmenu .mi .mii { width: 15px; flex: none; }

/* comments */
#cmtpane .cp-card .cq { font-size: 10.5px; color: #9B5513; background: #FDF2EC; border-radius: 2px; padding: 2px 5px; margin-bottom: 5px; }
#cmtpane .cp-card.cur { border-left-color: #C43E1C; box-shadow: 0 0 0 1px #C43E1C; }
#cmtpane .cp-card { cursor: pointer; }
#cmtpane .cp-card:hover { background: #FDF8F5; }

/* nav pane current */
#navpane .np-item.cur { background: #D5E6F7; font-weight: 600; }

/* spelling pane */
#spellpane { width: 250px; background: #fff; border-left: 1px solid #DDD; display: none; flex-direction: column; flex: none; }
#spellpane.open { display: flex; }
#spellpane .cp-h { font-size: 13px; font-weight: 600; padding: 12px 14px 8px; border-bottom: 1px solid #EEE; display: flex; justify-content: space-between; align-items: center; }
#spellpane .spx { border: none; background: none; cursor: pointer; color: #666; font-size: 12px; }
#spellpane .spx:hover { color: #000; }
#spellpane .sp-list { flex: 1; overflow: auto; padding: 8px; }
#spellpane .sp-item { padding: 8px 10px; border-bottom: 1px solid #F0F0F0; cursor: pointer; }
#spellpane .sp-item:hover { background: #F8F8F8; }
#spellpane .spw { font-weight: 600; font-size: 12.5px; color: #C43E1C; margin-bottom: 4px; }
#spellpane .sps { display: flex; flex-wrap: wrap; gap: 4px; }
#spellpane .spb { border: 1px solid #D0D0D0; background: #fff; border-radius: 3px; padding: 3px 9px; font-size: 11.5px; cursor: pointer; }
#spellpane .spb:hover { background: #E8F1FB; border-color: #0078D4; }
#spellpane .spb.dim { color: #777; border-style: dashed; }

/* dialog extras */
.dlg .dlgsec { font-weight: 600; font-size: 11.5px; color: #333; margin: 12px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #E8E8E8; }
.dlg .dlgsec:first-child { margin-top: 0; }
.dlgbtn { padding: 5px 14px; font-size: 12px; border: 1px solid #ADADAD; background: #fff; border-radius: 2px; cursor: pointer; }
.dlgbtn:hover { background: #F0F0F0; }
.dlgbtn.primary { background: var(--word-blue); border-color: var(--word-blue); color: #fff; }
.dlgprev { border: 1px solid #E0E0E0; background: #FAFAFA; padding: 14px; margin: 8px 0; min-height: 40px; font-size: 14px; }
.dlg .d-row input[type=color] { width: 52px; height: 26px; padding: 1px; border: 1px solid #BFBFBF; }
.dlg .d-row input[type=checkbox] { accent-color: var(--word-blue); }

/* style list picker */
.stylelist { max-height: 340px; overflow: auto; min-width: 300px; }
.stylelist .sli { display: flex; align-items: baseline; gap: 10px; padding: 7px 12px; cursor: pointer; border-left: 3px solid transparent; }
.stylelist .sli:hover { background: #E8F1FB; }
.stylelist .sli.cur { border-left-color: #0078D4; background: #F0F7FD; }
.stylelist .samp { font-size: 15px; min-width: 90px; }
.stylelist .snm { font-size: 11px; color: #777; margin-left: auto; }

/* word count table */
.wctable { border-collapse: collapse; margin: 6px 0; }
.wctable td { padding: 4px 14px 4px 0; font-size: 12.5px; }
.wctable td:last-child { font-weight: 600; text-align: right; }

/* table style / alignment strips */
.tstyle-strip { display: grid; grid-template-columns: repeat(4, 72px); gap: 6px; padding: 8px; }
.tstyle-strip .tsc { border: 2px solid #D0D0D0; background: #fff; border-radius: 2px; padding: 0; cursor: pointer; overflow: hidden; }
.tstyle-strip .tsc:hover, .tstyle-strip .tsc.on { border-color: #0078D4; }
.tstyle-strip .tsc .tsw { font-size: 9px; color: #666; text-align: center; padding: 2px; }
.tstyle-strip .tsc .tsb { height: 44px; }
.aligngrid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; padding: 8px; }
.aligngrid .ag { width: 34px; height: 34px; border: 1px solid #C8C8C8; background: #fff; border-radius: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 8px; color: #666; }
.aligngrid .ag:hover { border-color: #0078D4; background: #F0F7FD; }
.aligngrid .ag .ln { width: 16px; height: 1.5px; background: #555; }

/* toast / misc */
body.reading #toast { bottom: 60px; }
#ruler-h .rmarker { width: 12px; height: 26px; }

/* root app column */
#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }

/* big/mid split buttons: stacked icon+label over a bottom arrow strip */
.rbtn.big.split, .rbtn.mid.split { padding: 0; gap: 0; }
.rbtn.big.split .split-main, .rbtn.mid.split .split-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; padding: 5px 2px 0; border-radius: 3px 3px 0 0; }
.rbtn.big.split .split-main:hover, .rbtn.mid.split .split-main:hover { background: var(--hover); }
.rbtn.big.split .split-arrow, .rbtn.mid.split .split-arrow { display: flex; align-items: center; justify-content: center; width: 100%; height: 15px; border-radius: 0 0 3px 3px; }
.rbtn.big.split .split-arrow:hover, .rbtn.mid.split .split-arrow:hover { background: var(--hover); }
.rbtn.big.split .split-arrow .ic, .rbtn.mid.split .split-arrow .ic { width: 10px; height: 10px; }
