/* Tools4U independent Word Pro — polished ribbon & mobile controls; all visual changes scoped to this editor. */
:root{--word-blue:#2563eb;--word-violet:#7144dc}
.topbar{background:linear-gradient(112deg,#101936,#162450 60%,#1b1940);border-bottom:1px solid #3d4d77;height:66px}
.word-ico{background:linear-gradient(135deg,#216dcf,#2f4ebe);box-shadow:0 3px 10px #0a143e60;font-family:Segoe UI,Arial,sans-serif}
.word-brand strong{font-size:21px;letter-spacing:-.5px}.topbar .logo{font-weight:900;box-shadow:0 4px 13px #27207688}
.top-actions #btn-localdocs-top{color:#dce8ff;background:transparent;border:1px solid #6a77a844}.top-actions .accent{border-radius:9px}
.ribbon{background:var(--panel);box-shadow:0 3px 11px #0d1c3a18}
.ribbon-tabs{border-bottom:1px solid var(--line);padding-left:16px;gap:1px;scrollbar-width:thin;white-space:nowrap}
.ribbon-tabs button{font-size:13px;padding:10px 13px;min-height:39px;font-weight:650;color:var(--ink)}
.ribbon-tabs button[data-tab=file]{color:#fff;background:#2354af;border-radius:6px 6px 0 0;padding-left:17px;padding-right:17px;margin-right:4px}
.ribbon-tabs button.active:not([data-tab=file]){border-color:#7455eb;color:var(--accent);background:#7e59c80a}
.ribbon-tabs button.active[data-tab=file]{background:#5235c6}
.tab-lock{color:#e4aa47;font-size:10px}
.ribbon-panel{display:flex;flex-wrap:nowrap;align-items:stretch;gap:0;padding:7px 10px;min-height:89px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.word-pro-group{display:flex;flex-direction:column;align-items:center;border-right:1px solid var(--line);min-width:fit-content;min-height:78px;padding:2px 12px 0}
.word-pro-group:last-child{border:0}.word-pro-controls{display:flex;align-items:center;gap:5px;flex-wrap:wrap;align-content:center;max-width:480px;min-height:50px}
.word-pro-group-label{color:var(--muted);font-size:10px;line-height:1.15;text-align:center;margin-top:auto;padding:4px 0 0;letter-spacing:.4px}
.word-pro-action{border:1px solid transparent!important;background:transparent!important;font-size:12px!important;padding:8px 7px!important;min-width:29px!important;min-height:29px;white-space:nowrap}
.word-pro-action:hover{background:var(--panel2)!important;border-color:var(--line)!important}
.word-pro-action.premium-action{color:var(--accent)!important}
.word-pro-group select{max-width:128px;font-size:12px;height:31px;padding:3px 7px;border:1px solid var(--line);border-radius:6px;color:var(--ink);background:var(--panel)}
.word-color-control{display:flex;flex-direction:column;gap:1px;font-size:9px;color:var(--muted);min-width:28px;align-items:center}
.word-color-control input{width:30px;height:25px;padding:2px;cursor:pointer;border-radius:6px;border:1px solid var(--line)}
.workarea{height:calc(100dvh - 66px - 39px - 103px - 43px);min-height:350px}.page-zone{background:radial-gradient(ellipse at top,#d9dff1 0%,#e9edf5 65%,#edf0f7 100%);padding-top:18px}
:root[data-theme=dark] .page-zone{background:radial-gradient(ellipse at top,#25304a 0%,#111a2c 65%,#0e1425 100%)}
.editor-ruler{height:23px;max-width:min(100%,210mm);margin:0 auto 8px;background:repeating-linear-gradient(90deg,transparent,transparent 22px,#b9c2d5 23px,#b9c2d5 24px);display:flex;align-items:center;justify-content:space-between;color:#8290aa;font-size:10px;padding:0 7px;border-top:1px solid #bec8d9;border-bottom:1px solid #bec8d9;overflow:hidden}
.editor-ruler[hidden]{display:none}
.page-wrap{width:min(100%,var(--page-width,210mm));min-height:var(--page-height,297mm);margin:auto;transition:width .15s}
.paper{min-height:var(--page-height,297mm);padding:22mm 20mm;background:#fff;color:#182136;box-shadow:0 14px 44px #111a3540;font-size:15px;line-height:1.58;font-family:Calibri,'Segoe UI',Arial,sans-serif}
.paper:empty:before{content:'Start typing your document…';color:#99a1b8}
:root[data-theme=dark] .paper{background:#fdfdff;color:#19233a}
.paper p,.paper li{font-size:inherit}.paper h1{font-size:2em;color:#1c2e62}.paper h2{font-size:1.5em;color:#243d78}
.paper img{max-width:100%;height:auto}.paper table{width:100%;border-collapse:collapse;table-layout:auto}.paper td,.paper th{min-width:35px;border:1px solid #8d9cb9;vertical-align:top}.paper th{background:#e9efff}
.paper a{color:#4c51cc}.paper [id^=section-]{scroll-margin-top:28px}
.paper .word-merged-record:not(:first-child){break-before:page;page-break-before:always}
.word-focus .ribbon,.word-focus .top-actions #btn-templates,.word-focus .bottom-help{display:none!important}
.word-focus .workarea{height:calc(100dvh - 66px - 43px)}
.sidepanel{border-right:1px solid var(--line)}
.word-compare-result{max-height:220px;white-space:pre-wrap;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel2);font-size:12px;padding:10px;margin-top:10px}
#word-signature-pad{width:100%;height:auto;max-height:190px;touch-action:none;background:#fff;border:2px dashed #a9b1d0;border-radius:8px;cursor:crosshair}
.dialog .dlg textarea{display:block;width:100%;margin-top:9px;font:12px/1.6 ui-monospace,Consolas,monospace;color:var(--ink);background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:10px}
@media(min-width:1380px){.ribbon-tabs button{font-size:14px}.word-pro-group{padding-left:15px;padding-right:15px}}
@media(max-width:900px){.topbar{height:auto;min-height:60px}.word-brand .by{display:none}.top-actions button{font-size:12px}.ribbon-panel{min-height:83px;max-height:110px;overflow-x:auto;overflow-y:hidden;flex-wrap:nowrap}.ribbon-tabs{max-width:100vw}.workarea{height:calc(100dvh - 157px - 43px);min-height:320px}.page-wrap{width:min(100%,var(--page-width,210mm))!important}.paper{padding:26px 22px;min-height:600px}.editor-ruler{max-width:100%}}
@media(max-width:560px){.topbar{gap:6px;padding:8px}.word-brand strong{font-size:16px}.word-ico{width:27px;height:27px;font-size:18px}.by{display:none}.titlebar input{font-size:12px}.top-actions{width:100%;justify-content:space-between}.top-actions button{font-size:11px;padding:7px 8px}#btn-localdocs-top{font-size:11px}.ribbon-tabs button{font-size:12px;padding:9px 11px}.ribbon-panel{padding:4px 6px;min-height:76px;max-height:98px;overflow-y:hidden}.word-pro-group{min-height:70px;padding:2px 8px}.word-pro-action{font-size:11px!important;padding:6px 6px!important}.word-pro-group-label{font-size:9px}.workarea{height:calc(100dvh - 165px - 43px);min-height:330px}.page-zone{padding:10px 6px 28px}.paper{font-size:14px;min-height:500px;padding:18px 13px}.editor-ruler{display:none}.statusbar #stats{font-size:10px} }
@media print{.paper{color:#111!important;background:#fff!important;min-height:0!important}.editor-ruler{display:none!important}.word-merged-record{break-before:page;page-break-before:always}.word-merged-record:first-child{break-before:auto} }
@media(max-width:380px){
 .topbar{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px;padding:7px 8px;overflow:visible;max-width:100vw}
 .word-brand{grid-column:1;min-width:0;gap:5px}
 .titlebar{grid-column:2;min-width:0;width:100%;max-width:100%}
 .titlebar input{min-width:0;width:100%;max-width:100%}
 .top-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:4px;justify-content:flex-end;min-width:0;width:100%}
 .top-actions button,.top-actions .home-link{font-size:10px;padding:5px 6px}
 .word-brand strong{font-size:15px}
 .workarea{height:calc(100dvh - 174px - 43px);min-height:290px}
 }
