:root{--bg:#f2f5f8;--card:#fff;--text:#192235;--muted:#697486;--border:#e3e8ef;--shadow:0 8px 24px rgba(31,45,61,.075),0 1px 3px rgba(31,45,61,.045);--hover-shadow:0 12px 30px rgba(31,45,61,.11),0 2px 4px rgba(31,45,61,.05);--brand-surface:#fff;--icon-base:#fff;--chevron:#a8b1bd;--disabled-bg:rgba(255,255,255,.7);--pill-bg:#f0f2f5;--pill-text:#6f7988;--footer:#788394;--menu-hover:#f5f7fa;--menu-active:#edf2f7}
html[data-theme="dark"]{--bg:#11161c;--card:#1c222a;--text:#edf2f7;--muted:#aab5c3;--border:#323c49;--shadow:0 8px 24px rgba(0,0,0,.22),0 1px 3px rgba(0,0,0,.18);--hover-shadow:0 12px 30px rgba(0,0,0,.3),0 2px 4px rgba(0,0,0,.2);--brand-surface:#1c222a;--icon-base:#1c222a;--chevron:#8591a1;--disabled-bg:rgba(28,34,42,.72);--pill-bg:#252d37;--pill-text:#aab5c3;--footer:#98a4b4;--menu-hover:#252d37;--menu-active:#2a3440}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}body{min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}
.home-shell{width:min(1180px,calc(100% - 64px));min-height:100vh;margin:0 auto;padding:38px 0 26px;display:flex;flex-direction:column}.brand-row{min-height:54px;display:flex;align-items:center}.brand{display:inline-flex;align-items:center;gap:13px}.brand-mark{width:46px;height:46px;border-radius:12px;background:var(--brand-surface);box-shadow:0 2px 8px rgba(31,45,61,.08);display:grid;place-items:center}.brand-mark img{display:block;width:30px;height:30px}.brand-copy{display:flex;flex-direction:column;gap:3px;line-height:1.04}.brand-copy strong{font-size:20px;font-weight:760;letter-spacing:-.02em}.brand-copy small{font-size:13px;font-weight:500;color:var(--muted)}
.home-appearance{position:relative;margin-left:auto}.theme-button{width:38px;height:38px;padding:0;border:1px solid var(--border);border-radius:11px;background:var(--card);color:var(--muted);display:grid;place-items:center;box-shadow:0 1px 3px rgba(31,45,61,.045);cursor:pointer}.theme-button:hover{color:var(--text)}.theme-button:focus-visible{outline:2px solid currentColor;outline-offset:2px}.theme-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.theme-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:30;min-width:152px;padding:6px;border:1px solid var(--border);border-radius:12px;background:var(--card);box-shadow:var(--hover-shadow)}.theme-menu button{width:100%;min-height:36px;padding:0 10px;border:0;border-radius:8px;background:transparent;color:var(--text);font:inherit;font-size:13px;text-align:left;position:relative;cursor:pointer}.theme-menu button:hover,.theme-menu button:focus-visible{background:var(--menu-hover);outline:none}.theme-menu button[aria-checked="true"]{background:var(--menu-active);font-weight:650}
.intro{padding:54px 0 30px}.intro h1{margin:0;font-size:clamp(36px,4.1vw,58px);line-height:1.02;letter-spacing:-.045em;font-weight:790}.workspace-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.workspace-card{--accent:#6b7280;position:relative;min-height:154px;padding:27px 50px 25px 31px;background:var(--card);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);display:grid;grid-template-columns:58px minmax(0,1fr);align-items:center;column-gap:20px;overflow:hidden}.workspace-card .accent{position:absolute;left:0;top:20px;bottom:20px;width:5px;border-radius:0 5px 5px 0;background:var(--accent)}.workspace-card[href]{transition:transform .16s ease,box-shadow .16s ease}.workspace-card[href]:hover{transform:translateY(-2px);box-shadow:var(--hover-shadow)}.workspace-card[href]:active{transform:none}.workspace-card[href]:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 32%,transparent);outline-offset:3px}
.documents{--accent:#2f6fed}.spreadsheets{--accent:#267a45}.presentations{--accent:#d64a24}.pdf{--accent:#b42318}.txt{--accent:#d9a514}.epub{--accent:#7655c7}.app-icon{width:58px;height:58px;border-radius:15px;background:color-mix(in srgb,var(--accent) 11%,var(--icon-base));display:grid;place-items:center}.app-icon img{display:block;width:40px;height:40px;object-fit:contain}.workspace-copy{min-width:0}.workspace-copy strong{display:block;font-size:19px;line-height:1.15;font-weight:745;letter-spacing:-.018em}.workspace-copy small{display:block;margin-top:8px;font-size:13px;line-height:1.35;color:var(--muted)}.chevron{position:absolute;right:25px;top:50%;transform:translateY(-50%);font-size:32px;line-height:1;color:var(--chevron);font-weight:300}.unavailable{opacity:.62;box-shadow:none;background:var(--disabled-bg)}.coming-soon{display:inline-flex;margin-top:10px;padding:4px 8px;border-radius:999px;background:var(--pill-bg);color:var(--pill-text);font-size:11px;font-weight:720}
.home-footer{margin-top:auto;padding-top:42px;display:flex;align-items:center;gap:24px;color:var(--footer);font-size:12px}.home-footer nav{margin-left:auto;display:flex;align-items:center;gap:22px}.home-footer a:hover{text-decoration:underline}
@media(max-width:720px){.home-shell{width:min(100% - 28px,560px);padding:22px 0 20px}.brand-row{min-height:48px}.brand-mark{width:42px;height:42px;border-radius:11px}.brand-mark img{width:28px;height:28px}.brand-copy strong{font-size:19px}.theme-button{width:36px;height:36px;border-radius:10px}.intro{padding:36px 2px 22px}.intro h1{font-size:36px}.workspace-grid{grid-template-columns:1fr;gap:14px}.workspace-card{min-height:112px;padding:20px 46px 20px 24px;border-radius:17px;grid-template-columns:50px minmax(0,1fr);column-gap:16px}.workspace-card .accent{top:16px;bottom:16px;width:4px}.app-icon{width:50px;height:50px;border-radius:13px}.app-icon img{width:34px;height:34px}.workspace-copy strong{font-size:17px}.workspace-copy small{font-size:12px;margin-top:5px}.chevron{right:20px;font-size:29px}.home-footer{padding-top:28px;align-items:flex-start;flex-direction:column;gap:14px}.home-footer nav{margin-left:0;gap:16px;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.workspace-card[href]{transition:none}}

/* File launch hosting: Home routes a launched file into its workspace, shown full window. */
body.home-launching{overflow:hidden}
body.home-launching .home-shell{display:none}
.home-launch-host{position:fixed;inset:0;display:flex;flex-direction:column;background:var(--bg,#f2f5f8);z-index:10}
.home-launch-tabs{display:flex;gap:4px;padding:4px 8px;border-bottom:1px solid var(--line,#dce1e9);overflow-x:auto;flex:0 0 auto}
.home-launch-tab{border:1px solid var(--line,#dce1e9);border-radius:8px;background:var(--panel,#fff);color:inherit;font:inherit;font-size:13px;padding:4px 10px;white-space:nowrap;cursor:pointer}
.home-launch-tab[aria-selected="true"]{border-color:currentColor;font-weight:600}
.home-launch-frame{flex:1 1 auto;width:100%;border:0;display:block}
.home-launch-frame[hidden]{display:none}
.home-launch-note{margin:24px;font-size:15px}
html.home-launch-pending .home-shell{display:none}
.home-beta{margin-top:30px}.home-beta h2{margin:0 0 14px;font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}.home-beta .workspace-card{max-width:560px;min-height:0}.beta-extension{--accent:#0f766e}.beta-badge{display:inline-block;margin-left:8px;padding:1px 7px;border-radius:999px;background:color-mix(in srgb,var(--accent) 14%,transparent);color:var(--accent);font-size:11px;font-weight:700;letter-spacing:.03em;vertical-align:2px}
html[data-inkdos-host=tauri] .web-only{display:none}
.brand-row{gap:12px}.brand-row .tools-button{margin-left:auto}.brand-row .tools-button+.home-appearance{margin-left:0}
.tools-button{height:38px;padding:0 14px 0 11px;border:1px solid var(--border);border-radius:11px;background:var(--card);color:var(--text);display:inline-flex;align-items:center;gap:8px;font:600 14px/1 inherit;font-family:inherit;box-shadow:0 1px 3px rgba(31,45,61,.045);cursor:pointer}
.tools-button svg,.tools-item-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tools-button:hover{box-shadow:var(--hover-shadow)}
.tools-overlay{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));background:rgba(15,23,42,.28);-webkit-backdrop-filter:blur(12px) saturate(1.1);backdrop-filter:blur(12px) saturate(1.1)}
.tools-overlay[hidden]{display:none}
html.tools-open,html.tools-open body{overflow:hidden}
.tools-panel{width:min(560px,100%);max-height:min(680px,100%);display:flex;flex-direction:column;border:1px solid var(--border);border-radius:18px;background:var(--card);color:var(--text);box-shadow:0 24px 60px rgba(15,23,42,.28);overflow:hidden}
.tools-head{display:flex;align-items:center;gap:10px;padding:16px 14px 6px 20px}.tools-head h2{flex:1;margin:0;font-size:18px;font-weight:720;letter-spacing:-.01em}
.tools-close{width:34px;height:34px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:24px;line-height:1;cursor:pointer}.tools-close:hover{background:var(--menu-hover)}
.tools-search{margin:8px 16px 10px;height:40px;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:var(--bg);color:var(--text);font:inherit;font-size:15px}
.tools-list{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:0 10px 8px}
.tools-group{margin:12px 10px 6px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.tools-item{display:grid;grid-template-columns:40px minmax(0,1fr) 16px;align-items:center;gap:12px;padding:10px;border-radius:12px}.tools-item:hover,.tools-item:focus-visible{background:var(--menu-hover);outline:none}
.tools-item-icon{width:40px;height:40px;border-radius:11px;background:var(--pill-bg);color:var(--text);display:grid;place-items:center}
.tools-item-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.tools-item-copy strong{font-size:15px;font-weight:650}.tools-item-copy small{font-size:13px;color:var(--muted)}
.tools-item-chevron{color:var(--chevron);font-size:22px}
.tools-empty{margin:18px 10px;color:var(--muted);font-size:14px}
.tools-note{margin:0;padding:10px 20px 14px;border-top:1px solid var(--border);color:var(--muted);font-size:12px}
.tool-shell{position:fixed;inset:0;z-index:110;display:flex;flex-direction:column;background:var(--bg)}.tool-shell[hidden]{display:none}
.tool-shell-bar{display:flex;align-items:center;gap:10px;min-height:52px;padding:max(6px,env(safe-area-inset-top)) 12px 6px;background:var(--card);border-bottom:1px solid var(--border)}
.tool-shell-back{height:36px;padding:0 12px;border:1px solid var(--border);border-radius:10px;background:var(--card);color:var(--text);font:600 14px/1 inherit;font-family:inherit;cursor:pointer}.tool-shell-back:hover{background:var(--menu-hover)}
.tool-shell-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:16px;font-weight:720;letter-spacing:-.01em}
.tool-shell-badge{padding:2px 8px;border-radius:999px;background:var(--pill-bg);color:var(--pill-text);font-size:11px;font-weight:720}
.tool-shell-full{width:36px;height:36px;border-radius:9px;display:grid;place-items:center;color:var(--muted)}.tool-shell-full:hover{background:var(--menu-hover)}
.tool-shell-full svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tool-shell-body{flex:1;min-height:0}.tool-shell-frame{display:block;width:100%;height:100%;border:0;background:var(--bg)}
@media(max-width:720px){.tools-button{height:36px;padding:0 10px;border-radius:10px}.tools-button span,.tool-shell-back span{display:none}.tools-panel{max-height:100%}}
html[data-inkdos-host=tauri] .brand-row .home-appearance{margin-left:auto}
/* quick tools: the most used advanced tools, one tap from the Home (assets/advanced-tools.js opens them) */
.quick-tools[hidden]{display:none}.quick-tools{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px}.quick-tool{height:40px;padding:0 16px 0 12px;border:1px solid var(--border);border-radius:12px;background:var(--pill-bg);color:var(--text);display:inline-flex;align-items:center;gap:8px;font:600 14px/1 inherit;font-family:inherit;cursor:pointer}.quick-tool:hover{background:var(--menu-active)}.quick-tool:focus-visible{outline:3px solid color-mix(in srgb,#2f6fed 32%,transparent);outline-offset:2px}.quick-tool svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* engine switch (assets/engine-switch.js): Light = InkDOS editors, Complete = ONLYOFFICE editors on the InkDOS-tools origin */
.engine-switch{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:18px}.engine-label{font-size:13px;font-weight:700;color:var(--muted)}.engine-segment{display:inline-flex;padding:3px;border:1px solid var(--border);border-radius:12px;background:var(--pill-bg)}.engine-segment button{height:32px;padding:0 14px;border:0;border-radius:9px;background:transparent;color:var(--muted);font:600 13px/1 inherit;font-family:inherit;cursor:pointer}.engine-segment button[aria-pressed=true]{background:var(--card);color:var(--text);box-shadow:0 1px 3px rgba(31,45,61,.12)}.engine-segment button:focus-visible{outline:3px solid color-mix(in srgb,#2f6fed 32%,transparent);outline-offset:1px}.engine-note,.engine-offline{flex-basis:100%;color:var(--footer);font-size:12px;line-height:1.4}.engine-offline:empty{display:none}.engine-offline[data-state=online]{color:#b45309}
/* Full office (beta), superseded by the engine switch above (kept for the legacy markup) */
.beta-office{display:flex;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:28px}.beta-tool{text-decoration:none}.beta-office small{color:var(--footer);font-size:12px;line-height:1.4}
@media(max-width:720px){.quick-tools{margin-top:16px;gap:8px}.quick-tool{height:38px;padding:0 12px 0 10px;font-size:13px}}
