/*
 * BioStudio Excel — Microsoft Excel for Microsoft 365 (Fluent) look.
 *
 * Loaded after css/office.css. Everything is scoped to `.excel-app.xl365`
 * (window chrome) and `.xr-popover` (menus/popovers portalled to <body>).
 * Class names avoid the suffixes css/app-color-themes.css force-styles
 * (-btn, -pane, -canvas, -tab, -empty, …), and a guard block at the end
 * re-asserts this palette inside themed windows, like report-studio-word.css.
 *
 * Colour convention: rules set `--xr-c` rather than `color`; one rule turns
 * --xr-c into `color` for every xr-* element, and the theme guard does the
 * same with !important.
 *
 * Layout:
 *   .excel-app.xl365
 *     .xr-titlebar      app mark · AutoSave · QAT | document name · Search | avatar
 *     .xr-ribbon-host   tab row + ribbon card (ui/ribbon.js)
 *     .xr-fbar          Name Box · ✕ ✓ fx · formula
 *     .excel-grid-scroll
 *     .xr-sheetbar      ◀ ▶ … · sheet tabs · ⊕ · scroll
 *     .xr-sbar          mode · aggregates · views · zoom
 */

.excel-app.xl365 {
  --xr-font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --xr-grid-font: "Aptos Narrow", Aptos, Calibri, Carlito, "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --xr-bg: #f3f3f3;
  --xr-surface: #ffffff;
  --xr-surface-2: #fafafa;
  --xr-border: #e0e0e0;
  --xr-border-strong: #d1d1d1;
  --xr-text: #242424;
  --xr-text-2: #424242;
  --xr-text-3: #616161;
  --xr-text-disabled: #bdbdbd;
  --xr-hover: #f0f0f0;
  --xr-hover-chrome: #e6e6e6;
  --xr-pressed: #e0e0e0;
  --xr-checked: #e1dfdd;
  --xr-checked-border: #c8c6c4;
  --xr-accent: #107c41;
  --xr-accent-hover: #0e6f3a;
  --xr-accent-pressed: #0c5e31;
  --xr-accent-soft: #e7f3ec;
  --xr-accent-soft-2: #cde8d7;
  --xr-focus: #107c41;
  --xr-ic: #424242;
  --xr-ic-green: #107c41;
  --xr-ic-green-2: #21a366;
  --xr-ic-blue: #2b7cd3;
  --xr-ic-red: #d13438;
  --xr-ic-orange: #ca5010;
  --xr-ic-yellow: #eaa300;
  --xr-ic-purple: #8764b8;
  --xr-icon-fill: #ffffff;
  --xr-shadow-card: 0 0 2px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .10);
  --xr-shadow-pop: 0 0 2px rgba(0, 0, 0, .12), 0 8px 16px rgba(0, 0, 0, .14);

  /* Grid */
  --xl-accent: #107c41;
  --xl-gridline: #e1e1e1;
  --xl-head-bg: #f5f5f5;
  --xl-head-fg: #424242;
  --xl-head-line: #d4d4d4;
  --xl-head-sel-bg: #d3f0e0;
  --xl-head-sel-fg: #0f5c33;
  --xl-head-full-bg: #9fd5b7;
  --xl-range-fill: rgba(16, 124, 65, .10);
  --xl-grid-font: var(--xr-grid-font);
  --xl-cell-bg: #ffffff;
  --xl-pl-gutter: #e3e3e3;
  --xl-pl-edge: #c6c6c6;
  --xl-pl-hint: #8a8a8a;
  --xl-cell-ink: #000000;
  --xr-c: var(--xr-text);

  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  background: var(--xr-bg);
  font-family: var(--xr-font);
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}
.window[data-app-color-tone="dark"] .excel-app.xl365,
.excel-app.xl365.xr-dark {
  --xr-bg: #1f1f1f;
  --xr-surface: #292929;
  --xr-surface-2: #242424;
  --xr-border: #3d3d3d;
  --xr-border-strong: #525252;
  --xr-text: #ffffff;
  --xr-text-2: #e0e0e0;
  --xr-text-3: #adadad;
  --xr-text-disabled: #5c5c5c;
  --xr-hover: #383838;
  --xr-hover-chrome: #333333;
  --xr-pressed: #454545;
  --xr-checked: #474747;
  --xr-checked-border: #5c5c5c;
  --xr-accent: #4dbd7a;
  --xr-accent-hover: #62c98b;
  --xr-accent-pressed: #3aa566;
  --xr-accent-soft: #1d3a29;
  --xr-accent-soft-2: #245036;
  --xr-ic: #e0e0e0;
  --xr-ic-green: #4dbd7a;
  --xr-ic-blue: #62a8f5;
  --xr-icon-fill: #292929;
  --xl-head-bg: #2b2b2b;
  --xl-head-fg: #d6d6d6;
  --xl-head-line: #444444;
  --xl-head-sel-bg: #1d3a29;
  --xl-head-sel-fg: #8fdcaf;
  --xl-head-full-bg: #245036;
  --xl-gridline: #3a3a3a;
  --xl-cell-bg: #1f1f1f;
  --xl-pl-gutter: #121212;
  --xl-pl-edge: #3c3c3c;
  --xl-pl-hint: #9a9a9a;
  --xl-cell-ink: #f3f3f3;
  --xl-accent: #4dbd7a;
  --xl-range-fill: rgba(77, 189, 122, .16);
}

.excel-app.xl365 :is([class^="xr-"], [class*=" xr-"]) { color: var(--xr-c); }
.excel-app.xl365 :is(button, input, select, textarea) { font-family: inherit; }
/* Chrome from the previous ribbon never shows in the 365 surface. */
.excel-app.xl365 > :is(.office-titlebar, .office-rb, .office-ribbon, .excel-ribbon, .app-statusbar) { display: none !important; }

/* ---- Icons ---------------------------------------------------------------- */
.xr-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; --xr-c: var(--xr-ic); line-height: 0; }
.xr-ic svg { display: block; overflow: visible; }
.xr-ic svg * { vector-effect: non-scaling-stroke; stroke-width: 1.15px; }
.xr-ic .g { fill: var(--xr-ic-green); }
.xr-ic .a { fill: var(--xr-ic-blue); }
.xr-ic .r { fill: var(--xr-ic-red); }
.xr-ic .o { fill: var(--xr-ic-orange); }
.xr-ic .y { fill: var(--xr-ic-yellow); }
.xr-ic .p { fill: var(--xr-ic-purple); }
.xr-ic .g-s { stroke: var(--xr-ic-green); }
.xr-ic .a-s { stroke: var(--xr-ic-blue); }
.xr-ic .r-s { stroke: var(--xr-ic-red); }
.xr-ic .o-s { stroke: var(--xr-ic-orange); }
.xr-ic .g-text { fill: var(--xr-ic-green); }
.xr-ic .ai { fill: #7b61ff; }
.xr-ic .ai2 { fill: #2ba8ff; }
.xr-ic text { stroke: none; font-family: var(--xr-font, "Segoe UI", Arial, sans-serif); }
.xr-ic .fc-bar { fill: var(--xr-ic-bar, transparent); stroke: var(--xr-border-strong, #d1d1d1); stroke-width: .6px; }

/* ---- Title bar ------------------------------------------------------------------ */
.xr-titlebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 620px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 10px 0 8px;
  background: var(--xr-bg);
  flex: 0 0 auto;
  user-select: none; -webkit-user-select: none;
  /* Above the ribbon so the Search (Alt+Q) results drop over it. */
  position: relative; z-index: 30;
}
.xr-qat { display: flex; align-items: center; gap: 2px; min-width: 0; }
.xr-appmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; margin: 0 6px 0 2px;
}
.xr-appmark .xr-ic { --xr-c: var(--xr-accent); }
.xr-autosave {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 8px; border: 0; border-radius: 4px;
  --xr-c: var(--xr-text-2); background: transparent; font-size: 12px; cursor: pointer;
}
.xr-autosave:hover { background: var(--xr-hover-chrome); }
.xr-autosave-state { font-size: 11px; --xr-c: var(--xr-text-3); }
.xr-toggle {
  position: relative; width: 28px; height: 14px; border-radius: 7px;
  border: 1px solid var(--xr-text-3); background: transparent; flex: 0 0 auto;
}
.xr-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--xr-text-3); transition: left .12s ease;
}
.xr-toggle.on { border-color: var(--xr-accent); background: var(--xr-accent); }
.xr-toggle.on::after { left: 16px; background: #fff; }
.xr-qat-b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 28px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; cursor: pointer; --xr-c: var(--xr-ic);
}
.xr-qat-b:hover:not(:disabled) { background: var(--xr-hover-chrome); }
.xr-qat-b:active:not(:disabled) { background: var(--xr-pressed); }
.xr-qat-b:disabled { opacity: .4; cursor: default; }
.xr-qat-b.narrow { width: 16px; }
.xr-title-center { display: flex; align-items: center; gap: 10px; min-width: 0; }
.xr-docname {
  display: inline-flex; align-items: center; gap: 4px; min-width: 0; flex: 0 1 auto;
  height: 28px; padding: 0 8px; border: 0; border-radius: 4px;
  --xr-c: var(--xr-text); background: transparent; font-size: 12px; cursor: pointer;
}
.xr-docname:hover { background: var(--xr-hover-chrome); }
.xr-docname-text { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.xr-docname-state { --xr-c: var(--xr-text-3); white-space: nowrap; }
.xr-searchslot { flex: 1 1 auto; min-width: 180px; display: flex; justify-content: center; }
.xr-titlebar-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.xr-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #8764b8; --xr-c: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em;
}

/* The function search is Excel's Search box: flat, rounded, centred. */
.excel-app.xl365 .xr-searchslot .xl-fnsearch { width: 100%; max-width: 480px; }
.excel-app.xl365 .xr-searchslot .xl-fnsearch-field {
  width: 100%; height: 30px; border-radius: 6px;
  background: var(--xr-surface); border: 1px solid transparent;
  box-shadow: 0 0 0 1px var(--xr-border) inset;
  color: var(--xr-text);
}
.excel-app.xl365 .xr-searchslot .xl-fnsearch-field:hover { box-shadow: 0 0 0 1px var(--xr-border-strong) inset; background: var(--xr-surface); border-color: transparent; }
.excel-app.xl365 .xr-searchslot .xl-fnsearch.open .xl-fnsearch-field,
.excel-app.xl365 .xr-searchslot .xl-fnsearch-field:focus-within {
  background: var(--xr-surface); border-color: transparent;
  box-shadow: 0 0 0 1px var(--xr-border) inset, inset 0 -2px 0 var(--xr-focus);
}
.excel-app.xl365 .xr-searchslot .xl-fnsearch-input { font-size: 12px; font-weight: 400; }
.excel-app.xl365 .xr-searchslot .xl-fnsearch-input::placeholder { color: var(--xr-text-3); font-weight: 400; }
.excel-app.xl365 .xr-searchslot .xl-fnsearch-pop { right: auto; left: 50%; transform-origin: top center; margin-left: calc(min(540px, calc(100cqi - 24px)) / -2); }

