:root {
  --bg: #f5f4f8;
  --surface: #ffffff;
  --surface-2: #eeecf3;
  --border: #e1dee9;
  --text: #17151f;
  --text-muted: #5d5970;
  --text-subtle: #9894a8;
  --primary: #6d4aff;
  --primary-hover: #5a37ec;
  --on-primary: #ffffff;
  --pink: #ff4fa3;
  --amber: #ffb347;
  --brand-grad: linear-gradient(120deg, #6d4aff, #b44dff 45%, #ff4fa3 75%, #ffb347);
  --danger: #e5484d;
  --warn: #f5a524;
  --code-bg: #121119;
  --code-text: #e7e4f3;
  --font: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --display: "Space Grotesk", "IBM Plex Sans Arabic", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(20,10,50,.06);
  --shadow-md: 0 8px 24px -8px rgba(20,10,50,.16);
  --shadow-lg: 0 24px 60px -20px rgba(20,10,50,.35);
  --ease: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0b12; --surface: #15131d; --surface-2: #1f1c2a; --border: #2b2838;
    --text: #f2f0f9; --text-muted: #b1acc4; --text-subtle: #6f6a84;
    --primary: #8b6dff; --primary-hover: #a28aff; --on-primary: #ffffff;
    --code-bg: #0a0910;
    --shadow-md: 0 8px 24px -8px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 15px; line-height: 1.7; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; display: block; }
[hidden] { display: none !important; }
kbd { font-family: var(--mono); font-size: .6875rem; padding: 1px 5px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); }
.muted { color: var(--text-muted); } .small { font-size: .8125rem; }

/* ============ Shell ============ */
.app { display: grid; grid-template-columns: 440px 1fr; height: 100dvh; }
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-inline-end: 1px solid var(--border); position: relative; z-index: 2; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; box-shadow: 0 6px 16px -6px #6d4aff; }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 2.4; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.125rem; line-height: 1.1; letter-spacing: -.01em; }
.brand-sub { font-size: .6875rem; color: var(--text-subtle); letter-spacing: .06em; direction: ltr; text-align: end; font-family: var(--display); }
.head-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn { position: relative; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text-muted); transition: background .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.tool-count { position: absolute; inset-block-start: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--primary); color: #fff; font-size: .625rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }

