:root {
  color-scheme: dark;
  --canvas: #212121;
  --canvas-deep: #171717;
  --sidebar: #0f0f0f;
  --surface: #2f2f2f;
  --surface-strong: #383838;
  --surface-soft: #292929;
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(255,255,255,.17);
  --text: #ececec;
  --text-strong: #fff;
  --muted: #a7a7a7;
  --faint: #777;
  --accent: #a8a8ff;
  --accent-strong: #8f8fff;
  --accent-soft: rgba(143,143,255,.14);
  --success: #49c98d;
  --warning: #f0b45b;
  --danger: #ff7b7b;
  --sidebar-width: 272px;
  --content-width: 820px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
button, input, textarea, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

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

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--sidebar);
  border-right: 1px solid rgba(255,255,255,.045);
}
.sidebar-top { padding: 14px 12px 10px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 7px 8px 13px; color: var(--text); text-decoration: none; }
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  overflow: hidden;
  background: linear-gradient(145deg,#d9d9ff 0%,#8f8fff 46%,#7558c8 100%);
  box-shadow: inset 0 1px 1px #fff7, 0 8px 24px #6e5fff2b;
  color: #171328;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-mark::after { content: ""; position: absolute; inset: -55% -20% auto; height: 100%; background: linear-gradient(100deg,transparent,#fff7,transparent); transform: rotate(-12deg); }
.brand-mark span { position: relative; z-index: 1; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-copy b { color: var(--text-strong); font-size: 14px; letter-spacing: -.01em; }
.brand-copy small { margin-top: 2px; color: #777; font-size: 10px; letter-spacing: .035em; white-space: nowrap; }
.new-task-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: #e4e4e4;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease,border-color .18s ease;
}
.new-task-button:hover { background: #1f1f1f; border-color: var(--line-strong); }
.new-task-button svg { width: 18px; height: 18px; }

.history { min-height: 0; flex: 1; overflow-y: auto; padding: 12px 8px 18px; scrollbar-width: thin; scrollbar-color: #3b3b3b transparent; }
.history-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 9px; color: #777; font-size: 11px; font-weight: 650; }
.history-label span:last-child { min-width: 20px; padding: 2px 5px; border-radius: 99px; background: #202020; text-align: center; font-size: 10px; }
.history-list { display: grid; gap: 2px; }
.history-item {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 9px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c8c8c8;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease,color .15s ease;
}
.history-item:hover, .history-item.active { background: #222; color: #fff; }
.history-icon { display: grid; place-items: center; color: #888; }
.history-icon svg { width: 16px; height: 16px; }
.history-copy { min-width: 0; }
.history-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 540; }
.history-copy small { display: block; margin-top: 3px; color: #707070; font-size: 10px; }
.history-status { width: 6px; height: 6px; border-radius: 50%; background: #666; }
.history-status.completed { background: var(--success); }
.history-status.failed { background: var(--danger); }
.history-status.running, .history-status.queued, .history-status.processing { background: var(--warning); box-shadow: 0 0 0 4px rgba(240,180,91,.1); }
.sidebar-skeleton { height: 38px; margin: 3px 5px; border-radius: 8px; background: linear-gradient(90deg,#171717,#222,#171717); background-size: 200% 100%; animation: shimmer 1.6s infinite; }
.sidebar-skeleton.short { width: 70%; }
.empty-history { margin: 18px 10px; color: #666; font-size: 10px; text-align: center; }

.sidebar-bottom { flex: 0 0 auto; padding: 10px 8px 12px; border-top: 1px solid rgba(255,255,255,.055); background: #0f0f0ff2; }
.runtime-card, .account-button { display: flex; align-items: center; width: 100%; border: 0; border-radius: 9px; background: transparent; }
.runtime-card { gap: 10px; padding: 9px 10px 8px; }
.runtime-card > span:nth-child(2), .account-button > span:nth-child(2) { display: flex; flex: 1; min-width: 0; flex-direction: column; text-align: left; }
.runtime-card b, .account-button b { overflow: hidden; color: #d8d8d8; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.runtime-card small, .account-button small { overflow: hidden; margin-top: 3px; color: #6f6f6f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.runtime-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(73,201,141,.1); }
.runtime-dot.loading { background: var(--warning); box-shadow: 0 0 0 4px rgba(240,180,91,.1); animation: pulse 1.4s ease-in-out infinite; }
.runtime-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(255,123,123,.1); }
.account-button { gap: 9px; padding: 9px 10px; cursor: pointer; transition: background .15s ease; }
.account-button:hover { background: #202020; }
.account-avatar { display: grid !important; place-items: center; flex: 0 0 27px !important; width: 27px; height: 27px; border-radius: 8px; background: #303030; color: #ddd; font-size: 11px; font-weight: 750; }
.account-button > svg { width: 15px; height: 15px; color: #6e6e6e; }

.sidebar-backdrop { position: fixed; z-index: 25; inset: 0; display: none; border: 0; background: #0009; backdrop-filter: blur(2px); }
.chat-main { position: relative; display: flex; min-width: 0; min-height: 0; flex-direction: column; background: var(--canvas); overflow: hidden; }
.chat-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 42px;
  align-items: center;
  min-height: 58px;
  padding: 7px 16px;
  background: linear-gradient(180deg,rgba(33,33,33,.98) 45%,rgba(33,33,33,0));
  pointer-events: none;
}
.chat-header > * { pointer-events: auto; }
.header-title { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; font-size: 13px; font-weight: 600; }
.model-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(47,47,47,.8); color: #ccc; cursor: pointer; font-size: 10px; }
.model-badge:hover { background: #393939; }
.model-badge svg { width: 13px; height: 13px; }
.status-orb { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.status-orb.loading { background: var(--warning); animation: pulse 1.4s ease-in-out infinite; }
.status-orb.error { background: var(--danger); }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #b8b8b8; cursor: pointer; transition: background .15s ease,color .15s ease; }
.icon-button:hover { background: rgba(255,255,255,.075); color: #fff; }
.icon-button.compact { width: 30px; height: 30px; }
.icon-button.compact svg { width: 16px; height: 16px; }
.menu-button { visibility: hidden; }
.refresh-button { justify-self: end; }
.refresh-button.refreshing svg { animation: rotate .7s linear infinite; }

.conversation { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #555 transparent; }
.conversation-inner { width: min(var(--content-width),calc(100% - 36px)); min-height: 100%; margin: 0 auto; padding: 88px 0 242px; }
.welcome-state { display: flex; min-height: calc(100vh - 340px); min-height: calc(100dvh - 340px); flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.welcome-logo { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px; border: 1px solid var(--line-strong); border-radius: 15px; background: linear-gradient(145deg,#353535,#272727); box-shadow: 0 16px 42px #0003; color: #efefff; font-size: 13px; font-weight: 900; }
.welcome-state h1 { margin: 0; color: #f4f4f4; font-size: clamp(25px,4vw,32px); font-weight: 620; letter-spacing: -.035em; }
.welcome-state p { max-width: 530px; margin: 13px auto 0; color: #969696; font-size: 13px; line-height: 1.7; }
.conversation-date { display: flex; align-items: center; gap: 14px; margin: 6px 0 30px; color: #737373; font-size: 10px; }
.conversation-date::before, .conversation-date::after { content: ""; height: 1px; flex: 1; background: rgba(255,255,255,.055); }
.turn { margin-bottom: 42px; scroll-margin-top: 72px; }
.user-row { display: flex; justify-content: flex-end; padding-left: 15%; }
.user-message { max-width: 680px; padding: 13px 17px 12px; border-radius: 20px 20px 5px 20px; background: var(--surface); box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.message-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.message-chip { padding: 3px 7px; border-radius: 99px; background: rgba(255,255,255,.065); color: #a9a9a9; font-size: 9px; font-weight: 650; letter-spacing: .025em; }
.message-chip.mode { color: #c9c9ff; background: rgba(168,168,255,.1); }
.user-prompt { margin: 0; color: #eee; font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.attachment-summary { display: flex; justify-content: flex-end; gap: 5px; margin-top: 9px; color: #8f8f8f; font-size: 10px; }
.attachment-summary svg { width: 13px; height: 13px; }
.assistant-row { display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 13px; margin-top: 22px; }
.assistant-avatar { display: grid; place-items: center; width: 28px; height: 28px; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 9px; background: #2d2d2d; color: #ddddff; font-size: 9px; font-weight: 900; }
.assistant-message { min-width: 0; padding-top: 2px; }
.assistant-heading { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-bottom: 9px; }
.assistant-heading b { color: #efefef; font-size: 12px; }
.assistant-heading time { color: #707070; font-size: 9px; }
.task-status { display: flex; align-items: center; gap: 12px; max-width: 560px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.1); }
.task-status-copy { display: flex; min-width: 0; flex-direction: column; }
.task-status-copy b { color: #dedede; font-size: 12px; }
.task-status-copy small { overflow: hidden; margin-top: 4px; color: #8b8b8b; font-size: 10px; text-overflow: ellipsis; }
.activity-icon { position: relative; display: grid; place-items: center; flex: 0 0 31px; width: 31px; height: 31px; border-radius: 9px; background: rgba(240,180,91,.11); color: var(--warning); }
.activity-icon svg { width: 16px; height: 16px; animation: rotate 1.25s linear infinite; }
.activity-icon.queued svg { animation: none; }
.activity-icon.queued { color: #aaa; background: rgba(255,255,255,.06); }
.activity-icon.failed { color: var(--danger); background: rgba(255,123,123,.1); }
.activity-icon.failed svg { animation: none; }
.activity-dots::after { content: ""; animation: dots 1.5s steps(4,end) infinite; }
.error-detail { max-width: 660px; margin: 9px 0 0; color: #b98d8d; font-size: 10px; line-height: 1.55; word-break: break-word; }
.result-card { max-width: 700px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #171717; box-shadow: 0 20px 50px #0003; }
.result-card video { display: block; width: 100%; max-height: 440px; aspect-ratio: 16/9; background: #090909; object-fit: contain; }
.preview-video { position: relative; display: grid; width: 100%; aspect-ratio: 16/9; place-items: center; overflow: hidden; background: radial-gradient(circle at 65% 35%,rgba(173,139,255,.28),transparent 24%),radial-gradient(circle at 30% 70%,rgba(68,104,154,.3),transparent 32%),linear-gradient(145deg,#15171d,#08090c); }
.preview-video::before { content: ""; position: absolute; inset: 13%; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; box-shadow: 0 0 70px rgba(143,143,255,.13); }
.preview-video span { position: relative; z-index: 1; display: grid; width: 56px; height: 56px; place-items: center; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(255,255,255,.055); color: #d9d9ff; font-size: 14px; font-weight: 900; backdrop-filter: blur(14px); }
.preview-video small { position: absolute; z-index: 1; bottom: 16px; color: rgba(255,255,255,.35); font-size: 9px; letter-spacing: .08em; }
.result-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 11px 13px; }
.result-meta { min-width: 0; }
.result-meta b { display: block; color: #dadada; font-size: 11px; }
.result-meta small { display: block; overflow: hidden; margin-top: 3px; color: #777; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.result-actions { display: flex; gap: 6px; }
.result-link { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: #cfcfcf; text-decoration: none; font-size: 10px; transition: background .15s ease; }
.result-link:hover { background: #303030; }
.result-link svg { width: 14px; height: 14px; }

.composer-zone { position: absolute; z-index: 15; right: 0; bottom: 0; left: 0; padding: 45px 18px max(14px,env(safe-area-inset-bottom)); background: linear-gradient(0deg,var(--canvas) 0%,var(--canvas) 72%,rgba(33,33,33,0) 100%); pointer-events: none; }
.composer-zone > * { pointer-events: auto; }
.composer, .form-message, .composer-note { width: min(var(--content-width),100%); margin-right: auto; margin-left: auto; }
.composer { border: 1px solid rgba(255,255,255,.13); border-radius: 23px; background: var(--surface); box-shadow: 0 14px 40px #0005; transition: border-color .18s ease,box-shadow .18s ease; }
.composer:focus-within { border-color: rgba(255,255,255,.2); box-shadow: 0 16px 45px #0007; }
.parameters-panel { padding: 16px 16px 3px; border-bottom: 1px solid var(--line); animation: panelIn .17s ease-out; }
.parameters-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 13px; }
.parameters-heading > div { display: flex; flex-direction: column; }
.parameters-heading b { color: #e8e8e8; font-size: 12px; }
.parameters-heading small { margin-top: 3px; color: #858585; font-size: 9px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 12px; }
.mode-switch label { position: relative; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch span { display: flex; min-height: 47px; flex-direction: column; justify-content: center; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.1); cursor: pointer; transition: border-color .15s ease,background .15s ease; }
.mode-switch b { color: #ddd; font-size: 10px; }
.mode-switch small { margin-top: 3px; color: #777; font-size: 8px; }
.mode-switch input:checked + span { border-color: rgba(168,168,255,.6); background: var(--accent-soft); }
.mode-switch input:checked + span b { color: #ddddff; }
.parameter-grid { display: grid; grid-template-columns: 2fr 1fr 1.1fr 1fr; gap: 8px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #919191; font-size: 9px; }
.field input, .field select { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #242424; color: #d7d7d7; font-size: 10px; }
.field input:focus, .field select:focus { border-color: rgba(168,168,255,.55); }
.field option:disabled { color: #666; }
.upload-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.upload-tile { position: relative; display: flex; align-items: center; gap: 9px; min-height: 50px; padding: 8px 10px; border: 1px dashed rgba(255,255,255,.16); border-radius: 9px; background: rgba(0,0,0,.09); cursor: pointer; }
.upload-tile:hover { border-color: rgba(168,168,255,.5); background: var(--accent-soft); }
.upload-tile.wide { grid-column: 1/-1; }
.upload-tile input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-tile svg { flex: 0 0 17px; width: 17px; height: 17px; color: #999; }
.upload-tile > span { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.upload-tile b { color: #cfcfcf; font-size: 9px; }
.upload-tile small { margin-top: 2px; color: #727272; font-size: 8px; }
.upload-tile em { overflow: hidden; max-width: 160px; color: #8a8a8a; font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.prompt-box { padding: 12px 12px 10px; }
.prompt-box textarea { display: block; width: 100%; max-height: 170px; min-height: 28px; padding: 1px 5px 4px; resize: none; overflow-y: auto; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; line-height: 1.6; scrollbar-width: none; }
.prompt-box textarea::-webkit-scrollbar { display: none; }
.prompt-box textarea::placeholder { color: #868686; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.composer-tools { display: flex; min-width: 0; align-items: center; gap: 5px; }
.tool-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: #a5a5a5; cursor: pointer; font-size: 9px; }
.tool-button:hover, .tool-button.active { background: rgba(255,255,255,.075); color: #e2e2e2; }
.tool-button > svg { width: 17px; height: 17px; }
.parameter-button { max-width: min(52vw,280px); }
.parameter-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-button { display: grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: #f1f1f1; color: #202020; cursor: pointer; transition: transform .15s ease,opacity .15s ease; }
.send-button:hover { transform: scale(1.04); }
.send-button:disabled { cursor: not-allowed; opacity: .3; transform: none; }
.send-button svg { width: 17px; height: 17px; stroke-width: 2.2; }
.form-message { margin-bottom: 8px; padding: 9px 12px; border: 1px solid rgba(168,168,255,.2); border-radius: 10px; background: rgba(26,26,32,.96); color: #c8c8ff; box-shadow: 0 8px 24px #0005; font-size: 10px; }
.form-message.error { border-color: rgba(255,123,123,.24); color: #ffb0b0; }
.composer-note { margin-top: 7px; margin-bottom: 0; color: #737373; text-align: center; font-size: 8px; }

.login-body { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; padding: 28px; overflow: auto; background: #0d0d0d; color: var(--text); }
.login-shell { display: grid; grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr); width: min(980px,100%); min-height: 610px; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: #181818; box-shadow: 0 35px 90px #0009; }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 42px; overflow: hidden; background: radial-gradient(circle at 80% 10%,rgba(143,143,255,.3),transparent 28%),radial-gradient(circle at 20% 85%,rgba(104,78,190,.23),transparent 35%),linear-gradient(145deg,#252333,#15151a 70%); }
.login-intro::after { content: ""; position: absolute; right: -120px; bottom: -170px; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.018),0 0 0 140px rgba(255,255,255,.012); }
.login-brand, .mobile-login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; font-size: 14px; }
.login-intro > div { position: relative; z-index: 1; }
.login-kicker { margin: 0 0 14px; color: #a9a0dc; font-size: 9px; font-weight: 750; letter-spacing: .17em; }
.login-intro h1 { margin: 0; color: #f5f4ff; font-size: clamp(35px,4vw,52px); font-weight: 580; letter-spacing: -.055em; line-height: 1.08; }
.login-intro h1 + p { max-width: 490px; margin: 20px 0 0; color: #aaa7b9; font-size: 12px; line-height: 1.8; }
.login-capabilities { display: flex; flex-wrap: wrap; gap: 7px; }
.login-capabilities span { padding: 6px 9px; border: 1px solid rgba(255,255,255,.12); border-radius: 99px; background: rgba(0,0,0,.12); color: #aaa5bc; font-size: 8px; font-weight: 650; }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: 54px 50px; background: #181818; }
.mobile-login-brand { display: none; margin-bottom: 42px; }
.login-copy h2 { margin: 0; color: #f3f3f3; font-size: 27px; font-weight: 620; letter-spacing: -.035em; }
.login-copy p { margin: 8px 0 0; color: #858585; font-size: 11px; }
.login-error { margin-top: 20px; padding: 10px 12px; border: 1px solid rgba(255,123,123,.22); border-radius: 9px; background: rgba(255,123,123,.08); color: #ffaaaa; font-size: 10px; }
.login-form { display: grid; gap: 15px; margin-top: 30px; }
.login-form label { display: flex; flex-direction: column; gap: 7px; color: #aaa; font-size: 10px; font-weight: 600; }
.login-form input { width: 100%; height: 44px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #232323; color: #eee; font-size: 12px; }
.login-form input:focus { border-color: rgba(168,168,255,.6); box-shadow: 0 0 0 3px rgba(168,168,255,.08); }
.login-form button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin-top: 4px; border: 0; border-radius: 9px; background: #efefef; color: #1b1b1b; cursor: pointer; font-size: 11px; font-weight: 700; transition: background .15s ease,transform .15s ease; }
.login-form button:hover { background: #fff; transform: translateY(-1px); }
.login-form button svg { width: 15px; height: 15px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 23px 0 0; color: #656565; font-size: 8px; }
.login-security span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes panelIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%,100% { content: "..."; } }

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(var(--sidebar-width),86vw); transform: translateX(-105%); box-shadow: 20px 0 60px #0008; transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .menu-button { visibility: visible; }
  .chat-main { height: 100vh; height: 100dvh; }
  .conversation-inner { width: min(var(--content-width),calc(100% - 28px)); }
  .composer-zone { padding-right: 12px; padding-left: 12px; }
  .parameter-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; }
}

@media (max-width: 640px) {
  .chat-header { grid-template-columns: 38px minmax(0,1fr) 38px; padding-right: 8px; padding-left: 8px; }
  .header-title > span { display: none; }
  .conversation-inner { width: calc(100% - 22px); padding-top: 74px; padding-bottom: 225px; }
  .welcome-state { min-height: calc(100dvh - 310px); }
  .welcome-state p { max-width: 330px; font-size: 11px; }
  .turn { margin-bottom: 34px; }
  .user-row { padding-left: 8%; }
  .user-message { padding: 11px 14px; border-radius: 17px 17px 5px 17px; }
  .user-prompt { font-size: 12px; }
  .assistant-row { grid-template-columns: 27px minmax(0,1fr); gap: 10px; }
  .assistant-avatar { width: 26px; height: 26px; }
  .result-card video { max-height: 300px; }
  .result-footer { align-items: flex-start; flex-direction: column; }
  .composer-zone { padding-top: 35px; padding-bottom: max(9px,env(safe-area-inset-bottom)); }
  .composer { border-radius: 19px; }
  .parameters-panel { max-height: min(57vh,450px); overflow-y: auto; }
  .parameter-grid { grid-template-columns: 1fr 1fr; }
  .mode-switch { grid-template-columns: 1fr 1fr; }
  .upload-fields { grid-template-columns: 1fr; }
  .upload-tile.wide { grid-column: 1; }
  .parameter-button { max-width: 55vw; }
  .composer-note { display: none; }
  .prompt-box textarea { font-size: 16px; }
  .login-body { padding: 0; }
  .login-shell { display: block; width: 100%; min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; }
  .login-intro { display: none; }
  .login-panel { min-height: 100vh; min-height: 100dvh; padding: 34px 25px; }
  .mobile-login-brand { display: flex; }
}

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