/* ---- Ribbon: tab row -------------------------------------------------------------- */
.xr-ribbon-host { flex: 0 0 auto; position: relative; z-index: 20; }
.xr-ribbon { background: var(--xr-bg); user-select: none; -webkit-user-select: none; }
.xr-tabrow { display: flex; align-items: stretch; height: 34px; padding: 0 8px 0 6px; overflow: hidden; }
.xr-rtab {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 10px; border: 0; border-radius: 4px 4px 0 0;
  --xr-c: var(--xr-text-2); background: transparent;
  font-size: 13px; line-height: 1; white-space: nowrap; cursor: pointer;
}
.xr-rtab:hover { --xr-c: var(--xr-text); background: var(--xr-hover-chrome); }
.xr-rtab.active { --xr-c: var(--xr-accent); font-weight: 600; }
.xr-rtab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px;
  border-radius: 2px; background: var(--xr-accent);
}
.xr-rtab .xr-tab-text { display: inline-grid; }
.xr-rtab .xr-tab-text::after { content: attr(data-label); height: 0; visibility: hidden; font-weight: 600; }
.xr-rtab.contextual { --xr-c: var(--xr-accent); }
.xr-rtab.contextual .xr-tab-ctx { display: none; }
.xr-tabrow-spacer { flex: 1 1 0; min-width: 8px; }
.xr-trb {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; margin-left: 6px; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--xr-border-strong);
  --xr-c: var(--xr-text); background: var(--xr-surface);
  font-size: 12px; white-space: nowrap; cursor: pointer;
}
.xr-trb:hover { background: var(--xr-hover); }
.xr-trb.primary { --xr-c: #fff; border-color: var(--xr-accent); background: var(--xr-accent); font-weight: 600; }
.xr-trb.primary .xr-ic { --xr-c: #fff; }
.xr-trb.primary:hover { background: var(--xr-accent-hover); border-color: var(--xr-accent-hover); }

/* ---- Ribbon: body card ------------------------------------------------------------------ */
.xr-ribbon-body {
  position: relative;
  display: flex; align-items: stretch;
  height: 96px; margin: 0 8px 6px; padding: 4px 26px 0 4px;
  border-radius: 8px;
  background: var(--xr-surface);
  box-shadow: var(--xr-shadow-card);
  overflow: hidden;
}
.xr-ribbon.is-collapsed .xr-ribbon-body.peek {
  position: absolute; left: 0; right: 0; top: 34px; z-index: 30;
  box-shadow: var(--xr-shadow-pop);
}
.xr-ribbon-groups { display: flex; align-items: stretch; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.xr-ribbon-groups::-webkit-scrollbar { display: none; }
.xr-ribbon-collapse {
  position: absolute; right: 4px; bottom: 4px;
  width: 20px; height: 20px; padding: 0; border: 0; border-radius: 4px;
  background: transparent; cursor: pointer; --xr-c: var(--xr-text-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.xr-ribbon-collapse:hover { background: var(--xr-hover); }
.xr-ribbon.is-collapsed .xr-tabrow { margin-bottom: 4px; }

.xr-group { position: relative; display: flex; flex-direction: column; justify-content: space-between; flex: 0 0 auto; padding: 0 6px; }
.xr-group + .xr-group::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 8px; width: 1px; background: var(--xr-border); }
.xr-cols { display: flex; align-items: flex-start; gap: 2px; height: 72px; }
.xr-col { display: flex; flex-direction: column; justify-content: flex-start; gap: 0; }
.xr-col-wide { height: 72px; justify-content: center; }
.xr-rows { display: flex; flex-direction: column; gap: 3px; height: 72px; padding-top: 3px; }
.xr-row { display: flex; align-items: center; gap: 1px; min-height: 24px; }
.xr-sep { display: inline-block; width: 1px; height: 18px; margin: 0 4px; background: var(--xr-border); flex: 0 0 auto; }
.xr-cols > .xr-sep { height: 64px; margin: 4px 3px 0; }
.xr-group-label {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 20px; padding: 0 14px;
  --xr-c: var(--xr-text-3); font-size: 11.5px; white-space: nowrap;
}
.xr-launcher {
  position: absolute; right: -2px; bottom: 3px;
  width: 16px; height: 16px; padding: 0; border: 0; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; --xr-c: var(--xr-text-3); cursor: pointer;
}
.xr-launcher .xr-ic { --xr-c: var(--xr-text-3); }
.xr-launcher:hover { background: var(--xr-hover); }
.xr-opt-head { font-size: 12px; font-weight: 600; --xr-c: var(--xr-text-2); padding: 0 8px 0 4px; min-width: 64px; }

/* Buttons */
.xr-cmd {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid transparent; border-radius: 4px;
  --xr-c: var(--xr-text); background: transparent;
  font-size: 12px; line-height: 1.15; cursor: pointer; white-space: nowrap;
}
.xr-cmd:hover:not(.disabled):not(:disabled) { background: var(--xr-hover); }
.xr-cmd:active:not(.disabled):not(:disabled) { background: var(--xr-pressed); }
.xr-cmd.active { background: var(--xr-checked); border-color: var(--xr-checked-border); }
.xr-cmd.active:hover { background: var(--xr-pressed); }
.xr-cmd.disabled, .xr-cmd:disabled { --xr-c: var(--xr-text-disabled); cursor: default; }
.xr-cmd.disabled .xr-ic, .xr-cmd:disabled .xr-ic { opacity: .38; }
.xr-cmd:focus-visible { outline: 2px solid var(--xr-focus); outline-offset: -2px; }
.xr-big {
  flex-direction: column; justify-content: flex-start; gap: 2px;
  min-width: 44px; max-width: 78px; height: 70px; padding: 3px 4px 2px;
  white-space: normal; text-align: center;
}
.xr-big .xr-big-top { display: flex; align-items: center; justify-content: center; height: 34px; }
.xr-big .xr-big-top .xr-ic svg * { stroke-width: 1.35px; }
.xr-big-label { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 14px; }
.xr-big-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.xr-big.split { padding: 0; gap: 0; }
.xr-big.split .xr-big-top { height: 38px; width: 100%; border-radius: 3px 3px 0 0; padding-top: 2px; }
.xr-big.split .xr-big-label { width: 100%; padding: 1px 4px 2px; border-radius: 0 0 3px 3px; }
.xr-big.split:hover:not(.disabled) { background: transparent; border-color: var(--xr-border-strong); }
.xr-big.split .xr-big-top:hover { background: var(--xr-hover); }
.xr-big.split .xr-big-label:hover { background: var(--xr-hover); }
.xr-small { height: 24px; padding: 0 4px 0 3px; }
.xr-small .xr-split-main { display: inline-flex; align-items: center; gap: 5px; }
.xr-small .xr-small-text { padding-right: 2px; }
.xr-drop { display: inline-flex; align-items: center; justify-content: center; }
.xr-icon { height: 24px; min-width: 24px; justify-content: center; padding: 0 3px; gap: 1px; }
.xr-icon .xr-split-main { display: inline-flex; align-items: center; }
.xr-cmd.split .xr-split-drop { align-self: stretch; padding: 0 2px; border-radius: 0 3px 3px 0; display: inline-flex; align-items: center; }
.xr-cmd.split:hover:not(.disabled) .xr-split-drop { box-shadow: -1px 0 0 var(--xr-border-strong); }
.xr-cmd.split .xr-split-drop:hover { background: var(--xr-pressed); }

/* Combos (font name / size / number format) */
.xr-combo { position: relative; display: inline-flex; align-items: center; height: 24px; margin-right: 3px; }
.excel-app.xl365 .xr-combo-input {
  height: 24px; min-height: 0; padding: 0 20px 0 6px; margin: 0;
  border: 1px solid var(--xr-border-strong); border-radius: 4px;
  --xr-c: var(--xr-text); color: var(--xr-text); background: var(--xr-surface);
  font-size: 12px; line-height: 22px; box-shadow: none; outline: none;
}
.excel-app.xl365 .xr-combo-input:hover { border-color: var(--xr-text-3); }
.excel-app.xl365 .xr-combo-input:focus { box-shadow: inset 0 -2px 0 var(--xr-focus); }
.xr-combo-drop {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: 0 3px 3px 0; background: transparent; cursor: pointer; --xr-c: var(--xr-text-2);
}
.xr-combo-drop:hover { background: var(--xr-hover); }
.xr-combo.disabled { opacity: .5; pointer-events: none; }

/* Galleries, checks, spinners */
.xr-gallery { display: flex; align-items: stretch; height: 70px; margin-top: 1px; border: 1px solid var(--xr-border); border-radius: 4px; background: var(--xr-surface); overflow: hidden; }
.xr-gallery-cells { display: flex; align-items: stretch; gap: 2px; padding: 2px; overflow: hidden; }
.xr-gallery-item { display: flex; align-items: center; justify-content: center; width: 60px; padding: 2px; border: 1px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; overflow: hidden; }
.xr-gallery-item:hover { background: var(--xr-hover); border-color: var(--xr-border); }
.xr-gallery-item.active { border-color: var(--xr-accent); background: var(--xr-accent-soft); }
.xr-gallery-scroll { display: flex; flex-direction: column; width: 16px; border-left: 1px solid var(--xr-border); }
.xr-gallery-arrow { flex: 1 1 0; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; cursor: pointer; --xr-c: var(--xr-text-2); }
.xr-gallery-arrow:disabled { opacity: .35; cursor: default; }
.xr-gallery-arrow:hover:not(:disabled) { background: var(--xr-hover); }
.xr-gallery-arrow.more { border-top: 1px solid var(--xr-border); }
.xr-check { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 6px 0 4px; border-radius: 4px; --xr-c: var(--xr-text); font-size: 12px; cursor: pointer; white-space: nowrap; }
.xr-check:hover { background: var(--xr-hover); }
.xr-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--xr-accent); }
.xr-check.disabled { --xr-c: var(--xr-text-disabled); pointer-events: none; }
.xr-spin { display: inline-flex; align-items: center; gap: 4px; height: 24px; font-size: 12px; --xr-c: var(--xr-text); white-space: nowrap; }
.xr-spin-label { --xr-c: var(--xr-text-2); min-width: 40px; }
.excel-app.xl365 .xr-spin-input { width: 56px; height: 22px; padding: 0 4px; border: 1px solid var(--xr-border-strong); border-radius: 4px; color: var(--xr-text); background: var(--xr-surface); font-size: 12px; }
.xr-spin-unit { --xr-c: var(--xr-text-3); font-size: 11px; }
.xr-spin.disabled { opacity: .5; pointer-events: none; }
.xr-table-strip { display: flex; gap: 3px; padding: 4px 2px; height: 64px; align-items: center; }

/* ---- Popovers, menus, palettes (portalled to <body>) ---------------------------------- */
.xr-popover {
  --xr-c: #242424;
  position: fixed; z-index: 10060;
  min-width: 120px; max-height: min(620px, calc(100vh - 20px)); overflow: auto;
  color: #242424; background: #ffffff;
  border: 1px solid rgba(0, 0, 0, .1); border-radius: 6px;
  box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 8px 16px rgba(0, 0, 0, .14);
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}
.xr-popover :is([class^="xr-"], [class*=" xr-"]) { color: var(--xr-c); }
.xr-popover .xr-ic { --xr-c: #424242; }
.xr-popover .xr-ic .g { fill: #107c41; } .xr-popover .xr-ic .g-s { stroke: #107c41; }
.xr-popover .xr-ic .a { fill: #2b7cd3; } .xr-popover .xr-ic .a-s { stroke: #2b7cd3; }
.xr-popover .xr-ic .r { fill: #d13438; } .xr-popover .xr-ic .r-s { stroke: #d13438; }
.xr-popover .xr-ic .o { fill: #ca5010; } .xr-popover .xr-ic .y { fill: #eaa300; }
.xr-popover .xr-ic .g-text { fill: #107c41; }
.xr-menu { display: flex; flex-direction: column; padding: 4px; min-width: 210px; }
.xr-menu-item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 12px 0 4px; border: 0; border-radius: 4px;
  --xr-c: #242424; background: transparent; font-size: 12px; text-align: left; cursor: pointer;
}
.xr-menu-item:hover:not(:disabled), .xr-menu-item:focus-visible, .xr-menu-item.sub-open { background: #f0f0f0; outline: none; }
.xr-menu-item:disabled { --xr-c: #bdbdbd; cursor: default; }
.xr-menu-item:disabled .xr-ic { opacity: .4; }
.xr-menu-item.danger { --xr-c: #c50f1f; }
.xr-menu-item.checked .xr-menu-ic .xr-ic { --xr-c: #107c41; }
.xr-menu-ic { display: inline-flex; align-items: center; justify-content: center; }
.xr-menu-label { display: flex; flex-direction: column; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-menu-hint { font-size: 11px; --xr-c: #616161; white-space: normal; max-width: 320px; }
.xr-menu-key { --xr-c: #616161; font-size: 11px; padding-left: 16px; }
.xr-menu-sub { display: inline-flex; }
.xr-menu-sep { height: 1px; margin: 4px 6px; background: #e0e0e0; }
.xr-menu-header { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; --xr-c: #424242; background: #f5f5f5; margin: 2px -4px; }
.xr-menu-gallery { display: grid; gap: 2px; padding: 4px 6px; }
.xr-menu-gcell {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; min-height: 34px; padding: 3px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer;
}
.xr-menu-gcell:hover { background: #f0f0f0; border-color: #e0e0e0; }
.xr-swatch-static { display: inline-block; width: 18px; height: 18px; border: 1px solid rgba(0, 0, 0, .15); }
.xr-databar-prev { display: block; width: 36px; height: 30px; background: linear-gradient(90deg, var(--c) 0 70%, transparent 70%) 0 3px / 100% 6px no-repeat, linear-gradient(90deg, var(--c) 0 45%, transparent 45%) 0 12px / 100% 6px no-repeat, linear-gradient(90deg, var(--c) 0 85%, transparent 85%) 0 21px / 100% 6px no-repeat; }
.xr-scale-prev { display: block; width: 30px; height: 30px; border: 1px solid rgba(0, 0, 0, .1); }
.xr-numfmt-menu .xr-menu-item { min-height: 40px; }
.xr-numfmt-opt { display: inline-flex; align-items: center; gap: 10px; }
.xr-numfmt-opt > span { display: flex; flex-direction: column; line-height: 1.25; }
.xr-numfmt-opt b { font-weight: 600; font-size: 12px; }
.xr-numfmt-opt i { font-style: normal; font-size: 11px; --xr-c: #616161; color: #616161; }
.xr-fn-menu { max-height: 460px; }

.xr-palette { display: flex; flex-direction: column; gap: 4px; padding: 8px; width: 232px; }
.xr-palette-title { font-size: 11.5px; font-weight: 600; --xr-c: #424242; margin-top: 2px; }
.xr-palette-grid { display: grid; grid-template-columns: repeat(10, 18px); gap: 4px 4px; }
.xr-palette-grid.tints { gap: 0 4px; }
.xr-swatch { width: 18px; height: 18px; padding: 0; border: 1px solid rgba(0, 0, 0, .12); border-radius: 0; cursor: pointer; }
.xr-swatch:hover { outline: 1px solid #f29436; outline-offset: 0; border-color: #fff; position: relative; z-index: 1; }
.xr-palette-auto, .xr-palette-more {
  display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 6px; border: 0; border-radius: 4px;
  background: transparent; font-size: 12px; cursor: pointer; --xr-c: #242424; text-align: left;
}
.xr-palette-auto:hover, .xr-palette-more:hover { background: #f0f0f0; }
.xr-auto-chip { width: 16px; height: 16px; border: 1px solid #8a8a8a; background: linear-gradient(135deg, #fff 45%, #d13438 45% 55%, #fff 55%); }
.xr-palette-custom { width: 0; height: 0; opacity: 0; border: 0; padding: 0; }

/* ---- Formula bar --------------------------------------------------------------------------- */
.excel-app.xl365 .xr-fbar {
  display: flex; align-items: stretch; gap: 0;
  height: 30px; min-height: 30px; margin: 0; padding: 3px 8px 5px;
  background: var(--xr-bg); border: 0;
  flex: 0 0 auto;
}
.excel-app.xl365 .xr-fbar.expanded { height: 86px; }
.excel-app.xl365 .xr-fbar.hidden-bar { display: none; }
.xr-namebox-wrap {
  position: relative; display: flex; align-items: center; flex: 0 0 auto; width: 104px;
  border: 1px solid var(--xr-border-strong); border-radius: 4px 0 0 4px; background: var(--xr-surface);
}
.excel-app.xl365 .excel-namebox {
  width: 100%; height: 100%; min-width: 0; padding: 0 20px 0 6px; margin: 0;
  border: 0; background: transparent; color: var(--xr-text); outline: none;
  font-family: var(--xr-font); font-size: 12px; text-align: left; box-shadow: none; border-radius: 4px 0 0 4px;
}
.excel-app.xl365 .excel-namebox:focus { box-shadow: inset 0 -2px 0 var(--xr-focus); }
.xr-namebox-drop { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 18px; padding: 0; border: 0; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; --xr-c: var(--xr-text-2); }
.xr-namebox-drop:hover { background: var(--xr-hover); }
.xr-fbar-grip { display: flex; align-items: center; justify-content: center; width: 12px; cursor: ew-resize; --xr-c: var(--xr-text-3); background: var(--xr-surface); border-top: 1px solid var(--xr-border-strong); border-bottom: 1px solid var(--xr-border-strong); }
.xr-fbar-grip .xr-ic { transform: rotate(90deg); --xr-c: var(--xr-text-3); }
.xr-fbar-btns { display: flex; align-items: center; gap: 0; padding: 0 4px; background: var(--xr-surface); border-top: 1px solid var(--xr-border-strong); border-bottom: 1px solid var(--xr-border-strong); border-right: 1px solid var(--xr-border); }
.xr-fx-b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; --xr-c: var(--xr-text-2); }
.xr-fx-b:hover:not(:disabled) { background: var(--xr-hover); }
.xr-fx-b:disabled { opacity: .35; cursor: default; }
.xr-fx-cancel:not(:disabled) .xr-ic { --xr-c: #c50f1f; }
.xr-fx-enter:not(:disabled) .xr-ic { --xr-c: #107c41; }
.xr-fx-glyph { font-family: Cambria, Georgia, "Times New Roman", serif; font-style: italic; font-size: 14px; }
.xr-fbar-edit { position: relative; flex: 1 1 auto; min-width: 0; background: var(--xr-surface); border: 1px solid var(--xr-border-strong); border-left: 0; border-radius: 0 4px 4px 0; }
.excel-app.xl365 .excel-formula-input,
.xr-fbar-mirror {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 3px 26px 3px 8px; border: 0; box-sizing: border-box;
  font-family: var(--xr-grid-font); font-size: 14.5px; line-height: 20px; white-space: pre; overflow: hidden;
  tab-size: 4; letter-spacing: 0;
}
.excel-app.xl365 .excel-formula-input {
  resize: none; outline: none; background: transparent; color: var(--xr-text); caret-color: var(--xr-text); box-shadow: none; border-radius: 0 4px 4px 0;
}
.excel-app.xl365 .xr-fbar.colored .excel-formula-input { color: transparent; }
.excel-app.xl365 .xr-fbar.expanded .excel-formula-input,
.excel-app.xl365 .xr-fbar.expanded .xr-fbar-mirror { white-space: pre-wrap; overflow: auto; }
.xr-fbar-mirror { pointer-events: none; color: var(--xr-text); visibility: hidden; }
.excel-app.xl365 .xr-fbar.colored .xr-fbar-mirror { visibility: visible; }
.excel-app.xl365 .excel-formula-input.ghost { color: var(--xr-text-3); }
.xr-fbar-expand { position: absolute; right: 2px; top: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; --xr-c: var(--xr-text-3); z-index: 1; }
.xr-fbar-expand:hover { background: var(--xr-hover); }
.excel-app.xl365 .excel-fx { display: none; }

/* Reference colours shared by the range finder, formula bar and cell editor. */
.xr-ref-0 { color: #0070c0 !important; } .xr-ref-1 { color: #c00000 !important; } .xr-ref-2 { color: #7030a0 !important; }
.xr-ref-3 { color: #00b050 !important; } .xr-ref-4 { color: #e36c09 !important; } .xr-ref-5 { color: #0e7c7b !important; }
.xr-ref-6 { color: #a5487d !important; } .xr-ref-7 { color: #3d6fb6 !important; }

/* ---- Grid ------------------------------------------------------------------------------------ */
.excel-app.xl365 .excel-grid-scroll { background: var(--xl-cell-bg); margin: 0 8px; border: 1px solid var(--xr-border); border-radius: 6px 6px 0 0; border-bottom: 0; }
.excel-app.xl365 .excel-table { font-family: var(--xl-grid-font); font-size: 14.67px; color: var(--xl-cell-ink); }
.excel-app.xl365 .excel-table th,
.excel-app.xl365 .excel-table td { border: 1px solid var(--xl-gridline); height: 20px; padding: 0 3px; line-height: 18px; }
.excel-app.xl365 .excel-table td.excel-cell { background-color: var(--xl-cell-bg); vertical-align: bottom; }
.excel-app.xl365 .excel-table td.excel-cell.err { color: inherit; }
.excel-app.xl365.no-gridlines .excel-table td { border-color: transparent; }
.excel-app.xl365 .excel-corner,
.excel-app.xl365 .excel-colhead,
.excel-app.xl365 .excel-rowhead {
  background: var(--xl-head-bg); color: var(--xl-head-fg);
  border-color: var(--xl-head-line); font-family: var(--xl-grid-font); font-size: 13.33px; font-weight: 400;
}
.excel-app.xl365 .excel-colhead { vertical-align: middle; }
.excel-app.xl365 .excel-rowhead { text-align: center; padding: 0 2px; }
.excel-app.xl365 .excel-colhead.sel { background: var(--xl-head-sel-bg); color: var(--xl-head-sel-fg); font-weight: 600; box-shadow: inset 0 -2px 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-rowhead.sel { background: var(--xl-head-sel-bg); color: var(--xl-head-sel-fg); font-weight: 600; box-shadow: inset -2px 0 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-colhead.sel.full,
.excel-app.xl365 .excel-rowhead.sel.full { background: var(--xl-head-full-bg); color: var(--xl-head-sel-fg); }
.excel-app.xl365 .excel-corner::after { border-left-color: transparent; border-bottom-color: #bfbfbf; right: 2px; bottom: 2px; border-left-width: 9px; border-bottom-width: 9px; }
.excel-app.xl365.no-headings .excel-corner,
.excel-app.xl365.no-headings .excel-colhead,
.excel-app.xl365.no-headings .excel-rowhead { font-size: 0; color: transparent; }
.excel-app.xl365 .excel-table td.excel-cell.sel { outline: 2px solid var(--xl-accent); outline-offset: -1px; background-color: var(--xl-cell-bg); }
.excel-app.xl365 .excel-table td.excel-cell.in-range { background-color: var(--xl-range-fill); }
.excel-app.xl365 .excel-table td.excel-cell.rng-t { --xl-e-t: inset 0 2px 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-table td.excel-cell.rng-b { --xl-e-b: inset 0 -2px 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-table td.excel-cell.rng-l { --xl-e-l: inset 2px 0 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-table td.excel-cell.rng-r { --xl-e-r: inset -2px 0 0 0 var(--xl-accent); }
.excel-app.xl365 .excel-fillhandle { width: 7px; height: 7px; right: -4px; bottom: -4px; background: var(--xl-accent); box-shadow: 0 0 0 1px var(--xl-cell-bg); }
.excel-app.xl365 .excel-table td.excel-cell.editing { outline: 2px solid var(--xl-accent); outline-offset: -1px; }
.excel-app.xl365 .excel-cell-input { font-family: inherit; font-size: inherit; padding: 0 3px; color: inherit; }
.excel-app.xl365 .excel-table td.formula { font-family: var(--xl-grid-font); font-size: inherit; color: inherit; }

/* Spill ranges: a thin blue frame while any spilled cell is selected. */
.excel-app.xl365 .excel-table td.excel-cell.spill-t { box-shadow: var(--xl-e-t), var(--xl-e-b), var(--xl-e-l), var(--xl-e-r), inset 0 1px 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-b { box-shadow: var(--xl-e-t), var(--xl-e-b), var(--xl-e-l), var(--xl-e-r), inset 0 -1px 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-l { box-shadow: var(--xl-e-t), var(--xl-e-b), var(--xl-e-l), var(--xl-e-r), inset 1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-r { box-shadow: var(--xl-e-t), var(--xl-e-b), var(--xl-e-l), var(--xl-e-r), inset -1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-t.spill-l { box-shadow: inset 0 1px 0 0 #5b9bd5, inset 1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-t.spill-r { box-shadow: inset 0 1px 0 0 #5b9bd5, inset -1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-b.spill-l { box-shadow: inset 0 -1px 0 0 #5b9bd5, inset 1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-b.spill-r { box-shadow: inset 0 -1px 0 0 #5b9bd5, inset -1px 0 0 0 #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-t.spill-b.spill-l.spill-r { box-shadow: inset 0 0 0 1px #5b9bd5; }
.excel-app.xl365 .excel-table td.excel-cell.spill-blocked { box-shadow: none; outline: 1px dashed #5b9bd5; outline-offset: -2px; }
.excel-app.xl365 .excel-table td.excel-cell.sel.spill-blocked { outline: 2px solid var(--xl-accent); }

/* Accounting-style fill: "$" at the left edge, the number at the right. */
.excel-app.xl365 .excel-table td.fmt-fill { padding: 0; }
.fmt-fill-row { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; padding: 0 3px; box-sizing: border-box; white-space: pre; }
.excel-app.xl365 .excel-table td.excel-cell { white-space: pre; }

/* Filter buttons and data-validation arrows look like Excel's. */
.excel-app.xl365 .excel-filterbtn {
  width: 17px; height: 17px; right: 2px; bottom: 1px; top: auto; border-radius: 2px;
  border: 1px solid #c8c8c8; background: #fff; color: #444; font-size: 9px;
}
.excel-app.xl365 .excel-filterbtn.on { background: #fff; border-color: var(--xl-accent); color: var(--xl-accent); }

/* ---- Sheet bar ------------------------------------------------------------------------------------ */
.xr-sheetbar {
  display: flex; align-items: stretch; flex: 0 0 auto; height: 30px; margin: 0 8px;
  background: var(--xr-surface); border: 1px solid var(--xr-border); border-top: 1px solid var(--xl-head-line); border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.xr-sheetnav { display: flex; align-items: center; gap: 0; padding: 0 2px 0 4px; flex: 0 0 auto; }
.xr-nav-b { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; --xr-c: var(--xr-text-3); font-size: 13px; letter-spacing: -.05em; }
.xr-nav-b:hover { background: var(--xr-hover); --xr-c: var(--xr-text); }
.xr-nav-b.more { width: 18px; }
.excel-app.xl365 .xr-sheets {
  display: flex; align-items: stretch; gap: 0; padding: 0; margin: 0; flex: 0 1 auto; min-width: 0;
  background: transparent; border: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.excel-app.xl365 .xr-sheets::-webkit-scrollbar { display: none; }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab {
  position: relative; height: auto; margin: 0; padding: 0 16px; border: 0; border-radius: 0; border-right: 1px solid var(--xr-border);
  background: transparent; color: var(--xr-text-2); --xr-c: var(--xr-text-2); font-size: 12.5px; white-space: nowrap; cursor: pointer; box-shadow: none;
}
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab:hover { background: var(--xr-hover); }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab.active { background: var(--xr-surface); color: var(--xr-accent); --xr-c: var(--xr-accent); font-weight: 600; }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 3px; border-radius: 2px; background: var(--xr-accent); }
/* Grouped sheets ([Group]): selected like the active tab, without its weight. */
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab.grouped { background: var(--xr-surface); color: var(--xr-accent); --xr-c: var(--xr-accent); }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab.grouped::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--xr-accent); opacity: .6; }
#os#os .excel-app.xl365 .xr-sheets .excel-tab.xr-stab.grouped { background-color: var(--xr-surface) !important; color: var(--xr-accent) !important; }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab .xr-stab-color { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.excel-app.xl365 .xr-sheets .excel-tab.xr-stab.active .xr-stab-color { opacity: .55; height: 100%; z-index: -1; }
.excel-app.xl365 .xr-sheets .xr-stab-edit { height: 22px; width: 110px; margin: 3px 6px; padding: 0 4px; border: 1px solid var(--xr-accent); border-radius: 2px; font: inherit; font-size: 12.5px; outline: none; color: var(--xr-text); background: var(--xr-surface); }
.xr-sheet-add { display: inline-flex; align-items: center; justify-content: center; width: 30px; flex: 0 0 auto; padding: 0; border: 0; background: transparent; cursor: pointer; --xr-c: var(--xr-text-3); }
.xr-sheet-add:hover .xr-ic { --xr-c: var(--xr-accent); }
.xr-sheetbar-split { width: 6px; flex: 0 0 auto; cursor: ew-resize; background: linear-gradient(90deg, transparent 2px, var(--xr-border-strong) 2px 3px, transparent 3px 4px, var(--xr-border-strong) 4px 5px, transparent 5px); margin: 7px 2px; }
.xr-hscroll { flex: 1 1 auto; min-width: 60px; overflow-x: auto; overflow-y: hidden; height: 100%; display: flex; align-items: center; }
.xr-hscroll-inner { height: 1px; }

/* ---- Status bar ---------------------------------------------------------------------------------- */
.xr-sbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 26px; padding: 0 10px 0 14px; flex: 0 0 auto;
  background: var(--xr-bg); --xr-c: var(--xr-text-2); font-size: 12px;
  user-select: none; -webkit-user-select: none;
}
.xr-sbar-left, .xr-sbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.xr-sbar-mode { min-width: 40px; white-space: nowrap; }
.xr-sbar-extra { white-space: nowrap; --xr-c: var(--xr-text-2); }
.xr-sbar-extra:empty { display: none; }
.xr-sbar-item, .xr-sbar-agg {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; border: 0; border-radius: 3px;
  background: transparent; --xr-c: var(--xr-text-2); font-size: 12px; cursor: default; white-space: nowrap;
}
.xr-sbar-item:hover, .xr-sbar-agg:hover { background: var(--xr-hover-chrome); }
.xr-sbar-agg:empty { display: none; }
.xr-sbar-agg .xr-agg-part + .xr-agg-part { margin-left: 18px; }
.xr-views { display: flex; align-items: center; gap: 2px; }
.xr-view-b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.xr-view-b:hover { background: var(--xr-hover-chrome); }
.xr-view-b.active { background: var(--xr-checked); }
.xr-zoom { display: flex; align-items: center; gap: 4px; }
.xr-zoom-b { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 3px; background: transparent; cursor: pointer; --xr-c: var(--xr-text-2); font-size: 15px; line-height: 1; }
.xr-zoom-b:hover { background: var(--xr-hover-chrome); }
.excel-app.xl365 .xr-zoom-slider { width: 100px; height: 14px; margin: 0; accent-color: var(--xr-text-2); background: transparent; }
.xr-zoom-pct { min-width: 44px; height: 22px; padding: 0 4px; border: 0; border-radius: 3px; background: transparent; --xr-c: var(--xr-text-2); font-size: 12px; text-align: right; cursor: pointer; }
.xr-zoom-pct:hover { background: var(--xr-hover-chrome); }

/* ---- Key tips ---------------------------------------------------------------------------------------- */
.xr-keytip-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10070; }
.xr-keytip {
  position: absolute; transform: translate(-2px, -4px);
  min-width: 14px; height: 18px; padding: 0 4px; border-radius: 3px;
  background: #333; color: #fff; font: 600 11px/18px "Segoe UI", -apple-system, Arial, sans-serif; text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.xr-keytip.centered { transform: translate(-50%, -4px); }
.xr-keytip.dim { opacity: .25; }

/* ---- Theme guard ------------------------------------------------------------------------------------
 * css/app-color-themes.css forces colour on every span/button/label in a window
 * and background/border on inputs and class names ending -btn, -pane, -tab…
 * (all !important). Excel's chrome keeps its own palette — which already follows
 * the window's light/dark tone above — so it re-asserts it here. `#os#os`
 * out-ranks the theme's `#os .window[…]` selectors.
 */
#os#os .excel-app.xl365 :is([class^="xr-"], [class*=" xr-"]) { color: var(--xr-c) !important; }
#os#os .excel-app.xl365 .xr-ic svg text { fill: currentColor !important; }
#os#os .excel-app.xl365 .xr-ic .g-text { fill: var(--xr-ic-green) !important; }
#os#os .excel-app.xl365 { background: var(--xr-bg) !important; color: var(--xr-text) !important; }
#os#os .excel-app.xl365 :is(.xr-titlebar, .xr-ribbon, .xr-tabrow, .xr-sbar, .xr-fbar) { background-color: var(--xr-bg) !important; border-color: transparent !important; }
#os#os .excel-app.xl365 .xr-ribbon-body { background-color: var(--xr-surface) !important; }
#os#os .excel-app.xl365 .xr-sheetbar { background-color: var(--xr-surface) !important; border-color: var(--xr-border) !important; }
#os#os .excel-app.xl365 .xr-cmd:not(.active):not(:hover) { background-color: transparent !important; border-color: transparent !important; }
#os#os .excel-app.xl365 .xr-cmd.active { background-color: var(--xr-checked) !important; border-color: var(--xr-checked-border) !important; }
#os#os .excel-app.xl365 .xr-cmd:hover:not(.disabled):not(:disabled) { background-color: var(--xr-hover) !important; }
#os#os .excel-app.xl365 :is(.xr-qat-b, .xr-rtab, .xr-autosave, .xr-docname, .xr-nav-b, .xr-sheet-add, .xr-view-b, .xr-zoom-b, .xr-zoom-pct, .xr-fx-b, .xr-namebox-drop, .xr-fbar-expand, .xr-combo-drop, .xr-launcher, .xr-ribbon-collapse, .xr-sbar-item, .xr-sbar-agg):not(:hover):not(.active) { background-color: transparent !important; border-color: transparent !important; }
#os#os .excel-app.xl365 .xr-rtab.active { background-color: transparent !important; }
#os#os .excel-app.xl365 :is(.xr-combo-input, .xr-spin-input, .excel-namebox, .excel-formula-input) {
  color: var(--xr-text) !important; background-color: var(--xr-surface) !important; border-color: var(--xr-border-strong) !important;
}
#os#os .excel-app.xl365 .excel-namebox { border-color: transparent !important; background-color: transparent !important; }
#os#os .excel-app.xl365 .excel-formula-input { border-color: transparent !important; background-color: transparent !important; }
#os#os .excel-app.xl365 .xr-fbar.colored .excel-formula-input { color: transparent !important; }
#os#os .excel-app.xl365 .excel-formula-input.ghost { color: var(--xr-text-3) !important; }
#os#os .excel-app.xl365 :is(.xr-namebox-wrap, .xr-fbar-edit, .xr-fbar-btns, .xr-fbar-grip) { background-color: var(--xr-surface) !important; }
#os#os .excel-app.xl365 .excel-grid-scroll { background-color: var(--xl-cell-bg) !important; }
#os#os .excel-app.xl365 .excel-table :is(th.excel-colhead, th.excel-rowhead, th.excel-corner) { background-color: var(--xl-head-bg) !important; color: var(--xl-head-fg) !important; border-color: var(--xl-head-line) !important; }
#os#os .excel-app.xl365 .excel-table :is(th.excel-colhead.sel, th.excel-rowhead.sel) { background-color: var(--xl-head-sel-bg) !important; color: var(--xl-head-sel-fg) !important; }
#os#os .excel-app.xl365 .excel-table :is(th.excel-colhead.sel.full, th.excel-rowhead.sel.full) { background-color: var(--xl-head-full-bg) !important; }
#os#os .excel-app.xl365 .xr-sheets .excel-tab.xr-stab { background-color: transparent !important; color: var(--xr-text-2) !important; border-color: var(--xr-border) !important; }
#os#os .excel-app.xl365 .xr-sheets .excel-tab.xr-stab:hover { background-color: var(--xr-hover) !important; }
#os#os .excel-app.xl365 .xr-sheets .excel-tab.xr-stab.active { background-color: var(--xr-surface) !important; color: var(--xr-accent) !important; }
#os#os .excel-app.xl365 .xr-trb.primary { color: #fff !important; background-color: var(--xr-accent) !important; border-color: var(--xr-accent) !important; }
#os#os .excel-app.xl365 .xr-searchslot .xl-fnsearch-field { background: var(--xr-surface) !important; border-color: transparent !important; color: var(--xr-text) !important; }
#os#os .excel-app.xl365 .xr-searchslot .xl-fnsearch-input { background: transparent !important; color: var(--xr-text) !important; border-color: transparent !important; }
#os#os .excel-app.xl365 .xr-avatar { background-color: #8764b8 !important; color: #fff !important; }
#os#os .excel-app.xl365 .xr-toggle { background-color: transparent !important; border-color: var(--xr-text-3) !important; }
#os#os .excel-app.xl365 .xr-toggle.on { background-color: var(--xr-accent) !important; border-color: var(--xr-accent) !important; }

/* ---- Dialog boxes (ui/dialog.js), portalled to <body> ------------------------------------------ */
.xd-backdrop { position: fixed; inset: 0; z-index: 10080; background: transparent; }
.xd-backdrop.collapsed { pointer-events: none; }
.xd-dialog {
  position: fixed; min-width: 220px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  display: flex; flex-direction: column;
  color: #242424; background: #ffffff; border: 1px solid rgba(0, 0, 0, .18); border-radius: 8px;
  box-shadow: 0 0 2px rgba(0, 0, 0, .12), 0 16px 32px rgba(0, 0, 0, .2);
  font: 12px/1.35 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.xd-dialog.collapsed { pointer-events: auto; max-height: 64px; overflow: hidden; }
.xd-dialog.collapsed .xd-body > :not(:has(.xd-refedit)) { display: none; }
.xd-dialog.collapsed .xd-footer { display: none; }
.xd-dialog * { box-sizing: border-box; }
.xd-titlebar { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 4px 0 14px; cursor: default; user-select: none; }
.xd-title-text { font-size: 12px; color: #242424; }
.xd-tbtns { display: flex; gap: 2px; }
.xd-tbtn { width: 30px; height: 26px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #424242; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.xd-tbtn:hover { background: #f0f0f0; }
.xd-tbtn.xd-x:hover { background: #c42b1c; color: #fff; }
.xd-tbtn.xd-x:hover .xr-ic { --xr-c: #fff; color: #fff; }
.xd-body { padding: 4px 16px 12px; overflow: auto; min-height: 0; }
.xd-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 14px; }
.xd-footer-left { display: flex; align-items: center; gap: 8px; }
.xd-footer-right { display: flex; gap: 8px; margin-left: auto; }
.xd-button {
  min-width: 76px; height: 28px; padding: 0 12px; border: 1px solid #d1d1d1; border-radius: 4px;
  background: #fff; color: #242424; font: inherit; cursor: pointer;
}
.xd-button:hover:not(:disabled) { background: #f5f5f5; border-color: #c7c7c7; }
.xd-button:active:not(:disabled) { background: #e0e0e0; }
.xd-button.primary { background: #107c41; border-color: #107c41; color: #fff; font-weight: 600; }
.xd-button.primary:hover:not(:disabled) { background: #0e6f3a; border-color: #0e6f3a; }
.xd-button:disabled { opacity: .45; cursor: default; }
.xd-button.small { min-width: 0; height: 24px; padding: 0 8px; }
.xd-button:focus-visible { outline: 2px solid #107c41; outline-offset: 1px; }
.xd-link { color: #0f6cbd; text-decoration: none; font-size: 12px; }
.xd-link:hover { text-decoration: underline; }

.xd-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e0e0e0; margin: 0 -16px 10px; padding: 0 12px; }
.xd-tabb { position: relative; height: 32px; padding: 0 10px; border: 0; background: transparent; color: #424242; font: inherit; cursor: pointer; }
.xd-tabb:hover { color: #242424; background: #f5f5f5; border-radius: 4px 4px 0 0; }
.xd-tabb.active { color: #107c41; font-weight: 600; }
.xd-tabb.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 2px; background: #107c41; }
.xd-tabpage { min-height: 360px; }
.xd-group { margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid #e0e0e0; border-radius: 6px; min-width: 0; }
.xd-group legend { padding: 0 4px; font-weight: 600; color: #242424; }
.xd-label { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 3px; color: #242424; white-space: nowrap; }
.xd-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0; }
.xd-colm { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.xd-colm.grow { flex: 1 1 auto; }
.xd-text, .xd-select, .xd-textarea {
  height: 26px; padding: 0 6px; border: 1px solid #d1d1d1; border-bottom-color: #8a8a8a; border-radius: 4px;
  background: #fff; color: #242424; font: inherit; outline: none; min-width: 0;
}
.xd-textarea { height: auto; padding: 4px 6px; width: 100%; resize: vertical; }
.xd-text:focus, .xd-select:focus, .xd-textarea:focus { border-bottom: 2px solid #107c41; }
.xd-text.mono { font-family: Consolas, "Cascadia Code", Menlo, monospace; }
.xd-num { text-align: right; }
.xd-check, .xd-radio { display: flex; align-items: center; gap: 7px; min-height: 24px; color: #242424; cursor: pointer; }
.xd-check input, .xd-radio input { width: 15px; height: 15px; margin: 0; accent-color: #107c41; }
.xd-check.disabled, .xd-sub.disabled .xd-check { color: #a0a0a0; pointer-events: none; }
.xd-radios { display: flex; gap: 12px; }
.xd-radios.col { flex-direction: column; gap: 0; }
.xd-list { overflow: auto; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; outline: none; padding: 2px; }
.xd-list:focus { border-color: #107c41; }
.xd-list-item { padding: 3px 8px; border-radius: 3px; cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-list-item:hover { background: #f5f5f5; }
.xd-list-item.selected { background: #cde8d7; color: #0c3d20; }
.xd-list:focus .xd-list-item.selected { background: #107c41; color: #fff; }
.xd-list:focus .xd-list-item.selected * { color: #fff !important; }
.xd-refedit { display: inline-flex; align-items: stretch; }
.xd-refedit .xd-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.xd-refbtn { width: 24px; border: 1px solid #d1d1d1; border-left: 0; border-radius: 0 4px 4px 0; background: #fafafa; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.xd-refbtn:hover { background: #f0f0f0; }
.xd-note { margin: 8px 0 0; color: #616161; font-size: 11.5px; }
/* Message boxes (alert / confirm / prompt) */
.xd-msg { display: flex; gap: 14px; align-items: flex-start; padding: 4px 2px 6px; }
.xd-msg-ic { flex: 0 0 32px; width: 32px; height: 32px; }
.xd-msg-ic svg { display: block; }
.xd-msg-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 10px; }
.xd-msg-text { white-space: pre-line; line-height: 1.45; padding-top: 6px; overflow-wrap: anywhere; }
.xd-msg-input { width: 100%; }
.xd-preview { display: flex; align-items: center; justify-content: center; min-height: 54px; border: 1px solid #e0e0e0; background: #fff; overflow: hidden; }
.xd-inline-actions { display: flex; gap: 6px; margin-top: 6px; }

/* Format Cells */
.xd-numpage { display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 14px; }
.xd-numpage > .xd-note { grid-column: 1 / -1; }
.xd-numright { min-width: 0; }
.xd-sample-box { min-height: 22px; padding: 2px 4px; font-family: "Aptos Narrow", Aptos, Calibri, sans-serif; font-size: 14px; }
.xd-numopts { display: flex; flex-direction: column; gap: 2px; }
.xd-alignpage { display: flex; gap: 12px; }
.xd-orient { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.xd-vtext { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 26px; height: 128px; border: 1px solid #d1d1d1; border-radius: 3px; background: #fff; cursor: pointer; font-size: 12px; line-height: 1.05; }
.xd-vtext.on { background: #cde8d7; border-color: #107c41; }
.xd-dial { position: relative; width: 130px; height: 130px; border: 1px solid #e0e0e0; border-radius: 0 65px 65px 0; border-left: 0; cursor: pointer; }
.xd-dial-dot { position: absolute; left: 0; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #242424; transform-origin: 0 50%; }
.xd-dial-hand { position: absolute; left: 0; top: 50%; width: 60px; height: 0; border-top: 1px solid #c00000; transform-origin: 0 0; }
.xd-dial-hand span { position: absolute; left: 6px; top: -9px; font-size: 11px; color: #242424; }
.xd-fontpage { display: flex; flex-direction: column; gap: 6px; }
.xd-font-top { display: grid; grid-template-columns: minmax(0, 1fr) 124px 64px; gap: 10px; }
.xd-font-mid { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; }
.xd-font-bot { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; }
.xd-font-preview { font-size: 18px; }
.xd-colorbtn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 26px; min-width: 110px; padding: 0 8px; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; cursor: pointer; }
.xd-colorbtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.xd-colorchip { width: 36px; height: 14px; border: 1px solid rgba(0, 0, 0, .2); }
.xd-borderpage { display: flex; gap: 14px; }
.xd-linegrid { display: grid; grid-template-columns: repeat(2, 64px); gap: 2px; padding: 4px; border: 1px solid #e0e0e0; background: #fff; }
.xd-linestyle { height: 18px; padding: 0 4px; border: 1px solid transparent; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.xd-linestyle.selected { border-color: #107c41; background: #e7f3ec; }
.xd-line { display: block; width: 100%; height: 0; }
.xd-none { font-size: 11px; }
.xd-presets { display: flex; gap: 22px; justify-content: center; }
.xd-preset { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font: inherit; }
.xd-preset:hover { background: #f5f5f5; border-color: #e0e0e0; }
.xd-border-edit { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 1fr auto; gap: 6px; }
.xd-border-left { display: flex; flex-direction: column; justify-content: space-between; }
.xd-border-under { grid-column: 2; display: flex; justify-content: space-between; }
.xd-sidebtn { width: 30px; height: 28px; padding: 0; border: 1px solid #d1d1d1; border-radius: 3px; background: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.xd-sidebtn:hover { background: #f5f5f5; }
.xd-border-box { position: relative; display: flex; align-items: center; justify-content: center; height: 110px; margin: 4px; background: #fff; outline: 1px dotted #c8c8c8; }
.xd-border-box.du { background: linear-gradient(to top right, transparent calc(50% - 1px), #000 50%, transparent calc(50% + 1px)); }
.xd-border-box.dd { background: linear-gradient(to bottom right, transparent calc(50% - 1px), #000 50%, transparent calc(50% + 1px)); }
.xd-border-text { color: #444; }
.xd-fillpage { display: flex; gap: 24px; }
.xd-swatches { display: flex; flex-direction: column; gap: 6px; }
.xd-nocolor { height: 26px; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; font: inherit; cursor: pointer; }
.xd-swatch-grid { display: grid; grid-template-columns: repeat(10, 18px); gap: 3px; }
.xd-swatch-grid.tints { gap: 0 3px; }
.xd-swatch { width: 18px; height: 18px; padding: 0; border: 1px solid rgba(0, 0, 0, .12); cursor: pointer; }
.xd-swatch.selected, .xd-swatch:hover { outline: 2px solid #f29436; outline-offset: 0; }
.xd-fill-sample { height: 56px; border: 1px solid #e0e0e0; }
.xd-protpage { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }

/* Insert Function / Function Arguments */
.xd-insertfn { display: flex; flex-direction: column; gap: 2px; }
.xd-insertfn .xd-row > .xd-text { flex: 1 1 auto; }
.xd-fn-sig { margin-top: 8px; font-size: 12px; }
.xd-fn-sig b { font-weight: 700; }
.xd-fn-desc { min-height: 34px; margin-top: 4px; color: #242424; }
.xd-args { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow: auto; }
.xd-arg-row { display: grid; grid-template-columns: 110px 244px 14px minmax(0, 1fr); align-items: center; gap: 4px; }
.xd-arg-name { text-align: right; color: #242424; }
.xd-arg-name.req { font-weight: 700; }
.xd-arg-val { color: #616161; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xd-fn-result-row { display: flex; gap: 6px; justify-content: flex-end; color: #616161; margin: 2px 0; }
.xd-fn-result-row.bottom { justify-content: flex-start; margin-top: 10px; color: #242424; }
.xd-arg-help { min-height: 36px; margin-top: 8px; padding-left: 40px; color: #242424; }
.xd-arg-help b { font-weight: 700; }

/* Go To Special, Name Manager, misc */
.xd-gts-grid { display: grid; grid-template-columns: 1fr 1fr; }
.xd-gts-grid .xd-radios { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; grid-column: 1 / -1; }
.xd-sub { grid-column: 1; padding-left: 22px; margin-top: -2px; }
.xd-namemgr .xd-row { margin-bottom: 8px; }
.xd-nm-row { display: grid; grid-template-columns: 1.1fr 1fr 1.3fr .7fr 1fr; gap: 8px; }
.xd-nm-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-nm-row.head { padding: 2px 10px; font-weight: 600; color: #424242; }
.xd-hyperlink { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; }
.xd-hl-side { display: flex; flex-direction: column; gap: 4px; }
.xd-hl-mode { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; font: inherit; cursor: pointer; text-align: center; }
.xd-hl-mode:hover { background: #f5f5f5; }
.xd-hl-mode.active { background: #e7f3ec; border-color: #107c41; }
.xd-hl-page { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.xd-symgrid { display: grid; grid-template-columns: repeat(16, 1fr); border-top: 1px solid #d1d1d1; border-left: 1px solid #d1d1d1; max-height: 230px; overflow: auto; margin: 8px 0; }
.xd-sym { height: 28px; border: 0; border-right: 1px solid #d1d1d1; border-bottom: 1px solid #d1d1d1; background: #fff; font-size: 16px; cursor: pointer; }
.xd-sym:hover { background: #f0f0f0; }
.xd-sym.selected { background: #107c41; color: #fff; }
.xd-symcode { color: #616161; }
.xd-checklist { max-height: 170px; overflow: auto; border: 1px solid #d1d1d1; border-radius: 4px; padding: 2px 6px; }
.xd-eval-box { min-height: 90px; margin: 6px 0; padding: 8px; border: 1px solid #d1d1d1; border-radius: 4px; font-family: "Aptos Narrow", Aptos, Calibri, sans-serif; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
.xd-eval-box u { text-decoration-thickness: 2px; }
.xd-infotable { width: 100%; border-collapse: collapse; }
.xd-infotable td { padding: 4px 6px; border-bottom: 1px solid #eee; }
.xd-infotable td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.xd-shortcut-wrap { display: flex; flex-direction: column; gap: 8px; }
.xd-shortcuts { max-height: 60vh; overflow: auto; }
.xd-shortcuts h4 { margin: 12px 0 4px; font-size: 12px; color: #107c41; }
.xd-shortcuts table { width: 100%; border-collapse: collapse; }
.xd-shortcuts td { padding: 3px 4px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.xd-shortcuts td:first-child { width: 48%; white-space: nowrap; }
.xd-shortcuts kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid #d1d1d1; border-bottom-width: 2px; border-radius: 3px; background: #fafafa; font: 11px/17px "Segoe UI", -apple-system, sans-serif; text-align: center; }

/* ---- File view (backstage) --------------------------------------------------------------------- */
.excel-app.xl365 { position: relative; }
.xb-backstage {
  position: absolute; inset: 0; z-index: 60; display: grid; grid-template-columns: 180px minmax(0, 1fr);
  background: #ffffff; color: #242424; font-family: var(--xr-font); font-size: 13px;
}
.xb-rail { display: flex; flex-direction: column; padding: 8px 0; background: #107c41; color: #fff; overflow: auto; }
.xb-back { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 0 8px 8px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.xb-back .xr-ic { --xr-c: #fff; color: #fff; }
.xb-back:hover { background: rgba(255, 255, 255, .15); }
.xb-item { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 18px; border: 0; background: transparent; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.xb-item .xr-ic { --xr-c: #fff; color: #fff; }
.xb-item .xr-ic .g, .xb-item .xr-ic .a, .xb-item .xr-ic .r, .xb-item .xr-ic .o { fill: #fff; }
.xb-item .xr-ic .g-s, .xb-item .xr-ic .a-s, .xb-item .xr-ic .r-s { stroke: #fff; }
.xb-item:hover { background: rgba(255, 255, 255, .14); }
.xb-item.active { background: rgba(0, 0, 0, .22); }
.xb-rail-sep { height: 1px; margin: 8px 16px; background: rgba(255, 255, 255, .35); }
.xb-rail-spacer { flex: 1 1 auto; }
.xb-page { overflow: auto; padding: 28px 44px; }
.xb-h1 { margin: 0 0 22px; font-size: 32px; font-weight: 300; }
.xb-h3 { margin: 18px 0 8px; font-size: 14px; font-weight: 600; }
.xb-greet { margin: 0 0 18px; font-size: 26px; font-weight: 300; }
.xb-muted { color: #616161; }
.xb-templates { display: flex; gap: 18px; flex-wrap: wrap; }
.xb-template { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 150px; padding: 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; cursor: pointer; }
.xb-template:hover { background: #f5f5f5; border-color: #e0e0e0; }
.xb-thumb { display: flex; align-items: center; justify-content: center; width: 140px; height: 104px; border: 1px solid #d1d1d1; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.xb-blank-grid { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; height: 100%; }
.xb-blank-grid i { border-right: 1px solid #e8e8e8; border-bottom: 1px solid #e8e8e8; }
.xb-recent-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px; border-radius: 4px; }
.xb-recent-row:hover { background: #f5f5f5; }
.xb-tile { display: flex; align-items: center; gap: 14px; width: min(520px, 100%); padding: 12px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.xb-tile:hover { background: #f5f5f5; border-color: #e0e0e0; }
.xb-tile.disabled { opacity: .6; cursor: default; }
.xb-tile.setting { padding: 6px 10px; border-color: #e0e0e0; }
.xb-tile-text { display: flex; flex-direction: column; gap: 2px; }
.xb-tile-text span { color: #616161; font-size: 12px; }
.xb-info-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; }
.xb-infoblock { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid #eee; }
.xb-infobtn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid #d1d1d1; border-radius: 4px; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.xb-infobtn:hover { background: #f5f5f5; }
.xb-infobtn.disabled { opacity: .5; cursor: default; }
.xb-prop { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; padding: 5px 0; font-size: 12.5px; }
.xb-prop span:first-child { color: #616161; }
.xb-print-cols { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 30px; }
.xb-print-go { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; width: 90px; padding: 10px; border: 1px solid #d1d1d1; border-radius: 6px; background: #fff; font: inherit; cursor: pointer; }
.xb-print-go:hover { background: #f5f5f5; }
.xb-print-preview { display: flex; align-items: center; justify-content: center; min-height: 360px; background: #f3f3f3; border-radius: 6px; }
.xb-link { border: 0; background: none; color: #0f6cbd; font: inherit; cursor: pointer; padding: 6px 0; }
.xb-link:hover { text-decoration: underline; }
.xb-account { display: flex; align-items: center; gap: 14px; }
.xb-avatar { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: #8764b8; color: #fff; font-size: 18px; font-weight: 600; }
#os#os .excel-app.xl365 .xb-backstage { background: #ffffff !important; color: #242424 !important; }
#os#os .excel-app.xl365 .xb-rail { background: #107c41 !important; }
#os#os .excel-app.xl365 .xb-backstage :is(button, span, b, h1, h2, h3, p, div) { color: inherit !important; }
#os#os .excel-app.xl365 .xb-rail :is(button, span) { color: #fff !important; background-color: transparent; }
#os#os .excel-app.xl365 .xb-item.active { background-color: rgba(0, 0, 0, .22) !important; }

/* ---- Notes, hyperlinks, trace arrows, page breaks ----------------------------------------------- */
.excel-app.xl365 .excel-table td.has-note { position: relative; }
.excel-app.xl365 .excel-table td.has-note::after {
  content: ""; position: absolute; top: 0; right: 0; width: 0; height: 0;
  border-top: 6px solid #c00000; border-left: 6px solid transparent; pointer-events: none;
}
.xl-note {
  position: absolute; z-index: 40; min-width: 140px; max-width: 260px; min-height: 60px; padding: 4px 6px;
  background: #ffffe1; color: #000; border: 1px solid #6e6e6e; box-shadow: 2px 2px 4px rgba(0, 0, 0, .25);
  font: 12px/1.35 Tahoma, "Segoe UI", sans-serif; white-space: pre-wrap; word-break: break-word;
}
.xl-note::before { content: ""; position: absolute; left: -12px; top: 8px; width: 12px; height: 1px; background: #6e6e6e; }
.xl-note b { font-weight: 700; }
.xl-note.editing { padding: 0; }
.xl-note-text { display: block; width: 200px; height: 90px; margin: 0; padding: 4px 6px; border: 0; outline: 2px solid #107c41; background: #ffffe1; color: #000; font: inherit; resize: both; }
.excel-app.xl365 .excel-table td.has-link { cursor: pointer; }
.xl-trace-layer { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 30; overflow: visible; }
.excel-app.xl365.picking-range .excel-grid-scroll { outline: 2px dashed #107c41; outline-offset: -2px; }
.excel-app.xl365 .xr-stab.drop { box-shadow: inset 3px 0 0 #107c41; }
.xr-cellstyle-gallery, .xr-tablestyle-gallery { width: 620px; padding: 6px; }
.xr-gal-section { margin-bottom: 6px; }
.xr-gal-title { padding: 4px 6px; font-weight: 600; font-size: 11.5px; color: #424242; }
.xr-gal-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.xr-gal-grid.tables { grid-template-columns: repeat(7, 1fr); }
.xr-cellstyle { height: 26px; padding: 0 6px; border: 1px solid #d9d9d9; font: 12px "Aptos Narrow", Calibri, sans-serif; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.xr-cellstyle:hover { outline: 2px solid #f29436; }
.xr-tstile { display: flex; align-items: center; justify-content: center; height: 46px; padding: 3px; border: 1px solid transparent; border-radius: 3px; background: #fff; cursor: pointer; }
.xr-tstile:hover, .xr-tstile.active { border-color: #107c41; }
.xr-tsprev { display: flex; flex-direction: column; width: 60px; height: 38px; border: 1px solid #e0e0e0; }
.xr-tsrow { display: flex; flex: 1 1 0; gap: 3px; align-items: center; padding: 0 4px; }
.xr-tsrow i { flex: 1 1 0; height: 2px; border-radius: 1px; }

/* Ribbon scaling: compact groups drop small-button captions; collapsed
   groups become one button that drops the group down. */
.xr-group.compact .xr-small .xr-small-text { display: none; }
.xr-group.compact .xr-small { padding: 0 3px; }
.xr-group.collapsed { padding: 0 2px; }
.xr-collapsed-group { min-width: 52px; }
.xr-group-popover { padding: 6px 8px 0; }
.xr-group-pop { display: flex; flex-direction: column; align-items: stretch; min-height: 92px; }
.xr-group-pop > .xr-cols, .xr-group-pop > .xr-rows { height: 72px; }
.xr-group-pop .xr-group-label { height: 20px; font-size: 11.5px; color: #616161; display: flex; align-items: center; justify-content: center; }
.xr-group-pop .xr-cmd { --xr-c: #242424; color: #242424; }
.xr-group-pop .xr-cmd:hover { background: #f0f0f0; }
.xr-group-pop .xr-combo-input { height: 24px; border: 1px solid #d1d1d1; border-radius: 4px; padding: 0 20px 0 6px; font-size: 12px; }
.xr-group-pop .xr-combo { position: relative; display: inline-flex; align-items: center; height: 24px; margin-right: 3px; }
.xr-group-pop .xr-combo-drop { position: absolute; right: 1px; top: 1px; bottom: 1px; width: 18px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.xr-group-pop .xr-rows { display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.xr-group-pop .xr-row { display: flex; align-items: center; gap: 1px; min-height: 24px; }
.xr-group-pop .xr-cols { display: flex; align-items: flex-start; gap: 2px; }
.xr-group-pop .xr-col { display: flex; flex-direction: column; }
.xr-group-pop .xr-big { flex-direction: column; justify-content: flex-start; gap: 2px; min-width: 44px; max-width: 78px; height: 70px; padding: 3px 4px 2px; white-space: normal; text-align: center; }
.xr-group-pop .xr-big-top { display: flex; align-items: center; justify-content: center; height: 34px; }
.xr-group-pop .xr-big-label { display: flex; flex-direction: column; align-items: center; line-height: 14px; }
.xr-group-pop .xr-small { height: 24px; padding: 0 4px 0 3px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 12px; }
.xr-group-pop .xr-small .xr-split-main { display: inline-flex; align-items: center; gap: 5px; }
.xr-group-pop .xr-icon { height: 24px; min-width: 24px; justify-content: center; padding: 0 3px; display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 4px; background: transparent; }
.xr-group-pop .xr-sep { display: inline-block; width: 1px; height: 18px; margin: 0 4px; background: #e0e0e0; }
.xr-group-pop .xr-cmd.active { background: #e1dfdd; border-color: #c8c6c4; }
.xr-fit-label { display: inline-flex; align-items: center; gap: 4px; min-width: 64px; font-size: 12px; --xr-c: var(--xr-text); }

/* ---- In-cell editor overlay, range finder, AutoComplete ------------------------------------------ */
.excel-app.xl365 .excel-table td.excel-cell.editing { outline: none; background: var(--xl-cell-bg); }
.xl-editor-box {
  position: absolute; z-index: 25; box-sizing: border-box;
  background: var(--xl-cell-bg, #fff); outline: 2px solid var(--xl-accent, #107c41); outline-offset: -1px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .6);
}
.xl-cell-editor, .xl-editor-mirror {
  position: absolute; inset: 0; width: 100%; height: 100%; box-sizing: border-box;
  margin: 0; padding: 0 3px; border: 0; background: transparent;
  font-family: var(--xl-grid-font); font-size: 14.67px; line-height: 19px; white-space: pre; overflow: hidden;
  color: var(--xl-cell-ink, #000); letter-spacing: 0; tab-size: 4;
}
.xl-cell-editor { resize: none; outline: none; caret-color: var(--xl-cell-ink, #000); z-index: 1; }
.xl-editor-mirror { pointer-events: none; visibility: hidden; }
.xl-editor-box.formula .xl-editor-mirror { visibility: visible; }
.xl-finder-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 24; pointer-events: none; }
.xl-finder { position: absolute; box-sizing: border-box; border: 2px solid; pointer-events: none; }
.xl-finder i { position: absolute; width: 6px; height: 6px; }
.xl-finder i.tl { left: -4px; top: -4px; } .xl-finder i.tr { right: -4px; top: -4px; }
.xl-finder i.bl { left: -4px; bottom: -4px; } .xl-finder i.br { right: -4px; bottom: -4px; }
.xl-ac {
  position: fixed; z-index: 10065; min-width: 200px; max-height: 234px; overflow: auto; padding: 2px 0;
  background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 4px 10px rgba(0, 0, 0, .16);
  font: 12px "Segoe UI", -apple-system, sans-serif; color: #242424;
}
.xl-ac-item { display: flex; align-items: center; gap: 8px; height: 22px; padding: 0 8px; cursor: default; white-space: nowrap; }
.xl-ac-item.active { background: #cde8d7; }
.xl-ac-ic { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 14px; border-radius: 2px; font: italic 600 10px Cambria, Georgia, serif; color: #107c41; }
.xl-ac-ic.name, .xl-ac-ic.table { font-style: normal; color: #2b7cd3; }
.xl-ac-tip, .xl-argtip {
  position: fixed; z-index: 10066; max-width: 320px; padding: 4px 8px;
  background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 2px 6px rgba(0, 0, 0, .14);
  font: 12px "Segoe UI", -apple-system, sans-serif; color: #242424;
}
.xl-argtip { max-width: 560px; white-space: nowrap; }
.xl-argtip .cur { font-weight: 700; }
.xl-argtip-fn { color: #0f6cbd; text-decoration: underline; }

/* ---- Context menu mini toolbar and Quick Analysis ---------------------------------------------------- */
.xr-mini { display: flex; flex-direction: column; gap: 2px; padding: 4px 4px 6px; margin: -4px -4px 4px; border-bottom: 1px solid #e0e0e0; background: #fafafa; border-radius: 6px 6px 0 0; }
.xr-mini-row { display: flex; align-items: center; gap: 1px; }
.xr-mini-sel { height: 22px; max-width: 110px; margin-right: 2px; padding: 0 2px; border: 1px solid #d1d1d1; border-radius: 3px; background: #fff; font: 12px "Segoe UI", sans-serif; }
.xr-mini-sel.size { width: 46px; }
.xr-mini-b { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 3px; background: transparent; cursor: pointer; }
.xr-mini-b:hover { background: #e8e8e8; }
.xr-mini-b.active { background: #e1dfdd; border-color: #c8c6c4; }
.xr-mini-b .xr-ic .fc-bar { fill: #ff0000; }
.xr-qa { width: 420px; padding: 6px 8px 8px; }
.xr-qa-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e0e0e0; margin-bottom: 8px; }
.xr-qa-tab { position: relative; height: 28px; padding: 0 10px; border: 0; background: transparent; font: 12px "Segoe UI", sans-serif; color: #424242; cursor: pointer; }
.xr-qa-tab.active { color: #107c41; font-weight: 600; }
.xr-qa-tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; background: #107c41; border-radius: 2px; }
.xr-qa-body { display: flex; gap: 6px; flex-wrap: wrap; }
.xr-qa-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; padding: 6px 2px; border: 1px solid transparent; border-radius: 4px; background: transparent; font: 11px "Segoe UI", sans-serif; cursor: pointer; text-align: center; }
.xr-qa-item:hover { background: #f0f0f0; border-color: #e0e0e0; }
.xr-qa-note { margin-top: 8px; color: #616161; font-size: 11px; }

/* Conditional formatting: Excel 365 gradient data bars and icon sets. */
.excel-app.xl365 .excel-table td.cf-bar::before {
  left: 1px; top: 2px; bottom: 2px;
  background: linear-gradient(90deg, var(--cf-bar-color, #638ec6), color-mix(in srgb, var(--cf-bar-color, #638ec6) 12%, #fff));
  border: 1px solid var(--cf-bar-border, var(--cf-bar-color, #638ec6));
  box-sizing: border-box;
  opacity: 1;
  border-radius: 0;
}
.excel-app.xl365 .excel-table td.cf-icon { position: relative; padding-left: 20px; }
.excel-app.xl365 .excel-table td.cf-icon > .cf-icon-glyph {
  position: absolute; left: 3px; top: 50%; transform: translateY(-50%);
  line-height: 0; pointer-events: none;
}

/* Highlight Cells Rules / Top-Bottom dialogs */
.xd-hl { display: grid; gap: 10px; padding: 2px 0 4px; }
.xd-hl-prompt { font-weight: 600; }
.xd-hl-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xd-hl-word { white-space: nowrap; }

/* The active-cell border is the grid's focus indicator; no OS ring around it. */
#os .excel-app.xl365 .excel-grid-scroll:focus-visible,
.excel-app.xl365 .excel-grid-scroll:focus-visible { outline: none; }

/* Grid host: outline gutters (Data › Group) around the scroller. */
.excel-app.xl365 .xl-grid-host {
  flex: 1 1 auto; min-height: 0; margin: 0 8px;
  display: grid;
  grid-template-columns: var(--xl-outline-w, 0px) minmax(0, 1fr);
  grid-template-rows: var(--xl-outline-h, 0px) minmax(0, 1fr);
}
.excel-app.xl365 .xl-grid-host > .excel-grid-scroll { grid-column: 2; grid-row: 2; margin: 0; min-width: 0; min-height: 0; }
.excel-app.xl365 .xl-outline-corner { grid-column: 1; grid-row: 1; position: relative; }
.excel-app.xl365 .xl-outline-cols { grid-column: 2; grid-row: 1; position: relative; overflow: hidden; }
.excel-app.xl365 .xl-outline-rows { grid-column: 1; grid-row: 2; position: relative; overflow: hidden; }
.excel-app.xl365 .xl-ol-line { position: absolute; pointer-events: none; }
.excel-app.xl365 .xl-ol-line.v { width: 0; border-left: 1px solid #3b3b3b; }
.excel-app.xl365 .xl-ol-line.h { height: 0; border-top: 1px solid #3b3b3b; }
.excel-app.xl365 .xl-ol-line.v.tick-top::before,
.excel-app.xl365 .xl-ol-line.v.tick-bottom::before { content: ""; position: absolute; left: -1px; width: 5px; border-top: 1px solid #3b3b3b; }
.excel-app.xl365 .xl-ol-line.v.tick-top::before { top: 0; }
.excel-app.xl365 .xl-ol-line.v.tick-bottom::before { bottom: 0; }
.excel-app.xl365 .xl-ol-line.h.tick-left::before,
.excel-app.xl365 .xl-ol-line.h.tick-right::before { content: ""; position: absolute; top: -1px; height: 5px; border-left: 1px solid #3b3b3b; }
.excel-app.xl365 .xl-ol-line.h.tick-left::before { left: 0; }
.excel-app.xl365 .xl-ol-line.h.tick-right::before { right: 0; }
.excel-app.xl365 .xl-ol-btn {
  position: absolute; width: 14px; height: 14px; padding: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #7a7a7a; border-radius: 2px; background: #fff;
  --xr-c: #1f1f1f; color: var(--xr-c); font: 600 12px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.excel-app.xl365 .xl-ol-btn:hover, .excel-app.xl365 .xl-ol-level:hover { background: #e8f2ec; border-color: #107c41; }
.excel-app.xl365 .xl-ol-levels { position: absolute; display: flex; gap: 2px; }
.excel-app.xl365 .xl-ol-levels.rows { left: 2px; bottom: 3px; }
.excel-app.xl365 .xl-ol-levels.cols { right: 3px; top: 2px; flex-direction: column; }
.excel-app.xl365 .xl-ol-level {
  position: absolute;
  width: 14px; height: 14px; padding: 0; box-sizing: border-box;
  border: 1px solid #9a9a9a; border-radius: 2px; background: #fff;
  --xr-c: #1f1f1f; color: var(--xr-c); font: 10px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.xd-subtotal { display: grid; gap: 6px; }
.xd-subtotal .xd-check, .xd-subtotal label.xd-check { margin-top: 2px; }
.xd-checklist { overflow: auto; padding: 2px 0; }
.xd-check-row { display: flex; align-items: center; gap: 6px; padding: 2px 6px; cursor: default; }
.xd-group-axis .xd-radios { padding: 4px 2px; }
/* Paste Special / Sort / Remove Duplicates / Series / Goal Seek */
.xd-radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; padding: 2px 0; }
.xd-pastespecial { display: grid; gap: 8px; }
.xd-ps-checks { gap: 24px; padding-left: 6px; }
.xd-sort { display: grid; gap: 8px; }
.xd-sort-toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.xd-grow { flex: 1 1 auto; }
.xd-button.xd-small { min-width: 0; padding: 3px 9px; height: 26px; }
.xd-sort-grid { border: 1px solid #c8c8c8; min-height: 150px; max-height: 240px; overflow: auto; background: #fff; }
.xd-sort-head, .xd-sort-row { display: grid; grid-template-columns: 62px 1fr 1fr 1.2fr; gap: 6px; align-items: center; padding: 4px 6px; }
.xd-sort-head { grid-template-columns: 62px 1fr 1fr 1.2fr; background: #f3f3f3; border-bottom: 1px solid #e0e0e0; font-weight: 600; }
.xd-sort-head > span:first-child { grid-column: 2; }
.xd-sort-head > span:nth-child(2) { grid-column: 3; }
.xd-sort-head > span:nth-child(3) { grid-column: 4; }
.xd-sort-row.current { background: #e8f2ec; }
.xd-sort-row .xd-select { width: 100%; }
.xd-sort-order { display: flex; gap: 4px; }
.xd-sort-order .xd-select { flex: 1 1 0; min-width: 0; }
.xd-lead { margin: 0 0 6px; }
.xd-removedupes .xd-row { align-items: center; gap: 6px; margin-bottom: 6px; }
.xd-series { display: grid; gap: 8px; }
.xd-series-cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.xd-series .xd-row { align-items: center; gap: 6px; }
.xd-form-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; align-items: center; }
.xd-goalstatus p { margin: 0 0 10px; }
/* Auto Fill Options button (after dragging the fill handle) */
.excel-app.xl365 .xl-autofill-btn {
  position: absolute; z-index: 6; width: 24px; height: 20px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #b3b3b3; border-radius: 3px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18);
  --xr-c: #1f1f1f; color: var(--xr-c); cursor: pointer;
}
.excel-app.xl365 .xl-autofill-btn:hover { border-color: #107c41; background: #f3faf6; }
/* Data Validation */
.xd-dv-settings, .xd-dv-tab { display: grid; gap: 8px; min-height: 260px; align-content: start; }
.xd-dv-top { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.xd-dv-top .xd-check { margin-bottom: 4px; }
.xd-dv-field { display: grid; gap: 3px; }
.xd-textarea { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; min-height: 90px; }
.xd-dv-alert { display: grid; grid-template-columns: 160px 1fr; gap: 12px; }
.xd-dv-alert > div { display: grid; gap: 4px; align-content: start; }
.xd-dv-style-ic { width: 40px; height: 40px; margin-top: 10px; border-radius: 50%; display: block; }
.xd-dv-style-ic.stop { background: #c42b1c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M11 11l10 10M21 11 11 21' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.xd-dv-style-ic.warning { border-radius: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3 30 28H2Z' fill='%23f8d22a' stroke='%23c19c00'/%3E%3Cpath d='M16 11v9' stroke='%231f1f1f' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='24' r='1.6' fill='%231f1f1f'/%3E%3C/svg%3E") center/100% no-repeat; }
.xd-dv-style-ic.information { background: #0f6cbd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 14v9' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='9.5' r='1.7' fill='%23fff'/%3E%3C/svg%3E") center/100% no-repeat; }
.xd-msg-foot { color: #616161; }
/* Input message tip (Data Validation) */
.excel-app.xl365 .xl-dv-tip {
  position: absolute; z-index: 7; max-width: 240px; padding: 6px 8px;
  background: #ffffe1; border: 1px solid #767676; box-shadow: 1px 2px 4px rgba(0,0,0,.2);
  font: 12px/1.35 "Segoe UI", system-ui, sans-serif; --xr-c: #1f1f1f; color: var(--xr-c); pointer-events: none; white-space: pre-line;
}
.excel-app.xl365 .xl-dv-tip b { display: block; margin-bottom: 2px; }
/* Convert Text to Columns Wizard */
.xd-t2c { display: grid; gap: 8px; min-height: 360px; align-content: start; }
.xd-t2c p { margin: 0; }
.xd-t2c-kinds { display: grid; gap: 6px; }
.xd-t2c-raw, .xd-t2c-preview, .xd-t2c-fixed { border: 1px solid #c8c8c8; background: #fff; height: 150px; overflow: auto; font: 12px/1.45 Consolas, "Cascadia Mono", monospace; }
.xd-t2c-raw > div { white-space: pre; }
.xd-t2c-ln { display: inline-block; width: 28px; color: #8a8a8a; text-align: right; margin-right: 8px; }
.xd-t2c-preview table { border-collapse: collapse; }
.xd-t2c-preview td, .xd-t2c-preview th { padding: 1px 8px; border-right: 1px solid #e3e3e3; white-space: pre; text-align: left; cursor: default; }
.xd-t2c-preview th { background: #f3f3f3; font: 600 11px "Segoe UI", system-ui, sans-serif; }
.xd-t2c-preview .sel { background: #1f1f1f; color: #fff; }
.xd-t2c-preview td.skip { color: #9a9a9a; }
.xd-t2c-delims { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; align-items: start; }
.xd-t2c-opts { display: grid; gap: 10px; padding-top: 12px; }
.xd-t2c-step3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.xd-t2c-fixed { position: relative; padding: 18px 6px 4px; cursor: crosshair; }
.xd-t2c-ruler { position: absolute; left: 6px; top: 2px; height: 14px; font-size: 9px; color: #8a8a8a; }
.xd-t2c-ruler span { position: absolute; top: 0; }
.xd-t2c-mono > div { white-space: pre; }
.xd-t2c-break { position: absolute; top: 16px; bottom: 0; width: 0; border-left: 1px solid #1f1f1f; margin-left: 6px; cursor: ew-resize; }
.xd-t2c-break::before { content: ""; position: absolute; top: -4px; left: -4px; border: 4px solid transparent; border-top-color: #1f1f1f; }
.xd-t2c-help { margin: 0; padding-left: 20px; }
/* Page Setup */
.xd-pagesetup { display: grid; gap: 8px; }
.xd-ps-tab { display: grid; gap: 10px; min-height: 330px; align-content: start; }
.xd-ps-tab .xd-row { align-items: center; gap: 6px; flex-wrap: wrap; }
.xd-orients { gap: 28px !important; }
.xd-orient { display: inline-flex; align-items: center; gap: 6px; }
.xd-orient-ic { display: inline-flex; width: 26px; height: 32px; align-items: center; justify-content: center; border: 1px solid #8a8a8a; font: 700 18px "Segoe UI", sans-serif; background: #fff; }
.xd-ps-actions { justify-content: flex-end; gap: 6px; }
.xd-ps-margins { display: grid; gap: 8px; justify-items: center; }
.xd-ps-mtop, .xd-ps-mbot { display: flex; gap: 40px; }
.xd-ps-mmid { display: flex; gap: 18px; align-items: center; }
.xd-ps-m { display: grid; gap: 2px; justify-items: start; }
.xd-ps-preview { position: relative; border: 1px solid #6e6e6e; background: #fff; box-shadow: 2px 2px 0 #c8c8c8; }
.xd-ps-preview-area { position: absolute; border: 1px dashed #9a9a9a; background: repeating-linear-gradient(180deg, transparent 0 5px, #e8e8e8 5px 6px); }
.xd-ps-hfbox { display: grid; grid-template-columns: 1fr 1fr 1fr; min-height: 44px; border: 1px solid #c8c8c8; background: #fff; padding: 8px; font-size: 11px; }
.xd-ps-hfc { text-align: center; } .xd-ps-hfr { text-align: right; }
.xd-ps-custom { justify-content: center; gap: 10px !important; padding: 4px 0; }
.xd-ps-hfopts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.xd-ps-print { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.xd-hf { display: grid; gap: 8px; }
.xd-hf-tools { gap: 4px; }
.xd-hf-secs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.xd-hf-sec { width: 100%; box-sizing: border-box; min-height: 96px; resize: none; font: inherit; }
.excel-app.xl365 .excel-table td.cf-bar.cf-bar-solid::before { background: var(--cf-bar-color, #638ec6); }
/* Show Bar Only / Show Icon Only hide the value but keep the cell. */
.excel-app.xl365 .excel-table td.cf-hide-value { color: transparent !important; }
.excel-app.xl365 .excel-table td.cf-hide-value > .cf-icon-glyph { color: initial; }
/* Conditional Formatting Rules Manager / Formatting Rule */
.xd-cfm { display: grid; gap: 8px; }
.xd-cfm .xd-row { align-items: center; gap: 6px; }
.xd-cfm-tools { gap: 4px !important; }
.xd-cfm-table { border: 1px solid #c8c8c8; background: #fff; height: 230px; overflow: auto; }
.xd-cfm-head, .xd-cfm-row { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 80px; gap: 8px; align-items: center; padding: 3px 6px; }
.xd-cfm-head { background: #f3f3f3; border-bottom: 1px solid #e0e0e0; font-weight: 600; position: sticky; top: 0; }
.xd-cfm-row.current { background: #e8f2ec; }
.xd-cfm-desc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xd-cfm-stop { text-align: center; }
.xd-cf-preview { display: inline-block; min-width: 110px; height: 20px; line-height: 20px; padding: 0 6px; border: 1px solid #d0d0d0; background: #fff; font-size: 12px; overflow: hidden; white-space: nowrap; }
.xd-cf-preview.big { min-width: 220px; height: 26px; line-height: 26px; text-align: center; }
.xd-cfr { display: grid; gap: 8px; }
.xd-cfr-desc { display: grid; gap: 10px; min-height: 220px; align-content: start; }
.xd-cfr-desc .xd-row { align-items: center; gap: 6px; flex-wrap: wrap; }
.xd-cfr-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.xd-cfr-col { display: grid; gap: 3px; align-content: start; }
.xd-cfr-bar { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 8px; align-items: center; }
.xd-cfr-format { display: flex; align-items: center; gap: 8px; }
.xd-cfr-iconlabel { min-width: 150px; }
.xd-color { width: 46px; height: 24px; padding: 0 2px; border: 1px solid #c8c8c8; background: #fff; }
/* Create PivotTable / Value Field Settings */
.xd-pivotcreate { display: grid; gap: 8px; }
.xd-pivotcreate .xd-row { align-items: center; gap: 8px; padding-left: 12px; }
.xd-pivotcreate .xd-radios { padding-left: 12px; }
.xd-vfs { display: grid; gap: 8px; }
.xd-vfs .xd-row { align-items: center; gap: 8px; }
.xd-vfs-tab { display: grid; gap: 6px; min-height: 210px; align-content: start; }
/* PivotTable Fields pane (docked right of the grid) */
.excel-app.xl365 .xl-grid-host { grid-template-columns: var(--xl-outline-w, 0px) minmax(0, 1fr) var(--xl-pane-w, 0px); }
.excel-app.xl365 .xl-pivot-pane {
  grid-column: 3; grid-row: 1 / span 2; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-left: 8px;
  background: #fff; border: 1px solid var(--xr-border, #e0e0e0); border-radius: 6px 6px 0 0;
  font: 12px/1.35 "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c);
}
.excel-app.xl365 .xl-pivot-pane[hidden] { display: none; }
.xl-pp-head { display: flex; align-items: center; justify-content: space-between; }
.xl-pp-head h3 { margin: 0; font: 600 15px "Segoe UI", system-ui, sans-serif; }
.xl-pp-head button { border: 0; background: none; cursor: pointer; font-size: 14px; padding: 2px 6px; }
.xl-pp-search { width: 100%; box-sizing: border-box; height: 26px; border: 1px solid #c8c8c8; border-radius: 3px; padding: 0 6px; }
.xl-pp-fields { border: 1px solid #e0e0e0; min-height: 120px; max-height: 38%; overflow: auto; padding: 2px 0; }
.xl-pp-field { display: flex; align-items: center; gap: 6px; padding: 3px 8px; cursor: grab; user-select: none; }
.xl-pp-field:hover { background: #f3f3f3; }
.xl-pp-field b { font-weight: 600; }
.xl-pp-areas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xl-pp-area { display: grid; grid-template-rows: auto 1fr; min-height: 110px; }
.xl-pp-area > span { font-size: 11px; color: #616161; margin-bottom: 3px; display: flex; gap: 4px; align-items: center; }
.xl-pp-drop { border: 1px solid #e0e0e0; background: #fafafa; padding: 3px; display: flex; flex-direction: column; gap: 3px; min-height: 90px; overflow: auto; }
.xl-pp-drop.over { outline: 2px dashed #107c41; outline-offset: -2px; }
.xl-pp-pill { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 3px 6px; border: 1px solid #c8c8c8; border-radius: 3px; background: #fff; cursor: grab; user-select: none; }
.xl-pp-pill button { border: 0; background: none; padding: 0 2px; cursor: pointer; font-size: 10px; }
.xl-pp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.xl-pp-ghost { position: fixed; z-index: 100000; pointer-events: none; padding: 3px 8px; border: 1px solid #107c41; background: #fff; border-radius: 3px; font: 12px "Segoe UI", sans-serif; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.xl-pivot-placeholder { position: absolute; z-index: 4; pointer-events: none; display: grid; place-items: center; text-align: center; gap: 6px;
  border: 1px solid #b4c6e7; background: linear-gradient(#f7fbff, #eef4fb); color: #1f3864; font: 12px "Segoe UI", system-ui, sans-serif; padding: 10px; box-sizing: border-box; }
.xl-pivot-placeholder b { font-size: 14px; }
.xd-sparkcreate { display: grid; gap: 8px; }
.xd-sparkcreate .xd-row { align-items: center; gap: 8px; padding-left: 12px; }
.xd-sparkcreate .xd-label { min-width: 96px; }
/* Sparklines drawn inside cells */
.excel-app.xl365 .excel-table td.has-spark { position: relative; }
.excel-app.xl365 .excel-table td.has-spark > .xl-spark { position: absolute; inset: 0; pointer-events: none; line-height: 0; }
.excel-app.xl365 .excel-table td.has-spark > .xl-spark svg { display: block; }
/* Small tool dialogs */
.xd-refform { display: grid; gap: 8px; }
.xd-refform .xd-row { align-items: center; gap: 8px; }
.xd-refform .xd-row > .xd-label:first-child { min-width: 110px; }
.xd-consolidate { display: grid; gap: 6px; }
.xd-consolidate .xd-row { align-items: flex-start; gap: 8px; }
.xd-colm { display: flex; flex-direction: column; gap: 6px; }
.xd-scn { display: grid; gap: 8px; }
.xd-scn-top { align-items: flex-start !important; gap: 10px; }
.xd-scn-detail { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; min-height: 40px; }
/* Watch Window (a floating, non-modal tool window) */
.excel-app.xl365 .xl-watch {
  position: absolute; z-index: 30; right: 20px; top: 220px; width: 560px; min-height: 150px;
  background: #fff; border: 1px solid #b3b3b3; border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.22);
  font: 12px/1.35 "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); display: flex; flex-direction: column;
}
.xl-watch-title { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid #e3e3e3; cursor: move; font-weight: 600; }
.xl-watch-title button { border: 0; background: none; cursor: pointer; }
.xl-watch-tools { display: flex; gap: 6px; padding: 6px 10px; }
.xl-watch table { width: 100%; border-collapse: collapse; }
.xl-watch th, .xl-watch td { text-align: left; padding: 3px 8px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.xl-watch th { background: #f5f5f5; font-weight: 600; }
.xl-watch tr.sel td { background: #e8f2ec; }
.xl-watch-body { overflow: auto; max-height: 240px; }
.xd-cv { align-items: flex-start; gap: 12px; }
.xd-cv .xd-colm .xd-button { min-width: 90px; }
.xd-aer { display: grid; gap: 8px; }
.xd-aer-main { align-items: flex-start; gap: 10px; }
.xd-aer-table { flex: 1; border: 1px solid #c8c8c8; background: #fff; height: 130px; overflow: auto; }
.xd-aer-head, .xd-aer-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 3px 6px; }
.xd-aer-head { background: #f3f3f3; font-weight: 600; }
.xd-aer-row.current { background: #e8f2ec; }
/* Draw Border mode and sheet background */
.excel-app.xl365.drawing-borders .excel-grid-scroll td.excel-cell { cursor: crosshair; }
.excel-app.xl365 .excel-grid-scroll.has-background .excel-table { background-image: var(--xl-sheet-bg); background-repeat: repeat; }
.excel-app.xl365 .excel-grid-scroll.has-background .excel-table td.excel-cell:not([style*="background"]) { background-color: transparent !important; }
#os#os .excel-app.xl365 .excel-grid-scroll.has-background .excel-table td.excel-cell:not([style*="background"]) { background-color: transparent !important; }

/* Drawing objects (shapes, text boxes, pictures, icons) */
.excel-app.xl365 .xl-obj-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 5; }
.excel-app.xl365 .xl-obj { position: absolute; box-sizing: border-box; outline: none; transform-origin: 50% 50%; cursor: move; }
.excel-app.xl365 .xl-obj.hidden { display: none; }
.excel-app.xl365 .xl-obj-shape, .excel-app.xl365 .xl-obj-img, .excel-app.xl365 .xl-obj-icon { position: absolute; inset: 0; }
.excel-app.xl365 .xl-obj-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.excel-app.xl365 .xl-obj-img { width: 100%; height: 100%; object-fit: fill; pointer-events: none; user-select: none; }
.excel-app.xl365 .xl-obj-icon svg { width: 100%; height: 100%; }
.excel-app.xl365 .xl-obj-text { position: absolute; inset: 4px 7px; display: flex; flex-direction: column; overflow: hidden; white-space: pre-wrap; word-break: break-word;
  font-family: "Aptos Narrow", Calibri, "Segoe UI", sans-serif; line-height: 1.2; outline: none; pointer-events: none; }
.excel-app.xl365 .xl-obj-text.v-top { justify-content: flex-start; } .excel-app.xl365 .xl-obj-text.v-middle { justify-content: center; } .excel-app.xl365 .xl-obj-text.v-bottom { justify-content: flex-end; }
.excel-app.xl365 .xl-obj.editing { cursor: text; }
.excel-app.xl365 .xl-obj.editing .xl-obj-text { pointer-events: auto; cursor: text; }
.excel-app.xl365 .xl-obj-grip, .excel-app.xl365 .xl-obj-rot { display: none; position: absolute; width: 9px; height: 9px; box-sizing: border-box; border: 1px solid #5f5f5f; background: #fff; border-radius: 50%; z-index: 2; }
.excel-app.xl365 .xl-obj.selected { outline: 1px solid #8a8a8a; outline-offset: 0; }
.excel-app.xl365 .xl-obj.selected .xl-obj-grip, .excel-app.xl365 .xl-obj.selected .xl-obj-rot { display: block; }
.xl-obj-grip.nw { left: -5px; top: -5px; cursor: nwse-resize; } .xl-obj-grip.n { left: calc(50% - 4px); top: -5px; cursor: ns-resize; }
.xl-obj-grip.ne { right: -5px; top: -5px; cursor: nesw-resize; } .xl-obj-grip.e { right: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.xl-obj-grip.se { right: -5px; bottom: -5px; cursor: nwse-resize; } .xl-obj-grip.s { left: calc(50% - 4px); bottom: -5px; cursor: ns-resize; }
.xl-obj-grip.sw { left: -5px; bottom: -5px; cursor: nesw-resize; } .xl-obj-grip.w { left: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.excel-app.xl365 .xl-obj-rot { left: calc(50% - 6px); top: -26px; width: 12px; height: 12px; border: 0; background: none; cursor: grab; }
.excel-app.xl365 .xl-obj-rot::before { content: "↻"; position: absolute; inset: -4px; font: 15px/1 "Segoe UI Symbol", sans-serif; color: #5f5f5f; }
.excel-app.xl365 .xl-obj-ghost { position: absolute; border: 1px dashed #2f5597; background: rgba(68, 114, 196, .12); pointer-events: none; }
.excel-app.xl365 .excel-grid-scroll.xl-drawing-shape, .excel-app.xl365 .excel-grid-scroll.xl-drawing-shape td.excel-cell { cursor: crosshair; }
/* Shapes gallery */
.xr-shape-gallery { display: grid; gap: 4px; padding: 4px 6px; max-width: 360px; }
.xr-shape-gallery h4 { margin: 4px 0 0; font: 600 11px "Segoe UI", sans-serif; color: #616161; }
.xr-shape-row { display: flex; flex-wrap: wrap; gap: 2px; }
.xr-shape-btn { width: 26px; height: 26px; padding: 2px; border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; }
.xr-shape-btn:hover { border-color: #107c41; background: #eef7f1; }
/* Icons picker */
.xd-icons { display: grid; gap: 8px; }
.xd-icons-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 280px; overflow: auto; border: 1px solid #e0e0e0; padding: 6px; }
.xd-icon-cell { display: grid; place-items: center; height: 44px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; --xr-c: #242424; color: var(--xr-c); }
.xd-icon-cell:hover { background: #f3f3f3; } .xd-icon-cell.sel { border-color: #107c41; background: #e8f2ec; }
/* Selection Pane */
.excel-app.xl365 .xl-sel-pane { grid-column: 3; grid-row: 1 / span 2; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-left: 8px;
  background: #fff; border: 1px solid var(--xr-border, #e0e0e0); border-radius: 6px 6px 0 0; font: 12px/1.35 "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); }
.excel-app.xl365 .xl-sel-pane[hidden] { display: none; }
.xl-sp-tools { display: flex; gap: 6px; align-items: center; }
.xl-sp-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; border-radius: 3px; cursor: default; }
.xl-sp-item.sel { background: #e8f2ec; }
.xl-sp-item button { border: 0; background: none; cursor: pointer; font-size: 13px; }
/* Page breaks: Page Break Preview and manual breaks in Normal view */
.excel-app.xl365 .xl-pagebreaks { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 3; }
.excel-app.xl365.view-pagebreak .excel-grid-scroll .excel-table td.excel-cell { background-color: #ffffff; }
.excel-app.xl365.view-pagebreak .excel-grid-scroll { background: #bfbfbf; }
.excel-app.xl365.view-pagebreak .excel-grid-scroll .excel-table { background: #d9d9d9; }
.xl-pb-area { position: absolute; box-shadow: 0 0 0 3px #1f4e9c, 0 0 0 9999px rgba(128, 128, 128, .35); }
.xl-pb-label { position: absolute; display: grid; place-items: center; overflow: hidden; white-space: nowrap; color: rgba(128, 128, 128, .45); font-family: "Segoe UI", Calibri, sans-serif; font-weight: 600; }
.xl-pb-v, .xl-pb-h { position: absolute; }
.xl-pb-v { width: 0; border-left: 1px dashed #7f7f7f; }
.xl-pb-h { height: 0; border-top: 1px dashed #7f7f7f; }
.xl-pb-v.preview { border-left: 3px dashed #1f4e9c; }
.xl-pb-h.preview { border-top: 3px dashed #1f4e9c; }
.xl-pb-v.manual { border-left-style: solid; }
.xl-pb-h.manual { border-top-style: solid; }
/* Ink (Draw tab) */
.excel-app.xl365 .excel-grid-scroll.xl-inking, .excel-app.xl365 .excel-grid-scroll.xl-inking td.excel-cell { cursor: crosshair; }
.excel-app.xl365 .excel-grid-scroll.xl-erasing, .excel-app.xl365 .excel-grid-scroll.xl-erasing td.excel-cell { cursor: cell; }
.excel-app.xl365 .xl-obj.ink { cursor: default; }
.excel-app.xl365 .xl-obj.ink.selected { outline: 1px dashed #8a8a8a; }
.excel-app.xl365 .xl-obj.ink .xl-obj-grip, .excel-app.xl365 .xl-obj.ink .xl-obj-rot { display: none !important; }
.excel-app.xl365 .xl-obj-inkpreview { position: absolute; pointer-events: none; }
/* Excel chart frame: no title bar; handles and side buttons when selected */
.excel-app.xl365 .xl-chart { border: 1px solid #d9d9d9; border-radius: 0; box-shadow: none; overflow: visible; cursor: move; }
.excel-app.xl365 .xl-chart-bar { display: none; }
.excel-app.xl365 .xl-chart-body { overflow: hidden; }
.excel-app.xl365 .xl-chart.selected { border-color: #8a8a8a; box-shadow: none; }
.excel-app.xl365 .xl-chart-grip { display: none; position: absolute; width: 9px; height: 9px; box-sizing: border-box; border: 1px solid #5f5f5f; background: #fff; border-radius: 50%; z-index: 2; }
.excel-app.xl365 .xl-chart.selected .xl-chart-grip { display: block; }
.excel-app.xl365 .xl-chart-grip.nw { left: -5px; top: -5px; cursor: nwse-resize; } .excel-app.xl365 .xl-chart-grip.n { left: calc(50% - 4px); top: -5px; right: auto; cursor: ns-resize; }
.excel-app.xl365 .xl-chart-grip.ne { right: -5px; top: -5px; left: auto; cursor: nesw-resize; } .excel-app.xl365 .xl-chart-grip.e { right: -5px; top: calc(50% - 4px); left: auto; cursor: ew-resize; }
.excel-app.xl365 .xl-chart-grip.se { right: -5px; bottom: -5px; left: auto; top: auto; cursor: nwse-resize; } .excel-app.xl365 .xl-chart-grip.s { left: calc(50% - 4px); bottom: -5px; top: auto; cursor: ns-resize; }
.excel-app.xl365 .xl-chart-grip.sw { left: -5px; bottom: -5px; top: auto; cursor: nesw-resize; } .excel-app.xl365 .xl-chart-grip.w { left: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.excel-app.xl365 .xl-chart-side { display: none; position: absolute; left: calc(100% + 6px); top: 0; flex-direction: column; gap: 4px; z-index: 3; }
.excel-app.xl365 .xl-chart.selected .xl-chart-side { display: flex; }
.excel-app.xl365 .xl-chart-sidebtn { width: 26px; height: 26px; padding: 0; border: 1px solid #c8c8c8; border-radius: 2px; background: #fff; --xr-c: #1f1f1f; color: var(--xr-c); font: 600 14px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.excel-app.xl365 .xl-chart-sidebtn:hover { border-color: #107c41; background: #f3faf6; }
/* Insert Chart / Change Chart Type */
.xd-chartdlg .xd-tabpage { min-height: 440px; }
.xd-chart-rec { display: grid; grid-template-columns: 190px 1fr; gap: 12px; height: 440px; }
.xd-chart-reclist { display: flex; flex-direction: column; gap: 8px; overflow: auto; padding-right: 4px; }
.xd-chart-recitem { flex: 0 0 auto; height: 130px; padding: 4px; border: 1px solid #d6d6d6; background: #fff; cursor: pointer; overflow: hidden; }
.xd-chart-recitem .xd-chart-name { display: none; }
.xd-chart-recitem svg { width: 100%; height: auto; pointer-events: none; }
.xd-chart-recitem.selected { border: 2px solid #107c41; }
.xd-chart-all { display: grid; grid-template-columns: 170px 1fr; gap: 12px; height: 440px; }
.xd-chart-families { display: flex; flex-direction: column; gap: 1px; overflow: auto; border-right: 1px solid #e3e3e3; padding-right: 6px; }
.xd-chart-family { text-align: left; padding: 6px 10px; border: 0; background: none; cursor: pointer; border-radius: 3px; --xr-c: #242424; color: var(--xr-c); font: 12px "Segoe UI", system-ui, sans-serif; }
.xd-chart-family:hover { background: #f3f3f3; } .xd-chart-family.selected { background: #e8f2ec; font-weight: 600; }
.xd-chart-main { display: grid; grid-template-rows: auto 1fr; gap: 10px; min-width: 0; }
.xd-chart-subrow { display: flex; flex-wrap: wrap; gap: 6px; }
.xd-chart-subrow[hidden] { display: none; }
.xd-chart-sub { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; padding: 6px 4px; border: 1px solid transparent; background: #fff; cursor: pointer; font: 11px "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); text-align: center; }
.xd-chart-sub:hover { border-color: #b3d7c1; } .xd-chart-sub.selected { border-color: #107c41; background: #eef7f1; }
.xd-chart-sub.ineligible { opacity: .45; }
.xd-chart-subicon { font-size: 20px; line-height: 24px; }
.xd-chart-preview { border: 1px solid #e3e3e3; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; overflow: hidden; min-height: 0; }
.xd-chart-preview svg { max-width: 100%; height: auto; }
.xd-chart-name { font: 600 13px "Segoe UI", system-ui, sans-serif; align-self: flex-start; }
.xd-chart-hint { color: #616161; }
/* Slicers */
.excel-app.xl365 .xl-obj.slicer { background: #fff; border: 1px solid #c8c8c8; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.excel-app.xl365 .xl-obj-custom { position: absolute; inset: 0; overflow: hidden; }
.xl-slicer { display: flex; flex-direction: column; height: 100%; font: 12px "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); }
.xl-slicer-head { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid #e6e6e6; }
.xl-slicer-cap { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xl-slicer-btn { width: 22px; height: 22px; padding: 0; border: 1px solid transparent; background: none; border-radius: 3px; cursor: pointer; color: inherit; }
.xl-slicer-btn:hover { border-color: #c8c8c8; } .xl-slicer-btn.on { background: #dce6f2; border-color: #9bb8e0; }
.xl-slicer-btn:disabled { opacity: .35; cursor: default; }
.xl-slicer-items { flex: 1; overflow: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.xl-slicer-item { text-align: left; padding: 4px 8px; border: 1px solid #d0d0d0; background: #f3f3f3; color: #8a8a8a; border-radius: 2px; cursor: pointer; font: inherit; }
.xl-slicer-item.on { background: #dce6f2; border-color: #9bb8e0; --xr-c: #1f3864; color: var(--xr-c); }
/* Threaded comments */
.excel-app.xl365 .excel-table td.has-comment { position: relative; }
.excel-app.xl365 .excel-table td.has-comment::before { content: ""; position: absolute; right: 1px; top: 1px; width: 7px; height: 6px; background: #8e44ad; border-radius: 1px 1px 1px 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 30% 100%, 0 130%); pointer-events: none; }
.excel-app.xl365 .xl-comment-card { position: absolute; z-index: 8; width: 280px; background: #fff; border: 1px solid #d1d1d1; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
  font: 12px/1.4 "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); }
.xl-cm-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid #eee; color: #616161; }
.xl-cm-more { border: 0; background: none; cursor: pointer; font-size: 14px; }
.xl-cm-thread { padding: 6px 10px 10px; display: grid; gap: 8px; }
.xl-cm-thread.resolved { opacity: .75; }
.xl-cm-post { display: grid; gap: 2px; }
.xl-cm-head { display: flex; align-items: center; gap: 6px; }
.xl-cm-avatar { width: 22px; height: 22px; border-radius: 50%; background: #8e44ad; color: #fff; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; }
.xl-cm-time { margin-left: auto; color: #8a8a8a; font-size: 11px; }
.xl-cm-text { white-space: pre-wrap; padding-left: 28px; }
.xl-cm-reply { display: flex; gap: 6px; align-items: flex-end; }
.xl-cm-input { flex: 1; resize: none; border: 1px solid #c8c8c8; border-radius: 4px; padding: 5px 7px; font: inherit; min-height: 34px; }
.xl-cm-input:focus { outline: 2px solid #8e44ad; outline-offset: -1px; }
.xl-cm-post-btn { width: 30px; height: 30px; border: 0; border-radius: 4px; background: #8e44ad; color: #fff; cursor: pointer; }
.xl-cm-resolved { color: #107c41; font-weight: 600; }
.excel-app.xl365 .xl-comments-pane { grid-column: 3; grid-row: 1 / span 2; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin-left: 8px;
  background: #fff; border: 1px solid var(--xr-border, #e0e0e0); border-radius: 6px 6px 0 0; font: 12px/1.35 "Segoe UI", system-ui, sans-serif; --xr-c: #242424; color: var(--xr-c); }
.excel-app.xl365 .xl-comments-pane[hidden] { display: none; }
.xl-cm-paneitem { border: 1px solid #e3e3e3; border-radius: 6px; padding: 6px 0 0; }
.xl-cm-ref { padding: 0 10px; color: #616161; font-weight: 600; }

/* ---- Page Layout view ------------------------------------------------------------------ */
.excel-app.xl365.view-pagelayout .excel-grid-scroll { background: var(--xl-pl-gutter); }
.excel-app.xl365 .excel-table td.pl-gap,
.excel-app.xl365 .excel-table th.pl-gap { background: var(--xl-pl-gutter); border: none; padding: 0; }
.excel-app.xl365 .excel-table thead th.pl-gap { position: sticky; top: 0; z-index: 5; background: var(--xl-head-bg); border-bottom: 1px solid var(--xl-head-line); }
.excel-app.xl365 .excel-table th.pl-gap-head { position: sticky; left: 0; z-index: 4; background: var(--xl-head-bg); border: none; border-right: 1px solid var(--xl-head-line); padding: 0; }
.excel-app.xl365 .excel-table tr.pl-gap-row > td { height: auto; }
.excel-app.xl365 .xl-pl-layer { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; }
.xl-pl-layer > div { position: absolute; }
.xl-pl-page { border: 1px solid var(--xl-pl-edge); box-sizing: border-box; pointer-events: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.xl-pl-m { background: var(--xl-cell-bg); }
.xl-pl-empty { display: flex; align-items: center; justify-content: center; pointer-events: none; color: var(--xl-pl-hint); font: 400 15px var(--xl-grid-font, "Segoe UI", sans-serif); }
.xl-pl-hf { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px; align-items: stretch; }
.xl-pl-hf.header { align-items: end; }
.xl-pl-hf-sec { min-height: 18px; padding: 2px 4px; box-sizing: border-box; border: 1px dashed transparent; font: 400 11px var(--xl-grid-font, "Segoe UI", sans-serif); color: #000; white-space: pre; overflow: hidden; cursor: text; outline: none; }
.xl-pl-hf-sec.left { text-align: left; }
.xl-pl-hf-sec.center { text-align: center; }
.xl-pl-hf-sec.right { text-align: right; }
.xl-pl-hf-sec:empty::before { content: attr(data-placeholder); color: var(--xl-pl-hint); font-size: 13px; }
.xl-pl-hf:hover .xl-pl-hf-sec { border-color: #b8b8b8; }
.xl-pl-hf:hover .xl-pl-hf-sec:hover { border-color: #7a7a7a; background: rgba(0, 0, 0, .03); }
.xl-pl-hf-sec.editing { border: 1px solid var(--xl-accent); background: var(--xl-cell-bg); white-space: pre-wrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .xl-pl-hf-sec { color: #e8e8e8; } }
:root[data-theme="dark"] .xl-pl-hf-sec { color: #e8e8e8; }
.xl-pl-ruler { height: 12px; background: var(--xl-cell-bg); border: 1px solid var(--xl-pl-edge); box-sizing: border-box; overflow: hidden; pointer-events: none; }
.xl-pl-ruler.v { width: 12px; height: auto; }
.xl-pl-ruler-m { position: absolute; top: 0; bottom: 0; background: var(--xl-pl-gutter); }
.xl-pl-ruler.v .xl-pl-ruler-m { left: 0; right: 0; }
.xl-pl-tick { position: absolute; bottom: 0; width: 1px; height: 3px; background: var(--xl-pl-hint); font: 400 8px/1 var(--xl-grid-font, "Segoe UI", sans-serif); color: var(--xl-pl-hint); }
.xl-pl-tick.major { height: 5px; }
.xl-pl-tick:not(:empty) { width: auto; height: auto; background: none; transform: translateX(-50%); bottom: 1px; }
.xl-pl-ruler.v .xl-pl-tick { left: auto; right: 0; bottom: auto; width: 3px; height: 1px; }
.xl-pl-ruler.v .xl-pl-tick.major { width: 5px; }
.xl-pl-ruler.v .xl-pl-tick:not(:empty) { width: auto; height: auto; transform: translateY(-50%); right: 1px; }

/* ---- View › Split ------------------------------------------------------------------------ */
.excel-app.xl365 .xl-grid-host { position: relative; }
.excel-app.xl365 .xl-split-bar { position: absolute; z-index: 20; background: #b4b4b4; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.excel-app.xl365 .xl-split-bar.h { height: 5px; cursor: row-resize; }
.excel-app.xl365 .xl-split-bar.v { width: 5px; cursor: col-resize; }
.excel-app.xl365 .xl-split-bar.dragging { background: #7f7f7f; }
.excel-app.xl365 .xl-split-bar[hidden] { display: none; }

/* ---- View › Focus Cell ------------------------------------------------------------------- */
.excel-app.xl365.focus-cell .excel-table td.excel-cell.focus-row,
.excel-app.xl365.focus-cell .excel-table td.excel-cell.focus-col {
  background-image: linear-gradient(color-mix(in srgb, var(--xl-focus, #107c41) 15%, transparent), color-mix(in srgb, var(--xl-focus, #107c41) 15%, transparent));
}
.excel-app.xl365.focus-cell .excel-table td.excel-cell.focus-row { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--xl-focus, #107c41) 55%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--xl-focus, #107c41) 55%, transparent); }
.excel-app.xl365.focus-cell .excel-table td.excel-cell.focus-col { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--xl-focus, #107c41) 55%, transparent), inset -1px 0 0 color-mix(in srgb, var(--xl-focus, #107c41) 55%, transparent); }
.excel-app.xl365 .xr-sbar [hidden] { display: none !important; }

/* ---- Error checking: green triangles and the ⚠ smart tag -------------------------------- */
.excel-app.xl365 .excel-table td.excel-cell.xl-err-ind { background-image: linear-gradient(135deg, #1e8e3e 0 5px, transparent 5px); background-repeat: no-repeat; }
.excel-app.xl365 .xl-err-tag { position: absolute; z-index: 8; width: 20px; height: 20px; padding: 0; display: flex; align-items: center; justify-content: center; border: 1px solid #c8c8c8; border-radius: 2px; background: #fff; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.excel-app.xl365 .xl-err-tag:hover { background: #f3f3f3; border-color: #8a8a8a; }

/* ---- Insert › Checkbox (cell controls) ------------------------------------------------- */
.excel-app.xl365 .excel-table td.excel-cell.xl-cb-cell { text-align: center; padding: 0; }
.excel-app.xl365 .xl-cb { display: inline-block; width: 13px; height: 13px; box-sizing: border-box; vertical-align: middle; border: 1.5px solid currentColor; border-radius: 2px; cursor: pointer; opacity: .85; position: relative; }
.excel-app.xl365 .xl-cb.on { background: currentColor; opacity: 1; }
.excel-app.xl365 .xl-cb.on::after { content: ""; position: absolute; left: 3px; top: 0; width: 4px; height: 7px; border: solid var(--xl-cell-bg, #fff); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ---- Paste Options (Ctrl) / Insert Options smart tags ------------------------------------ */
.excel-app.xl365 .xl-smart-tag { width: auto; padding: 0 3px; gap: 2px; }
.excel-app.xl365 .xl-smart-ctrl { font: 400 11px "Segoe UI", system-ui, sans-serif; color: var(--xr-text-2, #555); }
.xr-menu-gcell.active { background: var(--xr-accent-soft, #d3f0e0); box-shadow: inset 0 0 0 1px var(--xr-accent, #107c41); }