.credit-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-full); background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-weight: 700; font-size: .875rem; font-variant-numeric: tabular-nums; transition: background .2s, transform .2s var(--ease); }
.credit-pill:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.credit-pill svg { width: 16px; height: 16px; }
.credit-pill.low { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.credit-pill.bump { animation: bump .5s var(--ease); }
.credit-float { position: absolute; inset-inline-end: 8px; top: 0; font-size: .8125rem; font-weight: 700; pointer-events: none; animation: floatUp 1.2s var(--ease) forwards; }
.credit-float.minus { color: var(--danger); } .credit-float.plus { color: #22a06b; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .875rem; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); transition: box-shadow .2s; }
.avatar-btn:hover { box-shadow: 0 0 0 2px var(--primary); }

/* ============ Calligraphic H logo ============ */
.h-mark { background: radial-gradient(120% 120% at 30% 15%, #2d2418, #0d0a06 70%) !important; box-shadow: inset 0 0 0 1px rgba(226,194,125,.4), inset 0 1px 0 rgba(255,240,200,.15), 0 8px 22px -8px rgba(201,164,92,.55) !important; overflow: hidden; }
.h-mark span { display: block; font-family: "Great Vibes", "Brush Script MT", cursive; font-weight: 400; line-height: 1; transform: translate(-3%, 8%); background: linear-gradient(160deg, #fff4d2 0%, #e8c77f 30%, #b3822f 58%, #f6dfa4 80%, #c89a4b 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }
.brand-mark.h-mark span { font-size: 30px; }
.empty-mark.h-mark span { font-size: 46px; }
.login-mark.h-mark span { font-size: 58px; }
.placeholder-art.h-mark span { font-size: 70px; }
.ai-avatar.h-mark span { font-size: 20px; }
.h-mark::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, transparent 35%, rgba(255,236,190,.22) 50%, transparent 65%); background-size: 250% 100%; animation: sheen 5s ease-in-out infinite; pointer-events: none; }
.brand-mark, .empty-mark, .login-mark, .placeholder-art, .ai-avatar { position: relative; }
@keyframes sheen { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }

/* ============ Messages ============ */
.messages { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 18px; }
.empty { margin: auto 0; display: flex; flex-direction: column; gap: 12px; padding-block: 16px; }
.empty-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; box-shadow: 0 12px 30px -10px #b44dff; margin-bottom: 4px; }
.empty-mark svg { width: 28px; height: 28px; stroke-width: 2.4; }
.empty h1 { font-size: 1.625rem; line-height: 1.3; font-weight: 700; }
.grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: var(--display); }
.empty p { color: var(--text-muted); }
.suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.suggestion { display: flex; align-items: center; gap: 10px; text-align: start; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: .875rem; color: var(--text-muted); transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); }
.suggestion svg { width: 16px; height: 16px; color: var(--primary); }
.suggestion:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }

.msg { display: flex; flex-direction: column; gap: 8px; animation: rise .35s var(--ease) both; }
.msg-user { align-items: flex-start; }
.msg-user .bubble { background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--r-lg); border-start-start-radius: 4px; max-width: 90%; white-space: pre-wrap; word-wrap: break-word; }
.msg-user .bubble-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .6875rem; font-weight: 600; padding: 2px 8px; border-radius: var(--r-full); background: var(--surface-2); color: var(--text-muted); }
.tag svg { width: 12px; height: 12px; }
.tag.t-max { background: linear-gradient(90deg, #ff6a3d, #ff4fa3); color: #fff; }

.ai-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .8125rem; color: var(--text-muted); }
.ai-avatar { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; }
.ai-avatar svg { width: 14px; height: 14px; stroke-width: 2.6; }
.notes { font-size: .9375rem; }
.notes ul { padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.notes li::marker { color: var(--primary); }
.notes p + p, .notes p + ul, .notes ul + p { margin-top: 6px; }
.notes code { font-family: var(--mono); font-size: .8125rem; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

details.thinking { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-size: .8125rem; }
details.thinking summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text-muted); font-weight: 500; user-select: none; }
details.thinking summary::-webkit-details-marker { display: none; }
details.thinking summary .chev { width: 14px; height: 14px; margin-inline-start: auto; transition: transform .2s var(--ease); }
details.thinking[open] summary .chev { transform: rotate(180deg); }
.thinking-body { padding: 0 12px 10px; color: var(--text-subtle); white-space: pre-wrap; max-height: 200px; overflow-y: auto; direction: ltr; text-align: left; font-family: var(--mono); font-size: .75rem; line-height: 1.6; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.live .dot { animation: pulse 1s ease-in-out infinite; }

.typing { display: flex; gap: 4px; padding: 4px 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-subtle); animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }

.version-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: start; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.version-card:hover { border-color: var(--text-subtle); }
.version-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.version-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.version-title { display: block; font-weight: 600; font-size: .875rem; line-height: 1.3; }
.version-meta { display: block; font-size: .75rem; color: var(--text-subtle); }
.msg-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { font-size: .6875rem; color: var(--text-subtle); padding: 2px 8px; border: 1px solid var(--border); border-radius: var(--r-full); font-variant-numeric: tabular-nums; }
.meta-chip.good { color: #22a06b; border-color: color-mix(in srgb, #22a06b 35%, transparent); }

.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); font-size: .875rem; border: 1px solid var(--border); background: var(--bg); }
.notice svg { width: 18px; height: 18px; margin-top: 2px; }
.notice.error { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.notice.credits { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.notice b { display: block; }
.notice-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.btn-soft { padding: 6px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); font-size: .8125rem; font-weight: 600; transition: border-color .2s, color .2s; }
.btn-soft:hover { border-color: var(--primary); color: var(--primary); }

/* ============ Warning (ethics) ============ */
.warning-card { position: relative; overflow: hidden; border-radius: var(--r-lg); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); animation: shake .5s var(--ease) both; }
.warning-card::before { content: ""; display: block; height: 8px; background: repeating-linear-gradient(-45deg, var(--warn) 0 12px, #1a1a1a 12px 24px); }
.warning-inner { display: flex; gap: 12px; padding: 14px 16px 16px; }
.warning-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--danger); color: #fff; flex-shrink: 0; box-shadow: 0 8px 20px -8px var(--danger); animation: pulseRing 1.6s ease-out 2; }
.warning-icon svg { width: 22px; height: 22px; stroke-width: 2.2; }
.warning-title { font-weight: 700; color: var(--danger); font-size: .9375rem; }
.warning-cat { display: inline-block; font-size: .6875rem; font-weight: 700; padding: 1px 8px; border-radius: var(--r-full); background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); margin-top: 2px; }
.warning-reason { font-size: .875rem; margin-top: 6px; }
.warning-foot { font-size: .75rem; color: var(--text-muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.warning-foot svg { width: 14px; height: 14px; color: #22a06b; }

body.is-warning { --primary: var(--danger); --primary-hover: #c9373c; }
body.is-warning .chat { box-shadow: inset 0 3px 0 var(--danger); }
body.is-warning .composer-box { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
body.is-warning .canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px color-mix(in srgb, var(--danger) 22%, transparent); animation: fadeIn .4s both; }
body.is-warning .brand-mark { box-shadow: inset 0 0 0 1px var(--danger), 0 6px 16px -6px var(--danger) !important; }

/* ============ Composer ============ */
.composer { padding: 10px 14px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; position: relative; }
.edit-context { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--text-muted); padding: 6px 10px; border-radius: var(--r-md); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.edit-context svg { width: 14px; height: 14px; color: var(--primary); }
.edit-context button { margin-inline-start: auto; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--text-muted); }
.edit-context button:hover { background: var(--surface); color: var(--text); }
.edit-context button svg { color: inherit; }

.styles { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.styles::-webkit-scrollbar { display: none; }
.style-chip { flex-shrink: 0; padding: 4px 11px; border-radius: var(--r-full); border: 1px solid var(--border); font-size: .75rem; font-weight: 500; color: var(--text-muted); background: var(--surface); transition: all .2s var(--ease); }
.style-chip:hover { color: var(--text); border-color: var(--text-subtle); }
.style-chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }

.composer-box { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.composer textarea { display: block; width: 100%; resize: none; border: none; background: transparent; outline: none; padding: 12px 14px; max-height: 180px; min-height: 48px; line-height: 1.6; }
.composer textarea::placeholder { color: var(--text-subtle); }

.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.modes { display: flex; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 12px; }
.mode { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 9px; font-size: .8125rem; font-weight: 600; color: var(--text-muted); transition: background .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease); isolation: isolate; }
.mode svg { width: 15px; height: 15px; }
.mode:hover { color: var(--text); }
.mode-cost { font-size: .6875rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 12%, transparent); font-variant-numeric: tabular-nums; }
.mode[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.mode[data-mode="fast"][aria-checked="true"] svg { color: #0ea5e9; }
.mode[data-mode="balanced"][aria-checked="true"] svg { color: var(--primary); }

/* --- MAX mode: living fire border --- */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.mode-max::before { content: ""; position: absolute; inset: -1px; border-radius: 10px; padding: 1.5px; background: conic-gradient(from var(--ang), #ff6a3d, #ff4fa3, #b44dff, #ffb347, #ff6a3d); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .45; animation: spin 4s linear infinite; z-index: -1; transition: opacity .3s; }
.mode-max:hover::before { opacity: .9; }
.mode-max svg { color: #ff6a3d; }
.mode-max[aria-checked="true"] { background: linear-gradient(120deg, #2a0f1f, #3b1030); color: #fff; box-shadow: 0 0 0 1px rgba(255,106,61,.3), 0 6px 22px -4px rgba(255,79,163,.65), 0 0 30px -6px rgba(255,106,61,.7); }
.mode-max[aria-checked="true"]::before { opacity: 1; animation-duration: 1.6s; }
.mode-max[aria-checked="true"] svg { color: #ffb347; filter: drop-shadow(0 0 6px #ff6a3d); animation: flicker 1.2s ease-in-out infinite; }
.mode-max[aria-checked="true"] .mode-label { background: linear-gradient(90deg, #ffd27a, #ff8a5c, #ff6bb5, #ffd27a); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2s linear infinite; }
.mode-max[aria-checked="true"] .mode-cost { background: rgba(255,255,255,.14); color: #ffd27a; }
.max-embers { position: absolute; inset: 0; pointer-events: none; overflow: visible; opacity: 0; transition: opacity .3s; }
.mode-max[aria-checked="true"] .max-embers { opacity: 1; }
.max-embers i { position: absolute; bottom: 4px; width: 3px; height: 3px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px #ff6a3d; animation: ember 1.8s ease-out infinite; }
.max-embers i:nth-child(1) { inset-inline-start: 18%; animation-delay: 0s; }
.max-embers i:nth-child(2) { inset-inline-start: 38%; animation-delay: .5s; background: #ff6bb5; }
.max-embers i:nth-child(3) { inset-inline-start: 58%; animation-delay: 1s; }
.max-embers i:nth-child(4) { inset-inline-start: 76%; animation-delay: .3s; background: #ffd27a; }
.max-embers i:nth-child(5) { inset-inline-start: 90%; animation-delay: 1.3s; }

.composer[data-mode="max"] .composer-box { border-color: transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, conic-gradient(from var(--ang), #ff6a3d, #ff4fa3, #b44dff, #ffb347, #ff6a3d) border-box; animation: spin 3s linear infinite; box-shadow: 0 0 0 4px rgba(255,79,163,.08), 0 10px 40px -12px rgba(255,79,163,.5); }
.composer[data-mode="max"]::before { content: ""; position: absolute; inset: -40px 0 auto; height: 80px; background: radial-gradient(50% 60% at 50% 100%, rgba(255,106,61,.16), transparent 70%); pointer-events: none; }

.send-btn { position: relative; height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--primary); color: var(--on-primary); font-weight: 700; transition: background .2s var(--ease), transform .15s var(--ease), opacity .2s, box-shadow .2s; }
.send-btn:hover { background: var(--primary-hover); }
.send-btn:active { transform: scale(.96); }
.send-btn:disabled { opacity: .45; cursor: not-allowed; }
.send-btn .i-send { width: 18px; height: 18px; stroke-width: 2.2; }
[dir="rtl"] .send-btn .i-send { transform: scaleX(-1); }
.send-cost { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; padding-inline-end: 8px; border-inline-end: 1px solid rgba(255,255,255,.3); font-variant-numeric: tabular-nums; }
.send-cost svg { width: 13px; height: 13px; }
.send-btn.stop { background: var(--text); color: var(--surface); }
.send-btn.stop .send-cost { display: none; }
.composer[data-mode="max"] .send-btn:not(.stop) { background: linear-gradient(120deg, #ff6a3d, #ff4fa3, #b44dff, #ff6a3d); background-size: 250% auto; animation: shine 3s linear infinite; box-shadow: 0 8px 24px -8px #ff4fa3; }
.composer-hint { font-size: .75rem; color: var(--text-subtle); text-align: center; }
.composer[data-mode="max"] .composer-hint { color: #ff6a3d; font-weight: 500; }

.models { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.model-card { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); text-align: start; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); min-width: 0; }
.model-card:hover { transform: translateY(-1px); border-color: var(--text-subtle); }
.model-card b { display: block; font-family: var(--display); font-size: .8125rem; line-height: 1.2; }
.model-card small { display: block; font-size: .6875rem; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-card > span:last-child { min-width: 0; }
.model-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.model-ico svg { width: 16px; height: 16px; }
.m-canvas { background: linear-gradient(135deg, #6d4aff, #b44dff); }
.m-forge { background: linear-gradient(135deg, #0ea5e9, #10b981); }
.m-muse { background: linear-gradient(135deg, #ff4fa3, #ffb347); }
.model-card[aria-checked="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); background: var(--surface); }
.fb-row { display: flex; gap: 4px; }
.fb-row button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border); font-size: .875rem; transition: all .2s; }
.fb-row button:hover { border-color: var(--primary); }
.fb-row button.on { background: color-mix(in srgb, var(--primary) 14%, transparent); border-color: var(--primary); }
@media (max-width: 1060px) { .model-card small { display: none; } }
.quick-edits { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.quick-edits::-webkit-scrollbar { display: none; }
.quick-edits button { flex-shrink: 0; padding: 4px 10px; border-radius: var(--r-full); font-size: .75rem; font-weight: 600; color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, transparent); transition: background .2s; }
.quick-edits button:hover { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.enhance-btn { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 8px; font-size: .7rem; font-weight: 600; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); transition: color .2s, border-color .2s; }
.enhance-btn:hover { color: var(--primary); border-color: var(--primary); }
.enhance-btn svg { width: 13px; height: 13px; }
.enhance-btn.busy svg { animation: spinIcon 1s linear infinite; }
.composer textarea { padding-bottom: 36px; }
@keyframes spinIcon { to { transform: rotate(360deg); } }
.theme-pick { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; margin-inline-end: 4px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-muted); font-size: .8125rem; cursor: pointer; }
.theme-pick svg { width: 15px; height: 15px; }
.theme-pick select { border: 0; background: transparent; font: inherit; color: var(--text); outline: none; cursor: pointer; }

/* ============ Stage ============ */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--r-md); gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; font-size: .8125rem; font-weight: 500; color: var(--text-muted); transition: background .2s var(--ease), color .2s var(--ease); }
.seg button svg { width: 16px; height: 16px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg.devices button { padding: 6px 9px; }
.tools { display: flex; align-items: center; gap: 2px; }

.canvas { flex: 1; min-height: 0; position: relative; overflow: auto; display: flex; justify-content: center; padding: 20px; background-color: var(--bg); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; }
.frame-wrap { width: 100%; height: 100%; background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-md), 0 0 0 1px var(--border); transition: width .35s var(--ease); }
.frame-wrap[data-device="tablet"] { width: 768px; max-width: 100%; }
.frame-wrap[data-device="mobile"] { width: 390px; max-width: 100%; }
.frame-wrap iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.code-view { position: absolute; inset: 20px; background: var(--code-bg); color: var(--code-text); border-radius: var(--r-lg); overflow: auto; direction: ltr; text-align: left; box-shadow: var(--shadow-md); }
.code-view pre { font-family: var(--mono); font-size: .8125rem; line-height: 1.7; padding: 20px 24px; white-space: pre; tab-size: 2; }

.placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; pointer-events: none; }
.placeholder-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 320px; color: var(--text-muted); }
.placeholder-art { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); color: var(--primary); animation: float 4s ease-in-out infinite; }
.placeholder-art svg { width: 40px; height: 40px; stroke-width: 2; }
.placeholder strong { color: var(--text); font-size: 1.0625rem; }

.status-pill { position: absolute; inset-block-start: 32px; inset-inline-end: 32px; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-full); background: var(--text); color: var(--surface); font-size: .75rem; font-weight: 500; box-shadow: var(--shadow-lg); }
.status-pill .dot { background: var(--amber); animation: pulse 1s ease-in-out infinite; }
.status-pill.max { background: linear-gradient(120deg, #2a0f1f, #3b1030); color: #ffd27a; box-shadow: 0 10px 30px -8px #ff4fa3; }
.status-pill.max .dot { background: #ff6a3d; box-shadow: 0 0 8px #ff6a3d; }

/* ============ Modals ============ */
.modal { margin: auto; border: none; border-radius: var(--r-xl); background: var(--surface); color: var(--text); width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-shadow: var(--shadow-lg); padding: 0; overflow: hidden; }
.modal[open] { animation: pop .3s var(--ease) both; display: flex; flex-direction: column; }
.modal-wide { width: min(640px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(10,8,20,.55); backdrop-filter: blur(4px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }

.login { align-items: stretch; text-align: center; padding: 32px 28px 28px; }
.login-mark { width: 64px; height: 64px; margin: 0 auto 4px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-grad); color: #fff; box-shadow: 0 16px 36px -12px #b44dff; }
.login-mark svg { width: 34px; height: 34px; stroke-width: 2.4; }
.login h2 { font-size: 1.5rem; }
.field { display: flex; flex-direction: column; gap: 6px; text-align: start; }
.field span { font-size: .8125rem; font-weight: 600; }
.field input { height: 46px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--bg); outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.btn-primary-lg { height: 48px; border-radius: var(--r-md); background: var(--brand-grad); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -10px #b44dff; transition: transform .2s var(--ease), box-shadow .2s; }
.btn-primary-lg:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px #b44dff; }
.btn-text { align-self: center; font-size: .8125rem; color: var(--text-subtle); padding: 6px 10px; border-radius: 6px; }
.btn-text:hover { color: var(--danger); }

.wallet { display: grid; grid-template-columns: 1fr; gap: 12px; }
.wallet-main { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 20px; border-radius: var(--r-lg); background: var(--brand-grad); color: #fff; }
.wallet-main::after { content: ""; position: absolute; inset-inline-end: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.12); }
.wallet-label { font-size: .8125rem; opacity: .85; }
.wallet-value { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 2.5rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wallet-value svg { width: 30px; height: 30px; }
.wallet-note { font-size: .75rem; opacity: .85; }
.wallet-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wallet-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.wallet-stats span { font-family: var(--display); font-weight: 700; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.wallet-stats small { font-size: .6875rem; color: var(--text-muted); }
.pricing { display: grid; gap: 6px; }
.pricing div { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-md); background: var(--bg); font-size: .8125rem; }
.pricing div > span { margin-inline-start: auto; color: var(--text-muted); }
.pricing svg { width: 16px; height: 16px; color: var(--primary); }
.pricing .p-max svg { color: #ff6a3d; }
.fair { font-size: .75rem; color: var(--text-muted); padding: 8px 12px; border-inline-start: 3px solid #22a06b; background: color-mix(in srgb, #22a06b 7%, transparent); border-radius: 6px; }
.sub { font-size: .875rem; font-weight: 700; }
.ledger { list-style: none; display: flex; flex-direction: column; }
.ledger li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: .8125rem; }
.ledger li:last-child { border-bottom: none; }
.ledger time { display: block; font-size: .6875rem; color: var(--text-subtle); }
.ledger .delta { font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }
.ledger .delta.plus { color: #22a06b; } .ledger .delta.minus { color: var(--danger); } .ledger .delta.zero { color: var(--text-subtle); }

.admin-login { display: flex; flex-direction: column; gap: 12px; }
.admin-site { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--border); }
.admin-site > div:first-child { display: flex; flex-direction: column; }
.admin-big { font-family: var(--display); font-size: 1.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-stats { font-size: .75rem; color: var(--text-muted); display: flex; flex-direction: column; }
.row-btns { display: flex; gap: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.admin-table th { text-align: start; font-size: .6875rem; color: var(--text-subtle); font-weight: 600; padding: 8px 10px; background: var(--bg); }
.admin-table td { padding: 8px 10px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.admin-table td:last-child { display: flex; gap: 4px; justify-content: flex-end; }

.photo-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-list li { border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; background: var(--bg); font-size: .6875rem; }
.photo-list img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--surface-2); }
.photo-list div { padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.photo-list b { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-list a { color: var(--primary); }
.report-btn { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; align-self: flex-start; padding: 3px 8px; border-radius: 6px; font-size: .6875rem; font-weight: 600; color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); transition: background .2s; }
.report-btn:hover { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.report-btn svg { width: 12px; height: 12px; }

.toast { position: fixed; inset-block-end: 24px; inset-inline-start: 50%; transform: translate(50%, 20px); background: var(--text); color: var(--surface); padding: 8px 16px; border-radius: var(--r-full); font-size: .8125rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 100; }
.toast.show { opacity: 1; transform: translate(50%, 0); }
.mobile-tabs { display: none; }

/* ============ Motion ============ */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes bounce { 0%,60%,100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes spin { to { --ang: 360deg; } }
@keyframes shine { to { background-position: 200% center; } }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.12) rotate(-4deg); } 50% { transform: scale(.95) rotate(3deg); } 75% { transform: scale(1.08) rotate(-2deg); } }
@keyframes ember { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-26px) scale(.3); opacity: 0; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bump { 40% { transform: scale(1.12); } }
@keyframes floatUp { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-22px); } }
@keyframes shake { 0%,100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes pulseRing { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); } to { box-shadow: 0 0 0 14px transparent; } }
@keyframes fadeIn { from { opacity: 0; } }

/* ============ Responsive ============ */
@media (max-width: 1060px) { .app { grid-template-columns: 380px 1fr; } .mode-label { display: none; } .mode { padding: 0 8px; } }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mode-label { display: inline; }
  .mobile-tabs { display: flex; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .mobile-tabs .seg { width: 100%; } .mobile-tabs .seg button { flex: 1; justify-content: center; }
  .chat, .stage { grid-row: 2; grid-column: 1; min-height: 0; }
  .app[data-view="chat"] .stage, .app[data-view="stage"] .chat { display: none; }
  .chat { border-inline-end: none; }
  .seg.devices { display: none; }
  .canvas { padding: 12px; } .code-view { inset: 12px; }
  .status-pill { inset-block-start: 20px; inset-inline-end: 20px; }
}
@media (max-width: 420px) { .mode-label { display: none; } .brand-sub { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* =====================================================================
   Layout v3 — Gemini / ChatGPT inspired: sidebar · chat · stage
   ===================================================================== */
.app { grid-template-columns: 272px minmax(380px, 460px) 1fr; }
.app.no-design { grid-template-columns: 272px 1fr; }
.app.no-design .stage { display: none; }
.app.side-collapsed { grid-template-columns: 0 minmax(380px, 460px) 1fr; }
.app.side-collapsed.no-design { grid-template-columns: 0 1fr; }
.app.side-collapsed .sidebar { visibility: hidden; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; min-height: 0; background: color-mix(in srgb, var(--surface) 55%, var(--bg)); border-inline-end: 1px solid var(--border); padding: 12px 10px; gap: 4px; overflow: hidden; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; font-size: .875rem; font-weight: 500; color: var(--text); text-align: start; transition: background .15s; }
.side-item:hover { background: var(--surface-2); }
.side-item svg { width: 17px; height: 17px; color: var(--text-muted); }
.side-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .2s, background .2s; cursor: text; margin-block: 2px; }
.side-search:focus-within { border-color: var(--primary); background: var(--surface); }
.side-search svg { width: 16px; height: 16px; color: var(--text-subtle); }
.side-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: .8125rem; }
.side-search input::-webkit-search-cancel-button { display: none; }
.side-search kbd { font-size: .625rem; color: var(--text-subtle); }
.side-label { font-size: .6875rem; font-weight: 700; color: var(--text-subtle); padding: 14px 10px 4px; letter-spacing: .02em; }
.projects { list-style: none; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin-inline: -2px; padding-inline: 2px; scrollbar-width: thin; }
.project { position: relative; display: flex; align-items: center; border-radius: 10px; transition: background .15s; }
.project:hover, .project.active { background: var(--surface-2); }
.project.active::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--primary); }
.project-open { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 7px 12px; text-align: start; }
.project-open b { font-size: .8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-open small { font-size: .6875rem; color: var(--text-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project mark { background: color-mix(in srgb, var(--primary) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.project-del { opacity: 0; width: 28px; height: 28px; margin-inline-end: 4px; border-radius: 8px; display: grid; place-items: center; color: var(--text-subtle); transition: opacity .15s, color .15s, background .15s; flex-shrink: 0; }
.project:hover .project-del, .project-del:focus-visible { opacity: 1; }
.project-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.project-del svg { width: 15px; height: 15px; }
.projects-empty { font-size: .75rem; color: var(--text-subtle); padding: 6px 10px; }
.side-foot { display: flex; align-items: center; gap: 10px; padding: 8px; margin-top: 6px; border-radius: 12px; text-align: start; transition: background .15s; }
.side-foot:hover { background: var(--surface-2); }
.side-user { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.side-user b { font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user small { font-size: .6875rem; color: var(--text-subtle); }
.side-foot .credit-pill { height: 28px; padding: 0 10px; font-size: .8125rem; }
.scrim { display: none; }

/* Chat column */
.chat { position: relative; background: var(--bg); border-inline-end: 1px solid var(--border); }
.app.no-design .chat { border-inline-end: 0; }
.chat-head { justify-content: flex-start; min-height: 56px; border-bottom: 0; position: relative; z-index: 2; }
.chat-title { font-weight: 600; font-size: .9375rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.app.side-collapsed .menu-btn { display: grid; }
.chat-head .mobile-tabs { display: none; padding: 3px; border: 0; }
.messages, .composer, .suggestions { width: 100%; max-width: 780px; margin-inline: auto; }
.composer { border-top: 0; padding: 8px 16px 14px; z-index: 3; }

/* Empty state: centered greeting + composer, blue glow */
.app.is-empty .chat { justify-content: center; }
.app.is-empty .chat::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(45% 42% at 50% 52%, color-mix(in srgb, #2f4bd8 32%, transparent), transparent 70%), radial-gradient(30% 30% at 62% 40%, color-mix(in srgb, #8b5cf6 18%, transparent), transparent 70%); animation: glowBreath 9s ease-in-out infinite alternate; }
.app.is-empty .messages { flex: 0 0 auto; overflow: visible; padding-bottom: 8px; position: relative; }
.app.is-empty .chat-head { position: absolute; top: 0; inset-inline: 0; }
.app:not(.is-empty) .suggestions { display: none; }
.app:not(.is-empty) .empty { display: none !important; }
@keyframes glowBreath { from { opacity: .75; transform: scale(1); } to { opacity: 1; transform: scale(1.08); } }
.empty { position: relative; align-items: center; text-align: center; margin: 0; padding: 0; gap: 8px; }
.greeting { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.greeting span { background: linear-gradient(100deg, var(--text) 30%, #8fa6ff 60%, #c9a4ff 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.greeting-sub { color: var(--text-muted); font-size: .9375rem; }
.suggestions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px 16px 0; flex-direction: row; margin-top: 0; }
.suggestion { border-radius: 999px; padding: 8px 14px; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }

/* Composer pill */
.composer-box { border-radius: 26px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 8px 30px -12px rgba(0,0,0,.35); padding: 6px; }
.app.is-empty .composer-box { box-shadow: 0 20px 60px -20px rgba(47,75,216,.55), 0 0 0 1px color-mix(in srgb, #5b7cff 18%, transparent); }
.composer textarea { padding: 10px 14px 4px; min-height: 44px; }
.composer-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.row-spacer { flex: 1; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--text-muted); background: var(--surface-2); transition: background .15s, color .15s; white-space: nowrap; }
.pill-btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 10%, var(--surface-2)); }
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn.round { width: 36px; padding: 0; justify-content: center; }
.pill-btn[aria-expanded="true"] { color: var(--primary); }
.pill-btn .chev { width: 14px; height: 14px; transition: transform .2s; }
.pill-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.picker-dot { opacity: .4; }
.picker-model { color: var(--text); }
#enhanceBtn.busy svg { animation: spinIcon 1s linear infinite; }
.style-badge { font-size: .75rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--text); color: var(--bg); }
.send-btn { height: 40px; border-radius: 999px; }
.styles { flex-wrap: wrap; padding-top: 2px; }

/* Picker menu (Gemini-like) */
.picker { position: relative; }
.menu { position: absolute; bottom: calc(100% + 10px); inset-inline-end: 0; z-index: 30; width: 300px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 24px 60px -16px rgba(0,0,0,.55); animation: pop .18s var(--ease) both; }
.menu-label { font-size: .6875rem; font-weight: 700; color: var(--text-subtle); padding: 8px 10px 4px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-item { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px 10px; border-radius: 12px; text-align: start; transition: background .15s; font-size: inherit; color: var(--text); background: none; box-shadow: none; }
.menu-item:hover { background: var(--surface-2); }
.menu-item[aria-checked="true"] { background: color-mix(in srgb, var(--primary) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); }
.mi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mi-text b { font-size: .875rem; }
.mi-text small { font-size: .75rem; color: var(--text-subtle); }
.menu-item .check { width: 16px; height: 16px; color: var(--primary); opacity: 0; }
.menu-item[aria-checked="true"] .check { opacity: 1; }
.mode-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); flex-shrink: 0; }
.mode-ico svg { width: 16px; height: 16px; }
.menu-item.mode[data-mode="fast"] .mode-ico { color: #0ea5e9; }
.menu-item.mode[data-mode="balanced"] .mode-ico { color: var(--primary); }
.menu-item.mode-max .mode-ico { background: linear-gradient(135deg, #3b1030, #2a0f1f); color: #ffb347; }
.menu-item.mode-max[aria-checked="true"] { background: linear-gradient(120deg, #2a0f1f, #3b1030); color: #fff; }
.menu-item.mode-max[aria-checked="true"] small { color: #ffb8d6; }
.menu-item .mode-label { display: inline !important; }
.menu-item.model-card { border: 0; }

/* Stage tweaks */
.stage { background: var(--bg); }
.toolbar { background: var(--bg); }

/* Responsive */
@media (max-width: 1180px) {
  .app { grid-template-columns: 240px 380px 1fr; }
  .app.side-collapsed { grid-template-columns: 0 380px 1fr; }
}
@media (max-width: 960px) {
  .app, .app.no-design, .app.side-collapsed, .app.side-collapsed.no-design { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 290px; z-index: 50; transform: translateX(100%); transition: transform .3s var(--ease); visibility: visible !important; }
  .app.side-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .app.side-open .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .chat, .stage { grid-row: 1; grid-column: 1; }
  .app:not(.no-design) .chat-head .mobile-tabs { display: inline-flex; }
  .app[data-view="chat"] .stage, .app[data-view="stage"] .chat { display: none; }
  .app[data-view="stage"] .stage { display: flex; }
}
@media (max-width: 520px) {
  #enhanceBtn span, .picker-dot, #pickerMode { display: none; }
  .menu { width: min(300px, calc(100vw - 32px)); }
}

.chat { overflow: hidden; }
html, body { overflow: hidden; max-width: 100vw; }

/* =====================================================================
   Lumen UI — black + liquid ice-blue light (always dark)
   ===================================================================== */
:root {
  --bg: #03040a; --surface: #0a0d18; --surface-2: #121831; --border: #1d2544;
  --text: #eef2ff; --text-muted: #a3b0d6; --text-subtle: #5f6c93;
  --primary: #8b9bff; --primary-hover: #a9b5ff; --on-primary: #050714;
  --brand-grad: linear-gradient(135deg, #ffffff, #c9d4ff 40%, #7b8cff 80%, #4a55e0);
  --code-bg: #05070f;
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,.7);
  --shadow-lg: 0 30px 70px -20px rgba(0,0,0,.85);
  color-scheme: dark;
}
body { background: var(--bg); }

/* cloud logo */
.cloud-logo { width: 70%; height: 70%; fill: none; stroke: none; filter: drop-shadow(0 0 6px rgba(139,155,255,.75)); }
.h-mark { background: radial-gradient(120% 120% at 30% 20%, #151c3a, #04050c 70%) !important; box-shadow: inset 0 0 0 1px rgba(170,185,255,.28), 0 8px 26px -8px rgba(123,140,255,.65) !important; display: grid !important; place-items: center; }
.h-mark::after { background: linear-gradient(115deg, transparent 35%, rgba(200,215,255,.22) 50%, transparent 65%); background-size: 250% 100%; }
.brand-name { background: linear-gradient(100deg, #fff, #c9d4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { color: #6f7ca8; }
.ai-avatar .cloud-logo { width: 80%; height: 80%; }

/* sidebar with faint light pleats */
.sidebar { background: linear-gradient(180deg, #05070f, #03040a); position: relative; }
.sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; background: repeating-linear-gradient(90deg, transparent 0 46px, rgba(170,190,255,.07) 46px 47px); -webkit-mask: linear-gradient(180deg, #000, transparent 55%); mask: linear-gradient(180deg, #000, transparent 55%); }
.sidebar > * { position: relative; }
.side-search { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06); }
.project:hover, .project.active, .side-item:hover, .side-foot:hover { background: rgba(139,155,255,.08); }
.credit-pill { background: rgba(139,155,255,.12); color: #c9d4ff; }

/* home: liquid light blob + glowing pleats (inspired by the references) */
.app.is-empty .chat::before {
  inset: -15%; animation: liquidFlow 18s ease-in-out infinite alternate;
  background:
    radial-gradient(16% 22% at 14% 46%, rgba(235,242,255,.85), transparent 60%),
    radial-gradient(24% 30% at 20% 58%, rgba(140,155,255,.75), transparent 65%),
    radial-gradient(34% 40% at 8% 66%, rgba(80,90,230,.65), transparent 70%),
    radial-gradient(22% 26% at 30% 36%, rgba(100,120,255,.45), transparent 70%),
    radial-gradient(40% 40% at 50% 55%, rgba(40,60,200,.18), transparent 70%);
  filter: blur(22px) saturate(1.2);
}
[dir="rtl"] .app.is-empty .chat::before { transform-origin: right; }
.app.is-empty .chat::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background:
    repeating-radial-gradient(ellipse at 18% 55%, rgba(210,220,255,.16) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, transparent 0 70px, rgba(190,205,255,.06) 70px 71px);
  -webkit-mask: radial-gradient(60% 70% at 18% 55%, #000 20%, transparent 75%); mask: radial-gradient(60% 70% at 18% 55%, #000 20%, transparent 75%);
  animation: liquidFlow 22s ease-in-out infinite alternate-reverse;
}
@keyframes liquidFlow { 0% { transform: translate(0,0) scale(1) rotate(0); } 50% { transform: translate(3%,-2%) scale(1.06) rotate(3deg); } 100% { transform: translate(-2%,3%) scale(1.02) rotate(-2deg); } }
.greeting span { background: linear-gradient(100deg, #ffffff 25%, #c9d4ff 55%, #8b9bff 85%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 22px rgba(139,155,255,.35)); }
.greeting-sub { color: #93a0cc; }

/* composer: glass on light */
.composer-box { background: rgba(12,16,32,.72); backdrop-filter: blur(18px) saturate(1.3); border-color: rgba(170,185,255,.16); }
.app.is-empty .composer-box { box-shadow: 0 24px 70px -20px rgba(90,110,255,.55), inset 0 1px 0 rgba(255,255,255,.06); }
.composer-box:focus-within { border-color: rgba(170,185,255,.5); box-shadow: 0 0 0 4px rgba(139,155,255,.12), 0 24px 70px -20px rgba(90,110,255,.55); }
.pill-btn { background: rgba(255,255,255,.05); }
.pill-btn:hover { background: rgba(255,255,255,.1); }
.send-btn { background: linear-gradient(180deg, #f1f4ff, #aab6ff); color: #050714; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5), 0 8px 26px -8px rgba(139,155,255,.8); }
.send-btn:hover { background: linear-gradient(180deg, #ffffff, #c3ccff); }
.send-cost { border-inline-end-color: rgba(5,7,20,.2); }
.suggestion { background: rgba(10,14,28,.6); border-color: rgba(170,185,255,.14); }
.suggestion:hover { border-color: rgba(170,185,255,.5); }
.suggestion svg { color: #aab6ff; }
.msg-user .bubble { background: linear-gradient(180deg, #1b2350, #141a3c); color: #eef2ff; box-shadow: inset 0 0 0 1px rgba(170,185,255,.18); }
.menu { background: rgba(10,13,26,.96); backdrop-filter: blur(20px); border-color: rgba(170,185,255,.14); }

/* single model card */
.omni-card { cursor: default; }
.m-omni { background: radial-gradient(120% 120% at 30% 20%, #1a2250, #05060d 70%); box-shadow: inset 0 0 0 1px rgba(170,185,255,.3); }
.m-omni .cloud-logo { width: 78%; height: 78%; }
.omni-tag { font-size: .625rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(139,155,255,.16); color: #c9d4ff; }

/* Guard badge */
.guard-badge { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; margin-inline-end: 4px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #34d399; background: rgba(52,211,153,.1); box-shadow: inset 0 0 0 1px rgba(52,211,153,.25); cursor: help; animation: pop .3s var(--ease) both; }
.guard-badge svg { width: 15px; height: 15px; }
.guard-badge.fixed { color: #7dd3fc; background: rgba(125,211,252,.1); box-shadow: inset 0 0 0 1px rgba(125,211,252,.3); }

/* stage canvas: pleated light backdrop */
.canvas { background-color: #03040a; background-image: repeating-linear-gradient(90deg, transparent 0 60px, rgba(170,190,255,.045) 60px 61px), radial-gradient(60% 60% at 50% 0%, rgba(90,110,255,.12), transparent 70%); background-size: auto; }
.placeholder-art { background: radial-gradient(120% 120% at 30% 20%, #151c3a, #04050c 70%); }
.placeholder-art .cloud-logo { width: 60%; height: 60%; }
.menu { background: #0b0f1f !important; backdrop-filter: none !important; box-shadow: 0 0 0 1px rgba(170,185,255,.14), 0 30px 80px -20px rgba(0,0,0,.9) !important; }

/* =====================================================================
   v5 — line-art cloud logo · celestial MAX mode · Omni showcase · variations
   ===================================================================== */

/* ---- Logo: no box, just the glowing line-art cloud ---- */
.h-mark { background: none !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; }
.h-mark::after { display: none !important; }
.cloud-logo { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 5px rgba(150,165,255,.85)) drop-shadow(0 0 14px rgba(110,125,255,.45)); }
.brand-mark { width: 40px; height: 40px; }
.brand-mark .cloud-logo { animation: logoBreath 5s ease-in-out infinite; }
@keyframes logoBreath { 50% { filter: drop-shadow(0 0 8px rgba(170,185,255,1)) drop-shadow(0 0 22px rgba(110,125,255,.6)); } }
.ai-avatar { width: 24px; height: 24px; }
.m-omni { background: none !important; box-shadow: none !important; }
.login-mark { width: 84px; height: 84px; }
.placeholder-art { background: none !important; border: 0 !important; box-shadow: none !important; }

/* ---- MAX mode: celestial crystal (replaces the fire look) ---- */
.mode-max::before { background: conic-gradient(from var(--ang), #ffffff, #b9c6ff, #6f7dff, #bfe3ff, #ffffff) !important; }
.max-embers i { background: #ffffff !important; box-shadow: 0 0 6px #b9c6ff, 0 0 12px #6f7dff !important; width: 2px !important; height: 2px !important; animation-name: starRise !important; }
.max-embers i:nth-child(2), .max-embers i:nth-child(4) { background: #bfe3ff !important; }
@keyframes starRise { 0% { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-22px) scale(1.4); opacity: 0; } }
.menu-item.mode-max .mode-ico { background: radial-gradient(120% 120% at 30% 20%, #202a66, #070a1a 70%) !important; color: #dfe6ff !important; box-shadow: inset 0 0 0 1px rgba(185,198,255,.35), 0 0 16px -4px rgba(139,155,255,.8); }
.menu-item.mode-max .mode-ico svg { filter: drop-shadow(0 0 4px #b9c6ff); }
.menu-item.mode-max[aria-checked="true"] { background: linear-gradient(120deg, #0d1233, #1a2160 55%, #0d1233) !important; color: #fff; box-shadow: inset 0 0 0 1px rgba(185,198,255,.45), 0 10px 30px -12px rgba(111,125,255,.9) !important; }
.menu-item.mode-max[aria-checked="true"] small { color: #c9d4ff !important; }
.menu-item.mode-max[aria-checked="true"] .mode-label { background: linear-gradient(90deg, #ffffff, #b9c6ff, #ffffff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.4s linear infinite; }
.composer[data-mode="max"] .composer-box { background: linear-gradient(rgba(10,13,28,.92), rgba(10,13,28,.92)) padding-box, conic-gradient(from var(--ang), #ffffff, #b9c6ff 20%, #6f7dff 40%, transparent 55%, #bfe3ff 75%, #ffffff) border-box !important; box-shadow: 0 0 0 4px rgba(139,155,255,.08), 0 20px 60px -18px rgba(111,125,255,.75), 0 0 80px -30px rgba(191,227,255,.6) !important; }
.composer[data-mode="max"]::before { background: radial-gradient(50% 60% at 50% 100%, rgba(139,155,255,.22), transparent 70%) !important; }
.composer[data-mode="max"] .send-btn:not(.stop) { background: linear-gradient(120deg, #ffffff, #c9d4ff 35%, #8b9bff 65%, #ffffff) !important; background-size: 250% auto !important; color: #050714 !important; box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset, 0 8px 30px -6px rgba(139,155,255,.95) !important; }
.composer[data-mode="max"] .composer-hint { color: #c9d4ff !important; text-shadow: 0 0 12px rgba(139,155,255,.6); }
.status-pill.max { background: linear-gradient(120deg, #0d1233, #1a2160) !important; color: #dfe6ff !important; box-shadow: 0 0 0 1px rgba(185,198,255,.35), 0 10px 30px -8px rgba(111,125,255,.9) !important; }
.status-pill.max .dot { background: #ffffff !important; box-shadow: 0 0 10px #b9c6ff !important; }
.tag.t-max { background: linear-gradient(90deg, #1a2160, #3b46b8) !important; color: #fff !important; box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); }
.pricing .p-max svg { color: #b9c6ff !important; }

/* ---- Sidebar Omni link ---- */
.omni-link { position: relative; background: linear-gradient(90deg, rgba(111,125,255,.14), rgba(111,125,255,.02)); box-shadow: inset 0 0 0 1px rgba(185,198,255,.12); margin-block: 2px; }
.omni-link:hover { background: linear-gradient(90deg, rgba(111,125,255,.24), rgba(111,125,255,.06)) !important; }
.omni-link .cloud-logo { width: 20px !important; height: 20px !important; color: inherit; }
.omni-link span:first-of-type { flex: 1; font-weight: 600; background: linear-gradient(100deg, #fff, #c9d4ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.omni-new { font-size: .625rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(139,155,255,.18); color: #c9d4ff; }

/* ---- Omni showcase (clouds) ---- */
.omni-modal { margin: auto; width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 28px; padding: 0; color: var(--text); background: radial-gradient(90% 70% at 50% 0%, #121a45, #04050d 70%); box-shadow: 0 0 0 1px rgba(185,198,255,.16), 0 40px 120px -30px rgba(80,100,255,.6); overflow: hidden; }
.omni-modal[open] { display: block; animation: omniIn .5s var(--ease) both; }
.omni-modal::backdrop { background: rgba(2,3,10,.75); backdrop-filter: blur(8px); }
@keyframes omniIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }
.omni-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.omni-sky .c { position: absolute; border-radius: 999px; background: radial-gradient(closest-side, rgba(220,228,255,.55), rgba(160,175,255,.22) 60%, transparent); filter: blur(10px); animation: cloudDrift linear infinite; }
.omni-sky .c::before, .omni-sky .c::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.omni-sky .c::before { width: 55%; height: 140%; top: -60%; left: 18%; }
.omni-sky .c::after { width: 40%; height: 110%; top: -40%; left: 52%; }
.c1 { width: 260px; height: 70px; top: 8%; left: -10%; animation-duration: 38s; opacity: .7; }
.c2 { width: 180px; height: 50px; top: 22%; left: 60%; animation-duration: 46s; animation-delay: -12s; opacity: .5; }
.c3 { width: 320px; height: 90px; top: 44%; left: -20%; animation-duration: 52s; animation-delay: -20s; opacity: .35; }
.c4 { width: 220px; height: 60px; top: 62%; left: 70%; animation-duration: 42s; animation-delay: -6s; opacity: .45; }
.c5 { width: 150px; height: 44px; top: 80%; left: 20%; animation-duration: 34s; animation-delay: -18s; opacity: .55; }
.c6 { width: 280px; height: 80px; top: 90%; left: 55%; animation-duration: 60s; animation-delay: -30s; opacity: .3; }
.c7 { width: 200px; height: 56px; top: 34%; left: 30%; animation-duration: 48s; animation-delay: -26s; opacity: .25; }
@keyframes cloudDrift { from { transform: translateX(-30vw); } to { transform: translateX(80vw); } }
.omni-sky .st { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #b9c6ff; animation: twinkle 3s ease-in-out infinite; }
.omni-sky .st:nth-of-type(1) { top: 12%; left: 20%; } .omni-sky .st:nth-of-type(2) { top: 18%; left: 78%; animation-delay: .6s; }
.omni-sky .st:nth-of-type(3) { top: 38%; left: 90%; animation-delay: 1.2s; } .omni-sky .st:nth-of-type(4) { top: 55%; left: 8%; animation-delay: .3s; }
.omni-sky .st:nth-of-type(5) { top: 72%; left: 40%; animation-delay: 1.8s; } .omni-sky .st:nth-of-type(6) { top: 6%; left: 50%; animation-delay: 2.1s; }
.omni-sky .st:nth-of-type(7) { top: 86%; left: 85%; animation-delay: .9s; } .omni-sky .st:nth-of-type(8) { top: 30%; left: 5%; animation-delay: 1.5s; }
@keyframes twinkle { 50% { opacity: .15; transform: scale(.6); } }
.omni-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2; background: rgba(255,255,255,.06); }
.omni-body { position: relative; z-index: 1; max-height: calc(100dvh - 24px); overflow-y: auto; padding: clamp(28px, 5vw, 56px); display: flex; flex-direction: column; gap: 22px; }
.omni-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.omni-logo { width: 120px !important; height: 120px !important; animation: omniFloat 6s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(185,198,255,1)) drop-shadow(0 0 40px rgba(111,125,255,.7)) !important; }
@keyframes omniFloat { 50% { transform: translateY(-10px); } }
.omni-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .08em; color: #9fb0ff; padding: 4px 12px; border-radius: 999px; background: rgba(139,155,255,.12); box-shadow: inset 0 0 0 1px rgba(185,198,255,.2); }
.omni-hero h2 { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.05; background: linear-gradient(100deg, #ffffff 30%, #c9d4ff 60%, #8b9bff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(139,155,255,.35)); direction: ltr; }
.omni-hero h2 span { font-weight: 400; opacity: .8; }
.omni-hero p { max-width: 620px; color: #b3bfe6; font-size: 1rem; }
.omni-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.omni-stats div { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 16px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px rgba(185,198,255,.1); text-align: center; }
.omni-stats b { font-family: var(--display); font-size: 1.75rem; line-height: 1.1; background: linear-gradient(180deg, #fff, #9fb0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.omni-stats span { font-size: .75rem; color: #8f9cc8; }
.omni-h { font-size: 1rem; color: #dfe6ff; margin-top: 4px; }
.omni-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.omni-cap { padding: 16px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.01)); box-shadow: inset 0 0 0 1px rgba(185,198,255,.1); display: flex; flex-direction: column; gap: 6px; transition: transform .3s var(--ease), box-shadow .3s; }
.omni-cap:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(185,198,255,.3), 0 20px 40px -20px rgba(111,125,255,.7); }
.oc-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: rgba(139,155,255,.14); color: #c9d4ff; margin-bottom: 4px; }
.omni-cap b { font-size: .9375rem; }
.omni-cap p { font-size: .8125rem; color: #8f9cc8; line-height: 1.7; }
.omni-strengths { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.omni-strengths li { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: #c4cdef; }
.omni-strengths svg { width: 18px; height: 18px; color: #34d399; flex-shrink: 0; margin-top: 3px; }
.omni-cta { align-self: center; height: 50px; padding: 0 28px; border-radius: 999px; font-weight: 700; color: #050714; background: linear-gradient(180deg, #ffffff, #aab6ff); box-shadow: 0 0 0 1px rgba(255,255,255,.6) inset, 0 14px 40px -10px rgba(139,155,255,.9); transition: transform .2s var(--ease); }
.omni-cta:hover { transform: translateY(-2px); }
@media (max-width: 760px) { .omni-grid { grid-template-columns: 1fr; } .omni-stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- Variations grid ---- */
.variants-modal { width: min(1100px, calc(100vw - 24px)); }
.free-tag { font-size: .6875rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(52,211,153,.14); color: #34d399; margin-inline-start: 6px; }
.variants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.variant { display: flex; flex-direction: column; gap: 8px; text-align: start; border-radius: 16px; padding: 6px; transition: background .2s, transform .2s var(--ease); }
.variant:hover { background: rgba(139,155,255,.1); transform: translateY(-3px); }
.variant-frame { position: relative; display: block; width: 100%; aspect-ratio: 16/11; overflow: hidden; border-radius: 12px; background: #0a0d18; box-shadow: 0 0 0 1px var(--border); }
.variant.current .variant-frame { box-shadow: 0 0 0 2px #8b9bff, 0 10px 30px -10px rgba(139,155,255,.8); }
.variant-frame iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 880px; border: 0; transform: scale(.19); transform-origin: top left; pointer-events: none; }
.variant-name { font-size: .8125rem; font-weight: 600; padding-inline: 4px; }

/* =====================================================================
   v6 — Working screen · smart questions · swatches · fonts button
   ===================================================================== */
/* ---- Working overlay ---- */
.working { position: absolute; inset: 20px; z-index: 5; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; overflow: hidden;
  background: radial-gradient(70% 60% at 50% 45%, #10164a 0%, #05071a 55%, #02030a 100%); box-shadow: inset 0 0 0 1px rgba(185,198,255,.12), 0 30px 80px -30px rgba(0,0,0,.9); animation: fadeIn .4s both; }
.working::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; background: repeating-linear-gradient(90deg, transparent 0 64px, rgba(185,198,255,.05) 64px 65px); }
.work-sky { position: absolute; inset: 0; pointer-events: none; }
.puff { position: absolute; border-radius: 999px; background: radial-gradient(closest-side, rgba(200,210,255,.28), transparent); filter: blur(8px); animation: puffDrift linear infinite; }
.puff::before, .puff::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.puff::before { width: 55%; height: 150%; top: -65%; left: 20%; } .puff::after { width: 40%; height: 120%; top: -45%; left: 52%; }
.p1 { width: 180px; height: 46px; top: 18%; animation-duration: 26s; }
.p2 { width: 120px; height: 34px; top: 70%; animation-duration: 34s; animation-delay: -10s; opacity: .7; }
.p3 { width: 240px; height: 60px; top: 82%; animation-duration: 42s; animation-delay: -20s; opacity: .5; }
.p4 { width: 140px; height: 38px; top: 30%; animation-duration: 30s; animation-delay: -16s; opacity: .6; }
@keyframes puffDrift { from { transform: translateX(-40vw); } to { transform: translateX(60vw); } }
.mech-cloud { position: relative; width: min(300px, 70%); height: auto; overflow: visible; animation: cloudBob 5s ease-in-out infinite; filter: drop-shadow(0 20px 40px rgba(80,100,255,.45)); }
@keyframes cloudBob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
.mech-cloud .gear { transform-box: fill-box; transform-origin: center; }
.mech-cloud .g1 path, .mech-cloud .g1 circle { animation: gearSpin 4s linear infinite; transform-box: fill-box; transform-origin: center; }
.mech-cloud .g2 path, .mech-cloud .g2 circle { animation: gearSpin 2.6s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
@keyframes gearSpin { to { transform: rotate(360deg); } }
.mech-cloud .bolts circle { animation: boltBlink 1.6s ease-in-out infinite; }
.mech-cloud .bolts circle:nth-child(2) { animation-delay: .5s; } .mech-cloud .bolts circle:nth-child(3) { animation-delay: 1s; }
@keyframes boltBlink { 50% { opacity: .2; } }
.mech-cloud .spark { transform-box: fill-box; transform-origin: center; animation: sparkPop 2.2s ease-in-out infinite; }
@keyframes sparkPop { 0%,100% { transform: scale(.6) rotate(0); opacity: .6; } 50% { transform: scale(1.25) rotate(45deg); opacity: 1; } }
.work-title { position: relative; font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: .01em; direction: ltr;
  background: linear-gradient(100deg, #ffffff 20%, #c9d4ff 40%, #ffffff 55%, #8b9bff 80%); background-size: 250% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 3s linear infinite; }
.work-title span { font-weight: 400; }
.work-phase { position: relative; color: #b3bfe6; font-size: .9375rem; min-height: 1.5em; }
.work-bar { position: relative; width: min(320px, 70%); height: 4px; border-radius: 4px; background: rgba(185,198,255,.12); overflow: hidden; }
.work-bar i { display: block; height: 100%; width: 3%; border-radius: inherit; background: linear-gradient(90deg, #6f7dff, #ffffff); box-shadow: 0 0 12px #8b9bff; transition: width .8s var(--ease); }
[dir="rtl"] .work-bar i { margin-inline-start: 0; }
.work-eta { position: relative; font-size: .8125rem; color: #7f8cb8; font-variant-numeric: tabular-nums; }
.working.max .work-bar i { background: linear-gradient(90deg, #6f7dff, #bfe3ff, #ffffff); }
.app:not(.no-design) .working ~ .placeholder { display: none; }

/* ---- Smart questions card ---- */
.clarify { border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: linear-gradient(180deg, rgba(18,24,60,.85), rgba(10,13,30,.85)); box-shadow: inset 0 0 0 1px rgba(185,198,255,.16), 0 20px 50px -24px rgba(90,110,255,.6); animation: rise .4s var(--ease) both; }
.clarify-head { display: flex; align-items: center; gap: 10px; }
.clarify-head .ai-avatar { width: 30px; height: 30px; }
.clarify-head b { display: block; font-size: 1rem; }
.clarify-head small { display: block; color: #8f9cc8; font-size: .75rem; }
.cq-title { font-size: .8125rem; font-weight: 700; color: #dfe6ff; margin-bottom: 6px; }
.cq-title small { color: #7f8cb8; font-weight: 400; }
.cq-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.cq-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: .8125rem; color: #c4cdef; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(185,198,255,.14); transition: all .15s; }
.cq-opt:hover { box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); color: #fff; }
.cq-opt.on { background: linear-gradient(180deg, #eef1ff, #b3beff); color: #050714; box-shadow: 0 6px 18px -8px rgba(139,155,255,.9); }
.cq-other { font-style: italic; }
.cq-input { width: 100%; margin-top: 8px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(185,198,255,.18); background: rgba(3,4,10,.6); color: var(--text); outline: none; }
.cq-input:focus { border-color: #8b9bff; }
.clarify-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.clarify-go { height: 40px; padding: 0 20px; border-radius: 999px; font-weight: 700; color: #050714; background: linear-gradient(180deg, #ffffff, #aab6ff); box-shadow: 0 10px 26px -10px rgba(139,155,255,.9); }
.clarify-skip { height: 40px; padding: 0 16px; border-radius: 999px; color: #c4cdef; background: rgba(255,255,255,.05); }
.clarify-never { margin-inline-start: auto; font-size: .75rem; color: #6f7ca8; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Two-color swatches ---- */
.sw2 { position: relative; display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--a) 0 50%, var(--b) 50% 100%); box-shadow: 0 0 0 1.5px rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.5); transform: rotate(-45deg); }
.sw-opt .sw2 { width: 16px; height: 16px; }
.swatch-now { position: relative; width: 20px; height: 20px; border-radius: 50%; background: conic-gradient(var(--a, #03040a) 0 50%, var(--b, #8b9bff) 50% 100%); transform: rotate(-45deg); box-shadow: 0 0 0 1.5px rgba(255,255,255,.3); }
.swatch-now i { display: none; }
.theme-pick select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.theme-pick { position: relative; cursor: pointer; border: 0; }
.theme-pick:hover { background: rgba(255,255,255,.08); }
.swatch-name { font-size: .8125rem; color: var(--text); }
.swatch-pop { position: fixed; z-index: 90; width: 250px; padding: 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 16px; background: #0b0f1f; box-shadow: 0 0 0 1px rgba(170,185,255,.14), 0 30px 70px -20px rgba(0,0,0,.9); animation: pop .18s var(--ease) both; }
.sw-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; font-size: .6875rem; color: #c4cdef; transition: background .15s; }
.sw-item:hover { background: rgba(139,155,255,.1); }
.sw-item.on { background: rgba(139,155,255,.16); box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); }
.sw-item .sw2 { width: 28px; height: 28px; }
.fonts-btn { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 1rem; font-style: italic; color: var(--text-muted); }
.fonts-btn:hover { color: #fff; }

/* =====================================================================
   v7 — settings · diagnostics · Ultra · loader captions · LTR · app themes
   ===================================================================== */
/* ---- interface themes: recolor the light (glows, logo, accents) ---- */
html[data-app-theme="violet"] { --primary: #b18cff; --primary-hover: #c6a8ff; }
html[data-app-theme="ember"] { --primary: #ff9f5a; --primary-hover: #ffb57d; }
html[data-app-theme="emerald"] { --primary: #4ade80; --primary-hover: #6ee79a; }
html[data-app-theme="rose"] { --primary: #ff7eb6; --primary-hover: #ff9cc8; }
html[data-app-theme="graphite"] { --primary: #d4d4d8; --primary-hover: #e4e4e7; }
html[data-app-theme="violet"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(35deg); }
html[data-app-theme="ember"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(160deg) saturate(1.2); }
html[data-app-theme="emerald"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(-110deg); }
html[data-app-theme="rose"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(95deg); }
html[data-app-theme="graphite"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: grayscale(1) brightness(1.1); }
html[data-app-theme] .canvas iframe, html[data-app-theme] .working .work-title { filter: none; }

/* ---- reduced motion setting ---- */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

/* ---- LTR (English default) ---- */
[dir="ltr"] .send-btn .i-send { transform: none; }
@media (max-width: 960px) { [dir="ltr"] .sidebar { transform: translateX(-100%); } [dir="ltr"] .app.side-open .sidebar { transform: none; } }
.bubble, .notes { unicode-bidi: plaintext; }
.bubble { text-align: start; }

/* ---- Ultra model ---- */
.m-ultra { background: radial-gradient(120% 120% at 30% 20%, #3b2a7a, #0a0718 70%) !important; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(210,190,255,.45), 0 0 16px -4px rgba(177,140,255,.9) !important; }
.m-ultra .cloud-logo { width: 72% !important; height: 72% !important; filter: drop-shadow(0 0 6px #d6c4ff) !important; }
.ultra-tag { background: linear-gradient(90deg, #6f7dff, #b18cff) !important; color: #fff !important; }
.ultra-card[aria-checked="true"] { background: linear-gradient(120deg, #1a1440, #2a1f63) !important; box-shadow: inset 0 0 0 1px rgba(210,190,255,.45), 0 10px 30px -12px rgba(177,140,255,.9) !important; }
.composer.is-ultra .picker-model { background: linear-gradient(90deg, #fff, #d6c4ff, #8b9bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.composer.is-ultra .composer-box { box-shadow: 0 0 0 1px rgba(177,140,255,.35), 0 20px 60px -20px rgba(140,100,255,.6) !important; }

/* ---- loader captions ---- */
.work-shape { position: relative; font-size: .8125rem; font-weight: 600; color: #dfe6ff; padding: 4px 14px; border-radius: 999px; background: rgba(139,155,255,.12); box-shadow: inset 0 0 0 1px rgba(185,198,255,.2); }
.work-tip { position: relative; max-width: 420px; font-size: .8125rem; color: #8f9cc8; min-height: 2.6em; padding-inline: 16px; }
.work-shape.in, .work-tip.in { animation: capIn .5s var(--ease) both; }
@keyframes capIn { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }
.mech-cloud #mcShape { transition: none; }

/* ---- diagnostics ---- */
.diag-badge { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; margin-inline-end: 4px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #ff8a8a; background: rgba(255,90,90,.1); box-shadow: inset 0 0 0 1px rgba(255,90,90,.3); animation: pop .3s var(--ease) both; }
.diag-badge svg { width: 15px; height: 15px; }
.diag-badge:hover { background: rgba(255,90,90,.18); }
.diag-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.diag-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--border); }
.diag-type { flex-shrink: 0; font-size: .6875rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255,90,90,.14); color: #ff9a9a; }
.diag-a11y .diag-type { background: rgba(139,155,255,.14); color: #c9d4ff; }
.diag-list code { font-family: var(--mono); font-size: .75rem; color: var(--text-muted); word-break: break-word; }
.diag-fix { margin-top: 6px; }

/* ---- settings ---- */
.settings-body { gap: 16px; }
.set-row { display: grid; grid-template-columns: 170px 1fr; gap: 12px; align-items: center; }
.set-label { font-size: .875rem; font-weight: 600; color: var(--text-muted); }
.set-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.set-opts button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); transition: all .15s; }
.set-opts button:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); }
.set-opts button.on { color: #050714; background: linear-gradient(180deg, #eef1ff, #b3beff); box-shadow: 0 6px 18px -8px rgba(139,155,255,.9); }
.set-themes i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
@media (max-width: 640px) { .set-row { grid-template-columns: 1fr; } }

/* =====================================================================
   v8 — Omni X · Settings v2
   ===================================================================== */
.m-x { background: conic-gradient(from 200deg, #0b1233, #3b1a6b, #0b1233, #13306b, #0b1233) !important; border-radius: 9px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 0 18px -3px rgba(139,155,255,1) !important; position: relative; }
.m-x::after { content: ""; position: absolute; inset: -2px; border-radius: 11px; background: conic-gradient(from var(--ang), #fff, #8b9bff, #d6c4ff, transparent 60%, #fff); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; padding: 1.5px; animation: spin 3s linear infinite; }
.m-x .cloud-logo { width: 74% !important; height: 74% !important; filter: drop-shadow(0 0 7px #fff) !important; }
.x-tag { background: linear-gradient(90deg, #fff, #c9d4ff) !important; color: #050714 !important; }
.x-card[aria-checked="true"] { background: linear-gradient(120deg, #0d1440, #28185a 50%, #0d1440) !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4), 0 12px 34px -12px rgba(139,155,255,1) !important; }
.composer.is-x .picker-model { background: linear-gradient(90deg, #fff, #c9d4ff, #d6c4ff, #fff); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.4s linear infinite; }
.composer.is-x .composer-box { background: linear-gradient(rgba(10,13,28,.94), rgba(10,13,28,.94)) padding-box, conic-gradient(from var(--ang), #ffffff, #d6c4ff, #8b9bff, transparent 60%, #ffffff) border-box !important; border-color: transparent !important; animation: spin 4s linear infinite; }

/* Settings v2 */
.settings-modal { width: min(820px, calc(100vw - 24px)); }
.settings-shell { display: grid; grid-template-columns: 190px 1fr; min-height: 420px; }
.set-tabs { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-inline-end: 1px solid var(--border); }
.set-tabs button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; font-size: .875rem; font-weight: 600; color: var(--text-muted); text-align: start; transition: background .15s, color .15s; }
.set-tabs button svg { width: 16px; height: 16px; }
.set-tabs button .cloud-logo { width: 18px; height: 18px; }
.set-tabs button:hover { background: rgba(255,255,255,.04); color: var(--text); }
.set-tabs button.on { background: rgba(139,155,255,.12); color: var(--text); box-shadow: inset 0 0 0 1px rgba(185,198,255,.2); }
.settings-body section { display: flex; flex-direction: column; gap: 16px; animation: fadeIn .25s both; }
.accent-pick { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); font-family: var(--mono); font-size: .75rem; cursor: pointer; }
.accent-pick input { width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; padding: 0; cursor: pointer; }
.accent-pick input::-webkit-color-swatch-wrapper { padding: 0; } .accent-pick input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.mini-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; font-size: .8125rem; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; transition: all .15s; }
.mini-btn:hover { color: var(--text); box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); }
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn.danger { color: #ff8a8a; } .mini-btn.danger:hover { box-shadow: inset 0 0 0 1px rgba(255,90,90,.5); }
.set-preview { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: radial-gradient(80% 120% at 0% 50%, rgba(80,100,255,.18), transparent 70%), rgba(255,255,255,.02); box-shadow: inset 0 0 0 1px var(--border); }
.sp-bubble { padding: 10px 14px; border-radius: 16px; background: linear-gradient(180deg, #1b2350, #141a3c); box-shadow: inset 0 0 0 1px rgba(170,185,255,.18); }
.sp-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; background: var(--primary); color: #050714; font-weight: 800; }
.sp-logo { width: 44px !important; height: 44px !important; margin-inline-start: auto; }
.model-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.model-compare div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--border); }
.model-compare b { font-size: .8125rem; } .model-compare span { font-family: var(--display); font-size: 1.3rem; font-weight: 700; color: #c9d4ff; } .model-compare small { font-size: .6875rem; color: var(--text-subtle); }
.model-compare .mc-x { background: linear-gradient(160deg, rgba(139,155,255,.14), rgba(214,196,255,.06)); box-shadow: inset 0 0 0 1px rgba(185,198,255,.35); }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.shortcuts { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.shortcuts li { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.03); font-size: .8125rem; }
.shortcuts li span { margin-inline-start: auto; color: var(--text-muted); }
@media (max-width: 700px) { .settings-shell { grid-template-columns: 1fr; } .set-tabs { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--border); } .model-compare { grid-template-columns: 1fr; } }

/* =====================================================================
   v9 — tasks · expert chat (markdown/code/math) · Micro Cloud images · full site
   ===================================================================== */
.task-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 2px 4px; }
.task-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 10px; border-radius: 12px; text-align: start; transition: background .15s, box-shadow .15s; }
.task-opt svg { width: 16px; height: 16px; color: #aab6ff; margin-bottom: 2px; }
.task-opt b { font-size: .8125rem; } .task-opt small { font-size: .6875rem; color: var(--text-subtle); }
.task-opt:hover { background: var(--surface-2); }
.task-opt.on { background: rgba(139,155,255,.12); box-shadow: inset 0 0 0 1px rgba(185,198,255,.4); }
.picker-task { color: #c9d4ff; }
.menu { max-height: min(640px, calc(100dvh - 140px)); overflow-y: auto; }
.fullsite-btn[aria-pressed="true"] { color: #050714; background: linear-gradient(180deg, #eef1ff, #b3beff); box-shadow: 0 6px 18px -8px rgba(139,155,255,.9); }
.composer[data-task="image"] .composer-box { box-shadow: 0 0 0 1px rgba(255,180,120,.25), 0 20px 60px -20px rgba(255,140,90,.35); }
.composer[data-task="chat"] #plusBtn { display: none; }
.img-opts { display: flex; flex-direction: column; gap: 6px; }
.img-row { display: flex; flex-wrap: wrap; gap: 6px; }
.img-row button { padding: 5px 12px; border-radius: 999px; font-size: .75rem; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); }
.img-row button.on { color: #050714; background: linear-gradient(180deg, #fff1e6, #ffc49c); box-shadow: none; }
.mc-link span:first-of-type { flex: 1; font-weight: 600; }
.mc-beta { font-size: .5625rem; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 999px; background: linear-gradient(90deg, #ff9f5a, #ff6bb5); color: #fff; text-transform: uppercase; }

/* images */
.img-card { display: flex; flex-direction: column; gap: 10px; }
.img-frame-gen { position: relative; width: min(100%, 460px); border-radius: 18px; overflow: hidden; background: #0a0d18; box-shadow: inset 0 0 0 1px var(--border), 0 20px 50px -24px rgba(0,0,0,.8); }
.img-frame-gen img { width: 100%; height: 100%; object-fit: cover; animation: imgIn .8s var(--ease) both; }
@keyframes imgIn { from { opacity: 0; filter: blur(18px); transform: scale(1.04); } }
.img-dream { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #c9d4ff; font-size: .8125rem;
  background: linear-gradient(110deg, #0a0d18 30%, #16204a 50%, #0a0d18 70%); background-size: 250% 100%; animation: dream 1.6s linear infinite; }
/* generating: a blank, softly lit canvas with a sweeping shine and one message on top */
.img-dream { justify-content: flex-start; padding-top: 16px; background: #0b0e1c; animation: none; overflow: hidden; }
.img-dream .dream-glow { position: absolute; inset: -30%; background:
  radial-gradient(40% 35% at 30% 35%, rgba(120,140,255,.35), transparent 70%),
  radial-gradient(35% 30% at 70% 65%, rgba(255,150,210,.22), transparent 70%),
  radial-gradient(30% 30% at 60% 25%, rgba(110,230,255,.18), transparent 70%);
  filter: blur(30px); animation: dreamDrift 7s ease-in-out infinite alternate; }
.img-dream .dream-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.14) 48%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.14) 52%, transparent 65%);
  background-size: 250% 100%; animation: dreamShine 2.2s cubic-bezier(.4,0,.2,1) infinite; }
.img-dream .dream-msg { position: relative; z-index: 1; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .78rem; color: #eef1ff;
  background: rgba(10,12,28,.45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); backdrop-filter: blur(10px); animation: dreamPulse 1.8s ease-in-out infinite; }
@keyframes dreamShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes dreamDrift { to { transform: translate(6%, -4%) rotate(8deg) scale(1.08); } }
@keyframes dreamPulse { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .img-dream .dream-glow, .img-dream .dream-shine, .img-dream .dream-msg { animation: none; } }
@keyframes dream { to { background-position: -250% 0; } }
.img-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.img-meta { font-size: .6875rem; color: var(--text-subtle); font-family: var(--mono); }

/* markdown answers */
.md-body { font-size: .9375rem; line-height: 1.75; overflow-wrap: anywhere; }
.md-body > * + * { margin-top: .7em; }
.md-body h1, .md-body h2, .md-body h3 { font-family: var(--display); line-height: 1.3; margin-top: 1.1em; }
.md-body h1 { font-size: 1.35rem; } .md-body h2 { font-size: 1.2rem; } .md-body h3 { font-size: 1.05rem; }
.md-body ul, .md-body ol { padding-inline-start: 1.4em; list-style: revert; }
.md-body li + li { margin-top: .25em; }
.md-body a { color: #aab6ff; text-decoration: underline; text-underline-offset: 3px; }
.md-body blockquote { padding: 6px 14px; border-inline-start: 3px solid #8b9bff; background: rgba(139,155,255,.06); border-radius: 6px; color: var(--text-muted); }
.md-body :not(pre) > code { font-family: var(--mono); font-size: .85em; padding: 1px 6px; border-radius: 6px; background: rgba(139,155,255,.12); color: #dfe6ff; }
.md-body pre { position: relative; direction: ltr; text-align: left; border-radius: 14px; overflow: hidden; background: #0b0e1a; box-shadow: inset 0 0 0 1px var(--border); }
.md-body pre code { display: block; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: .8125rem; line-height: 1.65; background: transparent !important; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; font-size: .6875rem; color: #8f9cc8; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--border); font-family: var(--mono); text-transform: lowercase; }
.copy-code { padding: 2px 10px; border-radius: 6px; font-size: .6875rem; color: #c9d4ff; background: rgba(139,155,255,.12); }
.copy-code:hover { background: rgba(139,155,255,.25); }
.md-body table { width: 100%; border-collapse: collapse; font-size: .875rem; display: block; overflow-x: auto; }
.md-body th, .md-body td { padding: 7px 10px; border: 1px solid var(--border); text-align: start; }
.md-body th { background: rgba(255,255,255,.03); }
.md-body .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.md-body .katex { font-size: 1.05em; }
.md-body hr { border: 0; height: 1px; background: var(--border); }
.msg-chat .notes { max-width: 100%; }

/* engine status chip */
.engine-chip { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: .6875rem; font-weight: 600; color: var(--text-muted); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--border); font-family: var(--mono); }
.engine-chip i { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 8px #f59e0b; animation: pulse 1.2s infinite; }
.engine-chip[data-status="ready"] i { background: #34d399; box-shadow: 0 0 8px #34d399; animation: none; }
.engine-chip[data-status="offline"] i, .engine-chip[data-status="error"] i { background: #f87171; box-shadow: 0 0 8px #f87171; animation: none; }

/* Explore: rotating label + tabs + Micro Cloud gallery */
.explore-text { display: inline-block; transition: opacity .3s ease, transform .3s ease; white-space: nowrap; }
.explore-text.out { opacity: 0; transform: translateY(-6px); }
.xp-tabs { align-self: center; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.xp-tab { border: 0; background: transparent; color: #aab4e6; font: inherit; font-weight: 600; font-size: .85rem; padding: 8px 18px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.xp-tab[aria-selected="true"] { background: linear-gradient(135deg, #ffffff, #cfd6ff); color: #0b0e1c; }
.xp-pane { display: flex; flex-direction: column; gap: 22px; }
.xp-pane[hidden] { display: none; }
.omni-models { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.om-card { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
.om-card .cloud-logo { grid-row: span 2; width: 28px; height: 28px; }
.om-card b { font-size: .9rem; } .om-card small { grid-column: 2; color: #9aa5d6; font-size: .72rem; }
.om-card span { grid-row: 1 / span 2; grid-column: 3; font-family: var(--mono); font-size: .75rem; color: #c9d4ff; }
.om-card.ultra .cloud-logo { filter: hue-rotate(40deg); } .om-card.x .cloud-logo { filter: hue-rotate(160deg); }
.mc-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mc-shot { margin: 0; position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 1; background: #0b0e1c; }
.mc-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.mc-shot:hover img { transform: scale(1.05); }
.mc-shot figcaption { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; font-size: .68rem; color: #eef1ff; background: linear-gradient(transparent, rgba(0,0,0,.7)); opacity: 0; transition: opacity .3s; }
.mc-shot:hover figcaption { opacity: 1; }
.mc-empty { grid-column: 1 / -1; text-align: center; color: #9aa5d6; font-size: .85rem; padding: 18px; border-radius: 16px; background: rgba(255,255,255,.04); }
@media (max-width: 640px) { .omni-models { grid-template-columns: 1fr; } .mc-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- new themes ---- */
html[data-app-theme="ocean"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(-35deg) saturate(1.25); }
html[data-app-theme="aurora"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(-75deg) saturate(1.3); }
html[data-app-theme="sunset"] :is(.app.is-empty .chat::before, .app.is-empty .chat::after, .working, .cloud-logo, .sidebar::before, .send-btn, .credit-pill, .greeting span, .omni-link, .menu-item[aria-checked="true"], .msg-user .bubble, .omni-modal) { filter: hue-rotate(125deg) saturate(1.35); }

/* ---- attachments ---- */
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 4px 8px; }
.attach-row[hidden] { display: none; }
.att { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.14); animation: attIn .3s var(--ease) both; }
.att img { width: 100%; height: 100%; object-fit: cover; }
.att button { position: absolute; top: 4px; inset-inline-end: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 14px; line-height: 20px; cursor: pointer; padding: 0; }
@keyframes attIn { from { opacity: 0; transform: scale(.85); } }
.composer.drop .composer-box { box-shadow: 0 0 0 2px var(--primary, #8b9bff), 0 20px 60px -20px rgba(120,140,255,.5); }
.bubble-imgs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 6px; }
.bubble-imgs img { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }

/* ---- wallet ---- */
.wallet-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 10px; }
.wallet-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b9bff, #c7b8ff, #ffd7a8); transition: width .8s var(--ease); }
.wallet-perks { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: .78rem; color: var(--text-subtle, #9aa5d6); }
.wallet-perks span { display: inline-flex; align-items: center; gap: 6px; }
.wallet-perks svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.wallet-perks b { color: var(--text, #fff); }
.pricing-2 { margin-top: -4px; }

/* ---- shortcuts ---- */
.shortcuts-modal { width: min(520px, calc(100vw - 24px)); }
.shortcuts { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.shortcuts li { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.04); font-size: .82rem; }
.shortcuts li span { margin-inline-start: auto; color: var(--text-subtle, #9aa5d6); }
.shortcuts kbd { font-family: var(--mono, monospace); font-size: .72rem; padding: 2px 7px; border-radius: 7px; background: rgba(255,255,255,.08); box-shadow: inset 0 -1px 0 rgba(255,255,255,.12); }

/* ---- compact density ---- */
html[data-density="compact"] .msg { margin-block: 6px; }
html[data-density="compact"] .msg-user .bubble { padding: 8px 12px; }
html[data-density="compact"] .composer-box { padding-block: 8px; }
html[data-density="compact"] .side-item { padding-block: 6px; }
.wallet-stats { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
@media (max-width: 520px) { .wallet-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }

/* ---- image mode: a clear on/off switch ---- */
.img-mode-btn[aria-pressed="true"] { background: linear-gradient(135deg, #ffd1a8, #ff9f7a); color: #1a0f08; box-shadow: 0 0 0 1px rgba(255,190,140,.6), 0 6px 20px -6px rgba(255,140,90,.6); }
.img-mode-btn[aria-pressed="true"] svg { stroke: currentColor; }
.img-mode-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; padding: 8px 8px 8px 12px; border-radius: 14px; font-size: .8rem; font-weight: 600;
  color: #ffe2cc; background: linear-gradient(90deg, rgba(255,150,100,.16), rgba(255,150,100,.05)); box-shadow: inset 0 0 0 1px rgba(255,170,120,.28); animation: attIn .25s var(--ease) both; }
.img-mode-bar[hidden] { display: none; }
.img-mode-bar > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.img-mode-bar > span { flex: 1; min-width: 0; }
.img-mode-bar button { flex: none; border: 0; cursor: pointer; font: inherit; font-size: .75rem; padding: 6px 12px; border-radius: 999px; color: #1a0f08; background: #ffe2cc; }
.img-mode-bar button:hover { background: #fff; }
.composer.hint-image .composer-box { box-shadow: 0 0 0 1px rgba(255,180,120,.18); }
