/* Shared Pxlsan UI tokens. Sources and audit notes: docs/UI-DESIGN.md.
   14px body; 12px metadata; 4/8/12/16/24/32 spacing; soft lilac / cherry pink surfaces + restrained action accents. */
:root {
 --bg-color:#191722; --card-bg:#24212f; --text-main:#f2eefb; --text-sub:#c0b5d1; --text-secondary:#c0b5d1; --text-muted:#aea0c1;
 --navbar-top-bg:#24212f; --navbar-tabs-bg:#2d283b; --navbar-shadow:0 4px 20px #0000001a;
 --ui-canvas:#191722; --ui-surface:#24212f; --ui-muted:#2d283b; --ui-hover:#383147; --ui-line:#494058;
 --ui-accent:#c7b5f7; --ui-accent-soft:#362c49; --ui-primary-text:#261b3b;
 --accent-char:#c7b5f7; --accent-outfit:#edbdd7; --btn-mix:#c7b5f7;
 --surface:var(--ui-surface); --surface-muted:var(--ui-muted); --text:var(--text-main); --muted:var(--text-sub); --subtle:var(--text-muted); --line:var(--ui-line); --gold:var(--ui-accent); --accent-soft:var(--ui-accent-soft); --primary:#c7b5f7;
 color-scheme:dark;
}
:root[data-theme=light] {
 --bg-color:#f7f5fc; --card-bg:#fff; --text-main:#312b45; --text-sub:#70657e; --text-secondary:#70657e; --text-muted:#736780;
 --navbar-top-bg:#fff; --navbar-tabs-bg:#f4f0fb; --navbar-shadow:0 4px 20px #30291f08;
 --ui-canvas:#f7f5fc; --ui-surface:#fff; --ui-muted:#f4f0fb; --ui-hover:#ece5f7; --ui-line:#e5ddf2;
 --ui-accent:#7258a5; --ui-accent-soft:#f0e9fc; --accent-char:#7258a5; --accent-outfit:#9d5176; --btn-mix:#c7b5f7;
 color-scheme:light;
}
:root body { background:var(--ui-canvas) !important; color:var(--text-main); font-family:system-ui,-apple-system,"Segoe UI","Microsoft YaHei",sans-serif; font-size:14px; line-height:1.65; }
:root button,:root input,:root textarea,:root select { font-family:inherit; }
:root button:focus-visible,:root a:focus-visible,:root input:focus-visible,:root textarea:focus-visible,:root select:focus-visible { outline:2px solid var(--ui-accent); outline-offset:3px; }
:root input::placeholder,:root textarea::placeholder { color:var(--text-muted); opacity:1; }
:root input[type=range],:root input[type=checkbox] { accent-color:var(--ui-accent); }
:root .navbar-wrapper { border:1px solid var(--ui-line); box-shadow:var(--navbar-shadow); }
:root .navbar-top { background:var(--ui-surface); padding:16px 20px; }
:root .navbar-tabs { background:var(--ui-surface); border-top:1px solid var(--ui-line); }
:root .nav-tab { min-height:44px; display:flex; align-items:center; justify-content:center; padding:10px 16px; color:var(--text-sub); font-size:16px; border-radius:0; }
:root .nav-tab:hover { background:var(--ui-hover); color:var(--text-main); }
:root .nav-tab.active { background:var(--nav-fill,var(--ui-accent)); color:#fff; box-shadow:none; font-weight:600; }
:root .navbar-logo .logo-slogan,:root .navbar-logo .logo-sub { color:var(--text-sub); font-size:12px; }
:root #cardChar,:root #cardOutfit { background:var(--ui-surface); border:1px solid var(--ui-line); border-radius:12px; padding:24px; box-shadow:none; }
:root .card-header-bar { gap:12px; }
:root .icon-btn,:root .filter-trigger { color:var(--text-sub); background:var(--ui-muted); border:1px solid var(--ui-line); box-shadow:none; min-height:32px; }
:root .icon-btn:hover,:root .filter-trigger:hover { color:var(--text-main); background:var(--ui-hover); }
:root .name-display { font-size:24px; line-height:1.4; letter-spacing:0; }
:root .prompt-box { background:var(--ui-muted); border:1px solid var(--ui-line); color:var(--text-sub); box-shadow:none; opacity:1; font-size:13px; line-height:1.7; padding:16px; }
:root .big-btn { min-height:44px; font-size:15px; line-height:1.5; letter-spacing:0; padding:12px 20px; border-radius:8px; box-shadow:none; }
:root .btn-roll-char,:root .btn-roll-outfit { background:var(--ui-surface); border:1px solid var(--ui-line); color:var(--text-main); }
:root .btn-roll-char:hover,:root .btn-roll-outfit:hover { background:var(--ui-accent-soft); color:var(--ui-accent); border-color:var(--ui-accent); }
:root .btn-mix-all { background:var(--primary); color:var(--ui-primary-text); border:1px solid transparent; font-size:16px; font-weight:600; margin-top:24px; }
:root .mix-section { padding:24px; margin-top:24px; gap:16px; background:var(--ui-surface) !important; border:1px solid var(--ui-line) !important; border-radius:12px; backdrop-filter:none; box-shadow:none; }
:root .final-prompt-title { color:var(--text-main); font-size:18px; line-height:1.5; }
:root .final-prompt-hint { color:var(--text-sub); font-size:13px; }
:root .final-prompt-copy-btn { background:var(--ui-muted); border:1px solid var(--ui-line); color:var(--text-main); min-height:36px; font-size:13px; }
:root .final-prompt-copy-btn:hover { background:var(--ui-hover); }
:root .final-prompt,:root #magicConnector,:root #magicSuffix { background:var(--ui-muted); color:var(--text-main); border:1px solid var(--ui-line); font-size:14px; line-height:1.75; padding:16px; }
:root #promptExtras { margin:0 !important; border-color:var(--ui-line) !important; padding:12px 16px !important; }
:root #promptExtras summary { color:var(--text-sub) !important; font-size:14px !important; }
:root #deepseekPromptAssistant { --surface:var(--ui-surface) !important; --surface-muted:var(--ui-muted) !important; --text:var(--text-main) !important; --muted:var(--text-sub) !important; --line:var(--ui-line) !important; --accent-soft:var(--ui-accent-soft) !important; --gold:var(--ui-accent) !important; --primary:var(--palette-primary,#c7b5f7) !important; }
:root .prompt-editor-container:has(.tag-wall:empty) { display:none; }
:root .prompt-editor-container { background:var(--ui-muted); border-color:var(--ui-line); padding:8px; }
:root .tag-wall { background:transparent; border:0; margin:0; padding:0; min-height:0; gap:8px; max-height:160px; overflow-y:auto; }
:root .tag-chip { border-color:var(--ui-line); background:var(--ui-surface); color:var(--text-main); padding:8px 12px; }
:root .prompt-tag-library { background:var(--ui-muted); border-color:var(--ui-line); padding:16px; margin-top:0; }
:root .prompt-tag-library summary { font-size:15px; }
:root .prompt-tag-library button,:root .prompt-tag-library input { border-color:var(--ui-line); background:var(--ui-surface); min-height:36px; }
:root .prompt-tag-library button[aria-pressed=true] { color:var(--ui-accent); border-color:var(--ui-accent); background:var(--ui-accent-soft); }
:root .ptl-tag i { color:var(--ui-accent); }
:root .ai-size-btn,:root .ai-model-btn,:root .lora-item { background:var(--ui-muted); border-color:var(--ui-line); color:var(--text-main); box-shadow:none; }
:root .ai-size-btn:hover,:root .ai-model-btn:hover,:root .lora-item:hover { background:var(--ui-hover); }
:root .ai-size-btn.active,:root .ai-model-btn.active,:root .lora-item.selected { background:var(--ui-accent-soft); border-color:var(--ui-accent); box-shadow:none; }
:root .ai-model-title,:root .lora-item-title { color:var(--text-main); font-size:14px; line-height:1.5; }
:root .ai-model-sub { color:var(--text-sub); font-size:12px; line-height:1.5; }
:root .ai-model-thumb-wrap,:root .lora-thumb-wrap { background:var(--ui-muted); }
:root .ai-gen-section a { color:var(--ui-accent); }
:root .ai-gen-section details,:root #aiGenHistorySection { border-color:var(--ui-line) !important; background:var(--ui-surface); }
:root #aiGenHistorySection>summary { color:var(--text-main); font-size:14px; padding:16px !important; }
:root #artist-choice { background:var(--ui-surface); color:var(--text-main); border-color:var(--ui-line); }
:root .artist-page-heading h1 { font-size:26px; }
:root .artist-page-heading p,:root .artist-breadcrumb { color:var(--text-sub); }
:root .artist-use,:root #artist-return,:root #artist-choice button { background:var(--ui-muted); border-color:var(--ui-line); color:var(--text-main); }
:root #artist-choice #artist-choice-apply { background:var(--primary); border-color:var(--primary); color:var(--ui-primary-text); }
:root { --background-color:var(--ui-canvas) !important; --card-background:var(--ui-surface) !important; --text-color:var(--text-main) !important; --secondary-text-color:var(--text-sub) !important; --border-color:var(--ui-line) !important; --accent-color:var(--ui-accent) !important; }
@media(max-width:600px) {
 :root .navbar-top { padding:12px; }
 :root .nav-tab { font-size:14px; padding:10px 12px; }
 :root #cardChar,:root #cardOutfit,:root .mix-section { padding:16px; }
 :root .name-display { font-size:20px; }
 :root .final-prompt-header { align-items:flex-start; gap:12px; }
 :root .final-prompt-hint { font-size:12px; }
 :root .big-btn { font-size:14px; padding:12px; }
}
@media(prefers-reduced-motion:reduce) { :root *, :root *::before, :root *::after { transition-duration:.01ms !important; animation-duration:.01ms !important; } }

:root #deepseekPromptAssistant>* { margin:0; }
:root .final-prompt-header { margin-bottom:0; }
:root #magicConnector,:root #magicSuffix { background:var(--ui-muted) !important; color:var(--text-main) !important; border-color:var(--ui-line) !important; }
:root #aiGenParams,:root #aiGenPlaceholder,:root #aiGenLoraPanel { background:var(--ui-muted) !important; border:1px solid var(--ui-line) !important; }
:root .ai-lora-header { background:var(--ui-muted); border-color:var(--ui-line); color:var(--text-main); }
:root .ai-lora-title,:root .ai-lora-toggle-icon { color:var(--text-sub); }
:root #aiGenerateBtn { background:var(--primary) !important; color:var(--ui-primary-text) !important; box-shadow:none !important; font-size:15px !important; border-radius:8px !important; min-height:44px; }
:root .studio-recommendation { padding:16px; margin-bottom:16px; border:1px solid var(--ui-line); border-radius:8px; background:var(--ui-muted); color:var(--text-sub); font-size:14px; line-height:1.75; }
:root .studio-recommendation b { color:var(--text-main); font-weight:600; }
:root .studio-recommendation a { color:var(--ui-accent) !important; }

:root .prompt-box [data-idle="1"] { color:var(--text-sub) !important; opacity:1 !important; }

/* Soft anime identity: card colors, gentle corners and small star details. */
:root { --ui-rose:#edbdd7; --ui-rose-soft:#3a293b; --ui-primary-end:#e9bddb; }
:root[data-theme=light] { --ui-rose:#9d5176; --ui-rose-soft:#fbeef5; }
:root #cardChar,:root #cardOutfit,:root .mix-section { border-radius:16px; }
:root #cardChar { border-top:2px solid var(--ui-accent); background:radial-gradient(ellipse at 0 0,color-mix(in srgb,var(--ui-accent) 7%,transparent),transparent 60%),var(--ui-surface); }
:root #cardOutfit { border-top:2px solid var(--ui-rose); background:radial-gradient(ellipse at 100% 0,color-mix(in srgb,var(--ui-rose) 7%,transparent),transparent 60%),var(--ui-surface); }
:root .btn-roll-char { background:var(--ui-accent-soft); color:var(--ui-accent); border-color:transparent; border-radius:10px; }
:root .btn-roll-outfit { background:var(--ui-rose-soft); color:var(--ui-rose); border-color:transparent; border-radius:10px; }
:root .btn-roll-outfit:hover { background:var(--ui-rose-soft); color:var(--ui-rose); border-color:var(--ui-rose); }
:root .btn-mix-all { background:linear-gradient(110deg,var(--primary),var(--ui-primary-end)); border-radius:10px; }
:root #aiGenerateBtn { background:linear-gradient(110deg,var(--primary),var(--ui-primary-end)) !important; }
:root .final-prompt-title::before { content:'✦'; color:var(--ui-accent); margin-right:2px; }
:root .nav-tab.active { border-radius:10px 10px 0 0; }
:root .name-display { text-shadow:none; }

/* Card and action accents use the same semantic roles as the complete theme. */
:root #cardChar { border-top-color:var(--draw-char); }
:root #cardOutfit { border-top-color:var(--draw-outfit); }
:root #cardChar .filter-trigger { color:var(--draw-char-ink); border-color:color-mix(in srgb,var(--draw-char-ink) 35%,var(--ui-line)); }
:root #cardOutfit .filter-trigger { color:var(--draw-outfit-ink); border-color:color-mix(in srgb,var(--draw-outfit-ink) 35%,var(--ui-line)); }
:root .btn-roll-char,:root .btn-roll-char:hover { background:linear-gradient(110deg,var(--draw-char),var(--draw-char-end)); color:var(--draw-char-content); border-color:transparent; font-weight:600; }
:root .btn-roll-outfit,:root .btn-roll-outfit:hover { background:linear-gradient(110deg,var(--draw-outfit),var(--draw-outfit-end)); color:var(--draw-outfit-content); border-color:transparent; font-weight:600; }
:root .btn-mix-all,:root .btn-mix-all:hover { background:linear-gradient(110deg,var(--primary),var(--ui-primary-end)); color:var(--ui-primary-text); border-color:transparent; }
:root .btn-roll-char:hover:not(:disabled),:root .btn-roll-outfit:hover:not(:disabled),:root .btn-mix-all:hover:not(:disabled) { filter:brightness(.97); }
:root .ptl-artist-link { border-color:var(--ui-accent); }
:root .prompt-tag-library button:focus-visible,:root .prompt-tag-library input:focus-visible { outline-color:var(--ui-accent); }
:root .tag-chip:not(.tag-chip-risky) .en { color:var(--text-main); }
:root .tag-chip:not(.tag-chip-risky) .cn { color:var(--text-sub); }
:root .tag-chip:hover:not(.tag-chip-risky) { background:var(--ui-accent-soft) !important; border-color:var(--ui-accent) !important; }
:root .ai-model-btn.active .ai-model-title,:root .ai-size-btn.active { color:var(--ui-accent); }
:root .ai-gen-title { color:var(--ui-accent) !important; }

/* Four full-width presets; price is beside the name, never below dimensions. */
:root #aiGenSizeOptions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; width:100%; }
:root #aiGenSizeOptions .ai-size-btn { display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"name cost" "dimensions dimensions"; align-items:center; gap:6px 8px; width:100%; min-width:0; max-width:none; min-height:78px; margin:0; padding:12px 14px; text-align:left; border-radius:10px; box-sizing:border-box; }
:root .ai-size-name { grid-area:name; font-size:15px; font-weight:600; line-height:1.4; white-space:nowrap; }
:root .ai-size-cost { grid-area:cost; display:inline-flex; align-items:center; justify-content:center; padding:3px 7px; border-radius:6px; color:var(--draw-char-ink); background:var(--draw-char-soft); font-size:13px; font-weight:600; line-height:1.4; white-space:nowrap; }
:root .ai-size-dimensions { grid-area:dimensions; color:var(--text-sub); font-size:13px; line-height:1.5; font-variant-numeric:tabular-nums; }
@media(max-width:600px) { :root #aiGenSizeOptions { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; } :root #aiGenSizeOptions .ai-size-btn { padding:10px; gap:6px; } :root .ai-size-name { font-size:14px; } :root .ai-size-cost { font-size:12px; padding:3px 6px; } }

/* Shared outer width for the home page and creator workspace. */
:root { --site-page-width:1440px; }
:root .pxlsan-home :is(.navbar-wrapper,.main-container,.filter-container,.btn-mix-all,.mix-section,.message-board,.leaderboard-section,#about) { width:100%; max-width:var(--site-page-width) !important; box-sizing:border-box; }
:root .pxlsan-home .card-column { min-width:0; flex:1 1 300px; }

/* Keep the shared navigation and main site pages aligned with the home page. */
:root .navbar-wrapper,
:root :is(.product-grid,.game-hub-shell,.page-wrapper,.tools-page,.artist-page-heading,.controls-container,#main-content),
:root .artist-page-heading + .header { width:100%; max-width:var(--site-page-width) !important; margin-left:auto; margin-right:auto; box-sizing:border-box; }

:root body.pxlsan-home { padding:20px !important; }
@media (max-width:600px) { :root body.pxlsan-home { padding:12px !important; } }

:root .pxlsan-home :is(#promptChar,#promptOutfit) { background:transparent !important; border:0 !important; box-shadow:none !important; border-radius:0; padding:4px 0; height:auto; min-height:120px; overflow:visible; overflow-wrap:anywhere; }
:root .pxlsan-home :is(#badgeChar,#badgeOutfit) { margin-top:13px; }
:root .pxlsan-home .filter-trigger { flex-shrink:0; white-space:nowrap; }

:root .pxlsan-home .idle-data-flow { display:grid; grid-template-columns:minmax(0,1fr); gap:0; width:100%; height:132px; overflow:hidden; mask-image:linear-gradient(transparent,#000 14%,#000 82%,transparent); pointer-events:none; user-select:none; }
:root .pxlsan-home .idle-data-lane { overflow:hidden; min-width:0; }
:root .pxlsan-home .idle-data-track { animation:idle-data-stream var(--flow-time) linear var(--flow-delay) infinite; will-change:transform; color:var(--text-sub); opacity:.65; font:11px/22px Consolas,monospace; }
:root .pxlsan-home .idle-data-track span { display:block; white-space:nowrap; text-align:center; }
@keyframes idle-data-stream { from { transform:translateY(0); } to { transform:translateY(-50%); } }
@media(max-width:600px) { :root .pxlsan-home .idle-data-flow { grid-template-columns:minmax(0,1fr); gap:0; } }
@media(prefers-reduced-motion:reduce) { :root .pxlsan-home .idle-data-track { animation:none; } }
