@import "https://fonts.googleapis.com/css2?family=Metrophobic&display=swap";*{box-sizing:border-box}:root{--app-header-height:64px;--app-footer-height:36px;--app-sidebar-width:248px;--page-width:794px;--page-height:1123px;--chrome-bg:#212529;--chrome-bg-lighter:#414850;--chrome-border:#495057;--chrome-text:#f8f9fa;--chrome-muted:#adb5bd;--chrome-hover:#343a40;--ui-font:"Metrophobic", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif}body{background-color:#f8fafc;margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow-x:hidden}.app-shell{min-height:100vh;padding-top:var(--app-header-height);padding-left:var(--app-sidebar-width);padding-bottom:var(--app-footer-height)}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.app-header{z-index:2500;width:100%;height:var(--app-header-height);background:var(--chrome-bg);border-bottom:1px solid var(--chrome-border);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);font-family:var(--ui-font);grid-template-columns:auto minmax(180px,1fr) auto;align-items:center;gap:16px;padding:10px 18px;display:grid;position:fixed;top:0;left:0;box-shadow:0 6px 18px #0f172a14}.header-brand{min-width:0;color:var(--chrome-text);white-space:nowrap;align-items:center;gap:10px;font-weight:800;display:inline-flex}.header-logo{object-fit:contain;width:auto;height:30px;display:block}.header-brand-name{font-size:.98rem}.worksheet-title-control{min-width:0;max-width:460px;display:block;position:relative}.worksheet-title-control input{color:#212529;width:100%;font:inherit;background:#e9ecef;border:1px solid #ced4da;border-radius:6px;outline:none;padding:8px 42px 8px 10px;font-size:1rem}.worksheet-title-control input:hover,.worksheet-title-control input:focus{background:#f1f3f5;border-color:#adb5bd}.worksheet-title-options-button{color:#495057;cursor:pointer;background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;width:30px;height:30px;display:inline-flex;position:absolute;top:50%;right:4px;transform:translateY(-50%)}.worksheet-title-options-button:hover,.worksheet-title-options-button:focus-visible{color:#212529;background:#dee2e6;outline:none}.header-actions{justify-content:flex-end;align-items:center;gap:6px;min-width:0;display:flex}.header-icon-button{min-height:36px;color:var(--chrome-text);cursor:pointer;font:inherit;white-space:nowrap;background:0 0;border:0;border-radius:6px;align-items:center;gap:7px;padding:8px 10px;font-size:.86rem;font-weight:700;display:inline-flex}.header-icon-button:hover,.header-icon-button:focus-visible{background:var(--chrome-hover);outline:none}.save-status{min-height:36px;color:var(--chrome-muted);white-space:nowrap;align-items:center;gap:7px;padding:8px 10px;font-size:.82rem;font-weight:700;display:inline-flex}.account-menu{align-items:center;margin-left:4px;display:inline-flex;position:relative}.account-avatar-button{color:#212529;cursor:pointer;background:#e9ecef;border:1px solid #f8f9fa42;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex}.account-avatar-button:hover,.account-avatar-button:focus-visible,.account-avatar-button[aria-expanded=true]{background:#fff;border-color:#f8f9fa80;outline:none}.account-menu-panel{z-index:3300;background:#fff;border:1px solid #cbd5e1;border-radius:8px;min-width:168px;padding:6px;position:absolute;top:calc(100% + 10px);right:0;overflow:hidden;box-shadow:0 18px 44px #0f172a38}.account-menu-panel button{color:#1f2937;cursor:pointer;width:100%;min-height:36px;font:inherit;text-align:left;background:0 0;border:0;border-radius:6px;align-items:center;gap:9px;padding:8px 10px;font-size:.86rem;font-weight:700;display:flex}.account-menu-panel button:hover,.account-menu-panel button:focus-visible{background:#f1f5f9;outline:none}.modal-backdrop{z-index:3200;background:#0f172a47;place-items:center;padding:24px;display:grid;position:fixed;inset:0}.worksheet-options-modal,.app-settings-modal{width:min(520px,100%);font-family:var(--ui-font);background:#fff;border:1px solid #cbd5e1;border-radius:8px;overflow:hidden;box-shadow:0 24px 70px #0f172a3d}.settings-placeholder{color:#64748b;text-transform:uppercase;font-size:.82rem;font-weight:800}.modal-header,.modal-footer{justify-content:space-between;align-items:center;gap:14px;padding:16px 18px;display:flex}.modal-header{border-bottom:1px solid #e2e8f0}.modal-header h2{color:#0f172a;margin:4px 0 0;font-size:1.08rem;line-height:1.2}.modal-kicker{color:#2563eb;text-transform:uppercase;align-items:center;gap:7px;font-size:.76rem;font-weight:800;display:inline-flex}.modal-close-button{color:#475569;cursor:pointer;background:0 0;border:0;border-radius:6px;justify-content:center;align-items:center;width:34px;height:34px;display:inline-flex}.modal-close-button:hover,.modal-close-button:focus-visible{background:#e2e8f0;outline:none}.modal-body{gap:2px;padding:10px 18px;display:grid}.option-row{color:#0f172a;grid-template-columns:minmax(0,1fr) 150px;align-items:center;gap:18px;padding:12px 0;display:grid}.option-row+.option-row{border-top:1px solid #e2e8f0}.option-row span{gap:3px;min-width:0;display:grid}.option-row strong{font-size:.9rem}.option-row small{color:#64748b;font-size:.76rem;font-weight:600}.option-row select{color:#0f172a;width:100%;height:34px;font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:6px;padding:0 9px;font-size:.84rem;font-weight:700}.option-row-toggle input{accent-color:#2563eb;justify-self:end;width:18px;height:18px}.modal-footer{background:#f8fafc;border-top:1px solid #e2e8f0;justify-content:flex-end}.modal-footer button{color:#fff;cursor:pointer;font:inherit;background:#1d4ed8;border:0;border-radius:6px;padding:8px 14px;font-size:.84rem;font-weight:800}.modal-footer button:hover,.modal-footer button:focus-visible{background:#1e40af;outline:none}@media (width<=900px){:root{--app-sidebar-width:214px}.app-header{grid-template-columns:auto minmax(120px,1fr) auto;gap:8px;padding:10px}.header-brand-name,.header-icon-button span,.save-status span{display:none}.header-icon-button,.save-status{justify-content:center;width:36px;padding:8px}.account-menu{margin-left:0}.account-avatar-button{width:36px;height:36px}}.worksheet-sidebar{top:var(--app-header-height);bottom:var(--app-footer-height);z-index:2300;width:var(--app-sidebar-width);background:var(--chrome-bg-lighter);border-right:1px solid var(--chrome-border);font-family:var(--ui-font);padding:14px 12px 18px;position:fixed;left:0;overflow-y:auto;box-shadow:7px 0 18px #0f172a0d}.sidebar-title{border-bottom:1px solid var(--chrome-border);justify-content:space-between;align-items:baseline;gap:10px;padding:4px 4px 12px;display:flex}.sidebar-title strong{color:var(--chrome-text);font-size:.9rem}.sidebar-title span{color:var(--chrome-muted);font-size:.72rem;font-weight:800}.sidebar-section{gap:6px;padding:14px 0 0;display:grid}.sidebar-section h2{color:var(--chrome-muted);letter-spacing:.04em;text-transform:uppercase;margin:0;padding:0 4px;font-size:.72rem;font-weight:900}.sidebar-list{gap:2px;display:grid}.sidebar-item{width:100%;min-height:30px;padding:6px 8px 6px calc(8px + var(--sidebar-indent,0px));color:var(--chrome-text);cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;border-radius:5px;font-size:.82rem;font-weight:700;display:block;overflow:hidden}.sidebar-item span{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.sidebar-item:hover,.sidebar-item:focus-visible{background:var(--chrome-hover);outline:none}.sidebar-empty{color:#868e96;margin:0;padding:2px 4px 6px;font-size:.78rem;font-weight:700}.canvas-area{width:100%;min-height:calc(100vh - var(--app-header-height) - var(--app-footer-height));-webkit-user-select:none;user-select:none;background:linear-gradient(#edf2f7 0%,#e5eaf1 100%);padding:42px 32px 80px;position:relative;overflow-x:auto}.page-stack{width:var(--page-width);transform-origin:0 0;position:relative}.page-stack-shell{margin:0 auto;position:relative}.add-page-button{border:1px solid var(--chrome-border);background:var(--chrome-bg);width:32px;height:32px;color:var(--chrome-text);cursor:pointer;font:800 1.2rem/1 var(--ui-font);border-radius:999px;justify-content:center;align-items:center;margin:18px auto 0;display:flex;box-shadow:0 8px 18px #0f172a29}.add-page-button:hover,.add-page-button:focus-visible{background:var(--chrome-hover);outline-offset:2px;outline:2px solid #60a5fa}.page-sheet{width:var(--page-width);height:var(--page-height);pointer-events:none;background:#fff;border:1px solid #d6dde8;position:absolute;left:0;box-shadow:0 1px 2px #0f172a14,0 18px 38px #0f172a1f}.page-template-grid .page-sheet{background-color:#fff;background-image:linear-gradient(#e2e8f0 1px,#0000 1px),linear-gradient(90deg,#e2e8f0 1px,#0000 1px);background-size:24px 24px}.page-template-ruled .page-sheet{background-color:#fff;background-image:linear-gradient(#e2e8f0 1px,#0000 1px);background-position:0 56px;background-size:100% 28px}.page-template-dot-grid .page-sheet{background-color:#fff;background-image:radial-gradient(circle,#cbd5e1 1px,#0000 1.4px);background-size:18px 18px}.print-worksheet{display:none}.print-page{width:var(--page-width);height:var(--page-height);background:#fff;position:relative;overflow:hidden}.print-worksheet.page-template-grid .print-page{background-color:#fff;background-image:linear-gradient(#e2e8f0 1px,#0000 1px),linear-gradient(90deg,#e2e8f0 1px,#0000 1px);background-size:24px 24px}.print-worksheet.page-template-ruled .print-page{background-color:#fff;background-image:linear-gradient(#e2e8f0 1px,#0000 1px);background-position:0 56px;background-size:100% 28px}.print-worksheet.page-template-dot-grid .print-page{background-color:#fff;background-image:radial-gradient(circle,#cbd5e1 1px,#0000 1.4px);background-size:18px 18px}.print-page-content{width:100%;height:100%;position:relative}.print-block{z-index:1;color:#1e293b;position:absolute;overflow:visible}.print-math-block{align-items:center;padding:4px 8px;display:flex}.print-math-row{align-items:center;gap:8px;display:flex}.print-math-row math-field{min-width:20px;color:inherit;pointer-events:none;background:0 0;border:0;font-size:1.2rem}.print-result-inline{color:#475569;white-space:nowrap;align-items:center;gap:2px;font-size:1.2rem;display:flex}.print-result-unit-field{color:#2563eb;width:7.5em}.print-result-unit-field.has-error{color:#ef4444}.print-markdown-block{cursor:default;max-width:none}.print-description-content{color:#475569;white-space:pre-wrap;width:220px;font-size:.9rem;line-height:1.35}.page-label{color:#94a3b8;letter-spacing:.03em;text-transform:uppercase;font-size:.72rem;font-weight:700;position:absolute;bottom:14px;right:18px}.selection-marquee{z-index:50;pointer-events:none;background:#2563eb1a;border:1px solid #2563eba6;position:absolute}.pending-insertion-marker{z-index:70;pointer-events:none;background:#ef444433;border:2px solid #ef4444;border-radius:999px;width:14px;height:14px;animation:1.1s ease-out infinite pending-insertion-pulse;position:absolute;transform:translate(-50%,-50%);box-shadow:0 0 #ef44448c}@keyframes pending-insertion-pulse{0%{box-shadow:0 0 #ef44448c}70%{box-shadow:0 0 0 13px #ef444400}to{box-shadow:0 0 #ef444400}}.context-toolbar{left:calc(var(--app-sidebar-width) + (100vw - var(--app-sidebar-width)) / 2);z-index:90;background:var(--chrome-bg);border:1px solid var(--chrome-border);font-family:var(--ui-font);border-radius:8px;align-items:center;display:flex;position:fixed;transform:translate(-50%);box-shadow:0 8px 14px -8px #0f172a38}.context-toolbar-math{width:min(620px, calc(100vw - var(--app-sidebar-width) - 48px));flex-direction:column;align-items:stretch;gap:6px;max-height:172px;padding:8px;top:92px}.context-toolbar-format{gap:4px;padding:6px;top:142px}.context-toolbar-insertion{gap:4px;padding:6px;transform:translate(-50%,calc(-100% - 18px))}.context-toolbar-selection{gap:4px;padding:6px;top:92px}.context-toolbar-label{color:var(--chrome-muted);margin-right:8px;font-size:.9em;font-weight:700}.math-toolbar-tabs{gap:4px;padding-bottom:2px;display:flex;overflow-x:auto}.math-toolbar-tab{color:var(--chrome-muted);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:6px;flex:none;padding:6px 9px;font-size:.76rem;font-weight:800}.math-toolbar-tab:hover,.math-toolbar-tab:focus-visible{background:var(--chrome-hover);color:var(--chrome-text);outline:none}.math-toolbar-tab.is-active{color:#fff;background:#1d4ed8}.math-toolbar-panel{flex-wrap:wrap;justify-content:flex-start;gap:5px;display:flex;overflow-y:auto}.math-toolbar-button{background:var(--chrome-hover);min-width:32px;color:var(--chrome-text);font:inherit;cursor:pointer;border:0;border-radius:6px;padding:7px 9px;font-size:.78rem;font-weight:600;transition:background-color .15s}.math-toolbar-button:hover,.math-toolbar-button:focus-visible{background:#495057;outline:none}.math-toolbar-function-button{color:#bbf7d0;font-weight:800}.insertion-toolbar-button,.selection-toolbar-button{min-height:32px;color:var(--chrome-text);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:6px;align-items:center;gap:6px;padding:7px 9px;font-size:.78rem;font-weight:800;display:inline-flex}.insertion-toolbar-button:hover,.insertion-toolbar-button:focus-visible,.selection-toolbar-button:hover,.selection-toolbar-button:focus-visible{background:var(--chrome-hover);outline:none}.format-button{width:32px;height:32px;color:var(--chrome-text);cursor:pointer;background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;display:inline-flex}.format-button:hover,.format-button:focus-visible{background:var(--chrome-hover);outline:none}.format-button:disabled{cursor:default}.format-button.is-active{color:#fff;background:#1d4ed8}.format-toolbar-divider{background:var(--chrome-border);width:1px;height:22px;margin:0 2px}.math-block{z-index:10;color:#1e293b;min-width:50px;box-shadow:none;cursor:move;background:0 0;border:1px solid #0000;border-radius:4px;align-items:center;padding:4px 8px;transition:background-color .2s,border-color .2s,box-shadow .2s;display:flex;position:absolute}.math-block:focus-within,.math-block.has-menu,.math-block.is-dragging{z-index:20;background:#fff;border-color:#3b82f6;box-shadow:0 0 0 2px #3b82f633}.math-block.is-selected{z-index:20;box-shadow:0 0 0 2px #2563eb59}.math-block.is-selected:focus-within,.math-block.is-selected.has-menu,.math-block.is-selected.is-dragging{box-shadow:0 0 0 2px #2563eb59}.math-block.error{background:#fff;border-color:#ef4444}.math-block.text-mode{border-style:dashed;min-width:150px}.math-block.description-mode{cursor:default;min-width:180px}.math-block.page-break-mode{width:calc(var(--page-width) - 72px);min-width:320px;padding:0}.math-block.text-mode:focus-within,.math-block.text-mode.has-menu,.math-block.text-mode.is-dragging,.math-block.description-mode:focus-within,.math-block.description-mode.has-menu,.math-block.page-break-mode:focus-within,.math-block.page-break-mode.has-menu,.math-block.page-break-mode.is-dragging{background:#fdfdfd}.block-content-wrapper{align-items:center;gap:8px;width:100%;display:flex}.result-inline{color:#475569;white-space:nowrap;align-items:center;gap:2px;font-size:1.2rem;display:flex}.definition-result{color:#94a3b8}.result-inline math-field{min-width:0;color:inherit;font-size:inherit;display:inline-block}.result-value-field{pointer-events:none}.result-unit-field{color:#2563eb;background:0 0;border:0;border-bottom:1px solid #0000;outline:none;width:7.5em;padding:0 2px 1px}.result-unit-field:hover,.result-unit-field:focus{background:#eff6ff;border-color:#93c5fd;border-radius:3px}.result-unit-field.has-error{color:#ef4444;border-color:#ef4444}.math-input-wrapper{position:relative}math-field,textarea{color:#1e293b;background:0 0;border:none;outline:none;font-size:1.2rem;display:block}math-field{min-width:20px}.math-suggestion-menu{z-index:2100;min-width:190px;font-family:var(--ui-font);background:#fff;border:1px solid #cbd5e1;border-radius:6px;flex-direction:column;gap:2px;padding:6px;display:flex;position:absolute;top:calc(100% + 8px);left:0;box-shadow:0 12px 24px #0f172a29}.math-suggestion-menu button{color:#1e293b;cursor:pointer;width:100%;font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:7px 8px;font-size:.86rem;display:grid}.math-suggestion-menu button:hover,.math-suggestion-menu button.is-active{background:#dcfce7}.math-suggestion-menu small{color:#64748b;text-transform:uppercase;font-size:.72rem;font-weight:700}math-field::part(menu-toggle),math-field::part(virtual-keyboard-toggle){display:none}textarea{resize:none;width:100%;min-height:1.5em;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.markdown-preview{color:#1e293b;cursor:text;outline:none;min-width:150px;max-width:420px;font-size:1rem;line-height:1.45}.markdown-preview :first-child{margin-top:0}.markdown-preview :last-child{margin-bottom:0}.markdown-preview h1,.markdown-preview h2,.markdown-preview h3,.markdown-preview h4,.markdown-preview h5,.markdown-preview h6{margin:.15em 0;font-size:1.1rem;line-height:1.2}.markdown-preview p,.markdown-preview blockquote,.markdown-preview ul,.markdown-preview ol{margin:.2em 0}.markdown-preview ul,.markdown-preview ol{padding-left:1.25em}.markdown-preview blockquote{color:#64748b;border-left:3px solid #cbd5e1;padding-left:.65em}.markdown-preview code{background:#e2e8f0;border-radius:4px;padding:.08em .28em;font-family:Fira Code,ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.9em}.markdown-preview a{color:#2563eb}.markdown-preview img{border-radius:4px;max-width:100%;margin:.25em 0;display:block}.description-block-content{width:220px;position:relative}.description-position-button{z-index:2;color:#475569;cursor:pointer;opacity:0;background:#fff;border:1px solid #cbd5e1;border-radius:999px;justify-content:center;align-items:center;width:18px;height:18px;padding:0;transition:background-color .15s,color .15s,opacity .15s;display:flex;position:absolute}.math-block.description-mode:hover .description-position-button,.math-block.description-mode:focus-within .description-position-button,.math-block.description-mode.has-menu .description-position-button{opacity:1}.description-position-button:hover,.description-position-button:focus-visible{color:#1d4ed8;background:#dbeafe;outline:none}.description-position-top{top:-20px;left:50%;transform:translate(-50%)}.description-position-left{top:50%;left:-22px;transform:translateY(-50%)}.description-position-right{top:50%;right:-22px;transform:translateY(-50%)}.description-editor{color:#475569;cursor:text;white-space:pre-wrap;outline:none;width:100%;min-height:1.45em;padding:2px 0;font-size:.9rem;line-height:1.35}.description-editor:empty:before{color:#94a3b8;content:attr(data-placeholder)}.page-break-block-content{color:#ef4444;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;width:100%;font-size:.72rem;font-weight:900;display:grid}.page-break-block-content:before,.page-break-block-content:after{content:"";background:repeating-linear-gradient(90deg,#ef4444 0 8px,#0000 8px 14px);height:1px}.unit-error{color:#ef4444;font-size:.75rem;font-weight:700}.block-context-menu{z-index:2000;cursor:default;min-width:190px;font-family:var(--ui-font);background:#fff;border:1px solid #cbd5e1;border-radius:6px;flex-direction:column;gap:2px;padding:6px;display:flex;position:fixed;box-shadow:0 12px 24px #0f172a29}.block-context-menu button{color:#1e293b;cursor:pointer;width:100%;font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;padding:7px 8px;font-size:.85rem}.block-context-menu button:hover,.block-context-menu button:focus-visible{background:#e2e8f0;outline:none}.context-menu-divider{background:#e2e8f0;height:1px;margin:4px 2px}.decimal-rounding-control{color:#475569;grid-template-columns:1fr 64px;align-items:center;gap:8px;padding:5px 6px 4px;font-size:.8rem;font-weight:600;display:grid}.decimal-rounding-control select{color:#1e293b;width:64px;font:inherit;background:#fff;border:1px solid #cbd5e1;border-radius:4px;padding:4px}.worksheet-footer{z-index:2400;height:var(--app-footer-height);background:var(--chrome-bg);border-top:1px solid var(--chrome-border);color:var(--chrome-muted);white-space:nowrap;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);font-size:.78rem;font-weight:700;font-family:var(--ui-font);justify-content:space-between;align-items:center;gap:18px;padding:0 18px;display:flex;position:fixed;bottom:0;left:0;right:0;box-shadow:0 -4px 14px #0f172a0f}.footer-stats,.zoom-controls{align-items:center;gap:18px;display:flex}.zoom-controls{gap:4px}.zoom-controls button{height:28px;color:var(--chrome-text);cursor:pointer;font:inherit;background:0 0;border:0;border-radius:5px;align-items:center;gap:5px;padding:5px 8px;font-size:.75rem;font-weight:800;display:inline-flex}.zoom-controls button:hover,.zoom-controls button:focus-visible{background:var(--chrome-hover);outline:none}.zoom-controls strong{min-width:44px;color:var(--chrome-text);text-align:center;font-size:.78rem}@media (width<=700px){.worksheet-footer{justify-content:flex-start;overflow-x:auto}.footer-stats{gap:12px}}@page{size:A4;margin:0}@media print{html,body,#root{width:var(--page-width);min-height:var(--page-height);background:#fff!important;overflow:visible!important}body{margin:0}.app-shell{min-height:auto;background:#fff!important;padding:0!important}.app-header,.worksheet-sidebar,.worksheet-footer,.canvas-area,.context-toolbar,.block-context-menu,.modal-backdrop,.math-suggestion-menu{display:none!important}.print-worksheet{width:var(--page-width);background:#fff;margin:0;display:block!important}.print-page{width:var(--page-width);height:var(--page-height);box-shadow:none;break-after:page;page-break-after:always;-webkit-print-color-adjust:exact;print-color-adjust:exact;border:0;margin:0;overflow:hidden}.print-page:last-child{break-after:auto;page-break-after:auto}.print-page-content{width:var(--page-width);height:var(--page-height);overflow:hidden}}
