:root {
  --ink: #f3f4f8;
  --muted: #969caf;
  --muted-2: #6f7588;
  --surface: rgba(22, 27, 45, 0.84);
  --surface-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.1);
  --purple: #a995ff;
  --purple-2: #7765f6;
  --mint: #70e2c4;
  --orange: #ffb371;
  --bg: #090d18;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); overflow-x: hidden; }
button, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; pointer-events: none; border-radius: 50%; filter: blur(2px); opacity: .4; z-index: 0; }
.ambient-one { width: 500px; height: 500px; background: #29205e; top: -240px; right: 15%; filter: blur(90px); }
.ambient-two { width: 430px; height: 430px; background: #0c4e56; bottom: -240px; left: 28%; filter: blur(100px); opacity: .24; }

.landing-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; position: relative; z-index: 1; }
.landing-grid { width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 20px; }
.landing-panel { border: 1px solid var(--line); border-radius: 28px; background: rgba(11, 16, 32, .82); backdrop-filter: blur(24px); box-shadow: 0 24px 90px rgba(0, 0, 0, .26); }
.landing-hero { padding: 34px; display: flex; flex-direction: column; gap: 22px; }
.landing-hero h1 { font: 600 clamp(36px, 4.8vw, 60px)/1.02 "Space Grotesk", sans-serif; letter-spacing: -.07em; margin: 0; }
.landing-copy { margin: 0; max-width: 560px; color: var(--muted); line-height: 1.8; font-size: 13px; }
.landing-note { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .035); }
.landing-note p { margin: 0; color: var(--muted-2); line-height: 1.6; font-size: 11px; }
.landing-selector { padding: 22px; display: grid; gap: 16px; align-content: stretch; }
.entry-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 220px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(155deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03)); box-shadow: inset 0 1px rgba(255, 255, 255, .05); transition: transform .2s, border-color .2s, background .2s; }
.entry-card:hover { transform: translateY(-2px); border-color: rgba(169, 149, 255, .45); background: linear-gradient(155deg, rgba(169, 149, 255, .16), rgba(255, 255, 255, .05)); }
.entry-card h2 { font: 600 clamp(24px, 2.8vw, 34px)/1.04 "Space Grotesk", sans-serif; letter-spacing: -.06em; margin: 12px 0 12px; }
.entry-card p { margin: 0; max-width: 360px; color: var(--muted); line-height: 1.65; font-size: 12px; }
.entry-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; color: var(--muted-2); font-size: 9px; letter-spacing: .14em; }
.entry-card-footer b { color: var(--ink); font-size: 18px; font-weight: 500; }
.entry-card-chat { background: radial-gradient(circle at top left, rgba(169, 149, 255, .18), transparent 35%), linear-gradient(155deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03)); }
.entry-card-image { background: radial-gradient(circle at top right, rgba(112, 226, 196, .16), transparent 35%), linear-gradient(155deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .03)); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(260px, 310px) 1fr; position: relative; z-index: 1; }
.sidebar { border-right: 1px solid var(--line); background: rgba(8, 12, 24, .72); padding: 34px 27px 24px; display: flex; flex-direction: column; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 31px; height: 31px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 5px; border: 1px solid rgba(169, 149, 255, .5); border-radius: 10px; background: linear-gradient(145deg, rgba(169,149,255,.24), rgba(112,226,196,.1)); box-shadow: 0 0 20px rgba(169,149,255,.18); }
.brand-mark span { background: var(--purple); border-radius: 2px; height: 45%; }
.brand-mark span:nth-child(2) { height: 75%; background: var(--mint); }
.brand-mark span:nth-child(3) { height: 100%; background: var(--orange); }
.brand-name { font: 700 18px/1 "Space Grotesk", sans-serif; letter-spacing: -.04em; }
.brand-subtitle { margin-top: 4px; color: var(--muted-2); font-size: 8px; font-weight: 700; letter-spacing: .24em; }
.sidebar-intro { margin-top: 94px; }
.eyebrow { color: var(--purple); font-size: 9px; letter-spacing: .2em; font-weight: 700; margin: 0 0 15px; }
.sidebar h1, .panel-heading h2, .welcome-state h2 { font: 600 clamp(30px, 3vw, 39px)/1.05 "Space Grotesk", sans-serif; letter-spacing: -.06em; margin: 0; }
em { color: var(--purple); font-style: normal; }
.intro-copy { color: var(--muted); line-height: 1.7; font-size: 12px; margin: 20px 0 0; max-width: 210px; }
.model-cards { display: grid; gap: 8px; margin-top: 57px; }
.model-card { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.model-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; font-size: 15px; }
.chat-icon { color: #b8aaff; background: rgba(169,149,255,.15); }
.image-icon { color: #84e8cf; background: rgba(112,226,196,.13); }
.model-card strong, .model-card span { display: block; }
.model-card strong { font-size: 11px; letter-spacing: .02em; }
.model-card div:nth-child(2) span { color: var(--muted-2); font-size: 9px; margin-top: 4px; }
.status-dot { width: 5px; height: 5px; background: var(--mint); border-radius: 50%; margin-left: auto; box-shadow: 0 0 12px var(--mint); }
.model-card-link { color: inherit; text-decoration: none; transition: transform .2s, border-color .2s, background .2s; }
.model-card-link:hover { transform: translateY(-1px); border-color: rgba(169, 149, 255, .5); background: rgba(255, 255, 255, .06); }
.card-arrow { margin-left: auto; color: var(--purple); font-size: 15px; }
.sidebar-note { display: flex; gap: 9px; align-items: flex-start; margin-top: auto; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.note-symbol { color: var(--mint); font-size: 17px; line-height: 1; }
.sidebar-note p { color: var(--muted-2); font-size: 10px; line-height: 1.5; margin: 0; }
.sidebar-footer { display: flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 8px; letter-spacing: .14em; margin-top: 17px; }
.footer-line { width: 20px; height: 1px; background: var(--muted-2); opacity: .7; }

.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; background: linear-gradient(115deg, rgba(17, 21, 38, .8), rgba(9, 13, 24, .5)); }
.topbar { min-height: 81px; padding: 14px 47px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.workspace-title { display: flex; align-items: center; gap: 10px; color: #d9dbe4; font: 600 13px "Space Grotesk", sans-serif; }
.live-pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 13px var(--mint); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px 18px; flex-wrap: wrap; }
.page-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-pill { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; color: var(--muted); background: rgba(255, 255, 255, .035); font-size: 9px; letter-spacing: .12em; transition: border-color .2s, color .2s, background .2s; }
.page-pill:hover { color: var(--ink); border-color: rgba(169, 149, 255, .45); }
.page-pill.active { color: var(--ink); background: rgba(169, 149, 255, .12); border-color: rgba(169, 149, 255, .55); }
.secure-label { color: var(--muted-2); font-size: 9px; letter-spacing: .1em; }
.lock-icon { color: var(--mint); font-size: 15px; margin-right: 5px; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 19px; transition: color .2s, transform .2s; }
.icon-button:hover { color: var(--ink); transform: rotate(-25deg); }
.mode-tabs { display: flex; gap: 4px; padding: 28px 47px 0; }
.mode-tab { border: 0; border-bottom: 1px solid transparent; color: var(--muted-2); background: transparent; padding: 0 19px 17px; font: 600 12px "Space Grotesk", sans-serif; }
.mode-tab span { margin-right: 7px; color: var(--muted-2); }
.mode-tab small { color: var(--muted-2); font-size: 8px; margin-left: 8px; vertical-align: 1px; }
.mode-tab.active { color: var(--ink); border-color: var(--purple); }
.mode-tab.active span { color: var(--purple); }
.mode-panel { display: none; flex: 1; min-height: 0; }
.mode-panel.active { display: flex; }

.chat-panel { flex-direction: column; padding: 0 47px 28px; }
.conversation { flex: 1; min-height: 360px; overflow: auto; padding: 45px 4px 18px; }
.welcome-state { max-width: 650px; margin: 0 auto; text-align: center; padding: 20px 0 30px; }
.welcome-orbit { width: 80px; height: 80px; border: 1px solid rgba(169,149,255,.3); border-radius: 50%; margin: 0 auto 24px; display: grid; place-items: center; position: relative; }
.welcome-orbit::before, .welcome-orbit::after { content: ""; position: absolute; border: 1px solid rgba(112,226,196,.25); border-radius: 50%; }
.welcome-orbit::before { width: 106px; height: 42px; transform: rotate(29deg); }
.welcome-orbit::after { width: 42px; height: 106px; transform: rotate(29deg); }
.orbit-core { width: 43px; height: 43px; border-radius: 15px; display: grid; place-items: center; color: #d9d0ff; background: linear-gradient(145deg, #8c78ff, #4f42b7); box-shadow: 0 0 35px rgba(124,101,246,.6); font-size: 20px; }
.welcome-state h2 { font-size: clamp(32px, 4vw, 46px); }
.welcome-copy { color: var(--muted); line-height: 1.7; font-size: 12px; margin: 20px auto 27px; max-width: 340px; }
.suggestion-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.suggestion, .preset { color: var(--muted); border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 9px 13px; font-size: 10px; transition: border-color .2s, color .2s, background .2s; }
.suggestion:hover, .preset:hover { color: var(--ink); border-color: rgba(169,149,255,.58); background: rgba(169,149,255,.1); }
.message-list { display: grid; gap: 18px; max-width: 800px; margin: 0 auto; }
.message { display: flex; gap: 12px; align-items: flex-start; }
.message.user { justify-content: flex-end; }
.message-avatar { flex: 0 0 29px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; color: var(--purple); background: rgba(169,149,255,.12); font-size: 13px; }
.message.user .message-avatar { order: 2; color: var(--mint); background: rgba(112,226,196,.12); }
.message-bubble { max-width: min(690px, 80%); padding: 12px 15px; border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; color: #dfe1e9; background: rgba(255,255,255,.045); white-space: pre-wrap; line-height: 1.65; font-size: 12px; }
.message.user .message-bubble { order: 1; border-radius: 15px 15px 4px 15px; color: #111727; background: linear-gradient(135deg, #b8aaff, #93e8d1); border: 0; }
.typing { display: inline-flex; gap: 4px; padding: 7px 2px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--purple); animation: bounce 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.composer-wrap { max-width: 800px; width: 100%; margin: 0 auto; }
.composer { border: 1px solid rgba(169,149,255,.38); border-radius: 16px; padding: 14px 15px 11px; background: rgba(17, 22, 40, .9); box-shadow: 0 13px 40px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.04); }
textarea { width: 100%; resize: none; outline: none; border: 0; color: var(--ink); background: transparent; line-height: 1.6; font-size: 12px; }
textarea::placeholder { color: var(--muted-2); }
.composer textarea { min-height: 36px; max-height: 150px; }
.composer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.hint, .cost-note { color: var(--muted-2); font-size: 9px; }
.send-button, .generate-button { border: 0; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: #111426; background: linear-gradient(120deg, #b8aaff, #8ce4cd); font: 700 11px "Space Grotesk", sans-serif; border-radius: 9px; padding: 10px 13px 10px 15px; box-shadow: 0 6px 20px rgba(128, 228, 205, .14); transition: transform .2s, filter .2s; }
.send-button:hover, .generate-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.send-button b, .generate-button b { font-size: 16px; line-height: 10px; font-weight: 500; }
.cost-note { text-align: center; margin: 10px 0 0; }

.image-panel { padding: 38px 47px 28px; flex-direction: column; }
.image-layout { width: 100%; max-width: 1020px; margin: auto; display: grid; grid-template-columns: minmax(250px, .8fr) minmax(360px, 1.2fr); gap: clamp(30px, 6vw, 92px); align-items: center; }
.panel-heading h2 { font-size: clamp(34px, 4vw, 52px); }
.panel-heading > p:last-child { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 20px 0 0; max-width: 290px; }
.image-form { margin-top: 36px; }
.image-form label { display: block; color: #d2d4de; font-size: 10px; font-weight: 600; margin-bottom: 10px; }
.image-form textarea { min-height: 145px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); }
.image-form textarea:focus { border-color: rgba(169,149,255,.65); }
.prompt-meta { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 9px; margin: 8px 2px 13px; }
.generate-button { width: 100%; padding: 13px; }
.sparkle { font-size: 18px; }
.preset-block { margin-top: 29px; }
.preset-label { color: var(--muted-2); font-size: 8px; letter-spacing: .16em; }
.preset-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.preset { padding: 7px 11px; font-size: 9px; }
.image-result-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.035); box-shadow: 0 18px 55px rgba(0,0,0,.18); }
.result-topline, .result-actions { display: flex; align-items: center; justify-content: space-between; color: var(--muted-2); font-size: 8px; letter-spacing: .14em; }
.quality-chip { color: var(--mint); letter-spacing: .06em; }
.image-preview { position: relative; aspect-ratio: 1; display: grid; place-items: center; margin-top: 14px; overflow: hidden; border-radius: 12px; background: radial-gradient(circle at 30% 20%, rgba(169,149,255,.16), transparent 38%), #0d1324; border: 1px solid rgba(255,255,255,.05); }
.preview-empty { text-align: center; color: var(--muted-2); }
.preview-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--purple); border: 1px dashed rgba(169,149,255,.52); border-radius: 14px; font-size: 21px; }
.preview-empty p { color: #a8acba; font-size: 12px; line-height: 1.6; margin: 0; }
.preview-empty span { display: block; margin-top: 10px; font-size: 9px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.loading-state { text-align: center; color: var(--muted); font-size: 11px; }
.loading-orbit { width: 52px; height: 52px; position: relative; margin: 0 auto 14px; animation: spin 1.4s linear infinite; }
.loading-orbit span { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--purple); top: 0; left: 22px; box-shadow: 0 0 15px var(--purple); }
.loading-orbit span:nth-child(2) { top: 31px; left: 3px; background: var(--mint); box-shadow: 0 0 15px var(--mint); }.loading-orbit span:nth-child(3) { top: 31px; left: 41px; background: var(--orange); box-shadow: 0 0 15px var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }
.result-actions { padding-top: 13px; letter-spacing: .05em; }
.download-button { color: var(--ink); text-decoration: none; border: 1px solid var(--line); padding: 7px 10px; border-radius: 8px; font-size: 9px; letter-spacing: .03em; transition: border-color .2s; }
.download-button:hover { border-color: var(--mint); }
.image-cost-note { margin-top: 15px; }
.toast { position: fixed; right: 26px; bottom: 25px; max-width: 350px; padding: 12px 15px; color: #e6e7ed; border: 1px solid rgba(255, 179, 113, .34); border-radius: 11px; background: #242032; box-shadow: 0 15px 40px rgba(0,0,0,.3); transform: translateY(20px); opacity: 0; pointer-events: none; transition: all .25s; font-size: 11px; z-index: 5; }
.toast.show { transform: translateY(0); opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .landing-shell { padding: 22px; }
  .landing-grid { grid-template-columns: 1fr; max-width: 820px; }
  .landing-hero { padding: 26px; }
  .landing-selector { padding: 20px; }
  .entry-card { min-height: 180px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 21px 22px 19px; }
  .sidebar-intro { margin-top: 36px; }.sidebar-intro h1 br { display: none; }.intro-copy { max-width: 420px; margin-top: 12px; }
  .model-cards { display: flex; margin-top: 25px; }.model-card { flex: 1; }.sidebar-note, .sidebar-footer { display: none; }
  .topbar { min-height: 66px; padding: 12px 22px; }.chat-panel { padding: 0 22px 22px; }.image-panel { padding: 30px 22px 22px; }
  .image-layout { grid-template-columns: 1fr; gap: 35px; max-width: 650px; }.image-controls { display: grid; }.panel-heading > p:last-child { max-width: 450px; }
  .image-form { margin-top: 25px; }.image-result-card { max-width: 650px; width: 100%; margin: auto; }
}
@media (max-width: 540px) {
  .landing-shell { padding: 16px; }
  .landing-hero { padding: 22px; gap: 18px; }
  .landing-selector { padding: 16px; }
  .entry-card { min-height: 170px; padding: 20px; }
  .entry-card p { font-size: 11px; }
  .entry-card-footer { margin-top: 16px; }
  .secure-label { display: none; }.conversation { padding-top: 24px; }.suggestion-row { gap: 5px; }.suggestion { font-size: 9px; padding: 8px 10px; }
  .hint { display: none; }.composer-bottom { justify-content: flex-end; }.model-card { padding: 9px; }.model-card div:nth-child(2) span { font-size: 8px; }.model-card strong { font-size: 10px; }
  .page-nav { gap: 5px; }.page-pill { padding: 6px 9px; font-size: 8px; }
}
