:root {
  color-scheme: dark;
  --bg: #09070d;
  --bg-elevated: #100d16;
  --panel: rgba(20, 16, 29, 0.92);
  --panel-solid: #15111d;
  --panel-soft: #1b1625;
  --panel-hover: #241d31;
  --text: #f7f4fb;
  --muted: #a9a1b5;
  --subtle: #766e82;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.17);
  --brand: #8b5cf6;
  --brand-strong: #7c3aed;
  --brand-soft: rgba(139, 92, 246, 0.16);
  --brand-glow: rgba(124, 58, 237, 0.32);
  --success: #6ee7b7;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --sidebar-width: 284px;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfafc;
  --bg-elevated: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-solid: #ffffff;
  --panel-soft: #f2eff6;
  --panel-hover: #ebe6f1;
  --text: #19131f;
  --muted: #665e70;
  --subtle: #8b8395;
  --border: rgba(31, 23, 42, 0.10);
  --border-strong: rgba(31, 23, 42, 0.17);
  --brand-soft: rgba(124, 58, 237, 0.10);
  --brand-glow: rgba(124, 58, 237, 0.17);
  --shadow: 0 24px 70px rgba(43, 28, 62, 0.14);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --bg: #fbfafc;
    --bg-elevated: #ffffff;
    --panel: rgba(255, 255, 255, 0.94);
    --panel-solid: #ffffff;
    --panel-soft: #f2eff6;
    --panel-hover: #ebe6f1;
    --text: #19131f;
    --muted: #665e70;
    --subtle: #8b8395;
    --border: rgba(31, 23, 42, 0.10);
    --border-strong: rgba(31, 23, 42, 0.17);
    --brand-soft: rgba(124, 58, 237, 0.10);
    --brand-glow: rgba(124, 58, 237, 0.17);
    --shadow: 0 24px 70px rgba(43, 28, 62, 0.14);
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); }
body, button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
::selection { background: rgba(139, 92, 246, 0.34); }

.jugi-body { overflow: hidden; }
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); width: 100vw; height: 100dvh; }

.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
  padding: 14px 12px 12px;
  position: relative;
  z-index: 30;
}
.sidebar-top { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 2px 6px 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -0.02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: inline-grid; place-items: center;
  color: white; font-size: 17px; font-weight: 850;
  background: linear-gradient(145deg, #a78bfa, #6d28d9 72%);
  box-shadow: 0 8px 28px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.3);
}
.brand-mark.small { width: 29px; height: 29px; border-radius: 9px; font-size: 14px; }
.brand-name { font-size: 17px; }
.icon-button, .composer-action, .send-button {
  appearance: none; border: 0; display: inline-grid; place-items: center; cursor: pointer; flex: 0 0 auto;
}
.icon-button { width: 38px; height: 38px; border-radius: 12px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--panel-soft); color: var(--text); }
.sidebar-close { display: none; }

