/* ==========================================================================
   word-ui.css — ظاهر Microsoft Word 2016 برای ابزار ورد
   (Title bar + Tabs + Ribbon + Paper + Header/Footer zones + Status bar)
   ========================================================================== */
.wd-app {
    --wd-blue: #2B579A;
    --wd-blue-dark: #234A85;
    --wd-ribbon: #F3F3F3;
    --wd-line: #D5D5D5;
    --wd-canvas: #E6E6E6;
    --wd-text: #262626;
    --wd-hover: #E1E1E1;
    --wd-press: #C8C8C8;
    --wd-mx: 96px;          /* حاشیه چپ/راست */
    --wd-mt: 96px;          /* حاشیه بالا */
    --wd-mb: 96px;          /* حاشیه پایین */
    --wd-hdr-top: 47px;     /* Header from Top  (1.25cm) */
    --wd-ftr-bot: 47px;     /* Footer from Bottom (1.25cm) */
    --wd-zoom: 1;
    font-family: "Segoe UI", Tahoma, "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    color: var(--wd-text);
}

/* ---- ریست کادر قدیمیِ editor-wrapper ---- */
.editor-wrapper.wd-app {
    border: 1px solid #b9b9b9 !important;
    border-radius: 0 !important;
    background: var(--wd-canvas) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.18) !important;
    overflow: visible;
    display: block !important;
    position: relative;
    direction: ltr;
}
.wd-app button { font-family: inherit; }
.wd-app *, .wd-app *::before, .wd-app *::after { box-sizing: border-box; }
.wd-hidden-sel { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wd-legacy { display: none !important; }
.wd-i { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: middle; }
.wd-caret { width: 8px; height: 8px; flex: none; color: #444; }

/* ================= Chrome (title + tabs + ribbon) ================= */
.wd-chrome {
    position: sticky !important;
    top: 70px !important;
    z-index: 99 !important;
    background: var(--wd-blue);
    border-radius: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid var(--wd-line) !important;
    user-select: none;
    -webkit-user-select: none;
}
@media (max-width: 768px) { .wd-chrome { top: 55px !important; } }

/* Title bar */
.wd-titlebar { position: relative; height: 30px; display: flex; align-items: center; color: #fff; }
.wd-qat { display: flex; align-items: center; padding-left: 6px; gap: 0; z-index: 2; }
.wd-qbtn {
    width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; color: #fff; cursor: pointer; padding: 0; border-radius: 0;
}
.wd-qbtn:hover { background: rgba(255,255,255,.18); }
.wd-qbtn .wd-i { width: 17px; height: 17px; }
.wd-qarrow { color: #fff; width: 10px; display: inline-flex; justify-content: center; }
.wd-qarrow .wd-caret { color: #fff; width: 7px; height: 7px; }
.wd-qarrow-last { margin-left: 4px; }
.wd-title { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; pointer-events: none; z-index: 1; }
.wd-title-right { margin-left: auto; display: flex; align-items: center; padding-right: 6px; z-index: 2; }

/* Tabs */
.wd-tabs { position: relative; height: 28px; display: flex; align-items: flex-end; padding-left: 0; background: var(--wd-blue); }
.wd-tab {
    position: relative; height: 28px; padding: 0 12px; background: transparent; border: 0; color: #fff;
    font-size: 12px; cursor: pointer; letter-spacing: 0; z-index: 2; white-space: nowrap;
}
.wd-tab:hover { background: rgba(255,255,255,.14); }
.wd-tab.is-active { background: var(--wd-ribbon); color: var(--wd-blue); }
.wd-tab.is-active:hover { background: var(--wd-ribbon); }
.wd-tab-file { background: var(--wd-blue-dark); margin-right: 4px; min-width: 60px; font-weight: 400; }
.wd-tab-file:hover { background: #1c3d70; }

/* Contextual tab group: Header & Footer Tools */
.wd-ctx { position: relative; display: flex; align-items: flex-end; margin-left: 4px; }
.wd-ctx[hidden] { display: none; }
.wd-ctx::before {
    content: ""; position: absolute; left: 0; right: 0; top: -30px; bottom: 0;
    background: var(--wd-blue-dark); border-top: 2px solid #A4373A; z-index: 0;
}
.wd-ctx-label { position: absolute; top: -30px; left: 0; right: 0; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #D9E3F3; z-index: 1; white-space: nowrap; padding: 0 10px; }
.wd-ctx .wd-tab { min-width: 70px; }
.wd-ctx .wd-tab.is-active { background: var(--wd-ribbon); color: var(--wd-blue); }

/* Tell me + Share */
.wd-tell { position: relative; display: flex; align-items: center; gap: 7px; margin-left: 12px; height: 28px; flex: 0 1 280px; min-width: 120px; padding: 0 6px; z-index: 3; }
.wd-tell input {
    flex: 1; min-width: 0; height: 22px; background: transparent; border: 0; outline: none; color: #fff; font-size: 12px; font-family: inherit;
}
.wd-tell input::placeholder { color: #fff; opacity: .92; }
.wd-tell:focus-within { background: #fff; }
.wd-tell:focus-within input { color: #222; }
.wd-tell:focus-within input::placeholder { color: #777; }
.wd-tell:focus-within .wd-i path { stroke: #444; }
.wd-tell-results { position: absolute; left: 0; top: 28px; width: 300px; background: #fff; border: 1px solid #ababab; box-shadow: 0 4px 12px rgba(0,0,0,.25); max-height: 320px; overflow: auto; z-index: 200; }
.wd-tell-results[hidden] { display: none; }
.wd-tell-results button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 10px; border: 0; background: #fff; color: #222; text-align: left; font-size: 12px; cursor: pointer; }
.wd-tell-results button:hover { background: #E1EAF7; }
.wd-tell-results .wd-none { padding: 8px 10px; color: #777; }
/* سه دکمه‌ی خروجی (دانلود ورد / PDF / چاپ) به‌جای «اشتراک‌گذاری» */
.wd-actions { margin-left: auto; display: flex; align-items: stretch; gap: 2px; height: 28px; flex: none; padding: 0 4px; z-index: 3; }
.wd-act { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 3px 3px 0 0; background: transparent; color: #fff; font: inherit; font-size: 12px; line-height: 1; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wd-act .wd-i { width: 18px; height: 18px; }
.wd-act:hover { background: rgba(255,255,255,.16); }
.wd-act:active { background: rgba(255,255,255,.26); }
.wd-act:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.wd-act .l-short { display: none; }
.wd-act-lock { position: absolute; top: 3px; inset-inline-start: 5px; width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px var(--wd-blue); pointer-events: none; }
.wd-act.is-busy { pointer-events: none; opacity: .65; }
.wd-act.is-busy .wd-i { animation: wdActPulse .8s ease-in-out infinite alternate; }
@keyframes wdActPulse { from { opacity: 1; } to { opacity: .35; } }

/* ================= Ribbon ================= */
.wd-ribbon { background: var(--wd-ribbon); height: 93px; overflow-x: auto; overflow-y: hidden; border-top: 1px solid var(--wd-line); scrollbar-width: thin; }
.wd-app.ribbon-collapsed .wd-ribbon { display: none; }
.wd-panel { display: none; height: 92px; min-width: min-content; align-items: stretch; padding: 2px 0 0; }
.wd-panel.is-active { display: flex; }
.wd-group { position: relative; display: flex; flex-direction: column; padding: 0 4px 0 4px; border-right: 1px solid var(--wd-line); flex: none; }
.wd-group-body { display: flex; align-items: flex-start; gap: 1px; height: 72px; padding-top: 2px; }
.wd-group-body.wd-rows { flex-direction: column; gap: 3px; padding-top: 3px; }
.wd-group-label { height: 18px; line-height: 18px; text-align: center; font-size: 11px; color: #444; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 14px; white-space: nowrap; }
.wd-dialog-launcher { position: absolute; right: 0; top: 3px; width: 12px; height: 12px; border: 0; background: transparent; color: #666; font-size: 9px; padding: 0; line-height: 1; cursor: default; }
.wd-row { display: flex; align-items: center; gap: 1px; height: 26px; }

/* دکمه‌ها */
.wd-big, .wd-sm, .wd-ib, .wd-style, .wd-gallery-nav button {
    background: transparent; border: 1px solid transparent; color: var(--wd-text); cursor: pointer; font-size: 11px; padding: 0; border-radius: 0;
}
.wd-big { min-width: 46px; height: 68px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 3px 4px; gap: 2px; text-align: center; line-height: 1.15; }
.wd-big .wd-i { width: 32px; height: 32px; }
.wd-big span { font-size: 11px; }
.wd-stack { display: flex; flex-direction: column; gap: 0; }
.wd-sm { height: 22px; display: flex; align-items: center; gap: 5px; padding: 0 5px; white-space: nowrap; font-size: 11px; }
.wd-sm-wide { min-width: 100px; justify-content: flex-start; }
.wd-sm .wd-i { width: 16px; height: 16px; }
.wd-ib { min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.wd-ib .wd-i { width: 18px; height: 18px; }
.wd-ib-arrow { width: 11px; height: 24px; display: inline-flex; align-items: center; justify-content: center; margin-left: -3px; margin-right: 1px; position: relative; cursor: pointer; }
.wd-txt { font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; min-width: 25px; padding: 0 2px; }
.wd-txt b, .wd-txt i, .wd-txt u, .wd-txt s { font-size: 14px; }
.wd-txt s { font-size: 12px; }
.wd-txt sub, .wd-txt sup { font-size: 9px; }
.wd-vsep { width: 1px; height: 20px; background: #cfcfcf; margin: 0 3px; flex: none; }
.wd-big:hover, .wd-sm:hover, .wd-ib:hover, .wd-gallery-nav button:hover { background: var(--wd-hover); border-color: #cfcfcf; }
.wd-big:active, .wd-sm:active, .wd-ib:active { background: var(--wd-press); }
.toolbar button.active, .wd-ib.active, .wd-ib.active:hover { background: var(--wd-press) !important; border-color: #a9a9a9 !important; color: var(--wd-text) !important; box-shadow: none !important; }
.wd-dis { opacity: .45; pointer-events: none; }

/* انتخاب‌گرهای فونت/اندازه */
.wd-select {
    height: 22px; border: 1px solid #ababab; background: #fff; color: #222; font-size: 12px; padding: 0 2px; border-radius: 0; font-family: "Segoe UI", Arial, sans-serif; outline: none; cursor: pointer;
}
.wd-select:focus, .wd-select:hover { border-color: #7a7a7a; }
.wd-sel-font { width: 124px; margin-right: 2px; }
.wd-sel-size { width: 46px; margin-right: 4px; }

/* دکمه رنگ‌ها (فونت/هایلایت) */
.wd-colorbtn { display: inline-flex; align-items: center; position: relative; }
.wd-colorbtn > .wd-ib { position: relative; padding-bottom: 3px; }
.wd-bar { position: absolute; left: 4px; right: 4px; bottom: 1px; height: 4px; display: block; }
.wd-pick input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }

/* Styles Gallery */
.wd-g-styles { flex: 1 1 380px; min-width: 330px; border-right: 1px solid var(--wd-line); }
.wd-gallery-body { align-items: stretch; padding-top: 3px; gap: 0; }
.wd-gallery { flex: 1; display: flex; flex-wrap: nowrap; overflow: hidden; background: #fff; border: 1px solid #c6c6c6; height: 64px; scroll-behavior: smooth; }
.wd-style { flex: none; width: 74px; height: 62px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px 2px 3px; gap: 3px; border: 1px solid transparent; }
.wd-style:hover { background: #E1EAF7; border-color: #9DB7DF; }
.wd-style.is-current { border-color: #6a8cc7; background: #eef3fb; }
.wd-sp { font-size: 13px; font-family: Calibri, "Segoe UI", Arial, sans-serif; color: #222; white-space: nowrap; letter-spacing: 0; line-height: 1.5; margin-bottom: auto; padding-top: 6px; }
.wd-sn { font-size: 11px; color: #333; white-space: nowrap; }
.wd-sp.s-h1 { color: #2E74B5; font-size: 16px; }
.wd-sp.s-h2 { color: #2E74B5; font-size: 14px; }
.wd-sp.s-title { font-size: 26px; line-height: 1; padding-top: 4px; font-weight: 300; }
.wd-sp.s-sub { color: #5A5A5A; letter-spacing: 1px; font-size: 12px; }
.wd-sp.s-subtle { font-style: italic; color: #595959; }
.wd-sp.s-em { font-style: italic; }
.wd-sp.s-intense { font-style: italic; color: #2E74B5; }
.wd-sp.s-strong { font-weight: 700; }
.wd-sp.s-quote { font-style: italic; color: #404040; }
.wd-sp.s-iq { font-style: italic; color: #2E74B5; border-top: 1px solid #2E74B5; border-bottom: 1px solid #2E74B5; padding: 3px 4px; margin-top: 4px; }
.wd-gallery-nav { width: 16px; display: flex; flex-direction: column; border: 1px solid #c6c6c6; border-left: 0; background: #fafafa; height: 64px; }
.wd-gallery-nav button { flex: 1; font-size: 7px; color: #555; border: 0; border-bottom: 1px solid #e3e3e3; }
.wd-gallery-nav button:last-child { border-bottom: 0; }

/* Options (checkbox) group */
.wd-checks { flex-direction: column; justify-content: center; gap: 4px; padding: 0 6px; align-items: flex-start; }
.wd-check { display: flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.wd-check input { margin: 0; width: 13px; height: 13px; accent-color: var(--wd-blue); }

/* Position group */
.wd-pos { padding-top: 6px; gap: 4px; }
.wd-poslabel { gap: 4px; font-size: 12px; height: 22px; }
.wd-poslabel label { min-width: 104px; margin: 0; font-weight: 400; font-size: 12px; color: var(--wd-text); }
.wd-posicon .wd-i { width: 18px; height: 18px; }
.wd-spin { width: 56px; height: 21px; border: 1px solid #ababab; font-size: 12px; padding: 0 3px; background: #fff; font-family: inherit; }
.wd-unit { font-size: 11px; color: #555; }
.wd-g-close { border-right: 0; }
.wd-close-hf .wd-i { width: 32px; height: 32px; }

/* ================= Menus ================= */
.wd-menu {
    position: fixed; z-index: 9999; background: #fff; border: 1px solid #ababab; box-shadow: 0 4px 14px rgba(0,0,0,.28); min-width: 210px; padding: 2px 0; font-size: 12px; direction: ltr; text-align: left;
}
.wd-menu[hidden] { display: none; }
.wd-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 14px 5px 10px; background: #fff; border: 0; color: #222; text-align: left; font-size: 12px; cursor: pointer; white-space: nowrap; }
.wd-menu button:hover { background: #E1EAF7; }
.wd-menu button[disabled] { opacity: .45; pointer-events: none; }
.wd-menu .wd-msep { height: 1px; background: #dcdcdc; margin: 3px 0; }
.wd-menu .wd-mhead { padding: 4px 10px; font-weight: 600; font-size: 11px; background: #f0f0f0; color: #333; }
.wd-menu .wd-gal { padding: 4px 10px 6px; }
.wd-menu .wd-gal-item { display: block; width: 100%; border: 1px solid #d0d0d0; background: #fff; margin-top: 4px; padding: 6px 8px; font-size: 11px; color: #666; text-align: left; cursor: pointer; }
.wd-menu .wd-gal-item:hover { border-color: #6a8cc7; background: #eef3fb; }
.wd-menu .wd-gal-3 { display: flex; justify-content: space-between; gap: 6px; }
.wd-menu .wd-gal-3 span { flex: 1; text-align: center; }

/* ================= Workspace + Paper ================= */
.wd-workspace { background: var(--wd-canvas); padding: 14px 0 28px; overflow-x: auto; overflow-y: visible; min-height: 640px; position: relative; direction: ltr; }
.wd-zoomwrap { zoom: var(--wd-zoom); width: 794px; margin: 0 auto; transform-origin: top center; }
.wd-page {
    position: relative; width: 794px; min-height: 1123px; background: #fff; margin: 0 auto;
    box-shadow: 0 0 0 1px #cfcfcf, 0 2px 8px rgba(0,0,0,.2);
    display: flex; flex-direction: column; direction: rtl;
}
.wd-page.landscape { width: 1123px; min-height: 794px; }

/* هدر / فوتر */
.wd-hf { position: relative; padding-left: var(--wd-mx); padding-right: var(--wd-mx); flex: none; cursor: default; }
#wdHeader { padding-top: var(--wd-hdr-top); min-height: var(--wd-mt); }
#wdFooter { padding-bottom: var(--wd-ftr-bot); min-height: var(--wd-mb); margin-top: auto; display: flex; flex-direction: column; justify-content: flex-end; }
.wd-hf-edit {
    outline: none; min-height: 1.7em; font-size: 14px; line-height: 1.7; color: #000; direction: rtl; text-align: right; word-break: break-word; unicode-bidi: plaintext;
}
.wd-hf-edit:empty::before { content: ""; }
.wd-hf-edit p { margin: 0; }
.wd-hf-edit img { max-width: 100%; height: auto; }
.wd-hf-edit table { border-collapse: collapse; width: 100%; }
.wd-hf-edit td { padding: 2px 4px; }
.wd-hf:not(.is-editing) .wd-hf-edit { opacity: .5; }
.wd-hf-label { display: none; position: absolute; left: 9px; font-size: 12px; font-family: "Segoe UI", Arial, sans-serif; color: #222; background: #E6E6E6; border: 1px solid #a8a8a8; padding: 1px 6px; line-height: 15px; z-index: 6; direction: ltr; user-select: none; }
.wd-hf.is-editing .wd-hf-label { display: block; }
#wdHeader .wd-hf-label { top: 100%; }
#wdFooter .wd-hf-label { bottom: 100%; }
.wd-hf.is-editing::after { content: ""; position: absolute; left: 0; right: 0; border-bottom: 1px dotted #6f6f6f; pointer-events: none; }
#wdHeader.is-editing::after { bottom: 0; }
#wdFooter.is-editing::after { top: 0; }
.wd-field { background: transparent; padding: 0 1px; }
.wd-hf.is-editing .wd-field:hover { background: #d9d9d9; }

/* بدنه‌ی سند (ادیتور اصلی) */
.editor-wrapper .wd-page #editor.editor {
    margin: 0 var(--wd-mx); padding: 0; flex: 1 0 auto; min-height: 200px; border-radius: 0 !important; background: transparent !important; width: auto;
}
.wd-page.hf-editing #editor { opacity: .38; user-select: none; -webkit-user-select: none; }
.wd-page.hf-editing.hide-doc-text #editor { visibility: hidden; }
.wd-app.wd-show-marks #editor p::after,
.wd-app.wd-show-marks #editor h1::after, .wd-app.wd-show-marks #editor h2::after, .wd-app.wd-show-marks #editor h3::after,
.wd-app.wd-show-marks #editor li::after { content: "\00B6"; color: #2B579A; opacity: .65; margin-right: 2px; }

/* پیش‌نمایش صفحه‌بندی داخل برگه */
.wd-page .page-break-overlay { top: 0; left: 0; right: 0; }
.wd-page .page-break-guide { left: 0; right: 0; border-top: 1px dashed #8a8a8a; }
.wd-page .page-break-label { background: #fff; color: #5b5b5b; font-family: "Segoe UI", Tahoma, sans-serif; }
.editor-wrapper.page-breaks-visible .wd-page .page-break-overlay { display: block; }

/* ================= Status bar ================= */
.wd-status {
    position: sticky; bottom: 0; z-index: 60; height: 24px; display: flex; align-items: center; background: var(--wd-ribbon); border-top: 1px solid #cfcfcf;
    color: #444; font-size: 12px; padding: 0 8px; gap: 14px; direction: ltr;
}
.wd-status .wd-sitem { white-space: nowrap; cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.wd-status .wd-sitem:hover { background: #E1E1E1; }
.wd-status .wd-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.wd-status .wd-vbtn { width: 22px; height: 20px; border: 1px solid transparent; background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.wd-status .wd-vbtn:hover { background: #E1E1E1; }
.wd-status .wd-vbtn.is-active { background: #C8C8C8; }
.wd-status .wd-vbtn .wd-i { width: 15px; height: 15px; }
.wd-zoom-btn { width: 18px; height: 18px; border: 0; background: transparent; font-size: 16px; line-height: 16px; color: #444; cursor: pointer; padding: 0; }
.wd-zoom-slider { -webkit-appearance: none; appearance: none; width: 110px; height: 3px; background: #9a9a9a; outline: none; margin: 0 4px; }
.wd-zoom-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 7px; height: 16px; background: #444; border-radius: 0; cursor: pointer; }
.wd-zoom-slider::-moz-range-thumb { width: 7px; height: 16px; background: #444; border: 0; border-radius: 0; }
.wd-zoom-val { width: 44px; text-align: right; cursor: pointer; }
.word-count { display: none !important; } /* شمارنده‌ی قدیمی؛ مقدارش در Status bar نمایش داده می‌شود */

/* ================= Dialogs ================= */
.wd-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.28); z-index: 10000; display: flex; align-items: center; justify-content: center; direction: ltr; }
.wd-dialog { background: #fff; min-width: 360px; max-width: 92vw; border: 1px solid #7a7a7a; box-shadow: 0 8px 28px rgba(0,0,0,.4); font-family: "Segoe UI", Tahoma, Arial, sans-serif; font-size: 12px; color: #222; }
.wd-dialog-head { height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 0 0 12px; background: #fff; font-size: 13px; border-bottom: 1px solid #e6e6e6; }
.wd-dialog-x { width: 40px; height: 30px; border: 0; background: transparent; font-size: 16px; cursor: pointer; color: #333; }
.wd-dialog-x:hover { background: #E81123; color: #fff; }
.wd-dialog-body { padding: 14px 16px; }
.wd-dialog-body label { display: block; margin: 8px 0 3px; }
.wd-dialog-body input[type=text], .wd-dialog-body select { width: 100%; height: 24px; border: 1px solid #ababab; padding: 0 6px; font-size: 12px; font-family: inherit; }
.wd-dialog-body .wd-list { border: 1px solid #ababab; max-height: 190px; overflow: auto; }
.wd-dialog-body .wd-list div { padding: 4px 8px; cursor: pointer; }
.wd-dialog-body .wd-list div:hover { background: #eef3fb; }
.wd-dialog-body .wd-list div.is-sel { background: #CDE0F7; }
.wd-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.wd-btn { min-width: 76px; height: 24px; border: 1px solid #adadad; background: #E1E1E1; color: #222; font-size: 12px; cursor: pointer; font-family: inherit; }
.wd-btn:hover { background: #E5F1FB; border-color: #0078D7; }
.wd-btn.is-primary { border-color: #0078D7; }
.wd-statrow { display: flex; justify-content: space-between; padding: 3px 0; }

/* ================= Backstage (File) ================= */
.wd-backstage { position: absolute; inset: 0; z-index: 400; display: flex; background: #fff; direction: ltr; }
.wd-backstage[hidden] { display: none; }
.wd-bs-nav { width: 190px; background: var(--wd-blue); color: #fff; padding-top: 6px; flex: none; }
.wd-bs-back { display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 0; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.wd-bs-back:hover { background: rgba(255,255,255,.15); }
.wd-bs-nav .wd-bs-item { display: block; width: 100%; padding: 10px 24px; border: 0; background: transparent; color: #fff; font-size: 14px; text-align: left; cursor: pointer; }
.wd-bs-nav .wd-bs-item:hover { background: rgba(255,255,255,.18); }
.wd-bs-main { flex: 1; padding: 28px 40px; background: #fff; }
.wd-bs-main h2 { font-size: 26px; font-weight: 300; margin: 0 0 20px; color: #2b2b2b; font-family: "Segoe UI Light", "Segoe UI", sans-serif; }
.wd-bs-main p { color: #555; font-size: 13px; max-width: 520px; line-height: 1.7; }
.wd-bs-main .wd-bs-big { display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px; margin: 0 12px 12px 0; border: 1px solid #d0d0d0; background: #fafafa; cursor: pointer; font-size: 14px; }
.wd-bs-main .wd-bs-big:hover { background: #E5F1FB; border-color: #6a8cc7; }

/* ================= Responsive ================= */
@media (max-width: 900px) {
    .wd-tell { display: none; }
    .wd-zoom-slider { width: 70px; }
}

/* ================= Print ================= */
@media print {
    #printArea.wd-paged { padding: 0 !important; }
    #printArea.wd-paged .wd-print-page, #printArea.wd-paged .wd-print-page > div { position: absolute !important; }
    #printArea.wd-paged .wd-print-page { position: relative !important; }
    @page { size: A4; margin: 0; }
    .wd-chrome, .wd-status, .wd-backstage, .wd-overlay, .wd-menu { display: none !important; }
}

/* ================= رابط فارسی (Persian UI) ================= */
.wd-chrome, .wd-menu, .wd-dialog, .wd-status, .wd-backstage {
    font-family: "Vazirmatn", "Vazir", Tahoma, "Segoe UI", Arial, sans-serif;
}
.wd-chrome { line-height: 1.35; }
.wd-big span, .wd-sm span, .wd-group-label, .wd-tab, .wd-check span, .wd-style .wd-sn { font-family: inherit; }
.wd-big span { font-size: 11px; }
/* منوهای کشویی، دیالوگ‌ها و منوی فایل: راست‌به‌چپ */
.wd-menu { direction: rtl; text-align: right; }
.wd-menu button { text-align: right; padding: 5px 10px 5px 14px; }
.wd-tell-results { direction: rtl; }
.wd-tell-results button { text-align: right; }
.wd-tell input { text-align: right; }
.wd-overlay { direction: rtl; }
.wd-dialog { direction: rtl; text-align: right; font-family: "Vazirmatn", Tahoma, "Segoe UI", Arial, sans-serif; }
.wd-dialog-head { padding: 0 12px 0 0; }
.wd-bs-main { direction: rtl; text-align: right; }
.wd-bs-main h2 { font-family: "Vazirmatn", Tahoma, sans-serif; font-weight: 500; }
.wd-bs-nav .wd-bs-item { text-align: right; direction: rtl; }
.wd-bs-main .wd-bs-big { margin: 0 0 12px 12px; }
.wd-statrow b { direction: ltr; unicode-bidi: plaintext; }


/* ================= راست‌چین‌کردن کامل ریبون (RTL) ================= */
.wd-chrome { direction: rtl; text-align: right; }
.wd-qat { padding-left: 0; padding-right: 6px; }
.wd-qarrow-last { margin-left: 0; margin-right: 4px; }
.wd-title-right { margin-left: 0; margin-right: auto; padding-right: 0; padding-left: 6px; }
.wd-tab-file { margin-right: 0; margin-left: 4px; }
.wd-ctx { margin-left: 0; margin-right: 4px; }
.wd-tell { margin-left: 0; margin-right: 12px; }
.wd-tell-results { left: auto; right: 0; }
.wd-actions { margin-left: 0; margin-right: auto; }
.wd-group { border-right: 0; border-left: 1px solid var(--wd-line); }
.wd-g-styles { border-right: 0; border-left: 1px solid var(--wd-line); }
.wd-g-close { border-left: 0; }
.wd-dialog-launcher { right: auto; left: 0; }
.wd-ib-arrow { margin-left: 1px; margin-right: -3px; }
.wd-sel-font { margin-right: 0; margin-left: 2px; }
.wd-sel-size { margin-right: 0; margin-left: 4px; }
.wd-gallery-nav { border-left: 1px solid #c6c6c6; border-right: 0; }
.wd-group-body, .wd-row, .wd-gallery { direction: rtl; }
.wd-select, .wd-spin, #wdTellMe { direction: rtl; }
/* نوار وضعیت */
.wd-status { direction: rtl; }
.wd-status .wd-right { margin-left: 0; margin-right: auto; }
.wd-zoom-slider { direction: ltr; }
.wd-zoom-val { text-align: left; }
/* منوی فایل */
.wd-backstage { direction: rtl; }
/* روی تبلت/گوشی: دکمه‌ها همیشه دیده می‌شوند (به لبه‌ی چپ می‌چسبند، تب‌ها پشتشان اسکرول می‌شوند) */
@media (max-width: 900px) { .wd-actions { position: sticky; left: 0; right: auto; background: var(--wd-blue); box-shadow: 6px 0 8px -4px rgba(0,0,0,.35); } }
@media (max-width: 768px) { .wd-actions { height: 40px; } .wd-act { padding: 0 11px; font-size: 13px; } }
@media (max-width: 600px) {
    .wd-act .l-full { display: none; }
    .wd-act .l-short { display: inline; }
    .wd-act { padding: 0 8px; gap: 4px; font-size: 12px; }
    .wd-act .wd-i { width: 20px; height: 20px; }
    .wd-act-lock { top: 6px; inset-inline-start: 4px; }
}

/* ===== اصلاح آیکون‌ها در حالت RTL: متنِ داخل SVG باید چپ‌به‌راست رسم شود ===== */
.wd-chrome svg, .wd-i, .wd-caret { direction: ltr; unicode-bidi: isolate; }
.wd-chrome svg text { direction: ltr; unicode-bidi: isolate; text-anchor: start; }
.wd-sel-size { direction: ltr; text-align: center; padding-left: 2px; padding-right: 2px; }
#fontSize { font-family: Tahoma, "Segoe UI", Arial, sans-serif; }
.wd-spin { direction: ltr; }

/* ===== جای کافی برای نام گروه‌ها (زیر ریبون) و نوار اسکرول افقی ===== */
.wd-ribbon { height: 112px; }
.wd-panel { height: 94px; }
.wd-group-label { height: 20px; line-height: 20px; overflow: visible; font-size: 11.5px; }
.wd-chrome { line-height: 1.25; }


/* دکمه‌های تکراری نوار بالا (در ریبون موجودند): از دید پنهان، ولی در DOM باقی می‌مانند تا ریبون بتواند آن‌ها را اجرا کند */
.persistent-toolbar .wd-offscreen { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }


/* دکمه‌ی «میزکار سئو» به‌صورت پویا به نوار بالا اضافه می‌شود؛ آن هم پنهان می‌شود (در تب هوش مصنوعی موجود است) */
.persistent-toolbar #toggleAiSidebarBtn { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; }
/* آیکون‌های تورفتگی برای متن راست‌به‌چپ آینه می‌شوند */
#wdIndent .wd-i, #wdOutdent .wd-i { transform: scaleX(-1); }


/* ===== گالری سبک‌ها: سه کارت + دکمه‌ی کشویی (مانند ورد آنلاین) ===== */
.wd-gallery-body { align-items: center; gap: 0; padding: 4px 6px 2px; margin: 3px 0 0; border: 1px solid #c6c6c6; border-radius: 6px; background: #fff; height: 66px; box-sizing: border-box; }
.wd-gallery { flex: none; height: auto; border: 0; background: transparent; gap: 4px; padding: 0; overflow: visible; }
.wd-style { width: 98px; height: 54px; border: 1px solid #cfcfcf; border-radius: 6px; background: #fff; justify-content: center; gap: 2px; padding: 2px 4px; }
.wd-style:hover { background: #f3f6fb; border-color: #9DB7DF; }
.wd-style.is-current { border: 1.5px solid #555; background: #fff; }
.wd-style .wd-sp { margin: 0; padding: 0; font-size: 15px; line-height: 1.3; font-family: inherit; color: #111; }
.wd-style .wd-sp.s-h1 { font-size: 17px; color: #0F4761; }
.wd-style .wd-sn { font-size: 10px; color: #444; }
.wd-gallery-nav { width: 26px; height: 54px; flex: none; margin-inline-start: 4px; border: 0; border-inline-start: 1px solid #d0d0d0; background: transparent; }
.wd-gallery-nav button { height: 100%; font-size: 15px; color: #333; border: 0; line-height: 1; }
.wd-g-styles { flex: 0 0 auto; min-width: 0; }

/* منوی کشویی سبک‌ها */
.wd-style-menu { padding: 6px; min-width: 270px; border-radius: 6px; }
.wd-stl-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.wd-style-menu .wd-stl-item { display: block; width: 100%; padding: 7px 12px; border: 1px solid transparent; border-radius: 2px; background: #fff; text-align: right; cursor: pointer; }
.wd-style-menu .wd-stl-item:hover { background: #f1f1f1; }
.wd-style-menu .wd-stl-item.is-current { background: #ebebea; border-color: #777; }
.wd-stl-name { font-size: 15px; color: #111; white-space: nowrap; }
.wd-stl-name.s-h1 { font-size: 22px; color: #0F4761; }
.wd-stl-name.s-h2 { font-size: 19px; color: #0F4761; }
.wd-stl-name.s-title { font-size: 26px; font-weight: 600; }
.wd-stl-name.s-sub { color: #666; font-size: 18px; }
.wd-stl-name.s-subtle { font-style: italic; color: #595959; }
.wd-stl-name.s-em { font-style: italic; }
.wd-stl-name.s-intense { font-style: italic; color: #0F4761; font-weight: 600; }
.wd-stl-name.s-strong { font-weight: 700; }
.wd-stl-name.s-quote { font-style: italic; color: #404040; }
.wd-stl-name.s-iq { font-style: italic; color: #0F4761; font-weight: 600; }
.wd-style-menu .wd-stl-act { padding: 8px 10px; gap: 10px; font-size: 12.5px; }
.wd-stl-ico { position: relative; width: 24px; font-weight: 600; font-size: 13px; color: #333; }
.wd-stl-ico::after { content: ""; position: absolute; left: -3px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--c, #2f9e44); border: 1px solid #fff; }


/* ===== QAT سمت چپ + H1 صفحه سمت راست نوار عنوان ===== */
.wd-chrome .wd-titlebar h1.wd-h1 {
    order: 0; flex: 0 1 auto; max-width: 42%; margin: 0 !important; padding: 0 12px !important;
    font-size: 12.5px !important; font-weight: 600 !important; line-height: 30px !important; text-align: right !important;
    color: #fff !important; -webkit-text-fill-color: #fff !important;
    background: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important;
    animation: none !important; letter-spacing: 0 !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 2;
}
.wd-chrome .wd-titlebar .wd-title-right { order: 1; margin-right: auto !important; margin-left: 0 !important; padding: 0 !important; }
.wd-chrome .wd-titlebar .wd-qat { order: 2; padding: 0 0 0 6px !important; }
.wd-chrome .wd-titlebar .wd-qarrow-last { margin: 0 4px 0 0 !important; }
