.table-workspace{overflow:hidden}.table-hub{display:grid;gap:14px}.table-settings{display:flex;align-items:end;flex-wrap:wrap;gap:12px}.table-settings label{min-width:210px}.table-settings .muted{align-self:center}.table-document-actions{display:flex;align-items:end;flex-wrap:wrap;gap:10px;border-top:1px solid var(--line,#c9d1d0)}.table-document-actions label{min-width:180px;flex:1}.table-document-actions [data-table-status]{align-self:center;font-size:13px}.table-editor-host{height:max(520px,calc(100vh - 380px));min-height:520px;background:#fff}.table-editor-frame{display:block;width:100%;height:100%;border:0;background:#fff}.table-links summary{cursor:pointer}.table-links .actions{margin-top:12px}.table-open-choice{width:min(570px,90vw)}.table-open-choice .actions{gap:12px}[data-table-books]{max-width:360px;min-width:170px}@media(max-width:760px){.table-editor-host{height:70vh;min-height:520px}.table-document-actions button{flex:1}.table-settings{align-items:stretch}}
.table-analysis-panel{border-top:1px solid var(--line,#c9d1d0)}.table-chart-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:16px;margin-top:16px}.table-chart-card{min-width:0;padding:14px;background:var(--surface,#fff);border:1px solid var(--line,#c9d1d0);border-radius:12px}.table-chart-card svg,.table-chart-preview svg{display:block;width:100%;height:auto;max-height:460px}.table-chart-card .actions{justify-content:space-between;align-items:center}.table-check{display:flex!important;align-items:center;gap:8px}.table-check input{width:auto!important;margin:0}.table-formula-list{display:grid;gap:8px;max-height:300px;overflow:auto;margin:12px 0 18px}.table-formula-list button{text-align:left;display:grid;gap:5px;white-space:normal}.table-formula-list code{overflow-wrap:anywhere}.table-code{font:14px/1.5 Consolas,monospace;tab-size:2;resize:vertical;white-space:pre;overflow:auto;min-height:220px}.table-code-output{white-space:pre-wrap;overflow-wrap:anywhere;max-height:200px;overflow:auto;font:13px/1.5 Consolas,monospace}.table-analysis-panel p,.table-chart-card strong{overflow-wrap:anywhere}#table-pivot-form td,[data-macro-preview] td{border:1px solid #000;white-space:normal;overflow-wrap:anywhere;max-width:350px}#table-pivot-form fieldset{max-height:200px;overflow:auto}
.table-open-choice .table-text-primary{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--green,#3f695a);color:var(--primary-ink,#fff);border-color:var(--green,#3f695a)}
.table-private-primary,html[data-theme] dialog .table-private-primary,html[data-design=video] dialog .table-private-primary{background:var(--green);border-color:var(--green);color:var(--primary-ink,#fff)}
.table-private-primary:hover,html[data-design=video] dialog .table-private-primary:hover{filter:brightness(.94)}
/* Workbook chrome only. Native cell formatting and accounting screens retain
   their own styles; the original commands keep their event handlers. */
.table-workspace .table-bookbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:14px 18px;background:var(--surface,#fff);border-bottom:1px solid var(--line,#dfe4df)}
.table-bookbar label{display:flex;align-items:center;gap:10px;flex:1;min-width:180px;max-width:620px;color:var(--subtle,#65716d);font-size:12px}
.table-bookbar input{min-width:0;flex:1;font-weight:600;border-radius:8px}
.table-bookbar [data-table-save]{background:var(--green,#8056b2);color:var(--primary-ink,#fff);border-color:transparent;border-radius:9px}
.table-bookbar [data-table-status]{margin-left:auto;font-size:12px;overflow-wrap:anywhere;max-width:40ch}
.table-workspace .table-ribbon{background:var(--surface,#fff);border-bottom:1px solid var(--line,#dfe4df)}
.table-ribbon-navigation{display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--line,#dfe4df)}
.table-ribbon-tabs{display:flex;gap:4px;overflow-x:auto;min-width:0;scrollbar-width:thin;flex:1}
.table-workspace .table-ribbon-tabs button{flex:none;border:0;border-radius:0;background:transparent;box-shadow:none;color:inherit;white-space:nowrap;padding:12px 13px;border-bottom:3px solid transparent;font-size:13px;min-height:44px}
.table-workspace .table-ribbon-tabs button[aria-selected=true]{color:var(--green,#8056b2);border-bottom-color:var(--green,#8056b2);font-weight:650}
.table-workspace .table-ribbon-tabs button:hover{background:var(--accent-soft,#eee6f8)}
.table-workspace .table-ribbon-toggle{flex:none;min-height:36px;font-size:12px;border:0;background:transparent;color:var(--subtle,#65716d);padding:6px 8px}
.table-ribbon-panel{display:flex;gap:8px 12px;align-items:center;flex-wrap:wrap;padding:12px 18px;min-height:64px}
.table-workspace .table-ribbon-panel[hidden],.table-workspace .table-hub[hidden],.table-workspace .table-document-actions[hidden]{display:none}
.table-ribbon-panel>button{min-height:36px;border-radius:8px;font-size:13px;white-space:normal}
.table-ribbon-panel .table-settings{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.table-ribbon-panel .table-settings label{min-width:0;display:flex;align-items:center;gap:8px;font-size:12px}
.table-ribbon-panel .table-settings select{width:auto;min-width:90px}
.table-ribbon-panel .table-settings .muted{font-size:11px;max-width:40ch}
.table-ribbon-panel .table-links{flex-basis:100%;font-size:12px}
.table-workspace [data-table-warnings]:empty{display:none}
.table-ribbon :is(button,input,select):focus-visible,.table-ribbon-panel:focus-visible{outline:2px solid var(--green,#8056b2);outline-offset:2px}
@media(max-width:760px){.table-workspace .table-bookbar{padding:10px 12px}.table-bookbar [data-table-status]{margin-left:0;max-width:100%;flex-basis:100%}.table-ribbon-panel{padding:10px 12px;gap:8px;min-height:60px}.table-ribbon-navigation{padding:0 6px}.table-workspace .table-ribbon-tabs button{padding:10px}.table-ribbon-panel>.actions{width:100%;flex-wrap:wrap}.table-ribbon-panel [data-table-books]{min-width:0;max-width:100%}.table-ribbon-panel .table-settings label{flex-wrap:wrap}.table-ribbon-toggle{max-width:86px}.table-ribbon-panel .table-settings .muted{max-width:none}}

/* Primary table actions retain their contrast inside the shared actions row. */
html[data-theme] dialog .actions>.table-private-primary{color:var(--primary-ink,#fff);background:var(--green);border-color:var(--green)}
html[data-theme] dialog .actions>.table-private-primary:hover{background:var(--green)}

/* Shared office finish: workbook chrome follows the account, cells keep their formatting. */
html[data-theme] .table-workspace{--book-radius:14px;border:1px solid var(--line);border-radius:var(--book-radius);background:var(--surface);box-shadow:0 4px 18px #171d2310;isolation:isolate}
html[data-theme] .table-workspace .table-bookbar{display:grid;grid-template-columns:minmax(180px,1fr) auto minmax(120px,.55fr);gap:12px 18px;padding:16px 20px;background:var(--surface);align-items:center}
html[data-theme] .table-bookbar label{min-width:0;max-width:none;width:100%;margin:0;gap:12px}
html[data-theme] .table-bookbar input{height:40px;background:var(--secondary);border:1px solid var(--line);color:var(--ink);font:inherit;min-width:0}
html[data-theme] .table-bookbar [data-table-status]{margin:0;max-width:none;text-align:right;color:var(--subtle);line-height:1.45}
html[data-theme] .table-workspace .table-ribbon{background:var(--surface)}
html[data-theme] .table-workspace .table-ribbon-navigation{padding:6px 12px;gap:10px;background:var(--secondary);border-bottom:1px solid var(--line)}
html[data-theme] .table-workspace .table-ribbon-tabs{gap:3px;scrollbar-color:var(--line-strong) transparent}
html[data-theme] .table-workspace .table-ribbon-tabs button{border:0;border-radius:8px;padding:9px 12px;min-height:36px;font:inherit;font-size:13px;color:var(--subtle);transition:background .18s ease,color .18s ease}
html[data-theme] .table-workspace .table-ribbon-tabs button[aria-selected=true]{background:var(--accent-soft);color:var(--green);font-weight:650;box-shadow:inset 0 0 0 1px var(--line)}
html[data-theme] .table-workspace .table-ribbon-tabs button:hover{background:var(--accent-soft);color:var(--green)}
html[data-theme] .table-workspace .table-ribbon-panel{padding:14px 20px;gap:10px;align-content:start;min-height:78px;background:var(--surface)}
html[data-theme] .table-workspace .table-ribbon-panel :is(button,.button),html[data-theme] .table-workspace .table-bookbar button{min-height:38px;padding:8px 13px;border-radius:9px;font:inherit;font-size:13px;line-height:1.35;box-shadow:none}
html[data-theme] .table-workspace .table-ribbon-panel :is(button,.button):not(.primary){background:var(--secondary);color:var(--ink);border:1px solid var(--line)}
html[data-theme] .table-workspace .table-ribbon-panel :is(button,.button):hover{background:var(--accent-soft);color:var(--green);border-color:var(--green)}
html[data-theme] .table-workspace .table-ribbon-panel .primary,html[data-theme] .table-bookbar [data-table-save]{background:var(--green);border:1px solid var(--green);color:var(--primary-ink)}
html[data-theme] .table-workspace .table-ribbon-panel .primary:hover{background:var(--green);color:var(--primary-ink);filter:brightness(.95)}
html[data-theme] .table-ribbon-panel .table-settings{flex-basis:100%;border-top:1px solid var(--line);padding-top:10px;margin-top:2px}
html[data-theme] .table-ribbon-panel .table-settings label{margin:0;color:var(--subtle);line-height:1.4}
html[data-theme] .table-ribbon-panel :is(select,input){background:var(--secondary);color:var(--ink);border-color:var(--line);max-width:100%}
html[data-theme] .table-workspace .table-ribbon-toggle{border-radius:8px;min-width:76px}
html[data-theme] .table-editor-host{background:var(--secondary);border-top:1px solid var(--line)}
html[data-theme] .table-editor-host>p{padding:48px 20px;text-align:center;color:var(--subtle);margin:0}
html[data-theme] :is(.table-analysis-panel,.table-chart-card){background:var(--surface);border-color:var(--line);color:var(--ink)}
html[data-theme] dialog:has(:is([id^="table-"],[data-macro-preview],.table-formula-list,.table-code)),html[data-theme] dialog.table-open-choice{background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:16px;max-width:calc(100vw - 28px)}
html[data-theme] dialog :is(.table-code,.table-code-output,.table-formula-list button){background:var(--secondary);color:var(--ink);border-color:var(--line);border-radius:8px}
html[data-theme] .table-chart-card{border-radius:12px;padding:16px}
html[data-theme] .table-workspace :is(button,input,select):focus-visible{outline:2px solid var(--green);outline-offset:2px}
html[data-design=classic] .table-workspace{--book-radius:6px;box-shadow:none}
html[data-interface-style=flat] .table-workspace{--book-radius:4px;box-shadow:none}
html[data-interface-style=flat] .table-workspace :is(.table-ribbon-tabs button,.table-ribbon-panel button){border-radius:4px}
html[data-interface-style=soft] .table-workspace{--book-radius:22px;box-shadow:0 8px 24px #171d2312}
html[data-interface-style=soft] .table-workspace .table-ribbon-tabs button{border-radius:14px}
html[data-interface-style=glass] .table-workspace{background:color-mix(in srgb,var(--surface) 85%,transparent);backdrop-filter:blur(18px);box-shadow:0 8px 28px #171d2314}
html[data-interface-style=glass] .table-workspace :is(.table-bookbar,.table-ribbon,.table-ribbon-panel){background:color-mix(in srgb,var(--surface) 82%,transparent)}
@media(max-width:900px){html[data-theme] .table-workspace .table-bookbar{grid-template-columns:minmax(0,1fr) auto}html[data-theme] .table-bookbar [data-table-status]{grid-column:1/-1;text-align:left}html[data-theme] .table-ribbon-panel .table-settings .muted{flex-basis:100%;max-width:none}}
@media(max-width:560px){html[data-theme] .table-workspace .table-bookbar,html[data-theme] .table-workspace .table-ribbon-panel{padding:12px}html[data-theme] .table-bookbar label{display:grid;gap:5px}html[data-theme] .table-workspace .table-ribbon-tabs button{padding:9px}html[data-theme] .table-ribbon-panel>.actions{display:flex;gap:8px;min-width:0}html[data-theme] .table-ribbon-panel>.actions>*{max-width:100%;min-width:0}html[data-theme] .table-settings{max-width:100%}}
@media(prefers-reduced-motion:reduce){.table-workspace *{transition:none!important;animation:none!important}}

html[data-theme] .table-ribbon-panel>.actions{display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;width:100%;margin:0}
html[data-theme] .table-ribbon-panel>.actions [data-table-books]{flex:1 1 210px;width:auto;max-width:350px;min-width:150px}
html[data-theme] .table-ribbon-panel>.actions button{flex:0 0 auto;width:auto}
html[data-theme] .table-ribbon-panel>label{min-width:180px;max-width:300px;margin:0}

html[data-theme] .table-ribbon-panel .table-sheet-appearance{display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;flex-basis:100%;border-top:1px solid var(--line);padding-top:12px}
html[data-theme] .table-sheet-appearance label{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--subtle);margin:0;min-width:0}
html[data-theme] .table-sheet-appearance select{width:auto;min-width:170px}
html[data-theme] .table-sheet-appearance input[type=color]{width:38px;height:32px;padding:3px;cursor:pointer;border:1px solid var(--line);border-radius:7px;background:var(--surface)}
html[data-theme] .table-sheet-appearance [role=status]{font-size:12px;color:var(--status-danger-text)}
@media(max-width:560px){html[data-theme] .table-sheet-appearance>label:first-child{flex-basis:100%;flex-wrap:wrap}}

/* Compact spreadsheet workspace; document formatting is not changed. */
.table-workspace [hidden]{display:none!important}
html[data-theme] .table-workspace .table-bookbar{grid-template-columns:minmax(160px,1fr) auto minmax(100px,.55fr) auto}
.table-workspace [data-table-expand]{white-space:nowrap}
.table-extra-help>summary,.table-book-warnings>summary{cursor:pointer;color:var(--subtle);font-size:13px;padding:8px 0}
.table-extra-help[open]{flex-basis:100%}.table-extra-help>.actions{padding-top:8px}
.table-book-warnings{padding:0 20px}.table-book-warnings [data-table-warnings]{padding:0 0 10px;font-size:12px}
.table-extra-help p{font-size:12px;max-width:80ch}
.table-workspace .table-analysis-panel[hidden]{display:none!important}
.table-workspace .table-ribbon-tabs{justify-content:flex-start}
body.table-expanded{overflow:hidden!important}
body.table-expanded aside,body.table-expanded .topbar,body.table-expanded .mobile-menu{visibility:hidden!important;pointer-events:none!important}
html[data-theme] .table-workspace.is-expanded{position:fixed;inset:0;z-index:900;margin:0;width:100vw;height:100dvh;border:0;border-radius:0;display:flex;flex-direction:column;box-sizing:border-box;overflow:hidden;isolation:isolate}
.table-workspace.is-expanded .table-editor-host{flex:1 1 auto;min-height:180px;height:0}
.table-workspace.is-expanded>.table-analysis-panel{flex:0 1 auto;max-height:25vh;overflow:auto}
.table-workspace.is-expanded .table-book-warnings{max-height:18vh;overflow:auto}
html[data-theme] .table-workspace.is-expanded .table-bookbar{flex:none;padding:10px 16px}
.table-workspace.is-expanded .table-ribbon{flex:none}
#table-protection-form>details{margin:10px 0}#table-protection-form summary{cursor:pointer}
html[data-theme] dialog.table-print-dialog{width:min(1260px,96vw);max-width:96vw;max-height:94dvh;padding-bottom:0}
dialog.table-print-dialog>.dialog-body{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:20px;align-items:start;max-height:calc(94dvh - 72px);overflow:hidden}
.table-print-dialog #table-print-form{overflow:auto;max-height:calc(94dvh - 105px);padding-right:8px;display:grid;gap:12px;align-content:start}
.table-print-basic{display:grid;gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.table-print-basic>label{margin:0;min-width:0}.table-print-basic label:first-child{grid-column:1/-1}
.table-print-basic>label[hidden]{display:none!important}
.table-print-dialog #table-print-form details{border-top:1px solid var(--line);padding-top:10px}
.table-print-dialog #table-print-form summary{cursor:pointer;font-weight:600;font-size:13px;margin-bottom:8px}
.table-print-dialog .opora-print-controls{gap:10px;grid-template-columns:1fr}
.table-print-dialog .opora-print-pages{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;min-height:420px;max-height:calc(94dvh - 110px);background:var(--secondary,#e7e9eb);padding:18px;box-sizing:border-box;border-radius:10px}
.table-print-dialog .opora-print-page{margin:0 auto!important;outline:1px solid #ccc}
.table-print-dialog [data-print-edit]{width:100%}.table-print-dialog [data-print-navigation]{gap:8px}
.table-print-dialog [data-print-status]{font-size:12px;line-height:1.4}
.table-print-dialog [data-print-count]{font-size:12px}
.table-print-dialog form label{font-size:12px}
.table-print-dialog .table-print-history{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:900px){html[data-theme] .table-workspace .table-bookbar{grid-template-columns:minmax(120px,1fr) auto auto}.table-bookbar [data-table-status]{grid-column:1/-1;grid-row:2}.table-bookbar [data-table-expand]{grid-column:3;grid-row:1}}
@media(max-width:720px){dialog.table-print-dialog>.dialog-body{grid-template-columns:1fr;overflow:auto}.table-print-dialog #table-print-form{max-height:none;overflow:visible}.table-print-dialog .opora-print-pages{max-height:65vh;min-height:260px}.table-print-basic{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-theme] .table-workspace.is-expanded .table-ribbon-panel{max-height:22vh;overflow:auto}}

/* Palette controls share the office surfaces, with an immediate sheet preview. */
html[data-theme] .table-ribbon-panel .table-sheet-appearance{gap:12px;padding-top:14px}
.sheet-look-presets,.sheet-look-colors{display:flex;gap:7px;flex-wrap:wrap;align-items:center}
html[data-theme] .table-workspace .sheet-look-presets button{display:flex;align-items:center;gap:7px;padding:7px 10px;min-height:42px;background:var(--surface);border:1px solid var(--line);font-size:12px}
html[data-theme] .table-workspace .sheet-look-presets button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--green);color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.sheet-look-sample{display:block;width:22px;height:25px;border:1px solid var(--line-strong);border-radius:4px;background:linear-gradient(90deg,transparent 47%,#6b768a30 48%,#6b768a30 52%,transparent 53%),linear-gradient(transparent 47%,#6b768a30 48%,#6b768a30 52%,transparent 53%),var(--surface);background-size:11px 12px}
.sheet-look-white{background-color:#ffffff}.sheet-look-blue{background-color:#edf5ff}.sheet-look-gray{background-color:#f1f3f5}
html[data-theme] .table-sheet-appearance .sheet-look-picker{position:relative;display:flex;align-items:center;gap:9px;min-height:48px;padding:7px 12px;border:1px solid var(--line);border-radius:10px;background:var(--secondary);cursor:pointer;box-sizing:border-box}
.sheet-look-picker>span:last-of-type{display:grid;gap:2px}.sheet-look-picker strong{font-size:12px;font-weight:550;color:var(--ink)}.sheet-look-picker small{font-size:10px;color:var(--subtle);letter-spacing:.04em;font-variant-numeric:tabular-nums}
.sheet-look-dot{display:block;width:23px;height:23px;border:1px solid var(--line-strong);border-radius:7px;box-sizing:border-box;flex:none}
.sheet-look-grid{background:linear-gradient(currentColor 1px,transparent 1px),linear-gradient(90deg,currentColor 1px,transparent 1px),var(--surface);background-size:7px 7px}
html[data-theme] .table-sheet-appearance .sheet-look-picker input[type=color]{position:absolute;inset:0;width:100%;height:100%;padding:0;opacity:0;cursor:pointer}
.sheet-look-picker:focus-within{outline:2px solid var(--green);outline-offset:2px}
.sheet-look-preview{display:grid;grid-template-columns:repeat(3,1fr);width:90px;height:52px;flex:none;border:1px solid var(--sheet-preview-line);border-radius:7px;overflow:hidden;background:var(--sheet-preview-bg);color:var(--sheet-preview-ink)}
.sheet-look-preview>*{border-right:1px solid var(--sheet-preview-line);border-bottom:1px solid var(--sheet-preview-line);font-size:9px;text-align:center;font-style:normal;line-height:16px;min-width:0}.sheet-look-preview>*:nth-child(3n){border-right:0}.sheet-look-preview>*:nth-child(n+7){border-bottom:0}.sheet-look-preview>span{background:color-mix(in srgb,var(--sheet-preview-bg) 93%,var(--sheet-preview-ink))}
html[data-theme] .table-workspace .table-sheet-appearance .sheet-look-reset{background:transparent;border-color:transparent;color:var(--subtle);font-size:12px;padding-inline:8px}
html[data-theme] .table-workspace .table-sheet-appearance .sheet-look-reset:hover{background:var(--accent-soft);color:var(--green)}
@media(max-width:620px){.sheet-look-colors{flex:1}.sheet-look-picker{flex:1}.sheet-look-preview{margin-left:auto}.sheet-look-presets{flex-basis:100%}}

/* Sheet appearance lives in a focused dialog, leaving the ribbon compact. */
.table-ribbon-deck{height:var(--table-tools-height,132px);overflow:hidden;transition:height 220ms cubic-bezier(.2,.7,.2,1)}
.table-ribbon.is-collapsed .table-ribbon-deck{height:0}.table-resizing .table-ribbon-deck{transition:none}
html[data-theme] .table-workspace .table-ribbon-deck .table-ribbon-panel{height:100%;min-height:0;max-height:none;padding:10px 14px;display:flex;flex-wrap:nowrap;align-items:stretch;gap:10px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
/* Spreadsheet ribbon. The panel scrolls as one strip at narrow widths. */
.table-ribbon-deck .table-ribbon-panel[hidden]{display:none!important}
.table-ribbon-deck .table-tool-group{display:flex;flex-direction:column;justify-content:center;flex:0 0 auto;gap:2px;min-width:0;padding-inline-end:10px;border-inline-end:1px solid var(--line)}
.table-tool-group:last-child{border-inline-end:0}
.table-tool-buttons{display:grid;grid-auto-flow:column;grid-template-rows:repeat(2,27px);gap:1px 3px;align-content:center;align-items:center;flex:1}
.table-tool-caption{font-size:11px;line-height:15px;text-align:center;color:var(--subtle);height:15px;transition:height 180ms ease,opacity 180ms ease}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button.table-tool-command{
 display:inline-flex;align-items:center;justify-content:flex-start;gap:5px;min-width:0;min-height:0;height:26px;width:auto;margin:0;padding:2px 5px;
 font:inherit;font-size:12px;font-weight:400;line-height:1.15;text-align:start;white-space:nowrap;
 color:var(--ink);background:transparent;border:1px solid transparent;border-radius:3px;box-shadow:none;cursor:pointer;
}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button.table-tool-command:hover:not(:disabled),
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button.table-tool-command:focus-visible{background:var(--accent-soft);color:var(--green)}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button.table-tool-command:active:not(:disabled){border-color:var(--green)}
.table-tool-command svg{width:18px;height:18px;flex:none;overflow:visible;pointer-events:none}
.table-tool-command[data-face=icon] .table-command-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button[data-face=icon]{width:28px;justify-content:center;padding:2px}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button[data-face=large]{grid-row:span 2;flex-direction:column;justify-content:center;text-align:center;gap:3px;width:max-content;max-width:88px;height:55px;white-space:normal}
.table-tool-command[data-face=large] svg{width:25px;height:25px;color:var(--green)}
.table-alignment-tools{grid-auto-flow:row;grid-template-columns:repeat(5,28px);gap:1px}
.table-alignment-tools [data-ribbon-command=left]{grid-column:1}
.table-number-tools{grid-template-columns:repeat(4,28px);gap:1px}
.table-number-tools [data-table-digits]{grid-row:1;grid-column:1/-1}
.table-number-tools [data-ribbon-command]{grid-row:2}
html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel .table-number-tools [data-table-digits]{background:var(--secondary);border-color:var(--line);justify-content:center}
html[data-theme] .table-workspace .table-ribbon-deck #table-tools-file,
html[data-theme] .table-workspace .table-ribbon-deck #table-tools-developer{overflow:auto;flex-wrap:wrap;align-content:flex-start}
.table-ribbon-deck #table-tools-developer .table-tool-group{order:-1}
html[data-theme] .table-workspace .table-ribbon.is-compact .table-ribbon-panel{align-items:center;padding-block:3px}
.table-ribbon.is-compact .table-tool-caption{height:0;opacity:0;overflow:hidden}
.table-ribbon.is-compact .table-tool-buttons:not(.table-alignment-tools):not(.table-number-tools){display:flex;align-items:center}
.table-ribbon.is-compact .table-tool-group{gap:0}
.table-ribbon-deck .table-extra-help{flex:none;max-width:460px;overflow:auto}.table-ribbon-deck .table-extra-help[open]{flex-basis:auto}
.table-ribbon-deck [data-table-action-status]{display:none}
html[data-theme] .table-workspace .table-command-search{flex:0 0 auto;white-space:nowrap;font-size:12px;padding:7px 10px;margin-left:auto;border-radius:8px;color:var(--subtle)}
.table-ribbon-navigation{flex-wrap:wrap}.table-ribbon-tabs{min-width:0;overflow-x:auto;scrollbar-width:thin;flex:1}.table-ribbon-toggle{order:3}
.table-command-dialog{max-width:720px}.table-command-results{display:grid;gap:4px;max-height:56vh;overflow:auto;padding:4px 0}
.table-command-results>button{display:flex;flex-direction:column;gap:3px;text-align:left;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink)}.table-command-results>button:hover,.table-command-results>button:focus-visible{background:var(--accent-soft);outline:2px solid var(--green);outline-offset:-2px}.table-command-results span{font-size:12px;color:var(--subtle)}.table-command-dialog input{width:100%}
@media(max-width:900px){html[data-theme] .table-workspace .table-command-search{font-size:11px;padding:6px}.table-ribbon-navigation .table-ribbon-tabs{flex-basis:100%;order:2}.table-ribbon-navigation .table-ribbon-toggle{order:1}.table-ribbon-deck .table-tool-group{padding-right:8px}}
@media(prefers-reduced-motion:reduce){.table-ribbon-deck,.table-tool-caption{transition:none!important}}
html[data-theme] dialog.table-chart-dialog{width:min(940px,94vw);max-width:94vw}
.table-chart-type-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:18px}.table-chart-type-picker button{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink)}.table-chart-type-picker button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--green);color:var(--green)}.table-chart-type-picker svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;flex:none}.table-chart-size{margin:10px 0}.table-chart-size summary{cursor:pointer;font-size:13px;color:var(--subtle);margin-bottom:8px}.table-chart-dialog .table-chart-preview{min-height:120px;overflow:auto}.table-chart-dialog .table-chart-preview svg{max-width:100%;height:auto;display:block;margin:auto}.table-chart-dialog [hidden]{display:none!important}.table-chart-dialog [data-error]:empty{display:none}
@media(max-width:600px){.table-chart-type-picker{grid-template-columns:repeat(2,minmax(0,1fr))}}
html[data-theme] #modal.table-chart-dialog{position:fixed;inset:var(--chart-panel-top,8px) 14px 12px auto;margin:0;width:410px;max-width:43vw;max-height:calc(100dvh - var(--chart-panel-top,8px) - 12px);height:auto;box-sizing:border-box;z-index:1100;box-shadow:0 8px 30px #0002;overflow:auto;border:1px solid var(--line);border-radius:14px;padding:0}

.table-chart-dialog .dialog-head{padding:12px 16px;position:sticky;top:0;z-index:1;background:var(--surface)}.table-chart-dialog .dialog-head h2{font-size:17px}.table-chart-dialog .dialog-body{padding:14px!important}.table-chart-dialog .form-grid{grid-template-columns:1fr}.table-chart-dialog .table-chart-type-picker{grid-template-columns:repeat(2,minmax(0,1fr))}.table-chart-dialog .table-chart-type-picker button{padding:8px;font-size:12px}.table-chart-dialog .form-actions{position:sticky;bottom:0;background:var(--surface);padding-block:10px}.table-chart-dialog [data-chart-selection]{margin-top:5px;padding:6px 9px;font-size:12px}.table-chart-dialog .table-chart-preview{min-height:0}.table-chart-dialog .table-chart-preview:empty::before{content:'Готовим предпросмотр…';font-size:12px;color:var(--subtle)}
@media(max-width:700px){html[data-theme] #modal.table-chart-dialog{top:auto;left:12px;right:12px;bottom:8px;max-width:none;width:auto;height:48dvh;max-height:48dvh}}
html[data-theme] #modal.table-chart-dialog .dialog-body{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
html[data-theme] #modal.table-chart-dialog{--reference-dialog-space:14px}
html[data-theme] #modal.table-chart-dialog .form-grid{grid-template-columns:minmax(0,1fr)}
html[data-theme] #modal.table-chart-dialog .table-chart-preview{width:100%;max-width:100%;min-width:0;overflow:hidden}
html[data-theme] #modal.table-chart-dialog .table-chart-preview svg{width:100%!important;min-width:0!important;max-width:100%!important;height:auto!important}
html[data-theme] .table-workspace .table-ribbon-panel{min-height:64px;box-sizing:border-box;padding:10px 20px;align-content:start}
html[data-theme] .table-workspace .table-ribbon.is-resizable .table-ribbon-panel{height:var(--table-tools-height);min-height:0;max-height:none;overflow:auto;flex-shrink:0}
.table-ribbon-resize{height:12px;min-height:12px;flex:none;display:flex;align-items:center;justify-content:center;cursor:row-resize;touch-action:none;user-select:none;background:var(--surface);border-block:1px solid var(--line);box-sizing:border-box}
.table-ribbon-resize>span{width:42px;height:3px;border-radius:3px;background:var(--subtle);opacity:.55;pointer-events:none}
.table-ribbon-resize:hover,.table-ribbon-resize:focus-visible{background:var(--accent-soft)}.table-ribbon-resize:focus-visible{outline:2px solid var(--green);outline-offset:-2px}
.table-ribbon-dragging,.table-ribbon-dragging *{cursor:row-resize!important;user-select:none!important}.table-resizing .table-editor-frame{pointer-events:none}
.table-workspace .table-editor-host{min-height:280px}.table-workspace.is-expanded .table-editor-host{min-height:180px}
.table-workspace [data-table-action-status]{font-size:12px;color:var(--subtle);max-width:50ch}.table-workspace [data-table-action-status].error{color:var(--status-danger-text,#b42318)}
.table-number-example{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:14px;background:var(--secondary);border:1px solid var(--line);border-radius:8px}.table-number-example>span{color:var(--subtle);font-size:12px}.table-number-example output{font-size:19px;font-variant-numeric:tabular-nums}
#table-decimals-form{max-width:460px}#table-decimals-form [data-decimals-error]:empty,#table-structure-form [data-structure-error]:empty{display:none}#table-structure-form details{font-size:12px}#table-structure-form details summary{cursor:pointer}
html[data-theme] #modal:has(.table-sheet-dialog-body){width:min(660px,calc(100vw - 24px));max-width:calc(100vw - 24px);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:18px}
.table-sheet-dialog-body{padding:22px!important}
.table-sheet-dialog-body .table-sheet-appearance{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:20px;align-items:center;padding:0;border:0}
.table-sheet-dialog-body .sheet-look-presets{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
html[data-theme] .table-sheet-dialog-body .sheet-look-presets button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:88px;padding:12px 8px;border:1px solid var(--line);border-radius:11px;background:var(--secondary);color:var(--ink);font:inherit;font-size:13px}
html[data-theme] .table-sheet-dialog-body .sheet-look-presets button[aria-pressed=true]{background:var(--accent-soft);border-color:var(--green);color:var(--green);box-shadow:inset 0 0 0 1px var(--green)}
.table-sheet-dialog-body .sheet-look-sample{width:31px;height:34px;background-size:15px 17px}
.table-sheet-dialog-body .sheet-look-colors{display:grid;gap:10px}
html[data-theme] .table-sheet-dialog-body .sheet-look-picker{min-height:60px;border-radius:12px;padding:10px 14px}
.table-sheet-dialog-body .sheet-look-picker strong{font-size:13px}.table-sheet-dialog-body .sheet-look-picker small{font-size:11px}
.table-sheet-dialog-body .sheet-look-dot{width:30px;height:30px}
.table-sheet-dialog-body .sheet-look-preview{width:148px;height:124px;grid-template-rows:28px 1fr 1fr;border-radius:10px}.table-sheet-dialog-body .sheet-look-preview>span{font-size:12px;line-height:27px}
html[data-theme] .table-sheet-dialog-body .sheet-look-reset{justify-self:start;background:transparent;border-color:var(--line);color:var(--subtle);border-radius:9px;font-size:12px;padding:8px 12px}
.table-sheet-dialog-body>.actions{justify-content:flex-end;margin:22px 0 0;padding-top:18px;border-top:1px solid var(--line)}
.table-sheet-dialog-body [data-sheet-status]:empty{display:none}
@media(max-width:480px){.table-sheet-dialog-body{padding:16px!important}.table-sheet-dialog-body .table-sheet-appearance{grid-template-columns:1fr}.table-sheet-dialog-body .sheet-look-presets{grid-template-columns:repeat(2,minmax(0,1fr))}.table-sheet-dialog-body .sheet-look-preview{grid-column:1;width:100%;height:100px}}

/* Editable chart presentation, scoped to the worksheet side panel. */
#modal.table-chart-dialog .table-chart-colors{display:flex;flex-wrap:wrap;gap:8px;min-width:0;margin:10px 0;border:1px solid var(--border,#ccc);border-radius:8px;padding:10px}
#modal.table-chart-dialog .table-chart-colors label{display:grid;gap:4px;text-align:center;font-size:11px}
#modal.table-chart-dialog .table-chart-colors input{width:34px;height:30px;min-width:0;padding:2px}
#modal.table-chart-dialog .table-chart-appearance>summary{cursor:pointer;padding:10px 0}
/* Both editors share one document; switching stays visible above the ribbon. */
.table-adaptive{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:8px 20px;border-bottom:1px solid var(--border,#d5d8d6);font-size:12px;min-width:0}
.table-adaptive-modes{display:inline-flex;gap:3px;padding:3px;border:1px solid var(--border,#d5d8d6);border-radius:12px;flex-shrink:0}
.table-adaptive-modes button{border:0;border-radius:9px;padding:7px 12px;white-space:nowrap;background:transparent;color:inherit;font:inherit;cursor:pointer}
.table-adaptive-modes button[aria-pressed="true"]{background:var(--green,#337260);color:var(--primary-ink,#fff)}
.table-adaptive-modes button:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.table-adaptive [data-table-external-status]{flex:1 1 260px;overflow-wrap:anywhere}
.table-adaptive [data-table-previous]{white-space:nowrap;color:inherit}
@media(max-width:600px){.table-adaptive{padding:8px 12px}.table-adaptive [data-table-external-status]{flex-basis:100%}}

html[data-theme] .table-workspace .table-ribbon-tabs button[role=tab]{position:relative;background:transparent;box-shadow:none;border:0;border-radius:0;padding:6px 9px;min-height:33px}
html[data-theme] .table-workspace .table-ribbon-tabs button[aria-selected=true]::after{content:"";position:absolute;inset:auto 8px 1px;height:3px;background:var(--green);border-radius:2px}
html[data-theme] .table-workspace .table-ribbon-navigation{gap:4px;padding:2px 8px}
html[data-theme] .table-workspace .table-command-search{display:inline-flex;align-items:center;justify-content:center;gap:4px}
.table-command-search svg{width:16px;height:16px}
@container workbook (max-width:1120px){html[data-theme] .table-workspace .table-command-search span{display:none}html[data-theme] .table-workspace .table-command-search{padding:5px;min-width:30px}}
.table-ribbon{container:workbook / inline-size}

html[data-theme] .table-workspace .table-ribbon .table-ribbon-panel button.table-tool-command[aria-pressed=true]{background:var(--accent-soft);color:var(--green);border-color:var(--line-strong)}

/* Let tabs wrap within their own column, leaving search and collapse reachable. */
html[data-theme] .table-workspace .table-ribbon-navigation{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;column-gap:8px}
.table-ribbon-navigation .table-ribbon-tabs{grid-column:1;grid-row:1;flex-wrap:wrap;overflow:visible}
.table-ribbon-navigation .table-command-search{grid-column:2;grid-row:1}
.table-ribbon-navigation .table-ribbon-toggle{grid-column:3;grid-row:1}
html[data-theme] .table-workspace .table-ribbon-deck #table-tools-file:not([hidden]){display:flex;align-items:center;flex-wrap:nowrap;gap:6px;overflow-x:auto;overflow-y:hidden}
html[data-theme] #table-tools-file>.actions{width:auto;flex:none;align-items:center;gap:4px;flex-wrap:nowrap}
html[data-theme] #table-tools-file>.actions [data-table-books]{flex:none;min-width:80px;width:clamp(90px,13vw,172px)}
html[data-theme] #table-tools-file>button{flex:none;white-space:nowrap}

html[data-theme] #table-file-options{position:fixed;inset:auto;margin:0;width:min(276px,calc(100vw - 16px));box-sizing:border-box;padding:10px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 22px #0003;overflow:auto}
#table-file-options:popover-open{display:grid;gap:5px}
#table-file-options label{margin:0;display:grid;gap:4px}
#table-file-options .table-links .actions{display:grid;justify-content:stretch}
#table-file-options [hidden]{display:none!important}
html[data-theme] #modal.table-chart-dialog{box-shadow:0 10px 40px #0003;background:var(--surface)}

html[data-theme] #table-tools-developer .table-ribbon-options{position:fixed;inset:auto;margin:0;box-sizing:border-box;width:min(304px,calc(100vw - 16px));overflow:auto;padding:14px;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 22px #0003}
.table-ribbon-options:popover-open{display:block}
.table-ribbon-options p{font-size:13px;line-height:1.5;margin:8px 0;overflow-wrap:anywhere}
html[data-theme] .table-workspace .table-ribbon-deck #table-tools-developer:not([hidden]){flex-wrap:nowrap;align-items:stretch;overflow-x:auto;overflow-y:hidden}

@media(max-width:560px){
 html[data-theme] .table-workspace .table-bookbar{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 8px}
 html[data-theme] .table-workspace .table-bookbar label{grid-column:1/-1;grid-row:1;display:flex;align-items:center}
 html[data-theme] .table-workspace .table-bookbar input{width:0;min-width:0;flex:1}
 html[data-theme] .table-bookbar [data-table-save]{grid-column:1;grid-row:2}
 html[data-theme] .table-bookbar [data-table-expand]{grid-column:2;grid-row:2}
 html[data-theme] .table-bookbar [data-table-status]{grid-column:1/-1;grid-row:3;text-align:left}
}
