/* ============================================================
   PIXX SUITE — the shared design system for every Pixx app.
   Pixxivi's look (dark, glassy, rounded) with the accent turned into a variable: each app sets
   <html data-app="pixxani"> and gets its own accent / surfaces from the suite spec
   (Pixxtools/PIXX_Creative_Suite_Uniform_Names.xlsx, "Color & UI Palettes").
   Pixxivi itself keeps its own stylesheet (its desktop UI is frozen pixel-identical) and only
   uses the .pxs-* parts of this file (launcher, account button).
   ============================================================ */
:root {
  /* shared suite tokens */
  --shell: #101827; --raised: #1C2940; --text: #F8FAFC; --muted: #A8B7CA; --dim: #66758a;
  --checker-a: #D5DAE2; --checker-b: #FFFFFF;
  /* app accent (defaults: Pixxivi indigo); --acc-rgb feeds rgba() tints */
  --acc: #8B5CF6; --acc-rgb: 139, 92, 246; --acc2: #22d3ee; --acc2-rgb: 34, 211, 238; --acc-deep: #6d3fe0;
  --surface: #251C3D; --surface-light: #F4EFFF; --on-acc: #fff;
  /* Pixxivi's working palette */
  --bg: #0b0c12; --bg2: #0f1018; --panel: #14151f; --panel2: #1a1b28; --panel3: #222336;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.12);
  --good: #3ddc97; --warn: #ffb547; --bad: #ff5d73;
  --r: 12px; --r2: 8px; --touch: 44px;
  --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, Consolas, monospace;
  --shadow: 0 10px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}