.new-chat-button {
  width: 100%; min-height: 46px; display: flex; align-items: center; gap: 11px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel-soft); color: var(--text); cursor: pointer;
  font-weight: 650; transition: .16s ease;
}
.new-chat-button:hover { background: var(--panel-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.new-chat-button svg { width: 18px; height: 18px; }
.sidebar-label { padding: 22px 11px 8px; color: var(--subtle); font-size: 11px; font-weight: 760; text-transform: uppercase; letter-spacing: .09em; }
.conversation-list { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.conversation-item { position: relative; display: flex; align-items: center; border-radius: 11px; margin: 2px 0; }
.conversation-item > button:first-child {
  appearance: none; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-width: 0; width: 100%;
  padding: 10px 35px 10px 11px; border-radius: 11px; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 14px;
}
.conversation-item:hover, .conversation-item.active { background: var(--panel-soft); }
.conversation-item.active > button:first-child { color: var(--text); font-weight: 620; }
.conversation-more { opacity: 0; position: absolute; inset-inline-end: 4px; width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.conversation-item:hover .conversation-more, .conversation-more:focus-visible { opacity: 1; }
.conversation-more:hover { background: var(--panel-hover); color: var(--text); }
.conversation-more svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.sidebar-footer { padding-top: 10px; border-top: 1px solid var(--border); }
/* HEYJUGI_V13_1_CHAT_NAV_RESTRUCTURE
   Creator Studio / Media / Control Center were destinations buried two clicks
   deep inside the avatar popover. They are now persistent sidebar links, and a
   direct settings gear sits beside the account button so desktop stops being
   worse than mobile (which already had #mobile-settings). Styling deliberately
   reuses the existing .popover a / .new-chat-button vocabulary rather than
   introducing a new one. */
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.sidebar-nav-link { min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 11px; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; transition: .16s ease; }
.sidebar-nav-link:hover { background: var(--panel-soft); color: var(--text); }
.sidebar-nav-link svg { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-footer-row { display: flex; align-items: center; gap: 4px; }
.sidebar-footer-row .account-button { flex: 1 1 auto; min-width: 0; }
.sidebar-footer-row .account-copy { min-width: 0; }
.sidebar-footer-row .account-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 13px; background: transparent; cursor: pointer; text-align: start; }
.account-button:hover { background: var(--panel-soft); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: #c4b5fd; border: 1px solid rgba(139,92,246,.25); font-weight: 780; }
.account-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.account-copy strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-button > svg { width: 18px; height: 18px; fill: currentColor; stroke: none; color: var(--subtle); }
.sidebar-scrim { display: none; }

.chat-main { min-width: 0; position: relative; display: flex; flex-direction: column; height: 100dvh; background: var(--bg); }
.mobile-header { display: none; }
.message-viewport { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.message-column { width: min(100%, 850px); margin: 0 auto; padding: 38px 28px 220px; }
.empty-state { min-height: calc(100dvh - 300px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: fadeUp .42s ease both; }
.hero-orb { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; position: relative; margin-bottom: 22px; background: radial-gradient(circle at 30% 25%, #c4b5fd, #8b5cf6 42%, #4c1d95 100%); box-shadow: 0 20px 65px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.35); }
.hero-orb::before { content: ""; position: absolute; inset: -13px; border-radius: 30px; border: 1px solid rgba(139,92,246,.22); }
.hero-orb span { color: white; font-size: 28px; font-weight: 850; }
.hero-orb.large { width: 86px; height: 86px; border-radius: 29px; }
.hero-orb.large span { font-size: 38px; }
.empty-state h1 { margin: 0; font-size: clamp(29px, 4.4vw, 45px); letter-spacing: -.045em; font-weight: 760; }
.empty-state > p { max-width: 620px; margin: 13px 0 0; color: var(--muted); line-height: 1.65; }
.suggestion-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.suggestion-row button { border: 1px solid var(--border); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 10px 14px; cursor: pointer; font-size: 13px; }
.suggestion-row button:hover { border-color: rgba(139,92,246,.42); color: var(--text); background: var(--brand-soft); }

.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 14px; padding: 18px 0; animation: fadeUp .22s ease both; }
.message.user { grid-template-columns: 1fr; justify-items: end; padding-top: 22px; }
.message-avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: #c4b5fd; font-weight: 800; font-size: 14px; border: 1px solid rgba(139,92,246,.2); }
.message-body { min-width: 0; max-width: 100%; }
.message.user .message-body { max-width: min(78%, 650px); background: var(--panel-soft); border: 1px solid var(--border); border-radius: 20px 20px 6px 20px; padding: 12px 16px; }
[dir="rtl"] .message.user .message-body { border-radius: 20px 20px 20px 6px; }
.message-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.66; font-size: 15.5px; }
.message.assistant .message-text { padding-top: 4px; }
.message-meta { margin-top: 7px; color: var(--subtle); font-size: 11px; }
.message-attachment { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-top: 10px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); font-size: 12px; background: var(--panel); }
.message-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.inline-card { margin-top: 13px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); overflow: hidden; box-shadow: 0 15px 42px rgba(0,0,0,.13); }
.navigation-card, .action-card, .memory-card { padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.navigation-card a, .card-link { color: #c4b5fd; font-weight: 650; }
.action-copy, .memory-copy { min-width: 0; }
.action-copy strong, .memory-copy strong { display: block; font-size: 13px; }
.action-copy small, .memory-copy small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; text-transform: capitalize; background: var(--panel-soft); color: var(--muted); white-space: nowrap; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill.succeeded, .status-pill.completed, .status-pill.ready { color: var(--success); background: rgba(52,211,153,.11); }
.status-pill.failed { color: var(--danger); background: rgba(251,113,133,.11); }
.status-pill.running, .status-pill.queued, .status-pill.pending { color: #c4b5fd; background: var(--brand-soft); }

.media-card { min-height: 138px; }
.media-preview { position: relative; background: #050407; min-height: 180px; display: grid; place-items: center; overflow: hidden; }
.media-preview img, .media-preview video { width: 100%; max-height: 560px; display: block; object-fit: contain; background: #050407; }
.media-card-body { padding: 14px 15px 15px; }
.media-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.media-card-head strong { font-size: 14px; }
.media-card-head p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 5px 0 0; }
.progress-track { width: 100%; height: 5px; border-radius: 999px; background: var(--panel-soft); overflow: hidden; margin-top: 13px; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7c3aed, #a78bfa); transition: width .35s ease; }
.media-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.media-actions a, .media-actions button { appearance: none; border: 1px solid var(--border); background: var(--panel-soft); color: var(--text); border-radius: 10px; min-height: 36px; padding: 0 12px; cursor: pointer; font-weight: 650; font-size: 12px; display: inline-flex; align-items: center; gap: 7px; }
.media-actions a:hover, .media-actions button:hover { border-color: rgba(139,92,246,.45); background: var(--brand-soft); }
.media-actions .primary-action { background: var(--brand-strong); color: white; border-color: transparent; }
.media-file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.media-file-list a { color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--border-strong); }
.media-spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.15); border-top-color: #a78bfa; border-radius: 50%; animation: spin .8s linear infinite; }
.media-error { padding: 20px; color: var(--danger); font-size: 13px; line-height: 1.5; }

.working-message { opacity: .85; }
.thinking-dots { display: inline-flex; gap: 4px; padding-top: 9px; }
.thinking-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: bounce 1.15s infinite ease-in-out; }
.thinking-dots i:nth-child(2) { animation-delay: .12s; }
.thinking-dots i:nth-child(3) { animation-delay: .24s; }

.composer-zone { position: absolute; z-index: 15; inset-inline: 0; bottom: 0; padding: 30px 24px calc(13px + var(--safe-bottom)); background: linear-gradient(180deg, rgba(9,7,13,0), var(--bg) 29%, var(--bg) 100%); pointer-events: none; }
.composer-zone > * { pointer-events: auto; }
.composer { width: min(100%, 850px); margin: 0 auto; min-height: 58px; display: flex; align-items: flex-end; gap: 7px; padding: 8px; border: 1px solid var(--border-strong); border-radius: 22px; background: var(--panel-solid); box-shadow: 0 14px 45px rgba(0,0,0,.25); transition: border-color .16s ease, box-shadow .16s ease; }
.composer:focus-within { border-color: rgba(139,92,246,.55); box-shadow: 0 16px 52px rgba(0,0,0,.28), 0 0 0 3px rgba(124,58,237,.08); }
.composer textarea { min-width: 0; flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); padding: 10px 5px 9px; line-height: 1.48; max-height: 180px; overflow-y: auto; }
.composer textarea::placeholder { color: var(--subtle); }
.composer-action { width: 41px; height: 41px; border-radius: 14px; background: transparent; color: var(--muted); }
.composer-action:hover { background: var(--panel-soft); color: var(--text); }
.composer-action.recording { color: white; background: var(--danger); animation: pulse 1.4s ease-in-out infinite; }
.send-button { width: 41px; height: 41px; border-radius: 14px; background: var(--brand-strong); color: white; box-shadow: 0 6px 18px var(--brand-glow); }
.send-button:hover { background: #6d28d9; transform: translateY(-1px); }
.send-button:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.attachment-chip { width: min(100%, 850px); margin: 0 auto 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--panel-solid); border-radius: 12px; padding: 8px 10px; color: var(--muted); font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.attachment-chip svg { width: 16px; height: 16px; }
.attachment-chip span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 20px; line-height: 1; }
.composer-status { width: min(100%, 850px); min-height: 17px; margin: 6px auto 0; color: var(--muted); text-align: center; font-size: 11px; }
.composer-note { width: min(100%, 850px); margin: 0 auto; color: var(--subtle); text-align: center; font-size: 10px; }

.popover { position: fixed; z-index: 90; width: 240px; border: 1px solid var(--border-strong); border-radius: 15px; padding: 6px; background: var(--panel-solid); box-shadow: var(--shadow); }
.account-menu { inset-inline-start: 14px; bottom: 76px; }
.popover a, .popover button { width: 100%; min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 0 10px; text-align: start; font-size: 13px; }
.popover a:hover, .popover button:hover { background: var(--panel-soft); }
.popover form { margin: 0; }
.popover svg { width: 17px; height: 17px; color: var(--muted); }
.menu-separator { height: 1px; background: var(--border); margin: 5px 4px; }
.menu-caption { color: var(--subtle); font-size: 10px; padding: 5px 10px 3px; text-transform: uppercase; letter-spacing: .08em; }
.danger-menu-item { color: var(--danger) !important; }
.conversation-popover { width: 160px; z-index: 95; }

.drawer-scrim { position: fixed; inset: 0; z-index: 98; border: 0; background: rgba(0,0,0,.48); backdrop-filter: blur(2px); }
.settings-drawer { position: fixed; z-index: 99; inset-block: 0; inset-inline-end: 0; width: min(92vw, 485px); background: var(--bg-elevated); border-inline-start: 1px solid var(--border); box-shadow: var(--shadow); transform: translateX(104%); transition: transform .24s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
[dir="rtl"] .settings-drawer { transform: translateX(-104%); }
.settings-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 23px 22px 17px; border-bottom: 1px solid var(--border); }
.drawer-header h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.drawer-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-form { min-height: 0; flex: 1; overflow-y: auto; padding: 6px 20px 90px; }
.settings-section { padding: 18px 0 8px; }
.settings-section + .settings-section { border-top: 1px solid var(--border); }
.settings-section h3 { color: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 8px; }
.setting-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 11px 2px; }
.setting-row > span { min-width: 0; display: flex; flex-direction: column; }
.setting-row strong { font-size: 13px; }
.setting-row small { color: var(--muted); margin-top: 4px; font-size: 11px; line-height: 1.45; }
.select-row select { max-width: 160px; appearance: none; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-soft); color: var(--text); padding: 9px 28px 9px 10px; outline: 0; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 14px) 52%, calc(100% - 10px) 52%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
[dir="rtl"] .select-row select { padding: 9px 10px 9px 28px; background-position: 14px 52%, 10px 52%; }
.switch-row { position: relative; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row i { width: 42px; height: 24px; border-radius: 999px; background: var(--panel-hover); border: 1px solid var(--border-strong); position: relative; flex: 0 0 auto; transition: .18s ease; }
.switch-row i::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; top: 2px; inset-inline-start: 2px; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.25); transition: .18s ease; }
.switch-row input:checked + i { background: var(--brand-strong); border-color: var(--brand-strong); }
.switch-row input:checked + i::after { transform: translateX(18px); }
[dir="rtl"] .switch-row input:checked + i::after { transform: translateX(-18px); }
.drawer-actions { position: absolute; inset-inline: 0; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 13px 20px calc(13px + var(--safe-bottom)); background: linear-gradient(180deg, transparent, var(--bg-elevated) 24%); }
.primary-button, .secondary-button { appearance: none; min-height: 43px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0 18px; font-weight: 690; font-size: 13px; cursor: pointer; transition: .16s ease; }
.primary-button { border: 1px solid transparent; background: var(--brand-strong); color: white; box-shadow: 0 8px 23px var(--brand-glow); }
.primary-button:hover { background: #6d28d9; transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--border); background: var(--panel-soft); color: var(--text); }
.secondary-button:hover { border-color: var(--border-strong); background: var(--panel-hover); }
.primary-button.compact { min-height: 38px; padding: 0 14px; border-radius: 10px; }
.full-button { width: 100%; }
.large-button { min-height: 52px; border-radius: 15px; padding: 0 23px; font-size: 14px; }

.toast-stack { position: fixed; z-index: 150; inset-inline-end: 18px; bottom: calc(18px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 220px; max-width: min(380px, calc(100vw - 36px)); border: 1px solid var(--border-strong); background: var(--panel-solid); color: var(--text); border-radius: 12px; padding: 11px 13px; box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; animation: toastIn .2s ease both; }
.toast.error { border-color: rgba(251,113,133,.38); color: #fecdd3; }

/* Public pages */
.public-body { overflow-y: auto; overflow-x: hidden; min-height: 100dvh; background: radial-gradient(circle at 50% -20%, rgba(124,58,237,.16), transparent 43%), var(--bg); }
.public-nav { width: min(1180px, calc(100% - 40px)); height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.public-nav nav { display: flex; align-items: center; gap: 20px; }
.public-nav nav > a:not(.primary-button) { color: var(--muted); font-size: 13px; font-weight: 620; }
.public-nav nav > a:hover { color: var(--text); }
.public-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.landing-hero { position: relative; min-height: 690px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 0 120px; }
.hero-glow { position: absolute; width: 520px; height: 320px; border-radius: 50%; background: rgba(124,58,237,.16); filter: blur(90px); pointer-events: none; }
.eyebrow { margin: 22px 0 13px; color: #a78bfa; font-size: 11px; letter-spacing: .17em; font-weight: 800; }
.landing-hero h1 { position: relative; max-width: 910px; margin: 0; font-size: clamp(45px, 8vw, 88px); line-height: .98; letter-spacing: -.065em; font-weight: 790; }
.landing-subtitle { max-width: 690px; margin: 24px auto 0; color: var(--muted); font-size: clamp(16px, 2vw, 19px); line-height: 1.65; }
.hero-actions { display: flex; gap: 10px; margin-top: 30px; }
.simple-promise { margin-top: 38px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 11px; color: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.simple-promise i { width: 3px; height: 3px; border-radius: 50%; background: var(--brand); }
.landing-demo { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; align-items: end; padding: 0 0 120px; }
.demo-card { border: 1px solid var(--border); background: linear-gradient(145deg, rgba(26,20,36,.92), rgba(13,10,18,.92)); border-radius: 27px; padding: 24px; box-shadow: var(--shadow); min-height: 340px; display: flex; flex-direction: column; gap: 18px; }
html[data-theme="light"] .demo-card { background: rgba(255,255,255,.92); }
.demo-card.compact-demo { min-height: 215px; transform: translateY(45px); }
.demo-message { max-width: 78%; border-radius: 18px; padding: 12px 15px; font-size: 13px; line-height: 1.55; }
.demo-message.user { align-self: flex-end; background: var(--panel-hover); border-radius: 18px 18px 5px 18px; }
.demo-message.jugi { align-self: flex-start; display: flex; gap: 9px; max-width: 90%; }
.demo-message.jugi p { margin: 0; color: var(--muted); }
.mini-mark { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand-soft); color: #c4b5fd; font-weight: 800; }
.demo-result { margin-top: auto; display: flex; align-items: center; gap: 13px; border: 1px solid var(--border); border-radius: 16px; padding: 11px; background: rgba(0,0,0,.14); }
.video-placeholder { width: 95px; aspect-ratio: 16/9; border-radius: 11px; display: grid; place-items: center; background: radial-gradient(circle at 35% 35%, #8b5cf6, #24113d 70%); color: white; }
.demo-result div:last-child { display: flex; flex-direction: column; min-width: 0; text-align: start; }
.demo-result strong { font-size: 13px; }
.demo-result small { color: var(--success); margin-top: 4px; font-size: 11px; }
.three-pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0 0 120px; }
.three-pillars article { border-top: 1px solid var(--border-strong); padding: 24px 4px 0; }
.three-pillars span { color: var(--brand); font-size: 11px; font-weight: 800; }
.three-pillars h2 { margin: 13px 0 8px; font-size: 21px; letter-spacing: -.03em; }
.three-pillars p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 13px; }
.public-footer { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: 90px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; color: var(--subtle); font-size: 11px; }
.public-footer div { display: flex; gap: 18px; }
.public-footer a:hover { color: var(--text); }

.download-main, .media-main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 100px; }
.download-heading { text-align: center; padding: 85px 0 55px; }
.download-heading .eyebrow { margin-top: 0; }
.download-heading h1 { margin: 0; font-size: clamp(38px, 6vw, 67px); letter-spacing: -.055em; }
.download-heading > p:last-child { max-width: 650px; margin: 15px auto 0; color: var(--muted); font-size: 16px; }
.device-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.device-card { border: 1px solid var(--border); background: var(--panel); border-radius: 23px; padding: 23px; display: flex; flex-direction: column; min-height: 510px; box-shadow: 0 18px 55px rgba(0,0,0,.14); }
.device-card.featured { border-color: rgba(139,92,246,.34); box-shadow: 0 23px 70px rgba(74,29,150,.18); }
.device-card-top { display: flex; align-items: center; justify-content: space-between; }
.platform-icon { font-size: 29px; height: 41px; display: grid; align-items: center; }
.status-badge { border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .06em; }
.status-badge.available { color: var(--success); background: rgba(52,211,153,.10); }
.status-badge.beta { color: var(--warning); background: rgba(251,191,36,.10); }
.device-card h2 { margin: 24px 0 10px; font-size: 23px; letter-spacing: -.035em; }
.device-card > p { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 0; }
.device-card ul { margin: 24px 0 30px; padding: 0; list-style: none; display: grid; gap: 11px; color: var(--muted); font-size: 12px; }
.device-card li { display: flex; align-items: center; gap: 9px; }
.device-card li::before { content: "✓"; color: var(--brand); font-weight: 800; }
.device-card .full-button { margin-top: auto; }
.platform-caveat, .source-link { color: var(--subtle); font-size: 10px; line-height: 1.45; text-align: center; margin-top: 10px; }
.source-link { text-decoration: underline; text-underline-offset: 3px; }
.install-help { margin-top: 12px !important; font-size: 10px !important; text-align: center; }
.why-card { margin: 18px 0 90px; border: 1px solid var(--border); border-radius: 19px; background: var(--panel); display: flex; align-items: flex-start; gap: 15px; padding: 19px 22px; }
.why-icon { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: var(--brand-soft); color: #c4b5fd; font-weight: 800; }
.why-card h2 { margin: 1px 0 7px; font-size: 15px; }
.why-card p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 12px; }
.how-it-works { padding-bottom: 20px; }
.how-it-works .eyebrow { margin: 0 0 11px; }
.how-it-works > h2 { margin: 0 0 28px; font-size: 31px; letter-spacing: -.04em; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.steps article { border-top: 1px solid var(--border-strong); padding: 18px 4px 0; }
.steps span { color: var(--brand); font-size: 11px; font-weight: 800; }
.steps strong { display: block; margin-top: 12px; font-size: 14px; }
.steps p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.media-heading { text-align: start; padding-bottom: 38px; }
.media-heading > p:last-child { margin-inline-start: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.library-card { border: 1px solid var(--border); background: var(--panel); border-radius: 19px; overflow: hidden; min-height: 250px; }
.library-card .media-preview { min-height: 220px; }
.library-empty { grid-column: 1 / -1; min-height: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--border-strong); border-radius: 22px; }
.library-empty h2 { margin: 2px 0 7px; }
.library-empty p { color: var(--muted); margin: 0 0 22px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(251,113,133,.12); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 980px) {
  :root { --sidebar-width: 262px; }
  .device-grid { grid-template-columns: 1fr 1fr; }
  .device-card:last-child { grid-column: 1 / -1; min-height: 420px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-pillars { grid-template-columns: 1fr; gap: 30px; }
}

@media (max-width: 760px) {
  .jugi-body:not(.public-body) { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(88vw, 300px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(0,0,0,.46); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .app-shell.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-close { display: grid; }
  .mobile-header { display: flex; height: 58px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 0 10px; background: rgba(9,7,13,.86); backdrop-filter: blur(18px); position: relative; z-index: 19; }
  html[data-theme="light"] .mobile-header { background: rgba(251,250,252,.88); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand strong { font-size: 14px; }
  .message-column { padding: 20px 16px 205px; }
  .empty-state { min-height: calc(100dvh - 275px); }
  .empty-state > p { font-size: 13px; }
  .suggestion-row { display: grid; width: 100%; }
  .suggestion-row button { text-align: start; border-radius: 13px; }
  .message { grid-template-columns: 29px minmax(0,1fr); gap: 10px; padding: 15px 0; }
  .message-avatar { width: 29px; height: 29px; border-radius: 9px; }
  .message.user .message-body { max-width: 88%; }
  .composer-zone { padding: 25px 10px calc(8px + var(--safe-bottom)); }
  .composer { border-radius: 19px; padding: 6px; }
  .composer-note { display: none; }
  .account-menu { inset-inline-start: 12px; bottom: 70px; }
  .settings-drawer { width: 100vw; }
  .select-row { align-items: flex-start; }
  .select-row select { max-width: 145px; }
  .toast-stack { inset-inline: 10px; bottom: calc(10px + var(--safe-bottom)); }
  .toast { min-width: 0; max-width: none; }

  .public-nav { width: calc(100% - 28px); height: 66px; }
  .public-nav nav { gap: 11px; }
  .public-nav nav > a:not(.primary-button):first-child { display: none; }
  .public-main, .download-main, .media-main, .public-footer { width: calc(100% - 28px); }
  .brand-name { font-size: 15px; }
  .landing-hero { min-height: 610px; padding: 70px 0 85px; }
  .landing-hero h1 { font-size: clamp(43px, 14vw, 65px); }
  .hero-actions { width: 100%; flex-direction: column; }
  .landing-demo { grid-template-columns: 1fr; padding-bottom: 90px; }
  .demo-card.compact-demo { transform: none; min-height: 190px; }
  .public-footer { min-height: 80px; }
  .download-heading { padding: 65px 0 42px; }
  .device-grid { grid-template-columns: 1fr; }
  .device-card, .device-card:last-child { grid-column: auto; min-height: 485px; }
  .why-card { margin-bottom: 70px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px 12px; }
  .media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .setting-row { gap: 12px; }
  .select-row { flex-direction: column; }
  .select-row select { width: 100%; max-width: none; }
  .steps { grid-template-columns: 1fr; }
  .device-card { padding: 20px; }
  .public-nav .primary-button { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}

.media-progress-meta{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-top:12px;font-size:12px}.media-progress-meta span{color:var(--muted,#8d8499)}.progress-track span{transition:width .55s ease}
