@font-face {
  font-family: "Tazdayt Noufouss";
  src: url("/assets/fonts/Tazdayt-Noufouss-Unicode.otf") format("opentype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-soft: #f8f9fb;
  --panel: #ffffff;
  --panel-warm: #f8f9fb;
  --panel-pink: var(--accent-soft);
  --line: #e2e4e8;
  --line-strong: #cdd1d8;
  --text: #202124;
  --text-soft: #667085;
  --muted: #667085;
  --accent: #ff2d87;
  --accent-deep: #e60067;
  --accent-soft: #ffe5f0;
  --accent-glow: rgba(255, 45, 135, .2);
  --on-accent: #fff;
  --yellow: #ffe537;
  --mint: #00bfae;
  --orange: #ff6b2c;
  --danger: #d95b45;
  --shadow: 0 12px 30px rgba(83, 68, 36, .08);
  --radius: 8px;
  --desktop-wallpaper: linear-gradient(132deg, #f1f2f3 0%, #e6e8eb 48%, #d9dde1 100%);
  --desktop-wallpaper-position: center;
  --desktop-wallpaper-overlay: 0;
  --dock-size-factor: 1;
  --time-font: "Tazdayt Noufouss", "Segoe UI", "Microsoft YaHei", sans-serif;
  /* iOS-style lock/login glass surface. Keep the panel light and readable
     over every built-in wallpaper without introducing a heavy shadow. */
  --lock-panel-bg: rgba(255, 255, 255, .62);
  --lock-panel-border: rgba(255, 255, 255, .7);
  --lock-panel-text: #17191c;
  --lock-error: #a31637;
  --lock-panel-muted: rgba(45, 51, 63, .7);
  --lock-input-bg: rgba(255, 255, 255, .3);
  --lock-input-border: rgba(255, 255, 255, .58);
  --lock-input-text: #17191c;
  --lock-input-label: rgba(63, 70, 85, .72);
  font-family: system-ui, "Segoe UI Variable", "Segoe UI", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16171c;
  --bg-soft: #1d1f25;
  --panel: #22242b;
  --panel-warm: #292a31;
  --panel-pink: var(--accent-soft);
  --line: #3a3c45;
  --line-strong: #50535e;
  --text: #f4f4f6;
  --text-soft: #b9bbc3;
  --muted: #8f929d;
  --shadow: 0 12px 30px rgba(0, 0, 0, .22);
  --lock-panel-bg: rgba(20, 24, 33, .64);
  --lock-panel-border: rgba(255, 255, 255, .22);
  --lock-panel-text: #f5f7fb;
  --lock-error: #ffd0df;
  --lock-panel-muted: rgba(236, 240, 248, .7);
  --lock-input-bg: rgba(11, 15, 23, .3);
  --lock-input-border: rgba(255, 255, 255, .24);
  --lock-input-text: #f5f7fb;
  --lock-input-label: rgba(235, 239, 247, .72);
}
:root[data-color-theme="ios-gray"] { --accent: #667085; --accent-deep: #475467; --accent-soft: #eaecf0; --accent-glow: rgba(102,112,133,.22); }
:root[data-color-theme="neon-pink"] { --accent: #ff2d87; --accent-deep: #d9146c; --accent-soft: #ffe5f0; --accent-glow: rgba(255,45,135,.2); }
:root[data-color-theme="midnight"] { --accent: #8d7cff; --accent-deep: #6c59df; --accent-soft: #e8e4ff; --accent-glow: rgba(108,89,223,.22); }
:root[data-color-theme="mint"] { --accent: #00a896; --accent-deep: #087f73; --accent-soft: #d9f7f2; --accent-glow: rgba(0,168,150,.2); }
:root[data-color-theme="sunset"] { --accent: #e96d2f; --accent-deep: #c4511d; --accent-soft: #ffeadc; --accent-glow: rgba(233,109,47,.2); }
:root[data-color-theme="accounting-green"] { --accent: #15803d; --accent-deep: #166534; --accent-soft: #e8f5ec; --accent-glow: rgba(21,128,61,.2); --on-accent: #fff; }
:root[data-color-theme="canvas-blue"] { --accent: #007aff; --accent-deep: #0064d4; --accent-soft: #eaf3ff; --accent-glow: rgba(0,122,255,.2); --on-accent: #fff; }
:root[data-theme="dark"][data-color-theme="accounting-green"] { --accent: #4ade80; --accent-deep: #86efac; --accent-soft: #173d2a; --accent-glow: rgba(74,222,128,.24); --on-accent: #10251a; }
:root[data-theme="dark"][data-color-theme="canvas-blue"] { --accent: #0a84ff; --accent-deep: #409fff; --accent-soft: #1c3152; --accent-glow: rgba(10,132,255,.24); --on-accent: #fff; }
:root[data-theme="dark"][data-color-theme="ios-gray"] { --accent: #a5afc0; --accent-deep: #c1c9d6; --accent-soft: #303642; --on-accent: #17191f; }
:root[data-theme="dark"][data-color-theme="neon-pink"] { --accent: #ff75b0; --accent-deep: #ff99c4; --accent-soft: #442337; --on-accent: #2a111d; }
:root[data-theme="dark"][data-color-theme="midnight"] { --accent: #b1a4ff; --accent-deep: #c8beff; --accent-soft: #302c47; --on-accent: #201b35; }
:root[data-theme="dark"][data-color-theme="mint"] { --accent: #58ceba; --accent-deep: #86dfcf; --accent-soft: #1c3b38; --on-accent: #102d28; }
:root[data-theme="dark"][data-color-theme="sunset"] { --accent: #ffa16e; --accent-deep: #ffba94; --accent-soft: #442f27; --on-accent: #352015; }
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after { transition: none !important; animation: none !important; }

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; padding: 9px 13px; transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
button:hover { border-color: #bfc2bd; background: #fafaf8; }
button:focus-visible { outline: 3px solid var(--accent-glow); outline-offset: 2px; }
button.primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }
button.primary:hover { background: var(--accent-deep); color: var(--on-accent, #fff); }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { border-right: 1px solid var(--line); background: var(--panel); padding: 20px 14px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 10px 24px; font-size: 18px; font-weight: 800; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft), 0 0 18px var(--accent-glow); }
.nav { display: grid; gap: 6px; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; border-color: transparent; background: transparent; text-align: left; }
.nav button:hover { background: var(--panel-pink); }
.nav button.active { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; }
.nav-icon { width: 24px; text-align: center; font-size: 17px; }
.content { max-width: 1280px; width: 100%; padding: 30px 38px 46px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.toolbar-actions { display: flex; gap: 8px; }
.eyebrow { color: var(--text-soft); font-size: 11px; letter-spacing: 0; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-size: 28px; letter-spacing: 0; }
h2 { letter-spacing: 0; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.module { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 19px; box-shadow: var(--shadow); }
.module:hover { border-color: var(--accent); }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.module h2 { margin: 5px 0 6px; font-size: 18px; }
.module p { min-height: 40px; color: var(--text-soft); font-size: 14px; line-height: 1.5; }
.module-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.status { display: inline-flex; align-items: center; gap: 7px; color: var(--mint); font-size: 13px; }
.status::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; content: ""; }
.status.closed { color: var(--muted); }
.drawer-panel { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 22px; box-shadow: var(--shadow); }
.drawer-panel > p { color: var(--text-soft); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.drawer-header h2 { margin: 5px 0 0; font-size: 21px; }
.drawer-body { margin-top: 22px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; }
.subpanel { border: 1px solid var(--line); border-radius: 13px; background: var(--panel-warm); padding: 18px; }
.subpanel h3 { margin: 0 0 14px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.field { position: relative; min-width: 0; --field-border-color: var(--line-strong); --field-radius: 9px; }
.field input, .field textarea, .field select { position: relative; z-index: 1; display: block; width: 100%; border: 1px solid transparent; border-radius: var(--field-radius); outline: 0; background: var(--panel-warm); color: var(--text); padding: 14px 12px 7px; transition: .16s ease; }
.field input, .field select { min-height: 43px; }
.field textarea { min-height: 92px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-soft); opacity: 1; transition: color .16s ease, opacity .16s ease; }
.field:focus-within > input::placeholder, .field:focus-within > textarea::placeholder, .field.is-floating > input::placeholder, .field.is-floating > textarea::placeholder { color: transparent; opacity: 0; }
.field label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; display: none; }
/* The native legend owns the floating caption and therefore the border notch.
   Keeping the label clipped avoids two independently positioned captions. */
.field-outline { position: absolute; z-index: 2; inset: 0; min-inline-size: 0; width: 100%; margin: 0; padding: 0 9px; border: 1px solid var(--field-border-color); border-radius: var(--field-radius); pointer-events: none; transition: border-color .16s ease, box-shadow .16s ease; }
.field-outline legend { display: block; width: 0; max-width: 0; height: 12px; margin: 0 0 0 4px; padding: 0 4px; overflow: hidden; background: transparent; color: transparent; font-size: 12px; font-weight: 600; line-height: 12px; text-shadow: none; visibility: hidden; white-space: nowrap; }
.field:focus-within > .field-outline legend, .field.is-floating > .field-outline legend { width: max-content; max-width: calc(100% - 18px); overflow: visible; color: var(--accent); visibility: visible; }
.field > :is(input, textarea, select):focus ~ .field-outline { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.field > :is(input, textarea, select):disabled ~ .field-outline { opacity: .5; }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.canvas-preview { min-height: 230px; border: 1px dashed var(--accent); border-radius: 12px; background: var(--accent-soft); padding: 16px; }
.canvas-toolbar { display: flex; gap: 7px; margin-bottom: 14px; }
.canvas-toolbar span { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.canvas-node { width: 155px; border: 1px solid var(--accent); border-radius: 10px; background: var(--panel); padding: 12px; box-shadow: 0 7px 18px var(--accent-glow); }
.canvas-node strong { display: block; font-size: 13px; }
.canvas-node small { color: var(--text-soft); }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.metric { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 11px; }
.metric strong { display: block; margin-top: 4px; font-size: 20px; }
.desktop { --app-cell-size: 132px; position: relative; width: 100%; min-height: 100dvh; overflow: hidden; background: var(--desktop-wallpaper); background-position: var(--desktop-wallpaper-position); background-size: cover; color: #191b1f; }
.desktop::before { position: absolute; inset: 0; z-index: 0; background: rgba(255, 255, 255, var(--desktop-wallpaper-overlay)); content: ""; pointer-events: none; }
.desktop-statusbar { position: relative; z-index: 2; display: flex; width: 100%; max-width: 1440px; margin: 0 auto; justify-content: flex-end; padding: 20px 32px 0; }
.desktop-time { display: grid; min-width: 104px; justify-items: center; gap: 1px; border: 1px solid rgba(255,255,255,.72); border-radius: 17px; background: rgba(255,255,255,.5); padding: 7px 12px 6px; color: #1e2024; font-style: normal; font-variant-numeric: tabular-nums; box-shadow: 0 8px 24px rgba(40,44,49,.08), inset 0 1px rgba(255,255,255,.55); backdrop-filter: blur(18px) saturate(135%); }
.desktop-time b { font-size: 18px; font-weight: 720; line-height: 1.05; }
.desktop-time small { color: #686d75; font-size: 10px; line-height: 1.15; }
.home-screen { position: relative; z-index: 1; width: 100%; max-width: none; min-height: calc(100dvh - 72px); margin: 0 auto; padding: 36px clamp(24px, 4vw, 64px) 138px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, var(--app-cell-size)); justify-content: start; gap: 18px 18px; }
.app-icon { position: relative; display: flex; align-items: center; width: 100%; min-width: 0; min-height: 126px; border: 0; background: transparent; flex-direction: column; gap: 11px; padding: 10px 8px; color: #191b1f; }
.app-icon:hover { border: 0; background: transparent; box-shadow: none; color: #191b1f; }
.app-icon:active { transform: translateY(0) scale(.985); }
.app-icon.launching { pointer-events: none; animation: app-launch .14s ease both; }
.app-icon.selected .app-icon-glyph { outline: 3px solid var(--accent-glow); outline-offset: 3px; }
.app-icon-glyph { display: grid; width: 76px; height: 76px; border: 1px solid rgba(0,0,0,.12); border-radius: 20px; background: linear-gradient(145deg, #687181, #3e4654); box-shadow: 0 10px 22px rgba(27,30,35,.18), inset 0 1px rgba(255,255,255,.26); color: #fff; place-items: center; transition: transform .16s ease, box-shadow .16s ease; }
.app-icon:hover .app-icon-glyph { box-shadow: 0 14px 28px rgba(27,30,35,.24), 0 0 0 4px rgba(255,255,255,.28); transform: translateY(-4px) scale(1.035); }
.app-icon-surface { display: contents; }
.app-icon-glyph img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 4px 7px rgba(0,0,0,.2)); user-select: none; }
.app-icon-glyph svg { width: 32px; height: 32px; stroke-width: 1.8; }
.app-icon.pink .app-icon-glyph { background: linear-gradient(145deg, #ff73b5, #d82476); border-color: rgba(143,0,64,.2); box-shadow: 0 10px 22px rgba(216,36,118,.22), inset 0 1px rgba(255,255,255,.32); color: #fff; }
.app-icon.yellow .app-icon-glyph { background: linear-gradient(145deg, #ffe66d, #e4b91e); border-color: rgba(91,73,0,.2); box-shadow: 0 10px 22px rgba(91,73,0,.18), inset 0 1px rgba(255,255,255,.55); color: #242619; }
.app-icon.blue .app-icon-glyph { background: linear-gradient(145deg, #7898cf, #3f619a); border-color: rgba(35,62,113,.2); box-shadow: 0 10px 22px rgba(40,66,117,.2), inset 0 1px rgba(255,255,255,.34); color: #fff; }
.app-icon.mint .app-icon-glyph { background: linear-gradient(145deg, #55cec0, #168f89); border-color: rgba(0,94,87,.2); box-shadow: 0 10px 22px rgba(0,143,134,.2), inset 0 1px rgba(255,255,255,.34); color: #fff; }
.app-icon.green .app-icon-glyph { background: linear-gradient(145deg, #36b76a, #15803d); border-color: rgba(21,128,61,.2); color: #fff; }
.app-icon-copy { display: grid; max-width: 100%; text-align: center; }
.app-icon-copy strong { overflow: hidden; font-size: 13px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.dock { --dock-base: 1; position: fixed; z-index: 4; bottom: 22px; left: 50%; display: flex; align-items: center; gap: 6px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.42); border-radius: 20px; background: rgba(38,40,46,.72); padding: calc(8px * var(--dock-base)) calc(10px * var(--dock-base)); box-shadow: 0 18px 42px rgba(18,20,24,.25), inset 0 1px rgba(255,255,255,.2); backdrop-filter: blur(22px) saturate(145%); }
.dock .app-icon, .dock .dock-item { width: calc(52px * var(--dock-base)); height: calc(52px * var(--dock-base)); }
.dock .app-icon-glyph, .dock .dock-item > span { width: calc(45px * var(--dock-base)); height: calc(45px * var(--dock-base)); }
.dock .app-icon-glyph img, .dock .dock-item > span img { width: calc(39px * var(--dock-base)); height: calc(39px * var(--dock-base)); }
.dock[data-size="small"] { --dock-base: .86; }
.dock[data-size="large"] { --dock-base: 1.16; }
.dock .app-icon { width: 52px; min-height: 52px; border: 0; gap: 0; padding: 0; transform: scale(var(--dock-scale, 1)); transform-origin: center bottom; transition: transform .12s ease; }
.dock .app-icon:hover { border: 0; background: rgba(255,255,255,.08); box-shadow: none; }
.dock .app-icon-glyph { width: 45px; height: 45px; border-radius: 13px; box-shadow: 0 5px 12px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.14); }
.dock .app-icon:hover .app-icon-glyph { box-shadow: 0 7px 16px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.14); transform: none; }
.dock .app-icon-glyph img { width: 39px; height: 39px; }
.dock .app-icon-glyph svg { width: 17px; height: 17px; }
.dock .app-icon .dock-running { position: absolute; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.95); }
.dock .app-icon.dock-bounce { animation: dock-bounce .8s cubic-bezier(.2,.8,.2,1) both; }
.dock-divider { width: 1px; height: 35px; margin: 0 3px; background: rgba(255,255,255,.24); }
.dock-item { display: grid; width: 52px; height: 52px; border: 0; background: transparent; padding: 0; place-items: center; transform: scale(var(--dock-scale, 1)); transform-origin: center bottom; transition: transform .12s ease; }
.dock-item:hover { border: 0; background: rgba(255,255,255,.08); box-shadow: none; }
.dock-item > span { display: grid; width: 45px; height: 45px; border-radius: 13px; background: rgba(244,245,246,.92); color: #24262b; place-items: center; box-shadow: 0 5px 12px rgba(0,0,0,.15), inset 0 1px rgba(255,255,255,.8); }
.dock-item > span img { width: 39px; height: 39px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.18)); user-select: none; }
.dock-item > span svg { width: 19px; height: 19px; }
.dock-item.dock-bounce { animation: dock-bounce .8s cubic-bezier(.2,.8,.2,1) both; }
.launcher { position: fixed; inset: 0; z-index: 10; display: grid; align-items: start; justify-items: center; padding-top: clamp(72px, 13vh, 138px); background: rgba(28,30,36,.18); backdrop-filter: blur(5px); }
.launcher[hidden] { display: none; }
.launcher-surface { width: min(520px, calc(100vw - 32px)); max-height: min(650px, calc(100vh - 120px)); overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--panel) 94%, transparent); color: var(--text); padding: 17px; box-shadow: 0 24px 70px rgba(24,27,32,.24), inset 0 1px var(--line); backdrop-filter: blur(24px) saturate(145%); }
.launcher-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.launcher-head h2 { margin: 3px 0 0; font-size: 20px; }
.launcher-search-field { margin-bottom: 10px; }
.launcher-search-field .field { --field-radius: 11px; }
.launcher-search-field input { background: var(--bg-soft); color: var(--text); }
.launcher-results { display: grid; gap: 4px; }
.launcher-result { display: grid; grid-template-columns: 38px 1fr 18px; align-items: center; gap: 11px; min-height: 54px; border: 0; border-radius: 11px; background: transparent; padding: 7px 9px; text-align: left; }
.launcher-result:hover { border-color: transparent; background: var(--accent-soft); box-shadow: none; }
.launcher-result > span:nth-child(2) { display: grid; gap: 2px; }
.launcher-result strong { font-size: 13px; }
.launcher-result small { color: var(--muted); font-size: 11px; }
.launcher-result > svg { width: 15px; color: var(--muted); }
.launcher-result-icon { display: grid; width: 38px; height: 38px; border-radius: 11px; background: #687181; color: #fff; place-items: center; }
.launcher-result-icon.pink { background: linear-gradient(145deg, #ff73b5, #d82476); }
.launcher-result-icon.yellow { background: linear-gradient(145deg, #ffe66d, #e4b91e); color: #242619; }
.launcher-result-icon.blue { background: linear-gradient(145deg, #7898cf, #3f619a); }
.launcher-result-icon.mint { background: linear-gradient(145deg, #55cec0, #168f89); }
.launcher-result-icon img { width: 31px; height: 31px; object-fit: contain; }
.launcher-result-icon svg { width: 19px; }
.desktop-selection { position: absolute; z-index: 3; border: 1px solid var(--accent); border-radius: 4px; background: var(--accent-glow); pointer-events: none; }
.desktop-context-menu { position: absolute; z-index: 8; display: grid; width: 184px; gap: 2px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--panel) 94%, transparent); padding: 6px; box-shadow: 0 14px 34px rgba(20,24,30,.18); backdrop-filter: blur(20px) saturate(145%); }
.desktop-context-menu[hidden] { display: none; }
.desktop-context-menu button { border: 0; border-radius: 7px; background: transparent; padding: 8px 10px; color: var(--text); font-size: 12px; text-align: left; }
.desktop-context-menu button:hover { border: 0; background: var(--accent-soft); box-shadow: none; }
@keyframes app-launch { 50% { transform: scale(.94); } 100% { transform: scale(1.025); } }
@keyframes dock-bounce { 0%, 100% { transform: translateY(0) scale(var(--dock-scale, 1)); } 12% { transform: translateY(-14px) scale(var(--dock-scale, 1)); } 24% { transform: translateY(0) scale(var(--dock-scale, 1)); } 36% { transform: translateY(-8px) scale(var(--dock-scale, 1)); } 48% { transform: translateY(0) scale(var(--dock-scale, 1)); } }
.app-shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; background: var(--bg); }
.app-sidebar { border-right: 1px solid color-mix(in srgb, var(--line) 78%, transparent); background: color-mix(in srgb, var(--panel) 82%, transparent); padding: 18px 12px; backdrop-filter: blur(22px) saturate(135%); }
.back-button { display: flex; align-items: center; gap: 4px; border-color: transparent; background: transparent; color: var(--text-soft); padding: 4px 8px; }.back-button:hover { border-color: transparent; background: var(--panel-pink); box-shadow: none; }
.app-identity { display: grid; margin: 30px 6px 24px; gap: 4px; border: 1px solid var(--line); border-radius: 15px; background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 12px; }.app-identity > span { display: grid; width: 42px; height: 42px; margin-bottom: 7px; border-radius: 13px; background: var(--accent); color: #fff; font-size: 21px; place-items: center; box-shadow: 0 5px 12px var(--accent-glow); }.app-identity > span svg { width: 22px; height: 22px; }.app-identity.yellow > span { background: var(--yellow); color: #453f00; box-shadow: 0 5px 12px rgba(255,229,55,.27); }.app-identity.blue > span { background: #5476af; color: #fff; box-shadow: 0 5px 12px rgba(63,97,154,.25); }.app-identity strong { font-size: 15px; }.app-identity small { color: var(--text-soft); font-size: 11px; }
.app-nav { display: grid; gap: 5px; }.app-nav button { display: flex; align-items: center; gap: 10px; min-height: 40px; border-color: transparent; border-radius: 10px; background: transparent; padding: 9px 11px; text-align: left; }.app-nav button svg { width: 16px; height: 16px; color: var(--muted); }.app-nav button:hover { background: var(--panel-pink); box-shadow: none; }.app-nav button.active { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent-deep); font-weight: 700; box-shadow: inset 3px 0 var(--accent); }.app-nav button.active svg { color: var(--accent-deep); }
.app-nav-group { display: grid; gap: 4px; margin-bottom: 16px; }
.app-nav-group:last-child { margin-bottom: 0; }
.app-nav-group-title { padding: 0 11px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0; }
.app-nav-group[hidden], .app-nav-group [data-nav-label][hidden] { display: none; }
.module-settings-page .settings-card { min-height: 0; }
.module-settings-page .settings-list { margin: 0 0 16px; }
.module-settings-page .settings-list dd { max-width: 38rem; }
.icon-button { display: inline-grid; width: 36px; height: 36px; min-width: 36px; padding: 0; place-items: center; font-weight: 700; }
.icon-button[data-select-tool] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.icon-button:disabled { cursor: default; opacity: .38; box-shadow: none; }
.wide { width: 100%; }
.app-content { max-width: none; min-width: 0; overflow: hidden; }
.canvas-app-shell .app-content { display: flex; height: 100vh; min-height: 640px; flex-direction: column; padding: 20px 24px 24px; }
.canvas-app-shell .toolbar { flex: 0 0 auto; padding-bottom: 14px; }
.canvas-runtime { width: 100vw; height: 100vh; position: relative; overflow: hidden; background: #f3f5f4; }
.canvas-runtime .legacy-canvas-frame { width: 100%; height: 100%; min-height: 0; border: 0; outline: 0; }
.canvas-runtime-actions { position: absolute; z-index: 2; top: calc(var(--window-chrome-height, 34px) + 28px); right: 8px; display: flex; flex-direction: column; gap: 6px; max-height: calc(100% - var(--window-chrome-height, 34px) - 42px); overflow-y: auto; scrollbar-width: none; opacity: .8; transition: opacity .18s ease; }
.canvas-runtime.task-workbench-open .canvas-runtime-actions { display: none; }
.canvas-runtime:hover .canvas-runtime-actions, .canvas-runtime-actions:focus-within { opacity: 1; }
.canvas-float-button { display: grid; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); padding: 0; place-items: center; box-shadow: none; }
.canvas-float-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.canvas-suite-toggle { border-color: color-mix(in srgb, var(--accent) 62%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel)); color: var(--accent-deep); }
.canvas-float-button svg { width: 15px; height: 15px; }
.legacy-canvas-host { display: grid; min-width: 0; min-height: 0; flex: 1 1 auto; grid-template-rows: auto minmax(0, 1fr); margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #f2f4f3; box-shadow: var(--shadow); }
.legacy-canvas-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; border-bottom: 1px solid var(--line); background: var(--panel); padding: 7px 10px; }
.legacy-canvas-controls > div { display: flex; align-items: center; gap: 8px; }
.legacy-project-picker { min-width: 0; }
.legacy-project-picker > span { flex: 0 0 auto; color: var(--text-soft); font-size: 12px; }
.legacy-project-picker select { width: min(320px, 32vw); min-width: 150px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; padding: 7px 9px; color: var(--text); }
.legacy-canvas-frame { display: block; width: 100%; height: 100%; min-height: 540px; border: 0; background: #f3f5f4; }
.accounting-legacy-host { display: flex; min-height: calc(100vh - 150px); flex-direction: column; margin-top: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: var(--shadow); }
.accounting-legacy-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 7px 12px 7px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 92%, var(--accent-soft)); }
.accounting-legacy-toolbar > span { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--text-soft); }
.accounting-legacy-toolbar > span i { width: 16px; color: var(--accent); }
.accounting-legacy-toolbar strong { color: var(--text); font-size: 13px; white-space: nowrap; }
.accounting-legacy-toolbar small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.accounting-legacy-frame { display: block; width: 100%; min-height: 720px; flex: 1 1 auto; border: 0; background: var(--panel); }
.accounting-runtime { width: 100vw; height: 100vh; position: relative; overflow: hidden; background: var(--panel); }
.accounting-runtime-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--panel); }
.accounting-runtime-actions { position: absolute; z-index: 5; top: 12px; right: 14px; display: flex; flex-direction: row; gap: 6px; height: 32px; opacity: .9; transition: opacity .18s ease; }
.accounting-runtime:hover .accounting-runtime-actions, .accounting-runtime-actions:focus-within { opacity: 1; }
.maintenance-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.maintenance-actions button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; }
.maintenance-actions button:hover { border-color: var(--accent); color: var(--accent); }
/* Compact storage control: keep the path readable without letting a long
   Windows path determine the card height. */
.settings-card:has(#canvas-output-directory) { min-height: 0; }
.settings-card:has(#canvas-output-directory) > p.hint:first-of-type { margin: 4px 0 14px; max-width: 34rem; }
.settings-card:has(#canvas-output-directory) > .setting-control { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; }
.settings-card:has(#canvas-output-directory) #canvas-output-directory { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-card:has(#canvas-output-directory) .storage-path { display: flex; align-items: center; gap: 7px; min-width: 0; margin: 10px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-card:has(#canvas-output-directory) > button { min-height: 36px; margin-top: 2px; }
.maintenance-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.maintenance-metric { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 9px; row-gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.maintenance-metric i { grid-row: span 2; width: 18px; color: var(--muted); }
.maintenance-metric span { color: var(--muted); font-size: 12px; }
.maintenance-metric strong { font-size: 18px; line-height: 1.1; }
.maintenance-metric.positive i { color: #16a34a; }.maintenance-metric.warning i { color: #d97706; }
.maintenance-details { display: grid; gap: 0; margin: 0; }
.maintenance-details div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.maintenance-details div:last-child { border-bottom: 0; }.maintenance-details dt { color: var(--muted); font-size: 12px; }.maintenance-details dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.maintenance-notice { width: 100%; min-height: 84px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface, var(--panel)); color: var(--text); font: inherit; }
.maintenance-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
@media (max-width: 760px) { .maintenance-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legacy-canvas-empty { display: grid; min-height: 0; flex: 1 1 auto; margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.legacy-canvas-empty .empty-state { min-height: 540px; }
.canvas-create-form { display: grid; width: min(100%, 380px); gap: 17px; margin-top: 8px; text-align: left; }
.notice-banner, .error-banner { margin-top: 16px; border-radius: 9px; padding: 10px 12px; font-size: 13px; }
.notice-banner { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.error-banner { border: 1px solid #efb5aa; background: #fff2ef; color: var(--danger); }
.canvas-layout { display: grid; grid-template-columns: 180px minmax(440px, 1fr) 260px; min-height: calc(100vh - 137px); margin-top: 20px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); overflow: hidden; box-shadow: var(--shadow); }
.project-rail, .inspector { min-width: 0; background: var(--panel-warm); padding: 16px; }
.project-rail { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.panel-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title h3 { margin: 0; font-size: 14px; }
.project-rail select { width: 100%; margin-top: 15px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; padding: 9px; color: var(--text); }
.rail-actions { display: grid; gap: 6px; margin-top: 15px; }
.rail-actions button { border-color: transparent; background: transparent; text-align: left; }
.rail-actions button:hover { background: var(--accent-soft); box-shadow: none; }
.stage-panel { min-width: 0; background: #efefec; }
.canvas-editor { display: grid; min-height: 100%; grid-template-rows: auto 1fr auto; }
.editor-toolbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); padding: 9px 12px; }
.tool-group { display: flex; align-items: center; gap: 6px; }
.zoom-value { width: 44px; color: var(--text-soft); font-size: 11px; text-align: center; }
.stage-viewport { position: relative; min-height: 480px; overflow: auto; background-color: #f1f1ee; background-image: radial-gradient(#cfcfc8 1px, transparent 1px); background-size: 18px 18px; }
.stage { position: relative; width: 920px; height: 620px; transform-origin: 0 0; }
.stage-node { position: absolute; display: grid; min-width: 116px; min-height: 62px; border: 1px solid #dbdbd3; border-radius: 9px; background: #fff; padding: 10px 12px; place-items: center; box-shadow: 0 6px 16px rgba(63,63,54,.1); touch-action: none; user-select: none; }
.stage-node:hover { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 3px var(--accent-glow); }
.stage-node.selected { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-glow), 0 7px 18px rgba(63,63,54,.12); }
.stage-node.node-text { min-width: 150px; background: transparent; border-style: dashed; box-shadow: none; font-size: 17px; font-weight: 750; }
.stage-node.node-image { min-width: 155px; min-height: 105px; background: linear-gradient(135deg, #fff, #fff0f6); color: var(--accent-deep); }
.stage-node.node-shape { min-width: 132px; min-height: 85px; background: var(--accent-soft); }
.editor-status { display: flex; justify-content: space-between; border-top: 1px solid var(--line); background: #fff; padding: 7px 12px; color: var(--muted); font-size: 10px; }
.inspector form { display: grid; gap: 17px; margin-top: 19px; }
.inspector hr { height: 1px; margin: 21px 0; border: 0; background: var(--line); }
.form-grid.compact { gap: 10px; }
.empty-state { display: grid; min-height: 480px; padding: 30px; place-content: center; place-items: center; text-align: center; }
.empty-state > span { display: grid; width: 62px; height: 62px; border-radius: 19px; background: var(--accent); color: #fff; font-size: 30px; place-items: center; box-shadow: 0 9px 22px var(--accent-glow); }
.empty-state h3 { margin: 17px 0 5px; font-size: 17px; }
.empty-state p { max-width: 280px; margin: 0 0 18px; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.empty-state.small { min-height: 180px; }
.empty-state.small p { margin: 0; }
.page-section { margin-top: 20px; }
.page-section.narrow { max-width: 720px; }
.section-heading { border-bottom: 1px solid var(--line); padding-bottom: 17px; }
.section-heading h2 { margin: 5px 0 0; font-size: 21px; }
.project-list { display: grid; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.project-row { display: grid; width: 100%; grid-template-columns: 48px 1fr auto; align-items: center; gap: 13px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 13px 15px; text-align: left; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: var(--panel-pink); box-shadow: none; }
.project-row > span:nth-child(2) { display: grid; gap: 4px; }
.project-row small { color: var(--muted); }
.project-row b { font-size: 22px; font-weight: 400; }
.trash-page .section-heading { align-items: flex-start; }
.trash-page .section-heading .hint { margin: 5px 0 0; }
.trash-list { margin-top: 18px; }
.trash-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); padding: 13px 15px; }
.trash-row:last-child { border-bottom: 0; }
.trash-row > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.trash-row small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.trash-actions { display: flex; align-items: center; gap: 7px; }
.trash-actions button { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); padding: 6px 10px; color: var(--text); font-size: 12px; }
.trash-actions button:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.trash-actions button.danger { color: #b42318; }
.project-thumb { display: grid; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; place-items: center; }
.task-form { display: grid; gap: 16px; margin-top: 25px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-warm); padding: 19px; }
.task-form button { justify-self: end; }
.task-result { display: grid; gap: 7px; margin-top: 15px; border: 1px solid #b7ebe5; border-radius: 11px; background: #f3fffd; padding: 15px; }
.task-result .status { justify-self: start; }
.task-result small { color: var(--muted); }
.tasks-page { max-width: 1120px; }
.task-page-actions { display: flex; align-items: center; gap: 7px; }
.task-page-actions .danger, .task-history-actions .danger { color: var(--danger); }
.task-page-actions .danger:disabled, .task-history-actions .danger:disabled { color: var(--muted); }
.task-filter-row { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 16px; }
.task-filter-row .compact-control { min-width: 240px; margin: 0; }
.task-filter-row .hint { margin: 0 0 8px; }
.task-data-error { color: var(--danger); }
.task-data-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 14px; margin-top: 16px; align-items: start; }
.task-history-card, .asset-library-card { min-width: 0; padding: 16px; }
.task-history-row, .asset-library-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 70px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.task-history-row:last-child, .asset-library-row:last-child { border-bottom: 0; }
.task-history-preview, .asset-library-preview { display: grid; width: 58px; height: 50px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-soft); place-items: center; }
.task-preview-media, .asset-preview-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.task-preview-media.compact { min-width: 100%; min-height: 100%; }
.task-no-preview { padding: 4px; color: var(--muted); font-size: 10px; text-align: center; }
.task-history-main, .asset-library-main { display: grid; min-width: 0; gap: 3px; }
.task-history-main strong, .asset-library-main strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.task-history-main small, .asset-library-main small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-history-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.task-history-head small { margin-left: auto; }
.task-history-error { margin: 0; overflow: hidden; color: var(--danger); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-history-actions { display: flex; align-items: center; gap: 4px; }
.task-action { width: 29px; height: 29px; min-width: 29px; }
.task-action svg { width: 14px; height: 14px; }
.asset-library-card .empty-state.small, .task-history-card .empty-state.small { min-height: 130px; }
.settings-list { margin: 20px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.settings-list > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 14px 16px; }
.settings-list > div:last-child { border-bottom: 0; }
.settings-list dt { color: var(--text-soft); }
.settings-list dd { display: flex; align-items: center; gap: 7px; margin: 0; font-weight: 650; }
.color-swatch { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.product-blue-swatch { background: #007aff; box-shadow: none; }
.field-spacer { height: 17px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; }
.accounting-migration-page .settings-columns { align-items: start; }
.migration-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 17px; }
.migration-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); padding: 7px 9px; color: var(--text-soft); font-size: 12px; }
.migration-count strong { color: var(--text); font-size: 14px; }
.migration-count.total { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.migration-count.total strong { color: var(--accent-deep); }
.migration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.migration-actions button, .migration-actions .upload-button { min-height: 36px; }
.migration-actions button { display: inline-flex; align-items: center; gap: 7px; }
.migration-actions svg { width: 15px; height: 15px; }
.backup-list { display: grid; gap: 0; margin-top: 11px; border-top: 1px solid var(--line); }
.backup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 52px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.backup-row:last-child { border-bottom: 0; }
.backup-row > div { display: grid; min-width: 0; gap: 3px; }
.backup-row strong, .backup-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-row small { color: var(--muted); font-size: 11px; }
.backup-row button { min-height: 30px; padding: 5px 10px; font-size: 12px; }
.migration-last { margin-top: 16px; }

.settings-page { max-width: 980px; }
.settings-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 16px; margin-top: 20px; }
.settings-card { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 20px; box-shadow: var(--shadow); }
.settings-card h3 { margin: 0 0 7px; font-size: 15px; }
.reconstruct-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); gap: 14px; }
.reconstruct-dropzone { display: grid; place-items: center; gap: 7px; min-height: 150px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--bg-soft); color: var(--text-soft); text-align: center; cursor: pointer; }
.reconstruct-dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.reconstruct-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.reconstruct-dropzone i { width: 28px; height: 28px; color: var(--accent); }
.reconstruct-dropzone strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reconstruct-dropzone small { color: var(--muted); }
.reconstruct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reconstruct-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.reconstruct-summary span { border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--text-soft); font-size: 12px; }
.reconstruct-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reconstruct-evidence > div { min-width: 0; border-top: 1px solid var(--line); padding-top: 10px; }
.reconstruct-evidence ul { display: grid; gap: 6px; margin: 9px 0 0; padding: 0; list-style: none; }
.reconstruct-evidence li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 5px 0; font-size: 12px; }
.reconstruct-evidence li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reconstruct-evidence li small { color: var(--muted); }
.offer-dialog { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(15, 17, 24, .28); }
.offer-dialog-surface { width: min(520px, 100%); border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 20px; box-shadow: 0 24px 70px rgba(20, 22, 28, .22); }
.offer-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; border-block: 1px solid var(--line); padding: 12px 0; }
.offer-meta strong { color: var(--accent-deep); }
.application-list { display: grid; gap: 8px; }
.application-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 12px 14px; }
.application-row strong, .application-row small, .application-row p { display: block; }
.application-row small, .application-row p { margin-top: 4px; color: var(--muted); font-size: 12px; }
.application-row p { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.application-actions { display: flex; gap: 6px; }
.notification-card { margin: 18px 0; }
.notification-card .panel-title { align-items: flex-start; }
.notification-list { display: grid; gap: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.notification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; border-bottom: 1px solid var(--line); padding: 9px 0; }
.notification-row > div { display: grid; min-width: 0; gap: 3px; }
.notification-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-row small, .notification-row p { margin: 0; color: var(--muted); font-size: 11px; }
.notification-row p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notification-row.unread strong { color: var(--accent-deep); }
.notification-row.read { opacity: .78; }
.commercial-offers { display: grid; gap: 12px; }
.commercial-offer { display: grid; grid-template-columns: 140px repeat(2, minmax(0, 1fr)); align-items: start; gap: 9px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.settings-subheading { margin-top: 26px !important; padding-top: 20px; border-top: 1px solid var(--line); }
.settings-form { display: grid; gap: 16px; margin-top: 19px; }
.setting-control { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 18px; color: var(--text-soft); font-size: 13px; }
.setting-control select { min-width: 130px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-warm); color: var(--text); padding: 8px 10px; }
.setting-control input[type="range"] { width: min(220px, 48%); accent-color: var(--accent); }
.setting-check { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--text-soft); font-size: 13px; }
.setting-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.background-presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 17px; }
.lock-wallpaper-presets { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.background-swatch { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 9px; background: transparent; padding: 5px; text-align: center; }
.background-swatch:hover, .background-swatch.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.background-swatch > span { display: block; aspect-ratio: 1.4; border-radius: 6px; background: var(--swatch); background-size: cover; }
.background-swatch small { overflow: hidden; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-upload { display: flex; align-items: center; gap: 10px; margin-top: 17px; }
.upload-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-warm); padding: 8px 10px; color: var(--text); cursor: pointer; font-size: 12px; }
.upload-button.disabled { cursor: default; opacity: .52; }
.upload-button svg { width: 15px; height: 15px; color: var(--accent); }
.settings-save-state { color: var(--mint); font-size: 12px; }
.logout-button { margin-top: 18px; border-color: transparent; background: transparent; color: var(--danger); padding-inline: 0; }
.boot-screen, .lock-screen { display: grid; min-height: 100vh; place-items: center; background: var(--desktop-wallpaper); color: #fff; }
.boot-screen { align-content: center; gap: 14px; color: var(--text); }
.boot-mark, .lock-mark { display: grid; width: 72px; height: 72px; border-radius: 22px; background: var(--accent); color: #fff; place-items: center; box-shadow: 0 0 0 7px var(--accent-soft), 0 14px 35px var(--accent-glow); }
.boot-mark svg { width: 30px; height: 30px; }
.boot-screen p { margin: 0; color: var(--text-soft); font-size: 13px; }
.lock-screen { position: relative; overflow: hidden; display: block; background: var(--lock-wallpaper); background-position: var(--lock-wallpaper-position); background-size: cover; }
.lock-screen-backdrop { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,18,30,.12) 0%, rgba(13,18,28,var(--lock-wallpaper-overlay, .12)) 58%, rgba(10,14,24,.34) 100%); backdrop-filter: saturate(118%); }
.lock-layout { position: relative; z-index: 1; display: grid; min-height: 100vh; align-content: start; justify-items: center; padding: clamp(42px, 10vh, 108px) 20px 42px; }
.lock-clock-group { display: grid; justify-items: center; color: #fff; text-align: center; text-shadow: 0 3px 22px rgba(0,0,0,.24); }
.lock-date { font-size: clamp(15px, 1.8vw, 20px); font-weight: 300; letter-spacing: .035em; font-family: "Segoe UI Variable", "Segoe UI Light", "Microsoft YaHei", sans-serif; font-variant-numeric: tabular-nums; }
.lock-clock { display: block; margin-top: 8px; font-size: clamp(78px, 12vw, 146px); font-weight: 260; letter-spacing: .01em; line-height: .9; font-family: var(--time-font); font-variant-numeric: tabular-nums; }
.lock-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 25px; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 600; }
.lock-mark { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); box-shadow: inset 0 1px rgba(255,255,255,.45); }
.lock-mark svg { width: 15px; height: 15px; }
.lock-panel { position: relative; display: grid; width: min(440px, calc(100vw - 40px)); justify-items: stretch; margin-top: clamp(42px, 8vh, 78px); border: 1px solid var(--lock-panel-border); border-radius: 24px; background: var(--lock-panel-bg); color-scheme: light; padding: 30px 22px 28px; box-shadow: none; backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%); text-shadow: none; text-align: center; }
.lock-panel::before { position: absolute; inset: 1px; border-radius: 23px; background: linear-gradient(180deg, rgba(255,255,255,.3), rgba(255,255,255,.08)); content: ""; pointer-events: none; }
.lock-panel > * { position: relative; z-index: 1; }
.lock-panel h1 { margin: 0; color: var(--lock-panel-text); font-size: 20px; font-weight: 720; }
.lock-panel p { margin: 6px 0 0; color: var(--lock-panel-muted); font-size: 13px; }
.lock-connection { display: grid; min-width: 0; gap: 4px; margin-top: 16px; color: var(--lock-panel-text); text-align: left; font-size: 12px; }
.lock-connection-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.lock-connection-row > span { overflow-wrap: anywhere; }
.lock-connection button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 4px 8px; border-color: var(--lock-input-border); border-radius: 6px; background: var(--lock-input-bg); color: var(--lock-panel-text); font-size: 12px; }
.lock-connection button svg { width: 14px; height: 14px; flex: none; }
.lock-connection button:disabled { opacity: .65; cursor: wait; }
.lock-connection small { color: var(--lock-panel-muted); font-size: 11px; overflow-wrap: anywhere; }
.lock-form { display: grid; width: 100%; gap: 13px; margin-top: 20px; text-align: left; }
.lock-form[hidden] { display: none !important; }
.lock-layout:has(#registration-form:not([hidden])) { padding: 20px; }
.lock-layout:has(#registration-form:not([hidden])) .lock-clock-group { display: none; }
.lock-layout:has(#registration-form:not([hidden])) .lock-panel { margin-top: 0; max-height: calc(100vh - var(--window-chrome-height) - 40px); overflow-y: auto; }
.lock-form > button[type="submit"] { width: 100%; min-height: 44px; box-shadow: none; }
.lock-form > button[type="submit"]:disabled { opacity: .55; cursor: not-allowed; }
@media (max-height: 760px) {
  .lock-layout:has(.lock-connection) { padding: 24px 20px 20px; }
  .lock-layout:has(.lock-connection) .lock-clock { font-size: 80px; }
  .lock-layout:has(.lock-connection) .lock-panel { margin-top: 24px; }
}
@media (max-height: 540px) {
  .lock-layout:has(.lock-connection) .lock-clock-group { display: none; }
  .lock-layout:has(.lock-connection) .lock-panel { margin-top: 0; max-height: calc(100vh - var(--window-chrome-height) - 44px); overflow-y: auto; }
}
/* Accounting's outlined field: only the notch's top edge opens for the label. */
.login-field { position: relative; min-width: 0; height: 44px; --login-outline-width: 1px; --login-outline-color: var(--lock-input-border); }
.login-field:focus-within { --login-outline-width: 2px; --login-outline-color: var(--accent); }
.login-field > input { display: block; width: 100%; height: 44px; min-width: 0; margin: 0; border: 0; border-radius: 12px; padding: 0 16px; background: var(--lock-input-bg); color: var(--lock-input-text); font-size: 14px; line-height: 1.25; outline: none; box-shadow: inset 0 1px rgba(255,255,255,.18); backdrop-filter: blur(16px) saturate(125%); -webkit-backdrop-filter: blur(16px) saturate(125%); }
.login-field-password > input { padding-right: 46px; }
.login-field-outline { position: absolute; inset: 0; display: grid; grid-template-columns: 12px max-content minmax(0, 1fr); pointer-events: none; }
.login-field-outline > span { min-width: 0; border-block: var(--login-outline-width) solid var(--login-outline-color); transition: border-color .15s ease; }
.login-outline-start { border-left: var(--login-outline-width) solid var(--login-outline-color); border-radius: 12px 0 0 12px; }
.login-outline-end { border-right: var(--login-outline-width) solid var(--login-outline-color); border-radius: 0 12px 12px 0; }
.login-outline-notch { position: relative; padding: 0 4px; }
.login-field-label { position: relative; top: calc(22px - var(--login-outline-width)); display: block; transform: translateY(-50%); background: transparent; color: var(--lock-input-label); font-size: 14px; line-height: 16px; font-weight: 400; white-space: nowrap; pointer-events: auto; cursor: text; text-shadow: none; transition: top .15s ease, font-size .15s ease, color .15s ease; }
.login-field:focus-within .login-outline-notch, .login-field > input:not(:placeholder-shown) ~ .login-field-outline .login-outline-notch { border-top-color: transparent; }
.login-field:focus-within .login-field-label, .login-field > input:not(:placeholder-shown) ~ .login-field-outline .login-field-label { top: calc(0px - var(--login-outline-width)); color: var(--lock-panel-text); font-size: 12px; }
.login-password-toggle { position: absolute; z-index: 1; top: 7px; right: 10px; display: grid; width: 30px; height: 30px; min-height: 0; border: 0; border-radius: 6px; background: transparent; color: #83838f; padding: 0; place-items: center; box-shadow: none; }
.login-password-toggle:hover { background: rgba(255,255,255,.28); color: var(--lock-panel-text); }
.login-password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.login-password-toggle svg { width: 18px; height: 18px; }
.app-store-list { display: grid; gap: 10px; margin-top: 20px; }
.app-store-row { display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 12px 14px; }
.app-store-row > div { display: grid; gap: 4px; min-width: 0; }
.app-store-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-store-icon { display: grid; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); place-items: center; overflow: hidden; }
.app-store-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-store-icon svg { width: 21px; height: 21px; }
.app-store-icon.pink { background: linear-gradient(145deg, #ff73b5, #d82476); color: #fff; }
.app-store-icon.yellow { background: linear-gradient(145deg, #ffe66d, #e4b91e); color: #242619; }
.app-store-icon.blue { background: linear-gradient(145deg, #7898cf, #3f619a); color: #fff; }
.app-store-icon.mint { background: linear-gradient(145deg, #55cec0, #168f89); color: #fff; }
.app-store-row button[disabled] { cursor: default; opacity: .65; }
.admin-users-card { margin-top: 16px; }
.admin-list { display: grid; gap: 0; margin-top: 17px; border-top: 1px solid var(--line); }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; border-bottom: 1px solid var(--line); }
.admin-row > span { display: grid; min-width: 0; gap: 3px; }
.admin-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-row code { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.provider-form-card { margin-bottom: 12px; }
.provider-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: end; }
.provider-form .form-footer { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.provider-form .form-footer .primary { display: inline-flex; align-items: center; gap: 6px; }
.provider-form .form-footer svg { width: 14px; height: 14px; }
.provider-card { border-top: 1px solid var(--line); padding: 2px 0 5px; }
.provider-card.is-disabled { opacity: .7; }
.provider-card:first-child { border-top: 0; }
.layering-api-fields { display: grid; gap: 12px; padding: 0 0 16px; }
.layering-api-fields .setting-control { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.layering-api-fields input { min-width: 0; width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; }
.layering-api-fields input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.layering-api-fields .setting-static strong { font-weight: 600; color: var(--text); }
.layering-api-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.layering-api-footer input[type="radio"], .layering-api-footer input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; padding: 0; flex: none; accent-color: var(--accent); }
@media (max-width: 760px) { .layering-api-fields .setting-control { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.provider-card-end, .provider-actions { display: inline-flex; align-items: center; gap: 6px; }
.provider-actions .icon-button { width: 28px; height: 28px; }
.provider-actions .icon-button.is-selected, .provider-actions .icon-button:disabled { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); opacity: 1; }
.provider-actions .icon-button.danger { color: var(--danger, #c0395b); }
.provider-details { margin: 0 0 2px; border-top: 1px solid var(--line); padding-top: 5px; }
.provider-details summary { display: flex; align-items: center; gap: 8px; min-height: 25px; color: var(--text-soft); cursor: pointer; list-style: none; font-size: 11px; }
.provider-details summary::-webkit-details-marker { display: none; }
.provider-details summary > span { font-weight: 650; }
.provider-details summary > small { overflow: hidden; flex: 1; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.provider-details summary > svg { width: 14px; height: 14px; color: var(--muted); transition: transform .16s ease; }
.provider-details[open] summary > svg { transform: rotate(180deg); }
.provider-models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 12px; margin: 5px 0 6px; color: var(--muted); font-size: 10px; }
.provider-models span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-models b { margin-right: 5px; color: var(--text-soft); font-weight: 650; }
.provider-catalog-meta { display: block; color: var(--muted); font-size: 10px; }
.provider-model-settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 7px; }
.provider-model-setting { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 10px; }
.provider-model-setting select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel-warm); color: var(--text); padding: 6px 7px; font-size: 11px; }
.provider-model-setting select:disabled { cursor: default; opacity: .6; }
.status-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-deep); background: var(--accent-soft); font-size: 11px; white-space: nowrap; }
.status-pill.muted { color: var(--muted); }
.status-pill.default { border-color: var(--accent); }
.status-pill.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, var(--panel)); color: var(--danger); }
.capability-routes { display: grid; gap: 0; }
.capability-route { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 37px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.capability-route code { color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.admin-user-toggle { flex: 0 0 auto; border-color: var(--line); background: transparent; color: var(--text-soft); padding: 6px 9px; font-size: 11px; }
.admin-user-toggle:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); box-shadow: none; }
.admin-category-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.admin-category-tab { display: grid; min-width: 118px; gap: 3px; border-color: transparent; border-radius: 9px; background: transparent; padding: 9px 11px; color: var(--text-soft); text-align: left; }
.admin-category-tab small { color: var(--muted); font-size: 10px; font-weight: 500; }
.admin-category-tab:hover { border-color: var(--line); background: var(--panel-warm); box-shadow: none; }
.admin-category-tab.active { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--accent-deep); box-shadow: inset 0 -2px var(--accent); }
.admin-category-tab.active small { color: var(--accent-deep); }
.admin-filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.admin-filter-tab { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; border-color: transparent; border-radius: 999px; background: transparent; padding: 5px 9px; color: var(--muted); font-size: 11px; }
.admin-filter-tab small { color: inherit; font-size: 10px; }
.admin-filter-tab:hover { border-color: var(--line); background: var(--panel-warm); box-shadow: none; }
.admin-filter-tab.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.admin-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 2px; }
.admin-summary > div { display: grid; gap: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-warm); padding: 11px 13px; }
.admin-summary strong { color: var(--accent-deep); font-size: 20px; line-height: 1; }
.admin-summary span { color: var(--muted); font-size: 11px; }
.admin-list-controls { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-top: 8px; }
.admin-list-controls .admin-filter-tabs { margin-top: 0; }
.admin-list-controls .compact-control { min-width: 170px; }
.settings-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -4px 0 14px; }
.settings-actions .icon-button { flex: 0 0 auto; }
.settings-reset-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; border-color: var(--line-strong); background: var(--panel-warm); color: var(--text-soft); padding: 7px 10px; font-size: 12px; }
.settings-reset-button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); box-shadow: none; }
.settings-reset-button svg { width: 14px; height: 14px; }
.settings-reset-button:disabled { cursor: default; opacity: .52; }
.entitlement-page { max-width: 1100px; }
.entitlement-page > .section-heading { align-items: flex-end; }
.compact-control { min-width: 190px; margin-top: 0; }
.compact-control select { min-width: 180px; }
.entitlement-card { display: grid; gap: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); padding: 18px; box-shadow: var(--shadow); }
.entitlement-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.entitlement-card-head h3 { margin: 4px 0 3px; font-size: 16px; }
.entitlement-card-head .hint { margin: 0; }
.entitlement-state { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; color: var(--muted); font-size: 11px; }
.entitlement-state.active { border-color: var(--mint); background: var(--accent-soft); color: var(--accent-deep); }
.entitlement-state.disabled { background: var(--panel-warm); }
.settings-readonly-note { margin: -4px 0 14px; }
.entitlement-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.entitlement-meta .setting-control { display: grid; align-content: start; justify-content: stretch; gap: 7px; margin: 0; }
.entitlement-meta .setting-control input, .entitlement-meta .setting-control select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-warm); color: var(--text); padding: 8px 10px; }
.entitlement-features { display: grid; gap: 9px; border-top: 1px solid var(--line); padding-top: 14px; }
.entitlement-features > strong { color: var(--text-soft); font-size: 12px; }
.entitlement-features .setting-check { align-items: flex-start; margin-top: 0; }
.entitlement-features .setting-check > span { display: grid; gap: 2px; }
.entitlement-features .setting-check b { color: var(--text); font-size: 12px; font-weight: 650; }
.entitlement-features .setting-check small { color: var(--muted); font-size: 11px; }
.entitlement-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding-top: 13px; }
.entitlement-card-foot .hint { margin: 0; }
.entitlement-page .entitlement-features { grid-column: auto; display: grid; align-items: stretch; gap: 9px; padding-top: 14px; }
@media (max-width: 760px) {
  .entitlement-page > .section-heading { align-items: stretch; flex-direction: column; }
  .compact-control { width: 100%; }
  .compact-control select { width: 100%; }
  .entitlement-meta { grid-template-columns: 1fr; }
  .entitlement-card-foot { align-items: stretch; flex-direction: column; }
}
@media (max-width: 760px) {
  .admin-category-tab { flex: 1 1 140px; min-width: 0; }
  .admin-summary { grid-template-columns: 1fr; }
  .admin-list-controls { align-items: stretch; flex-direction: column; gap: 3px; }
  .admin-list-controls .compact-control { min-width: 0; }
  .settings-actions { justify-content: flex-start; margin-top: 10px; }
  .provider-form { grid-template-columns: 1fr; }
  .provider-form .form-footer { align-items: flex-start; flex-direction: column; }
  .provider-models, .provider-model-settings { grid-template-columns: 1fr; }
  .task-data-grid { grid-template-columns: 1fr; }
  .task-filter-row { align-items: stretch; flex-direction: column; gap: 3px; }
  .task-filter-row .compact-control { min-width: 0; }
  .task-filter-row .hint { margin: 0; }
}
.lock-error { min-height: 18px; color: var(--lock-error); font-size: 12px; text-align: center; }
.lock-form [data-register-message][data-status="success"], .lock-form [data-register-message][data-status="pending"] { color: var(--lock-panel-text); }
@media (max-width: 760px) { .settings-columns { grid-template-columns: 1fr; } .reconstruct-grid, .reconstruct-evidence { grid-template-columns: 1fr; } .application-row, .commercial-offer { grid-template-columns: 1fr; } .application-actions { justify-content: flex-start; } .background-presets { grid-template-columns: repeat(2, 1fr); } .lock-wallpaper-presets { grid-template-columns: repeat(3, 1fr); } .migration-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .canvas-layout { grid-template-columns: 150px minmax(400px, 1fr) 230px; } .content { padding-inline: 24px; } }
@media (max-width: 900px) { .desktop { --app-cell-size: 122px; } .desktop-statusbar { padding: 26px 30px 0; } .home-screen { padding: 40px 30px 128px; } .app-shell { grid-template-columns: 72px 1fr; } .app-sidebar { padding-inline: 8px; } .back-button span, .app-identity strong, .app-identity small, .app-nav button { font-size: 0; } .app-identity { margin-inline: 7px; } .app-nav button { height: 38px; padding: 0; } .app-nav button::after { display: grid; font-size: 15px; content: "•"; place-items: center; } .canvas-layout { grid-template-columns: 1fr; overflow: visible; } .project-rail { border-right: 0; border-bottom: 1px solid var(--line); } .inspector { border-top: 1px solid var(--line); border-left: 0; } .stage-viewport { min-height: 420px; } .legacy-canvas-controls { align-items: stretch; flex-direction: column; } .legacy-canvas-controls > div { justify-content: space-between; } .legacy-project-picker select { width: 100%; } .workspace-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .desktop { --app-cell-size: 112px; } .desktop-statusbar { padding: 20px 18px 0; } .desktop-time { min-width: 92px; padding-inline: 9px; } .desktop-time small { display: block; } .home-screen { padding: 32px 18px 112px; } .app-grid { grid-template-columns: repeat(2, minmax(0, var(--app-cell-size))); gap: 12px; } .app-icon { min-height: 122px; padding-inline: 5px; } .dock { bottom: 14px; } .app-shell { display: block; } .app-sidebar { position: sticky; z-index: 5; top: 0; display: flex; align-items: center; height: 58px; border-right: 0; border-bottom: 1px solid var(--line); padding: 7px 12px; } .app-identity { display: flex; align-items: center; margin: 0 auto; }.app-identity > span { width: 34px; height: 34px; margin: 0; border-radius: 10px; font-size: 18px; }.app-identity strong { margin-left: 8px; font-size: 13px; }.app-nav { display: none; } .content { padding: 18px 14px 35px; }.canvas-app-shell .app-content { height: calc(100vh - 58px); min-height: 540px; padding: 14px; }.toolbar h1 { font-size: 20px; }.toolbar-actions button[data-home] { display: none; }.legacy-canvas-host { margin-top: 10px; }.legacy-canvas-frame { min-height: 420px; }.canvas-layout { margin-top: 14px; }.editor-toolbar { flex-wrap: wrap; gap: 7px; }.project-rail { display: none; }.form-grid { grid-template-columns: 1fr; }.metric-row { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
/* 按软件分类呈现租户权益，避免管理员面对一整列无层级表单。 */
.entitlement-group { display: grid; gap: 12px; margin: 0 0 22px; }
.entitlement-group-title { display: flex; align-items: baseline; gap: 10px; padding: 0 2px; font-size: 14px; font-weight: 700; }
.entitlement-group-title small { color: var(--muted); font-size: 12px; font-weight: 400; }

/* Frameless Electron shell
   Keep the native window lifecycle visible without bringing back the
   redundant title/icon chrome. The drag strip is deliberately narrow so
   canvas and accounting surfaces keep their pointer events. */
:root {
  --window-chrome-height: 34px;
}

.window-chrome {
  position: fixed;
  z-index: 1200;
  inset: 0 0 auto;
  display: flex;
  height: var(--window-chrome-height);
  pointer-events: none;
}

.window-drag-region {
  flex: 1 1 auto;
  min-width: 0;
  pointer-events: auto;
  -webkit-app-region: drag;
}

.window-controls {
  display: flex;
  align-items: stretch;
  height: var(--window-chrome-height);
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

.window-control {
  display: grid;
  width: 46px;
  height: var(--window-chrome-height);
  min-height: var(--window-chrome-height);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  padding: 0;
  place-items: center;
  box-shadow: none;
}

.window-control:hover {
  border: 0;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  box-shadow: none;
}

.window-control-close:hover {
  background: #d94b62;
  color: #fff;
}

.window-control svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.desktop,
.canvas-hub-shell,
.app-shell,
.lock-screen,
.boot-screen {
  padding-top: var(--window-chrome-height);
  box-sizing: border-box;
}

.desktop {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.desktop .home-screen {
  min-height: 0;
  height: calc(100vh - var(--window-chrome-height) - 72px);
  overflow: hidden;
}

body:has(.desktop),
body:has(.lock-screen),
body:has(.boot-screen) {
  overflow: hidden;
}

@supports (height: 100dvh) {
  .desktop {
    height: 100dvh;
    min-height: 100dvh;
  }

  .desktop .home-screen {
    height: calc(100dvh - var(--window-chrome-height) - 72px);
  }
}

.desktop-statusbar {
  padding-top: 12px;
}

.lock-screen,
.boot-screen {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.lock-layout {
  min-height: calc(100vh - var(--window-chrome-height));
  padding-top: clamp(28px, 8vh, 92px);
}

.canvas-hub-header {
  padding-top: 14px;
}

.canvas-runtime,
.accounting-runtime {
  height: calc(100vh - var(--window-chrome-height));
  /* The shell itself already reserves the fixed window-control strip via
     padding-top. A second margin here pushed embedded runtimes below the
     viewport and made the canvas/accounting surfaces look cropped. */
  margin-top: 0;
}

.upscale-runtime {
  position: fixed;
  inset: var(--window-chrome-height, 0px) 0 0;
  height: auto;
  margin-top: 0;
  overflow: hidden;
}
.upscale-runtime-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--surface, #f5f5f7); }
.upscale-settings-runtime { height: calc(100dvh - var(--window-chrome-height) - 64px); min-height: 440px; }

.canvas-runtime .legacy-canvas-frame,
.accounting-runtime-frame {
  height: 100%;
}

.canvas-app-shell .app-content {
  height: calc(100vh - var(--window-chrome-height));
  padding-top: 14px;
}

.app-shell .app-sidebar {
  min-height: calc(100vh - var(--window-chrome-height));
}

@media (max-width: 600px) {
  .window-control {
    width: 40px;
  }
}

/* Administrative surfaces share one list, form and action hierarchy. */
.settings-area-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; margin: 10px 0 6px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; }
.settings-area-switch button { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 36px; padding: 6px 3px; border: 0; background: transparent; color: var(--text-soft); border-radius: 4px; font-size: 12px; box-shadow: none; }
.settings-area-switch button[aria-current="page"] { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px #00000012; }
.settings-area-switch svg { width: 15px; height: 15px; flex-shrink: 0; }
.admin-workspace { max-width: 1200px; margin-inline: auto; color: var(--text); letter-spacing: 0; }
.admin-workspace [hidden] { display: none !important; }
.admin-page-header, .admin-workspace > .section-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-workspace h2 { margin: 4px 0 0; font-size: 23px; line-height: 1.35; letter-spacing: 0; }
.admin-workspace h3 { margin: 0; font-size: 15px; line-height: 1.5; letter-spacing: 0; }
.admin-workspace .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 0; }
.admin-workspace .hint { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.admin-workspace button, .admin-workspace .upload-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; max-width: 100%; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--text); background: var(--panel); font-size: 12px; line-height: 1.4; white-space: normal; box-shadow: none; }
.admin-workspace button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.admin-workspace button:not(:disabled):hover { filter: brightness(.97); border-color: var(--accent); }
.admin-workspace button:disabled { opacity: .45; cursor: not-allowed; }
.admin-workspace button.icon-button { width: 36px; height: 36px; padding: 8px; flex-shrink: 0; }
.admin-workspace button svg, .admin-workspace .upload-button svg { width: 15px; height: 15px; flex: 0 0 15px; }
.admin-page-actions, .admin-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.admin-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.admin-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); padding: 10px 2px; font-size: 14px; }
.admin-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 650; }
.admin-tabs button span { color: var(--muted); font-size: 12px; font-weight: 400; }
.admin-section { min-width: 0; padding: 22px 0; border-bottom: 1px solid var(--line); }
.admin-section:first-child { padding-top: 0; }
.admin-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.admin-toolbar, .admin-list-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.admin-toolbar { padding: 16px 0; border-bottom: 1px solid var(--line); justify-content: space-between; }
.admin-toolbar > .admin-field { min-width: 240px; max-width: 480px; flex: 1; }
.admin-search { display: flex; align-items: center; gap: 8px; min-width: 160px; max-width: 380px; flex: 1; height: 38px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); }
.admin-search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.admin-workspace input:not([type="checkbox"]):not([type="radio"]), .admin-workspace select, .admin-workspace textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; padding: 9px 10px; }
.admin-workspace input::placeholder, .admin-workspace textarea::placeholder { color: var(--muted); }
.admin-workspace .admin-search input[type="search"] { height: 34px; border: 0; border-radius: 0; padding: 0; background: transparent; outline: none; box-shadow: none; }
.admin-search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-list-toolbar > select { width: auto; max-width: 220px; min-height: 38px; }
.admin-list-toolbar .setting-control { margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-list-toolbar .setting-control > span { flex-shrink: 0; font-size: 12px; }
.admin-list-toolbar .hint { margin-left: auto; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; max-width: 960px; }
.admin-field { display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 0; color: var(--text-soft); font-size: 12px; }
.admin-field-full, .admin-form-grid .admin-form-footer { grid-column: 1 / -1; }
.admin-workspace textarea { min-height: 90px; resize: vertical; }
.admin-form-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 12px 0; }
.admin-workspace #commercial-form > .admin-form-footer { position: sticky; bottom: -36px; background: var(--bg); border-top: 1px solid var(--line); z-index: 2; }
.admin-editor { margin-bottom: 16px; }
.admin-editor:not([open]) { display: none; }
.admin-editor > summary { display: none; }
.admin-editor > form { border-left: 3px solid var(--line-strong); padding: 16px 20px; background: var(--bg-soft); }
.admin-table-wrap { overflow-x: auto; width: 100%; min-width: 0; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.admin-table th, .admin-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; max-width: 400px; }
.admin-table thead { background: var(--bg-soft); }
.admin-table td small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--panel) 65%, transparent); }
.admin-table th:last-child, .admin-table td:last-child { text-align: right; }
.admin-workspace.commercial-page th:last-child, .admin-workspace.commercial-page td:last-child { text-align: left; }
.admin-table-actions { width: 90px; }
.admin-empty, .admin-loading { padding: 32px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.admin-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 0 18px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.admin-setting-row .setting-control { display: flex; align-items: center; gap: 14px; margin: 0; }
.admin-workspace .application-list { gap: 0; }
.admin-workspace .admin-review-row { display: grid; grid-template-columns: minmax(120px, 1.05fr) minmax(150px, 1.6fr) 80px 160px; gap: 16px; align-items: center; margin: 0; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.admin-workspace .admin-list-head { font-size: 12px; color: var(--muted); background: var(--bg-soft); padding-block: 10px; }
.admin-review-row > div { min-width: 0; overflow-wrap: anywhere; }
.admin-record-primary strong { font-size: 13px; }
.admin-record-primary small, .admin-record-details small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.admin-record-details { font-size: 12px; }
.admin-workspace .application-row p { overflow: visible; white-space: normal; margin-bottom: 0; }
.admin-record-actions { justify-self: end; }
.admin-record-actions .application-actions button { white-space: nowrap; flex-shrink: 0; }
.admin-disclosure, .admin-details { border-top: 1px solid var(--line); margin-top: 24px; padding: 16px 0; }
.admin-disclosure > summary, .admin-details > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 0; }
.admin-disclosure[open] > summary, .admin-details[open] > summary { margin-bottom: 18px; }
.admin-workspace .notification-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0; background: transparent; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 20px 0; }
.admin-metric { padding-left: 14px; border-left: 2px solid var(--line); }
.admin-metric dt { font-size: 12px; color: var(--muted); }
.admin-metric dd { margin: 8px 0 0; font-size: 21px; font-weight: 650; }
.admin-metric.positive { border-color: #4fa77d; }.admin-metric.warning { border-color: #c58c39; }
.admin-key-values { margin: 0; }
.admin-key-values > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.admin-key-values dt { color: var(--muted); }.admin-key-values dd { margin: 0; overflow-wrap: anywhere; }
.admin-workspace .maintenance-alert-list > div { display: flex; gap: 10px; font-size: 13px; padding: 10px 0; }
.admin-workspace .maintenance-alert-list svg { width: 17px; height: 17px; flex-shrink: 0; color: #bf8435; }
.admin-workspace .entitlement-group { gap: 0; margin: 20px 0; }
.admin-workspace .entitlement-group-title { font-size: 12px; color: var(--muted); padding: 10px 0; }
.admin-workspace .entitlement-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 16px 0; background: transparent; box-shadow: none; }
.admin-workspace details.admin-entitlement { display: block; padding: 0; }
.admin-entitlement > summary { list-style: none; display: grid; grid-template-columns: minmax(140px, 1fr) 95px 170px 20px; gap: 16px; align-items: center; padding: 16px 0; cursor: pointer; font-size: 13px; }
.admin-entitlement > summary::-webkit-details-marker { display: none; }
.admin-entitlement > summary > svg { width: 16px; height: 16px; color: var(--muted); }
.admin-entitlement[open] > summary > svg { transform: rotate(180deg); }
.admin-entitlement-title { display: grid; gap: 5px; }.admin-entitlement-title small { color: var(--muted); font-size: 11px; }
.admin-entitlement-expiry { color: var(--text-soft); font-size: 12px; }
.admin-entitlement-editor { padding: 4px 0 18px; }
.admin-workspace .entitlement-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.admin-workspace .entitlement-features { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.admin-workspace .entitlement-features > strong { grid-column: 1/-1; }
.admin-workspace .entitlement-state { border-radius: 4px; text-align: center; font-size: 11px; }
.admin-workspace .status-pill { border-radius: 4px; font-size: 11px; white-space: nowrap; }
@media (max-width: 1000px) {
  .admin-workspace .admin-review-row { grid-template-columns: minmax(100px, 1fr) minmax(120px, 1.2fr) 70px 150px; gap: 10px; padding-inline: 6px; }
  .admin-workspace .application-actions { flex-wrap: wrap; }
  .admin-workspace .application-actions button { padding: 6px 8px; }
  .admin-entitlement > summary { grid-template-columns: minmax(100px, 1fr) 80px 115px 16px; gap: 10px; }
}
@media (max-width: 700px) {
  .app-shell.settings-app-shell .app-sidebar { flex-wrap: wrap; }
  .app-shell.settings-app-shell .settings-area-switch { order: 2; flex-basis: 100%; margin: 0; }
  .admin-workspace h2 { font-size: 21px; }
  .admin-form-grid, .admin-workspace .entitlement-meta, .admin-workspace .entitlement-features { grid-template-columns: minmax(0, 1fr); }
  .admin-toolbar > .admin-field { min-width: 180px; }
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-workspace .admin-review-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; }
  .admin-workspace .admin-list-head { display: none; }
  .admin-record-details { grid-column: 1/-1; grid-row: 2; }
  .admin-record-actions { grid-column: 1/-1; justify-self: start; }
  .admin-workspace #commercial-form > .admin-form-footer { bottom: -32px; }
  .admin-table th, .admin-table td { padding: 10px 8px; }
  .admin-search { max-width: none; flex-basis: 100%; }
  .admin-entitlement > summary { grid-template-columns: minmax(0, 1fr) 80px 16px; }
  .admin-entitlement-expiry { grid-column: 1/-1; grid-row: 2; }
  .admin-entitlement > summary > svg { grid-column: 3; grid-row: 1; }
}

/* The accounting iframe owns its header; keep the entire runtime below the
   host window controls, then reserve the app actions in the embedded header. */
.accounting-runtime {
  position: fixed;
  inset: var(--window-chrome-height, 0px) 0 0;
  height: auto;
  margin: 0;
}

.canvas-hub-shell { min-height: 100vh; background: var(--bg); color: var(--text); }
.canvas-hub-header { display: flex; align-items: center; gap: 28px; padding: 20px 36px 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.canvas-hub-brand { display: flex; align-items: center; gap: 10px; margin-right: 24px; padding-bottom: 18px; }
.canvas-hub-brand > img, .canvas-hub-brand > svg, .canvas-hub-brand .app-icon-art { width: 34px; height: 34px; object-fit: contain; }
.canvas-hub-brand h1 { margin: 0; font-size: 20px; white-space: nowrap; }
.canvas-hub-header > .icon-button { margin-left: auto; margin-bottom: 18px; }
.canvas-hub-tabs { display: flex; align-self: stretch; gap: 24px; }
.canvas-hub-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 0 4px 18px; color: var(--muted); background: transparent; box-shadow: none; white-space: nowrap; }
.canvas-hub-tabs button.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 650; }
.canvas-hub-main { max-width: 1440px; margin: auto; padding: 28px 36px 48px; }
.canvas-hub-main .page-section { margin-top: 0; }
.project-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.project-search { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 8px; width: min(360px, 48%); background: var(--panel); padding: 0 12px; }
.project-search svg { width: 17px; color: var(--muted); flex-shrink: 0; }
.project-search input { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; box-shadow: none; background: transparent; }
.project-controls > .primary { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.project-controls > .primary svg { width: 16px; height: 16px; }
.canvas-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.canvas-project-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.canvas-project-card[hidden] { display: none; }
.project-open { display: flex; flex-direction: column; gap: 8px; width: 100%; border: 0; border-radius: 0; padding: 0 0 14px; text-align: left; background: transparent; box-shadow: none; }
.project-open:hover { box-shadow: none; }
.project-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
.project-cover > svg { width: 34px; height: 34px; color: var(--muted); }
.project-cover img { width: 100%; height: 100%; object-fit: contain; }
.project-open strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; margin: 4px 16px 0; }
.project-open small { color: var(--muted); font-size: 12px; margin: 0 16px; }
.project-card-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 10px; border-top: 1px solid var(--line); }
.project-card-actions .icon-button { width: 32px; height: 32px; box-shadow: none; }
.project-empty[hidden] { display: none; }
.project-dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: #0005; }
.project-dialog { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 24px; background: var(--panel); }
.project-dialog h2 { margin: 0; font-size: 18px; }
.project-dialog .panel-title { margin-bottom: 24px; }
.project-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 700px) {
  .canvas-hub-header { gap: 14px; flex-wrap: wrap; padding: 16px 18px 0; }
  .canvas-hub-brand { margin-right: 0; padding-bottom: 12px; }
  .canvas-hub-header > .icon-button { order: 1; margin-bottom: 12px; }
  .canvas-hub-tabs { order: 2; width: 100%; gap: 24px; }
  .canvas-hub-tabs button { padding-bottom: 12px; }
  .canvas-hub-main { padding: 20px 18px 36px; }
  .project-controls { flex-wrap: wrap; gap: 10px; }
  .project-controls > .hint { display: none; }
  .project-search { flex: 1; width: auto; }
  .canvas-project-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
}

/* Unified workbench surface
   Keep the shell calm and symmetrical while leaving legacy APP runtimes
   responsible for their own business controls. */
:root {
  --shell-sidebar: 204px;
  --shell-content-max: 1180px;
  --shell-radius: 10px;
  --shell-shadow: 0 8px 24px rgba(27, 31, 36, .055);
}

body {
  background: var(--bg);
  text-rendering: optimizeLegibility;
}

button {
  min-height: 36px;
}

.app-shell {
  grid-template-columns: var(--shell-sidebar) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.app-sidebar {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
  padding: 18px 12px;
  backdrop-filter: none;
}

.app-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
}

.sidebar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  margin: 18px 4px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 78%, var(--bg));
  padding: 0 9px;
  color: var(--muted);
}

.sidebar-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.sidebar-search svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.sidebar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.sidebar-search input::placeholder {
  color: var(--muted);
}

.app-sidebar-profile {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 9px;
  min-height: 50px;
  margin: 0 4px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent-soft) 56%, var(--panel));
  padding: 8px 9px;
}

.app-sidebar-profile > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.app-sidebar-profile strong,
.app-sidebar-profile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-profile strong {
  font-size: 12px;
}

.app-sidebar-profile small {
  color: var(--muted);
  font-size: 10px;
}

.app-sidebar-profile > svg {
  width: 14px;
  color: var(--muted);
}

.sidebar-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  place-items: center;
}

.app-sidebar-kicker {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .02em;
}

.back-button {
  min-height: 32px;
  padding: 4px 7px;
  color: var(--text-soft);
  font-size: 13px;
}

.back-button svg {
  width: 16px;
  height: 16px;
}

.app-sidebar-context {
  display: grid;
  gap: 3px;
  margin: 27px 7px 20px;
  padding: 0 2px 18px;
  border-bottom: 1px solid var(--line);
}

.app-sidebar-context span {
  color: var(--muted);
  font-size: 11px;
}

.app-sidebar-context strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
}

.app-nav {
  gap: 3px;
}

.app-nav button {
  min-height: 38px;
  border-color: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-soft);
}

.app-nav button svg {
  width: 16px;
  height: 16px;
}

.app-nav button.active {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 82%, var(--panel));
  box-shadow: inset 2px 0 var(--accent);
}

.content {
  width: min(100%, var(--shell-content-max));
  max-width: var(--shell-content-max);
  margin: 0 auto;
  padding: 30px 42px 54px;
}

.toolbar {
  min-height: 52px;
  padding-bottom: 16px;
}

.toolbar h1 {
  font-size: 26px;
  font-weight: 720;
}

.toolbar-actions {
  align-items: center;
}

.settings-page {
  width: 100%;
  max-width: none;
}

.settings-page > .section-heading {
  align-items: center;
}

.settings-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.settings-card,
.subpanel,
.drawer-panel {
  border-radius: var(--shell-radius);
  box-shadow: var(--shell-shadow);
}

.settings-card {
  padding: 17px 18px;
}

.settings-card h3 {
  margin-bottom: 5px;
  font-weight: 700;
}

.settings-subheading {
  margin-top: 19px !important;
  padding-top: 16px;
}

.setting-control,
.setting-check {
  margin-top: 13px;
}

.background-presets {
  gap: 7px;
  margin-top: 13px;
}

.background-swatch {
  border-radius: 8px;
  padding: 4px;
}

.background-swatch > span {
  border-radius: 5px;
}

.settings-upload {
  margin-top: 13px;
}

.provider-form {
  gap: 8px;
}

.provider-form-card {
  margin-bottom: 10px;
}

.settings-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-card-heading > i {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.settings-card-heading .hint {
  margin-top: 3px;
}

.settings-overview-grid {
  align-items: start;
}

.settings-page > .settings-card,
.settings-page > .settings-columns > .settings-card {
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 20px 0;
}

.canvas-capabilities-page > .settings-columns {
  grid-template-columns: minmax(0, 1fr);
}

.canvas-storage-page .settings-card-cache {
  max-width: 860px;
}

.settings-page .settings-columns {
  column-gap: 28px;
}

.app-shell.settings-app-shell {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-shell.settings-app-shell .app-sidebar {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 12px;
}

.app-shell.settings-app-shell .app-sidebar-head { justify-content: space-between; }
.app-shell.settings-app-shell .back-button span { display: inline; font-size: 13px; }
.app-shell.settings-app-shell .app-sidebar-kicker { display: inline; }
.app-shell.settings-app-shell .app-nav { display: grid; }
.app-shell.settings-app-shell .app-nav button { justify-content: flex-start; height: 38px; padding: 0 10px; font-size: 13px; }
.app-shell.settings-app-shell .app-nav button::after { display: none; }
.app-shell.settings-app-shell .app-content { min-height: 0; overflow: auto; padding: 26px 30px 36px; }
.app-shell.settings-app-shell .page-section { margin-top: 0; }
.settings-mobile-navigation { display: none; }
.settings-shortcut-controls { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.settings-shortcut-controls button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.settings-shortcut-controls svg { width: 16px; height: 16px; flex: 0 0 auto; }

@media (max-width: 700px) {
  .app-shell.settings-app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app-shell.settings-app-shell .app-sidebar { flex-direction: row; align-items: center; height: auto; min-height: 0; gap: 12px; padding: 10px 14px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .app-shell.settings-app-shell .app-sidebar-head { flex: 0 0 auto; }
  .app-shell.settings-app-shell .back-button { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .app-shell.settings-app-shell .back-button span,
  .app-shell.settings-app-shell .app-sidebar-kicker,
  .app-shell.settings-app-shell .sidebar-search,
  .app-shell.settings-app-shell .app-nav { display: none; }
  .app-shell.settings-app-shell .settings-mobile-navigation { display: block; flex: 1; min-width: 0; }
  .settings-mobile-navigation select { width: 100%; height: 40px; min-width: 0; padding: 0 10px; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
  .app-shell.settings-app-shell .app-content { padding: 20px 16px 32px; }
  .app-shell.settings-app-shell .settings-columns { grid-template-columns: minmax(0, 1fr); }
  .app-shell.settings-app-shell .section-heading { flex-wrap: wrap; gap: 12px; }
  .app-shell.settings-app-shell .section-heading > div { min-width: 0; }
  .app-shell.settings-app-shell .settings-list > div { gap: 12px; }
  .app-shell.settings-app-shell .settings-list dd { overflow-wrap: anywhere; }
  .app-shell.settings-app-shell .cache-control-row { flex-wrap: wrap; }
}

.settings-card-lock,
.settings-card-cache {
  grid-column: 1 / -1;
}

.settings-inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 4px;
}

.settings-inline-controls .setting-control {
  min-width: 0;
}

.settings-subsection {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.settings-subsection > strong {
  color: var(--text-soft);
  font-size: 12px;
}

.cache-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 14px;
}

.cache-control-row input {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-warm);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.cache-control-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.cache-control-row button {
  min-width: 72px;
}

.directory-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.directory-control-row input { width: 100%; min-width: 0; }
.directory-control-row .icon-button { width: 40px; height: 40px; padding: 0; }
.accounting-local-path-card .cache-control-row { grid-template-columns: minmax(0, 1fr) 40px auto; }
.accounting-local-path-card [data-accounting-local-backup-choose] { min-width: 40px; padding-inline: 0; }

.desktop-statusbar {
  width: 100%;
  max-width: none;
  position: relative;
  padding-top: 22px;
  align-items: center;
  justify-content: flex-end;
  padding-inline: clamp(24px, 4vw, 64px);
}

.desktop-status-notice {
  position: absolute;
  top: 22px;
  left: clamp(24px, 4vw, 64px);
  max-width: min(62vw, 620px);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .desktop-status-notice {
    right: 18px;
    left: 18px;
    max-width: none;
    top: 58px;
  }
}

.desktop-launcher-button {
  display: grid;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.24);
  color: #32363e;
  padding: 0;
  place-items: center;
  box-shadow: none;
}

.desktop-launcher-button:hover {
  border: 0;
  background: rgba(255,255,255,.55);
  box-shadow: none;
}

.desktop-launcher-button svg {
  width: 16px;
  height: 16px;
}

.desktop-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-status-date {
  color: var(--text-soft);
  font-size: 13px;
  font-family: var(--time-font);
  font-variant-numeric: tabular-nums;
}

.desktop-datetime {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 36px;
  white-space: nowrap;
}

.desktop-time {
  min-width: 76px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  font-family: var(--time-font);
  font-variant-numeric: tabular-nums;
}

.desktop-time b {
  color: var(--text);
  font-size: 24px;
}

.desktop .app-grid .app-icon-copy,
.desktop .desktop-status-date,
.desktop .desktop-time b,
.desktop .desktop-launcher-button {
  color: var(--desktop-foreground, #191b1f);
}

body:has(.desktop) .window-control { color: var(--desktop-foreground, var(--text)); }
body:has(.desktop) .window-control-close:hover { color: #fff; }

.desktop .app-grid .app-icon-copy,
.desktop .desktop-datetime {
  text-shadow: var(--desktop-text-shadow, none);
}

.home-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 36px;
  padding-top: 24px;
}

.desktop-app-area {
  min-width: 0;
}

.desktop-rail {
  display: grid;
  gap: 14px;
}

.desktop-widget {
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 12px;
  background: rgba(255,255,255,.28);
  box-shadow: 0 10px 26px rgba(39, 45, 56, .07);
  backdrop-filter: blur(18px) saturate(125%);
}

.desktop-calendar {
  display: grid;
  gap: 2px;
  min-height: 156px;
  padding: 17px;
}

.desktop-calendar > span {
  color: #e14a55;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--time-font);
}

.desktop-calendar > strong {
  font-size: 44px;
  font-weight: 500;
  line-height: 1;
  font-family: var(--time-font);
  font-variant-numeric: tabular-nums;
}

.desktop-calendar > small {
  color: rgba(48, 54, 63, .6);
  font-size: 12px;
  font-family: var(--time-font);
}

.desktop-calendar > div {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  color: rgba(48, 54, 63, .56);
  font-size: 11px;
}

.desktop-calendar > div svg {
  width: 7px;
  height: 7px;
  fill: var(--accent);
  stroke: var(--accent);
}

.desktop-account {
  display: grid;
  gap: 15px;
  padding: 15px;
}

.desktop-account-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-account-head > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.desktop-account-head strong,
.desktop-account-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-account-head strong {
  font-size: 13px;
}

.desktop-account-head small {
  color: rgba(48, 54, 63, .56);
  font-size: 11px;
}

.desktop-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  place-items: center;
}

.desktop-lock-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--accent) 60%, #fff);
  border-radius: 8px;
  background: rgba(255,255,255,.22);
  color: var(--accent-deep);
  padding: 0 12px;
  font-size: 12px;
}

.desktop-lock-action svg {
  width: 14px;
  height: 14px;
}

.home-screen {
  width: 100%;
  max-width: none;
  padding-inline: clamp(28px, 3.2vw, 64px);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .app-sidebar {
    padding-inline: 9px;
  }
  .app-sidebar-kicker,
  .app-sidebar-context,
  .back-button span {
    display: none;
  }
  .app-sidebar-head {
    justify-content: center;
  }
  .app-nav button {
    justify-content: center;
    padding-inline: 0;
  }
  .content {
    padding-inline: 24px;
  }
}

@media (max-width: 760px) {
  .settings-columns {
    grid-template-columns: 1fr;
  }
  .settings-card-lock,
  .settings-card-cache {
    grid-column: auto;
  }
  .settings-inline-controls {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .content {
    padding-inline: 16px;
  }
  .home-screen {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .desktop-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Optional desktop widgets.  They share the shell palette and stay compact
   so the app grid remains the primary surface. */
.desktop-rail {
  align-content: start;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.desktop-widget {
  color: #20232a;
  border-color: rgba(255,255,255,.56);
  background: rgba(255,255,255,.34);
  box-shadow: 0 8px 22px rgba(39,45,56,.06);
}
.desktop-widget-head {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}
.desktop-widget-head > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
  flex: 1;
}
.desktop-widget-head strong,
.desktop-widget-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.desktop-widget-head strong { font-size: 14px; font-weight: 650; }
.desktop-widget-head small { color: var(--text-soft); font-size: 11px; }
.desktop-widget-icon,
.desktop-widget-icon-badge {
  display: grid;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(80,88,102,.16);
  border-radius: 9px;
  background: rgba(255,255,255,.46);
  color: var(--accent-deep);
  padding: 0;
  place-items: center;
}
.desktop-widget-icon { width: 27px; height: 27px; border-color: transparent; background: transparent; }
.desktop-widget [hidden] { display: none !important; }
.desktop-widget-icon:hover { border-color: rgba(80,88,102,.18); background: rgba(255,255,255,.48); color: var(--accent-deep); }
.desktop-widget-icon svg { width: 15px; height: 15px; }
.desktop-widget-icon-badge svg { width: 15px; height: 15px; }
.desktop-widget-icon-badge.weather { color: #1987a7; }
.desktop-widget-icon-badge.inspiration { color: #ad5d35; }
.desktop-widget-muted,
.desktop-widget-error {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.desktop-widget-error { color: #b5474b; }
.desktop-widget-loading { margin: 10px 0; color: rgba(48,54,63,.62); font-size: 11px; }

/* The bot mark uses a small face and antenna so the motion reads as a living
   assistant without taking space from the desktop. */
.desktop-bot-mark {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  animation: desktop-bot-float 3.2s ease-in-out infinite;
}
.desktop-bot-antenna {
  position: absolute;
  top: -3px;
  left: 15px;
  width: 1px;
  height: 7px;
  background: var(--accent);
}
.desktop-bot-antenna::after {
  position: absolute;
  top: -3px;
  left: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  content: "";
}
.desktop-bot-face {
  display: grid;
  width: 27px;
  height: 23px;
  border: 1px solid color-mix(in srgb, var(--accent) 58%, #fff);
  border-radius: 9px 9px 8px 8px;
  background: color-mix(in srgb, var(--accent-soft) 76%, #fff);
  color: var(--accent-deep);
  place-items: center;
  box-shadow: inset 0 1px rgba(255,255,255,.62);
}
.desktop-bot-face::before,
.desktop-bot-face::after {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  transform: translate(-4px, 1px);
}
.desktop-bot-face::after { transform: translate(4px, -2px); }
.desktop-bot-face svg { position: absolute; width: 10px; height: 10px; opacity: .25; }
.desktop-assistant-widget { padding: 15px; }
.desktop-assistant-body[hidden] { display: none; }
.desktop-assistant-body { margin-top: 9px; }
.desktop-assistant-response {
  border-left: 2px solid var(--accent);
  border-radius: 0 7px 7px 0;
  background: rgba(255,255,255,.28);
  padding: 8px 9px;
}
.desktop-assistant-response-label { color: var(--accent-deep); font-size: 10px; font-weight: 700; }
.desktop-assistant-response p { margin: 4px 0 0; font-size: 11px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.desktop-assistant-response small { display: block; margin-top: 5px; color: rgba(48,54,63,.5); font-size: 9px; }
.desktop-assistant-quick { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.desktop-assistant-quick button {
  min-height: 25px;
  border-color: rgba(80,88,102,.16);
  border-radius: 7px;
  background: rgba(255,255,255,.4);
  padding: 3px 7px;
  color: rgba(48,54,63,.78);
  font-size: 10px;
}
.desktop-assistant-quick button:hover { border-color: var(--accent); color: var(--accent-deep); }
.desktop-assistant-form { display: flex; gap: 8px; }
.desktop-assistant-form input {
  min-width: 0;
  flex: 1;
  height: 36px;
  border: 1px solid rgba(80,88,102,.2);
  border-radius: 8px;
  outline: 0;
  background: rgba(255,255,255,.38);
  padding: 0 9px;
  color: #20232a;
  font-size: 12px;
}
.desktop-assistant-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.desktop-widget-submit { display: grid; width: 36px; min-width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; padding: 0; place-items: center; }
.desktop-widget-submit:hover { background: var(--accent-deep); color: #fff; }
.desktop-widget-submit svg { width: 15px; height: 15px; }
.desktop-widget-loading { display: inline-flex; align-items: center; gap: 5px; }
.desktop-widget-loading::before { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); content: ""; animation: desktop-widget-pulse 1s ease-in-out infinite; }

.desktop-weather-widget,
.desktop-inspiration-widget { padding: 15px; }
.desktop-weather-body { min-height: 55px; }
.desktop-weather-reading { display: flex; align-items: baseline; gap: 8px; padding-top: 9px; }
.desktop-weather-reading strong { font-family: var(--time-font); font-size: 31px; font-weight: 560; line-height: 1; }
.desktop-weather-reading span { color: rgba(48,54,63,.7); font-size: 11px; }
.desktop-weather-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 5px; color: rgba(48,54,63,.58); font-size: 9px; }
.desktop-widget-link { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; margin-top: 7px; border: 0; background: transparent; padding: 0; color: var(--accent-deep); font-size: 11px; }
.desktop-widget-link:hover { border: 0; background: transparent; color: var(--accent); }
.desktop-widget-link svg { width: 12px; height: 12px; }
.desktop-inspiration-list { display: grid; gap: 3px; margin-top: 8px; }
.desktop-inspiration-item { display: flex; align-items: center; min-width: 0; gap: 7px; border-radius: 7px; padding: 6px 5px; color: inherit; text-decoration: none; }
.desktop-inspiration-item:hover { background: rgba(255,255,255,.42); }
.desktop-inspiration-item > span { display: grid; min-width: 0; flex: 1; gap: 1px; }
.desktop-inspiration-item strong { overflow: hidden; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.desktop-inspiration-item small { color: rgba(48,54,63,.55); font-size: 9px; }
.desktop-inspiration-item svg { width: 13px; height: 13px; color: rgba(48,54,63,.48); }

@keyframes desktop-bot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes desktop-widget-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

:root[data-theme="dark"] .desktop-widget { color: var(--text); border-color: rgba(255,255,255,.15); background: color-mix(in srgb, var(--panel) 94%, transparent); }
:root[data-theme="dark"] .desktop-widget-head small,
:root[data-theme="dark"] .desktop-widget-muted,
:root[data-theme="dark"] .desktop-widget-loading,
:root[data-theme="dark"] .desktop-widget-meta,
:root[data-theme="dark"] .desktop-weather-reading span,
:root[data-theme="dark"] .desktop-weather-meta,
:root[data-theme="dark"] .desktop-inspiration-item small { color: rgba(239,243,249,.62); }
:root[data-theme="dark"] .desktop-assistant-form input { border-color: rgba(255,255,255,.2); background: rgba(9,12,18,.28); color: #f3f5f8; }
:root[data-theme="dark"] .desktop-assistant-form input::placeholder { color: var(--text-soft); }
:root[data-theme="dark"] .desktop-inspiration-item > svg { color: var(--text-soft); }
:root[data-theme="dark"] .desktop-inspiration-item:hover,
:root[data-theme="dark"] .desktop-widget-icon:hover { background: rgba(255,255,255,.08); }
:root[data-theme="dark"] .desktop-assistant-quick button { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: rgba(239,243,249,.82); }

@media (max-width: 760px) {
  .desktop-rail { max-height: none; overflow: visible; }
}

.desktop .home-screen {
  height: calc(100dvh - var(--window-chrome-height) - 64px);
  grid-template-columns: minmax(0, 1fr) 320px;
  grid-template-rows: minmax(0, 1fr);
  padding-top: 20px;
  padding-bottom: 126px;
}
.desktop-rail { gap: 12px; padding: 2px 4px 4px; }
.desktop-widget { border-radius: 8px; background: color-mix(in srgb, var(--panel) 80%, transparent); border-color: color-mix(in srgb, var(--line) 70%, transparent); color: var(--text); box-shadow: 0 4px 14px rgba(25,30,36,.04); }
.desktop-widget-head .desktop-widget-icon { margin-left: auto; }
.desktop-widget-icon { min-height: 28px; }
.desktop-bot-mark { width: 38px; height: 38px; }
.desktop-bot-face { width: 33px; height: 28px; position: relative; border-radius: 8px; }
.desktop-bot-face::before, .desktop-bot-face::after { display: none; }
.desktop-bot-antenna { top: -1px; left: 19px; }
.desktop-bot-eyes { position: relative; width: 17px; height: 5px; animation: desktop-bot-blink 5s ease-in-out infinite; }
.desktop-bot-eyes::before, .desktop-bot-eyes::after { position: absolute; top: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-deep); content: ''; }
.desktop-bot-eyes::before { left: 0; }
.desktop-bot-eyes::after { right: 0; }
.desktop-assistant-widget.is-thinking .desktop-bot-mark { animation-duration: 1s; }
.desktop-assistant-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 12px; }
.desktop-assistant-quick button { display: flex; justify-content: space-between; align-items: center; gap: 4px; min-height: 32px; padding: 4px 7px; border: 0; background: transparent; color: var(--text-soft); font-size: 11px; text-align: left; }
.desktop-assistant-quick svg { flex: 0 0 auto; width: 12px; height: 12px; }
.desktop-assistant-transcript { max-height: 220px; overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.desktop-assistant-message { padding: 10px 0; border-bottom: 1px solid var(--line); }
.desktop-assistant-message > span { color: var(--accent-deep); font-size: 10px; font-weight: 600; }
.desktop-assistant-message.is-user > span { color: var(--text-soft); }
.desktop-assistant-message p { margin: 4px 0 0; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.desktop-assistant-tools { display: flex; align-items: center; justify-content: space-between; min-width: 0; gap: 8px; padding: 5px 0; }
.desktop-assistant-tools > span { font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }
.desktop-assistant-project { width: 100%; min-width: 0; max-width: 100%; height: 30px; margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 0 8px; color: var(--text-soft); font-size: 11px; }
.desktop-weather-reading { justify-content: space-between; align-items: center; padding-top: 12px; }
.desktop-weather-reading > strong { display: flex; font-family: inherit; font-size: 40px; font-weight: 450; }
.desktop-weather-reading > strong > span { font-size: 27px; }
.desktop-weather-reading > span { display: grid; gap: 5px; font-size: 12px; text-align: right; color: var(--text); }
.desktop-weather-reading small { color: var(--text-soft); font-size: 11px; }
.desktop-weather-meta { justify-content: space-between; gap: 6px; margin-top: 10px; font-size: 10px; color: var(--text-soft); }
.desktop-weather-empty { display: flex; align-items: center; gap: 8px; min-height: 52px; color: var(--text-soft); font-size: 12px; }
.desktop-weather-empty svg { width: 16px; height: 16px; }
.desktop-weather-actions { display: flex; gap: 18px; }
.desktop-weather-city-picker[hidden] { display: none; }
.desktop-widget-search { display: flex; align-items: center; min-width: 0; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px 2px 9px; background: var(--panel); }
.desktop-widget-search input { width: 100%; min-width: 0; height: 30px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.desktop-widget-search:focus-within { border-color: var(--accent); }
.desktop-weather-city-results { display: grid; max-height: 170px; overflow: auto; }
.desktop-weather-city-results button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: left; font-size: 12px; }
.desktop-weather-city-results svg { width: 13px; height: 13px; flex: 0 0 auto; }
.desktop-inspiration-list { gap: 0; }
.desktop-inspiration-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.desktop-inspiration-entry .desktop-inspiration-item { border-bottom: 0; min-width: 0; }
.desktop-inspiration-apply { border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; background: var(--panel); color: var(--text-soft); font-size: 10px; white-space: nowrap; cursor: pointer; }
.desktop-inspiration-apply:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.desktop-inspiration-apply:disabled { cursor: default; opacity: .72; }
.desktop-inspiration-item { min-height: 62px; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.desktop-inspiration-item > .desktop-inspiration-media { position: relative; display: grid; width: 52px; height: 44px; flex: 0 0 52px; aspect-ratio: 13 / 11; border-radius: 5px; overflow: hidden; place-items: center; background: var(--accent-soft); }
.desktop-inspiration-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.desktop-inspiration-media img[hidden] { display: none; }
.desktop-inspiration-media { border:0; padding:0; cursor:zoom-in; color:inherit; }
.desktop-inspiration-media:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.desktop-inspiration-source-link { display:grid; gap:4px; flex:1; min-width:0; text-decoration:none; color:inherit; }
.desktop-inspiration-source-link:hover strong { color:var(--accent-deep); }
.desktop-inspiration-item > span:not(.desktop-inspiration-media) { min-width: 0; gap: 4px; }
.desktop-inspiration-item strong { font-size: 12px; font-weight: 500; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; overflow-wrap: anywhere; }
.desktop-inspiration-item small { color: var(--text-soft); font-size: 10px; }
.desktop-inspiration-item > svg { flex: 0 0 auto; }
.desktop-inspiration-sources { display: flex; flex-wrap: wrap; gap: 8px 14px; padding-top: 12px; }
.desktop-inspiration-sources a { display: inline-flex; align-items: center; gap: 2px; color: var(--text-soft); text-decoration: none; font-size: 10px; }
.desktop-inspiration-sources a:hover { color: var(--accent-deep); }
.desktop-inspiration-sources svg { width: 10px; height: 10px; }
@keyframes desktop-bot-blink { 0%, 43%, 49%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.15); } }
@media (prefers-reduced-motion: reduce) { .desktop-bot-mark, .desktop-bot-eyes, .desktop-widget-loading::before { animation: none; } }
:root[data-motion="off"] .desktop-bot-mark, :root[data-motion="off"] .desktop-bot-eyes { animation: none; }
@media (max-width: 760px) {
  .desktop .home-screen { display: flex; flex-direction: column; height: calc(100dvh - var(--window-chrome-height) - 172px); gap: 18px; padding: 20px 18px 0; overflow: hidden; }
  .desktop-app-area { width: 100%; max-height: 42%; flex: 0 0 auto; overflow: auto; }
  .desktop-rail { width: 100%; min-height: 0; flex: 1 1 auto; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 100%; overflow: auto; }
  .desktop-assistant-widget { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .desktop-rail { grid-template-columns: 1fr; }
  .desktop .dock { max-width: calc(100vw - 20px); gap: 3px; padding: 6px; overflow-x: auto; }
}

/* Final shell overrides: these intentionally live at the end of the shared
   stylesheet so older module-specific rules cannot reintroduce a titlebar
   gap or stretch embedded runtimes beyond the available display area. */
:root {
  --window-chrome-height: 34px;
}

.window-chrome {
  position: fixed;
  z-index: 1200;
  inset: 0 0 auto;
  display: flex;
  height: var(--window-chrome-height);
  pointer-events: none;
}

.window-drag-region {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-app-region: drag;
}

.window-controls {
  display: flex;
  align-items: stretch;
  height: var(--window-chrome-height);
  pointer-events: auto;
  -webkit-app-region: no-drag;
}

.window-control {
  display: grid;
  width: 46px;
  height: var(--window-chrome-height);
  min-height: var(--window-chrome-height);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  padding: 0;
  place-items: center;
  box-shadow: none;
}

.window-control:hover {
  border: 0;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  box-shadow: none;
}

.window-control-close:hover {
  background: #d94b62;
  color: #fff;
}

.window-control svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.8;
}

.desktop,
.canvas-hub-shell,
.app-shell,
.lock-screen,
.boot-screen {
  box-sizing: border-box;
  padding-top: var(--window-chrome-height);
}

.desktop {
  min-height: 100vh;
}

.desktop-statusbar {
  padding-top: 12px;
}

.lock-screen,
.boot-screen {
  min-height: 100vh;
}

.lock-layout {
  min-height: calc(100vh - var(--window-chrome-height));
  padding-top: clamp(28px, 8vh, 92px);
}

.canvas-hub-header {
  padding-top: 14px;
}

.canvas-runtime,
.accounting-runtime {
  height: calc(100vh - var(--window-chrome-height));
  margin-top: 0;
}

.canvas-runtime .legacy-canvas-frame,
.accounting-runtime-frame {
  height: 100%;
}

.canvas-app-shell .app-content {
  height: calc(100vh - var(--window-chrome-height));
  padding-top: 14px;
}

.app-shell .app-sidebar {
  min-height: calc(100vh - var(--window-chrome-height));
}

@media (max-width: 600px) {
  .window-control {
    width: 40px;
  }
}
