:root {
  color-scheme: dark;
  --bg: #060606;
  --sidebar: #090909;
  --surface: #101011;
  --surface-2: #151516;
  --surface-3: #1b1b1d;
  --line: #29292c;
  --line-strong: #55555a;
  --text: #f4f4f1;
  --muted: #9b9b9f;
  --faint: #67676c;
  --green: #f4f4f1;
  --blue: #ffffff;
  --danger: #e2a3a8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.boot-screen { position: fixed; z-index: 9999; inset: 0; display: grid; place-items: center; visibility: hidden; opacity: 0; pointer-events: none; background: var(--bg); transition: opacity .48s cubic-bezier(.22,.8,.32,1), visibility 0s linear .48s; will-change: opacity; }
.boot-screen img { width: 72px; height: auto; opacity: .55; transform: scale(.98); }
.is-booting .auth-screen, .is-booting .studio-shell { display: none !important; }
.is-booting .boot-screen { visibility: visible; opacity: 1; transition-delay: 0s; }
.is-booting .boot-screen img { animation: boot-pulse 1.15s ease-in-out infinite alternate; }
@keyframes boot-pulse { from { opacity: .28; transform: scale(.98); } to { opacity: .9; transform: scale(1.02); } }

.auth-screen { width: 100%; height: 100dvh; display: grid; place-items: center; padding: 24px 18px; background: #070707; }
.auth-card { width: min(380px, 100%); display: flex; flex-direction: column; transform: translateY(-2vh); }
.auth-logo { width: 104px; height: auto; align-self: center; margin-bottom: 28px; }
.auth-card label { color: #a2a2a6; font-size: 12px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.auth-card input { width: 100%; height: 51px; margin: 8px 0 17px; padding: 0 14px; border: 1px solid #2c2c2f; border-radius: 9px; outline: 0; background: #111112; color: #f4f4f1; font-size: 14px; }
.auth-card input:focus { border-color: #65656a; }
.primary-button { min-height: 51px; border: 0; border-radius: 9px; background: #f2f2ef; color: #090909; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.text-button { align-self: center; margin-top: 17px; border: 0; background: transparent; color: #a2a2a6; font-size: 12px; font-weight: 600; }
.form-message { min-height: 20px; margin: 12px 0 0; color: #d8c48f; font-size: 12px; text-align: center; }
.app-toast { position: fixed; z-index: 10000; top: 18px; left: 50%; width: min(430px, calc(100vw - 28px)); min-height: 54px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 10px 11px 10px 13px; border: 1px solid #343438; border-radius: 13px; background: rgba(22,22,24,.96); color: var(--text); box-shadow: 0 18px 55px rgba(0,0,0,.55); opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, -16px) scale(.98); transition: opacity .2s ease, transform .24s cubic-bezier(.2,.8,.2,1), visibility 0s linear .24s; backdrop-filter: blur(18px); }
.app-toast.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0) scale(1); transition-delay: 0s; }
.app-toast.is-success { border-color: #344431; }
.app-toast.is-error { border-color: #59383b; }
.app-toast-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #29292c; color: #d7d7d9; font-size: 12px; font-weight: 900; }
.app-toast.is-success .app-toast-icon { background: #263522; color: #b9dda6; }
.app-toast.is-error .app-toast-icon { background: #3b2528; color: #e7b1b5; }
.app-toast p { margin: 0; font-size: 12px; font-weight: 650; line-height: 1.45; }
.app-toast button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 19px; }
.app-toast button:hover { background: var(--surface-3); color: var(--text); }

.studio-shell { width: 100%; height: 100dvh; display: grid; grid-template-columns: 275px minmax(0, 1fr); overflow: hidden; }
.studio-sidebar { position: relative; z-index: 70; min-width: 0; height: 100dvh; display: flex; flex-direction: column; padding: 20px 14px 14px; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand-row { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.brand-row img { width: 54px; height: auto; }
.brand-row button { display: none; border: 0; background: transparent; color: var(--muted); font-size: 25px; }
.new-creation { width: 100%; height: 45px; display: flex; align-items: center; gap: 10px; margin: 14px 0 16px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 700; }
.new-creation span { color: var(--muted); font-size: 19px; font-weight: 400; }
.main-nav { display: grid; gap: 4px; }
.main-nav button, .main-nav a { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-decoration: none; font-size: 14px; text-align: left; }
.main-nav button span, .main-nav a span { width: 24px; color: var(--faint); font-size: 21px; line-height: 1; text-align: center; }
.main-nav button:hover, .main-nav a:hover, .main-nav button.is-active { background: var(--surface); color: var(--text); }
.sidebar-search-panel { height: 42px; display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; margin: 7px 0 0; padding: 0 5px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.sidebar-search-panel input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.sidebar-search-panel input::placeholder { color: var(--faint); }
.sidebar-search-panel button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--faint); font-size: 16px; }
.sidebar-search-panel button:hover { background: var(--surface-3); color: var(--text); }
.history-block { min-height: 0; flex: 1; margin-top: 24px; border-top: 1px solid var(--line); padding: 19px 5px 10px; overflow: hidden; }
.history-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 7px; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.history-title button { border: 0; background: transparent; color: var(--faint); }
.history-list { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.history-list p { margin: 12px 7px; color: var(--faint); font-size: 12px; }
.history-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; border-radius: 8px; }
.history-row:hover, .history-row.is-current { background: var(--surface); }
.history-item { width: 100%; min-width: 0; display: block; overflow: hidden; padding: 10px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }
.history-item strong, .history-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item strong { font-size: 13px; font-weight: 650; }
.history-item small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.history-row:hover .history-item, .history-row.is-current .history-item { color: var(--text); }
.chat-more { width: 28px; height: 28px; display: grid; place-items: center; opacity: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 15px; transition: opacity .15s; }
.history-row:hover .chat-more, .chat-more:focus-visible, .chat-more.is-open { opacity: 1; }
.chat-more:hover { background: var(--surface-3); color: var(--text); }
.pinned-mark { margin-right: 4px; color: var(--text); font-size: 8px; }
.sidebar-account { width: 100%; min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); text-align: left; }
.sidebar-account > b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #e9e9e6; color: #080808; font-size: 11px; }
.sidebar-account > span { min-width: 0; }
.sidebar-account strong, .sidebar-account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-account strong { font-size: 12px; }
.sidebar-account small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.sidebar-account small i { width: 6px; height: 6px; display: inline-block; margin-right: 5px; border-radius: 50%; background: var(--green); }
.sidebar-account em { color: var(--faint); font-size: 10px; font-style: normal; }
.sidebar-scrim { display: none; }

.chat-actions-menu { position: fixed; z-index: 95; width: 168px; display: none; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #101011; box-shadow: 0 18px 45px rgba(0,0,0,.55); }
.chat-actions-menu.is-open { display: grid; }
.chat-actions-menu button { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 11px; text-align: left; }
.chat-actions-menu button:hover { background: var(--surface-3); }
.chat-actions-menu button span:first-child { width: 15px; color: var(--muted); text-align: center; }
.chat-actions-menu button.is-danger { color: var(--danger); }

.chat-dialog-overlay { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 18px; background: rgba(0,0,0,.72); }
.chat-dialog-overlay.is-open { display: grid; }
.chat-dialog { width: min(390px, 100%); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #101011; box-shadow: 0 24px 70px rgba(0,0,0,.58); }
.chat-dialog h2 { margin: 0; font-size: 15px; }
.chat-dialog p { margin: 8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.chat-dialog input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface-2); color: var(--text); font-size: 12px; }
.chat-dialog input:focus { border-color: var(--line-strong); }
.chat-dialog > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.chat-dialog > div button { height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 11px; }
.chat-dialog > div button.confirm { border-color: transparent; background: var(--text); color: #080808; font-weight: 750; }
.chat-dialog > div button.confirm.is-danger { background: #d8a1a5; color: #160809; }

.chat-main { min-width: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.chat-topbar { height: 70px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 22px 0 28px; border-bottom: 1px solid rgba(41,41,44,.72); }
.chat-topbar > div { display: flex; align-items: center; gap: 9px; }
.chat-topbar strong { font-size: 13px; }
.chat-topbar small { margin-left: 5px; color: var(--faint); font-size: 10px; }
.mobile-menu { display: none; border: 0; background: transparent; color: var(--muted); font-size: 20px; }
.top-new { height: 40px; display: flex; align-items: center; gap: 8px; margin-left: auto; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: 12px; }
.top-new span { color: var(--muted); font-size: 17px; }
.chat-stage { min-height: 0; flex: 1; position: relative; display: flex; flex-direction: column; }
.welcome-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px 180px; text-align: center; }
.welcome-state img { width: 58px; height: auto; margin-bottom: 22px; opacity: .92; }
.welcome-state h1 { margin: 0; font-size: clamp(27px, 3.4vw, 42px); letter-spacing: -.045em; }
.welcome-state p { max-width: 520px; margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.conversation { min-height: 0; width: min(880px, calc(100% - 36px)); flex: 1; align-self: center; display: none; overflow-y: auto; padding: 34px 0 190px; scrollbar-width: thin; }
.conversation.has-content { display: block; }
.conversation.is-library { padding-bottom: 34px; }
.view-heading { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.view-heading h1 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.025em; }
.view-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.5; }
.empty-view { min-height: 45vh; display: grid; place-items: center; text-align: center; }
.empty-view div { max-width: 360px; }
.empty-view span { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--muted); font-size: 20px; }
.empty-view h2 { margin: 0; font-size: 15px; }
.empty-view p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.file-card { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.file-card > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--muted); font-size: 16px; }
.file-card strong, .file-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card strong { font-size: 10px; }
.file-card small { margin-top: 5px; color: var(--faint); font-size: 8px; }
.settings-page { display: grid; gap: 13px; padding-bottom: 28px; }
.settings-page-section { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.settings-page-section > header { padding: 17px 19px; border-bottom: 1px solid var(--line); }
.settings-page-section h2 { margin: 0; font-size: 16px; font-weight: 800; }
.settings-page-section header p { margin: 6px 0 0; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.45; }
.settings-page-row { min-height: 70px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 250px); align-items: center; gap: 18px; padding: 13px 19px; border-bottom: 1px solid var(--line); }
.settings-page-row:last-child { border-bottom: 0; }
.settings-page-row > div > strong, .settings-page-row > div > small { display: block; }
.settings-page-row > div > strong { font-size: 13px; font-weight: 800; }
.settings-page-row > div > small { margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.4; }
.settings-page-row select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface-2); color: var(--text); font-size: 10px; }
.settings-page-row output { color: var(--text); font-size: 12px; font-weight: 650; text-align: right; }
.settings-page-row output a { color: var(--text); text-decoration: none; }
.usage-settings-body { padding: 19px; }
.usage-settings-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.usage-settings-total small, .usage-settings-total strong { display: block; }
.usage-settings-total small { color: var(--muted); font-size: 11px; font-weight: 600; }
.usage-settings-total strong { margin-top: 6px; font-size: 18px; font-weight: 800; }
.usage-settings-total > b { color: var(--text); font-size: 13px; }
.usage-settings-body progress { width: 100%; height: 6px; margin: 17px 0; overflow: hidden; border: 0; border-radius: 999px; background: var(--surface-3); }
.usage-settings-body progress::-webkit-progress-bar { background: var(--surface-3); }
.usage-settings-body progress::-webkit-progress-value { border-radius: 999px; background: var(--text); }
.usage-settings-body progress::-moz-progress-bar { border-radius: 999px; background: var(--text); }
.usage-settings-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.usage-settings-stats div { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.usage-settings-stats small, .usage-settings-stats strong { display: block; }
.usage-settings-stats small { color: var(--muted); font-size: 10px; font-weight: 600; }
.usage-settings-stats strong { margin-top: 6px; font-size: 12px; font-weight: 800; }
.account-edit-control, .account-key-control { width: 100%; min-width: 0; }
.account-edit-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.account-edit-control input, .account-key-control input { width: 100%; height: 41px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface-2); color: var(--text); font-size: 11px; font-weight: 650; }
.account-edit-control input:focus { border-color: var(--line-strong); }
.account-edit-control button, .account-key-control button { min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 9px; font-weight: 750; }
.account-key-control > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 7px; }
.account-key-control #rotate-settings-key { color: #e6c78f; }
.account-edit-control .account-confirm-box, .account-key-control .account-confirm-box { width: 100%; grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; margin-top: 8px; padding: 10px; border: 1px solid #4a402a; border-radius: 9px; background: #1b1811; }
.account-confirm-box span { grid-column: 1 / -1; color: #d8c48f; font-size: 9px; font-weight: 650; line-height: 1.4; }
.account-confirm-box input { letter-spacing: .16em; text-align: center; }
.recovered-key-notice { margin: 15px 19px 0; padding: 12px 14px; border: 1px solid #52472e; border-radius: 9px; background: #1d1a12; color: #e6c78f; }
.recovered-key-notice strong, .recovered-key-notice span { display: block; }
.recovered-key-notice strong { font-size: 11px; }
.recovered-key-notice span { margin-top: 5px; font-size: 9px; line-height: 1.45; }
.page-switch { width: 48px; height: 27px; justify-self: end; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #24272b; }
.page-switch span { width: 19px; height: 19px; display: block; border-radius: 50%; background: #777c84; transition: transform .15s, background .15s; }
.page-switch[aria-checked="true"] span { transform: translateX(19px); background: var(--text); }
.settings-page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-top: 3px; }
.settings-page-actions span { color: var(--muted); font-size: 9px; }
.settings-page-actions button { height: 41px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--text); color: #080808; font-size: 10px; font-weight: 850; }
.message { margin-bottom: 22px; }
.message-user { display: flex; justify-content: flex-end; }
.message-user p { max-width: 75%; margin: 0; padding: 13px 16px; border-radius: 15px 15px 4px 15px; background: var(--surface-3); color: var(--text); font-size: 13px; line-height: 1.55; }
.assistant-pending { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); font-size: 11px; }
.assistant-pending > span { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 9px; font-weight: 900; }
.assistant-pending i { display: flex; gap: 4px; }
.assistant-pending i span { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); animation: typing-dot .9s infinite alternate; }
.assistant-pending i span:nth-child(2) { animation-delay: .18s; }
.assistant-pending i span:nth-child(3) { animation-delay: .36s; }
@keyframes typing-dot { to { opacity: .25; transform: translateY(-2px); } }
.assistant-error { max-width: 680px; color: var(--danger); font-size: 11px; line-height: 1.55; }
.generation-card { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.generation-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.generation-card-head div { min-width: 0; }
.generation-card-head strong, .generation-card-head span { display: block; }
.generation-card-head strong { font-size: 12px; }
.generation-card-head span { margin-top: 5px; color: var(--faint); font-size: 10px; }
.generation-status { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.generation-card video { width: 100%; max-height: 520px; margin-top: 15px; border-radius: 9px; background: #000; }
.generation-card a { display: inline-block; margin-top: 12px; color: var(--text); font-size: 11px; }

.composer-zone { position: absolute; z-index: 30; left: 50%; bottom: 22px; width: min(820px, calc(100% - 40px)); transform: translateX(-50%); }
.chat-composer { position: relative; padding: 15px 15px 12px; border: 1px solid var(--line); border-radius: 16px; background: rgba(16,16,17,.98); box-shadow: 0 18px 55px rgba(0,0,0,.38); }
#video-prompt { width: 100%; min-height: 58px; max-height: 180px; resize: none; padding: 0 4px 12px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; line-height: 1.5; }
#video-prompt::placeholder { color: #76767b; }
.upload-tray { display: flex; gap: 9px; overflow-x: auto; padding: 0 2px 14px; scrollbar-width: thin; }
.media-slot, .upload-chip { position: relative; width: 118px; height: 86px; flex: 0 0 auto; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.media-slot { display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.media-slot:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-3); }
.media-slot b { font-size: 23px; font-weight: 300; line-height: 1; }
.media-slot span { font-size: 9px; letter-spacing: .02em; }
.upload-chip img, .upload-chip video { width: 100%; height: 100%; object-fit: cover; }
.upload-chip .video-file { width: 100%; height: 100%; display: grid; place-items: center; padding: 8px; color: var(--muted); font-size: 9px; text-align: center; }
.upload-chip > button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; }
.upload-chip > span { position: absolute; left: 5px; bottom: 5px; max-width: calc(100% - 10px); overflow: hidden; padding: 3px 6px; border-radius: 5px; background: rgba(0,0,0,.76); color: #fff; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.upload-chip.is-uploading { opacity: .55; }
.upload-chip.is-uploading::after { content: "Enviando"; position: absolute; inset: auto 3px 3px; padding: 3px; border-radius: 4px; background: rgba(0,0,0,.78); color: #fff; font-size: 7px; text-align: center; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composer-tools, .composer-actions { display: flex; align-items: center; gap: 8px; }
.icon-tool { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 18px; }
.icon-tool:hover { border-color: var(--line-strong); color: var(--text); }
.auto-actions-popover { position: absolute; z-index: 5; left: 15px; bottom: 61px; width: min(330px, calc(100vw - 36px)); display: none; overflow: hidden; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #111214; box-shadow: 0 24px 70px rgba(0,0,0,.62); }
.auto-actions-popover.is-open { display: block; }
.auto-actions-popover > strong { display: block; padding: 8px 10px 10px; color: var(--text); font-size: 14px; }
.auto-actions-popover > button { width: 100%; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; }
.auto-actions-popover > button:hover { background: var(--surface-3); }
.auto-actions-popover > button > span { width: 31px; height: 31px; display: grid; place-items: center; color: var(--muted); font-size: 19px; }
.auto-actions-popover b, .auto-actions-popover small { display: block; }
.auto-actions-popover b { font-size: 11px; }
.auto-actions-popover small { margin-top: 4px; color: var(--faint); font-size: 9px; line-height: 1.35; }
.model-picker { position: relative; }
.model-trigger { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.model-trigger strong { font-size: 11px; }
.model-mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; background: #202022; color: var(--text); font-size: 10px; font-weight: 900; }
.model-menu { position: absolute; left: 0; bottom: 48px; width: min(540px, calc(100vw - 36px)); max-height: min(72vh, 650px); display: none; overflow-x: hidden; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; background: #0c0c0d; box-shadow: 0 22px 60px rgba(0,0,0,.58); scrollbar-width: thin; }
.model-menu.is-open { display: block; }
.model-menu-head { position: sticky; z-index: 2; top: 0; padding: 14px 14px 0; border-bottom: 1px solid var(--line); background: #0c0c0d; }
.model-search-row { height: 41px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 28px; align-items: center; padding: 0 9px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.model-search-row > span { color: var(--faint); font-size: 18px; }
.model-search-row input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 12px; }
.model-search-row input::placeholder { color: var(--faint); }
.model-search-row button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--faint); font-size: 17px; }
.model-search-row button:hover { background: var(--surface-3); color: var(--text); }
.model-tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 0 11px; scrollbar-width: none; }
.model-tabs::-webkit-scrollbar { display: none; }
.model-tabs button { height: 30px; flex: 0 0 auto; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 10px; white-space: nowrap; }
.model-tabs button:hover { color: var(--text); }
.model-tabs button.is-active { background: var(--surface-3); color: var(--text); }
.model-group-title { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px 8px; border-top: 1px solid rgba(41,41,44,.75); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.model-group-title b { color: var(--faint); font-size: 9px; }
.model-menu-item { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 25px; align-items: center; gap: 9px; padding: 13px 14px; border: 0; border-bottom: 1px solid rgba(41,41,44,.72); background: transparent; color: var(--text); text-align: left; }
.model-menu-item:hover, .model-menu-item.is-selected { background: var(--surface-2); }
.model-menu-item:disabled { cursor: default; opacity: .72; }
.model-menu-item:disabled:hover { background: transparent; }
.model-item-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 12px; font-weight: 900; }
.model-menu-item strong, .model-menu-item small { display: block; }
.model-menu-item strong { font-size: 12px; }
.model-menu-item small { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.35; }
.model-menu-item i { display: none; color: var(--green); font-style: normal; }
.model-menu-item.is-selected i { display: block; }
.model-menu-item em { padding: 3px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--faint); font-size: 7px; font-style: normal; font-weight: 800; text-align: center; }
.model-info-trigger { grid-column: 4; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--faint); font-size: 10px; font-style: normal; font-weight: 800; }
.model-info-trigger:hover { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.model-menu-item.is-filtered-out, .model-group-title.is-filtered-out { display: none; }
.model-empty { margin: 0; padding: 28px 18px 32px; color: var(--faint); font-size: 11px; text-align: center; }
.model-info-panel { position: fixed; z-index: 150; width: 370px; max-height: min(620px, calc(100vh - 24px)); display: none; overflow-y: auto; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #14171a; color: var(--text); box-shadow: 0 26px 80px rgba(0,0,0,.68); }
.model-info-panel.is-open { display: block; }
.model-info-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 30px; align-items: center; gap: 12px; }
.model-info-head > span { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-2); font-size: 17px; font-weight: 900; }
.model-info-head strong, .model-info-head small { display: block; }
.model-info-head strong { font-size: 15px; }
.model-info-head small { max-width: 220px; overflow: hidden; margin-top: 5px; color: var(--faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.model-info-head button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; }
.model-info-head button:hover { background: var(--surface-3); color: var(--text); }
.model-info-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 14px; }
.model-info-badges span { padding: 4px 7px; border: 1px solid #34414a; border-radius: 999px; background: #1b2932; color: #a9c7da; font-size: 8px; font-weight: 800; }
.model-info-panel > p { margin: 0; color: #d4d6d8; font-size: 11px; line-height: 1.65; }
.model-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 12px; margin-top: 19px; padding-top: 17px; border-top: 1px solid var(--line); }
.model-info-grid small, .model-info-grid strong { display: block; }
.model-info-grid small { color: var(--faint); font-size: 8px; }
.model-info-grid strong { margin-top: 5px; font-size: 10px; line-height: 1.4; }
.model-info-cost { display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 9px; margin-top: 18px; padding: 12px; border: 1px solid #263321; border-radius: 10px; background: #141c12; color: #9bd36c; }
.model-info-cost > span { font-size: 18px; }
.model-info-cost strong, .model-info-cost small { display: block; }
.model-info-cost strong { font-size: 9px; }
.model-info-cost small { margin-top: 4px; color: #759a59; font-size: 8px; line-height: 1.4; }
.model-info-use { width: 100%; height: 40px; margin-top: 13px; border: 0; border-radius: 9px; background: var(--text); color: #090909; font-size: 10px; font-weight: 900; }
.quote-pill { min-width: 78px; height: 39px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 11px; border: 1px solid #263321; border-radius: 10px; background: #141c12; color: #9bd36c; }
.quote-pill:hover { border-color: #435b37; background: #182316; }
.quote-pill span { font-size: 16px; line-height: 1; }
.quote-pill strong { font-size: 10px; white-space: nowrap; }
.quote-pill.is-loading { opacity: .58; }
.quote-pill.is-unavailable { border-color: var(--line); background: var(--surface-2); color: var(--faint); }
.quote-pill.is-over-budget { border-color: #5a3034; background: #241416; color: #e7a0a6; }
.send-button { width: 39px; height: 39px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--text); color: #080808; font-size: 19px; font-weight: 800; }
.send-button:hover { background: #ffffff; color: #080808; }
.send-button:disabled { cursor: not-allowed; opacity: .45; }
.settings-popover { position: absolute; left: 55px; bottom: 61px; width: min(420px, calc(100vw - 36px)); display: none; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #111214; box-shadow: 0 24px 70px rgba(0,0,0,.62); }
.settings-popover.is-open { display: block; }
.settings-head { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.settings-head strong { font-size: 15px; }
.settings-head > div { display: flex; align-items: center; gap: 10px; }
.settings-head button { border: 0; background: transparent; color: var(--muted); }
#reset-settings { color: #e36d6d; font-size: 11px; }
#close-settings { width: 28px; height: 28px; font-size: 21px; }
.setting-row { min-height: 80px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(170px, 219px); align-items: center; gap: 18px; padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--text); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; }
.setting-row i { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; background: #666a72; color: #17181a; font-size: 9px; font-style: normal; }
.setting-row select { width: 100%; height: 42px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; outline: 0; background: #202226; color: var(--text); font-size: 12px; }
.custom-native-select { display: none !important; }
.custom-select { position: relative; width: 100%; min-width: 0; }
.custom-select.is-open { z-index: 45; }
.custom-select-trigger { width: 100%; height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: #202226; color: var(--text); font-size: 12px; font-weight: 650; text-align: left; }
.custom-select-trigger:hover, .custom-select.is-open .custom-select-trigger { border-color: #3b3e43; background: #24272b; }
.custom-select-trigger:disabled { cursor: default; color: var(--muted); opacity: .78; }
.custom-select-trigger > i { width: 8px; height: 8px; flex: 0 0 auto; margin: -4px 2px 0 0; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .16s ease, margin .16s ease; }
.custom-select.is-open .custom-select-trigger > i { margin-top: 4px; transform: rotate(225deg); }
.custom-select-menu { position: absolute; z-index: 50; top: calc(100% + 7px); right: 0; left: 0; max-height: 230px; overflow-y: auto; visibility: hidden; padding: 6px; border: 1px solid #3a3d42; border-radius: 11px; opacity: 0; transform: translateY(-5px) scale(.985); transform-origin: top center; background: #17191c; box-shadow: 0 20px 45px rgba(0,0,0,.58); transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s; }
.custom-select.is-open .custom-select-menu { visibility: visible; opacity: 1; transform: translateY(0) scale(1); transition-delay: 0s; }
.custom-select-menu button { width: 100%; min-height: 39px; display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600; text-align: left; }
.custom-select-menu button:hover { background: #24272b; color: var(--text); }
.custom-select-menu button[aria-selected="true"] { background: #2b2e33; color: var(--text); font-weight: 800; }
.custom-select-menu button i { color: var(--text); font-size: 11px; font-style: normal; text-align: center; }
.stepper { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #191b1e; color: var(--muted); font-size: 18px; }
.stepper button:hover { border-color: var(--line-strong); color: var(--text); }
.stepper button:disabled { opacity: .35; }
.stepper b { min-width: 14px; font-size: 12px; text-align: center; }
.switch-control { width: 47px; height: 27px; justify-self: end; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: #24272b; }
.switch-control span { display: block; width: 19px; height: 19px; border-radius: 50%; background: #777d88; transition: transform .18s ease, background .18s ease; }
.switch-control[aria-checked="true"] { background: var(--text); }
.switch-control[aria-checked="true"] span { background: #090909; transform: translateX(18px); }
.composer-meta { display: flex; justify-content: space-between; gap: 14px; padding: 8px 4px 0; color: var(--faint); font-size: 9px; }
.composer-meta p { margin: 0; text-align: right; }

.account-menu-wrap { position: relative; }
.account-popover { position: absolute; z-index: 110; left: 0; bottom: calc(100% + 9px); width: min(390px, calc(100vw - 28px)); max-height: min(650px, calc(100vh - 105px)); display: none; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; background: #101114; box-shadow: 0 24px 65px rgba(0,0,0,.62); scrollbar-width: thin; }
.account-popover.is-open { display: block; }
.account-popover-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px; }
.account-popover-head > span { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--text); color: #090909; font-size: 11px; font-weight: 800; }
.account-popover-head > div { min-width: 0; }
.account-popover-head strong, .account-popover-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-popover-head strong { font-size: 13px; }
.account-popover-head small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.account-popover-head > b { padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.account-usage-preview { padding: 0 14px 13px; border-bottom: 1px solid var(--line); }
.account-usage-preview > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; color: var(--muted); font-size: 10px; }
.account-usage-preview strong { color: var(--text); }
.account-usage-preview progress, .account-inline-panel progress { width: 100%; height: 5px; accent-color: #ededeb; }
.account-options { padding: 6px; }
.account-options > button, .account-options > a { width: 100%; min-height: 55px; display: grid; grid-template-columns: 25px minmax(0, 1fr) 16px; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-align: left; text-decoration: none; }
.account-options > button:hover, .account-options > a:hover, .account-options > button.is-open { background: var(--surface-3); color: var(--text); }
.account-options > button > span, .account-options > a > span { color: var(--faint); font-size: 15px; text-align: center; }
.account-options > button strong, .account-options > button small, .account-options > a strong, .account-options > a small { display: block; }
.account-options > button strong, .account-options > a strong { color: var(--text); font-size: 12px; }
.account-options > button small, .account-options > a small { margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.35; }
.account-options em { color: var(--faint); font-size: 17px; font-style: normal; }
.account-inline-panel { margin: 0 7px 6px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #0c0d0f; }
.account-inline-panel > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: var(--muted); font-size: 10px; }
.account-inline-panel > div:last-child { margin-bottom: 0; }
.account-inline-panel > small, .account-inline-panel p { display: block; margin: 8px 0 0; color: var(--faint); font-size: 9px; line-height: 1.45; }
.account-options > .account-logout { border-top: 1px solid var(--line); border-radius: 0; color: var(--danger); }
.key-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.key-row input, .key-row button { height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.key-row input { min-width: 0; padding: 0 10px; font: 11px ui-monospace, monospace; }
.key-row button { padding: 0 10px; font-size: 10px; }

@media (max-width: 760px) {
  .app-toast { top: 10px; width: calc(100vw - 20px); }
  * { scrollbar-width: none; }
  *::-webkit-scrollbar { display: none; width: 0; height: 0; }
  html, body, .conversation, .history-list, .account-popover, .model-menu, .model-info-panel, .upload-tray { scrollbar-width: none !important; }
  html::-webkit-scrollbar, body::-webkit-scrollbar, .conversation::-webkit-scrollbar, .history-list::-webkit-scrollbar, .account-popover::-webkit-scrollbar, .model-menu::-webkit-scrollbar, .model-info-panel::-webkit-scrollbar, .upload-tray::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
  .studio-shell { display: block; }
  .studio-sidebar { position: fixed; left: 0; top: 0; width: min(290px, 86vw); transform: translateX(-100%); transition: transform .22s ease; }
  .studio-sidebar.is-open { transform: none; }
  .brand-row button { display: block; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 65; display: block; pointer-events: none; background: transparent; transition: .2s; }
  .sidebar-scrim.is-open { pointer-events: auto; background: rgba(0,0,0,.62); }
  .chat-more { opacity: 0; pointer-events: none; }
  .history-row { grid-template-columns: minmax(0, 1fr); }
  .chat-topbar { height: 62px; padding: 0 14px; }
  .mobile-menu { display: block; }
  .chat-topbar > div { flex: 1; }
  .chat-topbar small { display: none; }
  .top-new { width: 40px; padding: 0; justify-content: center; }
  .top-new span { font-size: 20px; }
  .top-new { font-size: 0; }
  .welcome-state { justify-content: flex-start; padding: 18vh 22px 200px; }
  .welcome-state img { width: 47px; }
  .welcome-state h1 { font-size: 29px; }
  .welcome-state p { font-size: 12px; }
  .conversation { width: calc(100% - 26px); padding: 22px 0 184px; }
  .message-user p { max-width: 88%; }
  .composer-zone { bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); }
  .chat-composer { padding: 13px 12px 10px; border-radius: 14px; }
  .media-slot, .upload-chip { width: 102px; height: 76px; }
  .media-slot { gap: 6px; }
  .auto-actions-popover { left: 10px; bottom: 57px; width: min(310px, calc(100vw - 40px)); }
  .model-info-panel { inset: 62px 10px auto 10px !important; width: auto; max-height: calc(100dvh - 124px); padding: 17px; }
  .view-heading { margin-bottom: 18px; padding: 4px 3px 17px; }
  .view-heading h1 { font-size: 23px; }
  .view-heading p { margin-top: 9px; color: #85858a; font-size: 12px; line-height: 1.6; }
  .settings-page { gap: 18px; }
  .settings-page-section { border-radius: 15px; background: #0f0f10; }
  .settings-page-section > header { padding: 19px 17px 17px; background: #121214; }
  .settings-page-section h2 { font-size: 17px; }
  .settings-page-section header p { margin-top: 8px; color: #85858a; font-size: 12px; line-height: 1.55; }
  .settings-page-row { min-height: 0; grid-template-columns: 1fr; align-items: start; gap: 14px; padding: 19px 17px; }
  .settings-page-row > div > strong { font-size: 14px; }
  .settings-page-row > div > small { margin-top: 8px; color: #85858a; font-size: 11px; line-height: 1.55; }
  .settings-page-row output { padding: 10px 12px; border: 1px solid #242427; border-radius: 9px; background: #151517; color: #dededf; font-size: 11px; text-align: left; }
  .page-switch { justify-self: start; }
  .usage-settings-body { padding: 18px 17px; }
  .usage-settings-stats { gap: 8px; }
  .usage-settings-stats div { padding: 12px 9px; }
  .settings-page-row:has(.account-edit-control), .settings-page-row:has(.account-key-control) { grid-template-columns: 1fr; align-items: start; }
  .account-key-control > div { justify-content: flex-start; }
  .account-edit-control input, .account-key-control input { height: 45px; font-size: 12px; }
  .account-edit-control button, .account-key-control button { min-height: 40px; padding: 0 13px; font-size: 10px; }
  #video-prompt { min-height: 52px; font-size: 13px; }
  .composer-toolbar { align-items: flex-end; }
  .composer-tools { min-width: 0; gap: 5px; }
  .icon-tool { width: 35px; height: 35px; }
  .model-picker { min-width: 0; }
  .model-trigger { height: 35px; max-width: 120px; padding: 0 8px; }
  .model-trigger strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  #selected-model-label:not([data-model="automatic"]) { display: none; }
  #selected-model-label[data-model="automatic"] { font-size: 0; }
  #selected-model-label[data-model="automatic"]::after { content: "Auto"; font-size: 10px; }
  .quote-pill { min-width: 66px; height: 37px; padding: 0 7px; }
  .quote-pill strong { font-size: 9px; }
  .send-button { width: 37px; height: 37px; }
  .model-menu { position: fixed; left: 10px; right: 10px; bottom: 142px; width: auto; }
  .settings-popover { position: fixed; left: 10px; right: 10px; bottom: 142px; width: auto; max-height: calc(100vh - 165px); overflow-y: auto; }
  .settings-head { height: 60px; padding: 0 16px; }
  .setting-row { min-height: 70px; grid-template-columns: minmax(0, 1fr) minmax(140px, 180px); gap: 12px; padding: 11px 16px; }
  .composer-meta p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 390px) {
  .auth-logo { width: 88px; margin-bottom: 24px; }
  .model-trigger:has(#selected-model-label[data-model="automatic"]) .model-mark { display: none; }
  .model-trigger { max-width: 118px; }
  .composer-meta p { display: none; }
  .key-row { grid-template-columns: minmax(0, 1fr) auto; }
  #copy-key { grid-column: 1 / -1; }
}
