/* Word Garden: Windows Word (Microsoft 365, Windows 11) mock.
   Chrome colours come from the classroom screenshots: #F3F3F3 window, white rounded ribbon card,
   2px #3466B3 underline on the selected tab. Game overlays (toasts, hints) use the Word Garden palette. */

.wd {
  --w-bg: #F3F3F3;
  --w-text: #242424;
  --w-icon: #424242;
  --w-sub: #616161;
  --w-line: #E1E1E1;
  --w-border: #C7C7C7;
  --w-hover: #EBEBEB;
  --w-press: #E0E0E0;
  --w-blue: #3466B3;
  --w-grey: #A6A6A6;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--w-bg);
  color: var(--w-text);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  user-select: none;
  -webkit-font-smoothing: auto;
  border: 1px solid #CFCFCF;
  border-radius: 8px;
}
.wd :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: default; }
.wd :focus-visible { outline: 2px solid #000; outline-offset: -2px; border-radius: 3px; }
.wd .wd-page:focus-visible, .wd .wr-combo-in:focus-visible { outline: none; }

/* ---------- icons (Fluent UI System Icons as masks) ---------- */
.wi {
  display: inline-block; flex: none; width: 16px; height: 16px; color: var(--w-icon);
  background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.wi.wi-svg { background: none; -webkit-mask-image: none; mask-image: none; }
.wi.wi-svg svg { display: block; width: 100%; height: 100%; }
.wi.wi-big { width: 32px; height: 32px; }
.wi-blue { color: #2A62B8; }
.wi-orange { color: #C9601E; }
.wi-red { color: #D13438; }
.wi-save { color: #A53DB3; }
.wi-mic { color: #2F7AD6; }
.wi-eraser { color: #7A3E9E; }
.is-disabled .wi, .is-disabled .wr-txt, .is-disabled .wr-blbl, .is-disabled .wr-glyph, .is-disabled.wd-qb .wi { color: var(--w-grey) !important; }
.is-disabled .wr-txt, .is-disabled .wr-blbl { color: var(--w-grey); }

/* ---------- title bar ---------- */
.wd-title { flex: none; height: 44px; display: flex; align-items: center; gap: 2px; padding-left: 10px; }
.wd-logo .wi { width: 18px; height: 18px; }
.wd-autosave { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px; margin-left: 10px; border-radius: 4px; font-size: 12px; }
.wd-toggle { position: relative; display: inline-flex; align-items: center; justify-content: flex-end; width: 42px; height: 20px; padding-right: 6px; border: 1px solid #5C5C5C; border-radius: 10px; font-size: 11px; background: #fff; }
.wd-toggle i { position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: #5C5C5C; }
.wd-qb { height: 30px; min-width: 28px; display: inline-grid; place-items: center; border-radius: 4px; }
.wd-qsplit { display: inline-flex; }
.wd-qarrow { min-width: 14px; }
.wd-qarrow .wi { width: 9px; height: 9px; }
.wd-cust .wi { width: 11px; height: 11px; }
.wd-name { margin-left: 16px; white-space: nowrap; font-size: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wd-search {
  margin: 0 auto; flex: 0 1 410px; min-width: 120px; height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border: 1px solid #D6D6D6; border-radius: 5px; background: #FBFBFB; color: var(--w-sub); box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.wd-tright { display: flex; align-items: center; margin-left: 12px; }
.wd-avatar { width: 30px; height: 30px; margin-right: 16px; border-radius: 50%; background: #5B3A2E; display: grid; place-items: center; }
.wd-avatar .wi { color: #fff; width: 16px; height: 16px; }
.wd-cap { width: 46px; height: 44px; display: grid; place-items: center; }
.wd-cap .wi { width: 10px; height: 10px; }
.wd-cap:hover { background: #E5E5E5; }
.wd-cap-close:hover { background: #C42B1C; color: #fff; }
.wd-cap-close:hover .wi { color: #fff; }
.wd-qb:hover, .wd-autosave:hover, .wd-search:hover { background: var(--w-hover); }
.wd-search:hover { background: #fff; }

/* ---------- tab row ---------- */
.wt-row { flex: none; height: 33px; display: flex; align-items: flex-end; padding: 0 6px 0 8px; }
.wt-tabs { display: flex; align-items: stretch; height: 30px; }
.wt-tab { position: relative; padding: 0 10px; font-size: 13px; border-radius: 4px 4px 0 0; }
.wt-tab:hover { background: var(--w-hover); }
.wt-tab.is-on { color: #1B1B1B; font-weight: 600; }
.wt-tab.is-on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 1px; background: var(--w-blue); }
.wt-right { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
.wt-pill { height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border: 1px solid #BDBDBD; border-radius: 4px; background: #fff; font-size: 12.5px; }
.wt-pill .wi { width: 15px; height: 15px; }
.wt-pill .wr-chev .wi { width: 8px; height: 8px; }
.wt-pill:hover { background: #F5F5F5; }
.wt-share { background: #3870C4; border-color: #3870C4; color: #fff; }
.wt-share .wi { color: #fff; }
.wt-share:hover { background: #3466B3; }

/* ---------- ribbon card ---------- */
.wr-wrap { flex: none; padding: 0 4px; container-type: inline-size; container-name: ribbon; position: relative; z-index: 3; }
.wr-card {
  position: relative; height: 100px; display: flex; align-items: stretch; overflow: hidden;
  background: #fff; border-radius: 6px; padding: 3px 26px 0 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .06);
}
.wr-group { position: relative; display: flex; flex-direction: column; flex: none; padding: 0 4px; transition: opacity .25s; }
.wr-group + .wr-group::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 6px; width: 1px; background: var(--w-line); }
.wr-grow { flex: 1 1 auto; min-width: 0; }
.wr-gbody { flex: 1; display: flex; align-items: flex-start; gap: 1px; padding-top: 2px; min-height: 0; }
.wr-glabel { position: relative; height: 19px; display: flex; align-items: center; justify-content: center; padding: 0 2px; font-size: 11.5px; color: #3B3B3B; white-space: nowrap; }
.wr-glabel:has(.wr-launch) { padding: 0 14px; }
.wr-launch { position: absolute; right: -2px; top: 3px; width: 14px; height: 14px; display: grid; place-items: center; border-radius: 2px; }
.wr-launch .wi { width: 9px; height: 9px; }
.wr-launch:hover { background: var(--w-hover); }
.wr-collapse { position: absolute; right: 6px; bottom: 8px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 3px; }
.wr-collapse .wi { width: 11px; height: 11px; }
.wr-collapse:hover { background: var(--w-hover); }

.wr-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 4px; white-space: nowrap; }
.wr-btn:hover, .wr-btn.is-open { background: var(--w-hover); }
.wr-btn:active { background: var(--w-press); }
.wr-btn.is-on { background: #E3E3E3; border-color: #ADADAD; }
.wr-btn.is-disabled:hover { background: transparent; }
.wr-chev { display: inline-grid; place-items: center; }
.wr-chev .wi { width: 9px; height: 9px; }

/* small buttons */
.wr-sm { height: 26px; min-width: 24px; padding: 0 2px; gap: 1px; }
.wr-sm.has-txt { justify-content: flex-start; padding: 0 5px 0 4px; gap: 6px; height: 24px; }
.wr-sm.wr-menu { padding-right: 2px; }
.wr-ic { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; }
.wr-ic > .wi { width: 18px; height: 18px; }
.wr-bar { position: absolute; left: 2px; right: 2px; bottom: 0; height: 4px; border-radius: 1px; }
.wr-ic:has(.wr-bar) > .wi { transform: translateY(-2px); }
.wr-glyph { font-family: "Segoe UI", Arial, sans-serif; font-size: 17px; line-height: 1; color: var(--w-icon); transform: translateY(-2px); }
.wr-split { display: inline-flex; align-items: center; border-radius: 4px; }
.wr-split .wr-split-main { border-radius: 4px 0 0 4px; }
.wr-split-arrow { width: 12px; height: 26px; border-radius: 0 4px 4px 0; }
.wr-split:hover .wr-btn { background: var(--w-hover); }
.wr-split:hover .wr-btn:hover { background: var(--w-press); }
.wr-split .wr-split-main.is-on { background: #E3E3E3; }
.wr-sep { width: 1px; height: 20px; margin: 0 3px; background: var(--w-line); align-self: center; flex: none; }
.wr-rows { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.wr-row { display: flex; align-items: center; gap: 1px; }
.wr-stack { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }

/* large buttons */
.wr-big { flex-direction: column; justify-content: flex-start; height: 74px; min-width: 40px; padding: 3px 3px 2px; gap: 3px; }
.wr-bic { display: grid; place-items: center; width: 34px; height: 34px; }
.wr-blbl { font-size: 12px; line-height: 1.17; white-space: nowrap; text-align: center; }
.wr-blbl .wr-chev { vertical-align: middle; margin-left: 1px; }
.wr-bglyph { font-family: "Cambria Math", Cambria, "Times New Roman", serif; font-size: 30px; line-height: 34px; color: var(--w-icon); }
.wr-big .wr-chev { margin-top: -1px; }
.wr-bigsplit { display: inline-flex; flex-direction: column; border-radius: 4px; }
.wr-bigsplit .wr-big-top { height: 42px; border-radius: 4px 4px 0 0; padding: 3px 6px 0; }
.wr-bigsplit .wr-big-bottom { height: 32px; flex-direction: column; border-radius: 0 0 4px 4px; padding: 0 4px; gap: 0; justify-content: flex-start; }
.wr-bigsplit:hover .wr-btn { background: var(--w-hover); }
.wr-bigsplit:hover .wr-btn:hover { background: var(--w-press); }

/* font name and size boxes */
.wr-combo { display: inline-flex; align-items: center; height: 24px; border: 1px solid #B9B9B9; border-radius: 4px; background: #fff; margin-right: 3px; overflow: hidden; }
.wr-combo:hover { border-color: #8A8A8A; }
.wr-combo:focus-within { border-color: var(--w-blue); }
.wr-combo-in { border: 0; outline: 0; padding: 0 0 0 5px; height: 22px; font: inherit; font-size: 12.5px; color: var(--w-text); background: transparent; min-width: 0; user-select: text; }
.wr-combo-font .wr-combo-in { width: 104px; }
.wr-combo-size .wr-combo-in { width: 24px; }
.wr-combo-arrow { width: 16px; height: 22px; display: grid; place-items: center; }
.wr-combo-arrow:hover { background: var(--w-hover); }

/* styles gallery */
.wr-gallery { display: flex; align-items: stretch; gap: 3px; height: 64px; margin-top: 4px; overflow: hidden; min-width: 0; }
.wr-gallery-tiles { display: flex; flex: 1 1 auto; min-width: 0; overflow: hidden; padding: 2px; gap: 2px; }
.wr-style { flex: none; width: 108px; height: 58px; display: grid; place-items: center; border: 2px solid transparent; border-radius: 3px; background: #fff; overflow: hidden; white-space: nowrap; }
.wr-style:hover { background: #F5F5F5; }
.wr-style.is-on { border: 1px solid #8A8A8A; box-shadow: inset 0 0 0 1px #C8C8C8; }
.wr-style.is-clipped { display: none; }
.wr-gallery-more { flex: none; width: 26px; border: 1px solid #8A8A8A; border-radius: 4px; }
.wr-gallery-more .wi { width: 10px; height: 10px; }
.wr-set { width: 64px; flex-direction: column; gap: 3px; display: flex; align-items: stretch; padding: 6px; }
.wr-set b { font-size: 11px; font-weight: 600; }
.wr-set i { display: block; height: 3px; background: #D0D0D0; }

/* layout tab indent/spacing spinners */
.wr-spincols { display: flex; gap: 16px; padding: 4px 6px 0; }
.wr-spinhead { font-size: 12px; margin-bottom: 4px; }
.wr-spinrow { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 26px; }
.wr-spinlbl { display: flex; align-items: center; gap: 5px; min-width: 66px; }
.wr-spin { display: inline-flex; align-items: center; width: 80px; height: 22px; border: 1px solid #B9B9B9; border-radius: 3px; background: #fff; }
.wr-spin input { width: 60px; border: 0; outline: 0; font: inherit; padding-left: 5px; background: transparent; }
.wr-spinbtns { display: flex; flex-direction: column; }
.wr-spinbtns .wi { width: 8px; height: 8px; }
.wr-check { gap: 6px; height: 22px; padding: 0 4px; }
.wr-box { width: 13px; height: 13px; border: 1px solid #616161; border-radius: 2px; background: #fff; }

/* responsive ribbon: Word folds groups when the window is narrow */
.narrow-only { display: none; }
@container ribbon (max-width: 1340px) {
  .wr-group[data-group="home.editing"] .wide-only { display: none; }
  .wr-group[data-group="home.editing"] .narrow-only { display: block; }
}
@container ribbon (max-width: 1190px) {
  .wr-group[data-group="home.styles"] .wide-only { display: none; }
  .wr-group[data-group="home.styles"] .narrow-only { display: block; }
  .wr-group[data-group="home.styles"].wr-grow { flex: none; }
}
@container ribbon (max-width: 1360px) {
  .wr-group[data-group="home.clipboard"] .wr-txt { display: none; }
  .wr-group[data-group="home.clipboard"] .wr-sm.has-txt { padding: 0 3px; }
}
@container ribbon (max-width: 1170px) {
  .wr-big { min-width: 36px; padding-left: 2px; padding-right: 2px; }
  .wr-blbl { font-size: 11.5px; }
  .wr-group { padding: 0 3px; }
}

/* ---------- canvas and page ---------- */
.wd-canvas { position: relative; flex: 1; min-height: 0; overflow: auto; background: var(--w-bg); padding: 10px 0 24px; scrollbar-width: thin; }
.wd-pagewrap { width: max-content; margin: 0 auto; padding: 0 20px; }
.wd-page {
  position:relative; isolation:isolate;
  box-sizing: border-box; width: 8.5in; min-height: 11in; padding: 1in; background: #fff; border: 1px solid #B8B8B8;
  outline: none; cursor: text; color: #000; caret-color: #000; user-select: text; -webkit-user-select: text;
  font-family: "Aptos", "Segoe UI", Calibri, Arial, sans-serif; font-size: 12pt; line-height: 1.38;
}
.wd-page ::selection { background: #C8C8C8; }
.wd-p { position: relative; margin: 0; white-space: pre-wrap; overflow-wrap: break-word; tab-size: 0.5in; min-height: 1em; }
.wd-p[data-marker]::before {
  content: attr(data-marker); position: absolute; left: var(--wd-mk-left); top: 0;
  font-family: var(--wd-mk-font); font-size: var(--wd-mk-size); color: var(--wd-mk-colour); user-select: none; pointer-events: none;
}
.wd-page.is-marks .wd-p::after { content: "¶"; color: #5A78A8; font-family: Arial, sans-serif; font-size: 11pt; }
.wd.is-painting .wd-page { cursor: copy; }

/* ---------- status bar ---------- */
.wd-status { flex: none; height: 24px; display: flex; align-items: center; gap: 2px; padding: 0 6px; background: #F3F3F3; font-size: 11.5px; color: #3B3B3B; }
.wd-sb { height: 22px; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 3px; white-space: nowrap; }
.wd-sb:hover { background: #E3E3E3; }
.wd-sb.is-on { background: #E3E3E3; }
.wd-sb .wi { width: 14px; height: 14px; }
.wd-sright { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.wd-zoom { display: flex; align-items: center; gap: 2px; margin-left: 10px; }
.wd-zb { width: 20px; padding: 0; justify-content: center; font-size: 15px; }
.wd-zr { width: 110px; height: 14px; margin: 0 2px; -webkit-appearance: none; appearance: none; background: transparent; }
.wd-zr::-webkit-slider-runnable-track { height: 1px; background: #6B6B6B; }
.wd-zr::-webkit-slider-thumb { -webkit-appearance: none; width: 5px; height: 13px; margin-top: -6px; border-radius: 1px; background: #4A4A4A; }
.wd-zr::-moz-range-track { height: 1px; background: #6B6B6B; }
.wd-zr::-moz-range-thumb { width: 5px; height: 13px; border: 0; border-radius: 1px; background: #4A4A4A; }
.wd-zl { min-width: 42px; justify-content: flex-end; }

/* ---------- menus, mini toolbar, dialogs ---------- */
.wm-layer { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.wm-layer > * { pointer-events: auto; }
.wm-menu {
  position: absolute; min-width: 180px; max-height: calc(100% - 12px); overflow: auto; padding: 4px;
  background: #fff; border: 1px solid #C2C2C2; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); font-size: 12px;
}
.wm-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 3px 10px 3px 6px; border-radius: 4px; text-align: left; white-space: nowrap; }
.wm-item:hover { background: #F0F0F0; }
.wm-item.is-disabled { color: var(--w-grey); }
.wm-item.is-disabled .wi { color: var(--w-grey); }
.wm-item.is-inert:hover { background: none; }
.wm-lead { width: 22px; display: grid; place-items: center; flex: none; }
.wm-ck { color: #1B1B1B; font-weight: 700; }
.wm-label { flex: 1; }
.wm-sub .wi { width: 9px; height: 9px; }
.wm-auto { width: 14px; height: 14px; border: 1px solid #8A8A8A; }
.wm-sep { height: 1px; margin: 4px 2px 4px 34px; background: var(--w-line); }
.wm-head { padding: 6px 8px 4px; font-weight: 600; color: #2B2B2B; background: #F5F5F5; border-radius: 3px; margin: 2px 0; }
.wm-pal { display: grid; grid-template-columns: repeat(var(--cols), 18px); gap: 3px; padding: 4px 8px 6px; }
.wm-pal.gap-first > :nth-child(-n+10) { margin-bottom: 4px; }
.wm-sw { width: 18px; height: 18px; border: 1px solid #C8C8C8 !important; }
.wm-sw:hover { outline: 2px solid #E0A030; outline-offset: 1px; }
.wm-tiles { display: grid; grid-template-columns: repeat(4, 64px); gap: 4px; padding: 4px 8px 6px; }
.wm-tile { height: 64px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; border: 1px solid #D6D6D6 !important; font-size: 11px; }
.wm-tile:hover { border-color: #E0A030 !important; background: #FFF8EC; }
.wm-glyph { font-size: 22px; font-family: Arial, "Segoe UI Symbol", sans-serif; }
.wm-icons { display: flex; gap: 4px; padding: 2px 8px 4px; }
.wm-icons.is-indent { padding-left: 34px; }
.wm-iconbtn { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent !important; border-radius: 3px; }
.wm-iconbtn:hover { background: #F0F0F0; border-color: #C8C8C8 !important; }
.wm-iconbtn .wi { width: 22px; height: 22px; }
.wm-iconbtn.is-disabled .wi { color: var(--w-grey); }
.wm-a { position: absolute; right: 3px; bottom: 2px; font-size: 10px; font-weight: 700; background: #fff; line-height: 1; }
.wm-searchbox { display: block; width: calc(100% - 12px); margin: 4px 6px 6px; height: 26px; padding: 0 8px; text-align: left; border: 1px solid #8F8F8F !important; border-radius: 3px; color: #707070; }
.wm-context { border-color: #747474; border-radius: 4px; min-width: 220px; font-size: 13px; }
.wm-context .wm-item { min-height: 28px; }
.wm-undolist { min-width: 200px; }
.wm-fx-outline { color: #fff; -webkit-text-stroke: .7px #000; font-weight: 700; }
.wm-fx-shadow { text-shadow: 1.5px 1.5px 2px rgba(0, 0, 0, .45); }
.wm-fx-glow { text-shadow: 0 0 4px #8DB8F2, 0 0 8px #8DB8F2; }

.wm-mini {
  position: absolute; display: flex; flex-direction: column; gap: 4px; padding: 5px 6px; background: #fff;
  border: 1px solid #D0D0D0; border-radius: 4px; box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}
.wm-mini .wr-big { height: 54px; min-width: 40px; }
.wm-mini .wr-bic { width: 26px; height: 26px; }
.wm-mini .wr-bic .wi-big { width: 24px; height: 24px; }
.wm-mini > .wr-row:first-child { align-items: flex-start; }
.wm-mini .wm-mini-row2 { margin-top: -30px; width: max-content; }

.wd-dlg-back { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .06); z-index: 5; }
.wd-dlg { max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow: auto; background: #fff; border: 1px solid #ACACAC; border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); font-size: 12px; }
.wd-dlg-title { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 4px 0 14px; }
.wd-dlg-x { width: 32px; height: 28px; display: grid; place-items: center; border-radius: 4px; }
.wd-dlg-x:hover { background: #C42B1C; }
.wd-dlg-x:hover .wi { color: #fff; }
.wd-dlg-body { padding: 4px 14px 10px; display: flex; flex-direction: column; gap: 8px; user-select: text; }
.wd-dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px 12px; }
.wd-dbtn { min-width: 76px; height: 26px; padding: 0 10px; border: 1px solid #ADADAD !important; border-radius: 4px; background: #FDFDFD !important; }
.wd-dbtn:hover { background: #F0F0F0 !important; }
.wd-dbtn.is-primary { border-color: var(--w-blue) !important; box-shadow: inset 0 0 0 1px var(--w-blue); }
.wd-tabs { display: flex; gap: 14px; border-bottom: 1px solid var(--w-line); }
.wd-tabs span { padding: 4px 2px; }
.wd-tabs .is-on { border-bottom: 2px solid var(--w-blue); font-weight: 600; }
.wd-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wd-fld { display: flex; flex-direction: column; gap: 3px; }
.wd-fld input { width: 100%; box-sizing: border-box; height: 24px; border: 1px solid #ADADAD; border-radius: 3px; padding: 0 6px; font: inherit; background: #fff; color: var(--w-text); min-width: 0; }
.wd-fld input[readonly] { background: #FAFAFA; }
.wd-fs { border: 1px solid var(--w-line); border-radius: 4px; padding: 6px 10px 8px; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.wd-fs legend { padding: 0 4px; }
.wd-fs .wd-grid3 { width: 100%; }
.wd-chk { display: flex; align-items: center; gap: 5px; }
.wd-preview { height: 56px; display: grid; place-items: center; border: 1px solid var(--w-line); font-size: 20px; overflow: hidden; white-space: nowrap; }
.wd-radios { display: flex; gap: 20px; }
.wd-small { margin: 0; color: #3B3B3B; }
.wd-stats { border-collapse: collapse; width: 100%; }
.wd-stats td { padding: 3px 0; }
.wd-stats td:last-child { text-align: right; }
.wd-clipitem { display: block; width: 100%; text-align: left; padding: 8px; border: 1px solid #D6D6D6 !important; border-radius: 4px; white-space: pre-wrap; }
.wd-clipitem:hover { background: #F0F6FD !important; }
.wd-stylegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.wd-stylegrid .wr-style { width: 100%; border-color: #E3E3E3; }
.wd-linklist, .wd-panelist { display: flex; flex-direction: column; }
.wd-linklist button, .wd-panelist button { text-align: left; padding: 5px 6px; border-radius: 3px; display: flex; justify-content: space-between; }
.wd-linklist button:hover, .wd-panelist button:hover { background: #F0F0F0; }
.wd-dlg-tip { margin: 4px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--teal-l, #E3F0EE); color: var(--ink, #17324D); font-family: var(--font); font-size: 15px; font-weight: 600; line-height: 1.3; }
.wd-dlg-tip .vi { font-size: 13px; }

/* ---------- Backstage ---------- */
.bs { padding-top:44px; position: absolute; inset: 0; z-index: 30; display: flex; background: #F7F7F7; }
.bs-nav { width: 132px; flex: none; display: flex; flex-direction: column; padding: 8px 6px; background: #F3F3F3; border-right: 1px solid #E5E5E5; overflow: auto; }
.bs-nav hr { border: 0; border-top: 1px solid #DCDCDC; margin: 8px 6px; width: calc(100% - 12px); }
.bs-back { width: 32px; height: 32px; margin: 4px 0 10px 6px; border: 1px solid #9A9A9A !important; border-radius: 50% !important; display: grid; place-items: center; }
.bs-item { display: flex; align-items: center; gap: 10px; height: 40px; flex-shrink:0; padding: 0 10px; border-radius: 4px; font-size: 13.5px; text-align: left; }
.bs-item:hover { background: #E6E6E6; }
.bs-item.is-on { background: #E1E1E1; box-shadow: inset 0 0 0 1px #5C5C5C; }
.bs-spacer { flex: 1; }
.bs-main { flex: 1; overflow: auto; padding: 14px 44px; }
.bs-h1 { font-size: 26px; font-weight: 400; margin: 0 0 18px; }
.bs-sec { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.bs-tiles { display: flex; gap: 14px; margin: 10px 0 24px; }
.bs-tile { width: 120px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
.bs-thumb { width: 104px; height: 134px; background: #fff; border: 1px solid #CFCFCF; }
.bs-tile:hover .bs-thumb { border-color: var(--w-blue); }
.bs-search { width: 440px; max-width: 100%; height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #C8C8C8; border-radius: 5px; background: #fff; color: #6B6B6B; }
.bs-tabsrow { display: flex; gap: 22px; margin: 18px 0 8px; font-size: 13px; }
.bs-tabsrow .is-on { border-bottom: 2px solid var(--w-blue); font-weight: 600; padding-bottom: 3px; }
.bs-list { font-size: 12.5px; }
.bs-listhead, .bs-row { display: grid; grid-template-columns: 30px 1fr 140px; align-items: center; padding: 6px 4px; }
.bs-listhead { grid-template-columns: 1fr 140px; padding-left: 34px; color: var(--w-sub); border-bottom: 1px solid #E3E3E3; }
.bs-note { font-family: var(--font); font-size: 20px; font-weight: 600; color: var(--ink, #17324D); }
.bs-note .vi { font-size: 15px; }

/* ================= game layer (Word Garden palette, bilingual) ================= */
.wg-toast {
  position: absolute; left: 50%; bottom: 40px; transform: translate(-50%, 16px); opacity: 0; transition: opacity .25s, transform .25s;
  display: flex; align-items: center; gap: 18px; max-width: min(860px, calc(100% - 40px)); padding: 12px 14px 12px 20px;
  background: #fff; border-left: 8px solid var(--orange, #F29B38); border-radius: 16px; box-shadow: 0 14px 40px rgba(23, 50, 77, .22);
  font-family: var(--font); font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink, #17324D); user-select: none;
}
.wg-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
.wg-toast.is-ok { border-left-color: var(--leaf, #5E9E4F); }
.wg-toast .vi { font-size: 16px; }
.wg-toast-undo {
  flex: none; min-height: 58px; min-width: 140px; padding: 6px 20px !important; border-radius: 999px !important; cursor: pointer !important;
  background: var(--teal, #2F7370) !important; color: #fff !important; font-size: 21px !important; font-weight: 800 !important; line-height: 1.1;
}
.wg-toast-undo .vi { color: #D5ECEA; font-size: 13px; }
.wg-note, .wg-hint {
  position: absolute; max-width: 440px; padding: 12px 16px; border-radius: 14px; background: var(--ink, #17324D); color: #fff;
  font-family: var(--font); font-size: 18px; font-weight: 700; line-height: 1.3; box-shadow: var(--sh); white-space: normal;
}
.wg-note .vi, .wg-hint .vi { color: #D6E2EE; font-size: 14px; }
.wg-hint { display: flex; align-items: flex-start; gap: 10px; z-index: 6; animation: wgIn .3s both; }
.wg-hint-ic { font-size: 22px; line-height: 1.2; }
.wg-hint-x { margin-left: 4px; width: 32px; height: 32px; border-radius: 50%; color: #fff !important; font-size: 22px !important; line-height: 1; cursor: pointer !important; flex: none; }
.wg-hint-x:hover { background: rgba(255, 255, 255, .15) !important; }
.wg-hint.has-arrow::before { content: ""; position: absolute; top: -9px; left: var(--wg-arrow, 30px); margin-left: -9px; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--ink, #17324D); }
@keyframes wgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.wd.is-spot .wr-group:not(.is-spot-target), .wd.is-spot .wd-title, .wd.is-spot .wt-row, .wd.is-spot .wd-status { opacity: .4; }
.wd.is-spot .wr-group:not(.is-spot-target):hover { opacity: .85; }
.wr-group.is-spot-target {
  z-index: 2; border-radius: 8px; background: #fff;
  box-shadow: 0 0 0 3px #FFD18A, 0 0 0 8px rgba(242, 155, 56, .25); animation: wgGlow 2.4s ease-in-out infinite;
}
.wr-group.is-spot-target::before, .wr-group.is-spot-target + .wr-group::before { display: none; }
.wr-card:has(.is-spot-target) { overflow: visible; }
.wr-btn.is-spot-btn, .wr-split:has(.is-spot-btn) { box-shadow: 0 0 0 3px var(--orange, #F29B38); border-radius: 4px; background: #FFF0D9; }
@keyframes wgGlow { 50% { box-shadow: 0 0 0 3px #FFD18A, 0 0 0 12px rgba(242, 155, 56, .14), 0 0 26px 8px rgba(242, 155, 56, .25); } }
.wg-spotlayer { position: absolute; inset: 0; pointer-events: none; z-index: 41; }

.wg-marker {
  position: absolute; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  background: var(--orange, #F29B38); color: #3B2200; font: 800 20px var(--font); box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.wg-demo { position: absolute; inset: 0; z-index: 45; pointer-events: none; transition: opacity .45s; }
.wg-demo.is-fading { opacity: 0; }
.wg-blocker { position: absolute; inset: 0; pointer-events: auto; cursor: progress; }
.wg-demohl { position: absolute; background: rgba(70, 130, 210, .32); border-radius: 2px; }
.wg-ghost { position: absolute; width: 30px; height: 36px; transition-property: left, top; transition-timing-function: ease-in-out; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.wg-ghost .wi { width: 30px; height: 36px; }
.wg-ghost-lbl { position: absolute; left: 26px; top: 28px; background: var(--orange, #F29B38); color: #3B2200; font: 800 15px var(--font); border-radius: 8px; padding: 2px 9px; white-space: nowrap; }
.wg-ghost.is-press::after { content: ""; position: absolute; left: -12px; top: -12px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--orange, #F29B38); animation: wgRing .55s ease-out both; }
@keyframes wgRing { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.wd .is-demo-press { background: #FFE3B8 !important; border-color: var(--orange, #F29B38) !important; transform: scale(.93); }
.wg-caption {
  position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); max-width: min(720px, calc(100% - 40px));
  padding: 12px 20px; border-radius: 14px; background: var(--ink, #17324D); color: #fff; text-align: center;
  font-family: var(--font); font-size: 20px; font-weight: 700; line-height: 1.3; box-shadow: var(--sh);
}
.wg-caption .vi { color: #D6E2EE; font-size: 15px; }
.wg-yourturn {
  position: absolute; z-index: 46; width: 380px; max-width: calc(100% - 24px); padding: 16px 18px; border-radius: 16px;
  background: var(--ink, #17324D); color: #fff; font-family: var(--font); font-size: 20px; font-weight: 700; line-height: 1.3; box-shadow: var(--sh); animation: wgIn .3s both;
}
.wg-yourturn p { margin: 0 0 12px; }
.wg-yourturn .vi { color: #D6E2EE; font-size: 15px; }
.wg-yourturn-btns { display: flex; flex-direction: column; gap: 8px; }
.wg-btn { min-height: 56px; width: 100%; border-radius: 999px !important; font-family: var(--font) !important; font-size: 19px !important; font-weight: 800 !important; line-height: 1.1; cursor: pointer !important; padding: 4px 16px !important; }
.wg-btn .vi { font-size: 13px; }
.wg-btn-ok { background: var(--orange, #F29B38) !important; color: #3B2200 !important; }
.wg-btn-ok .vi { color: #3B2200; }
.wg-btn-again { background: transparent !important; color: #fff !important; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6); }
.wg-again {
  position: absolute; right: 22px; bottom: 36px; z-index: 44; min-height: 56px; padding: 6px 20px !important; border-radius: 999px !important;
  background: #fff !important; color: var(--teal-d, #245A58) !important; box-shadow: 0 0 0 2px var(--teal, #2F7370), var(--sh-sm);
  font-family: var(--font) !important; font-size: 19px !important; font-weight: 800 !important; line-height: 1.1; cursor: pointer !important;
}
.wg-again .vi { font-size: 13px; }
.wg-help-glow { animation: wgHelpGlow 1.6s ease-in-out infinite; border-color: var(--orange, #F29B38) !important; background: #FFF3DF !important; }
@keyframes wgHelpGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(242, 155, 56, .55); } 50% { box-shadow: 0 0 0 10px rgba(242, 155, 56, 0); } }

@media (prefers-reduced-motion: reduce) {
  .wr-group.is-spot-target, .wg-help-glow { animation: none; }
  .wg-ghost { transition: none; }
}

/* ---------- free practice screen ---------- */
.wg-free { height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; overflow: hidden; }
.wg-free-bar {
  flex: none; display: flex; align-items: center; gap: 16px; min-height: 60px; padding: 4px 320px 4px 18px;
  background: #fff; border-radius: 18px; box-shadow: var(--sh-sm);
}
.wg-free-ico { font-size: 28px; }
.wg-free-bar h1 { font-size: 24px; line-height: 1.1; white-space: nowrap; }
.wg-free-bar h1 .vi { font-size: 13px; }
.wg-free-bar p { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; color: var(--teal-d); line-height: 1.2; }
.wg-free-bar p .vi { font-size: 13px; color: var(--ink-2); }
.wg-free-bar .btn-sm { min-height: 50px; padding: 4px 18px; font-size: 17px; flex: none; text-decoration: none; color: var(--ink); }
.wg-free-host { flex: 1; min-height: 0; }
.wm-hint { color: var(--w-sub); font-size: 11px; }
.wm-menu:has([data-cmd="home.font.size"]) { min-width: 70px; }
.wr-gfold { display: none; flex: 1; align-items: flex-start; padding-top: 2px; }
.wr-group.is-folded .wr-gbody { display: none; }
.wr-group.is-folded .wr-gfold { display: flex; }
.wr-group.is-folded.wr-grow { flex: none; }
.wm-fold { padding: 4px 6px 8px; overflow: visible; }
.wm-fold > .wr-gbody { display: flex; align-items: flex-start; gap: 1px; height: 78px; }
.bs-noic { width: 16px; flex: none; }
/* B / I / U / Aa drawn as text, like Word's own ribbon glyphs */
.wr-glyph.g-b { font-weight: 700; font-size: 15px; transform: none; }
.wr-glyph.g-i { font-family: "Segoe UI", Georgia, serif; font-style: italic; font-size: 16px; transform: none; }
.wr-glyph.g-u { font-size: 15px; text-decoration: underline; text-underline-offset: 2px; transform: none; }
.wr-glyph.g-aa { font-size: 14px; transform: none; letter-spacing: -.5px; }
.wr-ic:has(.g-b, .g-i, .g-u, .g-aa) { width: 18px; }
.wr-style { width: 100px; }
.wi-mic { color: #3B82D6; }
.wi-green { color: #2E8B57; }
.wr-glyph.g-pil { font-size: 17px; font-weight: 700; transform: none; font-family: "Segoe UI", Arial, sans-serif; }
.wd-initials { color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; }
.wm-leadglyph { font-size: 19px; line-height: 1; color: var(--w-icon); font-family: "Segoe UI", Arial, sans-serif; }
.wm-item u { text-underline-offset: 2px; }
.wm-mini .wr-combo-font .wr-combo-in { width: 86px; }
.wm-mini .wr-big { min-width: 34px; padding: 2px 3px; }
.wm-mini .wr-sep { margin: 0 2px; }

/* ---------- Backstage Save As + the Save As dialog (Browse) ---------- */
.sa-page { display: flex; gap: 0; min-height: 0; }
.sa-places { width: 290px; flex: none; padding: 4px 18px 0 0; border-right: 1px solid #DCDCDC; display: flex; flex-direction: column; gap: 2px; }
.sa-places hr { border: 0; border-top: 1px solid #DCDCDC; margin: 8px 4px; width: calc(100% - 8px); }
.sa-place { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 12px; border-radius: 4px; font-size: 15px; text-align: left; color: #242424; }
.sa-place:hover { background: #E6E6E6; }
.sa-place:focus-visible { outline: 2px solid #000; outline-offset: -2px; }
.sa-pic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; }
.sa-pic .wi { width: 26px; height: 26px; }
.sa-pane { flex: 1; min-width: 0; padding: 6px 28px; }
.sa-lead { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--ink, #17324D); display: flex; flex-direction: column; gap: 6px; max-width: 460px; }
.sa-lead .vi { font-size: 15px; font-weight: 500; }
.sa-arrow { color: var(--orange, #F29B38); font-size: 22px; line-height: 1; }

.sa-scrim { position: absolute; inset: 0; z-index: 40; background: rgba(0, 0, 0, .28); display: grid; place-items: center; }
.sa-dlg { width: min(780px, calc(100% - 24px)); height: min(560px, calc(100% - 20px)); display: flex; flex-direction: column; background: #fff; border: 1px solid #8A8A8A; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); overflow: hidden; font-size: 12.5px; color: #1A1A1A; font-family: "Segoe UI", system-ui, sans-serif; }
.sa-dlg button { font: inherit; }
.sa-tb { height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding-left: 8px; background: #fff; }
.sa-tb-ic .wi { width: 18px; height: 18px; }
.sa-tb-t { flex: 1; }
.sa-x { width: 46px; height: 32px; display: grid; place-items: center; }
.sa-x:hover { background: #C42B1C; color: #fff; }
.sa-x .wi { width: 10px; height: 10px; }
.sa-addr { height: 40px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 10px 6px; }
.sa-ab { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; }
.sa-ab:hover:not(:disabled) { background: #E8E8E8; }
.sa-ab:disabled { opacity: .35; }
.sa-up .wi { transform: rotate(-90deg); }
.sa-path { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid #D0D0D0; border-radius: 4px; background: #fff; font-size: 13px; }
.sa-path i { font-style: normal; color: #6B6B6B; }
.sa-pcrumb { width: 18px; height: 18px; display: grid; place-items: center; }
.sa-pcrumb svg, .sa-n svg { width: 18px; height: 18px; }
.sa-search { width: 190px; flex: none; height: 28px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border: 1px solid #D0D0D0; border-radius: 4px; color: #5E5E5E; }
.sa-cmd { height: 34px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 12px; background: #F9F9F9; border-top: 1px solid #EFEFEF; }
.sa-c { height: 26px; padding: 0 6px; border-radius: 4px; font-size: 13px; }
.sa-c:hover { background: #E8E8E8; }
.sa-c i { font-style: normal; font-size: 10px; }
.sa-body { flex: 1; min-height: 0; display: flex; border-top: 1px solid #E5E5E5; }
.sa-nav { width: 178px; flex: none; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; border-right: 1px solid #EDEDED; }
.sa-dlg.no-nav .sa-nav { display: none; }
.sa-n { display: flex; align-items: center; gap: 10px; min-height: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; font-size: 13px; text-align: left; }
.sa-n:hover { background: #F0F0F0; }
.sa-n.is-on { background: #CCE4F7; border-color: #1A1A1A; }
.sa-n .wi { width: 18px; height: 18px; }
.sa-files { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sa-fh, .sa-r { display: grid; grid-template-columns: minmax(0, 1fr) 132px 150px 64px; align-items: center; column-gap: 8px; }
.sa-fh { height: 30px; flex: none; padding: 0 10px 0 28px; color: #5E5E5E; border-bottom: 1px solid #EDEDED; }
.sa-fl { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 0; }
.sa-r { height: 30px; padding: 0 10px 0 8px; border: 1px solid transparent; font-size: 13px; cursor: default; }
.sa-r:hover { background: #EEF5FC; }
.sa-r.is-on { background: #CCE4F7; }
.sa-r > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-rn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sa-fold { width: 20px; height: 16px; flex: none; }
.sa-docic .wi { width: 20px; height: 20px; }
.sa-empty { margin: 36px 0 0; text-align: center; color: #6B6B6B; font-size: 14px; }
.sa-empty .vi { font-size: 12px; }
.sa-form { flex: none; padding: 10px 14px 4px; background: #F0F0F0; border-top: 1px solid #E5E5E5; display: grid; gap: 6px; }
.sa-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 8px; }
.sa-lbl { text-align: right; font-size: 13px; }
.sa-name, .sa-type { height: 30px; border: 1px solid #8A8A8A; border-radius: 3px; background: #fff; padding: 0 8px; font: inherit; font-size: 14px; min-width: 0; }
.sa-name:focus { outline: 2px solid #0F6CBD; outline-offset: -1px; }
.sa-note { margin: 0 0 0 104px; font-size: 12.5px; color: #3B4B5C; }
.sa-note .vi { font-size: 11.5px; }
.sa-form:has(.sa-msg:not(:empty)) .sa-note { display: none; }
.sa-msg:empty { display: none; }
.sa-msg { margin: 0 0 0 104px; font-size: 13.5px; font-weight: 600; color: #8A4B00; }
.sa-msg .vi { font-size: 12px; font-weight: 500; }
.sa-foot { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #F0F0F0; }
.sa-grow { flex: 1; }
.sa-hide { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 4px; }
.sa-hide:hover { background: #E3E3E3; }
.sa-hide i { font-style: normal; font-size: 10px; }
.sa-btn { min-width: 96px; height: 32px; padding: 0 14px; border: 1px solid #ADADAD; border-radius: 4px; background: #FDFDFD; font-size: 14px; }
.sa-btn:hover { background: #E8F1FA; border-color: #0F6CBD; }
.sa-save { border: 2px solid #0F6CBD; }
.sa-dlg button:focus-visible { outline: 2px solid #0F6CBD; outline-offset: 1px; }
@media (max-height: 640px) { .sa-note { display: none; } }

/* Hide native caret during demo animations */
.wd.is-demo .wd-page { caret-color: transparent; }

/* Mission spelling uses the model's fixed vocabulary, independent of browser proofing. */
.wd-spelling { text-decoration: underline wavy #d21b29; text-decoration-skip-ink: none; text-underline-offset: 3px; }
.wd-caps { padding: 0 7px; font-weight: 600; }
.wd-caps[hidden] { display: none; }

/* Tables use normal model paragraphs inside native cells. */
.wd-table { width:100%; table-layout:fixed; border-collapse:collapse; margin:8pt 0; }
.wd-table td { border:1px solid #333; padding:4px 6px; vertical-align:top; min-width:24px; }
.wd-table .wd-p { min-height:1.38em; }
.wm-table-grid { display:grid; grid-template-columns:repeat(10,22px); gap:3px; padding:8px; }
.wm-table-grid button { width:22px; height:22px; background:white; border:1px solid #8b8b8b; cursor:pointer; }
.wm-table-grid button.is-on,.wm-table-grid button:focus-visible { background:#dceafb; border-color:#3466b3; }
.wt-tab[hidden] { display:none; }

.wd-picture { display:inline-block; position:relative; vertical-align:bottom; margin:4px 0; user-select:none; cursor:default; }
.wd-picture.is-square { float:left; margin:4px 16px 12px 0; }
.wd-picture img { display:block; width:100%; height:100%; pointer-events:none; }
.wd-picture.is-selected { outline:1px solid #3466b3; }
.wd-picture-handle { border-radius:50%; display:none; position:absolute; z-index:2; width:9px; height:9px; padding:0; background:white; border:1px solid #3466b3; transform:translate(-50%,-50%); }
.wd-picture.is-selected .wd-picture-handle { display:block; }
.wd-picture-handle[data-handle=n] {left:50%;top:0;cursor:ns-resize;}
.wd-picture-handle[data-handle=ne] {left:100%;top:0;cursor:nesw-resize;}
.wd-picture-handle[data-handle=e] {left:100%;top:50%;cursor:ew-resize;}
.wd-picture-handle[data-handle=se] {left:100%;top:100%;cursor:nwse-resize;}
.wd-picture-handle[data-handle=s] {left:50%;top:100%;cursor:ns-resize;}
.wd-picture-handle[data-handle=sw] {left:0;top:100%;cursor:nesw-resize;}
.wd-picture-handle[data-handle=w] {left:0;top:50%;cursor:ew-resize;}
.wd-picture-handle[data-handle=nw] {left:0;top:0;cursor:nwse-resize;}
.wd-dbtn:disabled { color: #A0A0A0; border-color: #CCCCCC !important; box-shadow: none; cursor: default; }
.wd-dbtn.is-spot-btn { box-shadow: 0 0 0 3px var(--orange, #F29B38); background: #FFF0D9 !important; }
.wd-page::after {content:"";display:block;clear:both;}

/* Floating pictures remain hit-testable between the text, even behind it. */
.wd-page.has-floating .wd-p { pointer-events:none; }
.wd-page.has-floating .wd-r, .wd-picture { pointer-events:auto; }
.wd-page.has-floating .wd-r { position:relative; z-index:1; }
.wd-picture.is-front, .wd-picture.is-behind { position:absolute; margin:0; cursor:move; }
.wd-picture.is-front { z-index:2; }
.wd-picture.is-behind { z-index:0; }

.bs-title { position:absolute; inset:0 0 auto; height:44px; display:flex; align-items:center; gap:12px; padding:0 16px; background:#f3f3f3; font-size:12px; }
.bs-caption { margin-left:auto; display:flex; gap:28px; }
.bs-caption .wi { width:12px; height:12px; }

/* ---------- Contextual tabs, picture menu and table tabs (classroom screenshots, 2026-10-26) ---------- */
/* Contextual tab names are blue in Word 365. */
.wt-tab[data-tab="picture"], .wt-tab[data-tab="tabledesign"], .wt-tab[data-tab="table"] { color: #2B579A; }
.wt-tab[data-tab="picture"].is-on, .wt-tab[data-tab="tabledesign"].is-on, .wt-tab[data-tab="table"].is-on { color: #1B4F96; }
.wr-check.is-checked .wr-box { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.6-5' fill='none' stroke='%23242424' stroke-width='1.4'/%3E%3C/svg%3E") center/11px no-repeat; }
.wr-rows .wr-check { min-width: 116px; height: 20px; justify-content: flex-start; font-size: 12px; }
[data-group="tabledesign.options"] .wr-rows { gap: 2px; padding-top: 2px; }
/* Table Styles gallery: small grid tiles in each style's colour. */
.wr-tstyles { height: 60px; max-width: 760px; }
.wr-tstyle { flex: none; width: 52px; height: 44px; margin: 6px 2px 0; padding: 3px; border: 1px solid transparent; border-radius: 3px; background: #fff; }
.wr-tstyle:hover { border-color: #C7C7C7; }
.wr-tstyle i { display: block; width: 100%; height: 100%;
  background: linear-gradient(var(--c) 0 0) top / 100% 5px no-repeat,
    repeating-linear-gradient(0deg, transparent 0 7px, color-mix(in srgb, var(--c) 45%, #fff) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 8px, color-mix(in srgb, var(--c) 45%, #fff) 8px 9px); }
.wr-tstyle.is-grid i { border: 1px solid #000;
  background: repeating-linear-gradient(0deg, transparent 0 7px, #000 7px 8px), repeating-linear-gradient(90deg, transparent 0 8px, #000 8px 9px); }
/* Cell Size measure boxes and the 3x3 cell alignment buttons. */
.wr-measure { gap: 4px; }
.wr-measure .wr-spin { width: 86px; }
.wr-cellalign { display: grid; grid-template-columns: repeat(3, 26px); gap: 2px; align-content: center; margin: 4px 4px 0; }
.wr-ca { width: 26px; height: 22px; padding: 3px; }
.wr-ca.is-on { box-shadow: inset 0 0 0 1px #8A8A8A; background: #E6E6E6; }
.wr-ca-cell { display: block; width: 100%; height: 100%; border: 1px solid #616161; position: relative; }
.wr-ca-cell::after { content: ""; position: absolute; width: 8px; height: 1.5px; background: #2E75B6;
  left: calc(var(--c) * 4px + 2px); top: calc(var(--r) * 5px + 2px); box-shadow: 0 2.5px 0 #2E75B6; }
/* Picture right-click menu and its submenus. */
.wm-picmenu { min-width: 250px; }
.wm-submenu { min-width: 230px; border-color: #747474; border-radius: 4px; font-size: 13px; z-index: 2; }
.wm-item.is-open { background: #F0F0F0; }

/* ---------- Insert › Pictures windows (classroom screenshots: Insert Picture, Stock Images, Online Pictures) ---------- */
/* Insert Picture reuses the Save As window's Windows 11 look (sa-* above): white title bar, grey form strip. */
.wd-dlg.wd-pic { display: flex; flex-direction: column; overflow: hidden; padding: 0; border-color: #8A8A8A; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); font-family: "Segoe UI", system-ui, sans-serif; color: #1A1A1A; font-size: 12.5px; }
.wd-pic button { font: inherit; color: inherit; }
.wd-pic button:focus-visible, .wd-pic input:focus-visible { outline: 2px solid #0F6CBD; outline-offset: 1px; }
.wd-pic svg { display: block; }
.wd-pic .pd-grow { flex: 1; }
.wd-pic .pd-caret { font-style: normal; font-size: 10px; }
.wd-pic .pd-btn { min-width: 96px; height: 32px; padding: 0 14px; border: 1px solid #ADADAD; border-radius: 4px; background: #FDFDFD; font-size: 14px; }
.wd-pic .pd-btn:hover:not(:disabled) { background: #E8F1FA; border-color: #0F6CBD; }
.wd-pic .is-spot-btn { box-shadow: 0 0 0 3px var(--orange, #F29B38) !important; }
.wd-pic .pd-x { width: 46px; height: 32px; display: grid; place-items: center; }
.wd-pic .pd-x:hover { background: #C42B1C; color: #fff; }
.wd-pic .pd-x .wi { width: 11px; height: 11px; }

/* This Device: the Windows "Insert Picture" window. */
.wd-pic.pd-device { width: min(880px, calc(100% - 24px)); height: min(560px, calc(100% - 20px)); border-radius: 8px; }
.pd-tb { height: 32px; flex: none; display: flex; align-items: center; gap: 8px; padding-left: 10px; }
.pd-tb-ic .wi { width: 18px; height: 18px; }
.pd-tb-t { flex: 1; font-size: 13px; }
.pd-addr { height: 44px; flex: none; display: flex; align-items: center; gap: 2px; padding: 0 10px 4px; }
.pd-ab { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 4px; color: #7A7A7A; }
.pd-ab:hover { background: #E8E8E8; }
.pd-ab .wi { width: 16px; height: 16px; }
.pd-recent .wi, .pd-sm .wi { width: 11px; height: 11px; }
.pd-up .wi { transform: rotate(-90deg); color: #1A1A1A; }
.pd-path { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; gap: 8px; margin-left: 4px; padding: 0 2px 0 10px; border: 1px solid #D0D0D0; border-radius: 4px; background: #fff; font-size: 13.5px; }
.pd-path i { font-style: normal; color: #6B6B6B; }
.pd-path .pd-sm { width: 26px; height: 26px; color: #5E5E5E; }
.pd-crumb svg { width: 18px; height: 18px; }
.pd-search { width: 200px; flex: none; margin-left: 12px; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border: 1px solid #D0D0D0; border-radius: 4px; color: #5E5E5E; font-size: 13.5px; }
.pd-search .wi { width: 15px; height: 15px; }
.pd-cmd { height: 36px; flex: none; display: flex; align-items: center; gap: 22px; padding: 0 14px; background: #F9F9F9; border-top: 1px solid #EFEFEF; }
.pd-c { height: 28px; padding: 0 6px; border-radius: 4px; font-size: 13.5px; }
.pd-c:hover { background: #E8E8E8; }
.pd-cmd .pd-ic { width: 30px; padding: 0; display: grid; place-items: center; margin-left: -12px; }
.pd-cmd .pd-ic svg { width: 19px; height: 19px; }
.pd-cmd .pd-narrow { width: 18px; margin-left: -20px; }
.pd-body { flex: 1; min-height: 0; display: flex; border-top: 1px solid #E5E5E5; }
.pd-nav { width: 176px; flex: none; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 4px; background: #F3F3F3; border-right: 6px solid #EAEAEA; }
.pd-n { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px 0 2px; border-radius: 4px; font-size: 13.5px; text-align: left; }
.pd-n:hover { background: #E6E6E6; }
.pd-n.is-on { background: #DADADA; }
.pd-exp { width: 12px; display: grid; place-items: center; color: #6B6B6B; }
.pd-exp .wi { width: 9px; height: 9px; }
.pd-ni svg { width: 19px; height: 19px; }
.pd-nl { flex: 1; min-width: 0; }
.pd-pin svg { width: 13px; height: 13px; }
.pd-sep { border: 0; border-top: 1px solid #CFCFCF; margin: 8px 10px; }
.pd-files { flex: 1; min-width: 0; overflow-y: auto; background: #fff; }
.pd-empty { margin: 20px 0 0; text-align: center; color: #5E5E5E; font-size: 13.5px; }
/* Medium icons, as Explorer shows a picture folder. */
.pd-fgrid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 10px 12px; }
.pd-file { width: 104px; padding: 6px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 4px; cursor: default; }
.pd-file:hover { background: #E5F3FF; }
.pd-file.is-picked { background: #CCE8FF; border-color: #99D1FF; }
.pd-thumb { width: 88px; height: 72px; display: grid; place-items: center; }
.pd-thumb img { max-width: 88px; max-height: 72px; object-fit: contain; box-shadow: 0 0 0 1px #D6D6D6; background: #fff; }
.pd-fn { font-size: 12.5px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.pd-form { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 14px; background: #F0F0F0; border-top: 1px solid #E5E5E5; }
.pd-frow { display: flex; align-items: center; gap: 22px; }
.pd-fbtns { justify-content: flex-end; gap: 22px; }
.pd-row { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.pd-lbl { width: 96px; flex: none; text-align: right; font-size: 13.5px; }
.pd-combo { flex: 1; min-width: 0; height: 30px; display: flex; align-items: center; border: 1px solid #8A8A8A; border-bottom: 2px solid #0F6CBD; border-radius: 3px; background: #fff; padding-right: 8px; }
.pd-combo .wi { width: 11px; height: 11px; color: #5E5E5E; }
.pd-name { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0 !important; padding: 0 8px; font: inherit; font-size: 14px; background: transparent; }
.pd-type { width: 220px; flex: none; height: 30px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; border: 1px solid #ADADAD; border-radius: 3px; background: #fff; font-size: 14px; }
.pd-type .wi { width: 11px; height: 11px; color: #5E5E5E; }
.pd-tools { padding: 0 10px; margin-right: -8px; font-size: 14px; }
.pd-fbtns .pd-btn { min-width: 112px; }
.pd-split { display: flex; height: 32px; border: 2px solid #0F6CBD; border-radius: 4px; background: #FDFDFD; }
.pd-split .pd-btn.pd-insert { border: 0; height: 28px; min-width: 96px; border-radius: 2px 0 0 2px; }
.pd-arrow { width: 22px; border-left: 1px solid #1A1A1A; display: grid; place-items: center; }
.pd-arrow .pd-caret { font-size: 12px; }

/* Stock Images and Online Pictures: Office's large web-style windows. */
.wd-pic.pd-stock, .wd-pic.pd-online { position: relative; width: min(1000px, calc(100% - 24px)); height: min(600px, calc(100% - 20px)); border-radius: 4px; border-color: #B9B9B9; padding: 0 22px; }
.pd-xo { position: absolute; top: 4px; right: 4px; width: 32px !important; height: 28px !important; border-radius: 4px; }
.pd-h { margin: 0; font-weight: 400; color: #2B579A; }
.pd-h-stock { padding: 26px 0 10px; font-size: 24px; font-weight: 600; font-family: "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif; color: #2F5597; }
.pd-tabs { flex: none; display: flex; gap: 26px; padding: 4px 6px 0; }
.pd-tab { height: 34px; padding: 0 2px; font-size: 14px; color: #333; border-bottom: 2px solid transparent; }
.pd-tab.is-on { font-weight: 600; color: #1A1A1A; border-bottom-color: #2F5597; }
.wd-pic .pd-q { flex: none; height: 30px; border: 2px solid #2F5597; border-radius: 2px; padding: 0 10px; font: inherit; font-size: 14px; color: #1A1A1A; background: #fff; outline: 0; min-width: 0; }
.pd-stock .pd-q { margin: 12px 30px 10px 0; }
.pd-q::placeholder { color: #5E5E5E; }
.pd-chips { flex: none; display: flex; gap: 8px; align-items: center; margin: 0 0 10px; overflow: hidden; }
.pd-chip { flex: 1 1 0; min-width: 0; height: 32px; padding: 0 6px; border-radius: 3px; position: relative; overflow: hidden; color: #fff !important; font-size: 14px; background: #333 var(--bg) center / cover; }
.pd-chip::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.pd-chip span { position: relative; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #2F5597; }
.pd-more { flex: none; width: 18px; color: #2F5597; }
.pd-more .wi { width: 12px; height: 12px; }
/* A justified photo grid: each photo's share of the row follows its width/height ratio. */
.pd-grid { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 3px 3px 6px; }
.pd-grid::after { content: ""; flex-grow: 100; }
.pd-photo { position: relative; height: 150px; flex: var(--r) 1 calc(150px * var(--r)); padding: 0; border-radius: 2px; overflow: hidden; background: #EEE; }
.pd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-photo:hover { box-shadow: 0 0 0 2px #8A8A8A; }
.pd-photo.is-picked { box-shadow: 0 0 0 3px #3C3C3C; border-radius: 6px; }
.pd-check { display: none; position: absolute; right: 8px; bottom: 8px; width: 14px; height: 14px; border: 1.5px solid #fff; background: rgba(0, 0, 0, .55); }
.pd-photo.is-picked .pd-check { display: block; background: #fff; }
.pd-photo.is-picked .pd-check::after { content: ""; position: absolute; left: 4px; top: 0; width: 4px; height: 8px; border: solid #1A1A1A; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pd-foot { flex: none; display: flex; align-items: center; gap: 12px; height: 62px; margin: 0 -22px; padding: 0 22px 0 26px; border-top: 1px solid #E1E1E1; }
.pd-info .wi { width: 17px; height: 17px; color: #444; }
.pd-note { font-size: 13px; color: #333; }
.pd-link { color: #333; text-decoration: underline; }
.wd-pic .pd-primary { background: #185ABD; border-color: #185ABD; color: #fff !important; font-weight: 600; }
.wd-pic .pd-primary:hover:not(:disabled) { background: #1A4F9F; border-color: #1A4F9F; }
.pd-stock .pd-primary:disabled { background: #F3F3F3; border-color: #F3F3F3; color: #C2C2C2 !important; font-weight: 400; }
.pd-online .pd-primary:disabled { background: #A9C0E6; border-color: #A9C0E6; color: #fff !important; }
.pd-foot .pd-btn { min-width: 118px; height: 36px; }

.pd-box { display: inline-block; width: 8px; height: 11px; border: 1px solid currentColor; vertical-align: middle; flex: none; }
.pd-ohead { flex: none; display: flex; align-items: center; padding: 30px 0 8px; }
.pd-h-online { font-family: Cambria, Georgia, "Times New Roman", serif; font-weight: 700; font-size: 26px; color: #2F5597; }
.pd-hicons { display: flex; gap: 26px; padding-right: 22px; color: #555; }
.pd-osearch { flex: none; display: flex; align-items: center; gap: 14px; }
.pd-back { display: none; width: 22px; height: 30px; color: #555; }
.pd-obox { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border: 2px solid #2F5597; border-radius: 2px; color: #555; background: #fff; }
.wd-pic .pd-obox .pd-q { flex: 1; border: 0; outline: 0; height: 28px; padding: 0; }
.pd-online:not([data-view="results"]) .pd-obox > .pd-box { display: none; }
.pd-clear { display: none; width: 18px; color: #999; }
.pd-bing { flex: none; margin: 10px 0 12px; font-size: 14px; color: #333; display: flex; align-items: center; gap: 4px; }
.pd-bing-b { display: inline-flex; align-items: center; gap: 1px; font-size: 15px; color: #333; }
.pd-bing-b svg { width: 18px; height: 18px; }
.pd-filters { flex: none; display: none; align-items: center; gap: 36px; margin: 0 0 14px 14px; }
.pd-filter { color: #555; }
.pd-cc { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; border-radius: 3px; font-size: 14px; color: #333; }
.pd-cc[aria-pressed="true"] { background: #DCDCDC; }
.pd-tiles { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); grid-auto-rows: 104px; gap: 9px; padding: 2px 2px 8px; }
.pd-tile { position: relative; overflow: hidden; border-radius: 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff !important; font-size: 15px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); background: #333 var(--bg) center / cover; }
.pd-tile::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .32); transition: background .1s; }
.pd-tile:hover::before { background: rgba(0, 0, 0, .12); }
.pd-tile > * { position: relative; }
.pd-tile .pd-box { width: 7px; height: 10px; }
.pd-online .pd-grid, .pd-online .pd-foot > * { display: none; }
.pd-online .pd-foot { height: 34px; }
.pd-online[data-view="results"] .pd-tiles { display: none; }
.pd-online[data-view="results"] .pd-grid { display: flex; }
.pd-online[data-view="results"] .pd-filters { display: flex; }
.pd-online[data-view="results"] .pd-back, .pd-online[data-view="results"] .pd-clear { display: block; }
.pd-online[data-view="results"] .pd-ohead { padding-top: 22px; }
.pd-online[data-view="results"] .pd-bing { margin-top: 14px; }
.pd-online[data-view="results"] .pd-foot { height: 62px; }
.pd-online[data-view="results"] .pd-foot > * { display: revert; }
.pd-online[data-view="results"] .pd-foot > .pd-grow { display: block; }
.pd-online .pd-photo { height: 140px; flex-basis: calc(140px * var(--r)); }

/* Insert › Pictures menu (classroom screenshot): plain bold heading, larger picture icons, roomier rows. */
.wm-menu:has(> [data-cmd="insert.pictures.device"]) { min-width: 250px; padding: 6px 4px 8px; }
.wm-menu:has(> [data-cmd="insert.pictures.device"]) .wm-head { background: none; padding: 8px 12px 6px; font-size: 13.5px; }
.wm-menu:has(> [data-cmd="insert.pictures.device"]) .wm-item { min-height: 36px; font-size: 13.5px; }
.wm-menu:has(> [data-cmd="insert.pictures.device"]) .wm-lead .wi { width: 20px; height: 20px; }
