:root {
  font-family: "Aptos Narrow", "Arial Narrow", Aptos, Calibri, Arial, sans-serif;
  color-scheme: light;
  color: #123d26;
  background: #edf6ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --deep: #123d26;
  --green: #087f3f;
  --leaf: #4b8259;
  --soft: #e4f2e8;
  --pale: #f1f8f3;
  --line: #d9d9d9;
  --white: #ffffff;
  --excel-block-border: #217346;
  --excel-grid-line: #d9d9d9;
  --brand-forest: #00552c;
  --brand-green: #087f3f;
  --brand-lime: #42dc36;
  --brand-teal: #00c9a6;
  /* Keep the worksheet familiar while using the app's favicon colors in its chrome. */
  --bg: #ffffff;
  --appearance-page-bg: #ffffff;
  --theme-page-bg: #ffffff;
  --theme-surface: #f5f5f5;
  --panel: #f5f5f5;
  --theme-surface-strong: #ffffff;
  --panel-strong: #ffffff;
  --theme-surface-soft: #edf6ef;
  --panel-soft: #edf6ef;
  --text: #242424;
  --accent: #087f3f;
  --accent-strong: #00552c;
  --accent-contrast: #ffffff;
}
* { box-sizing: border-box; accent-color: var(--green); }
html, body { height: 100%; margin: 0; }
body { min-width: 760px; overflow: hidden; color: var(--deep); background: var(--white); }
.app-shell { height: 100vh; width: 100vw; display: grid; grid-template-columns: minmax(0, 1fr) 286px; background: var(--white); }
.sheet-workspace { height: 100vh; min-width: 0; display: flex; flex-direction: column; background: var(--white); }
.sheet-topline { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--leaf); background: var(--green); }
.workbook-title { min-width: 120px; width: 300px; border: 1px solid transparent; border-radius: 4px; background: transparent; padding: 6px 8px; font-size: 14px; font-weight: 600; color: var(--white); outline: none; }
.workbook-title:hover, .workbook-title:focus { border-color: #c5dfcd; background: var(--leaf); }
.save-indicator { display: flex; align-items: center; gap: 8px; color: var(--white); font-size: 11px; }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #c5dfcd; box-shadow: 0 0 0 3px #c5dfcd35; }
.grid-viewport { flex: 1; min-height: 0; overflow: auto; position: relative; scrollbar-color: #a9cfb5 var(--pale); scrollbar-width: thin; overscroll-behavior: contain; }
.grid { display: grid; width: max-content; grid-template-columns: 40px repeat(26, 64px); grid-auto-rows: 20px; font-size: 11px; --col-size: 64px; }
.grid-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--deep); outline: none; background: var(--white); position: relative; }
.grid-cell.formula-cell-image { justify-content: center; padding: 1px; }
.formula-cell-image-content { display: block; flex: none; max-width: 100%; max-height: 100%; object-position: center; }
.formula-image-enable { border: 1px solid var(--line); border-radius: 3px; background: var(--pale); color: var(--deep); padding: 2px 6px; font: inherit; font-size: 10px; cursor: pointer; }
.grid-cell.col-head, .grid-cell.row-head, .grid-cell.corner { background: var(--pale); color: var(--green); justify-content: center; padding: 0; font-size: 11px; font-weight: 500; }
.grid-cell.col-head { position: sticky; top: 0; z-index: 3; border-bottom-color: var(--excel-block-border); }
.grid-cell.corner { position: sticky; top: 0; left: 0; z-index: 6; }
.grid-cell.row-head { position: sticky; left: 0; z-index: 3; }
.grid-cell.selected { box-shadow: inset 0 0 0 2px var(--excel-block-border); z-index: 1; }
.grid-cell.audit-reference { outline: 2px solid var(--leaf); outline-offset: -2px; }
.grid-cell.range-selected:not(.selected) { box-shadow: inset 0 0 0 1px var(--excel-block-border); cursor: move; }
.grid-cell.frozen-row { position: sticky; z-index: 1; background: var(--white); }
.grid-cell.row-head.frozen-row { z-index: 4; background: var(--pale); }
.grid-cell.frozen-col { position: sticky; z-index: 2; background: var(--white); }
.grid-cell.col-head.frozen-col { z-index: 5; background: var(--pale); }
.grid-cell.frozen-row.frozen-col { z-index: 3; }
.grid-spacer { border: 0; padding: 0; background: transparent; pointer-events: none; }
.fill-handle { position: absolute; width: 7px; height: 7px; right: -4px; bottom: -4px; z-index: 8; border: 1px solid var(--excel-block-border); background: var(--green); cursor: crosshair; }
.column-resize-handle { position: absolute; z-index: 6; width: 5px; height: 100%; right: 0; top: 0; cursor: col-resize; }
.column-resize-handle:hover { background: var(--green); }
.row-resize-handle { position: absolute; z-index: 6; height: 5px; width: 100%; bottom: 0; left: 0; cursor: row-resize; }
.row-resize-handle:hover { background: var(--green); }
.grid-cell.selected::after { content: ""; position: absolute; width: 5px; height: 5px; background: var(--green); right: -2px; bottom: -2px; }
.grid-cell.formula-cell { color: var(--deep); }
.grid-cell.error-cell { color: var(--deep); }
.grid-cell.editing { padding: 0; overflow: visible; z-index: 4; }
.cell-editor { display: block; border: 2px solid var(--green); outline: none; width: 100%; height: 100%; min-height: 100%; padding: 0 7px; resize: none; overflow: hidden; white-space: pre-wrap; line-height: 1.2; tab-size: 4; font: 12px "Aptos Narrow", "Arial Narrow", Aptos, Calibri, Arial, sans-serif; color: var(--deep); background: var(--white); }
.sheet-tabs-row { height: 39px; flex: none; display: flex; align-items: center; border-top: 1px solid var(--line); background: var(--pale); padding: 0 12px; gap: 4px; }
.sheet-tabs { display: flex; gap: 4px; height: 100%; align-items: flex-end; max-width: 75%; overflow: auto; }
.sheet-tab { height: 31px; border: 0; background: transparent; padding: 0 14px; border-radius: 5px 5px 0 0; color: var(--green); font-size: 11px; font-weight: 600; position: relative; white-space: nowrap; }
.sheet-tab:hover { background: var(--soft); color: var(--deep); }
.sheet-tab.active { background: var(--white); color: var(--green); box-shadow: 0 -2px 0 var(--green) inset; }
.add-sheet { width: 27px; height: 27px; border: 0; border-radius: 5px; background: transparent; color: var(--green); font-size: 19px; line-height: 1; }
.add-sheet:hover { background: var(--soft); color: var(--deep); }
.sheet-tab-fill { flex: 1; }
.zoom-control { display: flex; align-items: center; gap: 8px; color: var(--green); font-size: 12px; }
.zoom-control button { width: 23px; height: 23px; border: 1px solid var(--line); background: var(--white); border-radius: 4px; color: var(--green); font-size: 15px; line-height: 15px; }
.zoom-control button:hover { border-color: #a9cfb5; background: var(--soft); }
.zoom-control span { font-size: 10px; color: var(--green); min-width: 34px; text-align: right; }
.statusbar { height: 24px; flex: none; padding: 0 16px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--green); font-size: 10px; background: var(--white); position: relative; }
.status-aggregate-settings { position: relative; margin-left: auto; margin-right: 10px; }
.status-aggregate-settings > summary { list-style: none; cursor: pointer; font-size: 15px; font-weight: 700; line-height: 20px; }
.status-aggregate-settings > summary::-webkit-details-marker { display: none; }
.status-aggregate-settings fieldset { position: absolute; z-index: 30; right: -20px; bottom: 26px; width: 190px; margin: 0; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: 0 5px 18px #00150b30; color: var(--deep); }
.status-aggregate-settings legend { padding: 0 4px; font-weight: 700; }
.status-aggregate-settings label { display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.status-aggregate-settings input { accent-color: var(--green); margin: 0; }
.workbook-statistics-dialog { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--deep); background: var(--white); box-shadow: 0 20px 60px #00150b45; }
.workbook-statistics-dialog::backdrop { background: #07150c80; }
.workbook-statistics-dialog h2 { margin: 0 0 16px; font-size: 18px; }
.workbook-statistics-dialog form { float: right; }
.workbook-statistics-dialog .dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--green); font-size: 20px; cursor: pointer; }
.workbook-statistics-dialog dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 18px; margin: 0; }
.workbook-statistics-dialog dt { color: var(--muted); }
.workbook-statistics-dialog dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.workbook-sharing-dialog { width: min(520px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--deep); background: var(--white); box-shadow: 0 20px 60px #00150b45; }
.workbook-sharing-dialog::backdrop { background: #07150c80; }
.workbook-sharing-dialog h2 { margin: 0 0 16px; font-size: 18px; }
.workbook-sharing-dialog h3 { margin: 22px 0 8px; font-size: 14px; }
.workbook-sharing-dialog form { float: right; }
.workbook-sharing-dialog .dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--green); font-size: 20px; cursor: pointer; }
.workbook-sharing-dialog select { width: 100%; }
.workbook-share-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.workbook-share-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; }
.workbook-share-row small { color: var(--muted); }
.shared-readonly .cell-editor { display: none !important; }
.spell-check-setting { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; color: var(--green); font-size: 10px; line-height: 1.4; }
.spell-check-setting input { margin: 0; accent-color: var(--green); }
.control-sidebar { height: 100vh; overflow-y: auto; border-left: 1px solid var(--leaf); background: var(--green); padding: 0 18px 18px; scrollbar-width: thin; scrollbar-color: #c5dfcd var(--green); }
.sidebar-heading { padding: 21px 1px 17px; border-bottom: 1px solid var(--leaf); }
.eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 1.25px; color: #c5dfcd; }
.sidebar-heading h1 { font-size: 19px; line-height: 1.2; margin: 5px 0 0; font-weight: 650; letter-spacing: -.3px; color: var(--white); }
.control-section { padding: 17px 0 18px; border-bottom: 1px solid var(--leaf); }
.control-section h2 { margin: 0 0 13px; font-size: 12px; font-weight: 700; color: var(--white); }
.cell-address-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.cell-address-row label, .control-label { font-size: 10px; color: #e4f2e9; }
.name-box { height: 30px; width: 76px; border: 1px solid #c5dfcd; border-radius: 5px; background: var(--white); text-align: center; font: 600 12px Arial; color: var(--deep); outline: none; }
.name-box:focus, .formula-input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 2px #176b4520; }
.control-label { display: flex; flex-direction: column; gap: 6px; }
.formula-field { margin-top: 6px; height: 34px; display: flex; align-items: center; gap: 8px; border: 1px solid #c5dfcd; border-radius: 5px; background: var(--white); padding: 0 8px; }
.fx-mark { font: italic 600 13px Georgia, serif; color: var(--green); }
.formula-input { min-width: 0; flex: 1; height: 29px; border: 0; outline: 0; font: 11px Arial; color: var(--deep); background: transparent; }
.formula-input:focus { box-shadow: none; }
.formula-tools { display: grid; gap: 7px; margin-top: 10px; }
.formula-tools select { width: 100%; color-scheme: light; }
.formula-audit-actions { gap: 6px; }
.formula-audit-actions .action-button { min-height: 30px; padding: 0 6px; justify-content: center; font-size: 10px; }
.formula-audit-output { display: block; min-height: 17px; color: #e4f2e9; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.two-controls { display: grid; grid-template-columns: 1fr 78px; gap: 10px; }
.control-section select { height: 31px; max-width: 100%; border: 1px solid #c5dfcd; border-radius: 5px; background: var(--white); padding: 0 7px; color: var(--deep); font: 11px Arial; outline: none; }
.format-row { display: flex; align-items: center; gap: 4px; margin-top: 12px; }
.format-button { height: 29px; min-width: 24px; border: 1px solid transparent; background: transparent; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; color: var(--white); font: 12px Arial; }
.format-button:hover { border-color: #c5dfcd; background: var(--white); color: var(--green); }
.format-button.active { background: var(--soft); color: var(--deep); border-color: #c5dfcd; }
.control-divider { height: 20px; width: 1px; background: #c5dfcd; margin: 0 4px; }
.color-select-wrap { height: 29px; width: 60px; border-bottom: 3px solid #c5dfcd; border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 2px; color: var(--white); font: bold 13px Georgia, serif; }
.color-select-wrap:hover { background: var(--soft); }
.color-select-wrap select { width: 45px; height: 25px; border: 1px solid #c5dfcd; border-radius: 4px; background: var(--white); padding: 0 2px; color: var(--green); font: 9px Arial; outline: none; }
.color-select-wrap select:focus { border: 0; box-shadow: none; }
.fill-select-wrap { width: 60px; border-bottom: 0; }
.fill-select-wrap select { width: 45px; }
.alignment-row { flex-wrap: wrap; }
.format-select-label { flex: 1; min-width: 108px; font-size: 9px; }
.format-select-label select { width: 100%; }
.two-controls select, .format-select-label select { color-scheme: light; }
.button-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-button { min-height: 33px; border: 1px solid #c5dfcd; border-radius: 5px; background: var(--white); color: var(--green); font: 12px Arial; display: flex; align-items: center; justify-content: flex-start; gap: 9px; padding: 0 10px; transition: background .12s, border-color .12s; }
.action-button:hover { background: var(--soft); border-color: #a9cfb5; }
.action-button > span { font-size: 11px; }
.full-button { width: 100%; margin-top: 8px; }
.export-button { background: var(--white); color: var(--green); border-color: var(--white); }
.export-button:hover { background: var(--soft); border-color: var(--soft); }
.sidebar-help { padding: 17px 2px 5px; color: #e4f2e9; font-size: 10px; line-height: 1.65; }
.sidebar-input { width: 100%; height: 31px; border: 1px solid #c5dfcd; border-radius: 5px; background: var(--white); padding: 0 8px; color: var(--deep); font: 11px Arial; outline: none; }
.sidebar-input:focus { border-color: var(--green); box-shadow: 0 0 0 2px #176b4520; }
.replace-input-label { margin-top: 10px; }
.search-actions { margin-top: 9px; }
.conditional-row { display: grid; gap: 8px; margin-top: 12px; }
.data-controls { margin-top: 10px; grid-template-columns: minmax(0, 1fr) 82px; }
.data-actions { margin-top: 8px; }
.sheet-actions { margin-top: 8px; }
.data-actions .action-button { font-size: 10px; padding: 0 7px; }
.data-label { margin-top: 10px; }
.data-input { margin-top: 7px; }
.note-input { min-height: 66px; height: 66px; padding: 8px; resize: vertical; }
.print-margins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.print-margins-grid label { display: grid; gap: 4px; font-size: 9px; color: var(--muted); }
.print-margins-grid input { width: 100%; min-width: 0; }
.conditional-icon { flex: 0 0 auto; font-size: 12px; line-height: 1; }
.control-section [hidden] { display: none !important; }
.chart-dock { flex: none; height: 214px; overflow: auto; display: flex; align-items: stretch; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--pale); }
.chart-dock[hidden] { display: none; }
.chart-card { min-width: min(480px, 88%); max-width: 480px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); padding: 7px 10px; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; color: var(--green); font-size: 11px; }
.chart-heading-actions { display: flex; gap: 4px; }
.chart-remove { border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--green); font-size: 9px; padding: 3px 7px; }
.chart-remove:hover { background: var(--soft); }
.chart-edit-form { display: grid; grid-template-columns: 1fr 116px; gap: 8px; align-items: end; min-height: 178px; color: var(--deep); font-size: 10px; }
.chart-edit-form label { display: grid; gap: 4px; }
.chart-edit-form label:first-child, .chart-edit-form label:nth-child(4) { grid-column: 1 / -1; }
.chart-data-label-toggle { display: flex !important; align-items: center; gap: 7px !important; }
.chart-data-label-toggle input { width: auto; }
.chart-edit-form .sidebar-input { width: 100%; min-width: 0; height: 29px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); padding: 0 7px; color: var(--deep); font: 11px Arial, sans-serif; }
.chart-edit-actions { display: flex; gap: 6px; grid-column: 1 / -1; }
.chart-card svg { width: 100%; height: 166px; }
.grid-cell .sparkline { position: absolute; right: 2px; top: 4px; width: 38px; height: 20px; pointer-events: none; background: var(--white); }
.grid-cell.has-note::before { content: ""; position: absolute; top: 0; right: 0; border-top: 7px solid var(--green); border-left: 7px solid transparent; }
.grid-cell.has-note { cursor: help; }
.context-menu { position: fixed; z-index: 20; min-width: 190px; padding: 5px; border: 1px solid var(--green); border-radius: 6px; background: var(--white); box-shadow: 0 6px 20px #17453030; }
.context-menu[hidden] { display: none; }
.context-menu button { display: block; width: 100%; min-height: 31px; padding: 0 9px; border: 0; border-radius: 4px; background: var(--white); color: var(--deep); text-align: left; font: 11px Arial; }
.context-menu button:hover, .context-menu button:focus { outline: none; background: var(--soft); color: var(--green); }
.quick-analysis-lens { position: fixed; z-index: 1499; width: 28px; height: 28px; border: 1px solid var(--excel-grid-line); border-radius: 4px; color: var(--green); background: var(--white); box-shadow: 0 2px 7px #17453030; font: 16px Arial, sans-serif; cursor: pointer; }
.quick-analysis-lens:hover, .quick-analysis-lens:focus-visible { border-color: var(--green); background: var(--soft); outline: 2px solid #21734633; }
.quick-analysis-lens[hidden] { display: none; }
.quick-analysis-menu { position: fixed; z-index: 1500; width: min(320px, calc(100vw - 24px)); border: 1px solid var(--green); border-radius: 7px; padding: 8px; color: var(--deep); background: var(--white); box-shadow: 0 8px 28px #17453038; font: 12px Arial, sans-serif; }
.quick-analysis-menu[hidden] { display: none; }
.quick-analysis-header { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 8px; }
.quick-analysis-header strong { font-size: 13px; }
.quick-analysis-header button { width: 26px; height: 26px; border: 0; border-radius: 4px; background: transparent; color: inherit; font-size: 20px; cursor: pointer; }
.quick-analysis-header button:hover, .quick-analysis-header button:focus-visible { background: var(--soft); }
.quick-analysis-tabs { display: flex; gap: 3px; overflow-x: auto; border-bottom: 1px solid var(--excel-grid-line); }
.quick-analysis-tabs [role="tab"] { flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; padding: 7px 6px 6px; color: inherit; background: transparent; font: inherit; cursor: pointer; }
.quick-analysis-tabs [role="tab"][aria-selected="true"] { border-bottom-color: var(--green); color: var(--green); font-weight: 700; }
.quick-analysis-panel { display: grid; gap: 4px; padding-top: 7px; }
.quick-analysis-panel[hidden] { display: none; }
.quick-analysis-format-actions { display: grid; gap: 4px; }
.quick-analysis-chart-actions { display: grid; max-height: min(290px, 55vh); gap: 4px; overflow-y: auto; }
.quick-analysis-panel .quick-analysis-chart-option { display: flex; min-height: 50px; align-items: center; gap: 9px; padding: 5px 7px; }
.quick-analysis-chart-preview { display: grid; width: 48px; height: 36px; flex: none; place-items: center; border: 1px solid var(--excel-grid-line); background: var(--white); color: var(--green); font-size: 22px; }
.quick-analysis-chart-preview.recommended-chart-preview-bar::before,
.quick-analysis-chart-preview.recommended-chart-preview-bar-horizontal::before,
.quick-analysis-chart-preview.recommended-chart-preview-bar-stacked::before { content: "▂▅▇"; letter-spacing: 1px; }
.quick-analysis-chart-preview.recommended-chart-preview-line::before { content: "⌁"; font-size: 34px; }
.quick-analysis-chart-preview.recommended-chart-preview-scatter::before { content: "⠂⠔⠊"; font-size: 25px; }
.quick-analysis-chart-preview.recommended-chart-preview-pie::before { content: "◕"; }
.quick-analysis-chart-copy { display: grid; gap: 3px; }
.quick-analysis-chart-copy strong { font-size: 11px; font-weight: 600; }
.quick-analysis-chart-copy small { color: var(--muted); font-size: 9px; }
.quick-analysis-empty { margin: 4px 2px; color: var(--muted); font-size: 11px; }
.quick-analysis-panel button { min-height: 32px; border: 1px solid transparent; border-radius: 4px; padding: 6px 8px; color: inherit; background: transparent; text-align: left; font: inherit; cursor: pointer; }
.quick-analysis-panel button:hover, .quick-analysis-panel button:focus-visible { border-color: var(--excel-grid-line); background: var(--soft); outline: none; }
.quick-analysis-rule-entry { display: grid; gap: 8px; }
.quick-analysis-rule-entry label { display: grid; gap: 5px; }
.quick-analysis-rule-entry input { min-width: 0; height: 28px; padding: 4px 7px; border: 1px solid var(--excel-grid-line); border-radius: 3px; color: inherit; background: var(--white); font: inherit; }
.quick-analysis-rule-entry > div { display: flex; justify-content: flex-end; gap: 6px; }
#quick-analysis-status { min-height: 1.2em; margin: 7px 2px 0; color: var(--muted); font-size: 10px; }
.table-filter-button { position: absolute; inset-inline-end: 2px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: 1px solid transparent; border-radius: 2px; background: transparent; color: inherit; font: 11px Arial, sans-serif; line-height: 16px; cursor: pointer; }
.table-filter-button:hover, .table-filter-button:focus-visible { border-color: #d0d0d0; background: #f3f3f3; color: #333; outline: none; }
.table-filter-button.active { color: #174ea6; background: #dce8f7; }
.table-filter-menu { position: fixed; z-index: 50; width: 230px; max-height: min(420px, calc(100vh - 16px)); display: flex; flex-direction: column; gap: 7px; padding: 10px; border: 1px solid #b7b7b7; border-radius: 3px; background: #fff; color: #242424; box-shadow: 0 6px 18px #0002; font: 12px Arial, sans-serif; }
.table-filter-menu h3 { margin: 0; font-size: 13px; font-weight: 600; }
.table-filter-menu input[type="search"] { box-sizing: border-box; width: 100%; height: 29px; padding: 4px 7px; border: 1px solid #888; border-radius: 2px; font: inherit; }
.table-filter-operator, .table-filter-join, .table-filter-condition-value { box-sizing: border-box; min-width: 0; height: 28px; border: 1px solid #aaa; border-radius: 2px; background: #fff; color: inherit; font: inherit; }
.table-filter-condition { display: grid; grid-template-columns: minmax(0, 1fr) minmax(76px, .8fr); gap: 5px; }
.table-filter-condition:has(.table-filter-join) { grid-template-columns: 54px minmax(0, 1fr) minmax(76px, .8fr); }
.table-filter-date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.table-filter-date-row select { box-sizing: border-box; width: 100%; height: 27px; border: 1px solid #aaa; border-radius: 2px; background: #fff; color: inherit; font: inherit; }
.table-filter-date-select-all { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.table-filter-date-select-all input { margin: 0; }
.table-filter-date-values { overflow: auto; min-height: 28px; max-height: 100px; border-block: 1px solid #e2e2e2; }
.table-filter-icon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.table-filter-icon-row select { box-sizing: border-box; min-width: 0; height: 27px; border: 1px solid #aaa; border-radius: 2px; background: #fff; color: inherit; font: inherit; }
.table-filter-add-condition { display: flex; align-items: center; gap: 7px; min-height: 20px; }
.table-filter-add-condition input { margin: 0; }
.table-filter-sort, .table-filter-actions { display: flex; gap: 6px; }
.table-filter-menu button { min-height: 26px; padding: 4px 8px; border: 1px solid #b7b7b7; border-radius: 2px; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.table-filter-menu button:hover, .table-filter-menu button:focus-visible { border-color: var(--green); background: #f4f8f4; outline: none; }
.table-filter-menu button.primary { border-color: #217346; background: #217346; color: #fff; }
.table-filter-menu button:disabled { opacity: .5; cursor: default; }
.table-filter-sort button, .table-filter-actions button { flex: 1; }
.table-filter-option { display: flex; min-height: 23px; align-items: center; gap: 7px; padding: 2px 4px; border-radius: 2px; }
.table-filter-option:hover { background: #f1f1f1; }
.table-filter-option input { margin: 0; }
.table-filter-select-all { border-bottom: 1px solid #e2e2e2; padding-bottom: 6px; }
.table-filter-values { overflow: auto; min-height: 28px; max-height: 205px; }
.table-filter-values label[hidden] { display: none; }
kbd { font: 10px Arial; background: var(--white); border: 1px solid #c5dfcd; border-radius: 3px; padding: 2px 4px; color: var(--green); }
.grid-viewport:focus { outline: none; }
@media (max-width: 800px) {
  body { min-width: 640px; }
  .app-shell { grid-template-columns: minmax(0, 1fr) 245px; }
  .control-sidebar { padding-left: 14px; padding-right: 14px; }
  .grid { grid-template-columns: 42px repeat(26, 100px); }
}

/* A calmer, card-based sidebar keeps every workbook tool easy to scan. */
.app-shell { grid-template-columns: minmax(0, 1fr) 318px; }
.control-sidebar {
  padding: 0 13px 18px;
  border-left: 1px solid var(--green);
  background: var(--green);
  scrollbar-color: #c5dfcd var(--green);
}
.sidebar-heading {
  position: sticky;
  top: 0;
  z-index: 12;
  margin: 0 -13px;
  padding: 17px 18px 14px;
  border-bottom: 1px solid #ffffff30;
  background: var(--green);
}
.eyebrow { color: #e4f2e9; font-size: 9px; letter-spacing: 1.5px; }
.sidebar-heading h1 { margin-top: 5px; font-size: 20px; letter-spacing: -.35px; }
.sidebar-subtitle { margin: 5px 0 0; color: #e4f2e9; font-size: 11px; line-height: 1.4; }
.control-section {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid #c5dfcd;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 3px 12px #17453018;
}
.control-section h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
}
.control-section h2::before {
  width: 4px;
  height: 15px;
  border-radius: 4px;
  background: var(--green);
  content: "";
}
.cell-address-row label, .control-label { color: var(--green); font-size: 10px; font-weight: 600; }
.name-box,
.sidebar-input,
.formula-field,
.control-section select:not(#text-color):not(#fill-color) {
  border: 1px solid #c5dfcd;
  border-radius: 7px;
  background-color: var(--white);
  color: var(--deep);
}
.name-box { height: 34px; font-size: 12px; }
.control-section select:not(#text-color):not(#fill-color) {
  width: 100%;
  min-width: 0;
  height: 35px;
  padding: 0 9px;
  font: 12px Arial, sans-serif;
  color-scheme: light;
}
.sidebar-input { height: 35px; padding: 0 10px; font: 12px Arial, sans-serif; }
.sidebar-input::placeholder { color: #258451; opacity: .72; }
.formula-field { height: 38px; padding: 0 10px; }
.formula-input { font-size: 12px; }
.name-box:focus,
.formula-field:focus-within,
.sidebar-input:focus,
.control-section select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #176b4520;
}
.formula-input:focus { box-shadow: none; }
.control-section .control-label { gap: 7px; }
.formula-tools { gap: 8px; margin-top: 12px; }
.formula-tools .full-button { margin-top: 0; }
.formula-audit-actions { gap: 7px; }
.formula-audit-output { min-height: 0; color: var(--green); font-size: 10px; }
.two-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.data-controls { grid-template-columns: minmax(0, 1fr) 82px; }
.format-row { gap: 5px; margin-top: 10px; }
.format-button {
  min-width: 30px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--green);
}
.format-button:hover { border-color: var(--line); background: var(--pale); color: var(--deep); }
.format-button.active { border-color: #a9cfb5; background: var(--soft); color: var(--deep); }
.control-divider { background: var(--line); }
.color-select-wrap { color: var(--green); }
.color-select-wrap:hover { background: var(--pale); }
.color-select-wrap select {
  border-color: var(--line);
  border-radius: 5px;
  color: var(--deep);
}
.fill-select-wrap { border-bottom: 0; }
.format-select-label { min-width: 98px; color: var(--green); }
.format-select-label select { width: 100%; }
.button-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.action-button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #a9cfb5;
  border-radius: 7px;
  background: var(--white);
  color: var(--green);
  font: 11px Arial, sans-serif;
  line-height: 1.25;
  justify-content: center;
  gap: 7px;
  padding: 6px 8px;
  text-align: center;
  transition: background .15s, border-color .15s, transform .15s;
}
.action-button:hover { border-color: var(--green); background: var(--pale); }
.action-button:active { transform: translateY(1px); }
.action-button:focus-visible,
.format-button:focus-visible,
.chart-remove:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.action-button > span { font-size: 11px; }
.full-button { margin-top: 8px; }
.formula-tools .full-button, .formula-audit-actions .action-button { margin-top: 0; }
#create-table,
#apply-validation,
#create-chart,
#goal-seek,
#export-xlsx-button {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
  font-weight: 700;
}
#create-table:hover,
#apply-validation:hover,
#create-chart:hover,
#goal-seek:hover,
#export-xlsx-button:hover { border-color: var(--leaf); background: var(--leaf); }
.export-button { background: var(--green); color: var(--white); }
.sidebar-help {
  margin: 12px 0 0;
  padding: 12px 5px 3px;
  border-top: 1px solid #ffffff30;
  color: #e4f2e9;
  font-size: 10px;
  line-height: 1.6;
}
.sidebar-help kbd { border-color: #c5dfcd; background: var(--white); color: var(--green); }
.note-input { min-height: 78px; height: 78px; padding: 9px 10px; }
.conditional-row { gap: 8px; margin-top: 14px; }
.data-controls, .data-actions, .sheet-actions, .data-label { margin-top: 10px; }
.data-input { margin-top: 8px; }
.control-section [hidden] { display: none !important; }
@media (max-width: 800px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 245px; }
  .control-sidebar { padding-left: 10px; padding-right: 10px; }
  .sidebar-heading { margin-left: -10px; margin-right: -10px; padding-right: 14px; padding-left: 14px; }
  .control-section { padding: 12px; }
  .action-button { padding-right: 6px; padding-left: 6px; font-size: 10px; }
}

/* Keep compact controls inside their cards at every sidebar width. */
.control-sidebar { scrollbar-gutter: stable; }
.control-section { min-width: 0; }
.control-section > *,
.control-section label,
.control-section input,
.control-section select,
.control-section textarea,
.control-section button { min-width: 0; max-width: 100%; }
.format-row { min-width: 0; }
.format-row:not(.alignment-row) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 2px minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
}
.format-row:not(.alignment-row) .format-button { min-width: 0; width: 100%; }
.format-row:not(.alignment-row) .control-divider { width: 2px; margin: 0; }
.color-select-wrap {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  width: auto;
  min-width: 0;
  height: 32px;
  gap: 2px;
  align-items: center;
  justify-content: stretch;
}
.color-select-wrap select,
.fill-select-wrap select { width: 100%; min-width: 0; }
.alignment-row { display: flex; flex-wrap: wrap; }
.alignment-row .format-button { flex: 0 1 30px; }
.alignment-row .merge-cells-button { flex: 1 1 98px; font-size: 10px; white-space: nowrap; }
.alignment-row .merge-menu-button { flex: 0 0 24px; padding-inline: 2px; }
.alignment-row .control-divider { flex: 0 0 1px; }
.alignment-row .format-select-label { flex: 1 1 120px; min-width: 0; }
#wrap-text { width: 100%; margin-top: 10px; justify-content: flex-start; }
.action-button { overflow-wrap: anywhere; white-space: normal; }
.data-actions .action-button { min-height: 38px; }

/* The top bar exposes the everyday actions without taking space from the sheet. */
.sheet-topline {
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  padding: 0 14px;
}
.sheet-topline-main {
  height: 42px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.workbook-title { width: min(300px, 44%); }
.workbook-nav {
  height: 38px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.workbook-nav::-webkit-scrollbar { display: none; }
.nav-group { display: flex; align-items: center; gap: 4px; flex: none; }
.nav-divider { width: 1px; height: 21px; flex: none; margin: 0 4px; background: #ffffff55; }
.nav-button {
  width: 29px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid #ffffff55;
  border-radius: 5px;
  background: #ffffff12;
  color: var(--white);
  font: 12px Arial, sans-serif;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-button:hover,
.nav-button:focus-visible {
  border-color: var(--white);
  background: var(--white);
  color: var(--green);
  outline: none;
}
.nav-button:active { transform: translateY(1px); }
.nav-button.nav-labeled { width: auto; min-width: 59px; font-size: 11px; }
.nav-button.nav-format { font-size: 13px; }
.nav-file-actions .nav-labeled:last-child { min-width: 70px; }
@media (max-width: 800px) {
  .sheet-topline { height: 78px; padding: 0 10px; }
  .sheet-topline-main { height: 40px; }
  .workbook-nav { height: 38px; }
  .workbook-title { width: 44%; }
}

/* Keep the title and quick actions on one clean desktop line. */
.save-indicator { display: none; }
.sheet-topline {
  height: 46px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 0 14px;
}
.sheet-topline-main {
  height: auto;
  flex: 0 0 auto;
  width: auto;
  justify-content: flex-start;
}
.workbook-title { width: 220px; }
.workbook-nav { height: 46px; flex: 1 1 auto; }
@media (max-width: 800px) {
  .sheet-topline { height: 46px; gap: 8px; padding: 0 10px; }
  .sheet-topline-main { height: auto; }
  .workbook-title { width: 180px; }
  .workbook-nav { height: 46px; }
}

/* Simplify the quick-action strip after removing the sidebar branding block. */
.sheet-topline { gap: 10px; }
.workbook-title { width: 205px; font-size: 13px; }
.workbook-nav { gap: 8px; }
.nav-group {
  gap: 2px;
  padding: 3px;
  border: 1px solid #ffffff2b;
  border-radius: 7px;
  background: #ffffff12;
}
.nav-divider { display: none; }
.nav-button { border-color: transparent; background: transparent; }
.nav-button.nav-labeled { min-width: 56px; }
.nav-file-actions .nav-labeled:last-child { min-width: 68px; }
@media (max-width: 800px) {
  .workbook-title { width: 180px; }
  .workbook-nav { gap: 6px; }
}

/* Standalone Excel brand palette sampled from the workbook logo. */
html,
body {
  color-scheme: light;
  background: #edf6ef;
}

body,
body .app-shell,
body .sheet-workspace {
  color: var(--deep);
  background: #edf6ef;
}

body .sheet-workspace { background: #ffffff; }

body .sheet-topline {
  border-bottom-color: #075c2e;
  background: linear-gradient(105deg, #024e2a 0%, #087f3f 70%, #0d9949 100%);
}

body .workbook-title,
body .save-indicator,
body .nav-button { color: #ffffff; }

body .workbook-title:hover,
body .workbook-title:focus,
body .nav-group {
  border-color: #ffffff55;
  background: #ffffff12;
}

body .save-dot {
  background: #b7f34b;
  box-shadow: 0 0 0 3px #b7f34b35;
}

body .nav-button {
  border-color: transparent;
  background: transparent;
}

body .nav-button:hover,
body .nav-button:focus-visible {
  border-color: #b7f34b;
  background: #b7f34b;
  color: #06361d;
}

body .grid-viewport {
  background: #ffffff;
  scrollbar-color: #8fc79a #e6f2e8;
}

body .grid-cell:not(.col-head):not(.row-head):not(.corner),
body .grid-cell.frozen-row,
body .grid-cell.frozen-col,
body .cell-editor {
  color: #1d3b28;
  background: #ffffff;
}

body .grid-cell.col-head,
body .grid-cell.row-head,
body .grid-cell.corner,
body .grid-cell.row-head.frozen-row,
body .grid-cell.col-head.frozen-col {
  color: #245b36;
  background: #eaf5ec;
}

body .grid-cell,
body .grid-cell.col-head,
body .grid-cell.row-head,
body .grid-cell.corner { border-color: var(--excel-grid-line); }

body .grid-cell.selected,
body .grid-cell.range-selected:not(.selected) {
  box-shadow: inset 0 0 0 2px var(--excel-block-border);
}

body .grid-cell.audit-reference { outline-color: #65a873; }

body .fill-handle,
body .grid-cell.selected::after,
body .column-resize-handle:hover,
body .row-resize-handle:hover,
body .grid-cell.has-note::before {
  background-color: #0a9847;
}

body .sheet-tabs-row,
body .chart-dock,
body .statusbar {
  border-color: #c9dfce;
  color: #245b36;
  background: #eaf5ec;
}

body .sheet-tab,
body .add-sheet,
body .zoom-control,
body .zoom-control span { color: #245b36; }

body .sheet-tab:hover,
body .add-sheet:hover,
body .zoom-control button:hover {
  color: #06361d;
  background: #d9eddc;
}

body .sheet-tab.active {
  color: #075b2e;
  background: #ffffff;
  box-shadow: 0 -3px 0 #13a34a inset;
}

body .zoom-control button {
  border-color: #c2d9c7;
  color: #087f3f;
  background: #ffffff;
}

body .control-sidebar {
  border-left-color: #c2d9c7;
  background: #eaf5ec;
  scrollbar-color: #98c79f #eaf5ec;
}

body .sidebar-heading {
  border-bottom-color: #c2d9c7;
  background: #eaf5ec;
}

body .eyebrow,
body .sidebar-subtitle,
body .sidebar-help,
body .control-label,
body .cell-address-row label,
body .formula-audit-output { color: #4b7254; }

body .sidebar-heading h1,
body .control-section h2,
body .format-button,
body .color-select-wrap,
body .format-select-label,
body .formula-field .fx-mark { color: #123d26; }

body .control-section {
  border-color: #c6ddcb;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(2, 78, 42, 0.08);
}

body .control-section h2 { border-bottom-color: #dce9df; }
body .control-section h2::before { background: #0a9847; }

body .name-box,
body .sidebar-input,
body .formula-field,
body .control-section select:not(#text-color):not(#fill-color),
body .color-select-wrap select,
body .formula-input {
  border-color: #c2d9c7;
  color: #123d26;
  background-color: #ffffff;
}

body .sidebar-input::placeholder { color: #6b9272; }

body .name-box:focus,
body .formula-field:focus-within,
body .sidebar-input:focus,
body .control-section select:focus {
  border-color: #087f3f;
  box-shadow: 0 0 0 3px rgba(8, 127, 63, 0.15);
}

body .format-button:hover,
body .format-button.active,
body .color-select-wrap:hover,
body .action-button:hover,
body .chart-remove:hover,
body .context-menu button:hover,
body .context-menu button:focus {
  border-color: #8fc79a;
  color: #075b2e;
  background: #e4f2e8;
}

body .control-divider,
body .sidebar-help { border-color: #c9dfce; }

body .action-button,
body .chart-remove,
body .context-menu,
body .context-menu button,
body kbd {
  border-color: #c2d9c7;
  color: #087f3f;
  background: #ffffff;
}

body #create-table,
body #apply-validation,
body #create-chart,
body #goal-seek,
body #export-xlsx-button,
body .export-button {
  border-color: #087f3f;
  color: #ffffff;
  background: #087f3f;
}

body #create-table:hover,
body #apply-validation:hover,
body #create-chart:hover,
body #goal-seek:hover,
body #export-xlsx-button:hover,
body .export-button:hover {
  border-color: #05652f;
  color: #ffffff;
  background: #05652f;
}

body .chart-card {
  border-color: #c9dfce;
  background: #ffffff;
  color: #1d3b28;
}

body .chart-heading { color: #075b2e; }
body .chart-remove { color: #087f3f; background: #ffffff; }
body .context-menu { border-color: #c2d9c7; }
body ::selection { color: #06361d; background: #b7f34b88; }
/* Pointer-focus contract for tabs and select controls. */
:where([role="tab"], [role="option"], select, [aria-selected="true"], [data-state="active"], .active, .selected):focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Final standalone Excel compact ribbon layout. */
@media (max-width: 800px) {
  html.workbook-route body .ribbon-quick-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 36px 28px;
    min-height: 64px;
    height: 64px;
    flex: 0 0 64px;
    align-items: center;
    overflow: visible;
  }
  html.workbook-route body .sheet-topline-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }
  html.workbook-route body .workbook-nav {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    flex: 0 1 auto;
    margin-left: 0;
    overflow-x: auto;
    justify-content: flex-end;
  }
  html.workbook-route body .nav-group[aria-label="Quick formatting"],
  html.workbook-route body .nav-group.nav-file-actions,
  html.workbook-route body .nav-divider {
    display: none !important;
  }
  html.workbook-route body .ribbon-tabs {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
  }
  html.workbook-route body .ribbon-tabs {
    width: 100%;
    max-width: none;
    height: 28px;
    flex: 0 0 auto;
    justify-content: flex-start;
    margin: 0;
    padding: 0 8px;
    border-top: 1px solid #e5e5e5 !important;
    background: #f5f5f5 !important;
  }
  html.workbook-route body .ribbon-tab {
    min-width: 54px;
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }
  html.workbook-route body .control-sidebar .ribbon-panel {
    min-height: 64px;
    height: 64px;
    max-height: 64px;
  }
}

/* Keep the sheet scroll controls visible, like Excel, while matching this app's favicon palette. */
html.workbook-route body .grid-viewport {
  scrollbar-width: auto !important;
  scrollbar-color: #8fc79a #e6f2e8;
}

html.workbook-route body .grid-viewport::-webkit-scrollbar {
  display: block !important;
  width: 12px;
  height: 12px;
}

html.workbook-route body .grid-viewport::-webkit-scrollbar-track {
  background: #e6f2e8;
}

html.workbook-route body .grid-viewport::-webkit-scrollbar-thumb {
  border: 3px solid #e6f2e8;
  border-radius: 999px;
  background: #8fc79a;
}

html.workbook-route body .grid-viewport::-webkit-scrollbar-thumb:hover {
  background: #0a9847;
}

/* Excel's collapsed ribbon leaves the formula bar visible above the grid. */
html.workbook-route body .ribbon-quick-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 36px 36px;
  min-height: 72px;
  height: 72px;
  flex: 0 0 72px;
  align-items: center;
  overflow: visible;
  padding: 0 8px;
}
html.workbook-route body .sheet-topline-main {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
html.workbook-route body .workbook-nav {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin-left: 0;
  justify-content: flex-end;
}
html.workbook-route body .ribbon-tabs {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
}
html.workbook-route body .control-sidebar.ribbon-collapsed {
  height: 0;
  min-height: 0;
  padding: 0 !important;
  overflow: hidden;
}
html.workbook-route body .control-sidebar.ribbon-collapsed .ribbon-panel {
  display: none !important;
}
html.workbook-route body .formula-bar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 15px 8px 13px;
  border-bottom: 1px solid #d9d9d9;
  color: #242424;
  background: #ffffff;
}
html.workbook-route body .formula-bar .cell-address-row {
  width: 120px;
  height: 24px;
  flex: 0 0 120px;
  flex-direction: row;
  align-items: stretch;
  margin: 0;
}
html.workbook-route body .formula-bar .cell-address-row label {
  display: none;
}
html.workbook-route body .formula-bar .name-box {
  width: 116px;
  height: 24px;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid #d9d9d9 !important;
  border-radius: 3px;
  color: #242424 !important;
  background: #ffffff !important;
  font-size: 11px;
}
html.workbook-route body .formula-actions {
  height: 24px;
  flex: 0 0 104px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-left: 1px solid #e1e1e1;
  border-right: 1px solid #e1e1e1;
  background: #ffffff;
}
html.workbook-route body .formula-actions button {
  width: 29px;
  height: 23px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: #555555;
  background: transparent;
  font: 13px Arial, sans-serif;
  cursor: pointer;
}
html.workbook-route body .formula-actions button:last-child {
  width: 38px;
  color: #107c41;
  font-style: italic;
  font-weight: 700;
}
html.workbook-route body .formula-actions button:hover {
  color: #00552c;
  background: #eaf5ed;
}
html.workbook-route body .formula-bar .formula-field {
  height: 24px;
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0 8px;
  border: 1px solid #d9d9d9 !important;
  border-radius: 0 3px 3px 0;
  background: #ffffff !important;
}
html.workbook-route body .formula-bar .formula-input {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 1px 4px;
  border: 0 !important;
  outline: 0;
  color: #242424 !important;
  background: transparent !important;
  font-size: 11px;
}
html.workbook-route body .control-sidebar.ribbon-collapsed .control-section {
  display: none !important;
}

@media (max-width: 800px) {
  html.workbook-route body .workbook-nav {
    min-width: 0;
    flex: 0 1 auto;
    margin-left: auto;
    overflow-x: auto;
  }
  html.workbook-route body .nav-group[aria-label="Quick formatting"],
  html.workbook-route body .nav-group.nav-file-actions,
  html.workbook-route body .nav-divider {
    display: none !important;
  }
  html.workbook-route body .ribbon-tabs {
    width: 100%;
    max-width: none;
    height: 30px;
    flex: 0 0 30px;
    justify-content: flex-start;
    margin: 0;
    padding: 0 8px;
    border-top: 1px solid #e5e5e5 !important;
    background: #f5f5f5 !important;
  }
  html.workbook-route body .ribbon-tab {
    min-width: 54px;
    height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }
}

/* Keep Home controls in a single, scrollable ribbon row at narrow widths. */
html.workbook-route body #ribbon-panel-home .alignment-row {
  min-width: 220px;
  height: 28px;
  flex-wrap: nowrap !important;
}

html.workbook-route body .ribbon-panel {
  scrollbar-width: auto !important;
  scrollbar-color: #8fc79a #e6f2e8;
}

html.workbook-route body .ribbon-panel::-webkit-scrollbar {
  display: block !important;
  height: 9px;
}

html.workbook-route body .ribbon-panel::-webkit-scrollbar-track {
  background: #e6f2e8;
}

html.workbook-route body .ribbon-panel::-webkit-scrollbar-thumb {
  border: 2px solid #e6f2e8;
  border-radius: 999px;
  background: #8fc79a;
}

/* Match Excel's compact title, ribbon, and formula-bar stack. */
html.workbook-route body .ribbon-quick-row {
  grid-template-rows: 28px 28px;
  min-height: 56px;
  height: 56px;
  flex-basis: 56px;
}

html.workbook-route body #ribbon-panel-page-layout {
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
}

html.workbook-route body #ribbon-panel-page-layout .page-layout-command {
  height: 36px;
  padding: 0 7px;
  gap: 1px;
  font-size: 10px;
}

html.workbook-route body #ribbon-panel-page-layout .page-layout-command > span:first-child {
  font-size: 16px;
  line-height: 17px;
}

html.workbook-route body .formula-bar {
  height: 26px;
  flex-basis: 26px;
  padding: 0 8px;
}

/* Put sheet statistics, zoom, and full-screen controls where Excel keeps them. */
html.workbook-route body .statusbar {
  height: 28px;
  padding: 0 8px;
  justify-content: flex-start;
  gap: 10px;
}

html.workbook-route body .statusbar-left,
html.workbook-route body .statusbar-right {
  display: flex;
  min-width: 0;
  align-items: center;
}

html.workbook-route body .statusbar-left { gap: 10px; }
html.workbook-route body .statusbar-right {
  margin-left: auto;
  gap: 8px;
}

html.workbook-route body #status-workbook-statistics {
  padding: 0;
  border: 0;
  color: #245b36;
  background: transparent;
  font: 10px Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

html.workbook-route body #status-workbook-statistics:hover {
  color: #06361d;
  text-decoration: underline;
}

html.workbook-route body #selection-summary,
html.workbook-route body #cell-count {
  white-space: nowrap;
}

html.workbook-route body .status-aggregate-settings {
  margin: 0;
}

html.workbook-route body .statusbar .zoom-control {
  gap: 4px;
}

html.workbook-route body .zoom-control input[type="range"] {
  width: 64px;
  height: 12px;
  margin: 0;
  padding: 0;
  accent-color: #07853d;
  cursor: pointer;
}

html.workbook-route body #zoom-label {
  min-width: 34px;
  text-align: center;
}

html.workbook-route body #toggle-fullscreen {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: #245b36;
  background: transparent;
  font: 16px Arial, sans-serif;
  cursor: pointer;
}

html.workbook-route body #toggle-fullscreen:hover {
  color: #06361d;
  background: #d9eddc;
}

/* Excel's Font Color and Fill Color split buttons open a theme and standard color gallery. */
.color-palette-menu { position: relative; display: inline-flex; width: 60px; flex: 0 0 60px; }
.color-palette-menu > summary.color-select-wrap {
  position: relative;
  display: flex;
  width: 60px;
  height: 29px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  list-style: none;
}
.color-palette-menu > summary::-webkit-details-marker { display: none; }
.color-palette-menu > summary::marker { content: ""; }
.font-color-mark { color: #000; font: bold 14px Georgia, serif; }
.fill-color-mark { color: #242424; font: bold 13px Arial, sans-serif; }
.color-current-underline { position: absolute; bottom: 1px; left: 9px; width: 25px; height: 4px; border: 1px solid #777; background: #000; }
.color-menu-chevron { padding-left: 2px; color: #414141; font: 9px Arial, sans-serif; }
.color-palette-menu[open] > summary.color-select-wrap { background: #edf5ef; }
.color-palette-menu > select[hidden] { display: none !important; }
.color-palette-popup {
  position: fixed;
  z-index: 1450;
  display: none;
  width: 272px;
  max-height: min(430px, calc(100vh - 16px));
  overflow-y: auto;
  padding: 8px 8px 5px;
  border: 1px solid #c8c8c8;
  border-radius: 2px;
  color: #242424;
  background: #fff;
  box-shadow: 0 4px 16px #0003;
  font: 12px Arial, sans-serif;
}
.color-palette-menu[open] .color-palette-popup { display: block; }
.color-palette-heading { margin: 0 -2px; padding: 8px 4px 5px; font-weight: 600; }
.color-theme-grid,
.color-standard-grid { display: grid; grid-template-columns: repeat(10, 1fr); justify-items: center; }
.color-theme-grid { row-gap: 14px; padding: 0 0 8px; border-bottom: 1px solid #e6e6e6; }
.color-swatch { width: 16px; height: 16px; margin: 0; padding: 0; border: 1px solid #d5d5d5; border-radius: 50%; cursor: pointer; }
.color-swatch:hover,
.color-swatch:focus-visible,
.color-swatch[aria-pressed="true"] { z-index: 1; border-color: #333; outline: 1px solid #fff; box-shadow: 0 0 0 2px #333; }
.color-automatic-option,
.color-more-option,
.color-eyedropper-option { display: flex; width: 100%; min-height: 36px; align-items: center; gap: 9px; border: 0; border-radius: 2px; padding: 0 7px; color: #242424; background: #fff; text-align: left; cursor: pointer; font: 12px Arial, sans-serif; }
.color-automatic-option { min-height: 40px; }
.color-automatic-option::before { width: 17px; height: 17px; border: 1px solid #c8c8c8; border-radius: 50%; background: linear-gradient(135deg, #111 0 43%, #fff 45% 100%); content: ""; }
.color-more-option,
.color-eyedropper-option { border-top: 1px solid #e6e6e6; }
.color-automatic-option:hover,
.color-more-option:hover,
.color-eyedropper-option:hover { background: #f1f1f1; }
.color-more-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
html.workbook-route #grid .grid-cell:not(.col-head):not(.row-head):not(.corner) { color: #242424; }

/* Final app-level colors stay aligned with the Excel favicon on workbook routes. */
html.workbook-route {
  --excel-block-border: #00854a;
  --accent: #008044;
  --accent-strong: #003d2b;
}
html.workbook-route body .sheet-topline {
  border-bottom: 2px solid #00d7b0 !important;
  background: linear-gradient(105deg, #003d2b 0%, #006a3a 56%, #008044 100%) !important;
}
html.workbook-route body .ribbon-tabs {
  border-top-color: #00d7b0 !important;
  background: linear-gradient(90deg, #003d2b 0%, #005b3b 62%, #006b56 100%) !important;
}
html.workbook-route body .ribbon-tab[aria-selected="true"] {
  border-bottom-color: #aaff35 !important;
  color: #f2fff5 !important;
  -webkit-text-fill-color: #f2fff5 !important;
  background: #00a85a42 !important;
}
html.workbook-route body .ribbon-tab:hover,
html.workbook-route body .ribbon-tab:focus-visible {
  color: #003d2b !important;
  -webkit-text-fill-color: #003d2b !important;
  background: #aaff35 !important;
}
html.workbook-route body .sheet-tab.active {
  box-shadow: 0 -3px 0 #aaff35 inset !important;
  color: #005c36 !important;
}
html.workbook-route body .grid-cell.selected {
  box-shadow: inset 0 0 0 2px #00854a !important;
}
html.workbook-route body .grid-cell.col-head,
html.workbook-route body .grid-cell.row-head,
html.workbook-route body .grid-cell.corner {
  background: #e8f8ed !important;
  color: #075b3b !important;
}
html.workbook-route #grid { direction: inherit; }
html.workbook-route #grid .grid-cell { direction: ltr; }
html.workbook-route #grid[dir="rtl"] .row-head,
html.workbook-route #grid[dir="rtl"] .corner {
  left: auto;
  right: 0;
}
html.workbook-route #grid[dir="rtl"] .frozen-col { left: auto; }
html.workbook-route .page-layout-command[aria-pressed="true"] {
  border-color: #7ed39a;
  color: #004b32;
  background: #e2faed;
}
html.workbook-route .page-layout-command[aria-pressed="true"] > span:first-child { color: #008044; }

/* Standalone shell follows Excel's light chrome with the TRONXVI green/teal accents. */
html:not([data-appearance]) body .sheet-topline,
html:not([data-appearance]) body .ribbon-quick-row {
  color: #ffffff !important;
  background: linear-gradient(100deg, #00552c 0%, #087f3f 62%, #00875b 100%) !important;
  border-color: #00c9a6 !important;
}
html:not([data-appearance]) body .workbook-title {
  border-color: transparent !important;
  color: #ffffff !important;
  background: transparent !important;
  -webkit-text-fill-color: #ffffff !important;
}
html:not([data-appearance]) body .workbook-title:hover,
html:not([data-appearance]) body .workbook-title:focus {
  border-color: #79e9c8 !important;
  background: #ffffff19 !important;
}
html:not([data-appearance]) body .save-indicator { color: #e3f8ec !important; }
html:not([data-appearance]) body .save-dot {
  background: #42dc36 !important;
  box-shadow: 0 0 0 3px #42dc3633 !important;
}
html:not([data-appearance]) body .home-nav-button,
html:not([data-appearance]) body .nav-button {
  border-color: #ffffff38 !important;
  color: #ffffff !important;
  background: #ffffff12 !important;
}
html:not([data-appearance]) body .nav-button:hover,
html:not([data-appearance]) body .nav-button:focus-visible {
  border-color: #42dc36 !important;
  color: #ffffff !important;
  background: #ffffff24 !important;
}
html:not([data-appearance]) body #share-workbook {
  border-color: #42dc36 !important;
  color: #003f24 !important;
  background: linear-gradient(110deg, #42dc36 0%, #00c9a6 100%) !important;
}
html:not([data-appearance]) body #share-workbook:hover {
  border-color: #b0ff74 !important;
  color: #003f24 !important;
  background: linear-gradient(110deg, #68e94c 0%, #20dbb5 100%) !important;
}
html:not([data-appearance]) body .ribbon-tabs {
  border-color: #e5e5e5 !important;
  background: #f5f5f5 !important;
}
html:not([data-appearance]) body .ribbon-tab {
  color: #444444 !important;
  -webkit-text-fill-color: #444444 !important;
  background: transparent !important;
}
html:not([data-appearance]) body .ribbon-tab:hover,
html:not([data-appearance]) body .ribbon-tab:focus-visible {
  color: #00552c !important;
  -webkit-text-fill-color: #00552c !important;
  background: #e5f8ef !important;
}
html:not([data-appearance]) body .ribbon-tab[aria-selected="true"] {
  border-bottom-color: #087f3f !important;
  color: #087f3f !important;
  -webkit-text-fill-color: #087f3f !important;
  background: #ffffff !important;
}
html:not([data-appearance]) body .grid-cell.selected {
  box-shadow: inset 0 0 0 2px #217346 !important;
}
html:not([data-appearance]) body .grid-cell.col-head,
html:not([data-appearance]) body .grid-cell.row-head,
html:not([data-appearance]) body .grid-cell.corner {
  background: #f5f5f5 !important;
  color: #555555 !important;
}
html:not([data-appearance]) body .sheet-tab.active {
  box-shadow: 0 -2px 0 #00a97d inset !important;
  color: #087f3f !important;
}

:where(button, input, select, textarea, [role="gridcell"], [role="tab"]):focus-visible { outline: 3px solid var(--excel-block-border); outline-offset: 2px; }
.compatibility-notice { margin-top: 10px; padding: 10px 12px; border: 1px solid #a66b12; border-left: 4px solid #a66b12; border-radius: 6px; color: #5a3b08; background: #fff8e8; font-size: 11px; line-height: 1.5; }
.compatibility-notice p { margin: 6px 0; }
.compatibility-notice ul { margin: 6px 0 0; padding-left: 18px; }
.compatibility-notice li + li { margin-top: 4px; }

/* One workbook ribbon replaces the separate right-hand controls sidebar. */
body { min-width: 320px; }
.app-shell { display: block; width: 100vw; height: 100dvh; }
.sheet-workspace { width: 100%; height: 100%; }
.sheet-topline {
  height: auto;
  flex: none;
  display: block;
  padding: 0;
  border-bottom: 1px solid #075c2e;
}
.app-ribbon { display: flex; flex-direction: column; min-width: 0; }
.sheet-topline { background: #eaf5ec; }
.ribbon-quick-row {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
}
.sheet-topline-main { min-width: 0; flex: 0 0 auto; }
.workbook-title { width: clamp(150px, 16vw, 235px); }
.workbook-nav { height: 40px; flex: 1 1 auto; justify-content: flex-end; }
.ribbon-tabs {
  display: flex;
  min-width: 0;
  height: 36px;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  padding: 0 14px;
  border-top: 1px solid #ffffff28;
  background: #075f31;
  scrollbar-width: thin;
}
.ribbon-tab {
  min-width: 72px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 5px 5px 0 0;
  color: #f2fff5;
  background: transparent;
  font: 600 12px Arial, sans-serif;
  cursor: pointer;
}
.ribbon-tab:hover,
.ribbon-tab:focus-visible { color: #103c21; background: #b7f34b; outline: none; }
.ribbon-tab[aria-selected="true"] {
  border-bottom-color: #b7f34b;
  color: #ffffff;
  background: #ffffff20;
}
.control-sidebar {
  height: auto;
  min-height: 0;
  overflow: hidden;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid #c2d9c7;
  background: #eaf5ec;
  scrollbar-gutter: auto;
}
.ribbon-panel {
  display: flex;
  min-width: 0;
  max-height: min(300px, 34vh);
  gap: 8px;
  overflow: auto hidden;
  align-items: stretch;
  scrollbar-width: thin;
  scrollbar-color: #98c79f #eaf5ec;
}
.ribbon-panel[hidden] { display: none !important; }
.control-section {
  min-width: 250px;
  max-width: 420px;
  max-height: min(284px, calc(34vh - 16px));
  flex: 1 0 260px;
  overflow: auto;
  margin: 0;
  padding: 11px 12px;
  border-color: #c6ddcb;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(2, 78, 42, 0.07);
  scrollbar-width: thin;
}
.control-section h2 { margin-bottom: 9px; padding-bottom: 7px; }
.review-section { min-width: min(100%, 900px); max-width: 1200px; }
.sidebar-help { display: none; }
.ribbon-panel [hidden] { display: none !important; }
@media (max-width: 800px) {
  .ribbon-quick-row { flex-wrap: wrap; gap: 4px 8px; padding: 5px 8px; }
  .sheet-topline-main { flex: 1 0 145px; }
  .workbook-title { width: min(100%, 190px); }
  .workbook-nav { flex: 1 1 100%; justify-content: flex-start; height: 34px; }
  .nav-button.nav-labeled { min-width: 46px; }
  .ribbon-tabs { height: 34px; padding: 0 8px; }
  .ribbon-tab { min-width: 64px; padding: 0 10px; font-size: 11px; }
  .control-sidebar { padding: 7px 8px; }
  .ribbon-panel { max-height: min(270px, 36vh); }
  .control-section { min-width: 245px; max-height: min(254px, calc(36vh - 14px)); flex-basis: 245px; padding: 9px; }
  .review-section { min-width: min(100%, 720px); }
}

/* Compact single-row green navigation with a sideways-scrolling tool strip. */
.app-ribbon { display: flex; flex-direction: column; min-width: 0; }
.sheet-topline,
.app-ribbon { background: #eaf5ec; }
.ribbon-quick-row {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  height: 44px;
  flex: 0 0 44px;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 3px 10px;
  background: #08763b;
  scrollbar-width: thin;
  scrollbar-color: #b7f34b #075f31;
}
.sheet-topline-main { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.workbook-title { width: clamp(118px, 11vw, 185px); height: 30px; font-size: 13px; }
.save-indicator { font-size: 10px; }
.workbook-nav { height: 32px; flex: 0 0 auto; justify-content: flex-start; gap: 4px; }
.nav-group { gap: 2px; }
.nav-button { min-width: 29px; height: 28px; padding: 3px 7px; font-size: 11px; }
.nav-button.nav-labeled { min-width: 42px; }
.ribbon-tabs {
  box-sizing: border-box;
  height: 34px;
  min-width: 0;
  max-width: clamp(285px, 36vw, 555px);
  flex: 0 0 auto;
  margin-left: auto;
  gap: 1px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px;
  border: 0;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: #b7f34b #075f31;
}
.ribbon-tab { min-width: 58px; padding: 0 9px; font-size: 11px; }
.control-sidebar { max-width: min(100%, 1080px); padding: 5px 9px; background: #eaf5ec; }
.ribbon-panel {
  min-height: 88px;
  max-height: min(190px, 25vh);
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
}
.ribbon-panel::-webkit-scrollbar,
.ribbon-quick-row::-webkit-scrollbar,
.ribbon-tabs::-webkit-scrollbar { height: 6px; }
.ribbon-panel::-webkit-scrollbar-thumb { border-radius: 99px; background: #98c79f; }
.control-section {
  box-sizing: border-box;
  width: clamp(252px, 24vw, 325px);
  min-width: 252px;
  max-width: 325px;
  height: min(178px, calc(25vh - 12px));
  max-height: min(178px, calc(25vh - 12px));
  flex: 0 0 clamp(252px, 24vw, 325px);
  overflow: auto;
  scroll-snap-align: start;
  padding: 8px 9px;
  font-size: 11px;
}
.control-section h2 { margin-bottom: 6px; padding-bottom: 5px; font-size: 11px; }
.control-section .control-label { gap: 4px; margin-bottom: 5px; font-size: 10px; }
.control-section input:not([type="checkbox"]):not([type="radio"]),
.control-section select,
.control-section textarea,
.control-section button {
  font-size: 11px;
}
.control-section input:not([type="checkbox"]):not([type="radio"]),
.control-section select { min-height: 28px; padding-top: 4px; padding-bottom: 4px; }
.control-section .action-button { min-height: 28px; padding: 5px 7px; }
.review-section { min-width: min(520px, 72vw); max-width: 720px; flex-basis: min(520px, 72vw); }
@media (max-width: 800px) {
  .ribbon-quick-row { height: 42px; min-height: 42px; flex-basis: 42px; flex-wrap: nowrap; gap: 5px; padding: 3px 7px; }
  .sheet-topline-main { flex: 0 0 auto; gap: 5px; }
  .workbook-title { width: 126px; height: 28px; font-size: 12px; }
  .save-indicator { display: none; }
  .workbook-nav { height: 30px; }
  .nav-button { min-width: 27px; height: 26px; padding: 2px 6px; }
  .nav-button.nav-labeled { min-width: 39px; }
  .ribbon-tabs { max-width: 300px; height: 32px; }
  .ribbon-tab { min-width: 55px; padding: 0 7px; font-size: 10px; }
  .control-sidebar { max-width: 100%; padding: 4px 6px; }
  .ribbon-panel { min-height: 78px; max-height: min(168px, 24vh); gap: 6px; }
  .control-section { width: 252px; min-width: 252px; max-width: 252px; height: min(156px, calc(24vh - 10px)); max-height: min(156px, calc(24vh - 10px)); flex-basis: 252px; padding: 7px; }
  .review-section { min-width: min(460px, 84vw); max-width: 600px; flex-basis: min(460px, 84vw); }
}

/* Keep every workbook tool in one full-width ribbon instead of separate cards. */
.control-sidebar {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  padding: 0 14px 7px;
}
.ribbon-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  gap: 0;
  border: 1px solid #c6ddcb;
  border-radius: 8px;
  background: #fff;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
}
body .control-sidebar .control-section {
  box-sizing: border-box;
  width: clamp(270px, 25vw, 340px);
  min-width: 270px;
  max-width: none;
  height: min(178px, calc(25vh - 12px));
  max-height: min(178px, calc(25vh - 12px));
  flex: 0 0 clamp(270px, 25vw, 340px);
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  background: #fff;
  scroll-snap-align: start;
}
body .control-sidebar .control-section:last-child { border-right: 0; }
body .control-sidebar .control-section { scrollbar-width: none; }
body .control-sidebar .control-section::-webkit-scrollbar { display: none; }
.formula-calculation-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: center;
  gap: 5px 8px;
}
.formula-calculation-section h2,
.formula-calculation-section .control-label,
.formula-calculation-section #calculation-status { grid-column: 1 / -1; }
.formula-calculation-section .control-label { margin: 0; }
.formula-calculation-section #calculation-mode { grid-column: 1; width: 100%; }
.formula-calculation-section .formula-calculation-actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.formula-calculation-section .formula-calculation-actions .action-button { min-width: 0; min-height: 31px; padding: 5px 7px; font-size: 10px; }
.formula-calculation-section #calculation-status { min-height: 12px; font-size: 9px; }
.review-section {
  min-width: 270px;
  max-width: none;
  flex-basis: clamp(270px, 25vw, 340px);
}
@media (max-width: 800px) {
  .control-sidebar { padding: 0 6px 5px; }
  .ribbon-panel { min-height: 78px; max-height: min(168px, 24vh); }
  .control-section,
  .review-section {
    width: 270px;
    min-width: 270px;
    height: min(156px, calc(24vh - 10px));
    max-height: min(156px, calc(24vh - 10px));
    flex-basis: 270px;
  }
}

/* Compact density across the complete workbook, with matching renderer metrics. */
.ribbon-quick-row { height: 36px; min-height: 36px; flex-basis: 36px; gap: 4px; padding: 2px 8px; }
.sheet-topline-main { gap: 5px; }
.workbook-title { width: clamp(108px, 10vw, 160px); height: 25px; padding: 3px 6px; font-size: 11px; }
.save-indicator { font-size: 9px; gap: 5px; }
.workbook-nav { height: 27px; gap: 3px; }
.nav-group { gap: 1px; }
.nav-button { min-width: 24px; height: 23px; padding: 2px 5px; font-size: 9px; }
.nav-button.nav-labeled { min-width: 36px; }
.ribbon-tabs { height: 28px; }
.ribbon-tab { min-width: 50px; padding: 0 7px; font-size: 9px; border-bottom-width: 2px; }
.control-sidebar { padding: 0 9px 4px; }
.ribbon-panel { min-height: 70px; max-height: min(148px, 21vh); }
.ribbon-panel::-webkit-scrollbar,
.ribbon-quick-row::-webkit-scrollbar,
.ribbon-tabs::-webkit-scrollbar { height: 4px; }
body .control-sidebar .control-section {
  width: clamp(238px, 22vw, 300px);
  min-width: 238px;
  height: min(138px, calc(21vh - 10px));
  max-height: min(138px, calc(21vh - 10px));
  flex-basis: clamp(238px, 22vw, 300px);
  padding: 6px 7px;
  font-size: 9px;
}
.control-section h2 { margin-bottom: 4px; padding-bottom: 4px; font-size: 10px; }
.control-section .control-label { gap: 3px; margin-bottom: 3px; font-size: 9px; }
.control-section input:not([type="checkbox"]):not([type="radio"]),
.control-section select,
.control-section textarea,
.control-section button { font-size: 9px; }
.control-section input:not([type="checkbox"]):not([type="radio"]),
.control-section select { min-height: 23px; padding-top: 2px; padding-bottom: 2px; }
.control-section .action-button { min-height: 23px; padding: 3px 5px; }
.review-section { min-width: 238px; flex-basis: clamp(238px, 22vw, 300px); }
.grid { grid-template-columns: 40px repeat(26, 64px); grid-auto-rows: 20px; font-size: 11px; --col-size: 64px; }
.grid-cell { padding-inline: 5px; }
.grid-cell.col-head, .grid-cell.row-head, .grid-cell.corner { font-size: 9px; }
.cell-editor { padding-inline: 5px; font-size: 10px; }
.sheet-tabs-row { height: 31px; padding-inline: 8px; gap: 3px; }
.sheet-tabs { gap: 3px; }
.sheet-tab { height: 25px; padding-inline: 10px; font-size: 9px; }
.add-sheet { width: 23px; height: 23px; font-size: 15px; }
.zoom-control { gap: 5px; font-size: 10px; }
.zoom-control button { width: 19px; height: 19px; font-size: 12px; line-height: 12px; }
.zoom-control span { font-size: 9px; min-width: 30px; }
.statusbar { height: 20px; padding-inline: 10px; font-size: 9px; }
.status-aggregate-settings { margin-right: 6px; }
.status-aggregate-settings > summary { font-size: 12px; line-height: 16px; }
.status-aggregate-settings fieldset { bottom: 21px; width: 170px; padding: 7px; gap: 5px; font-size: 9px; }
.workbook-statistics-dialog,
.workbook-sharing-dialog { padding: 18px; border-radius: 9px; font-size: 11px; }
.workbook-statistics-dialog { width: min(370px, calc(100vw - 28px)); }
.workbook-sharing-dialog { width: min(460px, calc(100vw - 28px)); max-height: calc(100vh - 28px); }
.workbook-statistics-dialog h2, .workbook-sharing-dialog h2 { margin-bottom: 11px; font-size: 15px; }
.workbook-sharing-dialog h3 { margin: 16px 0 6px; font-size: 12px; }
.workbook-statistics-dialog dl { gap: 7px 12px; }
.workbook-statistics-dialog .dialog-close, .workbook-sharing-dialog .dialog-close { width: 26px; height: 26px; font-size: 16px; }
.chart-dock { height: 175px; gap: 7px; padding: 6px 9px; }
.chart-card { min-width: min(400px, 84%); max-width: 400px; padding: 5px 8px; }
.chart-edit-form { grid-template-columns: 1fr 100px; gap: 6px; min-height: 145px; font-size: 9px; }
.chart-edit-form .sidebar-input { height: 24px; padding-inline: 5px; font-size: 9px; }
.chart-card svg { height: 135px; }
.context-menu { min-width: 165px; padding: 4px; }
.context-menu button { min-height: 26px; padding-inline: 7px; font-size: 9px; }
.formula-tools { gap: 5px; margin-top: 7px; }
.formula-audit-actions { gap: 4px; }
.formula-audit-actions .action-button { min-height: 22px; padding-inline: 4px; font-size: 9px; }
.two-controls, .button-pair { gap: 5px; }
.format-row { gap: 3px; margin-top: 7px; }
.format-button { height: 23px; min-width: 21px; font-size: 10px; }
.color-select-wrap { width: 49px; height: 23px; font-size: 11px; }
.color-select-wrap select { width: 37px; height: 20px; font-size: 8px; }
.format-select-label { min-width: 88px; }
.control-divider { height: 16px; margin-inline: 2px; }
.conditional-row { gap: 5px; margin-top: 8px; }
.data-controls, .data-actions, .sheet-actions { margin-top: 6px; }
.data-label { margin-top: 7px; }
.data-input { margin-top: 5px; }
.note-input { height: 48px; min-height: 48px; padding: 5px; }
.print-margins-grid { gap: 5px; }
.print-margins-grid label { gap: 3px; }
.spell-check-setting { gap: 5px; margin-bottom: 8px; font-size: 9px; }
.workbook-share-list { gap: 5px; }
.workbook-share-row { gap: 8px; padding: 6px; border-radius: 6px; font-size: 10px; }
.workbook-share-row small { font-size: 9px; }
.compatibility-notice { margin-top: 7px; padding: 7px 9px; font-size: 9px; line-height: 1.4; }
.compatibility-notice p { margin: 4px 0; }
.compatibility-notice ul { margin-top: 4px; padding-left: 15px; }
.compatibility-notice li + li { margin-top: 3px; }
.chart-heading { font-size: 10px; }
.chart-heading-actions { gap: 3px; }
.chart-remove { padding: 2px 5px; font-size: 8px; }
.chart-edit-form label { gap: 3px; }
.chart-data-label-toggle { gap: 5px !important; }
.chart-edit-actions { gap: 4px; }
.grid-cell .sparkline { top: 2px; width: 32px; height: 17px; }
.grid-cell.has-note::before { border-top-width: 6px; border-left-width: 6px; }
.status-aggregate-settings fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-aggregate-settings label { gap: 4px; font-size: 9px; }
.workbook-statistics-dialog,
.workbook-sharing-dialog { font-size: 10px; }
.workbook-statistics-dialog .action-button,
.workbook-sharing-dialog .action-button { min-height: 26px; padding: 3px 7px; font-size: 10px; }
.workbook-statistics-dialog .sidebar-input,
.workbook-sharing-dialog .sidebar-input,
.workbook-sharing-dialog select { min-height: 24px; height: 24px; padding: 2px 6px; font-size: 10px; }
.workbook-sharing-dialog .workbook-share-list { margin-top: 5px; }
@media (max-width: 800px) {
  .ribbon-quick-row { height: 34px; min-height: 34px; flex-basis: 34px; gap: 3px; padding-inline: 5px; }
  .workbook-title { width: 112px; height: 23px; font-size: 10px; }
  .workbook-nav { height: 25px; }
  .nav-button { min-width: 22px; height: 21px; padding-inline: 4px; }
  .nav-button.nav-labeled { min-width: 33px; }
  .ribbon-tabs { max-width: min(250px, 58vw); height: 25px; }
  .ribbon-tab { min-width: 44px; padding-inline: 5px; font-size: 8px; }
  .control-sidebar { padding: 0 5px 3px; }
  .ribbon-panel { min-height: 62px; max-height: min(128px, 20vh); gap: 0; }
  body .control-sidebar .control-section,
  .review-section { width: 225px; min-width: 225px; height: min(120px, calc(20vh - 8px)); max-height: min(120px, calc(20vh - 8px)); flex-basis: 225px; padding: 5px; }
  .sheet-tabs-row { height: 28px; padding-inline: 5px; }
  .sheet-tab { height: 23px; padding-inline: 8px; }
  .statusbar { height: 18px; padding-inline: 6px; }
  .chart-dock { height: 148px; }
  .note-input { height: 44px; min-height: 44px; }
  .workbook-statistics-dialog,
  .workbook-sharing-dialog { padding: 14px; }
}

/* Standalone Excel landing page and return-home navigation. */
html:not(.workbook-route),
html:not(.workbook-route) body { height: auto; min-height: 100%; overflow: auto; }
html:not(.workbook-route) .app-shell { display: none; }
html.workbook-route #home-screen { display: none; }
.excel-home { min-height: 100vh; color: #20352b; background: #fff; font-family: Arial, sans-serif; }
.home-header { height: 58px; display: flex; align-items: center; gap: 34px; padding: 0 clamp(20px, 4.5vw, 76px); border-bottom: 1px solid #e8eee9; background: #fff; }
.home-brand { display: inline-flex; align-items: center; gap: 9px; color: #1e3528; text-decoration: none; font-size: 17px; font-weight: 700; white-space: nowrap; }
.home-brand img { width: 30px; height: 30px; object-fit: contain; }
.home-brand small { margin-left: -4px; color: #718278; font-size: 10px; font-weight: 500; }
.home-top-nav { height: 100%; display: flex; align-items: stretch; }
.home-top-nav span { display: flex; align-items: center; padding: 0 12px; border-bottom: 2px solid #087f3f; color: #205c38; font-size: 12px; font-weight: 700; }
.home-header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.home-cloud-status { display: flex; align-items: center; gap: 6px; color: #64766b; font-size: 10px; }
.home-cloud-status i { width: 7px; height: 7px; border-radius: 50%; background: #38a863; }
.home-hero { position: relative; min-height: 235px; display: flex; align-items: flex-start; overflow: hidden; padding: 39px clamp(24px, 4.5vw, 76px) 78px; background: linear-gradient(108deg, #f3f7f3 0%, #f6f8f4 54%, #e5f0e6 100%); }
.home-hero-copy { position: relative; z-index: 1; max-width: 640px; }
.home-eyebrow { margin: 0 0 8px; color: #5f8069; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.home-hero h1 { margin: 0; color: #235c3a; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -.9px; }
.home-hero-copy > p:last-child { margin: 9px 0 0; color: #586e60; font-size: 13px; }
.home-hero-art { position: absolute; top: 9px; right: clamp(28px, 7vw, 128px); width: 245px; height: 190px; transform: rotate(-7deg); opacity: .72; }
.home-art-sheet { position: absolute; top: 23px; right: 8px; width: 166px; height: 128px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 22px repeat(4, 1fr); overflow: hidden; border: 6px solid #fff; border-radius: 12px; background: #fff; box-shadow: 0 12px 24px #1c583121; }
.home-art-sheet::before { content: ""; grid-column: 1 / -1; background: linear-gradient(90deg,#76cc75,#0b8745); }
.home-art-sheet i { border: 1px solid #d4e7d8; background: #fff; }
.home-art-sheet i:nth-of-type(3n) { background: #e5f4e5; }
.home-art-mark { position: absolute; top: 49px; left: 12px; color: #08853f; font-size: 116px; font-weight: 800; line-height: 1; text-shadow: 2px 4px 0 #00552c, 5px 9px 12px #143c2250; }
.home-create-card { position: absolute; z-index: 2; bottom: -1px; left: clamp(20px, 4.5vw, 76px); display: flex; gap: 8px; padding: 9px; border: 1px solid #e5ebe6; border-radius: 13px; background: #fff; box-shadow: 0 5px 16px #183b2519; }
.home-action-status { position: absolute; top: calc(100% + 4px); left: 8px; color: #45664e; font-size: 9px; }
.home-action-status.is-error { color: #a2362b; }
.home-create-card button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 6px; font: 600 12px Arial, sans-serif; cursor: pointer; }
.home-primary-action { color: #fff; background: #39784a; }
.home-primary-action:hover { background: #28693b; }
.home-secondary-action { border-color: #d3dbd5 !important; color: #263d30; background: #fff; }
.home-secondary-action:hover { background: #f2f7f3; }
.home-action-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 15px; line-height: 1; }
.home-secondary-action > span { font-size: 18px; font-weight: 400; line-height: 1; }
.home-section { padding: 28px clamp(20px, 4.5vw, 76px) 0; }
.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.home-section-heading .home-eyebrow { margin-bottom: 5px; }
.home-section h2 { margin: 0; color: #243b2d; font-size: 18px; font-weight: 650; letter-spacing: -.25px; }
.home-template-search { width: min(250px, 35vw); height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid #e1e8e2; border-radius: 6px; color: #718278; background: #f7f9f7; }
.home-template-search > span { font-size: 18px; }
.home-template-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: #263d30; background: transparent; font: 11px Arial, sans-serif; }
.home-template-categories { display: flex; align-items: center; gap: 7px; overflow-x: auto; margin: 14px 0 13px; padding: 1px 0 5px; scrollbar-width: thin; }
.home-template-categories button { flex: 0 0 auto; min-height: 28px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; color: #51645a; background: transparent; font: 600 10px Arial, sans-serif; cursor: pointer; }
.home-template-categories button:hover { background: #f3f7f4; }
.home-template-categories button[aria-selected="true"] { border-color: #4f9261; color: #255e39; background: #e9f4eb; }
.home-template-grid { display: grid; grid-auto-columns: minmax(170px, 1fr); grid-auto-flow: column; gap: 14px; overflow-x: auto; padding: 1px 1px 9px; scrollbar-width: thin; }
.template-card { min-width: 0; display: flex; flex-direction: column; padding: 0; border: 0; text-align: left; color: inherit; background: transparent; cursor: pointer; }
.template-card[hidden] { display: none; }
.template-preview { position: relative; height: clamp(106px, 11vw, 145px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #dce4dd; border-radius: 8px; background: #fff; box-shadow: 0 1px 2px #1c3c2410; transition: transform .15s, box-shadow .15s; }
.template-card:hover .template-preview { transform: translateY(-2px); box-shadow: 0 7px 18px #1c3c2420; }
.template-card:focus-visible { outline: 2px solid #217346; outline-offset: 3px; border-radius: 8px; }
.template-preview b { min-height: 21px; flex: 0 0 21px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px; color: #fff; background: #34754a; font-size: 7px; letter-spacing: .4px; }
.template-preview b small { opacity: .82; font-size: 6px; font-weight: 600; letter-spacing: .35px; }
.preview-mini-table { display: grid; flex: 1; grid-auto-rows: minmax(13px, 1fr); align-content: stretch; overflow: hidden; color: #42564a; font-size: clamp(5px, .52vw, 7px); }
.preview-mini-table > i { min-width: 0; overflow: hidden; display: flex; align-items: center; padding: 0 4px; border-right: 1px solid #e4ebe5; border-bottom: 1px solid #e4ebe5; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.preview-mini-table > i:nth-child(-n+3) { color: #50695a; background: #edf4ee; font-size: 5px; font-weight: 750; letter-spacing: .25px; }
.preview-budget .preview-mini-table { grid-template-columns: 1.4fr .8fr .8fr; }
.preview-budget .preview-mini-table > i:nth-child(-n+3) { background: #dcefe0; }
.preview-budget b { background: #426f4c; }
.preview-budget-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 7px 4px; }
.preview-budget-summary > i { display: flex; flex-direction: column; gap: 2px; padding: 4px 5px; border: 1px solid #e4ece5; border-radius: 4px; color: #748178; font-size: 5px; font-style: normal; letter-spacing: .3px; }
.preview-budget-summary strong { color: #315a3b; font-size: 8px; letter-spacing: 0; }
.preview-schedule b { background: #29466e; }
.preview-schedule .preview-mini-table { grid-template-columns: .7fr repeat(5, 1fr); }
.preview-schedule .preview-mini-table > i:nth-child(-n+6) { background: #e7edf7; }
.preview-schedule .preview-mini-table > i:nth-child(6n + 1) { color: #52647c; background: #f0f3f7; font-weight: 650; }
.preview-calendar { background: #fff; }
.preview-calendar b { background: #426f4c; }
.preview-mini-calendar { display: grid; flex: 1; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 13px repeat(5, minmax(0, 1fr)); color: #53675a; font-size: 6px; }
.preview-mini-calendar > i { display: flex; align-items: flex-start; justify-content: flex-end; padding: 2px 3px; border-right: 1px solid #e7ece7; border-bottom: 1px solid #e7ece7; font-style: normal; }
.preview-mini-calendar > i:nth-child(-n+7) { justify-content: center; padding-top: 3px; color: #667b6b; background: #f3f6f3; font-size: 5px; font-weight: 700; }
.preview-mini-calendar > i.is-today { color: #255d37; background: #e2f1dc; font-weight: 750; }
.preview-invoice { margin-inline: 8%; padding-bottom: 4px; }
.preview-invoice b { background: #71835e; }
.preview-invoice-meta { display: flex; justify-content: space-between; padding: 6px 8px 4px; }
.preview-invoice-meta > i { display: flex; flex-direction: column; gap: 2px; color: #849087; font-size: 5px; font-style: normal; letter-spacing: .35px; }
.preview-invoice-meta strong { color: #45564b; font-size: 7px; font-weight: 650; letter-spacing: 0; }
.preview-invoice .preview-mini-table { grid-template-columns: 1.6fr .4fr .7fr .8fr; }
.preview-invoice .preview-mini-table > i:nth-child(-n+4) { background: #edf2ec; }
.preview-invoice .preview-mini-table > i:nth-child(n+5) { justify-content: flex-end; }
.preview-invoice .preview-mini-table > i:nth-child(5) { justify-content: flex-start; }
.preview-total { display: flex; justify-content: space-between; padding: 4px 7px 0; color: #58705c; font-size: 6px; letter-spacing: .25px; }
.preview-total span { color: #2c603a; font-size: 8px; }
.preview-list b { background: #526476; }
.preview-list .preview-mini-table { grid-template-columns: 1.6fr .65fr 1fr; }
.preview-list .preview-mini-table > i:nth-child(-n+3) { background: #e7ebf0; }
.preview-list .preview-mini-table > i.preview-pill { justify-content: center; margin: 2px 3px; padding: 0 2px; border: 0; border-radius: 8px; font-size: 5px; }
.preview-pill.done { color: #24623a; background: #dff0e2; }
.preview-pill.progress { color: #775b09; background: #fff1c2; }
.preview-pill.next { color: #5f6c79; background: #edf0f3; }
.preview-progress { height: 15px; display: flex; align-items: center; gap: 5px; padding: 0 7px; color: #748177; font-size: 6px; }
.preview-progress i { width: 28%; height: 4px; border-radius: 4px; background: linear-gradient(90deg,#5a9b66 38%,#e6ece7 38%); }
.preview-household b { background: #82724b; }
.preview-household .preview-mini-table { grid-template-columns: 1.2fr .65fr .7fr; }
.preview-household .preview-mini-table > i:nth-child(-n+3) { background: #f2eddf; }
.preview-chore-note { padding: 4px 7px; color: #617659; background: #f6f8f3; font-size: 6px; }
.template-card-title { margin-top: 7px; color: #263d30; font-size: 11px; font-weight: 650; }
.template-card-caption { margin-top: 3px; color: #718078; font-size: 9px; }
.home-empty-state { padding: 22px 0; color: #728177; font-size: 11px; }
.home-recent { padding-top: 24px; }
.home-recent-heading { align-items: center; }
.home-library-status { color: #758278; font-size: 10px; }
.home-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px; margin-top: 12px; }
.recent-workbook-card { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid #e4eae5; border-radius: 7px; color: inherit; background: #fff; text-align: left; text-decoration: none; }
.recent-workbook-card:hover { border-color: #b8d4be; background: #f8fbf8; }
.recent-workbook-icon { width: 30px; height: 34px; flex: 0 0 30px; display: grid; place-items: center; border-radius: 4px; color: #fff; background: linear-gradient(135deg,#66b96a,#087f3f); font-size: 15px; font-weight: 800; }
.recent-workbook-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.recent-workbook-copy strong { overflow: hidden; color: #2a4032; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.recent-workbook-copy small { color: #7a887f; font-size: 9px; }
.home-empty-library { grid-column: 1/-1; padding: 20px; border: 1px dashed #d5e1d7; border-radius: 8px; color: #718078; text-align: center; font-size: 11px; }
.home-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 25px; padding: 12px clamp(20px, 4.5vw, 76px); border-top: 1px solid #edf1ee; color: #829087; font-size: 9px; }
.home-nav-button { width: 23px; height: 23px; flex: 0 0 23px; display: inline-grid; place-items: center; border: 1px solid #ffffff55; border-radius: 5px; color: #fff; background: #ffffff13; text-decoration: none; }
.home-nav-button:hover, .home-nav-button:focus-visible { color: #173e25; background: #b7f34b; outline: none; }
@media (min-width: 1500px) { .home-template-grid { grid-auto-columns: minmax(200px, 1fr); } }
@media (max-width: 700px) {
  .home-header { height: 51px; gap: 16px; padding-inline: 15px; }
  .home-brand { gap: 6px; font-size: 15px; }
  .home-brand img { width: 26px; height: 26px; }
  .home-brand small { font-size: 9px; }
  .home-hero { min-height: 224px; padding: 30px 18px 75px; }
  .home-hero h1 { max-width: 65%; font-size: 27px; }
  .home-hero-copy > p:last-child { max-width: 64%; font-size: 11px; line-height: 1.5; }
  .home-hero-art { top: 44px; right: -34px; transform: scale(.78) rotate(-7deg); transform-origin: top right; opacity: .5; }
  .home-create-card { left: 13px; gap: 5px; padding: 6px; }
  .home-create-card button { min-height: 34px; gap: 5px; padding-inline: 9px; font-size: 10px; }
  .home-section { padding: 22px 15px 0; }
  .home-section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .home-section h2 { font-size: 16px; }
  .home-template-search { width: 100%; }
  .home-template-categories { margin-top: 10px; }
  .home-template-grid { grid-auto-columns: minmax(155px, 45vw); gap: 10px; }
  .template-preview { height: 110px; }
  .home-recent { padding-top: 20px; }
  .home-recent-heading { flex-direction: row; align-items: center; }
  .home-recent-list { grid-template-columns: 1fr; }
  .home-footer { flex-direction: column; gap: 4px; margin-top: 20px; padding-inline: 15px; }
}

/* Excel's standalone interface follows the emerald, lime, and teal favicon palette. */
:root {
  --deep: #073b2b;
  --green: #008044;
  --leaf: #006b4b;
  --soft: #dff8e9;
  --pale: #effaf3;
  --line: #d7e8dc;
  --excel-block-border: #00854a;
  --brand-forest: #003d2b;
  --brand-green: #008044;
  --brand-lime: #aaff35;
  --brand-teal: #00d7b0;
  --accent: #008044;
  --accent-strong: #003d2b;
  --theme-surface-soft: #effaf3;
  --panel-soft: #effaf3;
}

html, body { accent-color: var(--brand-green); }
body .sheet-topline {
  border-bottom-color: var(--brand-teal);
  background: linear-gradient(105deg, #003d2b 0%, #006a3a 56%, #008044 100%);
}
body .save-dot { background: var(--brand-lime); box-shadow: 0 0 0 3px #aaff3535; }
body .nav-button:hover,
body .nav-button:focus-visible,
body .home-nav-button:hover,
body .home-nav-button:focus-visible {
  border-color: var(--brand-lime);
  background: var(--brand-lime);
  color: var(--brand-forest);
}
body .grid-cell.col-head,
body .grid-cell.row-head,
body .grid-cell.corner,
body .grid-cell.row-head.frozen-row,
body .grid-cell.col-head.frozen-col {
  color: #075b3b;
  background: #e8f8ed;
}
body .grid-cell.selected,
body .grid-cell.range-selected:not(.selected) {
  box-shadow: inset 0 0 0 2px var(--brand-green);
}
body .fill-handle,
body .grid-cell.selected::after,
body .column-resize-handle:hover,
body .row-resize-handle:hover,
body .grid-cell.has-note::before { background-color: var(--brand-green); }
body .sheet-tabs-row,
body .chart-dock,
body .statusbar {
  border-color: #cde8d7;
  color: #075b3b;
  background: linear-gradient(90deg, #effaf3, #f3fbf8);
}
body .sheet-tab.active {
  color: #005c36;
  box-shadow: 0 -3px 0 var(--brand-lime) inset;
}
body .control-sidebar {
  border-left-color: #b7e8d9;
  background: linear-gradient(160deg, #effaf3, #e7f8f2);
}
body .control-section h2::before { background: linear-gradient(180deg, var(--brand-lime), var(--brand-teal)); }
body .name-box:focus,
body .formula-field:focus-within,
body .sidebar-input:focus,
body .control-section select:focus,
body .home-template-search:focus-within {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 3px #00d7b026;
}
body .action-button:hover,
body .format-button:hover,
body .format-button.active,
body .chart-remove:hover,
body .context-menu button:hover,
body .context-menu button:focus {
  border-color: #92d8ad;
  color: #004b32;
  background: #e2faed;
}
.excel-home { --home-forest: #003d2b; --home-emerald: #008044; --home-lime: #aaff35; --home-teal: #00c9a6; }
.home-header { border-bottom-color: #d5eee2; }
.home-brand { color: var(--home-forest); }
.home-top-nav span { border-bottom-color: var(--home-lime); color: #006541; }
.home-cloud-status i { background: linear-gradient(135deg, var(--home-lime), var(--home-teal)); }
.home-hero {
  background:
    radial-gradient(ellipse at 82% 30%, #00c9a61c, transparent 34%),
    linear-gradient(108deg, #f1faf4 0%, #f4faf6 54%, #e4f7ed 100%);
}
.home-eyebrow { color: #177451; }
.home-hero h1 { color: #064b32; }
.home-art-sheet::before { background: linear-gradient(90deg, var(--home-lime), #45d75a 42%, var(--home-emerald)); }
.home-art-sheet i:nth-of-type(3n) { background: #e3f7e9; }
.home-art-mark { color: #008044; text-shadow: 2px 4px 0 #003d2b, 5px 9px 12px #143c2250; }
.home-create-card { border-color: #d7eee0; }
.home-primary-action { background: linear-gradient(110deg, #006d3a, #008044); }
.home-primary-action:hover { background: linear-gradient(110deg, #005a35, #007c52); }
.home-primary-action:focus-visible,
.home-template-categories button:focus-visible,
.template-card:focus-visible { outline-color: var(--home-teal); }
.home-template-categories button[aria-selected="true"] {
  border-color: #76d89a;
  color: #005c38;
  background: #e3f9eb;
}
.template-preview b { background: #006b3d; }
.preview-budget b,
.preview-calendar b { background: #007746; }
.home-recent-list .recent-workbook-icon { background: linear-gradient(135deg, #8be92f, #00a85a 52%, #00b99e); }
.recent-workbook-card:hover { border-color: #92d8ad; background: #f2fbf5; }
.home-footer { border-top-color: #ddf0e4; }

/* Keep workbook commands in one horizontal strip with no vertically scrolling cards. */
body .control-sidebar {
  width: 100%;
  max-width: none;
  overflow: hidden;
  padding: 0 8px 5px;
}
body .control-sidebar .ribbon-panel {
  display: flex;
  width: 100%;
  height: 94px;
  min-height: 94px;
  max-height: 94px;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  scroll-snap-type: none;
  scrollbar-width: thin;
}
body .control-sidebar .control-section,
body .control-sidebar .control-section.review-section {
  position: relative;
  display: flex;
  width: max-content;
  min-width: max-content;
  max-width: none;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  flex-flow: row nowrap;
  align-items: center;
  gap: 8px;
  overflow: visible;
  margin: 0;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
  scroll-snap-align: none;
  scrollbar-width: none;
}
body .control-sidebar .control-section h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
body .control-sidebar .control-section > .control-label,
body .control-sidebar .control-section .cell-address-row,
body .control-sidebar .control-section .formula-field,
body .control-sidebar .control-section .two-controls,
body .control-sidebar .control-section .button-pair,
body .control-sidebar .control-section .format-row,
body .control-sidebar .control-section .conditional-row,
body .control-sidebar .control-section .formula-tools,
body .control-sidebar .control-section .print-margins-grid,
body .control-sidebar .control-section .spell-check-setting {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
}
body .control-sidebar .control-section > .control-label,
body .control-sidebar .control-section .cell-address-row,
body .control-sidebar .control-section .formula-tools > .control-label {
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  white-space: nowrap;
}
body .control-sidebar .control-section .cell-address-row { width: 86px; }
body .control-sidebar .control-section .formula-field { width: 228px; }
body .control-sidebar .control-section .formula-tools { flex-direction: row; }
body .control-sidebar .control-section .formula-tools > .control-label { width: 148px; }
body .control-sidebar .control-section .formula-audit-actions { display: flex; }
body .control-sidebar .control-section .formula-audit-output { max-width: 190px; }
body .control-sidebar .control-section .two-controls { width: auto; grid-template-columns: none; }
body .control-sidebar .control-section .button-pair { width: auto; grid-template-columns: none; }
body .control-sidebar .control-section .button-pair > *,
body .control-sidebar .control-section > .full-button,
body .control-sidebar .control-section .formula-tools > .full-button {
  width: auto;
  min-width: max-content;
  flex: 0 0 auto;
  margin: 0;
}
body .control-sidebar .control-section .conditional-row > .control-label,
body .control-sidebar .control-section .format-select-label,
body .control-sidebar .control-section .data-label {
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  white-space: nowrap;
}
body .control-sidebar .control-section .conditional-row > .control-label { width: 142px; }
body .control-sidebar .control-section .data-label { width: 130px; }
body .control-sidebar .control-section .print-margins-grid { display: flex; }
body .control-sidebar .control-section .print-margins-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body .control-sidebar .control-section .note-input { width: 150px; height: 30px; min-height: 30px; }
body .control-sidebar .control-section .spell-check-setting { white-space: nowrap; }
@media (max-width: 800px) {
  body .control-sidebar { padding-inline: 5px; }
  body .control-sidebar .ribbon-panel { height: 88px; min-height: 88px; max-height: 88px; }
  body .control-sidebar .control-section { gap: 6px; }
  body .control-sidebar .control-section .formula-field { width: 190px; }
}

/* Keep workbook geometry fixed while a tab is hidden or the browser restores it. */
html.workbook-route .app-shell { width: 100vw; height: 100vh; }
html.workbook-route .sheet-topline-main { flex: 0 0 auto; gap: 5px; }
html.workbook-route .workbook-title { width: 128px; min-width: 128px; height: 25px; font-size: 11px; }
html.workbook-route .save-indicator { display: flex; font-size: 9px; gap: 5px; }
html.workbook-route .ribbon-quick-row { height: 36px; min-height: 36px; flex-basis: 36px; flex-wrap: nowrap; gap: 4px; padding: 2px 8px; }
html.workbook-route .workbook-nav { height: 27px; flex: 0 0 auto; gap: 3px; }
html.workbook-route .nav-button { min-width: 24px; height: 23px; padding: 2px 5px; font-size: 9px; }
html.workbook-route .nav-button.nav-labeled { min-width: 36px; }
html.workbook-route .ribbon-tabs { max-width: 461px; height: 28px; flex: 0 0 auto; }
html.workbook-route .ribbon-tab { min-width: 50px; padding: 0 7px; font-size: 9px; }
html.workbook-route .control-sidebar { width: 100%; max-width: none; padding: 0 8px 5px; }
html.workbook-route .control-sidebar .ribbon-panel { width: 100%; height: 94px; min-height: 94px; max-height: 94px; }
html.workbook-route .control-sidebar .control-section,
html.workbook-route .control-sidebar .control-section.review-section {
  width: max-content;
  min-width: max-content;
  max-width: none;
  height: auto;
  min-height: 0;
  max-height: none;
  flex: 0 0 auto;
  overflow: visible;
}
html.workbook-route .control-sidebar .control-section .formula-field { width: 228px; }
html.workbook-route .page-layout-section { width: max-content; min-width: max-content; }
html.workbook-route .page-layout-ribbon-actions { display: flex; align-items: stretch; gap: 4px; height: 100%; }
html.workbook-route .page-layout-command { display: flex; min-width: 75px; height: 58px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 8px; border: 1px solid transparent; border-radius: 5px; color: var(--deep); background: transparent; font: 11px Arial, sans-serif; white-space: nowrap; cursor: pointer; }
html.workbook-route .page-layout-command > span:first-child { color: var(--green); font-size: 18px; line-height: 20px; }
html.workbook-route .page-layout-command:hover,
html.workbook-route .page-layout-command:focus-visible { border-color: var(--line); background: #f2f8f3; outline: none; }
html.workbook-route .view-ribbon-section { display: flex; align-items: stretch; gap: 8px; width: max-content; min-width: max-content; }
html.workbook-route .view-ribbon-group { display: flex; min-width: 95px; flex-direction: column; justify-content: center; gap: 3px; padding: 0 9px; border-right: 1px solid var(--line); }
html.workbook-route .view-ribbon-group h2 { margin: auto 0 2px; color: var(--muted); font-size: 9px; font-weight: 500; text-align: center; }
html.workbook-route .view-ribbon-group .page-layout-command { min-width: 74px; height: 43px; }
html.workbook-route .view-ribbon-group .page-layout-command.active { border-color: var(--line); background: #eef7f0; }
html.workbook-route .view-ribbon-toggle { display: flex; align-items: center; gap: 5px; min-height: 20px; color: var(--deep); font-size: 11px; white-space: nowrap; }
html.workbook-route .view-ribbon-toggle input { margin: 0; accent-color: var(--green); }
html.workbook-route .view-focus-control { position: relative; display: flex; align-items: center; gap: 5px; }
html.workbook-route .focus-cell-color-trigger { display: inline-flex; width: 29px; height: 20px; align-items: center; justify-content: center; gap: 2px; padding: 2px 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--deep); cursor: pointer; }
html.workbook-route .focus-cell-color-trigger:hover,
html.workbook-route .focus-cell-color-trigger:focus-visible { border-color: var(--line); background: #f2f8f3; outline: none; }
html.workbook-route #view-focus-cell-color-chip { width: 13px; height: 13px; border: 1px solid #6f7772; border-radius: 2px; }
html.workbook-route .focus-cell-palette { position: fixed; z-index: 10000; width: 282px; max-height: min(390px, calc(100vh - 220px)); overflow: auto; padding: 10px; border: 1px solid #d3d7d3; border-radius: 7px; background: #fff; box-shadow: 0 5px 18px #0002; }
html.workbook-route .focus-cell-palette[hidden] { display: none; }
html.workbook-route .focus-cell-palette-section + .focus-cell-palette-section { margin-top: 10px; padding-top: 8px; border-top: 1px solid #e4e6e4; }
html.workbook-route .focus-cell-palette-section h3 { margin: 0 0 7px; color: #555; font: 11px Arial, sans-serif; }
html.workbook-route .focus-cell-swatch-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
html.workbook-route .focus-cell-swatch { width: 21px; height: 21px; justify-self: center; border: 1px solid #c7cbc7; border-radius: 50%; cursor: pointer; }
html.workbook-route .focus-cell-swatch:hover,
html.workbook-route .focus-cell-swatch:focus-visible,
html.workbook-route .focus-cell-swatch[aria-checked="true"] { outline: 2px solid #217346; outline-offset: 1px; }
html.workbook-route .view-freeze-actions { display: flex; align-items: stretch; gap: 3px; }
html.workbook-route .view-freeze-actions .page-layout-command { min-width: 70px; padding-inline: 5px; font-size: 10px; }
html.workbook-route #grid.hide-gridlines .grid-cell { border-color: transparent !important; }
html.workbook-route #grid.hide-headings .col-head,
html.workbook-route #grid.hide-headings .row-head,
html.workbook-route #grid.hide-headings .corner { visibility: hidden; }
html.workbook-route.hide-formula-bar body .formula-bar { display: none; }
html.workbook-route #grid .grid-cell.focus-cell-highlight { background-image: linear-gradient(var(--focus-cell-tint), var(--focus-cell-tint)) !important; }
html.workbook-route #grid .grid-cell.col-head.focus-cell-highlight,
html.workbook-route #grid .grid-cell.row-head.focus-cell-highlight { background-color: var(--focus-cell-tint) !important; }
.page-setup-dialog { width: min(720px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 22px; color: var(--deep); background: #fff !important; opacity: 1 !important; box-shadow: 0 20px 60px #00150b45; }
.page-setup-dialog::backdrop { background: #07150c80; }
.page-setup-dialog h2 { margin: 0 0 16px; font-size: 18px; }
.page-setup-dialog form { float: right; }
.page-setup-dialog .dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--green); font-size: 20px; cursor: pointer; }
.page-setup-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; clear: both; }
.page-setup-fields > .control-label { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.page-setup-fields .sidebar-input,
.page-setup-fields select { box-sizing: border-box; width: 100%; min-width: 0; min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--deep); background: var(--white); }
.page-setup-fields .print-margins-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.page-setup-fields .print-margins-grid label { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.page-setup-dialog #page-setup-print { margin-top: 16px; }
@media (max-width: 560px) { .page-setup-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 360px) { .page-setup-fields { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  html.workbook-route .ribbon-quick-row { height: 36px; min-height: 36px; flex-basis: 36px; padding: 2px 8px; }
  html.workbook-route .workbook-title { width: 128px; min-width: 128px; height: 25px; font-size: 11px; }
  html.workbook-route .save-indicator { display: flex; }
  html.workbook-route .workbook-nav { height: 27px; }
  html.workbook-route .ribbon-tabs { max-width: 461px; height: 28px; }
  html.workbook-route .ribbon-tab { min-width: 50px; padding: 0 7px; font-size: 9px; }
  html.workbook-route .control-sidebar { padding: 0 8px 5px; }
  html.workbook-route .control-sidebar .ribbon-panel { height: 94px; min-height: 94px; max-height: 94px; }
  html.workbook-route .control-sidebar .control-section,
  html.workbook-route .control-sidebar .control-section.review-section { width: max-content; min-width: max-content; height: auto; max-height: none; flex-basis: auto; }
  html.workbook-route .control-sidebar .control-section .formula-field { width: 228px; }
}

/* TronXVI neutral direction. Keep the spreadsheet surface white as document content while matching the application shell. */
:root {
  --tronxvi-black: var(--theme-page-bg, #010304);
  --tronxvi-black-soft: var(--theme-surface-strong, #070a0c);
  --tronxvi-rail: var(--theme-surface, #030506);
  --tronxvi-white: var(--text, #f2f5f7);
  --tronxvi-secondary: var(--muted, #aab2ba);
  --tronxvi-line: var(--line, rgba(242, 245, 247, 0.16));
}

body,
body .app-shell,
body .sheet-workspace {
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .sheet-topline {
  border-bottom-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .workbook-title,
body .save-indicator,
body .nav-button {
  color: var(--tronxvi-white);
}

body .workbook-title:hover,
body .workbook-title:focus,
body .nav-group {
  border-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .save-dot {
  background: var(--theme-lock-text, var(--text));
  box-shadow: 0 0 0 3px rgba(170, 178, 186, 0.22);
}

body .nav-button {
  border-color: transparent;
  background: transparent;
}

body .nav-button:hover,
body .nav-button:focus-visible {
  border-color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  color: var(--tronxvi-black);
}

body .grid-viewport {
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  scrollbar-color: var(--tronxvi-secondary) var(--tronxvi-black-soft);
}

/* Spreadsheet cells remain white document content. */
body .grid-cell:not(.col-head):not(.row-head):not(.corner),
body .grid-cell.frozen-row,
body .grid-cell.frozen-col,
body .cell-editor {
  color: var(--theme-lock-text, var(--text));
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .grid-cell.col-head,
body .grid-cell.row-head,
body .grid-cell.corner,
body .grid-cell.row-head.frozen-row,
body .grid-cell.col-head.frozen-col {
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .grid-cell,
body .grid-cell.col-head,
body .grid-cell.row-head,
body .grid-cell.corner {
  border-color: var(--excel-grid-line);
}

body .grid-cell.selected {
  box-shadow: inset 0 0 0 2px var(--excel-block-border);
}

body .grid-cell.audit-reference {
  outline-color: var(--tronxvi-secondary);
}

body .grid-cell.range-selected:not(.selected),
body .fill-handle,
body .grid-cell.selected::after,
body .column-resize-handle:hover,
body .row-resize-handle:hover,
body .grid-cell.has-note::before {
  background-color: var(--theme-lock-text, var(--text));
}

body .sheet-tabs-row,
body .chart-dock,
body .statusbar {
  border-color: var(--tronxvi-line);
  color: var(--tronxvi-secondary);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .sheet-tab,
body .add-sheet,
body .zoom-control,
body .zoom-control span {
  color: var(--tronxvi-white);
}

body .sheet-tab:hover,
body .add-sheet:hover,
body .zoom-control button:hover {
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .sheet-tab.active {
  color: var(--tronxvi-black);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  box-shadow: 0 -2px 0 var(--tronxvi-white) inset;
}

body .zoom-control button {
  border-color: var(--tronxvi-line);
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .control-sidebar {
  border-left-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  scrollbar-color: var(--tronxvi-secondary) var(--tronxvi-rail);
}

body .sidebar-heading {
  border-bottom-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .eyebrow,
body .sidebar-subtitle,
body .sidebar-help,
body .control-label,
body .cell-address-row label,
body .formula-audit-output {
  color: var(--tronxvi-secondary);
}

body .sidebar-heading h1,
body .control-section h2,
body .format-button,
body .color-select-wrap,
body .format-select-label,
body .formula-field .fx-mark {
  color: var(--tronxvi-white);
}

body .control-section {
  border-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
}

body .control-section h2 {
  border-bottom-color: var(--tronxvi-line);
}

body .control-section h2::before {
  background: var(--theme-lock-ui-border);
}

body .name-box,
body .sidebar-input,
body .formula-field,
body .control-section select:not(#text-color):not(#fill-color),
body .color-select-wrap select,
body .formula-input {
  border-color: var(--tronxvi-line);
  color: var(--tronxvi-white);
  background-color: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .sidebar-input::placeholder {
  color: var(--tronxvi-secondary);
}

body .name-box:focus,
body .formula-field:focus-within,
body .sidebar-input:focus,
body .control-section select:focus {
  border-color: var(--tronxvi-white);
  box-shadow: 0 0 0 3px rgba(242, 245, 247, 0.16);
}

body .format-button:hover,
body .format-button.active,
body .color-select-wrap:hover,
body .action-button:hover,
body .chart-remove:hover,
body .context-menu button:hover,
body .context-menu button:focus {
  border-color: var(--tronxvi-white);
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .control-divider,
body .sidebar-help {
  border-color: var(--tronxvi-line);
}

body .action-button,
body .chart-remove,
body .context-menu,
body .context-menu button,
body kbd {
  border-color: var(--tronxvi-line);
  color: var(--tronxvi-white);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body #create-table,
body #apply-validation,
body #create-chart,
body #goal-seek,
body #export-xlsx-button,
body .export-button {
  border-color: var(--tronxvi-white);
  color: var(--tronxvi-black);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body #create-table:hover,
body #apply-validation:hover,
body #create-chart:hover,
body #goal-seek:hover,
body #export-xlsx-button:hover,
body .export-button:hover {
  border-color: #ffffff;
  color: var(--tronxvi-black);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .chart-card {
  border-color: var(--tronxvi-line);
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
  color: var(--theme-lock-text, var(--text));
}

body .chart-heading {
  color: var(--theme-lock-text, var(--text));
}

body .chart-remove {
  color: var(--theme-lock-text, var(--text));
  background: var(--appearance-page-bg, var(--theme-page-bg, var(--bg)));
}

body .sidebar-help {
  border-top-color: var(--tronxvi-line);
}

/* Final Infinity contract: Appearance owns surfaces; Accent owns text, borders, and dividers. Cell fills and imported workbook content remain user data. */
html[data-appearance][data-theme] body {
  --excel-chrome-text: var(--theme-lock-text, var(--accent, var(--text)));
  --excel-chrome-border: var(--theme-lock-ui-border, var(--line));
  --excel-chrome-surface: var(--theme-surface, var(--panel));
  --excel-chrome-surface-strong: var(--theme-surface-strong, var(--panel-strong));
}

body :where(.sheet-topline, .workbook-nav, .nav-group, .grid-viewport,
  .sheet-tabs-row, .statusbar, .control-sidebar, .sidebar-heading,
  .control-section, .chart-dock, .context-menu, .zoom-control) {
  border-color: var(--excel-chrome-border) !important;
  color: var(--excel-chrome-text) !important;
}

body :where(.sheet-topline, .workbook-nav, .nav-group, .sheet-tabs-row,
  .statusbar, .control-sidebar, .sidebar-heading, .control-section,
  .chart-dock, .context-menu, .zoom-control) {
  background-color: var(--excel-chrome-surface) !important;
}

body :where(.sheet-topline, .workbook-nav, .sheet-tabs-row, .statusbar,
  .control-sidebar, .sidebar-heading, .control-section, .chart-dock,
  .context-menu, .zoom-control) :where(h1, h2, h3, h4, h5, h6, p, span,
  label, strong, small, output, button) {
  color: var(--excel-chrome-text) !important;
}

body :where(.workbook-title, .nav-button, .zoom-control button,
  .name-box, .sidebar-input, .formula-field, .formula-input,
  .control-section select, .color-select-wrap select, .format-button,
  .action-button, .chart-remove, .context-menu button, kbd) {
  border-color: var(--excel-chrome-border) !important;
  color: var(--excel-chrome-text) !important;
}

body :where(.workbook-title, .nav-button, .zoom-control button,
  .name-box, .sidebar-input, .formula-field, .formula-input,
  .control-section select, .color-select-wrap select, .format-button,
  .action-button, .chart-remove, .context-menu button, kbd) {
  background-color: var(--excel-chrome-surface-strong) !important;
}

body :where(.nav-button:hover, .nav-button:focus-visible,
  .zoom-control button:hover, .format-button:hover, .format-button.active,
  .action-button:hover, .chart-remove:hover, .context-menu button:hover,
  .context-menu button:focus, .name-box:focus, .formula-field:focus-within,
  .sidebar-input:focus, .control-section select:focus) {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  outline-color: var(--accent) !important;
}

body :where(.eyebrow, .sidebar-subtitle, .sidebar-help, .control-label,
  .cell-address-row label, .formula-audit-output, .save-indicator) {
  color: var(--excel-chrome-text) !important;
}

body .save-dot,
body .control-divider,
body .nav-divider {
  background-color: var(--theme-lock-text, var(--text)) !important;
}

body :where(#create-table, #apply-validation, #create-chart, #goal-seek,
  #export-xlsx-button, .export-button) {
  border-color: var(--accent) !important;
  background-color: var(--excel-chrome-surface-strong) !important;
  color: var(--excel-chrome-text) !important;
}

body :where(#create-table:hover, #apply-validation:hover, #create-chart:hover,
  #goal-seek:hover, #export-xlsx-button:hover, .export-button:hover) {
  border-color: var(--accent-strong) !important;
  background-color: var(--excel-chrome-surface-strong) !important;
  color: var(--excel-chrome-text) !important;
}

/* Pointer-focus contract for tabs and select controls. */
:where([role="tab"], [role="option"], select, [aria-selected="true"], [data-state="active"], .active, .selected):focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Final standalone Excel compact ribbon layout. */
@media (max-width: 800px) {
  html.workbook-route body .workbook-nav {
    min-width: 0;
    flex: 0 1 auto;
    margin-left: auto;
    overflow-x: auto;
  }
  html.workbook-route body .nav-group[aria-label="Quick formatting"],
  html.workbook-route body .nav-group.nav-file-actions,
  html.workbook-route body .nav-divider {
    display: none !important;
  }
  html.workbook-route body .ribbon-tabs {
    width: 100%;
    max-width: none;
    height: 30px;
    flex: 0 0 30px;
    justify-content: flex-start;
    margin: 0;
    padding: 0 8px;
    border-top: 1px solid #e5e5e5 !important;
    background: #f5f5f5 !important;
  }
  html.workbook-route body .ribbon-tab {
    min-width: 54px;
    height: 30px;
    padding: 0 9px;
    font-size: 10px;
  }
}

/* Final standalone favicon palette pass. Embedded Infinity pages keep their own appearance contract. */
html:not([data-appearance]) body .sheet-topline {
  border-bottom: 2px solid #00d7b0 !important;
  background: linear-gradient(105deg, #003d2b 0%, #006b3d 48%, #008044 82%, #00a85a 100%) !important;
}
html:not([data-appearance]) body .ribbon-tabs {
  border-top-color: #cfe8d7 !important;
  background: #f2fbf5 !important;
}
html:not([data-appearance]) body .ribbon-tab[aria-selected="true"] {
  border-bottom-color: #008044 !important;
  color: #005c36 !important;
}
html:not([data-appearance]) body .home-header,
html:not([data-appearance]) body .home-section,
html:not([data-appearance]) body .home-footer { border-color: #cfe8d7; }
html:not([data-appearance]) body .home-header { border-bottom-color: #00d7b0; }
html:not([data-appearance]) body .home-top-nav [aria-current="page"],
html:not([data-appearance]) body .home-top-nav span {
  border-bottom-color: #008044;
  color: #005c36;
}
html:not([data-appearance]) body .home-primary-action {
  border-color: #008044 !important;
  background: #008044 !important;
}
html:not([data-appearance]) body .home-primary-action:hover,
html:not([data-appearance]) body .home-primary-action:focus-visible {
  border-color: #aaff35 !important;
  background: #aaff35 !important;
  color: #003d2b !important;
}
html:not([data-appearance]) body .home-secondary-action:hover,
html:not([data-appearance]) body .home-template-categories button[aria-selected="true"] {
  border-color: #00a85a;
  color: #005c36;
  background: #e7f8ed;
}
html:not([data-appearance]) body :is(.template-preview b, .preview-budget b, .preview-calendar b) {
  background: linear-gradient(100deg, #006b3d, #008044 72%, #00a85a);
}
html:not([data-appearance]) body :is(.preview-schedule b, .preview-list b) {
  background: #003d2b;
}
html:not([data-appearance]) body :is(.nav-button:hover, .nav-button:focus-visible,
  .format-button:hover, .format-button.active, .action-button:hover,
  .chart-remove:hover, .context-menu button:hover, .context-menu button:focus,
  .zoom-control button:hover) {
  border-color: #00a85a !important;
  color: #005c36 !important;
  background: #e7f8ed !important;
}
html:not([data-appearance]) body :is(.grid-viewport, .ribbon-panel) {
  scrollbar-color: #00a85a #e7f8ed !important;
}
html:not([data-appearance]) body :is(.grid-viewport, .ribbon-panel)::-webkit-scrollbar-track {
  background: #e7f8ed !important;
}
html:not([data-appearance]) body :is(.grid-viewport, .ribbon-panel)::-webkit-scrollbar-thumb {
  border-color: #e7f8ed !important;
  background: #00a85a !important;
}
html:not([data-appearance]) body :is(.grid-viewport, .ribbon-panel)::-webkit-scrollbar-thumb:hover {
  background: #008044 !important;
}
html:not([data-appearance]) body :is(button, a, input, select, [tabindex]):focus-visible {
  outline-color: #00a85a !important;
}
html:not([data-appearance]) body .home-hero {
  background: linear-gradient(108deg, #f2fbf5 0%, #f8fcf8 54%, #e4f6ed 100%);
}
html:not([data-appearance]) body .home-hero h1,
html:not([data-appearance]) body .home-brand { color: #003d2b; }
html:not([data-appearance]) body .home-eyebrow { color: #008044; }
html:not([data-appearance]) body .home-primary-action { color: #ffffff !important; }
html:not([data-appearance]) body .home-primary-action:hover,
html:not([data-appearance]) body .home-primary-action:focus-visible { color: #003d2b !important; }
html:not([data-appearance]) body .home-art-sheet::before {
  background: linear-gradient(90deg, #aaff35, #00a85a 55%, #00d7b0);
}
html:not([data-appearance]) body .home-cloud-status i {
  background: #aaff35;
  box-shadow: 0 0 0 3px #00804420;
}
html:not([data-appearance]) body .sheet-tabs-row,
html:not([data-appearance]) body .statusbar { background: #f2fbf5 !important; }
html:not([data-appearance]) body .sheet-tab.active {
  box-shadow: inset 0 -3px 0 #008044;
}
html:not([data-appearance]) body .home-hero {
  background: linear-gradient(108deg, #f2fbf5 0%, #f8fcf8 54%, #e4f6ed 100%) !important;
  background-image: linear-gradient(108deg, #f2fbf5 0%, #f8fcf8 54%, #e4f6ed 100%) !important;
}

/* Keep standalone workbook controls readable without the embedded-host theme bridge. */
html:not([data-appearance]) {
  --tronxvi-black: #ffffff;
  --tronxvi-black-soft: #f2fbf5;
  --tronxvi-rail: #e7f8ed;
  --tronxvi-white: #003d2b;
  --tronxvi-secondary: #006b3d;
  --tronxvi-line: #cfe8d7;
}
html:not([data-appearance]) body .control-sidebar {
  border-left-color: #cfe8d7 !important;
  background: #f2fbf5 !important;
  color: #003d2b !important;
  scrollbar-color: #00a85a #e7f8ed;
}
html:not([data-appearance]) body .sidebar-heading,
html:not([data-appearance]) body .control-section {
  border-color: #cfe8d7 !important;
  background: #f2fbf5 !important;
  color: #003d2b !important;
  box-shadow: none !important;
}
html:not([data-appearance]) body :is(.sidebar-heading h1, .control-section h2,
  .control-label, .cell-address-row label, .format-button, .color-select-wrap,
  .format-select-label, .formula-field .fx-mark, .sidebar-help, .eyebrow,
  .sidebar-subtitle, .formula-audit-output) {
  color: #005c36 !important;
}
html:not([data-appearance]) body .control-section h2::before {
  background: linear-gradient(180deg, #aaff35, #00d7b0) !important;
}
html:not([data-appearance]) body :is(.format-button:hover, .format-button.active,
  .color-select-wrap:hover, .action-button:hover, .chart-remove:hover,
  .context-menu button:hover, .context-menu button:focus) {
  border-color: #00a85a !important;
  color: #005c36 !important;
  background: #e7f8ed !important;
}
html:not([data-appearance]) body :is(.name-box, .sidebar-input, .formula-field,
  .control-section select, .color-select-wrap select, .formula-input) {
  border-color: #cfe8d7 !important;
  color: #003d2b !important;
  background-color: #ffffff !important;
}
html:not([data-appearance]) body .control-divider { background: #00a85a; }

/* Excel-style ribbon display menu and the three ribbon visibility modes. */
html.workbook-route body .workbook-nav { position: relative; overflow: visible; }
html.workbook-route body .ribbon-display-options { position: relative; flex: 0 0 auto; z-index: 40; }
html.workbook-route body .ribbon-display-options > summary {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #003d2b;
  background: transparent;
  cursor: pointer;
  font: 18px/1 Arial, sans-serif;
  list-style: none;
}
html.workbook-route body .ribbon-display-options > summary::-webkit-details-marker { display: none; }
html.workbook-route body .ribbon-display-options > summary:hover,
html.workbook-route body .ribbon-display-options[open] > summary { border-color: #cfe8d7; background: #f2fbf5; }
html.workbook-route body .ribbon-display-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  display: grid;
  width: 215px;
  padding: 5px;
  border: 1px solid #cfe0d3;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 8px 24px #003d2b26;
}
html.workbook-route body .ribbon-display-menu button {
  min-height: 34px;
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  color: #173d29 !important;
  background: #fff !important;
  opacity: 1 !important;
  text-align: left;
  font: 12px Arial, sans-serif;
  cursor: pointer;
}
html.workbook-route body .ribbon-display-menu button:hover,
html.workbook-route body .ribbon-display-menu button[aria-checked="true"] { background: #eaf5ec !important; }
html.workbook-route body .ribbon-display-menu button:hover { background: #f4faf5 !important; }
html.workbook-route body .ribbon-display-menu button[aria-checked="true"]::before { content: "✓"; display: inline-block; width: 17px; color: #087f3f; }
html.workbook-route.ribbon-auto-hide body .ribbon-quick-row {
  grid-template-rows: 36px;
  min-height: 36px;
  height: 36px;
  flex-basis: 36px;
}
html.workbook-route.ribbon-auto-hide body .ribbon-tabs,
html.workbook-route.ribbon-auto-hide body .control-sidebar { display: none !important; }

/* Keep long ribbon groups scrollable with a quiet Excel-like overflow cue. */
html.workbook-route body .control-sidebar .ribbon-panel {
  scrollbar-width: thin !important;
  scrollbar-color: #bdc7c0 transparent !important;
}
html.workbook-route body .control-sidebar .ribbon-panel::-webkit-scrollbar {
  display: block !important;
  height: 4px !important;
}
html.workbook-route body .control-sidebar .ribbon-panel::-webkit-scrollbar-track { background: transparent !important; }
html.workbook-route body .control-sidebar .ribbon-panel::-webkit-scrollbar-thumb {
  border: 0 !important;
  border-radius: 99px;
  background: #bdc7c0 !important;
}
html.workbook-route body .control-sidebar .ribbon-panel::-webkit-scrollbar-button { display: none !important; }

/* Excel keeps its workbook header white; use TRONXVI green for accents and status. */
html.workbook-route body .sheet-topline,
html.workbook-route body .ribbon-quick-row {
  color: #242424 !important;
  background: #ffffff !important;
  border-color: #e1e5e2 !important;
}
html.workbook-route body .workbook-title {
  border-color: transparent !important;
  color: #242424 !important;
  background: transparent !important;
  -webkit-text-fill-color: #242424 !important;
}
html.workbook-route body .workbook-title:hover,
html.workbook-route body .workbook-title:focus {
  border-color: #c9d8ce !important;
  background: #f6faf7 !important;
}
html.workbook-route body .save-indicator { color: #5f6368 !important; }
html.workbook-route body .save-dot {
  background: #0f9d58 !important;
  box-shadow: 0 0 0 3px #0f9d5820 !important;
}
html.workbook-route body .home-nav-button,
html.workbook-route body .nav-button {
  border-color: transparent !important;
  color: #444746 !important;
  background: transparent !important;
}
html.workbook-route body .home-nav-button:hover,
html.workbook-route body .home-nav-button:focus-visible,
html.workbook-route body .nav-button:hover,
html.workbook-route body .nav-button:focus-visible {
  border-color: #d7e3da !important;
  color: #075c36 !important;
  background: #f0f7f2 !important;
}
html.workbook-route body #share-workbook {
  border-color: #0f9d58 !important;
  color: #ffffff !important;
  background: #0f9d58 !important;
}
html.workbook-route body #share-workbook:hover {
  border-color: #087e47 !important;
  color: #ffffff !important;
  background: #087e47 !important;
}
html.workbook-route body .control-sidebar {
  border-bottom-color: #e1e5e2 !important;
  background: #f8f9fa !important;
}
html.workbook-route body .home-nav-button img { display: block; width: 18px; height: 18px; object-fit: contain; }

/* Fit the Home ribbon into the viewport and keep secondary commands in menus. */
html.workbook-route body .control-sidebar .ribbon-panel[data-ribbon-panel="home"] {
  height: 94px;
  min-height: 94px;
  max-height: 94px;
  align-items: stretch;
}
html.workbook-route body #ribbon-panel-home > .control-section {
  box-sizing: border-box;
  height: 94px;
  min-width: 0;
  max-height: 94px;
  flex-flow: row wrap;
  align-content: center;
  align-items: center;
  gap: 6px 8px;
  overflow: visible;
  padding: 5px 10px;
  border-right: 1px solid #e1e5e2;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(1) {
  width: 560px;
  flex-basis: 560px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(2) {
  width: 230px;
  flex-basis: 230px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) {
  width: 310px;
  flex-basis: 310px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .control-label {
  width: 132px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .control-label {
  flex-direction: row;
  align-items: center;
  gap: 4px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .control-label input {
  width: 88px;
  min-width: 0;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .replace-input-label input {
  width: 66px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .button-pair {
  width: 142px;
}
html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) > .replace-input-label {
  width: 132px;
}
html.workbook-route body #ribbon-panel-home .two-controls > .control-label {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  margin: 0;
  white-space: nowrap;
}
html.workbook-route body #ribbon-panel-home #wrap-text {
  width: auto;
  min-width: max-content;
  flex: 0 0 auto;
  margin: 0;
}
html.workbook-route body .ribbon-command-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: max-content;
  align-items: center;
}
html.workbook-route body .ribbon-command-menu > summary {
  display: inline-flex;
  min-width: max-content;
  min-height: 27px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid #d7e3da;
  border-radius: 5px;
  color: #2f3c34;
  background: #fff;
  font: 11px Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
html.workbook-route body .ribbon-command-menu > summary::-webkit-details-marker { display: none; }
html.workbook-route body .ribbon-command-menu > summary::after {
  content: "⌄";
  margin-left: 7px;
  color: #68736d;
}
html.workbook-route body .ribbon-command-menu[open] > summary {
  border-color: #0f9d58;
  background: #f0f7f2;
}
html.workbook-route body .ribbon-command-menu-content {
  position: fixed;
  z-index: 1000;
  top: 112px;
  left: 16px;
  display: grid;
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 132px);
  gap: 9px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  color: #242a26;
  background: #fff;
  box-shadow: 0 8px 26px #202a222e;
}
html.workbook-route body .conditional-format-menu .conditional-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}
html.workbook-route body .conditional-format-menu .conditional-row > .control-label {
  width: auto;
  grid-column: 1 / -1;
}
html.workbook-route body .conditional-format-menu .conditional-row > button {
  grid-column: 1 / -1;
}
html.workbook-route body .conditional-format-menu .data-label { width: auto; }
html.workbook-route body .conditional-format-menu .button-pair {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html.workbook-route body .sheet-command-menu .ribbon-command-menu-content {
  width: min(310px, calc(100vw - 32px));
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
html.workbook-route body .clear-command-menu .ribbon-command-menu-content {
  width: min(250px, calc(100vw - 32px));
  gap: 3px;
}
html.workbook-route body .clear-command-menu .ribbon-command-menu-content .action-button {
  width: 100%;
  min-height: 30px;
  justify-content: flex-start;
  padding-inline: 9px;
}
html.workbook-route body .cell-styles-menu .ribbon-command-menu-content {
  width: min(650px, calc(100vw - 32px));
  gap: 4px;
}
html.workbook-route body .cell-style-gallery-heading {
  display: block;
  padding: 4px 3px 1px;
  color: #616161;
  font-size: 11px;
  font-weight: 600;
}
html.workbook-route body .cell-style-gallery {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
html.workbook-route body .cell-style-group-items {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px 5px;
}
html.workbook-route body .cell-style-group-wide {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
html.workbook-route body .cell-style-group-data {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
html.workbook-route body .cell-style-choice {
  display: block;
  min-width: 0;
  min-height: 27px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 1px;
  color: #242424;
  background: transparent;
  font: 10px "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}
html.workbook-route body .cell-style-choice:hover,
html.workbook-route body .cell-style-choice:focus-visible {
  border-color: #8a8886;
  background: #f5f5f5;
  outline: none;
}
html.workbook-route body .cell-style-swatch {
  display: flex;
  box-sizing: border-box;
  min-height: 23px;
  height: 23px;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  border: 1px solid #d1d1d1;
  padding: 0 5px;
  background: var(--style-fill);
  color: var(--style-ink);
  font: 10px "Segoe UI", Arial, sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html.workbook-route body .cell-style-choice[data-cell-style="calculation"] .cell-style-swatch,
html.workbook-route body .cell-style-choice[data-cell-style="followed-by"] .cell-style-swatch,
html.workbook-route body .cell-style-choice[data-cell-style="hyperlink"] .cell-style-swatch,
html.workbook-route body .cell-style-choice[data-cell-style="linked-cell"] .cell-style-swatch,
html.workbook-route body .cell-style-choice[data-cell-style^="heading-"] .cell-style-swatch,
html.workbook-route body .cell-style-choice[data-cell-style="total"] .cell-style-swatch { text-decoration: underline; }
html.workbook-route body .cell-style-choice[data-cell-style="explanatory"] .cell-style-swatch { font-style: italic; }
html.workbook-route body .cell-style-choice[data-cell-style="title"] .cell-style-swatch { font-size: 15px; }
html.workbook-route body .number-format-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  padding: 20px;
  color: #242424;
  background: #fff;
  box-shadow: 0 16px 42px #0003;
}
html.workbook-route body .number-format-dialog::backdrop { background: #0005; }
html.workbook-route body .number-format-dialog form { float: right; }
html.workbook-route body .number-format-dialog .dialog-close {
  width: 28px;
  height: 28px;
  border: 1px solid #d1d1d1;
  border-radius: 4px;
  color: #242424;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}
html.workbook-route body .number-format-dialog h2 { margin: 4px 0 18px; font-size: 18px; }
html.workbook-route body .number-format-fields { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
html.workbook-route body .number-format-fields > .control-label { display: flex; flex-direction: column; gap: 5px; color: #424242; font-size: 12px; }
html.workbook-route body .number-format-fields select,
html.workbook-route body .number-format-fields input[type="number"] { box-sizing: border-box; width: 100%; min-height: 34px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 5px 8px; background: #fff; color: #242424; }
html.workbook-route body .number-format-separator { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; color: #424242; font-size: 12px; }
html.workbook-route body .number-format-sample { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border-top: 1px solid #e1e1e1; padding-top: 12px; font-size: 12px; }
html.workbook-route body .number-format-sample output { text-align: right; font-variant-numeric: tabular-nums; }
html.workbook-route body .number-format-dialog .number-format-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
html.workbook-route body .number-format-dialog .number-format-actions button { min-width: 82px; }
html.workbook-route body .number-format-dialog #number-format-apply { border-color: #217346; color: #fff; background: #217346; }
html.workbook-route body .data-validation-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid #c8c8c8; border-radius: 8px; padding: 20px; color: #242424; background: #fff; box-shadow: 0 16px 42px #0003; }
html.workbook-route body .data-validation-dialog::backdrop { background: #0005; }
html.workbook-route body .data-validation-dialog form { float: right; }
html.workbook-route body .data-validation-dialog .dialog-close { width: 28px; height: 28px; border: 1px solid #d1d1d1; border-radius: 4px; color: #242424; background: #fff; font-size: 18px; cursor: pointer; }
html.workbook-route body .data-validation-dialog h2 { margin: 4px 0 6px; font-size: 18px; }
html.workbook-route body .validation-range-label { margin: 0 0 14px; color: #666; font-size: 12px; }
html.workbook-route body .validation-tabs { display: flex; gap: 3px; border-bottom: 1px solid #d6d6d6; }
html.workbook-route body .validation-tabs [role="tab"] { border: 0; border-bottom: 2px solid transparent; padding: 8px 11px; color: #555; background: transparent; font: 12px Arial, sans-serif; cursor: pointer; }
html.workbook-route body .validation-tabs [role="tab"][aria-selected="true"] { border-bottom-color: #217346; color: #217346; font-weight: 700; }
html.workbook-route body .validation-tab-panel { display: grid; gap: 12px; padding: 16px 2px 4px; }
html.workbook-route body .validation-tab-panel .control-label { display: grid; gap: 5px; color: #444; font-size: 12px; }
html.workbook-route body .validation-tab-panel .sidebar-input { box-sizing: border-box; width: 100%; min-height: 34px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 6px 8px; background: #fff; color: #242424; }
html.workbook-route body .validation-values { min-height: 68px !important; resize: vertical; }
html.workbook-route body .validation-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
html.workbook-route body .validation-checkbox { display: inline-flex; align-items: center; gap: 7px; color: #424242; font-size: 12px; }
html.workbook-route body .validation-message { min-height: 84px !important; resize: vertical; }
html.workbook-route body #validation-status { display: block; min-height: 18px; margin-top: 8px; color: #a4262c; font-size: 12px; }
html.workbook-route body .validation-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; margin-top: 12px; }
html.workbook-route body #validation-apply { min-width: 82px; border-color: #217346; color: #fff; background: #217346; }
html.workbook-route body .validation-alert-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid #b8b8b8; border-radius: 8px; padding: 22px; color: #242424; background: #fff; box-shadow: 0 18px 48px #0004; }
html.workbook-route body .validation-alert-dialog::backdrop { background: #0006; }
html.workbook-route body .validation-alert-content { display: grid; grid-template-columns: 34px 1fr; align-items: start; gap: 14px; }
html.workbook-route body .validation-alert-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #c33; border-radius: 50%; color: #c33; font-weight: 700; }
html.workbook-route body .validation-alert-dialog[data-style="warning"] .validation-alert-icon { border-color: #b97800; color: #b97800; }
html.workbook-route body .validation-alert-dialog[data-style="information"] .validation-alert-icon { border-color: #217346; color: #217346; }
html.workbook-route body .validation-alert-dialog h2 { margin: 1px 0 8px; font-size: 17px; font-weight: 600; }
html.workbook-route body .validation-alert-dialog p { margin: 0; color: #4c4c4c; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
html.workbook-route body .validation-alert-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }
html.workbook-route body .validation-alert-actions button { min-width: 78px; }
html.workbook-route body .validation-alert-actions .primary { border-color: #217346; color: #fff; background: #217346; }
html.workbook-route body .validation-alert-dialog[data-style="stop"] #validation-alert-yes,
html.workbook-route body .validation-alert-dialog[data-style="stop"] #validation-alert-no,
html.workbook-route body .validation-alert-dialog[data-style="stop"] #validation-alert-cancel,
html.workbook-route body .validation-alert-dialog[data-style="warning"] #validation-alert-retry,
html.workbook-route body .validation-alert-dialog[data-style="information"] #validation-alert-retry,
html.workbook-route body .validation-alert-dialog[data-style="information"] #validation-alert-cancel { display: none; }
@media (max-width: 560px) { html.workbook-route body .data-validation-dialog { padding: 14px; } html.workbook-route body .validation-limits { grid-template-columns: 1fr; } }
html.workbook-route body .text-to-columns-dialog { width: min(690px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid #c8c8c8; border-radius: 8px; padding: 20px; color: #242424; background: #fff; box-shadow: 0 16px 42px #0003; }
html.workbook-route body .text-to-columns-dialog::backdrop { background: #0005; }
html.workbook-route body .text-to-columns-dialog form { float: right; }
html.workbook-route body .text-to-columns-dialog .dialog-close { width: 28px; height: 28px; border: 1px solid #d1d1d1; border-radius: 4px; color: #242424; background: #fff; font-size: 18px; cursor: pointer; }
html.workbook-route body .text-to-columns-dialog h2 { margin: 4px 0 10px; font-size: 18px; }
html.workbook-route body .text-columns-source { color: #555; font-size: 12px; }
html.workbook-route body .text-columns-mode, html.workbook-route body .text-columns-options fieldset { margin: 12px 0; border: 1px solid #d6d6d6; border-radius: 5px; padding: 9px 12px; }
html.workbook-route body .text-columns-mode legend, html.workbook-route body .text-columns-options legend { padding: 0 4px; color: #444; font-size: 12px; }
html.workbook-route body .text-columns-mode label, html.workbook-route body .text-columns-delimiters label, html.workbook-route body .text-columns-inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; font-size: 12px; }
html.workbook-route body .text-columns-delimiters { display: flex; flex-wrap: wrap; gap: 9px 14px; }
html.workbook-route body .text-columns-delimiters label { margin: 0; }
html.workbook-route body .text-columns-delimiters .sidebar-input { width: 52px; min-height: 28px; }
html.workbook-route body .text-columns-options .control-label, html.workbook-route body .text-columns-output-options .control-label { display: grid; gap: 5px; color: #444; font-size: 12px; }
html.workbook-route body .text-columns-options .sidebar-input, html.workbook-route body .text-columns-output-options .sidebar-input { box-sizing: border-box; width: 100%; min-height: 34px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 5px 8px; background: #fff; color: #242424; }
html.workbook-route body .text-columns-options > .control-label { max-width: 320px; }
html.workbook-route body .text-columns-options .text-columns-inline { margin-top: 12px; }
html.workbook-route body .text-columns-output-options { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: end; margin-top: 14px; }
html.workbook-route body .text-columns-output-options .text-columns-inline { grid-column: 1 / -1; }
html.workbook-route body .text-columns-preview-section h3 { margin: 18px 0 7px; font-size: 13px; }
html.workbook-route body .text-columns-preview { max-height: 180px; overflow: auto; border: 1px solid #d6d6d6; }
html.workbook-route body .text-columns-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
html.workbook-route body .text-columns-preview th, html.workbook-route body .text-columns-preview td { min-width: 90px; max-width: 220px; overflow: hidden; border: 1px solid #e4e4e4; padding: 5px 7px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
html.workbook-route body .text-columns-preview th { background: #f3f3f3; font-weight: 600; }
html.workbook-route body #text-columns-status { display: block; min-height: 18px; margin-top: 9px; color: #a4262c; font-size: 12px; }
html.workbook-route body .text-columns-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
html.workbook-route body #text-columns-finish { min-width: 82px; border-color: #217346; color: #fff; background: #217346; }
@media (max-width: 560px) { html.workbook-route body .text-columns-output-options { grid-template-columns: 1fr; } }
html.workbook-route body #ribbon-panel-data .get-data-menu { display: inline-flex; width: auto; min-width: 0; flex: 0 0 auto; }
html.workbook-route body #ribbon-panel-data .get-data-menu > summary { width: auto; min-height: 32px; justify-content: center; border-color: #d4ddd6; border-radius: 4px; color: #242a26; background: #fff; font-size: 12px; }
html.workbook-route body #ribbon-panel-data .get-data-menu-content { gap: 3px; }
html.workbook-route body #ribbon-panel-data .get-data-menu-content .action-button { justify-content: flex-start; min-height: 30px; border: 0; border-radius: 3px; color: #242a26; background: #fff; text-align: left; font-size: 12px; }
html.workbook-route body #ribbon-panel-data .get-data-menu-content .action-button:hover { background: #f0f7f2; }
html.workbook-route body .data-import-dialog { width: min(780px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); overflow: auto; border: 1px solid #c8c8c8; border-radius: 8px; padding: 20px; color: #242424; background: #fff; box-shadow: 0 16px 42px #0003; }
html.workbook-route body .data-import-dialog::backdrop { background: #0005; }
html.workbook-route body .data-import-dialog form { float: right; }
html.workbook-route body .data-import-dialog .dialog-close { width: 28px; height: 28px; border: 1px solid #d1d1d1; border-radius: 4px; color: #242424; background: #fff; font-size: 18px; cursor: pointer; }
html.workbook-route body .data-import-dialog h2 { margin: 4px 0 8px; font-size: 18px; }
html.workbook-route body .data-import-source { margin: 0 0 14px; color: #5e625f; font-size: 12px; }
html.workbook-route body .data-import-dialog > .control-label { display: grid; width: min(300px, 100%); gap: 5px; color: #444; font-size: 12px; }
html.workbook-route body .data-import-dialog .sidebar-input { box-sizing: border-box; width: 100%; min-height: 32px; border: 1px solid #c8c8c8; border-radius: 4px; padding: 5px 8px; color: #242424; background: #fff; }
html.workbook-route body .data-import-preview-section h3 { margin: 16px 0 7px; font-size: 13px; }
html.workbook-route body .data-import-preview { max-height: 330px; overflow: auto; border: 1px solid #d6d6d6; }
html.workbook-route body .data-import-preview table { width: max-content; min-width: 100%; border-collapse: collapse; font-size: 12px; }
html.workbook-route body .data-import-preview th, html.workbook-route body .data-import-preview td { min-width: 76px; max-width: 220px; overflow: hidden; border: 1px solid #e4e4e4; padding: 5px 7px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
html.workbook-route body .data-import-preview th { position: sticky; top: 0; z-index: 1; background: #f3f3f3; font-weight: 600; }
html.workbook-route body #data-import-status { display: block; min-height: 18px; margin-top: 9px; color: #5e625f; font-size: 12px; }
html.workbook-route body .data-import-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
html.workbook-route body #data-import-load { min-width: 82px; border-color: #217346; color: #fff; background: #217346; }
@media (max-width: 560px) { html.workbook-route body .data-import-dialog { padding: 14px; } }
html.workbook-route body .sheet-command-menu .full-button { grid-column: 1 / -1; }
@media (max-width: 760px) {
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(1) { width: 490px; flex-basis: 490px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(2) { width: 220px; flex-basis: 220px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) { width: 300px; flex-basis: 300px; }
}

/* Excel-style Insert commands with working cell tools and compact chart controls. */
html.workbook-route body #ribbon-panel-insert > .control-section[data-ribbon-section="insert"] {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
html.workbook-route body #ribbon-panel-insert > .control-section[data-ribbon-section="insert"] > h2 {
  display: none;
}
html.workbook-route body .insert-command-group {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(52px, auto);
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  padding-right: 9px;
  border-right: 1px solid #d8e1da;
}
html.workbook-route body .insert-command-button {
  display: flex;
  width: 62px;
  min-height: 62px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 5px 3px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #283a2e;
  background: transparent;
  font: 11px Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
html.workbook-route body .insert-command-button > span {
  color: #188247;
  font-size: 23px;
  line-height: 1;
}
html.workbook-route body .insert-command-button:hover,
html.workbook-route body .insert-command-button:focus-visible {
  border-color: #c6dfcd;
  background: #eff7f1;
  outline: none;
}
html.workbook-route body .insert-charts-group,
html.workbook-route body .insert-sparkline-group {
  grid-auto-flow: row;
  grid-template-columns: repeat(2, minmax(100px, auto));
  align-content: center;
  align-items: center;
  gap: 4px 8px;
}
html.workbook-route body .insert-charts-group .control-label,
html.workbook-route body .insert-sparkline-group .control-label {
  display: flex;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
}
html.workbook-route body .insert-charts-group {
  grid-template-columns: 132px repeat(3, 44px);
  grid-template-rows: repeat(2, 30px);
  gap: 4px;
}
html.workbook-route body .insert-charts-group #recommended-charts {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 58px;
}
html.workbook-route body .insert-chart-quick-tools { display: contents; }
html.workbook-route body .insert-chart-quick-button {
  display: flex;
  width: 44px;
  height: 30px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 1px 2px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #283a2e;
  background: transparent;
  cursor: pointer;
}
html.workbook-route body .insert-chart-quick-button:hover,
html.workbook-route body .insert-chart-quick-button:focus-visible {
  border-color: #c6dfcd;
  background: #eff7f1;
  outline: none;
}
html.workbook-route body .insert-chart-quick-button > span { color: #188247; font: 17px/18px Arial, sans-serif; }
html.workbook-route body .insert-chart-quick-button > small { color: #48534b; font: 8px/9px Arial, sans-serif; }
html.workbook-route body .insert-chart-quick-button:nth-child(1) { grid-column: 2; grid-row: 1; }
html.workbook-route body .insert-chart-quick-button:nth-child(2) { grid-column: 3; grid-row: 1; }
html.workbook-route body .insert-chart-quick-button:nth-child(3) { grid-column: 4; grid-row: 1; }
html.workbook-route body .insert-chart-quick-button:nth-child(4) { grid-column: 2; grid-row: 2; }
html.workbook-route body .insert-chart-quick-button:nth-child(5) { grid-column: 3; grid-row: 2; }
html.workbook-route body .chart-options-menu { grid-column: 4; grid-row: 2; }
html.workbook-route body .chart-options-menu > summary { width: 44px; min-width: 44px; padding: 4px 3px; }
html.workbook-route body .insert-charts-group select,
html.workbook-route body .insert-charts-group input,
html.workbook-route body .insert-sparkline-group input {
  width: 115px;
  min-width: 0;
  height: 25px;
  padding: 3px 5px;
}
html.workbook-route body .insert-charts-group .action-button,
html.workbook-route body .insert-sparkline-group .action-button {
  width: auto;
  min-width: 0;
  min-height: 25px;
  margin: 0;
  padding: 4px 7px;
  font-size: 10px;
  white-space: nowrap;
}
html.workbook-route body .insert-charts-group #create-chart,
html.workbook-route body .insert-sparkline-group #create-sparkline {
  grid-column: 1 / -1;
}
html.workbook-route body .insert-command-menu > summary { min-height: 30px; }
html.workbook-route body .cell-checkbox-control {
  width: 15px;
  height: 15px;
  margin: 0 auto;
  accent-color: #168044;
  cursor: pointer;
}
html.workbook-route body .cell-checkbox-control:disabled { cursor: not-allowed; }
@media (max-width: 760px) {
  html.workbook-route body #ribbon-panel-insert > .control-section[data-ribbon-section="insert"] { gap: 6px; }
  html.workbook-route body .insert-command-group { padding-right: 5px; }
  html.workbook-route body .insert-command-button { width: 54px; }
  html.workbook-route body .insert-charts-group,
  html.workbook-route body .insert-sparkline-group { grid-template-columns: repeat(2, minmax(80px, auto)); }
  html.workbook-route body .insert-charts-group { grid-template-columns: 110px repeat(3, 40px); }
  html.workbook-route body .insert-chart-quick-button,
  html.workbook-route body .chart-options-menu > summary { width: 40px; min-width: 40px; }
}
html.workbook-route body .recommended-chart-pane[hidden] { display: none; }
html.workbook-route body .recommended-chart-pane {
  position: fixed;
  z-index: 30;
  top: 154px;
  right: 0;
  bottom: 27px;
  display: flex;
  width: min(360px, calc(100vw - 24px));
  flex-direction: column;
  border-left: 1px solid #d6d9dc;
  background: #fff;
  box-shadow: -5px 0 18px #0000001a;
  color: #242424;
  font-family: Arial, sans-serif;
}
html.workbook-route body .recommended-chart-pane-header {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  padding: 17px 18px 13px;
  border-bottom: 1px solid #e4e6e8;
}
html.workbook-route body .recommended-chart-pane-header h2 { margin: 0; font-size: 16px; font-weight: 600; }
html.workbook-route body .recommended-chart-pane-header button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #444;
  font-size: 22px;
  cursor: pointer;
}
html.workbook-route body .recommended-chart-pane-header button:hover { background: #f1f1f1; }
html.workbook-route body .recommended-chart-context { margin: 0; padding: 12px 18px; color: #616161; font-size: 12px; }
html.workbook-route body .recommended-chart-options { display: grid; align-content: start; gap: 9px; overflow: auto; padding: 4px 14px 14px; }
html.workbook-route body .recommended-chart-option {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 13px;
  padding: 9px 12px;
  border: 1px solid #d6d9dc;
  border-radius: 4px;
  background: #fff;
  color: #242424;
  text-align: left;
  cursor: pointer;
}
html.workbook-route body .recommended-chart-option:hover { background: #f7faf8; border-color: #668a70; }
html.workbook-route body .recommended-chart-option[aria-checked="true"] { border: 2px solid #217346; padding: 8px 11px; background: #f4f8f5; }
html.workbook-route body .recommended-chart-option:focus-visible { outline: 2px solid #217346; outline-offset: 2px; }
html.workbook-route body .recommended-chart-preview {
  display: grid;
  width: 62px;
  height: 48px;
  flex: none;
  place-items: center;
  border: 1px solid #e3e6e4;
  background: #fff;
  color: #217346;
  font-size: 30px;
}
html.workbook-route body .recommended-chart-preview-bar::before { content: "▂▅▇"; letter-spacing: 1px; }
html.workbook-route body .recommended-chart-preview-line::before { content: "⌁"; font-size: 46px; }
html.workbook-route body .recommended-chart-preview-pie::before { content: "◕"; }
html.workbook-route body .recommended-chart-option-copy { display: grid; gap: 5px; }
html.workbook-route body .recommended-chart-option-copy strong { font-size: 13px; font-weight: 600; }
html.workbook-route body .recommended-chart-option-copy small { color: #616161; font-size: 11px; }
html.workbook-route body .recommended-chart-pane-footer { display: flex; flex: none; justify-content: flex-end; gap: 8px; margin-top: auto; padding: 12px 16px; border-top: 1px solid #e4e6e8; }
html.workbook-route body .recommended-chart-pane-footer button { min-width: 76px; height: 32px; border-radius: 3px; font: 12px Arial, sans-serif; cursor: pointer; }
html.workbook-route body .recommended-chart-insert { border: 1px solid #217346; background: #217346; color: #fff; }
html.workbook-route body .recommended-chart-cancel { border: 1px solid #b8bdc2; background: #fff; color: #242424; }
@media (max-width: 760px) {
  html.workbook-route body .recommended-chart-pane { top: 205px; }
}

/* Excel-style Home Clipboard group and one-shot Format Painter controls. */
html.workbook-route body #ribbon-panel-home > .clipboard-section {
  width: 206px;
  min-width: 206px;
  max-width: 206px;
  flex-basis: 206px;
}
html.workbook-route body .home-clipboard-actions { display: flex; align-items: stretch; gap: 5px; }
html.workbook-route body .home-clipboard-secondary { display: grid; flex: 1; align-content: center; gap: 3px; }
html.workbook-route body .home-clipboard-button {
  display: flex;
  min-width: 0;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #283a2e;
  font: 11px Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}
html.workbook-route body .home-clipboard-button > span { display: inline-grid; width: 17px; place-items: center; color: #188247; font-size: 15px; }
html.workbook-route body .home-paste-button { min-width: 70px; min-height: 78px; flex-direction: column; justify-content: center; gap: 7px; font-size: 12px; }
html.workbook-route body .home-paste-button > span { width: auto; font-size: 27px; }

html.workbook-route body #ribbon-panel-home #home-paste-special {
  min-height: 25px;
  padding: 3px 5px;
  font-size: 9px;
  white-space: nowrap;
}
.paste-special-dialog {
  width: min(390px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  color: var(--deep);
  background: var(--white);
  box-shadow: 0 20px 60px #00150b45;
}
.paste-special-dialog::backdrop { background: #07150c80; }
.paste-special-dialog h2 { margin: 0 38px 7px 0; font-size: 19px; }
.paste-special-description { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.paste-special-dialog .dialog-close { float: right; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--green); font-size: 20px; cursor: pointer; }
.paste-special-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.paste-special-options legend { padding: 0 5px; font-size: 11px; font-weight: 700; }
.paste-special-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.paste-special-options input { accent-color: var(--green); }
.paste-special-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.paste-special-actions .action-button { min-width: 78px; justify-content: center; }
#paste-special-status { display: block; min-height: 16px; color: var(--muted); font-size: 11px; }

/* Excel Formulas ribbon: function library, defined names, and formula auditing. */
body .control-sidebar #ribbon-panel-formulas .formula-library-section { min-width: 160px; }
body .control-sidebar #ribbon-panel-formulas .formula-names-section { min-width: 174px; }
body .control-sidebar #ribbon-panel-formulas .formula-audit-section { min-width: 178px; }
body .control-sidebar #ribbon-panel-formulas .formula-tools { display: flex; align-items: center; gap: 7px; margin: 0; }
body .control-sidebar #ribbon-panel-formulas .formula-tools .full-button { min-width: 104px; min-height: 40px; }
body .control-sidebar #ribbon-panel-formulas .formula-tools { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 3px 6px; }
body .control-sidebar #ribbon-panel-formulas .formula-tools #insert-function { min-width: 0; min-height: 32px; padding: 5px 7px; font-size: 10px; }
body .control-sidebar #ribbon-panel-formulas .formula-function-categories { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 4px; }
body .control-sidebar #ribbon-panel-formulas .formula-function-menu { position: relative; min-width: 0; }
body .control-sidebar #ribbon-panel-formulas .formula-function-menu > summary { overflow: hidden; border-radius: 3px; padding: 4px 3px; color: #242424; background: transparent; text-align: center; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font: 9px Arial, sans-serif; list-style: none; }
body .control-sidebar #ribbon-panel-formulas .formula-function-menu > summary::-webkit-details-marker { display: none; }
body .control-sidebar #ribbon-panel-formulas .formula-function-menu > summary::after { content: "⌄"; margin-left: 3px; color: #5b625d; }
body .control-sidebar #ribbon-panel-formulas .formula-function-menu > summary:hover,
body .control-sidebar #ribbon-panel-formulas .formula-function-menu[open] > summary { background: #edf3ee; }
.formula-function-popup { position: fixed; z-index: 1251; top: 0; left: 0; display: grid; min-width: 150px; max-height: min(330px, 55vh); overflow: auto; gap: 1px; border: 1px solid #b8c8bb; border-radius: 6px; padding: 4px; background: #fff; box-shadow: 0 8px 24px #00150b30; }
.formula-function-popup button { min-height: 27px; border: 0; border-radius: 3px; padding: 5px 8px; color: #242424; background: transparent; text-align: left; cursor: pointer; font: 11px Arial, sans-serif; }
.formula-function-popup button:hover,
.formula-function-popup button:focus-visible { background: #eaf3ec; outline: none; }
.formula-function-empty { padding: 8px; color: #5b625d; font-size: 11px; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-control { position: relative; display: flex; height: 40px; flex: 0 0 auto; align-items: center; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-button { display: grid; width: 32px; height: 40px; place-items: center; border: 0; border-radius: 3px; color: #217346; background: transparent; cursor: pointer; font: 22px Arial, sans-serif; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-button:hover,
body .control-sidebar #ribbon-panel-formulas .formula-autosum-menu > summary:hover { background: #edf3ee; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-menu { position: relative; height: 40px; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-menu > summary { display: grid; width: 17px; height: 40px; place-items: center; border-radius: 3px; color: #242424; cursor: pointer; font: 9px Arial, sans-serif; list-style: none; }
body .control-sidebar #ribbon-panel-formulas .formula-autosum-menu > summary::-webkit-details-marker { display: none; }
body .control-sidebar #ribbon-panel-home .home-autosum-control { display: flex; width: 100%; min-height: 36px; align-items: center; border: 1px solid #c8d6cb; border-radius: 4px; background: #fff; }
body .control-sidebar #ribbon-panel-home .home-autosum-control .formula-autosum-button { width: 40px; height: 36px; color: #217346; font-size: 20px; }
body .control-sidebar #ribbon-panel-home .home-autosum-control .formula-autosum-menu { height: 36px; }
body .control-sidebar #ribbon-panel-home .home-autosum-control .formula-autosum-menu > summary { height: 36px; }
.formula-autosum-popup { position: absolute; z-index: 1250; top: calc(100% + 4px); left: 0; display: grid; min-width: 150px; gap: 2px; border: 1px solid #b8c8bb; border-radius: 6px; padding: 5px; background: #fff; box-shadow: 0 8px 24px #00150b30; }
.formula-autosum-popup button { min-height: 29px; border: 0; border-radius: 3px; padding: 5px 8px; color: #242424; background: transparent; text-align: left; cursor: pointer; font: 12px Arial, sans-serif; }
.formula-autosum-popup button:hover { background: #eaf3ec; }
body .control-sidebar #ribbon-panel-formulas .formula-ribbon-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
body .control-sidebar #ribbon-panel-formulas .formula-ribbon-actions .action-button { min-height: 31px; padding: 5px 9px; font-size: 10px; }
body .control-sidebar #ribbon-panel-formulas .formula-toggle { display: flex; align-items: center; gap: 5px; color: var(--deep); white-space: nowrap; font-size: 10px; }
body .control-sidebar #ribbon-panel-formulas .formula-toggle input { margin: 0; }
body .control-sidebar #ribbon-panel-formulas .formula-library-section,
body .control-sidebar #ribbon-panel-formulas .formula-names-section,
body .control-sidebar #ribbon-panel-formulas .formula-audit-section { min-height: 82px; padding-bottom: 14px; }
body .control-sidebar #ribbon-panel-formulas .formula-library-section::after,
body .control-sidebar #ribbon-panel-formulas .formula-names-section::after,
body .control-sidebar #ribbon-panel-formulas .formula-audit-section::after { position: absolute; right: 0; bottom: 0; left: 0; padding-top: 3px; border-top: 1px solid #c2d9c7; color: #69766c; text-align: center; font-size: 9px; }
body .control-sidebar #ribbon-panel-formulas .formula-library-section::after { content: "Function Library"; }
body .control-sidebar #ribbon-panel-formulas .formula-names-section::after { content: "Defined Names"; }
body .control-sidebar #ribbon-panel-formulas .formula-audit-section::after { content: "Formula Auditing"; }
body .control-sidebar #ribbon-panel-formulas .formula-library-section,
body .control-sidebar #ribbon-panel-formulas .formula-names-section,
body .control-sidebar #ribbon-panel-formulas .formula-audit-section { border-right: 1px solid #d4ddd6; padding-right: 12px; }
.formula-audit-menu { position: relative; }
.formula-audit-menu > summary { display: flex; min-height: 31px; align-items: center; gap: 5px; border: 1px solid #d1d8d3; border-radius: 5px; padding: 5px 8px; color: var(--deep); background: #fff; cursor: pointer; font-size: 10px; list-style: none; }
.formula-audit-menu > summary::-webkit-details-marker { display: none; }
.formula-audit-popup { position: absolute; z-index: 1250; top: calc(100% + 5px); left: 0; display: grid; min-width: 180px; gap: 5px; border: 1px solid #b8c8bb; border-radius: 6px; padding: 8px; background: #fff; box-shadow: 0 8px 24px #00150b30; }
.formula-audit-popup .action-button { width: 100%; text-align: left; }
.formula-audit-popup .formula-audit-output { white-space: normal; }
.formula-calculation-section #calculation-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.insert-function-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #b8c8bb;
  border-radius: 6px;
  padding: 24px;
  color: #242424;
  background: #fff;
  box-shadow: 0 18px 54px #00150b40;
  font: 13px Arial, sans-serif;
}
.save-as-dialog {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid #b8c8bb;
  border-radius: 6px;
  padding: 24px;
  color: #242424;
  background: #fff;
  box-shadow: 0 18px 54px #00150b40;
  font: 13px Arial, sans-serif;
}
.save-as-dialog::backdrop { background: #07150c66; }
.save-as-dialog form { float: right; }
.save-as-dialog .dialog-close {
  width: 28px;
  height: 28px;
  border: 1px solid #c8d0ca;
  border-radius: 4px;
  color: #303a33;
  background: #fff;
  font-size: 19px;
  cursor: pointer;
}
.save-as-dialog h2 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.save-as-dialog > p { color: #505a53; line-height: 1.45; }
.save-as-dialog > .control-label { display: grid; gap: 6px; margin: 16px 0; color: #424a44; font-size: 12px; }
.save-as-dialog .sidebar-input { min-height: 34px; border: 1px solid #b7c1ba; border-radius: 3px; padding: 6px 8px; color: #242424; background: #fff; font: 13px Arial, sans-serif; }
.save-as-dialog #save-as-status { min-height: 1.2em; color: #8b3026; }
.save-as-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.insert-function-dialog::backdrop { background: #07150c66; }
.insert-function-dialog form { float: right; }
.insert-function-dialog .dialog-close {
  width: 28px;
  height: 28px;
  border: 1px solid #c8d0ca;
  border-radius: 4px;
  color: #303a33;
  background: #fff;
  font-size: 19px;
  cursor: pointer;
}
.insert-function-dialog h2 { margin: 0 0 18px; font-size: 18px; font-weight: 600; }
.insert-function-dialog > .control-label { display: grid; gap: 6px; margin: 12px 0; color: #424a44; font-size: 12px; }
.insert-function-dialog .sidebar-input { min-height: 34px; border: 1px solid #b7c1ba; border-radius: 3px; padding: 6px 8px; color: #242424; background: #fff; font: 13px Arial, sans-serif; }
.insert-function-browser { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .8fr); min-height: 240px; border: 1px solid #c8d0ca; }
.insert-function-list-wrap { min-width: 0; padding: 10px; }
.insert-function-list-label { margin: 0 0 6px; color: #505a53; font-size: 11px; }
.insert-function-list { max-height: 210px; overflow: auto; }
.insert-function-option { display: block; width: 100%; min-height: 27px; border: 0; border-radius: 2px; padding: 5px 7px; color: #242424; background: transparent; text-align: left; font: 12px Arial, sans-serif; cursor: pointer; }
.insert-function-option:hover, .insert-function-option[aria-selected="true"] { color: #174c2a; background: #e7f2e9; }
.insert-function-empty { margin: 10px 0; color: #616b64; font-size: 12px; }
.insert-function-details { align-self: stretch; border-left: 1px solid #d7ddd8; padding: 16px; background: #fafbfa; }
.insert-function-details strong { color: #174c2a; font-size: 14px; }
.insert-function-details p { min-height: 42px; margin: 12px 0; color: #424a44; line-height: 1.45; }
.insert-function-details code { display: block; overflow-wrap: anywhere; color: #404a43; font: 11px Consolas, monospace; }
.insert-function-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.insert-function-footer .action-button { min-width: 76px; min-height: 32px; border: 1px solid #b8c1bb; border-radius: 3px; padding: 6px 12px; color: #242424; background: #fff; cursor: pointer; font: 12px Arial, sans-serif; }
.insert-function-footer #insert-function-confirm { border-color: #217346; color: #fff; background: #217346; }
.formula-autocomplete {
  position: fixed;
  z-index: 1200;
  display: grid;
  max-height: min(260px, 42vh);
  overflow: auto;
  border: 1px solid #aeb9b1;
  border-radius: 3px;
  padding: 3px;
  color: #242424;
  background: #fff;
  box-shadow: 0 4px 14px #0002;
  font: 12px Arial, sans-serif;
}
.formula-autocomplete[hidden] { display: none !important; }
.formula-autocomplete-option {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  width: 100%;
  min-height: 28px;
  border: 0;
  border-radius: 2px;
  padding: 5px 7px;
  color: #242424;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.formula-autocomplete-option:hover,
.formula-autocomplete-option[aria-selected="true"] { background: #eaf3ec; }
.formula-autocomplete-option strong { color: #174c2a; font-size: 12px; }
.formula-autocomplete-option span { overflow: hidden; color: #5b625d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.formula-argument-help {
  position: fixed;
  z-index: 1190;
  display: grid;
  gap: 5px;
  border: 1px solid #aeb9b1;
  border-radius: 3px;
  padding: 8px 10px;
  color: #242424;
  background: #fff;
  box-shadow: 0 4px 14px #0002;
  font: 12px Arial, sans-serif;
}
.formula-argument-help[hidden] { display: none !important; }
.formula-argument-help strong { color: #174c2a; }
.formula-argument-help code { overflow-wrap: anywhere; font: 11px Consolas, monospace; }
.formula-argument-help .active-argument { border-radius: 2px; outline: 1px solid #217346; background: #eaf3ec; }
.formula-argument-help > span { color: #5b625d; font-size: 11px; }
@media (max-width: 540px) {
  .insert-function-dialog, .save-as-dialog { padding: 18px; }
  .insert-function-browser { grid-template-columns: 1fr; }
  .insert-function-details { border-top: 1px solid #d7ddd8; border-left: 0; }
}
.grid-cell.formula-display-cell { width: max-content; min-width: 100%; max-width: none; overflow: visible; z-index: 4; background: var(--white); }
.name-manager-dialog { width: min(660px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 32px)); overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 24px; color: var(--deep); background: var(--white); box-shadow: 0 20px 60px #00150b45; }
.name-manager-dialog::backdrop { background: #07150c80; }
.name-manager-dialog form { float: right; }
.name-manager-dialog .dialog-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--green); font-size: 20px; cursor: pointer; }
.name-manager-dialog h2 { margin: 0 0 18px; font-size: 18px; }
.name-manager-content { display: grid; grid-template-columns: minmax(170px, .8fr) minmax(260px, 1.2fr); gap: 18px; clear: both; }
.name-manager-list-panel { display: flex; min-width: 0; flex-direction: column; gap: 7px; color: var(--deep); font-size: 12px; }
.name-manager-list-panel select { width: 100%; min-height: 218px; border: 1px solid var(--line); border-radius: 6px; padding: 5px; color: var(--deep); background: var(--white); }
.name-manager-actions { display: flex; gap: 7px; }
.name-manager-dialog .name-manager-fields { display: grid; align-content: start; gap: 12px; }
.name-manager-dialog .control-label { color: var(--deep); font-size: 12px; }
.name-manager-dialog .sidebar-input { min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--deep); background: var(--white); }
.name-manager-dialog #name-manager-status { min-height: 18px; color: var(--muted); font-size: 11px; }
.name-manager-dialog .action-button { min-height: 32px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; color: var(--deep); background: var(--white); cursor: pointer; }
.name-manager-dialog .action-button:hover:not(:disabled) { border-color: var(--green); background: var(--pale); }
.name-manager-dialog .action-button:disabled { opacity: .5; cursor: default; }
.name-manager-dialog #name-manager-save { border-color: var(--green); color: var(--white); background: var(--green); }
@media (max-width: 560px) { .name-manager-content { grid-template-columns: 1fr; } .name-manager-list-panel select { min-height: 120px; } }
html.workbook-route body .home-clipboard-button:hover,
html.workbook-route body .home-clipboard-button:focus-visible,
html.workbook-route body .home-clipboard-button[aria-pressed="true"] { border-color: #c6dfcd; background: #eff7f1; outline: none; }

/* Use Excel's group captions at the bottom of the Home ribbon. */
html.workbook-route body #ribbon-panel-home .control-section {
  padding-bottom: 15px;
}
html.workbook-route body #ribbon-panel-home .control-section::after {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 11px;
  border-top: 1px solid #d9d9d9;
  color: #666;
  content: attr(aria-label);
  font: 9px/10px "Segoe UI", Arial, sans-serif;
  text-align: center;
  pointer-events: none;
}

/* Keep Excel's primary Home commands visible on desktop-sized viewports. */
@media (min-width: 1100px) {
  html.workbook-route body #ribbon-panel-home {
    gap: 4px;
    overflow-x: auto;
    scroll-snap-type: none;
  }
  html.workbook-route body #ribbon-panel-home > .control-section {
    box-sizing: border-box;
    min-width: 0;
    max-width: none;
    height: 94px;
    min-height: 94px;
    max-height: 94px;
    flex: 0 0 auto;
    align-content: center;
    align-items: center;
    overflow: hidden;
    gap: 3px 4px;
    padding: 4px 4px 15px;
    border-radius: 0;
    box-shadow: none;
  }
  html.workbook-route body #ribbon-panel-home > .control-section > h2 { display: none; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(1) { width: 150px; flex: 0 0 150px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(2) { width: 215px; flex: 0 0 215px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) { width: 166px; flex: 0 0 166px; }
  html.workbook-route body #ribbon-panel-home > .home-number-section { width: 174px; }
  html.workbook-route body #ribbon-panel-home > .home-styles-section {
    width: 150px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] {
    display: grid;
    width: 176px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 2px 4px;
  }
  html.workbook-route body #ribbon-panel-home > .find-select-section { width: 82px; flex: 0 0 82px; padding-inline: 5px; }
  html.workbook-route body #ribbon-panel-home .home-clipboard-actions { width: 100%; gap: 4px; }
  html.workbook-route body #ribbon-panel-home .home-paste-button { min-width: 62px; min-height: 73px; font-size: 10px; }
  html.workbook-route body #ribbon-panel-home .home-paste-button > span { font-size: 23px; }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary { min-width: 0; gap: 1px; }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary .home-clipboard-button { min-height: 23px; gap: 3px; padding: 2px 3px; font-size: 9px; }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary .home-clipboard-button > span { width: 13px; font-size: 12px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls { width: 100%; gap: 5px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls > .control-label:first-child { min-width: 0; flex: 1 1 auto; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls > .control-label:last-child { width: 48px; flex: 0 0 48px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls select { width: 100%; min-width: 0; }
  html.workbook-route body #ribbon-panel-home .home-font-section .format-row { width: 100%; gap: 3px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .format-row .format-button { width: 25px; min-width: 25px; flex: 0 0 25px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .color-select-wrap { min-width: 0; flex: 1 1 34px; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section .alignment-row {
    width: 100%;
    min-width: 0;
    height: 25px;
    min-height: 25px;
    flex-wrap: nowrap !important;
    gap: 3px;
    margin: 0;
  }
  html.workbook-route body #ribbon-panel-home .home-alignment-section .alignment-row .format-button { width: 24px; min-width: 24px; height: 24px; flex: 0 0 24px; padding: 2px; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section #merge-center { width: auto; min-width: 88px; height: 24px; flex: 1 1 auto; padding: 2px 5px; font-size: 9px; white-space: nowrap; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section #merge-menu { width: 22px; min-width: 22px; height: 24px; flex: 0 0 22px; padding: 2px; }
  html.workbook-route body #ribbon-panel-home #wrap-text { min-width: 0; min-height: 23px; margin: 0; padding: 3px 5px; font-size: 9px; }
  html.workbook-route body #ribbon-panel-home .home-number-section > .control-label { width: 100%; min-width: 0; margin: 0; gap: 2px; font-size: 9px; }
  html.workbook-route body #ribbon-panel-home .home-number-section #number-format { width: 100%; min-width: 0; min-height: 25px; padding: 3px 5px; }
  html.workbook-route body #ribbon-panel-home .home-number-section .number-format-actions { width: 100%; min-width: 0; height: 25px; min-height: 25px; gap: 3px; margin: 0; }
  html.workbook-route body #ribbon-panel-home .home-number-section .number-format-actions .format-button { width: 23px; min-width: 23px; height: 24px; flex: 0 0 23px; padding: 2px; font-size: 10px; }
  html.workbook-route body #ribbon-panel-home .home-styles-section .ribbon-command-menu { width: 100%; min-width: 0; }
  html.workbook-route body #ribbon-panel-home .home-styles-section .ribbon-command-menu > summary { width: 100%; min-width: 0; min-height: 25px; justify-content: space-between; padding: 3px 6px; font-size: 10px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .button-pair { grid-column: 1 / -1; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .clear-command-menu { grid-column: 1; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .sheet-command-menu { grid-column: 2; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .button-pair { display: flex; width: 100%; gap: 3px; margin: 0; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .action-button { min-width: 0; min-height: 23px; flex: 1 1 0; padding: 2px 4px; font-size: 9px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .button-pair { min-height: 20px; gap: 2px; margin: 0; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] > .sheet-actions { margin: 0; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .action-button { min-height: 20px; padding: 1px 3px; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .ribbon-command-menu { min-width: 0; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .ribbon-command-menu > summary { min-width: 0; min-height: 20px; padding: 2px 4px; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .sheet-command-menu > summary { max-width: 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] > .control-label:nth-of-type(1),
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] > .replace-input-label { display: flex; flex-direction: row; align-items: center; gap: 3px; width: 100%; min-width: 0; margin: 0; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] > .control-label:nth-of-type(1) { grid-column: 1; grid-row: 1; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] > .search-actions { display: contents; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #find-next,
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #replace-one { width: 40px; min-width: 0; min-height: 23px; padding: 2px 3px; font-size: 12px; white-space: nowrap; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #find-next { grid-column: 2; grid-row: 1; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #find-next span,
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #replace-one span { display: none; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] > .replace-input-label { grid-column: 1; grid-row: 2; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #replace-one { grid-column: 2; grid-row: 2; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] #replace-all { grid-column: 1 / -1; grid-row: 3; width: 100%; min-width: 0; min-height: 23px; padding: 2px 5px; font-size: 9px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Find & replace"] .sidebar-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 23px; height: 23px; padding: 2px 5px; }
}
/* Keep the Home ribbon controls inside their groups at desktop widths. */
@media (min-width: 1100px) {
  html.workbook-route body #ribbon-panel-home > .control-section {
    align-content: center;
    align-items: center;
    overflow: hidden;
  }

  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(1) { width: 130px; flex: 0 0 130px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(2) { width: 390px; flex: 0 0 390px; flex-flow: row nowrap; gap: 4px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(3) { width: 182px; flex: 0 0 182px; flex-flow: column nowrap; gap: 1px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(4) { width: 144px; flex: 0 0 144px; }
  html.workbook-route body #ribbon-panel-home > .control-section:nth-of-type(5) { width: 142px; flex: 0 0 142px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] { width: 170px; flex: 0 0 170px; }
  html.workbook-route body #ribbon-panel-home > .find-select-section { width: 82px; flex: 0 0 82px; }

  html.workbook-route body #ribbon-panel-home .home-clipboard-actions {
    width: 100%;
    height: 75px;
    min-height: 75px;
    align-items: center;
    gap: 4px;
  }
  html.workbook-route body #ribbon-panel-home .home-paste-button {
    width: 62px;
    min-width: 62px;
    height: 72px;
    min-height: 72px;
    flex: 0 0 62px;
    font-size: 9px;
  }
  html.workbook-route body #ribbon-panel-home .home-paste-button > span { font-size: 22px; }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary {
    width: 56px;
    height: 72px;
    grid-template-rows: repeat(4, 18px);
    gap: 0;
  }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary .home-clipboard-button {
    width: 56px;
    min-width: 0;
    height: 18px;
    min-height: 18px;
    gap: 2px;
    padding: 1px 2px;
    font-size: 8px;
  }
  html.workbook-route body #ribbon-panel-home .home-clipboard-secondary .home-clipboard-button > span { width: 12px; font-size: 11px; }

  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls {
    width: 162px;
    min-width: 162px;
    flex: 0 0 162px;
    flex-direction: row;
    gap: 4px;
  }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls > .control-label {
    min-width: 0;
    margin: 0;
    flex-direction: row;
    align-items: center;
    gap: 0;
    color: transparent;
    font-size: 0;
    line-height: 0;
  }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls > .control-label:first-child { width: 108px; flex: 0 0 108px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls > .control-label:last-child { width: 50px; flex: 0 0 50px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .two-controls select {
    width: 100%;
    min-width: 0;
    height: 28px;
    min-height: 28px;
    padding: 3px 4px;
    color: #242424 !important;
    font-size: 10px;
    line-height: normal;
  }
  html.workbook-route body #ribbon-panel-home .home-font-section .format-row {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 2px;
    margin: 0;
  }
  html.workbook-route body #ribbon-panel-home .home-font-section .format-row .format-button { width: 24px; min-width: 24px; height: 26px; min-height: 26px; flex: 0 0 24px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .color-palette-menu { width: 52px; min-width: 52px; flex: 0 0 52px; }
  html.workbook-route body #ribbon-panel-home .home-font-section .color-palette-menu > summary { width: 52px; min-width: 52px; }
  html.workbook-route body #ribbon-panel-home .home-font-section [data-color-menu="fill"] { order: 1; }
  html.workbook-route body #ribbon-panel-home .home-font-section [data-color-menu="font"] { order: 2; }

  html.workbook-route body #ribbon-panel-home .home-alignment-section .alignment-row {
    width: 100%;
    min-width: 0;
    height: 23px;
    min-height: 23px;
    flex-wrap: nowrap !important;
    gap: 2px;
    margin: 0;
  }
  html.workbook-route body #ribbon-panel-home .home-alignment-section .alignment-row .format-button { height: 23px; min-height: 23px; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section #merge-center { width: 80px; min-width: 80px; flex: 0 0 80px; padding-inline: 3px; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section #merge-menu { width: 22px; min-width: 22px; flex: 0 0 22px; }
  html.workbook-route body #ribbon-panel-home .home-alignment-section #wrap-text { width: auto; min-width: 0; min-height: 23px; height: 23px; flex: 1 1 auto; padding: 2px 3px; font-size: 8px; white-space: nowrap; }

  html.workbook-route body #ribbon-panel-home .home-number-section > .control-label { width: 100%; min-width: 0; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home .home-number-section #number-format { width: 100%; min-width: 0; font-size: 10px; }

  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 20px repeat(3, 17px);
    align-content: center;
    gap: 1px 3px;
  }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .home-autosum-control { height: 20px; min-height: 20px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .home-autosum-control .formula-autosum-button,
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .home-autosum-control .formula-autosum-menu,
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .home-autosum-control .formula-autosum-menu > summary { height: 20px; min-height: 20px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .ribbon-command-menu > summary { min-height: 17px; height: 17px; padding: 1px 3px; font-size: 8px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .button-pair,
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .sheet-actions { height: 17px; min-height: 17px; }
  html.workbook-route body #ribbon-panel-home > .control-section[aria-label="Editing"] .action-button { height: 17px; min-height: 17px; padding: 1px 2px; font-size: 8px; }
}

/* Worksheet charts behave as floating objects anchored to cells. */
body .grid-viewport > .chart-dock {
  position: absolute; inset: 0 auto auto 0; z-index: 7;
  display: block; width: 0; height: 0; overflow: visible;
  padding: 0; border: 0; background: transparent; pointer-events: none;
}
body .grid-viewport > .chart-dock[hidden] { display: none; }
body .grid-viewport > .chart-dock > .chart-card {
  position: absolute; display: flex; flex-direction: column;
  min-width: 320px; max-width: none; min-height: 200px; max-height: none;
  width: 528px; height: 300px; padding: 8px 10px 12px;
  overflow: hidden; resize: none; pointer-events: auto;
  background: #fff; border: 1px solid #217346; border-radius: 2px;
  box-shadow: 0 2px 7px #0002;
}
body .grid-viewport > .chart-dock > .chart-card.chart-selected {
  outline: 2px solid #0f6cbd; outline-offset: 1px;
}
body .grid-viewport > .chart-dock > .chart-card:focus-visible {
  outline: 2px solid #0f6cbd; outline-offset: 1px;
}
body .grid-viewport > .chart-dock > .chart-card[hidden] { display: none; }
body .grid-viewport > .chart-dock .chart-heading {
  flex: none; min-height: 26px; margin-bottom: 4px;
  cursor: move; touch-action: none; user-select: none;
}
body .grid-viewport > .chart-dock .chart-card svg {
  flex: 1; min-height: 0; height: auto; width: 100%;
}
body .grid-viewport > .chart-dock .chart-resize-handle {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  padding: 0; border: 0; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 42%, #217346 44% 50%, transparent 52% 63%, #217346 65% 71%, transparent 73%);
}
body .grid-viewport > .chart-dock .chart-dragging { opacity: .88; }
/* Text boxes are floating worksheet objects anchored to a cell. */
body .grid-viewport > .drawing-dock {
  position: absolute; inset: 0 auto auto 0; z-index: 8;
  display: block; width: 0; height: 0; overflow: visible;
  padding: 0; border: 0; background: transparent; pointer-events: none;
}
body .grid-viewport > .drawing-dock[hidden] { display: none; }
body .grid-viewport > .drawing-dock > .text-box-card {
  position: absolute; display: flex; flex-direction: column; box-sizing: border-box;
  min-width: 100px; min-height: 48px; max-width: none; max-height: none;
  padding: 3px 5px 5px; overflow: hidden; resize: none; pointer-events: auto;
  background: #fff; border: 1px solid #8c8c8c; border-radius: 1px;
  box-shadow: 0 1px 3px #0002;
}
body .grid-viewport > .drawing-dock > .text-box-card.text-box-selected,
body .grid-viewport > .drawing-dock > .text-box-card:focus-visible {
  outline: 2px solid #0f6cbd; outline-offset: 1px; border-color: #0f6cbd;
}
body .grid-viewport > .drawing-dock .text-box-heading {
  display: flex; align-items: center; justify-content: space-between;
  flex: none; min-height: 16px; margin-bottom: 2px;
}
body .grid-viewport > .drawing-dock .text-box-drag-handle {
  flex: 1; height: 13px; cursor: move; touch-action: none; user-select: none;
  color: #666; font-size: 9px; line-height: 13px;
}
body .grid-viewport > .drawing-dock .text-box-remove {
  flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 2px;
  background: transparent; color: #444; font-size: 16px; line-height: 16px; cursor: pointer;
}
body .grid-viewport > .drawing-dock .text-box-remove:hover { background: #f2f2f2; }
body .grid-viewport > .drawing-dock .text-box-content {
  flex: 1; min-width: 0; min-height: 0; width: 100%; height: 100%; box-sizing: border-box;
  padding: 2px; border: 0; outline: 0; resize: none; background: transparent;
  color: #242424; font: 14px/1.35 Aptos, Calibri, Arial, sans-serif; white-space: pre-wrap;
}
body .grid-viewport > .drawing-dock .text-box-content:disabled { color: #242424; opacity: 1; }
body .grid-viewport > .drawing-dock .text-box-resize-handle {
  position: absolute; right: 0; bottom: 0; width: 13px; height: 13px;
  padding: 0; border: 0; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 44%, #777 46% 51%, transparent 53% 64%, #777 66% 71%, transparent 73%);
}
body .grid-viewport > .drawing-dock > .shape-card {
  position: absolute; box-sizing: border-box; min-width: 40px; min-height: 30px;
  overflow: visible; padding: 0; border: 1px solid transparent; background: transparent;
  pointer-events: auto; touch-action: none;
}
body .grid-viewport > .drawing-dock > .shape-card.shape-selected,
body .grid-viewport > .drawing-dock > .shape-card:focus-visible {
  outline: 2px solid #0f6cbd; outline-offset: 2px;
}
body .grid-viewport > .drawing-dock .worksheet-shape-visual {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
}
body .grid-viewport > .drawing-dock .shape-heading {
  position: absolute; z-index: 2; top: -21px; left: 0; right: 0; height: 20px;
  display: none; align-items: center; gap: 3px; padding: 1px 3px; box-sizing: border-box;
  border: 1px solid #0f6cbd; background: #fff; touch-action: none; user-select: none;
}
body .grid-viewport > .drawing-dock .shape-selected .shape-heading,
body .grid-viewport > .drawing-dock .shape-card:focus-visible .shape-heading { display: flex; }
body .grid-viewport > .drawing-dock .shape-drag-handle {
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: #444; font: 10px/16px Aptos, Calibri, Arial, sans-serif; cursor: move;
}
body .grid-viewport > .drawing-dock .shape-remove {
  flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 2px;
  background: transparent; color: #444; font-size: 16px; line-height: 16px; cursor: pointer;
}
body .grid-viewport > .drawing-dock .shape-remove:hover { background: #f2f2f2; }
body .grid-viewport > .drawing-dock .shape-resize-handle {
  position: absolute; z-index: 2; right: -7px; bottom: -7px; width: 13px; height: 13px;
  display: none; padding: 0; border: 1px solid #0f6cbd; border-radius: 50%;
  background: #fff; cursor: nwse-resize; touch-action: none;
}
body .grid-viewport > .drawing-dock .shape-selected .shape-resize-handle,
body .grid-viewport > .drawing-dock .shape-card:focus-visible .shape-resize-handle { display: block; }
body .grid-viewport > .drawing-dock > .picture-card {
  position: absolute; box-sizing: border-box; min-width: 24px; min-height: 24px;
  border: 1px solid transparent; overflow: visible; pointer-events: auto; touch-action: none;
}
body .grid-viewport > .drawing-dock > .picture-card.picture-selected,
body .grid-viewport > .drawing-dock > .picture-card:focus-visible { outline: 2px solid #0f6cbd; outline-offset: 2px; }
body .grid-viewport > .drawing-dock .worksheet-picture {
  display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; pointer-events: none;
}
body .grid-viewport > .drawing-dock .picture-heading {
  position: absolute; z-index: 3; top: -21px; left: 0; right: 0; height: 20px;
  display: none; align-items: center; gap: 3px; padding: 1px 3px; box-sizing: border-box;
  border: 1px solid #0f6cbd; background: #fff; touch-action: none; user-select: none;
}
body .grid-viewport > .drawing-dock .picture-selected .picture-heading,
body .grid-viewport > .drawing-dock .picture-card:focus-visible .picture-heading { display: flex; }
body .grid-viewport > .drawing-dock .picture-drag-handle {
  flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  color: #444; font: 10px/16px Aptos, Calibri, Arial, sans-serif; cursor: move;
}
body .grid-viewport > .drawing-dock .picture-remove {
  flex: none; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 2px;
  background: transparent; color: #444; font-size: 16px; line-height: 16px; cursor: pointer;
}
body .grid-viewport > .drawing-dock .picture-remove:hover { background: #f2f2f2; }
body .grid-viewport > .drawing-dock .picture-resize-handle {
  position: absolute; z-index: 3; right: -7px; bottom: -7px; width: 13px; height: 13px;
  display: none; padding: 0; border: 1px solid #0f6cbd; border-radius: 50%; background: #fff; cursor: nwse-resize; touch-action: none;
}
body .grid-viewport > .drawing-dock .picture-selected .picture-resize-handle,
body .grid-viewport > .drawing-dock .picture-card:focus-visible .picture-resize-handle { display: block; }
.find-select-section { min-width: 92px; }
.find-select-section h2 { margin-bottom: 9px; }
.find-select-button { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 43px; padding: 5px 7px; border: 1px solid #c5dfcd; border-radius: 6px; background: #fff; color: var(--deep); font: 11px/1.15 Arial, sans-serif; cursor: pointer; }
.find-select-button:hover { border-color: var(--green); background: var(--pale); }
.find-select-button > span:first-child { color: var(--green); font-size: 23px; line-height: 1; }
.find-select-chevron { color: var(--muted); margin-left: auto; }
.find-select-menu { position: relative; min-width: 0; width: 100%; }
.find-select-menu-content { position: fixed; z-index: 1200; inset: auto; display: grid; width: 190px; padding: 4px; border: 1px solid #c9d2cc; border-radius: 3px; background: #fff; box-shadow: 0 8px 24px #0003; }
.find-select-menu-content button { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 5px 9px; border: 0; background: #fff; color: #242424; font: 12px Arial, sans-serif; text-align: left; cursor: pointer; }
.find-select-menu-content button:hover { background: #eef5ef; }
.find-select-menu-content kbd { border: 0; background: transparent; color: #777; font: 10px Arial, sans-serif; }
html.workbook-route body .find-select-menu { min-width: 0; width: 100%; }
html.workbook-route body .find-select-menu > summary.find-select-button { min-width: 0; width: 100%; min-height: 43px; justify-content: center; }
.find-replace-dialog { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 28px)); max-height: min(620px, calc(100vh - 28px)); overflow: auto; margin: 0; padding: 22px 24px 18px; border: 1px solid #d1d5d1; border-radius: 4px; color: #242424; background: #fff; box-shadow: 0 14px 42px #0003; font: 13px/1.4 Arial, sans-serif; }
.find-replace-dialog::backdrop { background: #0006; }
.find-replace-dialog > form { float: right; margin: -8px -8px 0 0; }
.find-replace-dialog .dialog-close { width: 29px; height: 29px; border: 0; border-radius: 2px; background: transparent; color: #505050; font: 22px Arial; cursor: pointer; }
.find-replace-dialog .dialog-close:hover { background: #eee; }
.find-replace-dialog h2 { margin: 0 36px 16px 0; color: #518866; font-size: 19px; font-weight: 600; }
.find-replace-tabs { display: flex; gap: 0; margin: 0 0 15px; border-bottom: 1px solid #d6d6d6; }
.find-replace-tabs button { position: relative; min-width: 76px; padding: 8px 14px 10px; border: 0; background: transparent; color: #444; font: 13px Arial; cursor: pointer; }
.find-replace-tabs button[aria-selected="true"] { color: #107c41; font-weight: 600; }
.find-replace-tabs button[aria-selected="true"]::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 3px; background: #107c41; content: ""; }
.find-dialog-label { display: grid; gap: 6px; margin: 0 0 13px; color: #333; font-size: 12px; }
.find-dialog-label .sidebar-input { width: 100%; height: 35px; border: 1px solid #8a8886; border-radius: 2px; color: #242424; font-size: 13px; }
.find-dialog-label .sidebar-input:focus { border-color: #107c41; box-shadow: 0 0 0 1px #107c41; }
.find-wildcard-help { margin: -7px 0 12px; color: #5d5d5d; font-size: 10px; line-height: 1.35; }
.find-dialog-options { margin: 1px 0 12px; }
.find-dialog-options summary { width: fit-content; color: #107c41; font-size: 12px; cursor: pointer; }
.find-dialog-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 16px; padding: 14px 0 4px; }
.find-dialog-option-grid > label:not(.find-dialog-checkbox) { display: grid; gap: 5px; font-size: 11px; }
.find-dialog-option-grid .sidebar-input { height: 30px; border: 1px solid #c8c8c8; border-radius: 2px; color: #242424; font-size: 12px; }
.find-dialog-checkbox { display: flex; align-items: center; gap: 7px; font-size: 11px; }
.find-dialog-checkbox input { margin: 0; accent-color: #107c41; }
.find-replace-panel[hidden] { display: none; }
.find-replace-dialog [hidden] { display: none !important; }
.find-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.find-dialog-actions .action-button { min-width: 84px; min-height: 33px; border: 1px solid #8a8886; border-radius: 2px; color: #242424; font-size: 12px; }
.find-dialog-actions .action-button.primary { border-color: #107c41; background: #107c41; color: #fff; }
.find-dialog-actions .action-button.primary:hover { border-color: #0b5d30; background: #0b5d30; }
.find-all-results { display: grid; max-height: 185px; overflow: auto; margin-top: 8px; border: 1px solid #e1e1e1; }
.find-all-results[hidden] { display: none; }
.find-all-result { overflow: hidden; padding: 7px 9px; border: 0; border-bottom: 1px solid #eee; background: #fff; color: #333; font: 11px Arial; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.find-all-result:hover { background: #eff6f0; }
.go-to-dialog { position: fixed; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 28px)); margin: 0; padding: 22px 25px 18px; border: 1px solid #d1d5d1; border-radius: 7px; color: #242424; background: #fff; box-shadow: 0 14px 42px #0003; font: 13px/1.4 Arial, sans-serif; }
.go-to-dialog::backdrop { background: #0006; }
.go-to-dialog > form { float: right; margin: -8px -8px 0 0; }
.go-to-dialog .dialog-close { width: 28px; height: 28px; border: 0; background: transparent; color: #518866; font: 22px Arial; cursor: pointer; }
.go-to-dialog h2 { margin: 0 30px 16px 0; color: #518866; font-size: 19px; font-weight: 600; }
.go-to-label { display: grid; gap: 6px; margin: 0 0 15px; color: #333; font-size: 12px; }
.go-to-label .sidebar-input { width: 100%; height: 34px; border: 1px solid #8a8886; border-radius: 2px; color: #242424; font-size: 12px; }
.go-to-label .sidebar-input:focus { border-color: #107c41; box-shadow: 0 0 0 1px #107c41; }
#go-to-error { display: block; min-height: 15px; color: #a4262c; font-size: 11px; }
.go-to-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.go-to-actions .action-button { min-width: 92px; min-height: 32px; border: 1px solid #8a8886; border-radius: 2px; color: #242424; font-size: 12px; }
#go-to-dialog #go-to-confirm { border-color: #107c41 !important; background-color: #107c41 !important; color: #fff !important; }
@media (max-width: 520px) { .find-replace-dialog { padding: 18px 16px 14px; } .find-dialog-option-grid { grid-template-columns: 1fr; } .find-dialog-actions { flex-wrap: wrap; } }

/* Match the current Excel web command surface: neutral ribbon, green selection accents. */
html.workbook-route {
  --deep: #242424;
  --green: #107c41;
  --leaf: #595959;
  --soft: #f3f2f1;
  --pale: #f3f2f1;
  --line: #e1dfdd;
  --excel-block-border: #107c41;
  --excel-grid-line: #e1dfdd;
  --brand-forest: #242424;
  --brand-green: #107c41;
  --brand-lime: #107c41;
  --brand-teal: #107c41;
  --accent: #107c41;
  --accent-strong: #0b5d30;
  --theme-surface: #f3f2f1;
  --panel: #f3f2f1;
  --theme-surface-soft: #f3f2f1;
  --panel-soft: #f3f2f1;
}
html.workbook-route body { color: #242424; background: #fff; accent-color: #107c41; }
html.workbook-route body .sheet-topline {
  border-color: #e1dfdd !important;
  background: #f3f2f1 !important;
}
html.workbook-route body .workbook-title,
html.workbook-route body .save-indicator,
html.workbook-route body .nav-button { color: #242424 !important; -webkit-text-fill-color: #242424 !important; }
html.workbook-route body .workbook-title:hover,
html.workbook-route body .workbook-title:focus { border-color: #c8c6c4 !important; background: #fff !important; }
html.workbook-route body .save-dot { background: #107c41 !important; box-shadow: 0 0 0 3px #107c4122 !important; }
html.workbook-route body .nav-button,
html.workbook-route body .home-nav-button { border-color: transparent !important; color: #444 !important; background: transparent !important; }
html.workbook-route body .nav-button:hover,
html.workbook-route body .nav-button:focus-visible,
html.workbook-route body .home-nav-button:hover,
html.workbook-route body .home-nav-button:focus-visible { border-color: transparent !important; color: #242424 !important; background: #e6e6e6 !important; }
html.workbook-route body #share-workbook { border-color: #107c41 !important; color: #fff !important; background: #107c41 !important; }
html.workbook-route body #share-workbook:hover { border-color: #0b5d30 !important; background: #0b5d30 !important; }
html.workbook-route body .ribbon-tabs,
html.workbook-route body .control-sidebar,
html.workbook-route body .ribbon-panel { border-color: #e1dfdd !important; background: #f3f2f1 !important; }
html.workbook-route body .ribbon-tabs { border-radius: 0 !important; }
html.workbook-route body .ribbon-tab { border-radius: 0 !important; color: #444 !important; -webkit-text-fill-color: #444 !important; background: transparent !important; }
html.workbook-route body .ribbon-tab:hover,
html.workbook-route body .ribbon-tab:focus-visible { color: #242424 !important; -webkit-text-fill-color: #242424 !important; background: #e6e6e6 !important; }
html.workbook-route body .ribbon-tab[aria-selected="true"] { border-bottom-color: #107c41 !important; color: #242424 !important; -webkit-text-fill-color: #242424 !important; background: #fff !important; }
html.workbook-route body #ribbon-panel-home { border: 0 !important; border-radius: 0 !important; background: #f3f2f1 !important; }
html.workbook-route body #ribbon-panel-home > .control-section { border-right: 1px solid #d6d6d6 !important; background: transparent !important; }
html.workbook-route body #ribbon-panel-home > .control-section::after { display: none !important; }
html.workbook-route body #ribbon-panel-home .control-label,
html.workbook-route body #ribbon-panel-home .control-label > span { color: #444 !important; }
html.workbook-route body #ribbon-panel-home select,
html.workbook-route body #ribbon-panel-home .sidebar-input { border-color: #c8c6c4 !important; border-radius: 2px !important; color: #242424 !important; background: #fff !important; }
html.workbook-route body #ribbon-panel-home .format-button,
html.workbook-route body #ribbon-panel-home .home-clipboard-button,
html.workbook-route body #ribbon-panel-home .action-button,
html.workbook-route body #ribbon-panel-home .ribbon-command-menu > summary,
html.workbook-route body #ribbon-panel-home .find-select-button { border-color: transparent !important; border-radius: 2px !important; color: #444 !important; background: transparent !important; }
html.workbook-route body #ribbon-panel-home .format-button:hover,
html.workbook-route body #ribbon-panel-home .home-clipboard-button:hover,
html.workbook-route body #ribbon-panel-home .action-button:hover,
html.workbook-route body #ribbon-panel-home .ribbon-command-menu > summary:hover,
html.workbook-route body #ribbon-panel-home .find-select-button:hover { border-color: transparent !important; color: #242424 !important; background: #e6e6e6 !important; }
html.workbook-route body #ribbon-panel-home .format-button.active,
html.workbook-route body #ribbon-panel-home .home-clipboard-button[aria-pressed="true"] { border-color: transparent !important; color: #107c41 !important; background: #e2f0e9 !important; }
html.workbook-route body #ribbon-panel-home .color-select-wrap { border-radius: 2px !important; color: #444 !important; }
html.workbook-route body #ribbon-panel-home .home-paste-button { border-color: transparent !important; }
html.workbook-route body .formula-bar { border-color: #d6d6d6 !important; background: #fff !important; }
html.workbook-route body .grid-viewport { border-color: #d6d6d6 !important; scrollbar-color: #c8c6c4 #f3f2f1 !important; }
html.workbook-route body .grid-cell.col-head,
html.workbook-route body .grid-cell.row-head,
html.workbook-route body .grid-cell.corner,
html.workbook-route body .grid-cell.row-head.frozen-row,
html.workbook-route body .grid-cell.col-head.frozen-col { color: #595959 !important; background: #f3f2f1 !important; }
html.workbook-route body .grid-cell.selected,
html.workbook-route body .grid-cell.range-selected:not(.selected) { box-shadow: inset 0 0 0 2px #107c41 !important; }
html.workbook-route body .grid-cell.selected::after,
html.workbook-route body .fill-handle { background-color: #107c41 !important; }
html.workbook-route body .sheet-tabs-row,
html.workbook-route body .statusbar { border-color: #e1dfdd !important; color: #605e5c !important; background: #fff !important; }
html.workbook-route body .sheet-tab,
html.workbook-route body .add-sheet,
html.workbook-route body .zoom-control,
html.workbook-route body .zoom-control span { color: #444 !important; }
html.workbook-route body .sheet-tab.active { border-radius: 0 !important; color: #242424 !important; box-shadow: 0 -2px 0 #107c41 inset !important; }
html.workbook-route body .sheet-tab:hover,
html.workbook-route body .add-sheet:hover { color: #242424 !important; background: #f3f2f1 !important; }
:where(html.workbook-route button, html.workbook-route input, html.workbook-route select, html.workbook-route textarea, html.workbook-route [role="gridcell"], html.workbook-route [role="tab"]):focus-visible { outline-color: #0f6cbd !important; }
@media (min-width: 1100px) {
  html.workbook-route body .control-sidebar:has(> #ribbon-panel-home:not([hidden])) {
    height: 84px; min-height: 84px; max-height: 84px; padding-bottom: 6px;
  }
  html.workbook-route body #ribbon-panel-home {
    height: 78px; min-height: 78px; max-height: 78px;
  }
  html.workbook-route body #ribbon-panel-home > .control-section {
    height: 78px; min-height: 78px; max-height: 78px; padding: 1px 4px;
  }
}

/* Excel's top command row keeps the workbook identity at left and Tell Me centered. */
html.workbook-route body .ribbon-quick-row {
  grid-template-columns: minmax(205px, 1fr) minmax(210px, 330px) auto;
  grid-template-rows: 28px 28px;
  column-gap: 14px;
}
html.workbook-route body .sheet-topline-main { grid-column: 1; grid-row: 1; }
html.workbook-route body .tell-me-search {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  display: flex;
  height: 25px;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid #d2d0ce;
  border-radius: 4px;
  color: #605e5c;
  background: #fff;
}
html.workbook-route body .tell-me-search:focus-within {
  border-color: #0f6cbd;
  box-shadow: 0 0 0 1px #0f6cbd;
}
html.workbook-route body .tell-me-search-icon { flex: none; font: 20px/1 Arial, sans-serif; }
html.workbook-route body #tell-me-search {
  width: 100%;
  min-width: 0;
  height: 22px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #242424;
  background: transparent;
  font: 11px Arial, sans-serif;
}
html.workbook-route body #tell-me-search::placeholder { color: #605e5c; opacity: 1; }
html.workbook-route body #tell-me-search::-webkit-search-cancel-button { cursor: pointer; }
html.workbook-route body .workbook-nav { grid-column: 3; grid-row: 1; }
html.workbook-route body .ribbon-tabs { grid-column: 1 / -1; grid-row: 2; }
html.workbook-route body .tell-me-results {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  left: 0;
  width: max(100%, 310px);
  max-height: min(360px, 55vh);
  overflow: auto;
  padding: 4px;
  border: 1px solid #d2d0ce;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 5px 18px #0002;
}
html.workbook-route body .tell-me-results[hidden] { display: none !important; }
html.workbook-route body .tell-me-result {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 10px;
  padding: 4px 9px;
  border: 0;
  border-radius: 3px;
  color: #242424;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: 11px Arial, sans-serif;
}
html.workbook-route body .tell-me-result:hover,
html.workbook-route body .tell-me-result[aria-selected="true"] { background: #f3f2f1; }
html.workbook-route body .tell-me-result-icon {
  width: 20px;
  color: #107c41;
  text-align: center;
  font-size: 15px;
}
html.workbook-route body .tell-me-empty { padding: 10px; color: #605e5c; font: 11px Arial, sans-serif; }
html.workbook-route body .share-ribbon-section { display: flex; align-items: center; gap: 14px; }
html.workbook-route body .share-ribbon-section h2 { flex: none; margin: 0; padding: 0; border: 0; }
html.workbook-route body .share-ribbon-description { max-width: 340px; margin: 0; color: #605e5c; font: 11px/1.4 Arial, sans-serif; }
html.workbook-route body #share-tab-open-dialog { min-height: 30px; padding: 5px 14px; border: 1px solid #107c41; border-radius: 2px; color: #fff; background: #107c41; font: 12px Arial, sans-serif; cursor: pointer; }
html.workbook-route body #share-tab-open-dialog:hover { border-color: #0b5d30; background: #0b5d30; }
html.workbook-route body .draw-ribbon-section { display: flex; align-items: stretch; gap: 0; }
html.workbook-route body .draw-tool-group { display: flex; align-items: center; gap: 6px; padding: 0 14px; border-right: 1px solid #d6d6d6; }
html.workbook-route body .draw-tool-group:first-child { padding-left: 0; }
html.workbook-route body .draw-tool-group:last-child { border-right: 0; }
html.workbook-route body .draw-tool-group h2 { align-self: flex-start; flex: none; margin: 2px 8px 0 0; padding: 0; border: 0; color: #616161; font: 11px/16px Arial, sans-serif; }
html.workbook-route body .draw-tool-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 54px; min-height: 54px; padding: 5px 7px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: #242424; font: 11px Arial, sans-serif; cursor: pointer; }
html.workbook-route body .draw-tool-button:hover { background: #f0f0f0; border-color: #d6d6d6; }
html.workbook-route body .draw-tool-button[aria-pressed="true"] { border-color: #107c41; background: #e8f3ec; }
html.workbook-route body .draw-tool-button > span[aria-hidden="true"] { font-size: 20px; line-height: 22px; }
html.workbook-route body .draw-tool-icon { width: 24px; height: 22px; position: relative; }
html.workbook-route body .draw-pen-icon::before { content: ""; position: absolute; width: 20px; height: 4px; top: 9px; left: 2px; border-radius: 4px; background: #1565c0; transform: rotate(-42deg); box-shadow: 2px 0 #fff; }
html.workbook-route body .draw-highlighter-icon::before { content: ""; position: absolute; width: 22px; height: 8px; top: 7px; left: 1px; border-radius: 2px; background: #f6d84c; transform: rotate(-42deg); }
html.workbook-route body .draw-color-control, html.workbook-route body .draw-size-control { display: flex; flex-direction: column; gap: 5px; color: #424242; font: 11px Arial, sans-serif; }
html.workbook-route body .draw-color-control input { width: 34px; height: 30px; padding: 2px; border: 1px solid #bdbdbd; border-radius: 2px; background: #fff; cursor: pointer; }
html.workbook-route body .draw-size-control input { width: 120px; accent-color: #107c41; }
html.workbook-route body .draw-size-control output { color: #616161; font-size: 10px; }
html.workbook-route body #worksheet-ink-overlay { position: fixed; z-index: 12; pointer-events: none; overflow: hidden; }
html.workbook-route body #grid-viewport[data-ink-tool="pen"], html.workbook-route body #grid-viewport[data-ink-tool="highlighter"] { cursor: crosshair; }
html.workbook-route body #grid-viewport[data-ink-tool="eraser"] { cursor: cell; }
html.workbook-route body #grid-viewport[data-ink-tool="pen"] #grid, html.workbook-route body #grid-viewport[data-ink-tool="highlighter"] #grid { user-select: none; }
@media (max-width: 800px) {
  html.workbook-route body .ribbon-quick-row { grid-template-columns: minmax(130px, 1fr) minmax(150px, 42vw) auto; column-gap: 5px; }
  html.workbook-route body .tell-me-search { padding-inline: 6px; }
  html.workbook-route body #tell-me-search { font-size: 10px; }
}

/* Align the workbook chrome with Excel's light ribbon and compact worksheet stack. */
html.workbook-route body .sheet-topline,
html.workbook-route body .app-ribbon,
html.workbook-route body .ribbon-quick-row {
  background: #ffffff;
}
html.workbook-route body .sheet-topline {
  border-bottom-color: #e5e5e5;
}
html.workbook-route body .ribbon-quick-row {
  scrollbar-color: #c8c6c4 #ffffff;
}
html.workbook-route body .ribbon-tabs {
  border-top: 1px solid #e5e5e5;
  background: #f5f5f5;
  scrollbar-color: #c8c6c4 #f5f5f5;
}
html.workbook-route body .ribbon-tab {
  min-width: 62px;
  color: #242424;
  font-size: 12px;
}
html.workbook-route body .ribbon-tab:hover,
html.workbook-route body .ribbon-tab:focus-visible {
  color: #242424;
  background: #eaeaea;
}
html.workbook-route body .ribbon-tab[aria-selected="true"] {
  border-bottom: 2px solid #107c41;
  color: #242424;
  background: #ffffff;
}
html.workbook-route body .control-sidebar {
  padding: 0 14px 5px;
  border-bottom-color: #e5e5e5;
  background: #ffffff;
}
html.workbook-route body .ribbon-panel {
  height: 66px;
  min-height: 66px;
  max-height: 66px;
  border-color: transparent;
  border-radius: 0;
  background: #ffffff;
}
html.workbook-route body .control-sidebar .control-section {
  height: 66px;
  max-height: 66px;
  padding: 4px 7px;
  background: #ffffff;
}
html.workbook-route body .formula-bar {
  border-bottom-color: #e5e5e5;
}
html.workbook-route body .control-sidebar .ribbon-panel {
  border-color: transparent;
  background: #ffffff;
}
@media (min-width: 1100px) {
  html.workbook-route body .control-sidebar:has(> #ribbon-panel-home:not([hidden])) {
    height: 72px;
    min-height: 72px;
    max-height: 72px;
  }
  html.workbook-route body #ribbon-panel-home {
    height: 66px;
    min-height: 66px;
    max-height: 66px;
  }
  html.workbook-route body #ribbon-panel-home > .control-section {
    height: 66px;
    min-height: 66px;
    max-height: 66px;
  }
}
html.workbook-route body .ribbon-tab[aria-selected="true"] {
  color: #242424 !important;
  background: #ffffff !important;
}
html.workbook-route body #ribbon-panel-home {
  background: #ffffff !important;
}
html.workbook-route body .help-ribbon-section {
  display: flex;
  width: max-content;
  min-width: max-content;
  align-items: stretch;
  gap: 0;
}
html.workbook-route body .help-ribbon-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  border-right: 1px solid #e1dfdd;
}
html.workbook-route body .help-ribbon-group:first-child { padding-left: 3px; }
html.workbook-route body .help-ribbon-group:last-child { border-right: 0; }
html.workbook-route body .help-ribbon-group h2 {
  align-self: flex-start;
  flex: none;
  margin: 2px 5px 0 0;
  padding: 0;
  border: 0;
  color: #616161;
  font: 11px/16px Arial, sans-serif;
}
html.workbook-route body .help-ribbon-group .page-layout-command {
  min-width: 82px;
  height: 54px;
  font-size: 11px;
}
html.workbook-route body .help-ribbon-group .page-layout-command > span:first-child { color: #107c41; }
html.workbook-route body .help-ribbon-tip p {
  max-width: 300px;
  margin: 0;
  color: #605e5c;
  font: 11px/1.4 Arial, sans-serif;
}
.keyboard-shortcuts-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #c8c6c4;
  border-radius: 8px;
  padding: 24px;
  color: #242424;
  background: #ffffff;
  box-shadow: 0 18px 48px #0003;
}
.keyboard-shortcuts-dialog::backdrop { background: #0005; }
.keyboard-shortcuts-dialog form { float: right; }
.keyboard-shortcuts-dialog .dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  color: #242424;
  background: #ffffff;
  font-size: 20px;
  cursor: pointer;
}
.keyboard-shortcuts-dialog h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.keyboard-shortcuts-description { margin: 0 0 18px; color: #605e5c; font-size: 12px; }
.keyboard-shortcuts-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; clear: both; }
.keyboard-shortcuts-list h3 { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid #e1dfdd; font-size: 13px; font-weight: 600; }
.keyboard-shortcuts-list dl { display: grid; gap: 8px; margin: 0; }
.keyboard-shortcuts-list dl > div { display: grid; grid-template-columns: minmax(100px, max-content) 1fr; gap: 12px; align-items: center; }
.keyboard-shortcuts-list dt { display: flex; flex-wrap: wrap; gap: 3px; }
.keyboard-shortcuts-list dd { margin: 0; color: #424242; font-size: 12px; }
.keyboard-shortcuts-list kbd { border-color: #c8c6c4; color: #242424; background: #f5f5f5; font: 11px "Segoe UI", Arial, sans-serif; }
@media (max-width: 560px) { .keyboard-shortcuts-list { grid-template-columns: 1fr; } }
.whats-new-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #c8c6c4;
  border-radius: 8px;
  padding: 24px;
  color: #242424;
  background: #ffffff;
  box-shadow: 0 18px 48px #0003;
}
.whats-new-dialog::backdrop { background: #0005; }
.whats-new-dialog form { float: right; }
.whats-new-dialog .dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  color: #242424;
  background: #ffffff;
  font-size: 20px;
  cursor: pointer;
}
.whats-new-dialog h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.whats-new-description { margin: 0 0 16px; color: #605e5c; font-size: 12px; }
.whats-new-list { display: grid; gap: 12px; margin: 0; padding-left: 20px; color: #424242; font-size: 12px; line-height: 1.5; }
.whats-new-list strong { color: #242424; }
.automate-ribbon-section {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
}
.automate-ribbon-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border-right: 1px solid #e1dfdd;
}
.automate-ribbon-group:first-child { padding-left: 3px; }
.automate-ribbon-group:last-child { border-right: 0; }
.automate-ribbon-group h2 {
  align-self: flex-start;
  flex: none;
  margin: 2px 5px 0 0;
  padding: 0;
  border: 0;
  color: #616161;
  font: 11px/16px Arial, sans-serif;
}
.automate-ribbon-group .page-layout-command {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  height: 32px;
  gap: 7px;
  padding: 4px 7px;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
}
.automate-ribbon-group .page-layout-command > span:first-child { color: #107c41; }
.automate-ribbon-group[aria-label="Scripts"] > .page-layout-command { width: 96px; }
.automate-ribbon-actions > .page-layout-command { width: 208px; }
.automate-ribbon-group[aria-label="Automation templates"] .page-layout-command { width: 170px; }
.automate-more-scripts { position: relative; display: flex; align-items: center; }
.automate-more-scripts > summary { list-style: none; cursor: pointer; }
.automate-more-scripts > summary::-webkit-details-marker { display: none; }
.automate-ribbon-group[aria-label="Scripts"] .automate-more-scripts > summary { box-sizing: border-box; width: 40px; min-width: 40px; max-width: 40px; padding: 4px; }
.automate-ribbon-actions .automate-more-scripts > summary { box-sizing: border-box; width: 26px; min-width: 26px; max-width: 26px; padding: 0; }
.automate-more-scripts-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 2px);
  left: 0;
  display: grid;
  min-width: 240px;
  padding: 4px;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 6px 18px #0002;
}
.automate-more-scripts-menu h3 { margin: 2px 8px 5px; color: #424242; font: 600 11px/20px Arial, sans-serif; }
.automate-more-scripts-menu button {
  min-height: 34px;
  border: 0;
  border-radius: 3px;
  padding: 6px 9px;
  color: #242424;
  background: transparent;
  text-align: left;
  font: 12px Arial, sans-serif;
  cursor: pointer;
}
.automate-more-scripts-menu button:hover { background: #f3f8f4; }
.automation-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #c8c6c4;
  border-radius: 8px;
  padding: 24px;
  color: #242424;
  background: #ffffff;
  box-shadow: 0 18px 48px #0003;
}
.automation-dialog::backdrop { background: #0005; }
.automation-dialog form { float: right; }
.automation-dialog .dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid #c8c6c4;
  border-radius: 4px;
  color: #242424;
  background: #ffffff;
  font-size: 20px;
  cursor: pointer;
}
.automation-dialog h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.automation-dialog-description { margin: 0 0 16px; color: #605e5c; font-size: 12px; line-height: 1.45; }
.automation-script-name-label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; }
.automation-script-name { box-sizing: border-box; width: 100%; height: 34px; margin-bottom: 16px; border: 1px solid #8a8886; border-radius: 3px; padding: 6px 8px; font: 13px Arial, sans-serif; }
.automation-action-list { display: grid; gap: 9px; margin: 0; border: 1px solid #e1dfdd; border-radius: 5px; padding: 12px; }
.automation-action-list legend { padding: 0 5px; color: #424242; font-size: 12px; font-weight: 600; }
.automation-action-list label { display: flex; align-items: center; gap: 8px; color: #242424; font-size: 12px; }
.automation-action-list input { accent-color: #217346; }
.automation-dialog-status { min-height: 16px; margin: 8px 0 0; color: #a4262c; font-size: 12px; }
.automation-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.automation-script-list { display: grid; gap: 8px; }
.automation-empty-state { margin: 0; border: 1px solid #e1dfdd; border-radius: 5px; padding: 16px; color: #605e5c; text-align: center; font-size: 12px; }
.automation-script-row { display: flex; align-items: center; gap: 6px; border: 1px solid #e1dfdd; border-radius: 5px; padding: 8px; }
.automation-script-details { display: grid; flex: 1; gap: 3px; min-width: 0; }
.automation-script-details strong { overflow: hidden; color: #242424; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.automation-script-details span { color: #605e5c; font-size: 11px; }
.automation-template-list { display: grid; gap: 6px; }
.automation-template-list button { min-height: 36px; border: 1px solid #e1dfdd; border-radius: 4px; padding: 7px 10px; color: #242424; background: #fff; text-align: left; font: 12px Arial, sans-serif; cursor: pointer; }
.automation-template-list button:hover { border-color: #217346; background: #f3f8f4; }
.automation-json-dialog { width: min(760px, calc(100vw - 32px)); }
.automation-json-dialog textarea { box-sizing: border-box; width: 100%; min-height: 260px; resize: vertical; border: 1px solid #c8c6c4; border-radius: 4px; padding: 10px; color: #242424; background: #f8f8f8; font: 12px/1.5 Consolas, monospace; }
.conditional-format-manager-dialog {
  width: min(760px, calc(100vw - 32px)); max-height: min(760px, calc(100vh - 32px)); overflow: auto;
  border: 1px solid #c8c6c4; border-radius: 8px; padding: 24px; color: #242424; background: #fff; box-shadow: 0 18px 48px #0003;
}
.conditional-format-manager-dialog::backdrop { background: #0005; }
.conditional-format-manager-dialog [hidden] { display: none !important; }
.conditional-format-manager-dialog form { float: right; }
.conditional-format-manager-dialog .dialog-close { width: 30px; height: 30px; border: 1px solid #c8c6c4; border-radius: 4px; color: #242424; background: #fff; font-size: 20px; cursor: pointer; }
.conditional-format-manager-dialog h2 { margin: 0 0 5px; font-size: 20px; font-weight: 600; }
.conditional-manager-description { margin: 0 0 14px; color: #605e5c; font-size: 12px; line-height: 1.45; }
.conditional-manager-list { display: grid; gap: 4px; max-height: 230px; overflow: auto; border: 1px solid #d1d1d1; border-radius: 4px; padding: 5px; background: #fff; }
.conditional-manager-list:empty::before { content: "No conditional formatting rules on this worksheet."; padding: 12px; color: #605e5c; font-size: 12px; }
.conditional-manager-rule { display: grid; grid-template-columns: 34px minmax(150px, 1.2fr) minmax(130px, 1fr) minmax(110px, .8fr); align-items: center; gap: 10px; min-height: 38px; border: 1px solid transparent; border-radius: 3px; padding: 5px 8px; color: #242424; background: #fff; text-align: left; font: 12px Arial, sans-serif; cursor: pointer; }
.conditional-manager-rule:hover { background: #f3f8f4; }
.conditional-manager-rule[aria-selected="true"] { border-color: #217346; background: #e9f3ec; }
.conditional-manager-rule strong { color: #605e5c; font-weight: 600; font-variant-numeric: tabular-nums; }
.conditional-manager-rule span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conditional-manager-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 14px; }
.conditional-manager-toolbar .action-button { min-height: 30px; padding: 5px 9px; }
.conditional-manager-toolbar .action-button:disabled { opacity: .45; cursor: default; }
.conditional-manager-editor { margin: 0; border: 1px solid #d1d1d1; border-radius: 4px; padding: 12px; }
.conditional-manager-editor legend { padding: 0 5px; color: #424242; font-size: 12px; font-weight: 600; }
.conditional-manager-fields { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 1fr) minmax(120px, .8fr); gap: 10px; }
.conditional-manager-fields label { display: grid; gap: 5px; color: #424242; font-size: 11px; font-weight: 600; }
.conditional-manager-fields input, .conditional-manager-fields select { box-sizing: border-box; width: 100%; min-width: 0; height: 32px; border: 1px solid #8a8886; border-radius: 3px; padding: 5px 7px; color: #242424; background: #fff; font: 12px Arial, sans-serif; }
.conditional-manager-fields input:disabled { color: #777; background: #f3f2f1; }
.conditional-manager-color-scale { margin: 12px 0 0; border: 1px solid #d1d1d1; border-radius: 4px; padding: 8px; }
.conditional-manager-midpoint-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 8px; color: #424242; font-size: 11px; }
.conditional-manager-midpoint-toggle input { accent-color: #217346; }
.conditional-manager-color-scale-stops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.conditional-manager-color-scale-stop { display: grid; align-content: start; gap: 6px; min-width: 0; margin: 0; border: 1px solid #e1dfdd; border-radius: 3px; padding: 6px; }
.conditional-manager-color-scale-stop legend { padding: 0 4px; color: #424242; font-size: 10px; font-weight: 600; }
.conditional-manager-color-scale-stop label { display: grid; gap: 3px; color: #424242; font-size: 10px; }
.conditional-manager-color-scale-stop input[type="number"], .conditional-manager-color-scale-stop select { box-sizing: border-box; width: 100%; min-width: 0; height: 27px; border: 1px solid #8a8886; border-radius: 3px; padding: 3px 5px; color: #242424; background: #fff; font: 11px Arial, sans-serif; }
.conditional-manager-color-scale-stop input[type="color"] { width: 100%; height: 28px; border: 1px solid #8a8886; border-radius: 3px; padding: 2px; background: #fff; }
.conditional-manager-color-scale-stop input:disabled { color: #777; background: #f3f2f1; }
#conditional-manager-data-bar > label { display: grid; grid-template-columns: 1fr 54px; align-items: center; gap: 8px; color: #424242; font-size: 11px; }
#conditional-manager-data-bar-color { width: 54px; height: 28px; border: 1px solid #8a8886; border-radius: 3px; padding: 2px; background: #fff; }
#conditional-manager-data-bar > .conditional-manager-data-bar-show-only, #conditional-manager-icon-set > .conditional-manager-data-bar-show-only { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.conditional-manager-icon-thresholds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.conditional-manager-icon-threshold { display: grid; grid-template-columns: minmax(0, 1fr) 76px; gap: 5px; color: #424242; font-size: 10px; }
.conditional-manager-icon-style { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 8px; color: #424242; font-size: 11px; margin-bottom: 8px; }
.conditional-manager-icon-style select { box-sizing: border-box; width: 100%; min-width: 0; height: 28px; border: 1px solid #8a8886; border-radius: 3px; padding: 3px 6px; color: #242424; background: #fff; font: 11px Arial, sans-serif; }
.conditional-manager-icon-threshold select, .conditional-manager-icon-threshold input { box-sizing: border-box; width: 100%; min-width: 0; height: 27px; border: 1px solid #8a8886; border-radius: 3px; padding: 3px 5px; color: #242424; background: #fff; font: 11px Arial, sans-serif; }
.conditional-manager-icon-threshold select[id$="-gte"] { grid-column: 1 / -1; }
.conditional-manager-format { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.conditional-manager-format label { display: inline-flex; align-items: center; gap: 6px; color: #424242; font-size: 12px; }
.conditional-manager-format input[type="checkbox"] { accent-color: #217346; }
.conditional-manager-format input[type="color"] { width: 34px; height: 28px; border: 1px solid #8a8886; border-radius: 3px; padding: 2px; background: #fff; }
.conditional-manager-format input:disabled { opacity: .55; }
.conditional-manager-border-sides { display: grid; grid-template-columns: repeat(2, minmax(190px, 1fr)); gap: 5px 14px; margin: 10px 0 0; border: 1px solid #d1d1d1; border-radius: 3px; padding: 8px 10px 10px; }
.conditional-manager-border-sides legend { padding: 0 5px; color: #424242; font-size: 11px; font-weight: 600; }
.conditional-manager-border-sides label { display: flex; align-items: center; gap: 6px; color: #424242; font-size: 11px; }
.conditional-manager-border-sides select { min-width: 74px; height: 26px; border: 1px solid #8a8886; border-radius: 3px; padding: 2px 4px; background: #fff; font: 11px Arial, sans-serif; }
.conditional-manager-border-sides input[type="checkbox"] { accent-color: #217346; }
.conditional-manager-border-sides input[type="color"] { width: 30px; height: 25px; border: 1px solid #8a8886; border-radius: 3px; padding: 2px; background: #fff; }
.conditional-manager-border-sides input:disabled, .conditional-manager-border-sides select:disabled { opacity: .55; }
.conditional-manager-stop { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; color: #424242; font-size: 12px; }
.conditional-manager-stop input { accent-color: #217346; }
.conditional-manager-stop input:disabled { opacity: .55; }
.conditional-manager-status { min-height: 16px; margin: 7px 0 0; color: #a4262c; font-size: 12px; }
.conditional-manager-save-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (max-width: 620px) {
  .conditional-format-manager-dialog { padding: 16px; }
  .conditional-manager-rule { grid-template-columns: 28px minmax(0, 1fr) minmax(0, .8fr); }
  .conditional-manager-rule span:last-child { display: none; }
  .conditional-manager-fields { grid-template-columns: 1fr; }
  .conditional-manager-color-scale-stops { grid-template-columns: 1fr; }
}
html.workbook-route body #ribbon-panel-automate .automate-ribbon-group .page-layout-command {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: 32px;
  gap: 7px;
  padding: 4px 7px;
  font: 11px/1.2 Arial, sans-serif;
  text-align: left;
}
html.workbook-route body #ribbon-panel-automate .automate-ribbon-group[aria-label="Scripts"] > .page-layout-command { width: 96px; }
html.workbook-route body #ribbon-panel-automate .automate-ribbon-actions > .page-layout-command { width: 208px; }
html.workbook-route body #ribbon-panel-automate .automate-ribbon-group[aria-label="Automation templates"] .page-layout-command { width: 170px; }
html.workbook-route body #ribbon-panel-automate .automate-ribbon-actions .automate-more-scripts > summary { box-sizing: border-box; width: 26px; min-width: 26px; max-width: 26px; height: 32px; padding: 0; }
html.workbook-route body #ribbon-panel-automate { box-sizing: border-box; height: 76px; min-height: 76px; }

@media (max-width: 650px) {
  .automate-ribbon-section { align-items: flex-start; }
  .automate-ribbon-actions > .page-layout-command { width: 132px; }
  .automation-script-row { flex-wrap: wrap; }
  .automation-script-details { flex-basis: 100%; }
}

/* Keep Excel-style ribbon group captions visible beneath each command group. */
html.workbook-route body .control-sidebar .control-section,
html.workbook-route body .control-sidebar .control-section.review-section {
  min-height: 76px;
  padding-bottom: 18px;
  border-right: 1px solid #d6d6d6;
}
html.workbook-route body .control-sidebar .control-section h2 {
  position: absolute;
  inset: auto 0 1px;
  display: block;
  box-sizing: border-box;
  width: auto;
  height: 12px;
  overflow: visible;
  clip: auto;
  margin: 0;
  padding: 0;
  border: 0;
  color: #605e5c;
  background: transparent;
  font: 9px/12px "Segoe UI", Arial, sans-serif;
  font-weight: 400;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.workbook-route body .control-sidebar .control-section h2::before { display: none; }

/* Put worksheet structure commands in Excel's Home > Cells group. */
html.workbook-route body #ribbon-panel-home > .home-cells-section {
  box-sizing: border-box;
  width: 112px;
  min-width: 112px;
  flex: 0 0 112px;
  flex-flow: column nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  padding: 3px 5px 18px;
}
html.workbook-route body #ribbon-panel-home > .home-cells-section > .home-cell-command-menu {
  display: flex;
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}
html.workbook-route body #ribbon-panel-home > .home-cells-section > .home-cell-command-menu > summary {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 20px;
  justify-content: space-between;
  padding: 2px 5px;
  font-size: 9px;
}
html.workbook-route body .home-cell-menu-content {
  width: min(250px, calc(100vw - 32px));
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 5px;
}
html.workbook-route body .home-cell-menu-content > .action-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 25px;
  justify-content: flex-start;
  padding: 3px 7px;
  font-size: 10px;
}
@media (min-width: 1100px) {
  html.workbook-route body #ribbon-panel-home > .home-cells-section {
    width: 112px;
    min-width: 112px;
    flex: 0 0 112px;
    padding: 1px 5px;
  }
}
.dimension-dialog { box-sizing: border-box; width: min(360px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 9px; padding: 20px; color: var(--deep); background: #fff; box-shadow: 0 18px 48px #00150b38; }
.dimension-dialog::backdrop { background: #07150c70; }
.dimension-dialog > form { float: right; }
.dimension-dialog h2 { margin: 2px 0 7px; font-size: 18px; }
.dimension-dialog .dialog-close { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; color: var(--green); background: #fff; font-size: 19px; cursor: pointer; }
.dimension-selection { margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.dimension-dialog .control-label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
.dimension-input-wrap { display: flex; align-items: center; gap: 9px; }
.dimension-input-wrap .sidebar-input { box-sizing: border-box; width: 130px; min-height: 34px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--deep); background: #fff; font: 14px Arial, sans-serif; }
.dimension-input-wrap > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.dimension-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

@media (min-width: 1100px) {
  html.workbook-route body #ribbon-panel-home > .control-section::after {
    display: block !important;
    height: 11px;
    border-top: 1px solid #d9d9d9;
    color: #666 !important;
    font: 9px/10px "Segoe UI", Arial, sans-serif;
  }
}
.insert-function-arguments-step { min-height: 250px; }
.insert-function-arguments-description { margin: 4px 0 14px; color: #424a44; line-height: 1.45; }
.insert-function-arguments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; max-height: min(300px, 38vh); overflow: auto; padding: 2px; }
.insert-function-argument { display: grid; min-width: 0; gap: 5px; color: #404a43; font-size: 12px; }
.insert-function-argument input { width: 100%; min-height: 32px; border: 1px solid #aeb9b1; border-radius: 3px; padding: 6px 8px; color: #242424; background: #fff; font: 13px Arial, sans-serif; }
.insert-function-argument input:focus { border-color: #217346; outline: 1px solid #217346; }
#insert-function-add-argument { margin-top: 10px; min-height: 29px; border: 1px solid #b8c1bb; border-radius: 3px; padding: 5px 10px; color: #174c2a; background: #fff; cursor: pointer; font: 12px Arial, sans-serif; }
.insert-function-preview-label { display: block; margin: 16px 0 5px; color: #505a53; font-size: 11px; }
.insert-function-preview { display: block; min-height: 34px; overflow-wrap: anywhere; border: 1px solid #d7ddd8; border-radius: 3px; padding: 8px; color: #303a33; background: #f7f9f7; font: 12px Consolas, monospace; }
.insert-function-result-line { margin: 10px 0 0; color: #505a53; font-size: 12px; }
.insert-function-result-line strong { color: #242424; font-weight: 600; }
@media (max-width: 540px) { .insert-function-arguments { grid-template-columns: 1fr; } }
#insert-function-back[hidden], #insert-function-next[hidden], #insert-function-confirm[hidden], #insert-function-add-argument[hidden] { display: none !important; }
.insert-function-arguments { grid-template-columns: minmax(0, 1fr); }
