/* Ayster proprietary software. Copyright © 2026 Ayster. All rights reserved. */
:root{--office-bg:#f3f5f8;--office-ink:#1f2328;--office-line:#d9dde5;--office-accent:#7a5a00;--office-ribbon:#fff;--office-panel:#f8f9fb}
body.office-pro{margin:0;background:var(--office-bg);color:var(--office-ink);font-family:Inter,Arial,sans-serif}
.office-appbar{position:sticky;top:62px;z-index:700;background:#fff;border-bottom:1px solid var(--office-line);box-shadow:0 2px 10px rgba(0,0,0,.05)}
.office-titlebar{display:flex;align-items:center;gap:10px;padding:8px 14px}.office-titlebar input{flex:1;min-width:180px;border:0;background:transparent;font-size:17px;font-weight:700;padding:8px;outline:none}.office-brandchip{font-weight:900;letter-spacing:.04em}.office-save-state{font-size:12px;color:#67707c}
.office-btn{border:1px solid var(--office-line);background:#fff;color:#222;border-radius:7px;min-height:34px;padding:6px 10px;font-weight:650;cursor:pointer}.office-btn:hover{background:#f4f6f8}.office-btn.primary{background:#185abd;color:#fff;border-color:#185abd}.office-btn.ai{background:linear-gradient(135deg,#7c3aed,#7c3aed 55%,#6d28d9);color:#fff;border:0}.office-btn.active{background:#e7ebf2;border-color:#aab2bf}
.ribbon-tabs{display:flex;gap:2px;padding:0 12px;border-top:1px solid #eef0f4}.ribbon-tab{border:0;background:transparent;padding:9px 14px;font-weight:700;cursor:pointer;border-bottom:2px solid transparent}.ribbon-tab.active{border-color:#111827}.ribbon-panels{padding:7px 12px;background:var(--office-ribbon)}.ribbon-panel{display:none;align-items:center;gap:6px;flex-wrap:wrap}.ribbon-panel.active{display:flex}.ribbon-panel select,.ribbon-panel input[type=color]{height:34px;border:1px solid var(--office-line);border-radius:6px;background:#fff}.ribbon-sep{width:1px;height:28px;background:var(--office-line);margin:0 3px}
.workspace{display:flex;min-height:calc(100vh - 210px)}.work-main{flex:1;min-width:0}.ai-drawer{width:360px;background:#fff;border-left:1px solid var(--office-line);display:none;flex-direction:column;position:sticky;top:188px;height:calc(100vh - 188px)}.ai-drawer.open{display:flex}.ai-head{padding:14px;border-bottom:1px solid var(--office-line);display:flex;align-items:center;justify-content:space-between}.ai-body{padding:14px;overflow:auto;flex:1}.ai-quick{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.ai-msg{padding:10px 12px;border-radius:12px;background:#f1f3f6;margin:8px 0;white-space:pre-wrap}.ai-compose{padding:12px;border-top:1px solid var(--office-line);display:flex;gap:8px}.ai-compose textarea{flex:1;min-height:58px;resize:vertical;border:1px solid var(--office-line);border-radius:9px;padding:9px}
.doc-stage{padding:26px 18px 70px;overflow:auto}.doc-page{width:min(816px,calc(100% - 24px));min-height:1056px;margin:0 auto;background:#fff;box-shadow:0 5px 24px rgba(0,0,0,.16);padding:72px 78px;box-sizing:border-box;outline:none;font-family:Arial,sans-serif;font-size:16px;line-height:1.55}.doc-page img{max-width:100%}.doc-page table{border-collapse:collapse;width:100%;margin:10px 0}.doc-page td,.doc-page th{border:1px solid #888;padding:6px}.statusline{display:flex;gap:16px;justify-content:space-between;padding:6px 14px;background:#fff;border-top:1px solid var(--office-line);font-size:12px;color:#667085;position:sticky;bottom:0}
.sheet-stage{padding:12px 12px 58px;overflow:auto}.formula-row{display:flex;gap:7px;align-items:center;padding:7px 12px;background:#fff;border-top:1px solid var(--office-line)}.name-box{width:76px}.formula-row input{height:34px;border:1px solid var(--office-line);border-radius:6px;padding:0 8px}.formula-input{flex:1}.sheet-grid-wrap{overflow:auto;background:#fff;border:1px solid var(--office-line);height:calc(100vh - 300px)}.sheet-grid{border-collapse:separate;border-spacing:0;table-layout:fixed;font:13px Arial,sans-serif;min-width:2100px}.sheet-grid th,.sheet-grid td{border-right:1px solid #e2e5ea;border-bottom:1px solid #e2e5ea;height:25px;min-width:92px;max-width:92px;padding:3px 5px;box-sizing:border-box;overflow:hidden;white-space:nowrap}.sheet-grid thead th{position:sticky;top:0;background:#f5f6f8;z-index:4;text-align:center}.sheet-grid .row-head{position:sticky;left:0;z-index:3;background:#f5f6f8;text-align:center;min-width:48px;max-width:48px}.sheet-grid thead .row-head{z-index:5}.sheet-cell{outline:none;background:#fff}.sheet-cell.selected{box-shadow:inset 0 0 0 2px #1463ff}.sheet-cell.bold{font-weight:700}.sheet-cell.italic{font-style:italic}.sheet-cell.center{text-align:center}.sheet-cell.right{text-align:right}.sheet-tabs{display:flex;gap:4px;align-items:center;padding:7px 12px;background:#fff;border-top:1px solid var(--office-line);position:sticky;bottom:0}.sheet-tab{border:0;background:#eceff3;border-radius:7px;padding:7px 12px;cursor:pointer}.sheet-tab.active{background:#107c41;color:#fff}
.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:10000;display:none;align-items:center;justify-content:center}.modal-backdrop.open{display:flex}.office-modal{width:min(720px,92vw);max-height:85vh;overflow:auto;background:#fff;border-radius:15px;padding:20px}.office-modal canvas{width:100%;height:300px;border:1px solid var(--office-line)}
@media(max-width:900px){.ai-drawer{position:fixed;right:0;top:62px;bottom:0;height:auto;width:min(92vw,380px);z-index:9000;box-shadow:-8px 0 25px rgba(0,0,0,.2)}.doc-page{padding:48px 34px}.office-appbar{top:62px}.workspace{min-height:0}}
@media print{.ayster-global-nav,.office-appbar,.ai-drawer,.statusline{display:none!important}.workspace,.work-main,.doc-stage{display:block;padding:0;background:#fff}.doc-page{box-shadow:none;width:100%;min-height:0;padding:.65in .7in}}
/* v30 Office refinements */
.doc-ruler{width:min(816px,calc(100% - 60px));height:28px;margin:12px auto 0;background:linear-gradient(#fff,#f6f7f8);border:1px solid var(--office-line);border-radius:5px;display:flex;justify-content:space-around;align-items:end;padding-bottom:3px;font:10px Arial;color:#6b7280;box-sizing:border-box}.doc-ruler span{border-left:1px solid #adb5bd;padding-left:2px;flex:1}.doc-stage{background:#e9edf2}.doc-stage #docZoom{transform-origin:top center;transition:transform .15s ease}.office-pro.focus .ayster-global-nav,.office-pro.focus .office-titlebar,.office-pro.focus .ribbon-tabs,.office-pro.focus .ribbon-panels,.office-pro.focus .doc-ruler,.office-pro.focus .statusline{display:none!important}.office-pro.focus .office-appbar{display:none}.office-pro.focus .doc-stage{padding-top:30px}.ai-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.modal-title{display:flex;align-items:center;justify-content:space-between}.template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin-top:12px}.template-card{min-height:120px;text-align:left;border:1px solid var(--office-line);border-radius:14px;background:#fff;padding:18px;cursor:pointer;box-shadow:0 2px 8px rgba(0,0,0,.05)}.template-card:hover{border-color:#111827;transform:translateY(-1px)}.template-card b,.template-card span{display:block}.template-card span{margin-top:8px;color:#667085;font-size:13px}.sheet-statusbar{display:flex;gap:18px;align-items:center;padding:5px 12px;background:#fff;border-top:1px solid var(--office-line);font-size:12px;color:#667085}.sheet-grid td.sheet-cell.selected-range{background:#e9f2ff!important}.sheet-grid td.sheet-cell.primary-selected{box-shadow:inset 0 0 0 2px #1463ff}.sheet-grid th.col-selected,.sheet-grid .row-head.row-selected{background:#dce8ff}.chart-controls{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.office-select{height:34px;border:1px solid var(--office-line);border-radius:7px;background:#fff;padding:0 8px}
.sheet-grid-wrap.freeze-top .sheet-grid thead th{position:sticky;top:0}.sheet-grid-wrap.freeze-first .sheet-grid .row-head{position:sticky;left:0}.sheet-grid-wrap.no-grid .sheet-grid th,.sheet-grid-wrap.no-grid .sheet-grid td{border-color:transparent}.sheet-grid-wrap.no-grid .sheet-grid thead th,.sheet-grid-wrap.no-grid .sheet-grid .row-head{border-color:#e2e5ea}

/* v31 — Professional Office UI */
:root{--v31-blue:#185abd;--v31-green:#107c41;--v31-surface:#ffffff;--v31-soft:#f6f8fb;--v31-border:#d7dce3;--v31-shadow:0 10px 35px rgba(31,35,40,.12)}
body.office-pro{background:#eef1f5;overflow-x:hidden}
.office-appbar{top:58px;border-bottom:1px solid #cfd5de;box-shadow:0 3px 14px rgba(22,31,44,.08)}
.office-titlebar{min-height:48px;padding:6px 16px;background:#fff}.office-brandchip{display:inline-flex;align-items:center;gap:7px;font-size:15px}.office-brandchip:before{content:'A';display:grid;place-items:center;width:27px;height:27px;border-radius:7px;background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;font-weight:900}.office-titlebar input{font-size:16px;border:1px solid transparent;border-radius:7px;padding:7px 9px}.office-titlebar input:hover,.office-titlebar input:focus{border-color:#d5dae2;background:#fafbfc}.office-save-state{padding:4px 8px;border-radius:999px;background:#f2f4f7}
.ribbon-tabs{padding-left:14px;background:#fff}.ribbon-tab{padding:8px 13px;color:#3e4651}.ribbon-tab.active{color:#111827;border-color:#185abd}.ribbon-panels{min-height:48px;padding:8px 14px;border-top:1px solid #f0f2f5;background:linear-gradient(#fff,#fbfcfd)}.ribbon-panel.active{gap:5px}.office-btn{min-height:32px;border-radius:6px;padding:5px 9px;font-size:12px;background:#fff;border-color:#d7dce3}.office-btn:hover{background:#edf3fb;border-color:#b9c7dc}.office-btn.primary{background:#185abd;border-color:#185abd}.office-btn.ai{background:linear-gradient(135deg,#7c3aed,#7c3aed 55%,#6d28d9);color:#fff;box-shadow:0 3px 10px rgba(124,58,237,.25)}
.ribbon-panel select{font-size:12px;padding:0 6px}.ribbon-sep{height:32px;margin:0 5px}
.doc-stage{padding:30px 22px 90px;background:#e5e9ef;min-height:calc(100vh - 255px)}.doc-page{width:816px;max-width:calc(100vw - 90px);min-height:1056px;border:1px solid #d8dde5;box-shadow:var(--v31-shadow);padding:78px 82px;font-size:15.5px;line-height:1.6}.doc-page:focus{box-shadow:0 12px 38px rgba(24,90,189,.16),0 0 0 1px rgba(24,90,189,.18)}.doc-page h1{font-size:32px;line-height:1.2;margin:0 0 18px}.doc-page h2{font-size:24px}.doc-page p{margin:0 0 12px}.doc-ruler{width:816px;max-width:calc(100vw - 90px);height:24px;border-color:#ccd3dd;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.statusline,.sheet-statusbar{min-height:28px;align-items:center;background:#fff;border-top-color:#d7dce3;box-shadow:0 -2px 8px rgba(0,0,0,.03)}
.ai-drawer{width:390px;top:188px;height:calc(100vh - 188px);box-shadow:-8px 0 28px rgba(17,24,39,.13)}.ai-head{background:linear-gradient(135deg,#7c3aed,#7c3aed 55%,#6d28d9);color:#fff}.ai-head .office-btn{color:#fff;background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2)}.ai-body{background:#fafbff}.ai-msg{background:#fff;border:1px solid #e4e7ec;box-shadow:0 2px 8px rgba(0,0,0,.04);line-height:1.55}.ai-compose{background:#fff}.ai-compose textarea{min-height:78px;background:#fbfcfe}.ai-compose textarea:focus{outline:2px solid rgba(37,99,235,.18);border-color:#8fb4ee}
/* Sheets */
.sheet-stage{padding:10px 10px 62px;background:#eef1f4}.sheet-grid-wrap{height:calc(100vh - 292px);border-color:#cfd6df;box-shadow:0 3px 12px rgba(0,0,0,.05)}.sheet-grid{font-family:Arial,sans-serif}.sheet-grid th,.sheet-grid td{height:26px;min-width:96px;max-width:96px;border-color:#dfe3e8}.sheet-grid thead th,.sheet-grid .row-head{background:#f3f5f7;color:#4b5563;font-weight:600}.sheet-cell.selected,.sheet-cell.primary-selected{box-shadow:inset 0 0 0 2px #107c41!important}.formula-row{padding:6px 10px}.formula-row:before{content:'fx';font:italic 700 14px Georgia;color:#5d6570}.formula-input:focus{outline:2px solid rgba(16,124,65,.13);border-color:#5ea37c}.sheet-tab.active{background:#107c41}.sheet-grid td.sheet-cell.selected-range{background:#e8f4ed!important}
/* Better laptop sizing */
@media(max-height:850px){.office-titlebar{min-height:40px}.ribbon-tabs .ribbon-tab{padding-top:6px;padding-bottom:6px}.ribbon-panels{min-height:40px;padding-top:5px;padding-bottom:5px}.doc-stage{padding-top:18px}.doc-page{min-height:980px}.ai-drawer{top:170px;height:calc(100vh - 170px)}}
@media(max-width:1050px){.office-btn{padding:5px 7px}.ribbon-panel{overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px}.ribbon-panel>*{flex:0 0 auto}.doc-page{max-width:calc(100vw - 55px);padding:58px 62px}.doc-ruler{max-width:calc(100vw - 55px)}}