/* ---------- per-app accents (accent / dark surface / light surface from the suite spec) ---------- */
[data-app=pixxivi] { --acc: #8B5CF6; --acc-rgb: 139, 92, 246;  --acc2: #22d3ee; --acc2-rgb: 34, 211, 238;  --acc-deep: #6d3fe0; --surface: #251C3D; --surface-light: #F4EFFF; }
[data-app=pixxani] { --acc: #E879F9; --acc-rgb: 232, 121, 249; --acc2: #a78bfa; --acc2-rgb: 167, 139, 250; --acc-deep: #c026d3; --surface: #351B3C; --surface-light: #FFF0FD; }
[data-app=pixxato] { --acc: #2DD4BF; --acc-rgb: 45, 212, 191;  --acc2: #60a5fa; --acc2-rgb: 96, 165, 250;  --acc-deep: #0f9f8d; --surface: #143A39; --surface-light: #E8FFFB; --on-acc: #04211d; }
[data-app=pixxula] { --acc: #FBBF24; --acc-rgb: 251, 191, 36;  --acc2: #fb923c; --acc2-rgb: 251, 146, 60;  --acc-deep: #d97706; --surface: #42331C; --surface-light: #FFF7DA; --on-acc: #2a1d00; }
[data-app=pixxifo] { --acc: #4ADE80; --acc-rgb: 74, 222, 128;  --acc2: #2dd4bf; --acc2-rgb: 45, 212, 191;  --acc-deep: #16a34a; --surface: #193D2B; --surface-light: #E9FFF0; --on-acc: #04210f; }
[data-app=pixxori] { --acc: #38BDF8; --acc-rgb: 56, 189, 248;  --acc2: #6ee7b7; --acc2-rgb: 110, 231, 183; --acc-deep: #0284c7; --surface: #18394D; --surface-light: #EAF8FF; --on-acc: #03202e; }
[data-app=pixxulo] { --acc: #FB7185; --acc-rgb: 251, 113, 133; --acc2: #fbbf24; --acc2-rgb: 251, 191, 36;  --acc-deep: #e11d48; --surface: #452331; --surface-light: #FFF0F3; }
[data-app=pixxava] { --acc: #FB923C; --acc-rgb: 251, 146, 60;  --acc2: #fb7185; --acc2-rgb: 251, 113, 133; --acc-deep: #ea580c; --surface: #452C1D; --surface-light: #FFF3E8; --on-acc: #2a1300; }
[data-app=pixxico] { --acc: #60A5FA; --acc-rgb: 96, 165, 250;  --acc2: #a78bfa; --acc2-rgb: 167, 139, 250; --acc-deep: #2563eb; --surface: #1D3050; --surface-light: #EFF6FF; }
[data-app=pixxypo] { --acc: #FACC15; --acc-rgb: 250, 204, 21;  --acc2: #fb923c; --acc2-rgb: 251, 146, 60;  --acc-deep: #ca8a04; --surface: #413A19; --surface-light: #FFFADE; --on-acc: #2a2200; }
[data-app=pixxevi] { --acc: #22D3EE; --acc-rgb: 34, 211, 238;  --acc2: #818cf8; --acc2-rgb: 129, 140, 248; --acc-deep: #0891b2; --surface: #173E47; --surface-light: #E7FCFF; --on-acc: #03242b; }
[data-app=pixxino] { --acc: #A78BFA; --acc-rgb: 167, 139, 250; --acc2: #f472b6; --acc2-rgb: 244, 114, 182; --acc-deep: #7c3aed; --surface: #2C2549; --surface-light: #F4F0FF; }
[data-app=pixxura] { --acc: #A3E635; --acc-rgb: 163, 230, 53;  --acc2: #facc15; --acc2-rgb: 250, 204, 21;  --acc-deep: #65a30d; --surface: #30401B; --surface-light: #F6FFE5; --on-acc: #1a2600; }
[data-app=pixxovo] { --acc: #FDA4AF; --acc-rgb: 253, 164, 175; --acc2: #c4b5fd; --acc2-rgb: 196, 181, 253; --acc-deep: #f43f5e; --surface: #45242D; --surface-light: #FFF1F2; --on-acc: #2d0a10; }
[data-app=pixxexa] { --acc: #6EE7B7; --acc-rgb: 110, 231, 183; --acc2: #38bdf8; --acc2-rgb: 56, 189, 248;  --acc-deep: #059669; --surface: #193F36; --surface-light: #E9FFF5; --on-acc: #032619; }
[data-app=pixxibu] { --acc: #C084FC; --acc-rgb: 192, 132, 252; --acc2: #f472b6; --acc2-rgb: 244, 114, 182; --acc-deep: #9333ea; --surface: #352345; --surface-light: #F7EDFF; --on-acc: #1f0a33; }
[data-app=pixxoni] { --acc: #818CF8; --acc-rgb: 129, 140, 248; --acc2: #22d3ee; --acc2-rgb: 34, 211, 238;  --acc-deep: #4f46e5; --surface: #222B52; --surface-light: #EDF0FF; }
[data-app=pixxomo] { --acc: #F472B6; --acc-rgb: 244, 114, 182; --acc2: #fb923c; --acc2-rgb: 251, 146, 60;  --acc-deep: #db2777; --surface: #48253B; --surface-light: #FFF0F8; --on-acc: #2d0619; }
[data-app=pixxsuite] { --acc: #8B5CF6; --acc-rgb: 139, 92, 246; --acc2: #E879F9; --acc2-rgb: 232, 121, 249; --acc-deep: #6d3fe0; --surface: #1C2940; --surface-light: #F4EFFF; }

/* ============================================================
   BASE — everything below is scoped to body.pxs-app (the new apps), so loading this file next to
   another stylesheet (Pixxivi) changes nothing but the .pxs-* widgets.
   ============================================================ */
body.pxs-app, body.pxs-app * { box-sizing: border-box; }
html:has(body.pxs-app) { height: 100%; }
body.pxs-app { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.4 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body.pxs-app.scroll { overflow: auto; }
.pxs-app button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.pxs-app button:disabled { opacity: .35; cursor: default; }
.pxs-app input, .pxs-app select, .pxs-app textarea { font: inherit; color: inherit; }
.pxs-app :focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.pxs-app .grow { flex: 1 1 auto; }
.pxs-app .muted { color: var(--muted); } .pxs-app .sm { font-size: 11.5px; } .pxs-app .mono { font-family: var(--mono); font-size: 11.5px; }
.pxs-app .row { display: flex; align-items: center; } .pxs-app .gap { gap: 8px; } .pxs-app .wrap { flex-wrap: wrap; }
.pxs-app .hidden { display: none !important; }
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pxs-app kbd { font: 600 10.5px var(--mono); padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.pxs-app ::-webkit-scrollbar { width: 9px; height: 9px; } .pxs-app ::-webkit-scrollbar-thumb { background: #33344a; border-radius: 5px; } .pxs-app ::-webkit-scrollbar-track { background: transparent; }

/* ---------- app grid: topbar / optionsbar / workspace [left | stage | right] / footer ---------- */
.pxs-shell { display: grid; height: 100dvh; grid-template-rows: 52px auto minmax(0, 1fr) auto; grid-template-columns: 100%; background:
  radial-gradient(1200px 600px at 20% -10%, rgba(var(--acc-rgb), .11), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(var(--acc2-rgb), .07), transparent 60%), var(--bg); }
.pxs-ws { display: grid; grid-template-columns: var(--left-w, 300px) minmax(0, 1fr) var(--right-w, 320px); min-height: 0; }
.pxs-ws.no-left { grid-template-columns: minmax(0, 1fr) var(--right-w, 320px); }
.pxs-ws.no-right { grid-template-columns: var(--left-w, 300px) minmax(0, 1fr); }
.pxs-side { background: rgba(14,15,23,.65); overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: #33344a transparent; }
.pxs-side.left { border-right: 1px solid var(--line); } .pxs-side.right { border-left: 1px solid var(--line); }
.pxs-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.pxs-foot { border-top: 1px solid var(--line); background: rgba(12,13,20,.92); min-height: 0; }

/* ---------- topbar ---------- */
.pxs-app .topbar { display: flex; align-items: center; gap: 6px; padding: 0 12px; border-bottom: 1px solid var(--line); background: rgba(13,14,21,.8); backdrop-filter: blur(14px); position: relative; z-index: 5; min-width: 0; }
.pxs-app .logo { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 2px; border-radius: 10px; text-decoration: none; color: inherit; flex: none; }
.pxs-app .logo:hover { background: rgba(255,255,255,.04); }
.pxs-app .logo-mark { display: inline-flex; filter: drop-shadow(0 2px 10px rgba(var(--acc-rgb), .45)); }
.pxs-app .logo-word { font-weight: 800; font-size: 16px; letter-spacing: -.02em; background: linear-gradient(90deg, #fff, var(--acc) 70%, var(--acc2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pxs-app .logo-sub { color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pxs-app .menubar { display: flex; gap: 1px; margin-left: 6px; }
.pxs-app .menubtn { padding: 6px 9px; border-radius: 8px; color: #c8c8d8; font-weight: 500; white-space: nowrap; }
.pxs-app .menubtn:hover, .pxs-app .menubtn.on { background: rgba(255,255,255,.06); color: #fff; }
.pxs-app .tb-sep { width: 1px; height: 22px; background: var(--line2); margin: 0 8px; flex: none; }
.pxs-app .projname { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; font-weight: 600; width: 180px; min-width: 60px; flex: 0 1 180px; }
.pxs-app .projname:hover { border-color: var(--line); } .pxs-app .projname:focus { border-color: var(--acc); background: var(--panel); outline: none; }
.pxs-app .savestate { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pxs-app .savestate .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }
.pxs-app .savestate.dirty .dot, .pxs-app .savestate.saving .dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.pxs-app .savestate.syncing .dot, .pxs-app .savestate.synced .dot { background: var(--acc2); box-shadow: 0 0 8px var(--acc2); }

/* ---------- options bar ---------- */
.pxs-app .optionsbar { display: flex; align-items: center; gap: 8px; padding: 6px 14px; min-height: 46px; border-bottom: 1px solid var(--line); background: rgba(16,17,26,.75); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.pxs-app .optionsbar::-webkit-scrollbar { display: none; }
.pxs-app .optionsbar.wrap { flex-wrap: wrap; white-space: normal; }
.pxs-app .opt-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--line2); color: #fff; flex: none; }
.pxs-app .opt-title .ico { color: var(--acc); }
.pxs-app .opt-badge { background: rgba(var(--acc2-rgb), .15); color: var(--acc2); padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 11px; }

/* ---------- buttons & inputs ---------- */
.pxs-app .ibtn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: #cfcfe0; transition: background .12s, color .12s; flex: none; }
.pxs-app .ibtn:hover:not(:disabled) { background: rgba(255,255,255,.07); color: #fff; }
.pxs-app .ibtn.on { background: rgba(var(--acc-rgb), .22); color: #fff; }
.pxs-app .ibtn.sm { width: 28px; height: 28px; border-radius: 8px; }
.pxs-app .ibtn.ghost { color: var(--muted); }
.pxs-app .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; font-weight: 600; background: var(--panel3); border: 1px solid var(--line2); white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; text-decoration: none; color: inherit; }
.pxs-app .btn:hover:not(:disabled) { background: #2a2b42; }
.pxs-app .btn:active:not(:disabled) { transform: translateY(1px); }
.pxs-app .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.pxs-app .btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc-deep) 60%, var(--acc2)); border-color: transparent; color: var(--on-acc); box-shadow: 0 6px 20px rgba(var(--acc-rgb), .35); }
.pxs-app .btn.primary:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(135deg, var(--acc), var(--acc-deep) 60%, var(--acc2)); }
.pxs-app .btn.danger { background: rgba(255,93,115,.14); border-color: rgba(255,93,115,.35); color: #ff9aa9; }
.pxs-app .btn.busy { opacity: .6; pointer-events: none; }
.pxs-app .chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: #cfd0e0; white-space: nowrap; font-size: 12px; transition: all .12s; }
.pxs-app .chip:hover { border-color: rgba(var(--acc-rgb), .55); color: #fff; }
.pxs-app .chip.on { background: rgba(var(--acc-rgb), .2); border-color: var(--acc); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), .25); }
.pxs-app .chip.sm { height: 24px; padding: 0 8px; font-size: 11px; }
.pxs-app .seg { display: inline-flex; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 10px; padding: 2px; gap: 2px; flex: none; }
.pxs-app .seg.wrap { flex-wrap: wrap; }
.pxs-app .seg button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pxs-app .seg button:hover { color: #fff; }
.pxs-app .seg button.on { background: var(--panel3); color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4), inset 0 0 0 1px rgba(var(--acc-rgb), .45); }
.pxs-app .sel { background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; height: 30px; padding: 0 8px; max-width: 240px; }
.pxs-app .sel.sm { height: 26px; font-size: 12px; } .pxs-app .sel.full { width: 100%; max-width: none; }
.pxs-app .text { background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; height: 34px; padding: 0 10px; width: 100%; }
.pxs-app textarea.text { height: auto; min-height: 90px; padding: 8px 10px; font: 12px/1.45 var(--mono); resize: vertical; }
.pxs-app .text.sm { height: 26px; font-size: 12px; padding: 0 7px; }
.pxs-app .text:focus, .pxs-app .num:focus, .pxs-app .sel:focus { border-color: var(--acc); outline: none; }
.pxs-app .num { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; height: 28px; width: 64px; padding: 0 6px; font-family: var(--mono); font-size: 12px; }
.pxs-app .num.wide { width: 90px; }
.pxs-app .num.bad, .pxs-app .text.bad { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(255,93,115,.15); }
.pxs-app .field { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.pxs-app .field.col { display: flex; flex-direction: column; align-items: stretch; gap: 5px; margin-bottom: 10px; }
.pxs-app .field.col > span { font-weight: 600; color: #b9bad0; }
.pxs-app .lbl { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin: 14px 0 7px; }
.pxs-app .sl { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; flex: none; }
.pxs-app .sl input[type=range] { width: 110px; }
.pxs-app .sl.full { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; width: 100%; margin: 4px 0; }
.pxs-app .sl.full input[type=range] { width: 100%; }
.pxs-app .sl-val { font-family: var(--mono); font-size: 11px; color: var(--text); min-width: 34px; text-align: right; }
.pxs-app input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--acc2)); opacity: .9; }
.pxs-app input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .45); cursor: pointer; }
.pxs-app input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .45); }
.pxs-app input[type=color] { width: 34px; height: 30px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); padding: 2px; cursor: pointer; }
.pxs-app input[type=checkbox] { accent-color: var(--acc); width: 15px; height: 15px; }
.pxs-app .vsep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line2); flex: none; }
.pxs-app .warn { color: #ffcf85; font-size: 12px; background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.25); border-radius: 8px; padding: 6px 9px; margin: 6px 0; }
.pxs-app .warn:empty { display: none; }
.pxs-app .note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0; }
.pxs-app .empty { color: var(--muted); font-size: 12px; padding: 6px 2px; margin: 0; }

/* ---------- side panels ---------- */
.pxs-app .pnl { border-bottom: 1px solid var(--line); }
.pxs-app .pnl-head { display: flex; align-items: center; gap: 6px; padding: 11px 14px; cursor: pointer; user-select: none; }
.pxs-app .pnl-head h3 { margin: 0; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #b9bad0; }
.pxs-app .pnl-head > .ico { color: var(--dim); transition: transform .15s; }
.pxs-app .pnl.collapsed .pnl-head > .ico { transform: rotate(-90deg); }
.pxs-app .pnl.collapsed .pnl-body { display: none; }
.pxs-app .pnl-body { padding: 0 14px 14px; }
.pxs-app .tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pxs-app .tabs.pad { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pxs-app .tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.pxs-app .tab:hover { color: #fff; background: rgba(255,255,255,.04); }
.pxs-app .tab.on { color: #fff; background: rgba(var(--acc-rgb), .18); box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), .45); }

/* ---------- stage (canvas area) ---------- */
.pxs-app .checker { background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 16px 16px; }
.pxs-app .checker.light { background: repeating-conic-gradient(var(--checker-a) 0 25%, var(--checker-b) 0 50%) 0 0 / 16px 16px; }
.pxs-app .pixelated { image-rendering: pixelated; }
.pxs-app .floatpill { position: absolute; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(20,21,31,.82); border: 1px solid var(--line2); backdrop-filter: blur(12px); box-shadow: var(--shadow); z-index: 2; }
.pxs-app .dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 40px 24px; margin: auto; border: 2px dashed rgba(var(--acc-rgb), .45); border-radius: 22px; background: rgba(var(--acc-rgb), .05); color: var(--muted); max-width: 520px; }
.pxs-app .dropzone .ico { color: var(--acc); }
.pxs-app .dropzone h2 { margin: 0; color: var(--text); font-size: 18px; }

/* ---------- popovers / menus ---------- */
.pxs-pop { position: fixed; z-index: 60; background: rgba(24,25,37,.97); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow); backdrop-filter: blur(16px); animation: pxs-pop .12s ease-out; color: var(--text); font: 13px/1.4 var(--font); }
@keyframes pxs-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pxs-menu { padding: 6px; min-width: 230px; max-height: 78vh; overflow-y: auto; }
.pxs-menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px 7px 6px; border-radius: 8px; text-align: left; color: #dcdcea; background: none; border: 0; font: inherit; cursor: pointer; }
.pxs-menu-item:hover { background: rgba(var(--acc-rgb), .2); color: #fff; }
.pxs-menu-item .ico { color: var(--muted); width: 16px; }
.pxs-menu-item .k { margin-left: auto; color: var(--dim); font: 600 10.5px var(--mono); }
.pxs-menu-item.disabled { opacity: .4; pointer-events: none; }
.pxs-menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.pxs-menu-head { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 9px 10px 4px; }

/* ---------- modals ---------- */
.pxs-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(5,6,10,.6); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: pxs-fade .14s; font: 13px/1.4 var(--font); color: var(--text); }
.pxs-overlay.closing { opacity: 0; transition: opacity .14s; }
@keyframes pxs-fade { from { opacity: 0; } }
.pxs-modal { width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(28,29,44,.98), rgba(20,21,32,.98)); border: 1px solid var(--line2); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(var(--acc-rgb), .08); animation: pxs-rise .18s cubic-bezier(.2,.9,.3,1.2); }
.pxs-modal.wide { width: min(900px, 100%); } .pxs-modal.xwide { width: min(1180px, 100%); }
@keyframes pxs-rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.pxs-modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px 20px; }
.pxs-modal-head .ico { color: var(--acc); }
.pxs-modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
.pxs-modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.pxs-modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px 20px; border-top: 1px solid var(--line); }

/* ---------- toasts ---------- */
.pxs-toasts { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; font: 13px/1.4 var(--font); }
.pxs-toast { background: rgba(24,25,38,.96); color: var(--text); border: 1px solid var(--line2); padding: 9px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; animation: pxs-rise .18s; transition: opacity .4s, transform .4s; max-width: 80vw; }
.pxs-toast.warn { border-color: rgba(255,181,71,.5); } .pxs-toast.error { border-color: rgba(255,93,115,.6); color: #ffc2cb; }
.pxs-toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- suite widgets (also used inside Pixxivi and Pixxani) ---------- */
/* self-contained: host apps may style bare <button>s globally (Pixxani does) */
.pxs-menu-item, .pxs-cloudcard, .pxs-launch, .pxs-acct, .pxs-overlay .tab, .pxs-overlay .ibtn { height: auto; min-width: 0; box-shadow: none; transform: none; text-transform: none; letter-spacing: normal; line-height: 1.4; }
.pxs-menu-item { justify-content: flex-start; border-radius: 8px; font-weight: 500; font-size: 13px; }
.pxs-launch { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; height: 34px !important; padding: 0 10px 0 7px; border-radius: 10px; font-family: inherit; color: #cfcfe0; background: none; border: 0; cursor: pointer; flex: none; }
.pxs-launch:hover { background: rgba(255,255,255,.07); color: #fff; }
.pxs-launcher { width: min(560px, calc(100vw - 16px)); padding: 12px; }
.pxs-launcher-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.pxs-launcher-head b { font-size: 14px; } .pxs-launcher-head a { margin-left: auto; color: var(--muted); font-size: 12px; text-decoration: none; }
.pxs-launcher-head a.pxs-launcher-home { margin-left: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--text, #fff); border-radius: 8px; padding: 2px 6px 2px 2px; }
.pxs-launcher-head a.pxs-launcher-home:hover { background: rgba(255,255,255,.07); }
.pxs-launch-txt { font-size: 13px; font-weight: 600; letter-spacing: .01em; }
@media (max-width: 420px) { .pxs-launch { width: 34px; padding: 0; } .pxs-launch-txt { display: none; } }
.pxs-launcher-head a:hover { color: #fff; }
.pxs-launcher-group { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 8px 4px 6px; }
.pxs-launcher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.pxs-tile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font: inherit; min-width: 0; }
.pxs-tile:hover { border-color: var(--tile-acc); background: rgba(255,255,255,.05); }
.pxs-tile.current { box-shadow: inset 0 0 0 1px var(--tile-acc); }
.pxs-tile.soon { opacity: .55; }
.pxs-tile-mark { flex: none; display: inline-flex; filter: drop-shadow(0 2px 8px rgba(0,0,0,.35)); }
.pxs-tile-txt { display: flex; flex-direction: column; min-width: 0; }
.pxs-tile-txt b { font-size: 13px; } .pxs-tile-txt span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxs-acct { display: inline-flex; align-items: center; gap: 7px; height: 30px !important; padding: 0 12px; border-radius: 10px; font: 600 12px var(--font); background: linear-gradient(135deg, var(--acc), var(--acc-deep) 60%, var(--acc2)); color: var(--on-acc); border: 0; cursor: pointer; white-space: nowrap; flex: none; }
.pxs-acct.signed-in { background: rgba(255,255,255,.04); border: 1px solid var(--line2); color: #dcdcea; padding: 0 10px 0 4px; }
.pxs-acct .av { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2)); }
.pxs-acct .nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
/* account dialog (same class names as Pixxivi's, so both read the same) */
.pxs-overlay .tabs { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; }
.pxs-overlay .tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; background: none; border: 0; cursor: pointer; font: 600 13px var(--font); }
.pxs-overlay .tab.on { color: #fff; background: rgba(var(--acc-rgb), .18); box-shadow: inset 0 0 0 1px rgba(var(--acc-rgb), .45); }
.pxs-overlay .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px; font: 600 13px var(--font); background: var(--panel3); border: 1px solid var(--line2); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
.pxs-overlay .btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.pxs-overlay .btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc-deep) 60%, var(--acc2)); border-color: transparent; color: var(--on-acc); box-shadow: 0 6px 20px rgba(var(--acc-rgb), .35); }
.pxs-overlay .btn.danger { background: rgba(255,93,115,.14); border-color: rgba(255,93,115,.35); color: #ff9aa9; }
.pxs-overlay .btn:disabled, .pxs-overlay .btn.busy { opacity: .55; pointer-events: none; }
.pxs-overlay .ibtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; color: var(--muted); background: none; border: 0; cursor: pointer; }
.pxs-overlay .ibtn:hover { background: rgba(255,255,255,.07); color: #fff; }
.pxs-overlay .text { background: var(--panel2); border: 1px solid var(--line2); border-radius: 9px; height: 34px; padding: 0 10px; width: 100%; color: var(--text); font: 13px var(--font); box-sizing: border-box; }
.pxs-overlay .text.sm { height: 28px; font-size: 12px; }
.pxs-overlay .text:focus { border-color: var(--acc); outline: none; }
.pxs-overlay .field.col { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.pxs-overlay .field.col > span { font-weight: 600; color: #b9bad0; }
.pxs-overlay .muted { color: var(--muted); } .pxs-overlay .sm { font-size: 11.5px; }
.pxs-overlay .row { display: flex; align-items: center; } .pxs-overlay .gap { gap: 8px; } .pxs-overlay .wrap { flex-wrap: wrap; } .pxs-overlay .grow { flex: 1; }
.pxs-overlay .chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: #cfd0e0; font-size: 11px; cursor: pointer; }
.account-dlg .pxs-modal { width: min(460px, 100%); }
.account-form { display: flex; flex-direction: column; gap: 2px; }
.account-form .btn.primary { align-self: flex-start; margin-top: 4px; }
.account-msg { font-size: 12.5px; min-height: 0; margin: 2px 0 6px; }
.account-msg:empty { display: none; }
.account-msg.bad { color: #ff9aa9; } .account-msg.good { color: var(--good); }
.account-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 0; }
.account-done .ico { color: var(--good); }
.account-done h3 { margin: 4px 0; }
.account-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.account-avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; color: #fff; background: linear-gradient(135deg, var(--acc), var(--acc2)); flex: none; }
.account-usage { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.account-usage .bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.account-usage .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); }
.account-adv { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.account-adv summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 4px 0; }
.account-adv[open] summary { color: var(--text); margin-bottom: 6px; }
.account-adv .text.sm { flex: 1; min-width: 0; }
.danger-zone summary { color: #ff9aa9; }
.account-suite { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 12px; }
.account-suite i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
/* cloud project picker */
.pxs-cloudgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; padding: 2px; }
.pxs-cloudcard { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); overflow: hidden; cursor: pointer; text-align: left; color: var(--text); font: inherit; padding: 0; }
.pxs-cloudcard:hover { border-color: rgba(var(--acc-rgb), .6); }
.pxs-cloudcard .th { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#1d1e2b 0 25%, #242536 0 50%) 0 0 / 14px 14px; }
.pxs-cloudcard .th img { max-width: 86%; max-height: 86%; image-rendering: pixelated; }
.pxs-cloudcard .mt { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.pxs-cloudcard .mt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- responsive: narrow windows, tablets, phones ---------- */
@media (max-width: 1100px) { .pxs-app .menubar { display: none; } .pxs-app .only-wide { display: none !important; } .pxs-ws { --left-w: 260px; --right-w: 280px; } }
@media (pointer: coarse) {
  .pxs-app .ibtn { width: 40px; height: 40px; } .pxs-app .ibtn.sm { width: 34px; height: 34px; }
  .pxs-app .chip { height: 34px; } .pxs-app .seg button { height: 32px; } .pxs-app .btn { height: 40px; }
  .pxs-menu-item { padding: 11px 12px 11px 8px; }
  .pxs-app input[type=range] { height: 6px; } .pxs-app input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
}
/* phones: one column; side panels become bottom sheets opened from the bottom bar */
.pxs-mobilebar { display: none; }
@media (max-width: 760px) {
  .pxs-shell { grid-template-rows: calc(50px + var(--safe-t)) auto minmax(0, 1fr) auto calc(58px + var(--safe-b)); }
  .pxs-app .topbar { padding: var(--safe-t) calc(6px + var(--safe-r)) 0 calc(6px + var(--safe-l)); gap: 2px; }
  .pxs-app .logo-sub, .pxs-app .tb-sep, .pxs-app .savestate > span, .pxs-acct .nm { display: none; }
  .pxs-app .projname { flex: 1 1 80px; width: auto; }
  .pxs-ws, .pxs-ws.no-left, .pxs-ws.no-right { grid-template-columns: minmax(0, 1fr); }
  .pxs-side { position: fixed; left: 0; right: 0; bottom: 0; max-height: 74dvh; z-index: 65; border: 1px solid var(--line2) !important; border-radius: 22px 22px 0 0; background: rgba(18,19,29,.98); transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.9,.3,1); box-shadow: 0 -20px 60px rgba(0,0,0,.5); padding-bottom: calc(10px + var(--safe-b)); }
  .pxs-side.open { transform: none; }
  .pxs-side::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line2); margin: 8px auto 4px; }
  .pxs-mobilebar { display: flex; align-items: center; justify-content: space-around; gap: 4px; padding: 6px calc(8px + var(--safe-r)) calc(6px + var(--safe-b)) calc(8px + var(--safe-l)); border-top: 1px solid var(--line); background: rgba(13,14,21,.96); }
  .pxs-mobilebar button { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: var(--touch); min-height: var(--touch); padding: 4px 8px; border-radius: 12px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
  .pxs-mobilebar button.on { color: #fff; background: rgba(var(--acc-rgb), .22); }
  .pxs-scrim { position: fixed; inset: 0; z-index: 64; background: rgba(0,0,0,.4); }
  .pxs-overlay { align-items: flex-end; padding: 0; }
  .pxs-modal, .pxs-modal.wide, .pxs-modal.xwide { width: 100%; max-height: calc(100dvh - var(--safe-t) - 10px); border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); }
  .pxs-pop { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-height: 80dvh; overflow-y: auto; border-radius: 22px 22px 0 0; padding-bottom: calc(10px + var(--safe-b)); }
  .pxs-launcher { width: 100%; }
  .pxs-toasts { bottom: calc(80px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) { .pxs-app *, .pxs-overlay, .pxs-pop, .pxs-modal { animation: none !important; transition: none !important; } }

/* ---------- app tiles (Send to App, Open in…): 3 columns, each tile in its app's colours ---------- */
.pxs-appgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
:is(body, .pxs-app) .pxs-apptile { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px; min-height: 64px; border-radius: 14px; cursor: pointer; color: var(--text, #fff); font: inherit;
  border: 1px solid color-mix(in srgb, var(--tile-acc) 45%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--tile-acc) 20%, transparent), color-mix(in srgb, var(--tile-acc2) 6%, transparent)); transition: transform .12s, border-color .12s, box-shadow .12s; }
:is(body, .pxs-app) .pxs-apptile:hover, :is(body, .pxs-app) .pxs-apptile:focus-visible { transform: translateY(-1px); border-color: var(--tile-acc); box-shadow: 0 6px 22px color-mix(in srgb, var(--tile-acc) 35%, transparent); outline: none; }
.pxs-apptile-mark { flex: none; display: inline-flex; filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--tile-acc) 50%, transparent)); }
.pxs-apptile-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pxs-apptile-txt b { font-size: 14px; color: #fff; }
.pxs-apptile-txt span { font-size: 12px; line-height: 1.3; color: color-mix(in srgb, var(--tile-acc) 35%, #c9cbe0); }
.pxs-sendkinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
:is(body, .pxs-app) .pxs-sendkind { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line, rgba(255,255,255,.12)); background: rgba(255,255,255,.04); color: var(--muted, #aab); font: inherit; font-size: 13px; cursor: pointer; }
:is(body, .pxs-app) .pxs-sendkind:hover { color: #fff; } :is(body, .pxs-app) .pxs-sendkind.on { color: #fff; border-color: var(--acc); background: rgba(var(--acc-rgb), .18); }
.pxs-sendhint { margin: 0 0 12px; }
.pxs-senddlg .pxs-modal, .pxs-apppicker .pxs-modal { max-width: 860px; }
@media (max-width: 760px) { .pxs-appgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pxs-appgrid { grid-template-columns: 1fr; } }
/* top bars between 1101 and 1400px: long-label buttons go icon-only (their title still names them) so Export + account always fit */
@media (max-width: 1400px) { .pxs-app .topbar .only-wide { display: none !important; } }
