:root {
  color-scheme: light dark;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-2: #eef3f5;
  --text: #17202a;
  --muted: #667586;
  --line: #cdd6dd;
  --accent: #146c5c;
  --accent-hover: #0f5d4f;
  --secondary: #345f86;
  --danger: #a43f46;
  --warning: #8a6814;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.chat-page.image-viewer-active {
  overflow: hidden;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0 22px;
}

.top-actions,
.form-row,
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 28px;
  font-weight: 720;
}

h2 {
  font-size: 18px;
  font-weight: 720;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.panel,
.auth-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel {
  padding: 16px;
}

.auth-panel {
  width: min(460px, 100%);
  margin: 36px auto 0;
}

.auth-form {
  display: grid;
  gap: 14px;
  border: 0;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tabs button {
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
}

.tabs button.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.tabs button:hover,
.tabs button.active:hover {
  background: var(--accent-hover);
  color: #ffffff;
  border-color: var(--accent-hover);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
}

.image-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.tts-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.stt-workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
}

.controls,
.request,
.settings-grid,
.key-create {
  display: grid;
  align-content: start;
  gap: 14px;
}

.keys-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 11px;
}

textarea {
  min-height: 210px;
  resize: vertical;
  line-height: 1.45;
}

textarea.compact {
  min-height: 120px;
}

.toggle {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--text);
}

.toggle input {
  width: 18px;
  height: 18px;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button.secondary {
  background: var(--secondary);
}

button.danger {
  background: var(--danger);
}

.request {
  min-width: 0;
}

.statusline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
}

.attachment-list {
  display: grid;
  gap: 6px;
}

.attachment-item {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 650;
}

#output {
  min-height: 330px;
  margin: 0;
  padding: 14px;
  background: #0d1117;
  color: #d7dde5;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.image-preview-shell {
  display: grid;
  place-items: center;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
  color: var(--muted);
}

.image-preview-shell img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #ffffff;
}

#imageOutput {
  min-height: 120px;
  margin: 0;
  padding: 14px;
  background: #0d1117;
  color: #d7dde5;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.tts-preview-shell {
  display: grid;
  gap: 10px;
  place-items: center;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 16px;
}

.tts-preview-shell audio {
  width: 100%;
}

.tts-voice-cloner {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.tts-voice-cloner .section-head {
  margin-bottom: 0;
}

.tts-voice-cloner .form-row {
  flex-wrap: wrap;
}

.tts-voice-cloner .form-row button {
  flex: 1 1 84px;
}

.tts-voice-cloner audio {
  width: 100%;
}

.tts-saved-voice-list {
  display: grid;
  gap: 8px;
}

.tts-saved-voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.tts-saved-voice-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tts-saved-voice-details strong,
.tts-saved-voice-details span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tts-saved-voice-details strong {
  color: var(--text);
}

.tts-saved-voice-details span {
  color: var(--muted);
  font-size: 12px;
}

#sttTranscript,
#sttOutput,
#musicSettingsOutput,
#ttsOutput {
  min-height: 120px;
  margin: 0;
  padding: 14px;
  background: #0d1117;
  color: #d7dde5;
  border-radius: 8px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

#sttTranscript {
  white-space: pre-wrap;
}

.settings-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 10px 16px;
}

.model-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px 16px;
}

.music-runner {
  display: grid;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.music-runner h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.runner-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.runner-status-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.runner-status-grid span {
  color: var(--muted);
  font-size: 12px;
}

.runner-status-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.voice-alias-settings {
  display: grid;
  gap: 10px;
}

.voice-alias-settings h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.voice-alias-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 10px 16px;
}

.section-note,
.form-status {
  color: var(--muted);
  font-size: 13px;
}

.secret-box {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.key-rows {
  display: grid;
  gap: 10px;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
}

.key-details {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.key-title-row,
.key-meta,
.endpoint-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.key-title-row,
.endpoint-item {
  justify-content: space-between;
}

.key-preview {
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 700;
}

.status-toggle {
  display: flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}

.status-toggle input {
  width: 16px;
  height: 16px;
}

.permission-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.58);
}

.permission-modal {
  width: min(620px, 100%);
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}

.key-permissions-modal {
  display: grid;
  gap: 14px;
}

.feature-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-permission-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-permission-option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.feature-permission-option span {
  display: grid;
  gap: 4px;
}

.feature-permission-option strong {
  color: var(--text);
  font-size: 14px;
}

.feature-permission-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.key-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.key-field {
  gap: 6px;
}

.key-field span,
.key-secret-field span {
  color: var(--muted);
}

.key-secret-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 650;
}

.key-secret-value {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.4;
}

.key-meta {
  color: var(--muted);
  font-size: 13px;
}

.usage,
.usage-metrics {
  display: grid;
  gap: 10px;
}

.request-log-panel {
  display: grid;
  gap: 14px;
}

.request-log {
  display: grid;
  gap: 10px;
}

.request-log-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f9fbfc;
}

.request-log-row.failed {
  border-left-color: var(--danger);
}

.request-log-row.running {
  border-left-color: #b7791f;
}

.request-log-row.cancelled {
  border-left-color: var(--muted);
}

.request-log-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.request-log-endpoint {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: baseline;
}

.request-log-endpoint strong,
.request-log-endpoint span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.request-log-endpoint span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.request-log-status {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.request-log-row.running .request-log-status {
  background: #fff7e6;
  color: #8a5200;
}

.request-log-row.failed .request-log-status {
  background: #fff1f2;
  color: var(--danger);
}

.request-log-row.cancelled .request-log-status {
  color: var(--muted);
}

.request-log-meta,
.request-log-error {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.request-log-error {
  color: var(--danger);
  overflow-wrap: anywhere;
}

.usage-metrics {
  grid-template-columns: repeat(4, minmax(110px, 1fr));
}

.usage-metric {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
}

.usage-metric strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.1;
}

.usage-metric span,
.endpoint-usage {
  color: var(--muted);
  font-size: 12px;
}

.endpoint-usage summary {
  width: fit-content;
  cursor: pointer;
}

.endpoint-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.endpoint-item {
  padding: 7px 9px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.endpoint-item span:first-child {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.row-actions {
  display: grid;
  gap: 8px;
}

.empty-state {
  padding: 28px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.error {
  color: var(--danger);
}

.warning {
  color: var(--warning);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-page {
  height: 100dvh;
  overflow: hidden;
  background: #f7f9fb;
}

.chat-app-shell,
.chat-login-view,
.chat-view {
  min-height: 100dvh;
}

.chat-login-view {
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.chat-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.administration-link {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.administration-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.chat-view {
  height: 100dvh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: var(--bg);
}

.chat-sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-right: 1px solid #20303d;
  background: #101820;
  color: #f6f8fa;
}

.chat-sidebar h1,
.chat-sidebar p {
  color: inherit;
}

.chat-sidebar p {
  color: #aebdcc;
}

.chat-sidebar-head,
.chat-main-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.chat-sidebar-head {
  padding-bottom: 6px;
}

.chat-sidebar .secondary {
  background: #2c3b49;
}

.chat-sidebar .administration-link {
  color: #c9d7e4;
}

.chat-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
}

.chat-list-item {
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #edf3f8;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-item:hover,
.chat-list-item.active {
  background: #233242;
  border-color: #34495d;
}

.chat-list-empty {
  padding: 12px;
  color: #aebdcc;
  font-size: 13px;
}

.chat-main {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.chat-main-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.messages {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: auto;
  padding: 28px 24px;
}

.chat-empty-state {
  width: min(760px, 100%);
  margin: auto;
  text-align: center;
}

.chat-empty-state h2 {
  font-size: 28px;
}

.chat-message {
  width: min(820px, 100%);
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-self: center;
}

.message-role {
  padding-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.message-content {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message-content > :first-child {
  margin-top: 0;
}

.message-content > :last-child {
  margin-bottom: 0;
}

.message-content p,
.message-content ul,
.message-content ol,
.message-content blockquote,
.message-content pre,
.message-content .markdown-table-wrap {
  margin: 0 0 12px;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 14px 0 8px;
  color: var(--text);
  line-height: 1.25;
}

.message-content h1 {
  font-size: 24px;
}

.message-content h2 {
  font-size: 20px;
}

.message-content h3 {
  font-size: 17px;
}

.message-content ul,
.message-content ol {
  padding-left: 24px;
}

.message-content li + li {
  margin-top: 5px;
}

.message-content blockquote {
  padding: 8px 12px;
  border-left: 4px solid var(--line);
  color: var(--muted);
  background: var(--surface-2);
}

.message-content pre {
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #0d1117;
  color: #d7dde5;
}

.message-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.message-content a {
  color: var(--secondary);
  font-weight: 700;
}

.message-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.message-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0;
}

.message-content input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0 6px 0 0;
  vertical-align: middle;
}

.markdown-table-wrap {
  overflow: auto;
}

.message-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.message-content th,
.message-content td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.message-content th {
  background: var(--surface-2);
  color: var(--text);
}

.chat-message.user .message-content {
  background: var(--surface-2);
}

.composer {
  width: min(860px, calc(100% - 32px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

#composerInput {
  min-height: 46px;
  max-height: 180px;
  padding: 12px;
  border: 0;
  resize: none;
  line-height: 1.45;
}

#composerInput:focus {
  outline: 2px solid rgba(20, 108, 92, 0.28);
  outline-offset: 1px;
}

.chat-status {
  width: min(860px, calc(100% - 32px));
  min-height: 24px;
  margin: 6px auto 12px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .shell {
    width: min(100vw - 20px, 760px);
    padding: 12px 0;
  }

  .topbar,
  .workspace,
  .image-workspace,
  .tts-workspace,
  .stt-workspace,
  .keys-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .settings-list,
  .voice-alias-grid,
  .runner-status-grid,
  .model-settings-grid {
    grid-template-columns: 1fr;
  }

  .key-row,
  .key-fields,
  .feature-permission-grid,
  .usage-metrics {
    grid-template-columns: 1fr;
  }

  .key-title-row,
  .endpoint-item,
  .request-log-main,
  .request-log-endpoint {
    align-items: flex-start;
    flex-direction: column;
  }

  .row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions,
  .section-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  h1 {
    font-size: 24px;
  }
}

@media (max-width: 760px) {
  .chat-view {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .chat-sidebar {
    max-height: 34dvh;
    border-right: 0;
    border-bottom: 1px solid #20303d;
  }

  .chat-main {
    height: auto;
  }

  .chat-main-head,
  .messages {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chat-message {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .message-role {
    padding-top: 0;
  }

  .composer {
    width: calc(100% - 20px);
    grid-template-columns: 1fr;
  }

  .chat-status {
    width: calc(100% - 20px);
  }
}

.chat-page {
  --visual-viewport-height: 100dvh;
  --visual-viewport-offset-top: 0px;
  --keyboard-inset: 0px;
  --chat-sidebar-width: clamp(260px, 17vw, 320px);
  --composer-dock-height: 90px;
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-viewport-height: calc(var(--visual-viewport-height, 100dvh) - var(--app-safe-top) - var(--app-safe-bottom));
  box-sizing: border-box;
  width: 100vw;
  height: var(--visual-viewport-height, 100dvh);
  padding-top: var(--app-safe-top);
  padding-bottom: var(--app-safe-bottom);
  overflow: hidden;
  background: #000000;
  color: #f4f4f4;
  color-scheme: dark;
}

.chat-page :where(button, input, textarea, select) {
  font: inherit;
}

.chat-page :where(button) {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: 500;
  cursor: pointer;
  white-space: normal;
}

.chat-page :where(button:hover) {
  background: transparent;
}

.chat-page :where(button:disabled) {
  cursor: not-allowed;
  opacity: 0.52;
}

.chat-page :where(input, textarea, select) {
  border: 0;
  background: transparent;
  color: inherit;
}

.chat-page :where(input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible) {
  outline: 2px solid #8ecaff;
  outline-offset: 3px;
}

#chatRoot {
  min-height: var(--app-viewport-height);
  height: var(--app-viewport-height);
  overflow: hidden;
}

.chat-loading {
  min-height: var(--app-viewport-height);
  background: #000000;
}

.chat-shell {
  width: 100vw;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-columns: clamp(260px, 17vw, 320px) minmax(0, 1fr);
  background: #000000;
  color: #f4f4f4;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 80;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.mobile-menu-button {
  display: none;
}

.chat-sidebar {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 20px;
  padding: 24px 8px 0;
  border-right: 1px solid #202020;
  background: #050505;
  color: #f4f4f4;
}

.sidebar-head,
.sidebar-action,
.project-item,
.sidebar-account,
.conversation-topbar,
.message-actions,
.chat-login-brand {
  display: flex;
  align-items: center;
}

.sidebar-head {
  justify-content: space-between;
  padding: 0 18px;
}

.sidebar-head h1 {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: 0;
}

.icon-button,
.composer-icon-button,
.send-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #f4f4f4;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.icon-button:hover,
.composer-icon-button:hover {
  background: #262626;
}

.icon-button.subtle {
  width: 30px;
  height: 30px;
  color: #c9c9c9;
}

.sidebar-nav,
.sidebar-section {
  display: grid;
  gap: 8px;
}

.sidebar-action,
.project-item {
  width: 100%;
  min-height: 44px;
  gap: 12px;
  padding: 0 16px;
  border-radius: 12px;
  color: #f1f1f1;
  text-align: left;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.sidebar-action svg,
.project-item svg {
  width: 18px;
  color: #f6f6f6;
}

.sidebar-action:hover,
.sidebar-action.active,
.recent-chat-row:hover,
.recent-chat-row.active {
  background: #303030;
}

.sidebar-action.compact {
  padding-left: 18px;
}

.chat-search {
  display: block;
  padding: 0 2px 6px;
}

.chat-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #2f2f2f;
  border-radius: 14px;
  background: #161616;
  color: #f5f5f5;
}

.chat-search input:focus,
.chat-search input:focus-visible {
  outline: 0;
  box-shadow: none;
  border-color: #3a3a3a;
}

.sidebar-section {
  padding: 0 14px;
}

.sidebar-section h2 {
  margin: 0 0 10px;
  color: #f7f7f7;
  font-size: 18px;
  font-weight: 720;
}

.project-item {
  padding-left: 12px;
}

.project-item svg {
  color: #ff8a2a;
}

.recent-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: stretch;
  overflow: hidden;
  padding-right: 8px;
}

.recent-list {
  min-height: 0;
  display: grid;
  align-self: stretch;
  align-content: start;
  gap: 2px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 8px;
}

.recent-chat-row {
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  border-radius: 12px;
  transition: background 180ms ease;
}

.recent-chat {
  min-width: 0;
  min-height: 40px;
  display: block;
  padding: 0 10px 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #eeeeee;
  font-size: 16px;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.recent-chat:hover,
.recent-chat:focus-visible {
  background: transparent;
}

.chat-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.recent-chat-row:hover .chat-row-actions,
.recent-chat-row.active .chat-row-actions,
.chat-row-actions:focus-within {
  opacity: 1;
}

.chat-row-action {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #cfcfcf;
}

.chat-row-action:hover {
  background: #454545;
  color: #ffffff;
}

.chat-row-action.danger:hover {
  background: rgba(239, 68, 68, 0.16);
  color: #ffb4b4;
}

.chat-list-empty {
  margin: 0;
  padding: 10px 8px;
  color: #9c9c9c;
}

.sidebar-account {
  min-height: 82px;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #202020;
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #cb4b3b;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.account-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.account-text strong,
.account-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-text strong {
  color: #f7f7f7;
  font-size: 15px;
  font-weight: 620;
}

.account-text span {
  color: #a6a6a6;
  font-size: 14px;
}

.conversation {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  position: relative;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  background: #000000;
  color: #f4f4f4;
}

.chat-drop-hint {
  position: absolute;
  inset: 64px 18px 104px;
  z-index: 35;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: drop-hint-in 140ms ease-out both;
}

.chat-drop-hint::before {
  position: absolute;
  inset: 0;
  border: 1px dashed #8ecaff;
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.74);
  backdrop-filter: blur(4px);
  content: "";
}

.chat-drop-hint-inner {
  position: relative;
  z-index: 1;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  background: #f4f4f4;
  color: #050505;
  font-size: 15px;
  font-weight: 720;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

@keyframes drop-hint-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.conversation-topbar {
  min-width: 0;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
}

.topbar-spacer {
  flex: 1;
}

.text-icon-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 999px;
  color: #f5f5f5;
  font-size: 16px;
  transition: background 180ms ease;
}

.text-icon-button:hover {
  background: #222222;
}

.conversation-scroll {
  min-height: 0;
  overflow: auto;
  overflow-anchor: none;
  scroll-behavior: auto;
}

.message-list {
  width: min(900px, calc(100% - 64px));
  display: grid;
  align-content: start;
  gap: 34px;
  margin: 0 auto;
  padding: 16px 0px;
}

.message-row {
  min-width: 0;
  align-self: start;
}

.older-messages-loading {
  justify-self: center;
  padding: 7px 12px;
  border: 1px solid #2f2f2f;
  border-radius: 999px;
  background: #151515;
  color: #bdbdbd;
  font-size: 12px;
  font-weight: 650;
}

.user-message {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.user-message-stack {
  max-width: min(520px, 70%);
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 6px;
}

.user-bubble {
  max-width: 100%;
  align-self: start;
  justify-self: end;
  padding: 12px 20px;
  border-radius: 24px;
  background: #f4f4f4;
  color: #111111;
  font-size: 16px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.user-message-status {
  padding-right: 12px;
  color: #8f8f8f;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.message-attachment-list {
  max-width: 100%;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.message-attachment-card {
  max-width: min(320px, 100%);
  min-height: 50px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #151515;
  color: #ededed;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.message-attachment-card.image {
  width: min(320px, 100%);
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: stretch;
}

.message-attachment-card:hover,
.message-attachment-card:focus-visible {
  border-color: #505050;
  background: #1d1d1d;
  outline: 0;
}

.message-attachment-preview {
  width: 86px;
  height: 64px;
  display: block;
  border-radius: 7px;
  object-fit: cover;
  background: #f5f5f5;
}

.message-attachment-preview-fallback {
  width: 86px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #242424;
  color: #dcecff;
}

.message-attachment-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #242424;
  color: #dcecff;
  font-size: 17px;
}

.message-attachment-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}

.message-attachment-copy strong,
.message-attachment-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-copy strong {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 650;
}

.message-attachment-copy small {
  color: #a8a8a8;
  font-size: 12px;
}

.assistant-message {
  width: min(720px, 100%);
}

.message-content {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ededed;
  font-size: 16px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.message-content > :first-child {
  margin-top: 0;
}

.message-content > :last-child {
  margin-bottom: 0;
}

.message-content p,
.message-content ul,
.message-content ol,
.message-content blockquote,
.message-content pre,
.message-content table {
  margin: 0 0 14px;
}

.message-content p,
.message-content li,
.message-content td {
  color: #ededed;
}

.message-content strong {
  color: #f7f7f7;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
  margin: 20px 0 10px;
  color: #f7f7f7;
  line-height: 1.22;
}

.message-content h1 {
  font-size: 26px;
}

.message-content h2 {
  font-size: 22px;
}

.message-content h3 {
  font-size: 19px;
}

.message-content ul,
.message-content ol {
  padding-left: 24px;
}

.message-content li + li {
  margin-top: 6px;
}

.message-content blockquote {
  padding: 10px 16px;
  border-left: 4px solid #5a5a5a;
  color: #d0d0d0;
  background: #111111;
}

.message-content pre {
  overflow: auto;
  padding: 12px;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  background: #0d1117;
  color: #d7dde5;
  font-size: 15px;
}

.message-content code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #202020;
  color: #f2f2f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.message-content pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.message-content a {
  color: #8ecaff;
  font-weight: 650;
}

.message-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.message-content hr {
  border: 0;
  border-top: 1px solid #303030;
  margin: 22px 0;
}

.message-content table {
  width: 100%;
  display: block;
  overflow: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.message-content th,
.message-content td {
  padding: 8px 10px;
  border: 1px solid #303030;
  vertical-align: top;
}

.message-content th {
  background: #171717;
  color: #f7f7f7;
}

.message-content input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  vertical-align: middle;
}

.source-card-list {
  margin-top: 16px;
}

.workspace-file-card-list {
  margin-top: 16px;
}

.workspace-file-card-list h3 {
  margin: 0 0 8px;
  color: #b8b8b8;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-transform: uppercase;
}

.workspace-file-cards {
  display: grid;
  gap: 8px;
}

.workspace-file-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #151515;
}

.workspace-file-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #242424;
  color: #dcecff;
  font-size: 18px;
}

.workspace-file-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-file-copy strong,
.workspace-file-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-file-copy strong {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 650;
}

.workspace-file-copy small {
  color: #a8a8a8;
  font-size: 12px;
}

.workspace-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-file-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #202020;
  color: #ededed;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 160ms ease, background 160ms ease;
}

.workspace-file-action:hover {
  border-color: #505050;
  background: #2a2a2a;
}

.workspace-file-action.primary {
  border-color: #275178;
  background: #14283a;
  color: #dcecff;
}

.workspace-file-action.primary:hover {
  border-color: #3e78ad;
  background: #19334a;
}

.attachment-preview-backdrop {
  z-index: 125;
}

.attachment-preview-modal {
  width: min(460px, 100%);
}

.attachment-preview-modal-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.attachment-preview-modal-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #242424;
  color: #dcecff;
  font-size: 20px;
}

.pdf-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 140;
  min-height: 100dvh;
  background: #080808;
}

.pdf-preview-modal {
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: 54px minmax(0, 1fr);
  background: #080808;
  color: #f4f4f4;
}

.pdf-preview-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 8px 18px;
  border-bottom: 1px solid #2a2a2a;
  background: #111111;
}

.pdf-preview-title {
  min-width: 0;
  overflow: hidden;
  color: #f4f4f4;
  font-size: 15px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-preview-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pdf-preview-action,
.pdf-preview-close {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #343434;
  border-radius: 8px;
  background: #202020;
  color: #f4f4f4;
  text-decoration: none;
}

.pdf-preview-action {
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 650;
}

.pdf-preview-close {
  width: 38px;
  padding: 0;
  font-size: 17px;
}

.pdf-preview-action:hover,
.pdf-preview-close:hover {
  border-color: #505050;
  background: #2a2a2a;
}

.pdf-preview-frame {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #111111;
}

.pdf-preview-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: #111111;
  color: #d8d8d8;
  font-size: 15px;
  font-weight: 650;
}

.pdf-preview-state svg {
  color: #dcecff;
  font-size: 24px;
}

.source-card-list h3 {
  margin: 0 0 8px;
  color: #b8b8b8;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-transform: uppercase;
}

.source-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.source-card {
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #151515;
  color: #ededed;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.source-card:hover {
  border-color: #4b4b4b;
  background: #1d1d1d;
}

.source-thumbnail {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #242424;
  overflow: hidden;
}

.source-thumbnail img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.source-card-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.source-title,
.source-domain {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-title {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 650;
}

.source-domain {
  color: #a8a8a8;
  font-size: 12px;
}

.message-actions {
  gap: 8px;
  margin-top: 14px;
}

.empty .conversation-scroll {
  display: grid;
  place-items: center;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.empty-chat-panel {
  width: min(900px, calc(100% - 64px));
  margin: 0 auto;
  text-align: center;
  display: grid;
  place-items: center;
  pointer-events: none;
  transform: translateY(-78px);
}

.futuristic-mark {
  position: relative;
  width: clamp(96px, 10vw, 132px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.35));
  animation: futuristic-mark-float 5.4s ease-in-out infinite;
}

.futuristic-mark-aura {
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 48%, rgba(240, 253, 250, 0.22), transparent 24%),
    radial-gradient(circle, rgba(20, 184, 166, 0.22), transparent 54%),
    radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 72%);
  filter: blur(12px);
  opacity: 0.8;
  animation: futuristic-aura-pulse 3.8s ease-in-out infinite;
}

.futuristic-mark-frame,
.futuristic-mark-core,
.futuristic-mark-line {
  position: absolute;
  box-sizing: border-box;
}

.futuristic-mark-frame {
  width: 58%;
  aspect-ratio: 1;
  border: 1px solid rgba(165, 243, 252, 0.78);
  box-shadow:
    inset 0 0 14px rgba(45, 212, 191, 0.24),
    0 0 18px rgba(59, 130, 246, 0.28);
}

.futuristic-mark-frame::before,
.futuristic-mark-frame::after {
  content: "";
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  border: 1px solid rgba(45, 212, 191, 0.74);
}

.futuristic-mark-frame::before {
  top: -1px;
  left: -1px;
  border-right: 0;
  border-bottom: 0;
}

.futuristic-mark-frame::after {
  right: -1px;
  bottom: -1px;
  border-top: 0;
  border-left: 0;
}

.frame-one {
  transform: rotate(45deg);
  animation: futuristic-frame-one 6.6s linear infinite;
}

.frame-two {
  width: 46%;
  border-color: rgba(147, 197, 253, 0.72);
  transform: rotate(0deg) translateX(17%);
  animation: futuristic-frame-two 7.4s linear infinite;
}

.frame-three {
  width: 46%;
  border-color: rgba(125, 211, 252, 0.62);
  transform: rotate(90deg) translateX(-17%);
  animation: futuristic-frame-three 7.4s linear infinite;
}

.futuristic-mark-core {
  width: 23%;
  aspect-ratio: 1;
  transform: rotate(45deg);
  background: rgba(240, 253, 250, 0.88);
  box-shadow:
    0 0 16px rgba(240, 253, 250, 0.6),
    0 0 34px rgba(20, 184, 166, 0.44);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  animation: futuristic-core-pulse 2.6s ease-in-out infinite;
}

.futuristic-mark-line {
  width: 72%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(191, 219, 254, 0.72), transparent);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.46);
  transform-origin: 50% 50%;
}

.line-one {
  transform: rotate(0deg);
}

.line-two {
  transform: rotate(90deg);
}

.line-three {
  width: 58%;
  transform: rotate(45deg);
}

.line-four {
  width: 58%;
  transform: rotate(-45deg);
}

.composer-dock {
  width: min(900px, calc(100% - 64px));
  margin: 0 auto;
  padding: 0 0 12px;
}

.composer-dock.empty-mode {
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(50% + 144px);
  bottom: auto;
  width: min(900px, calc(100% - 64px));
  padding: 0;
  transform: translate(-50%, -50%);
}

.chat-composer {
  min-height: 64px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 48px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-radius: 14px;
  background: #242424;
  color: #f4f4f4;
}

.chat-composer textarea {
  width: 100%;
  min-height: 28px;
  max-height: 176px;
  padding: 3px 0;
  overflow: auto;
  resize: none;
  color: #f4f4f4;
  font-size: 18px;
  line-height: 1.42;
}

.chat-composer textarea:focus,
.chat-composer textarea:focus-visible {
  outline: 0;
  box-shadow: none;
}

.chat-composer textarea::placeholder {
  color: #a7a7a7;
  opacity: 1;
}

.composer-mode {
  min-height: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  color: #a9a9a9;
  font-size: 16px;
}

.composer-mode.disabled {
  opacity: 0.52;
}

.composer-mode-trigger {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 999px;
  color: inherit;
  font-size: inherit;
  font-weight: 620;
  white-space: nowrap;
  transition: background 180ms ease, color 180ms ease;
}

.composer-mode-trigger:hover,
.composer-mode.open .composer-mode-trigger {
  background: #303030;
  color: #f5f5f5;
}

.composer-mode.disabled .composer-mode-trigger {
  cursor: not-allowed;
}

.reasoning-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 40;
  width: 174px;
  max-width: calc(100vw - 32px);
  padding: 7px;
  border: 1px solid #333333;
  border-radius: 14px;
  background: #202020;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.reasoning-menu-title {
  padding: 7px 9px 8px;
  color: #a5a5a5;
  font-size: 12px;
  font-weight: 680;
}

.reasoning-menu-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 9px;
  border-radius: 9px;
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 580;
}

.reasoning-menu-option:hover,
.reasoning-menu-option:focus-visible,
.reasoning-menu-option.selected {
  background: #303030;
}

.reasoning-menu-option.selected::after {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #f4f4f4;
  content: "";
}

.thinking-message {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.thinking-spinner {
  flex: 0 0 auto;
  width: 0.95em;
  height: 0.95em;
  animation: thinking-spin 780ms linear infinite;
}

@keyframes thinking-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes futuristic-mark-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes futuristic-aura-pulse {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.94);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.08);
  }
}

@keyframes futuristic-frame-one {
  to {
    transform: rotate(405deg);
  }
}

@keyframes futuristic-frame-two {
  to {
    transform: rotate(-360deg) translateX(17%);
  }
}

@keyframes futuristic-frame-three {
  to {
    transform: rotate(450deg) translateX(-17%);
  }
}

@keyframes futuristic-core-pulse {
  0%,
  100% {
    opacity: 0.74;
    transform: rotate(45deg) scale(0.86);
  }

  50% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-spinner {
    animation: none;
  }

  .futuristic-mark,
  .futuristic-mark-aura,
  .futuristic-mark-frame,
  .futuristic-mark-core {
    animation: none;
  }
}

.send-button {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  overflow: visible;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #f8fafc;
  color: #080808;
  flex: 0 0 auto;
  font-size: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38), 0 0 24px rgba(34, 211, 238, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.send-button::before {
  position: absolute;
  inset: -1px;
  z-index: 0;
  border-radius: inherit;
  background: conic-gradient(from 0deg, #22d3ee 0deg, #f8fafc 80deg, #10b981 156deg, #f8fafc 228deg, #38bdf8 304deg, #22d3ee 360deg);
  content: "";
  opacity: 0.82;
  pointer-events: none;
  animation: send-button-ring 7.5s linear infinite;
}

.send-button::after {
  position: absolute;
  inset: 2px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #ffffff 0%, #e8eef5 54%, #cbd5df 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), inset 0 -10px 16px rgba(15, 23, 42, 0.12);
  content: "";
  pointer-events: none;
}

.send-button svg {
  position: relative;
  z-index: 1;
  width: 1em;
  height: 1em;
  display: block;
}

.send-icon {
  transform: none;
}

.send-button:not(:disabled):hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: #ffffff;
  color: #000000;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42), 0 0 30px rgba(34, 211, 238, 0.24), inset 0 1px 0 rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.send-button:not(:disabled):active {
  background: #edf2f7;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.34), 0 0 18px rgba(34, 211, 238, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transform: translateY(0);
}

.send-button:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.9);
  outline-offset: 3px;
}

.send-button:disabled {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.08);
  background: #111111;
  color: #7c7c7c;
  cursor: not-allowed;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: none;
}

.send-button:disabled::before {
  opacity: 0;
  animation: none;
}

.send-button:disabled::after {
  background: linear-gradient(180deg, #222222 0%, #151515 54%, #0b0b0b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -8px 14px rgba(0, 0, 0, 0.4);
}

.send-button.stop-button {
  border-color: rgba(248, 113, 113, 0.4);
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(127, 29, 29, 0.34), 0 0 24px rgba(239, 68, 68, 0.2);
}

.send-button.stop-button::before {
  background: conic-gradient(from 0deg, #fecaca 0deg, #ef4444 118deg, #7f1d1d 244deg, #fecaca 360deg);
  opacity: 0.72;
}

.send-button.stop-button::after {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 56%, #b91c1c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -10px 16px rgba(127, 29, 29, 0.28);
}

.send-button.stop-button:not(:disabled):hover {
  border-color: rgba(252, 165, 165, 0.52);
  background: #f87171;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(127, 29, 29, 0.42), 0 0 30px rgba(239, 68, 68, 0.28);
}

.send-button.stop-button:not(:disabled):active {
  background: #dc2626;
  box-shadow: 0 9px 20px rgba(127, 29, 29, 0.36), 0 0 18px rgba(239, 68, 68, 0.2);
}

@keyframes send-button-ring {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .send-button::before {
    animation: none;
  }
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.attachment-pill {
  min-height: 34px;
  max-width: min(320px, 100%);
  display: inline-grid;
  align-items: center;
  row-gap: 3px;
  column-gap: 8px;
  padding: 0 8px 0 10px;
  border: 1px solid #383838;
  border-radius: 999px;
  background: #181818;
  color: #e8e8e8;
  font-size: 13px;
}

.attachment-pill.uploading {
  padding-top: 4px;
  padding-bottom: 5px;
  border-color: #4a4a4a;
}

.attachment-pill-main {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.attachment-pill.image {
  min-height: 38px;
  padding-left: 6px;
}

.attachment-pill-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-pill-preview {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 999px;
  background: #f5f5f5;
}

.attachment-pill-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.attachment-pill .file-type-icon {
  flex: 0 0 auto;
  width: 16px;
  color: #dcecff;
}

.attachment-pill button {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #bdbdbd;
}

.attachment-pill button:hover {
  background: #303030;
  color: #ffffff;
}

.attachment-pill-progress {
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #303030;
}

.attachment-pill-progress span {
  width: var(--attachment-upload-progress, 0%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #f5f5f5;
  transition: width 180ms ease;
}

.chat-disclaimer {
  min-height: 24px;
  margin: 0 0 8px;
  color: #a7a7a7;
  font-size: 14px;
  text-align: center;
}

.chat-disclaimer.error {
  color: #ff8f8f;
}

.image-page {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: #000000;
  color: #f4f4f4;
}

.image-page.drop-active {
  position: relative;
}

.image-drop-hint {
  position: absolute;
  inset: 64px 18px 18px;
  z-index: 45;
  display: grid;
  place-items: center;
  pointer-events: none;
  animation: drop-hint-in 140ms ease-out both;
}

.image-drop-hint::before {
  position: absolute;
  inset: 0;
  border: 1px dashed #8ecaff;
  border-radius: 8px;
  background: rgba(8, 8, 8, 0.76);
  backdrop-filter: blur(4px);
  content: "";
}

.image-drop-hint-inner {
  position: relative;
  z-index: 1;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid #3a3a3a;
  border-radius: 999px;
  background: #f4f4f4;
  color: #050505;
  font-size: 15px;
  font-weight: 720;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.image-page-topbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
}

.image-page-title {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.image-page-title h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.image-workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 22px 22px;
  overflow: hidden;
}

.image-settings,
.image-preview-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #090909;
}

.image-settings {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.image-settings-scroll {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
  overflow: auto;
}

.image-settings-footer {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
  border-top: 1px solid #1c1c1c;
  background: #090909;
}

.image-field {
  display: grid;
  gap: 8px;
}

.image-field label,
.image-control-label {
  color: #d6d6d6;
  font-size: 13px;
  font-weight: 680;
}

.image-optional-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-optional-badge {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border: 1px solid rgba(255, 99, 99, 0.36);
  border-radius: 999px;
  background: rgba(255, 69, 69, 0.12);
  color: #ff8f8f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.image-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 11px 12px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #f4f4f4;
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  resize: none;
}

.image-field textarea:focus,
.image-field textarea:focus-visible {
  outline: 0;
  border-color: #5c5c5c;
  box-shadow: 0 0 0 1px #5c5c5c;
}

.image-field textarea::placeholder {
  color: #8f8f8f;
}

.image-control-group {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.image-ratio-control {
  margin-bottom: 8px;
}

.image-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.image-segment,
.image-count,
.image-upload-button {
  min-height: 38px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #ededed;
  font-size: 14px;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.image-segment:hover,
.image-count:hover,
.image-upload-button:hover,
.ratio-option:hover {
  border-color: #4a4a4a;
  background: #1b1b1b;
}

.image-segment.selected,
.image-count.selected {
  border-color: #f4f4f4;
  background: #f4f4f4;
  color: #050505;
}

.ratio-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ratio-option {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #eeeeee;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.ratio-option.selected {
  border-color: #f4f4f4;
  background: #202020;
}

.ratio-visual {
  width: 52px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #090909;
}

.ratio-visual span {
  width: var(--ratio-visual-width);
  height: var(--ratio-visual-height);
  aspect-ratio: var(--ratio);
  border: 1px solid #8a8a8a;
  border-radius: 3px;
  background: linear-gradient(135deg, #f0f0f0 0%, #9e9e9e 100%);
}

.ratio-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ratio-copy strong,
.ratio-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ratio-copy strong {
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 720;
}

.ratio-copy small {
  color: #a8a8a8;
  font-size: 12px;
}

.reference-ratio-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reference-ratio-choice {
  min-width: 0;
  min-height: 58px;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #111111;
  color: #eeeeee;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.reference-ratio-choice:hover {
  border-color: #4a4a4a;
  background: #1b1b1b;
}

.reference-ratio-choice.selected {
  border-color: #f4f4f4;
  background: #202020;
}

.reference-ratio-choice span,
.reference-ratio-choice strong,
.reference-ratio-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-ratio-choice span {
  color: #ffb3b3;
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

.reference-ratio-choice strong {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 720;
}

.reference-ratio-choice small {
  color: #a8a8a8;
  font-size: 12px;
}

.image-control-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.image-count-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: stretch;
  gap: 6px;
}

.image-count-control {
  justify-items: stretch;
  text-align: left;
}

.image-count {
  width: 100%;
  height: auto;
}

.image-count-control-scroll {
  display: none;
}

.image-count-control-footer {
  display: grid;
}

.image-upload-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.image-generate-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px;
  border-radius: 8px;
  background: #f4f4f4;
  color: #050505;
  font-size: 15px;
  font-weight: 760;
  transition: background 160ms ease, opacity 160ms ease;
}

.image-generate-button:hover {
  background: #ffffff;
}

.image-generate-button:disabled {
  background: #f4f4f4;
  color: #050505;
  opacity: 0.48;
}

.image-stop-button {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 99, 99, 0.38);
  border-radius: 8px;
  background: rgba(255, 69, 69, 0.1);
  color: #ffb3b3;
  font-size: 13px;
  font-weight: 720;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.image-stop-button:hover {
  border-color: rgba(255, 143, 143, 0.56);
  background: rgba(255, 69, 69, 0.16);
  color: #ffd0d0;
}

.image-reference-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-reference-preview-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
}

.image-reference-preview-media {
  width: 54px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #080808;
  color: #a8a8a8;
}

.image-reference-preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-reference-preview-name {
  min-width: 0;
  overflow: hidden;
  color: #e8e8e8;
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-reference-preview-card button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #bdbdbd;
}

.image-reference-preview-card button:hover {
  background: #303030;
  color: #ffffff;
}

.image-preview-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.image-preview-content {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.image-preview-history-footer {
  display: flex;
  padding: 12px 16px 16px;
  border-top: 1px solid #1c1c1c;
  background: #090909;
}

.image-history-open-button {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 720;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.image-history-open-button-mobile {
  display: none;
}

.image-history-open-button:hover {
  border-color: #4a4a4a;
  background: #1b1b1b;
}

.generated-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.image-progress-grid.two-by-two {
  width: min(100%, 720px);
  max-width: 720px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.generated-image-grid.two-by-two {
  width: min(100%, 720px);
  max-width: 720px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.generated-image-card {
  min-width: 0;
  container-type: inline-size;
  display: grid;
  align-items: center;
  padding: 8px;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #111111;
  animation: generated-image-card-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 220ms ease, transform 220ms ease;
}

.generated-image-preview-button {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  background: #050505;
  cursor: zoom-in;
}

.generated-image-preview-button.loading {
  min-height: 120px;
}

.generated-image-preview-button:focus {
  outline: 0;
}

.generated-image-preview-button:focus:not(:focus-visible) {
  box-shadow: none;
}

.generated-image-preview-button img {
  width: 100%;
  max-height: 68dvh;
  display: block;
  object-fit: contain;
  background: #050505;
  opacity: 0;
  transition: opacity 180ms ease, transform 220ms ease;
}

.generated-image-preview-button img.loaded {
  opacity: 1;
}

.generated-image-preview-button img.loading {
  opacity: 0;
}

.generated-image-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  opacity: 0.7;
  pointer-events: none;
  animation: image-skeleton-spin 820ms linear infinite;
  transition: opacity 180ms ease;
}

.generated-image-loading-spinner.hidden {
  opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .generated-image-card:hover {
    border-color: #3d3d3d;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    transform: translateY(-3px);
  }

  .generated-image-card:hover .generated-image-preview-button img {
    transform: scale(1.018);
  }
}

.generated-image-card.compact {
  padding: 8px;
}

.generated-image-card.removing {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.generated-image-card.compact .generated-image-preview-button.loading {
  min-height: 96px;
}

.generated-image-card.compact .generated-image-preview-button img {
  max-height: 220px;
}

.video-page {
  background: #000000;
}

.video-reference-preview-list {
  grid-template-columns: 1fr;
}

.video-number-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.video-number-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.video-number-field span {
  color: #d6d6d6;
  font-size: 13px;
  font-weight: 680;
}

.video-number-field input {
  width: 100%;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #f4f4f4;
  font-size: 14px;
  font-weight: 650;
}

.video-number-field input:focus,
.video-number-field input:focus-visible {
  outline: 0;
  border-color: #5c5c5c;
  box-shadow: 0 0 0 1px #5c5c5c;
}

.video-number-field input::placeholder {
  color: #8f8f8f;
}

.video-seed-field {
  width: 100%;
}

.video-progress-status {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
}

.video-progress-bar {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #303030;
}

.video-progress-bar span {
  width: var(--video-progress, 0%);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: #f4f4f4;
  transition: width 240ms ease;
}

.video-progress-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.video-progress-copy strong,
.video-progress-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-progress-copy strong {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 720;
}

.video-progress-copy small {
  color: #a8a8a8;
  font-size: 12px;
}

.generated-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.generated-video-grid.two-by-two {
  width: min(100%, 840px);
  max-width: 840px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.generated-video-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #111111;
  animation: generated-image-card-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: border-color 180ms ease, box-shadow 180ms ease, opacity 220ms ease, transform 220ms ease;
}

.generated-video-player {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  background: #050505;
  object-fit: contain;
}

.generated-video-meta {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #a8a8a8;
  font-size: 12px;
}

.generated-video-meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generated-video-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.generated-video-actions a,
.generated-video-actions button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #bdbdbd;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.generated-video-actions a:hover,
.generated-video-actions button:hover {
  background: #303030;
  color: #ffffff;
}

@media (hover: hover) and (pointer: fine) {
  .generated-video-card:hover {
    border-color: #3d3d3d;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
    transform: translateY(-3px);
  }
}

.generated-video-card.compact {
  padding: 8px;
}

.generated-video-card.removing {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.generated-video-card.compact .generated-video-player {
  max-height: 220px;
}

.video-skeleton-preview {
  aspect-ratio: 1 / 1;
}

.image-skeleton-grid {
  align-items: start;
}

.image-skeleton-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #111111;
  animation: skeleton-card-in 180ms ease-out both;
}

.image-skeleton-preview {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #1a1a1a;
}

.image-skeleton-preview::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 45%, transparent 90%);
  animation: image-skeleton-shimmer 1150ms ease-in-out infinite;
  content: "";
  transform: translateX(-100%);
}

.image-skeleton-preview {
  display: grid;
  place-items: center;
  aspect-ratio: var(--image-skeleton-ratio, 1 / 1);
}

.image-skeleton-spinner {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #f2f2f2;
  border-radius: 999px;
  animation: image-skeleton-spin 760ms linear infinite;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.08);
}

@keyframes skeleton-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes image-skeleton-shimmer {
  to {
    transform: translateX(100%);
  }
}

@keyframes image-skeleton-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes generated-image-card-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.image-history-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.54);
  animation: history-scrim-in 220ms ease both;
}

.image-history-scrim.closing {
  pointer-events: none;
  animation: history-scrim-out 220ms ease both;
}

.image-history-scrim:hover,
.image-history-scrim:focus-visible {
  background: rgba(0, 0, 0, 0.54);
}

.image-history-panel {
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 75;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #2e2e2e;
  border-radius: 8px;
  background: #090909;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
  animation: history-panel-in 220ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-history-panel.closing {
  pointer-events: none;
  animation: history-panel-out 180ms cubic-bezier(0.7, 0, 0.84, 0) both;
}

.image-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-history-head h3,
.image-history-head p {
  margin: 0;
}

.image-history-head h3 {
  color: #f5f5f5;
  font-size: 17px;
  line-height: 1.2;
}

.image-history-head p {
  color: #a8a8a8;
  font-size: 12px;
}

.image-history-body {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.image-history-grid {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.image-history-loading,
.image-history-error {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #a8a8a8;
  font-size: 13px;
  font-weight: 680;
  text-align: center;
}

.image-history-error {
  flex-direction: column;
  color: #ffb4b4;
}

.image-history-error button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #151515;
  color: #f2f2f2;
  font-size: 13px;
  font-weight: 720;
}

.image-history-sentinel {
  height: 1px;
}

.image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.92);
  color: #f4f4f4;
}

.image-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  background: rgba(18, 18, 18, 0.88);
  backdrop-filter: blur(10px);
}

.image-viewer-toolbar {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 12px 64px 12px 12px;
  border-bottom: 1px solid #222222;
  background: rgba(8, 8, 8, 0.94);
}

.image-viewer-title {
  min-width: 0;
  display: grid;
  gap: 2px;
  flex: 1;
}

.image-viewer-title strong,
.image-viewer-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-title strong {
  color: #f4f4f4;
  font-size: 14px;
}

.image-viewer-title span {
  color: #a8a8a8;
  font-size: 12px;
}

.image-viewer-actions {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.image-viewer-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #151515;
  color: #f2f2f2;
  font-size: 12px;
  font-weight: 720;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.image-viewer-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-action:hover {
  border-color: #4a4a4a;
  background: #222222;
}

.image-viewer-action.danger {
  border-color: rgba(255, 99, 99, 0.34);
  background: #151515;
  color: #ffb3b3;
}

.image-viewer-action.danger:hover {
  border-color: rgba(255, 143, 143, 0.54);
  background: rgba(255, 69, 69, 0.14);
}

.image-viewer-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  max-width: min(420px, calc(100vw - 28px));
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.94);
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 720;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  animation: image-viewer-toast-in 160ms ease-out both;
}

.image-viewer-toast.warning {
  border-color: rgba(255, 183, 77, 0.48);
  color: #ffd89a;
}

.image-generation-toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  max-width: min(420px, calc(100vw - 28px));
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid rgba(255, 99, 99, 0.42);
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.94);
  color: #ffb3b3;
  font-size: 13px;
  font-weight: 720;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  animation: image-viewer-toast-in 160ms ease-out both;
}

.chat-copy-toast {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 28px));
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  background: rgba(18, 18, 18, 0.94);
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 720;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  animation: image-viewer-toast-in 160ms ease-out both;
}

@keyframes image-viewer-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.image-viewer-stage {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
  container-type: size;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.image-viewer-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  opacity: 0.7;
  pointer-events: none;
  animation: image-skeleton-spin 820ms linear infinite;
  transition: opacity 180ms ease;
}

.image-viewer-loading-spinner.hidden {
  opacity: 0;
}

.image-viewer-stage:active {
  cursor: grabbing;
}

.image-viewer-stage.sliding .image-viewer-image {
  opacity: 0;
}

.image-viewer-stage.settled .image-viewer-image.loaded {
  opacity: 1;
  transition: none;
}

.image-viewer-slide-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.image-viewer-slide-image {
  max-width: min(94vw, 1280px, 100%);
  max-width: min(94cqw, 1280px, 100%);
  max-height: 100%;
  max-height: 100cqh;
  width: auto;
  height: auto;
  display: block;
  grid-area: 1 / 1;
  object-fit: contain;
  user-select: none;
  will-change: transform, opacity;
}

.image-viewer-slide-layer.next .image-viewer-slide-image.outgoing {
  animation: image-viewer-slide-out-left 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-viewer-slide-layer.next .image-viewer-slide-image.incoming {
  animation: image-viewer-slide-in-right 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-viewer-slide-layer.previous .image-viewer-slide-image.outgoing {
  animation: image-viewer-slide-out-right 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-viewer-slide-layer.previous .image-viewer-slide-image.incoming {
  animation: image-viewer-slide-in-left 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.image-viewer-image {
  max-width: min(94vw, 1280px, 100%);
  max-width: min(94cqw, 1280px, 100%);
  max-height: 100%;
  max-height: 100cqh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  place-self: center;
  transform-origin: center;
  user-select: none;
  pointer-events: none;
  will-change: transform;
  opacity: 0;
  transition: opacity 180ms ease;
}

.image-viewer-image.loaded {
  opacity: 1;
}

.image-viewer-image.loading {
  opacity: 0;
}

@keyframes image-viewer-slide-in-right {
  from {
    opacity: 0.88;
    transform: translateX(100vw) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes image-viewer-slide-out-left {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0.88;
    transform: translateX(-100vw) scale(0.98);
  }
}

@keyframes image-viewer-slide-in-left {
  from {
    opacity: 0.88;
    transform: translateX(-100vw) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes image-viewer-slide-out-right {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0.88;
    transform: translateX(100vw) scale(0.98);
  }
}

.image-viewer-gallery {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  overflow: hidden;
  border-top: 1px solid #222222;
  background: rgba(8, 8, 8, 0.94);
}

.image-viewer-gallery-track {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 2px;
}

.image-viewer-thumb {
  width: 92px;
  min-width: 92px;
  height: 72px;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #151515;
  color: #f2f2f2;
  transition: border-color 160ms ease, background 160ms ease;
}

.image-viewer-thumb:hover {
  border-color: #4a4a4a;
  background: #222222;
}

.image-viewer-thumb.selected {
  border-color: #8ecaff;
}

.image-viewer-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-viewer-thumb.skeleton {
  background: linear-gradient(90deg, #151515 0%, #1d1d1d 48%, #151515 100%);
}

@keyframes history-panel-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes history-panel-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(28px);
  }
}

@keyframes history-scrim-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes history-scrim-out {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.image-empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #8f8f8f;
  text-align: center;
}

.image-empty-state svg {
  width: 30px;
  height: 30px;
}

.image-empty-state h3 {
  margin: 0;
  color: #bcbcbc;
  font-size: 17px;
  font-weight: 680;
}

.chat-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  animation: modal-backdrop-in 180ms ease-out both;
}

.chat-modal-backdrop.closing {
  animation: modal-backdrop-out 160ms ease-in both;
}

.image-delete-modal-backdrop {
  z-index: 130;
}

.chat-modal {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #121212;
  color: #f4f4f4;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: modal-fade-up 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-modal.closing {
  animation: modal-fade-down 160ms cubic-bezier(0.4, 0, 1, 1) both;
}

.image-delete-modal {
  width: min(380px, 100%);
}

.chat-modal-copy {
  display: grid;
  gap: 8px;
}

.chat-modal h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.chat-modal p {
  margin: 0;
}

.chat-modal-copy p {
  color: #b7b7b7;
  font-size: 14px;
  line-height: 1.45;
}

.chat-modal-field {
  display: grid;
  gap: 8px;
  color: #dedede;
  font-size: 14px;
}

.chat-modal-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #050505;
  color: #f5f5f5;
  font-size: 15px;
}

.chat-modal-field input:focus,
.chat-modal-field input:focus-visible {
  outline: 0;
  border-color: #5c5c5c;
  box-shadow: 0 0 0 1px #5c5c5c;
}

.chat-modal-target {
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid #292929;
  border-radius: 8px;
  background: #080808;
  color: #f4f4f4;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-modal-error {
  color: #ff9f9f;
  font-size: 14px;
}

.chat-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.modal-button.secondary {
  border: 1px solid #333333;
  color: #f0f0f0;
}

.modal-button.secondary:hover {
  background: #242424;
}

.modal-button.primary {
  background: #f5f5f5;
  color: #050505;
}

.modal-button.primary:hover {
  background: #d8d8d8;
}

.modal-button.danger {
  background: #ef4444;
  color: #ffffff;
}

.modal-button.danger:hover {
  background: #f05252;
}

.modal-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.notification-permission-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(4px);
  animation: modal-backdrop-in 180ms ease-out both;
}

.notification-permission-dialog {
  width: min(440px, 100%);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #121212;
  color: #f4f4f4;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  animation: modal-fade-up 180ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.notification-permission-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #050505;
  color: #f5f5f5;
}

.notification-permission-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.notification-permission-copy h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.notification-permission-copy p {
  margin: 0;
  color: #b7b7b7;
  font-size: 14px;
  line-height: 1.45;
}

.notification-permission-error {
  color: #ff9f9f !important;
}

.notification-permission-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes modal-backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-backdrop-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modal-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modal-fade-down {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(14px);
  }
}

.chat-login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 48px);
  background: #000000;
  overflow: hidden;
}

.chat-login-card {
  width: min(432px, 100%);
  display: grid;
  gap: 20px;
  padding: clamp(28px, 5vw, 42px);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #0f0f0f;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.44);
  color: #f4f4f4;
  animation: login-card-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.chat-login-card p {
  color: #b7b7b7;
}

.chat-login-brand {
  gap: 16px;
  margin-bottom: 4px;
  animation: login-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) 70ms both;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f4f4f4;
  color: #050505;
  animation: login-mark-in 360ms cubic-bezier(0.16, 1, 0.3, 1) 110ms both;
}

.chat-login-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1;
}

.chat-kicker {
  margin: 0 0 4px;
  color: #8ecaff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chat-login-card label {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  color: #d8d8d8;
  font-size: 14px;
  font-weight: 700;
  animation: login-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) 120ms both;
}

.chat-login-card input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #333333;
  border-radius: 8px;
  background: #050505;
  color: #f4f4f4;
  font-size: 16px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.chat-login-card input:hover {
  border-color: #4a4a4a;
  background: #070707;
}

.chat-login-card input:focus,
.chat-login-card input:focus-visible {
  outline: 0;
  border-color: #8ecaff;
  box-shadow: 0 0 0 3px rgba(142, 202, 255, 0.16);
}

.chat-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  margin-top: 2px;
  border-radius: 8px;
  background: #f4f4f4;
  color: #050505;
  font-weight: 760;
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  animation: login-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) 170ms both;
}

.chat-login-button:hover {
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.chat-login-button:disabled {
  cursor: wait;
  opacity: 0.92;
}

.chat-login-button:disabled:hover {
  background: #f4f4f4;
  box-shadow: none;
  transform: none;
}

.chat-login-button:active {
  transform: translateY(0);
}

.login-button-spinner {
  width: 1em;
  height: 1em;
  animation: thinking-spin 780ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .login-button-spinner {
    animation: none;
  }
}

.chat-login-card .form-status {
  min-height: 18px;
  margin: -6px 0 0;
  color: #a7a7a7;
  font-size: 13px;
  line-height: 1.35;
  animation: login-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) 210ms both;
}

.chat-login-card .form-status.error {
  color: #ff9f9f;
}

.chat-login-card .form-status:empty {
  display: none;
}

.administration-link {
  color: #8ecaff;
}

.desktop-only {
  display: inline-grid;
}

.mobile-only {
  display: none;
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-content-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-mark-in {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-4deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

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

  .image-viewer-slide-image {
    transform: translateX(0) scale(1) !important;
  }
}

@media (max-width: 1100px) {
  .chat-page {
    --chat-sidebar-width: 280px;
  }

  .chat-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .recent-chat,
  .message-content,
  .user-bubble,
  .chat-composer textarea {
    font-size: 16px;
  }

  .composer-dock.empty-mode {
    left: 50%;
    width: calc(100% - 64px);
  }
}

body.chat-page.chat-keyboard-active.visual-keyboard-open {
  height: var(--app-viewport-height);
  overflow: hidden;
}

body.chat-page.chat-keyboard-active.visual-keyboard-open #chatRoot,
body.chat-page.chat-keyboard-active.visual-keyboard-open .chat-shell:not(.images-mode):not(.videos-mode),
body.chat-page.chat-keyboard-active.visual-keyboard-open .conversation {
  height: var(--app-viewport-height);
  max-height: var(--app-viewport-height);
  overflow: hidden;
}

body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
  width: auto;
  position: fixed;
  left: calc(var(--chat-sidebar-width, 0px) + 32px);
  right: 32px;
  top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
  bottom: auto;
  z-index: 42;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  margin: 0;
  padding-bottom: 8px;
  transform: translateY(-100%);
}

body.chat-page.touch-keyboard-device .conversation {
  grid-template-rows: 64px minmax(0, 1fr);
}

body.chat-page.touch-keyboard-device .message-list {
  padding-bottom: calc(var(--composer-dock-height, 160px) + 16px);
}

body.chat-page.touch-keyboard-device.visual-keyboard-open .message-list,
body.chat-page.touch-keyboard-device.chat-keyboard-active .message-list {
  padding-bottom: calc(var(--composer-dock-height, 104px) + 16px);
}

body.chat-page.touch-keyboard-device .composer-dock,
body.chat-page.touch-keyboard-device .composer-dock.empty-mode {
  width: auto;
  position: fixed;
  left: calc(var(--chat-sidebar-width, 0px) + 32px);
  right: 32px;
  top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
  bottom: auto;
  z-index: 42;
  margin: 0;
  padding-bottom: 12px;
  transform: translateY(-100%);
}

body.chat-page.visual-keyboard-open .composer-dock.keyboard-active .chat-disclaimer,
body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active .chat-disclaimer {
  display: none;
}

@media (any-pointer: coarse) {
  body.chat-page.chat-keyboard-active.visual-keyboard-open {
    height: var(--app-viewport-height);
    overflow: hidden;
  }

  body.chat-page.chat-keyboard-active.visual-keyboard-open #chatRoot,
  body.chat-page.chat-keyboard-active.visual-keyboard-open .chat-shell:not(.images-mode):not(.videos-mode),
  body.chat-page.chat-keyboard-active.visual-keyboard-open .conversation {
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: auto;
    position: fixed;
    left: calc(var(--chat-sidebar-width, 0px) + 32px);
    right: 32px;
    top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
    bottom: auto;
    z-index: 42;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    margin: 0;
    padding-bottom: 8px;
    transform: translateY(-100%);
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active .chat-disclaimer,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active .chat-disclaimer {
    display: none;
  }
}

@media (max-width: 920px) {
  body.chat-page.chat-keyboard-active.visual-keyboard-open {
    height: var(--app-viewport-height);
    overflow: hidden;
  }

  body.chat-page.chat-keyboard-active.visual-keyboard-open #chatRoot {
    height: var(--app-viewport-height);
    overflow: hidden;
  }

  body.chat-page.image-workspace-active,
  body.chat-page.video-workspace-active,
  body.chat-page.music-workspace-active,
  body.chat-page.voice-workspace-active {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  body.chat-page.image-workspace-active #chatRoot,
  body.chat-page.video-workspace-active #chatRoot,
  body.chat-page.music-workspace-active #chatRoot,
  body.chat-page.voice-workspace-active #chatRoot,
  .chat-shell.images-mode,
  .chat-shell.videos-mode,
  .chat-shell.music-mode,
  .chat-shell.voice-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell {
    grid-template-columns: 1fr;
  }

  .chat-shell:not(.images-mode):not(.videos-mode) {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    overflow: hidden;
  }

  .chat-shell.videos-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell.music-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell.voice-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .mobile-menu-button {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 45;
    border-radius: 999px;
    background: #161616;
  }

  .chat-sidebar {
    width: min(88vw, 340px);
    height: var(--app-viewport-height);
    max-height: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    overflow: hidden;
    border-right: 1px solid #202020;
    border-bottom: 0;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .chat-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.62);
  }

  .sidebar-backdrop:hover,
  .sidebar-backdrop:focus-visible {
    background: rgba(0, 0, 0, 0.62);
  }

  .sidebar-backdrop:focus-visible {
    outline: 0;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: inline-grid;
  }

  .chat-login-view {
    padding: 18px;
  }

  .chat-login-card {
    width: 100%;
    gap: 18px;
    padding: 24px;
  }

  .chat-login-brand {
    gap: 14px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }

  .chat-login-card h1 {
    font-size: 30px;
  }

  .conversation {
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    grid-template-rows: 68px minmax(0, 1fr) auto;
  }

  .chat-drop-hint {
    inset: 68px 12px 92px;
  }

  .chat-drop-hint-inner {
    max-width: calc(100vw - 48px);
    min-height: 44px;
    padding: 0 13px;
    font-size: 14px;
  }

  .image-page {
    height: auto;
    min-height: var(--app-viewport-height);
    display: block;
    overflow: visible;
  }

  .image-drop-hint {
    position: fixed;
    inset: 62px 12px 18px;
  }

  .image-drop-hint-inner {
    max-width: calc(100vw - 48px);
    min-height: 44px;
    padding: 0 13px;
    font-size: 14px;
  }

  .conversation-topbar {
    padding: 12px;
  }

  .conversation-topbar .text-icon-button {
    width: 44px;
    flex: 0 0 44px;
    justify-content: center;
    padding: 0;
  }

  .conversation-topbar .text-icon-button span {
    display: none;
  }

  .image-page-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    gap: 10px;
    padding: 10px 12px;
    background: #000000;
  }

  .image-page-title h2 {
    font-size: 19px;
  }

  .image-page-actions {
    flex: 0 0 auto;
  }

  .image-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 0 10px 18px;
    overflow: visible;
  }

  .image-settings {
    min-height: auto;
    display: block;
    align-self: start;
    overflow: visible;
  }

  .image-preview-panel {
    min-height: 84px;
    max-height: none;
    align-self: start;
    overflow: visible;
  }

  .image-preview-content {
    overflow: visible;
    padding: 10px;
  }

  .image-preview-history-footer {
    padding: 10px;
  }

  .image-settings-scroll {
    gap: 10px;
    padding: 10px;
    overflow: visible;
  }

  .image-settings-footer {
    position: sticky;
    bottom: 0;
    z-index: 24;
    padding: 10px;
    box-shadow: 0 -18px 32px rgba(0, 0, 0, 0.48);
  }

  .image-history-open-button-mobile {
    display: inline-flex;
    order: 3;
  }

  .image-preview-history-footer {
    display: none;
  }

  .image-preview-panel {
    display: none;
  }

  .image-field {
    gap: 6px;
  }

  .image-field label,
  .image-control-label {
    font-size: 12px;
  }

  .image-field textarea {
    min-height: 68px;
    padding: 9px 10px;
    font-size: 15px;
    line-height: 1.35;
  }

  .image-settings .image-field:first-of-type textarea {
    min-height: 92px;
  }

  .image-settings .image-field:nth-of-type(2) textarea {
    min-height: 58px;
  }

  .image-control-row,
  .video-number-grid,
  .generated-image-grid,
  .generated-video-grid {
    grid-template-columns: 1fr;
  }

  .image-progress-grid.two-by-two,
  .generated-image-grid.two-by-two {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generated-video-grid.two-by-two {
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-segmented {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .image-segment,
  .image-count,
  .image-upload-button {
    min-height: 34px;
    font-size: 12px;
  }

  .image-upload-button {
    min-height: 44px;
  }

  .image-reference-preview-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .image-reference-preview-card {
    grid-template-columns: 48px minmax(0, 1fr) 28px;
    padding: 6px;
  }

  .image-reference-preview-media {
    width: 48px;
    height: 38px;
  }

  .ratio-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .ratio-option {
    width: auto;
    min-width: 0;
    min-height: 58px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
  }

  .ratio-visual {
    width: 40px;
    height: 32px;
    border-radius: 6px;
  }

  .ratio-visual span {
    max-width: none;
    max-height: none;
  }

  .ratio-copy strong {
    font-size: 13px;
  }

  .ratio-copy small {
    display: none;
  }

  .reference-ratio-picker {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .reference-ratio-choice {
    min-height: 52px;
    padding: 8px 9px;
  }

  .image-control-row {
    gap: 10px;
  }

  .image-count-control-scroll {
    display: grid;
  }

  .image-count-control-footer {
    display: none;
  }

  .image-count-options {
    gap: 5px;
  }

  .image-count {
    width: 100%;
    height: auto;
  }

  .image-generate-button {
    order: 2;
    min-height: 42px;
    font-size: 14px;
  }

  .image-stop-button {
    order: 1;
    min-height: 36px;
    font-size: 13px;
  }

  .image-page.generating {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    display: grid;
    grid-template-rows: 54px minmax(0, 1fr);
    overflow: hidden;
  }

  .image-page.generating .image-page-topbar {
    position: static;
  }

  .image-page.generating .image-workbench {
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0;
    padding: 0 10px 10px;
    overflow: hidden;
  }

  .image-page.generating .image-settings {
    order: 2;
    min-height: 0;
    border-width: 0;
    background: #000000;
  }

  .image-page.generating .image-settings-scroll {
    display: none;
  }

  .image-page.generating .image-settings-footer {
    position: static;
    border: 1px solid #242424;
    border-radius: 8px;
  }

  .image-page.generating .image-preview-panel {
    order: 1;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    border-width: 0;
    background: #000000;
    overflow: hidden;
  }

  .image-page.generating .image-preview-content {
    min-height: 0;
    display: grid;
    align-items: center;
    overflow: auto;
  }

  .image-history-panel {
    width: 100vw;
    max-height: none;
    inset: 0;
    border-width: 0;
    border-radius: 0;
  }

  .image-history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .image-viewer-toolbar {
    grid-template-columns: 1fr;
    padding: 12px 10px 10px;
  }

  .image-viewer-title {
    min-width: 0;
    padding-right: 50px;
  }

  .image-viewer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-viewer-action {
    min-width: 0;
  }

  .image-viewer-gallery {
    padding: 8px 10px 10px;
  }

  .image-viewer-thumb {
    width: 76px;
    min-width: 76px;
    height: 60px;
  }

  .image-empty-state {
    min-height: 72px;
    gap: 7px;
  }

  .image-empty-state svg {
    width: 22px;
    height: 22px;
  }

  .image-empty-state h3 {
    font-size: 14px;
  }

  .message-list,
  .empty-chat-panel,
  .composer-dock {
    width: calc(100% - 24px);
  }

  .empty-chat-panel {
    transform: none;
  }

  .empty .conversation-scroll {
    padding-bottom: 176px;
  }

  body.chat-page.visual-keyboard-open .empty .conversation-scroll {
    padding-bottom: 120px;
  }

  .message-list {
    gap: 34px;
    padding-bottom: calc(var(--composer-dock-height, 74px) + 16px);
  }

  body.chat-page.touch-keyboard-device .message-list {
    padding-bottom: calc(var(--composer-dock-height, 74px) + 16px);
  }

  body.chat-page.visual-keyboard-open .message-list {
    padding-bottom: calc(var(--composer-dock-height, 104px) + 16px);
  }

  .recent-chat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .recent-chat-row.active {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chat-row-actions {
    display: none;
    padding-right: 0;
    opacity: 0;
    pointer-events: none;
  }

  .recent-chat-row.active .chat-row-actions {
    display: flex;
    padding-right: 6px;
    opacity: 1;
    pointer-events: auto;
  }

  .assistant-message,
  .user-message-stack,
  .user-bubble {
    max-width: 100%;
  }

  .message-attachment-card,
  .message-attachment-card.image {
    width: min(320px, 100%);
  }

  .source-cards {
    grid-template-columns: 1fr;
  }

  .workspace-file-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .workspace-file-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-file-action {
    min-width: 0;
  }

  .user-bubble {
    padding: 12px 18px;
    border-radius: 24px;
  }

  .futuristic-mark {
    width: clamp(92px, 30vw, 132px);
  }

  .composer-dock.empty-mode {
    position: static;
    width: calc(100% - 24px);
    padding-bottom: 12px;
    transform: none;
  }

  .composer-dock,
  .composer-dock.empty-mode {
    width: auto;
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
    bottom: auto;
    z-index: 42;
    margin: 0;
    padding-bottom: 12px;
    transform: translateY(-100%);
  }

  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode {
    width: auto;
    max-width: calc(100vw - 24px);
    left: 12px;
    right: 12px;
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: auto;
    position: fixed;
    left: 12px;
    right: 12px;
    top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
    bottom: auto;
    z-index: 42;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    margin: 0;
    padding-bottom: 8px;
    transform: translateY(-100%);
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active .chat-disclaimer,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active .chat-disclaimer {
    display: none;
  }

  .chat-composer {
    min-height: 64px;
    grid-template-columns: 38px minmax(0, 1fr) auto 46px;
    gap: 6px;
    padding: 8px 8px 8px 12px;
  }

  .composer-mode {
    min-height: 40px;
    font-size: 13px;
  }

  .composer-mode-trigger {
    min-height: 40px;
    gap: 4px;
    padding: 0 7px;
  }

  .reasoning-menu {
    width: 150px;
  }

  .composer-icon-button,
  .send-button {
    width: 40px;
    height: 40px;
  }

  .chat-composer textarea {
    font-size: 18px;
  }

  .chat-disclaimer {
    font-size: 12px;
  }
}

@media (min-width: 761px) {
  body.chat-page.touch-keyboard-device {
    --app-safe-top: max(env(safe-area-inset-top, 0px), 14px);
    --app-safe-bottom: max(env(safe-area-inset-bottom, 0px), 10px);
    --app-viewport-height: calc(100dvh - var(--app-safe-top) - var(--app-safe-bottom));
    height: 100dvh;
  }

  body.chat-page.touch-keyboard-device .conversation {
    grid-template-rows: 68px minmax(0, 1fr) auto;
  }

  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: min(900px, calc(100% - 64px));
    max-width: none;
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    display: block;
    margin: 0 auto;
    padding-bottom: 12px;
    transform: none;
  }

  body.chat-page.touch-keyboard-device .message-list,
  body.chat-page.touch-keyboard-device.visual-keyboard-open .message-list,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .message-list,
  body.chat-page.visual-keyboard-open .message-list {
    padding-bottom: 24px;
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active .chat-disclaimer,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active .chat-disclaimer {
    display: block;
  }
}

@media (min-width: 761px) and (max-width: 920px) {
  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: calc(100% - 24px);
  }
}

@media (max-width: 420px) {
  .chat-sidebar {
    width: min(92vw, 340px);
  }

  .sidebar-head {
    padding: 0 14px;
  }

  .sidebar-section {
    padding: 0 10px;
  }

  .recent-list {
    padding-right: 4px;
  }

  .conversation-topbar {
    gap: 6px;
    padding: 10px;
  }

  .conversation-topbar .icon-button,
  .conversation-topbar .text-icon-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .message-list,
  .empty-chat-panel {
    width: calc(100% - 20px);
  }

  .message-list {
    gap: 28px;
  }

  .user-bubble {
    padding: 11px 15px;
  }

  .message-content pre {
    font-size: 13px;
  }

  .composer-dock,
  .composer-dock.empty-mode {
    left: 10px;
    right: 10px;
    padding-bottom: 10px;
  }

  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    left: 10px;
    right: 10px;
  }

  .chat-composer {
    min-height: 60px;
    grid-template-columns: 38px minmax(0, 1fr) 40px 42px;
    gap: 5px;
    padding: 8px;
  }

  .composer-mode-trigger {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .composer-mode-trigger span {
    display: none;
  }

  .composer-icon-button,
  .send-button {
    width: 38px;
    height: 38px;
  }

  .attachment-tray {
    gap: 6px;
  }

  .attachment-pill {
    max-width: 100%;
  }
}

body.chat-page .chat-sidebar {
  min-height: 0;
  height: var(--app-viewport-height);
  max-height: none;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

body.chat-page .recent-section {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body.chat-page .recent-list {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body.chat-page .sidebar-account {
  align-self: end;
  position: relative;
  z-index: 1;
  background: #050505;
}

.voice-page {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: linear-gradient(180deg, #030605 0%, #000000 48%, #050505 100%);
  color: #f4f4f4;
  --voice-accent: #43d38b;
  --voice-accent-soft: rgba(67, 211, 139, 0.18);
  --voice-accent-strong: rgba(67, 211, 139, 0.78);
  --voice-secondary: #8ecaff;
  --voice-warning: #f0b35b;
  --voice-danger: #ff7d7d;
}

.voice-topbar {
  justify-content: flex-start;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(16px);
}

.voice-page-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-page-title svg {
  color: var(--voice-accent);
  font-size: 18px;
}

.voice-page-title > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.voice-page-title h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.voice-page-title span {
  min-width: 0;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 440px) minmax(0, 1fr);
  gap: 20px;
  padding: 10px 24px 24px;
  overflow: hidden;
}

.voice-control-panel,
.voice-conversation-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 18, 17, 0.96), rgba(5, 5, 5, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.voice-control-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  overflow: auto;
}

.voice-settings-strip {
  display: grid;
  gap: 12px;
}

.voice-field {
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 720;
}

.voice-select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 720;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.voice-select:hover,
.voice-select:focus {
  border-color: var(--voice-accent-strong);
  background: rgba(67, 211, 139, 0.08);
  box-shadow: 0 0 0 3px rgba(67, 211, 139, 0.12);
}

.voice-client-toggle {
  min-height: 48px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 720;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.voice-client-toggle.active {
  border-color: rgba(67, 211, 139, 0.38);
  background: rgba(67, 211, 139, 0.1);
}

.voice-client-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--voice-accent);
}

.voice-client-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-stage {
  min-width: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 16px;
  padding-top: 2px;
}

.voice-stage-status {
  width: 100%;
  min-height: 42px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(67, 211, 139, 0.2);
  border-radius: 999px;
  background: rgba(67, 211, 139, 0.07);
  color: #dffcea;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.voice-stage-status.error {
  border-color: rgba(255, 125, 125, 0.32);
  background: rgba(255, 125, 125, 0.1);
  color: #ffd0d0;
}

.voice-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--voice-accent);
  box-shadow: 0 0 0 6px rgba(67, 211, 139, 0.12);
  animation: voice-status-pulse 1400ms ease-in-out infinite;
}

.voice-page.error .voice-status-dot {
  background: var(--voice-danger);
  box-shadow: 0 0 0 6px rgba(255, 125, 125, 0.14);
}

.voice-page.thinking .voice-status-dot,
.voice-page.speaking .voice-status-dot {
  background: var(--voice-secondary);
  box-shadow: 0 0 0 6px rgba(142, 202, 255, 0.14);
}

.voice-record-button {
  width: min(264px, 100%);
  aspect-ratio: 1 / 1;
  min-height: 218px;
  justify-self: center;
  position: relative;
  display: block;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease;
}

.voice-record-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.voice-record-button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.voice-orb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 211, 139, 0.42);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 44%, rgba(67, 211, 139, 0.34), rgba(9, 31, 19, 0.92) 58%, rgba(3, 7, 6, 1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 22px 58px rgba(0, 0, 0, 0.42), 0 0 38px rgba(67, 211, 139, 0.12);
  animation: voice-orb-idle 4200ms ease-in-out infinite;
}

.voice-orb-ring {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.voice-orb-ring.outer {
  inset: -8px;
  border: 1px solid rgba(142, 202, 255, 0.7);
  opacity: 0.68;
}

.voice-orb-ring.middle {
  inset: 8px;
  border: 1px solid rgba(67, 211, 139, 0.28);
}

.voice-orb-core {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #07140d;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.voice-orb-core svg {
  font-size: 34px;
}

.voice-record-label {
  position: absolute;
  right: 20px;
  bottom: 44px;
  left: 20px;
  z-index: 1;
  display: block;
  color: #ffffff;
  font-size: 18px;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.voice-page.recording .voice-orb {
  animation: voice-orb-listening 1150ms ease-in-out infinite;
  border-color: rgba(67, 211, 139, 0.8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 64px rgba(0, 0, 0, 0.48), 0 0 54px rgba(67, 211, 139, 0.26);
}

.voice-page.thinking .voice-orb,
.voice-page.speaking .voice-orb {
  border-color: rgba(142, 202, 255, 0.62);
  background: radial-gradient(circle at 50% 44%, rgba(142, 202, 255, 0.28), rgba(10, 30, 45, 0.94) 58%, rgba(3, 6, 8, 1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 22px 58px rgba(0, 0, 0, 0.42), 0 0 38px rgba(142, 202, 255, 0.16);
}

.voice-page.error .voice-orb {
  border-color: rgba(255, 125, 125, 0.56);
  background: radial-gradient(circle at 50% 44%, rgba(255, 125, 125, 0.22), rgba(40, 14, 14, 0.96) 58%, rgba(8, 3, 3, 1) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 22px 58px rgba(0, 0, 0, 0.42), 0 0 38px rgba(255, 125, 125, 0.14);
}

.voice-waveform {
  height: 42px;
  display: grid;
  grid-template-columns: repeat(9, 6px);
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.voice-waveform span {
  width: 6px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--voice-accent), var(--voice-secondary));
  transform: scaleY(var(--voice-bar-scale, 0.34));
  transform-origin: center;
  opacity: 0.82;
  animation: voice-wave 1180ms ease-in-out infinite;
  transition: transform 80ms linear, opacity 80ms linear;
}

.voice-waveform span:nth-child(2),
.voice-waveform span:nth-child(8) {
  animation-delay: 120ms;
}

.voice-waveform span:nth-child(3),
.voice-waveform span:nth-child(7) {
  animation-delay: 240ms;
}

.voice-waveform span:nth-child(4),
.voice-waveform span:nth-child(6) {
  animation-delay: 360ms;
}

.voice-waveform span:nth-child(5) {
  animation-delay: 480ms;
}

.voice-page.idle .voice-waveform span,
.voice-page.ready .voice-waveform span,
.voice-page.error .voice-waveform span {
  animation-play-state: paused;
  opacity: 0.36;
}

.voice-page.thinking .voice-waveform span,
.voice-page.speaking .voice-waveform span {
  background: linear-gradient(180deg, var(--voice-secondary), var(--voice-warning));
}

.voice-page.recording .voice-waveform span {
  animation: none;
  opacity: var(--voice-waveform-opacity, 0.46);
  transform: scaleY(var(--voice-bar-scale, 0.22));
}

.voice-live-card {
  width: 100%;
  min-height: 86px;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.voice-live-card > span {
  color: var(--voice-accent);
  font-size: 11px;
  font-weight: 840;
  line-height: 1.2;
  text-transform: uppercase;
}

.voice-live-card p {
  min-height: 42px;
  max-height: 126px;
  margin: 0;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  overflow: auto;
}

.voice-action-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.voice-action-row:empty {
  display: none;
}

.voice-stop-button {
  width: 100%;
  justify-content: center;
  border-color: rgba(255, 125, 125, 0.24);
  background: rgba(255, 125, 125, 0.1);
  color: #ffffff;
}

.voice-conversation-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  overflow: auto;
}

.voice-conversation-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 9, 9, 0.92);
  backdrop-filter: blur(14px);
}

.voice-conversation-header div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.voice-conversation-header span {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-transform: uppercase;
}

.voice-conversation-header h3 {
  margin: 0;
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 820;
  line-height: 1.2;
}

.voice-conversation-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(142, 202, 255, 0.18);
  border-radius: 999px;
  background: rgba(142, 202, 255, 0.08);
  color: #dcefff;
  white-space: nowrap;
}

.voice-conversation-state svg {
  color: var(--voice-secondary);
}

.voice-turns {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
}

.voice-turn {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  animation: voice-turn-in 260ms ease both;
}

.voice-turn.user {
  border-color: rgba(240, 179, 91, 0.18);
  background: rgba(240, 179, 91, 0.06);
}

.voice-turn.assistant {
  border-color: rgba(67, 211, 139, 0.18);
  background: rgba(67, 211, 139, 0.055);
}

.voice-turn h3 {
  margin: 0;
  color: var(--voice-accent);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
  text-transform: uppercase;
}

.voice-turn.user h3 {
  color: var(--voice-warning);
}

.voice-turn p {
  margin: 0;
  color: #f4f4f4;
  font-size: 18px;
  font-weight: 620;
  line-height: 1.55;
  white-space: pre-wrap;
}

.voice-turn .message-content {
  max-width: 900px;
  color: #f4f4f4;
  font-size: 18px;
  font-weight: 620;
  line-height: 1.6;
}

.voice-spoken-word {
  background: rgba(67, 211, 139, 0.34);
  border-radius: 4px;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(67, 211, 139, 0.18);
}

.voice-audio-player {
  width: 100%;
  margin-top: 2px;
  accent-color: var(--voice-accent);
}

.voice-empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #f4f4f4;
  text-align: center;
  padding: 24px;
}

.voice-empty-state svg {
  width: 76px;
  height: 76px;
  padding: 20px;
  border: 1px solid rgba(67, 211, 139, 0.24);
  border-radius: 999px;
  background: rgba(67, 211, 139, 0.08);
  color: var(--voice-accent);
  font-size: 34px;
  box-sizing: border-box;
}

.voice-empty-state h3 {
  margin: 0;
  color: #f5f5f5;
  font-size: 22px;
}

@keyframes voice-orb-idle {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.018);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes voice-orb-listening {
  0% {
    transform: scale(0.985);
  }

  50% {
    transform: scale(1.045);
  }

  100% {
    transform: scale(0.985);
  }
}

@keyframes voice-wave {
  0% {
    transform: scaleY(0.28);
  }

  50% {
    transform: scaleY(1);
  }

  100% {
    transform: scaleY(0.28);
  }
}

@keyframes voice-status-pulse {
  0% {
    opacity: 0.72;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1.08);
  }

  100% {
    opacity: 0.72;
    transform: scale(0.92);
  }
}

@keyframes voice-turn-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-orb,
  .voice-status-dot,
  .voice-waveform span,
  .voice-turn {
    animation: none;
    transition: none;
  }
}

.music-page {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: #000000;
  color: #f4f4f4;
}

.music-topbar {
  justify-content: flex-start;
}

.music-page-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-page-title svg {
  color: #8ecaff;
}

.music-page-title h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.music-workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 22px 22px;
  overflow: hidden;
}

.music-settings,
.music-results-panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #090909;
}

.music-settings {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px;
  overflow: auto;
}

.music-control-group,
.music-field {
  display: grid;
  gap: 8px;
}

.music-control-label,
.music-field,
.music-toggle {
  color: #d0d0d0;
  font-size: 13px;
  font-weight: 720;
}

.music-segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  background: #111111;
}

.music-segment {
  min-height: 38px;
  border-radius: 6px;
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 720;
}

.music-segment:hover,
.music-segment.selected {
  background: #303030;
  color: #ffffff;
}

.music-field input,
.music-field textarea {
  width: 100%;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #121212;
  color: #f5f5f5;
}

.music-field input {
  min-height: 42px;
  padding: 0 12px;
}

.music-field textarea {
  min-height: 160px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

.music-language-trigger {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #121212;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.music-language-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-language-trigger:hover:not(:disabled) {
  border-color: #4a4a4a;
  background: #171717;
}

.music-language-trigger:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.music-language-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.64);
}

.music-language-modal {
  width: min(520px, 100%);
  max-height: min(680px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #0b0b0b;
  color: #f5f5f5;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

.music-language-modal-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.music-language-modal-head p,
.music-language-modal-head h3 {
  margin: 0;
}

.music-language-modal-head p {
  color: #8ecaff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.music-language-modal-head h3 {
  margin-top: 3px;
  font-size: 20px;
  line-height: 1.2;
}

.music-language-search {
  display: grid;
  gap: 7px;
  color: #d0d0d0;
  font-size: 13px;
  font-weight: 720;
}

.music-language-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #121212;
  color: #f5f5f5;
}

.music-language-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 2px;
}

.music-language-option {
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #121212;
  color: #f5f5f5;
  text-align: left;
}

.music-language-option:hover,
.music-language-option.selected {
  border-color: rgba(142, 202, 255, 0.35);
  background: #1f2a33;
}

.music-language-flag {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 18px;
  line-height: 1;
}

.music-language-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 760;
}

.music-language-option small {
  color: #a9a9a9;
  font-size: 12px;
  font-weight: 720;
}

.music-language-empty {
  margin: 0;
  padding: 16px 8px;
  color: #a9a9a9;
  text-align: center;
}

.music-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.music-toggle input {
  width: 18px;
  height: 18px;
}

.music-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.music-actions .text-icon-button {
  padding: 0 18px;
  background: var(--secondary);
  color: #ffffff;
}

.music-actions .text-icon-button:hover {
  background: #3d6f9c;
}

.music-status {
  min-height: 20px;
  margin: 0;
  color: #a7a7a7;
  font-size: 13px;
}

.music-status.error {
  color: #ff8f8f;
}

.music-polling-status {
  margin: -8px 0 0;
  color: #8ecaff;
  font-size: 13px;
}

.music-results-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
  overflow: hidden;
}

.music-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.music-results-title {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.music-results-head h3,
.music-lyrics-panel h3 {
  margin: 0;
  color: #f5f5f5;
  font-size: 16px;
}

.music-history-view {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.music-result-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
}

.music-result-card {
  min-width: 0;
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  border: 1px solid #2c3036;
  border-radius: 8px;
  background: linear-gradient(135deg, #151719 0%, #101010 54%, #090909 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.music-result-card.generating {
  border-color: rgba(142, 202, 255, 0.42);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(142, 202, 255, 0.08);
}

.music-result-artwork {
  width: 104px;
  aspect-ratio: 1 / 1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #1d1d1d;
  color: #8ecaff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.music-result-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.music-result-artwork-spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.44);
  color: #ffffff;
  font-size: 24px;
}

.music-result-artwork-spinner svg {
  padding: 10px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.44);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.music-result-body {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.music-result-header {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.music-result-heading {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.music-result-heading h3 {
  margin: 0;
  overflow: hidden;
  color: #f5f5f5;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-result-body p {
  margin: 4px 0 0;
  color: #a7a7a7;
  font-size: 13px;
}

.music-result-body .music-result-prompt {
  max-height: 72px;
  margin: 0;
  overflow: hidden;
  color: #d4d4d4;
  line-height: 1.45;
}

.music-audio-native {
  display: none;
}

.music-audio-player {
  --music-audio-progress: 0%;
  --music-audio-volume: 100%;
  width: min(100%, 680px);
  min-width: 0;
  min-height: 46px;
  justify-self: start;
  display: grid;
  grid-template-columns: 38px minmax(38px, auto) minmax(112px, 1fr) minmax(38px, auto) minmax(96px, 124px);
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid #333333;
  border-radius: 24px;
  background: #242424;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.music-audio-player:focus-within {
  border-color: #8ecaff;
  box-shadow: 0 0 0 3px rgba(142, 202, 255, 0.16);
}

.music-audio-play-button,
.music-audio-volume-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-size: 15px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.music-audio-play-button:hover,
.music-audio-volume-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.music-audio-play-button:focus-visible,
.music-audio-volume-button:focus-visible,
.music-audio-scrubber:focus-visible,
.music-audio-volume input:focus-visible {
  outline: 2px solid #8ecaff;
  outline-offset: 3px;
}

.music-audio-time {
  min-width: 38px;
  color: #ffffff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: center;
}

.music-audio-time.total {
  color: rgba(255, 255, 255, 0.72);
}

.music-audio-scrubber,
.music-audio-volume input {
  width: 100%;
  height: 26px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.music-audio-scrubber:disabled {
  cursor: default;
  opacity: 0.55;
}

.music-audio-scrubber::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #ffffff 0%, #ffffff var(--music-audio-progress), rgba(255, 255, 255, 0.28) var(--music-audio-progress), rgba(255, 255, 255, 0.28) 100%);
}

.music-audio-volume input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #8ecaff 0%, #8ecaff var(--music-audio-volume), rgba(255, 255, 255, 0.24) var(--music-audio-volume), rgba(255, 255, 255, 0.24) 100%);
}

.music-audio-scrubber::-webkit-slider-thumb,
.music-audio-volume input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid #242424;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.music-audio-scrubber::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #ffffff 0%, #ffffff var(--music-audio-progress), rgba(255, 255, 255, 0.28) var(--music-audio-progress), rgba(255, 255, 255, 0.28) 100%);
}

.music-audio-volume input::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #8ecaff 0%, #8ecaff var(--music-audio-volume), rgba(255, 255, 255, 0.24) var(--music-audio-volume), rgba(255, 255, 255, 0.24) 100%);
}

.music-audio-scrubber::-moz-range-thumb,
.music-audio-volume input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #242424;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.music-audio-volume {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(58px, 1fr);
  align-items: center;
  gap: 4px;
}

.music-audio-error {
  grid-column: 1 / -1;
  margin: 0;
  color: #ffb4b4;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.music-history-sentinel {
  width: 100%;
  min-height: 1px;
}

.music-lyrics-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.5);
}

.music-lyrics-drawer {
  width: min(460px, 100vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  overflow: auto;
  border-left: 1px solid #2c3036;
  background: #0b0b0b;
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.35);
  animation: musicLyricsDrawerIn 180ms ease-out;
}

.music-lyrics-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.music-lyrics-drawer-head p,
.music-lyrics-drawer-head h3,
.music-lyrics-drawer-head span,
.music-lyrics-drawer-prompt {
  margin: 0;
}

.music-lyrics-drawer-head p {
  color: #8ecaff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.music-lyrics-drawer-head h3 {
  margin-top: 4px;
  color: #f5f5f5;
  font-size: 22px;
  line-height: 1.15;
}

.music-lyrics-drawer-head span {
  display: block;
  margin-top: 6px;
  color: #a7a7a7;
  font-size: 13px;
}

.music-lyrics-drawer-prompt {
  padding: 12px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #111111;
  color: #d4d4d4;
  font-size: 14px;
  line-height: 1.45;
}

.music-lyrics-block {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #050505;
}

.music-lyrics-block-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #1e1e1e;
  background: #101010;
}

.music-lyrics-block-head > span {
  color: #f5f5f5;
  font-size: 13px;
  font-weight: 800;
}

.music-lyrics-block-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.music-lyrics-copy-button,
.music-lyrics-generate-button,
.music-lyrics-regenerate-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(142, 202, 255, 0.28);
  border-radius: 999px;
  background: rgba(45, 75, 102, 0.42);
  color: #d9efff;
  font-size: 13px;
  font-weight: 800;
}

.music-lyrics-generate-button {
  border-color: rgba(120, 255, 174, 0.3);
  background: rgba(37, 112, 74, 0.42);
  color: #d7ffe7;
}

.music-lyrics-regenerate-button {
  border-color: rgba(142, 202, 255, 0.36);
  background: rgba(48, 104, 153, 0.48);
  color: #e2f3ff;
}

.music-lyrics-copy-button:hover,
.music-lyrics-generate-button:hover:not(:disabled),
.music-lyrics-regenerate-button:hover:not(:disabled) {
  background: rgba(67, 116, 159, 0.52);
}

.music-lyrics-generate-button:hover:not(:disabled) {
  background: rgba(48, 136, 90, 0.58);
}

.music-lyrics-regenerate-button:hover:not(:disabled) {
  background: rgba(61, 124, 178, 0.6);
}

.music-lyrics-generate-button:disabled,
.music-lyrics-regenerate-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.music-lyrics-block pre {
  min-height: 0;
  margin: 0;
  padding: 14px;
  overflow: auto;
  background: #050505;
  color: #d8d8d8;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
}

@keyframes musicLyricsDrawerIn {
  from {
    transform: translateX(32px);
  }

  to {
    transform: translateX(0);
  }
}

.music-result-pending {
  padding: 10px;
  border-radius: 8px;
  background: #181818;
}

.music-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.music-result-links a,
.music-lyrics-open-button,
.music-result-download-button,
.music-result-reuse-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #303030;
  border-radius: 999px;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.music-result-links a:hover,
.music-lyrics-open-button:hover,
.music-result-download-button:hover,
.music-result-reuse-button:hover:not(:disabled) {
  background: #242424;
}

.music-result-download-button {
  border-color: rgba(142, 202, 255, 0.32);
  background: rgba(45, 75, 102, 0.34);
  color: #d9efff;
}

.music-result-download-button:hover {
  background: rgba(67, 116, 159, 0.48);
}

.music-result-reuse-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.music-result-delete-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 180, 180, 0.22);
  border-radius: 999px;
  background: rgba(164, 63, 70, 0.24);
  color: #ffd0d0;
  font-size: 14px;
  font-weight: 700;
}

.music-result-delete-button:hover {
  background: rgba(239, 68, 68, 0.16);
}

.music-empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: #f4f4f4;
  text-align: center;
}

.music-empty-state > svg {
  color: #8ecaff;
  font-size: 38px;
}

.music-empty-state h3 {
  margin: 0;
  color: #f5f5f5;
  font-size: 18px;
}

.music-empty-state p {
  max-width: 420px;
  margin: 0;
  color: #a7a7a7;
  font-size: 13px;
  line-height: 1.45;
}

.music-lyrics-panel {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #111111;
}

.music-lyrics-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.music-lyrics-actions h3 {
  margin-right: auto;
}

.music-lyrics-actions .text-icon-button {
  min-height: 32px;
  padding: 0 10px;
  background: var(--secondary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.music-lyrics-actions .text-icon-button:hover {
  background: #3d6f9c;
}

.music-history-actions {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.music-history-state {
  margin: 0;
  color: #a7a7a7;
  font-size: 13px;
}

.music-history-state.error {
  color: #ff8f8f;
}

.music-history-load-more {
  margin-left: auto;
}

.apps-page {
  min-width: 0;
  min-height: 0;
  height: var(--app-viewport-height);
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr);
  background: #000000;
  color: #f4f4f4;
}

.apps-topbar {
  justify-content: flex-start;
}

.apps-page-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.apps-page-title svg {
  color: #8ecaff;
}

.apps-page-title h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.apps-workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 16px;
  padding: 8px 22px 22px;
  overflow: hidden;
}

.apps-list,
.apps-detail {
  min-width: 0;
  min-height: 0;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #090909;
}

.apps-list {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  overflow: auto;
}

.app-list-item {
  min-width: 0;
  min-height: 56px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  color: #f4f4f4;
  text-align: left;
  transition: background 180ms ease;
}

.app-list-item:hover,
.app-list-item.active {
  background: #222222;
}

.app-list-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--app-color, #38bdf8) 20%, #111111);
  color: var(--app-color, #38bdf8);
}

.app-list-item span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-list-item strong,
.app-list-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-list-item strong {
  color: #f6f6f6;
  font-size: 15px;
  font-weight: 720;
}

.app-list-item small {
  color: #a6a6a6;
  font-size: 12px;
  font-weight: 520;
}

.apps-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  gap: 16px;
  padding: 16px;
  overflow: auto;
}

.app-settings {
  min-width: 0;
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.app-field {
  display: grid;
  gap: 8px;
  color: #d6d6d6;
  font-size: 13px;
  font-weight: 680;
}

.app-field-wide {
  grid-column: 1 / -1;
}

.app-choice-group {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  margin: 0;
}

.app-choice-group legend {
  padding: 0;
  color: #d6d6d6;
  font-size: 13px;
  font-weight: 680;
}

.app-choice-grid {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-choice-button,
.app-color-choice {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #141414;
  color: #f4f4f4;
  transition: border-color 160ms ease, background 160ms ease;
}

.app-choice-button:hover,
.app-choice-button.selected,
.app-color-choice:hover,
.app-color-choice.selected {
  border-color: #8ecaff;
  background: #1d1d1d;
}

.app-color-choice {
  position: relative;
}

.app-color-choice::before {
  width: 22px;
  height: 22px;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: var(--app-color);
  content: "";
}

.app-settings input,
.app-settings textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #141414;
  color: #f4f4f4;
  font-size: 15px;
  line-height: 1.45;
}

.app-settings textarea {
  min-height: 104px;
  resize: vertical;
}

.app-settings input:focus,
.app-settings textarea:focus,
.app-settings input:focus-visible,
.app-settings textarea:focus-visible {
  outline: 0;
  border-color: #5c5c5c;
  box-shadow: 0 0 0 1px #5c5c5c;
}

.app-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: #eeeeee;
}

.app-toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #8ecaff;
}

.app-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-settings-actions .text-icon-button {
  border: 1px solid #2a2a2a;
  background: #111111;
}

.app-settings-actions .text-icon-button:hover {
  background: #1d1d1d;
}

.text-icon-button.danger {
  color: #ffb4b4;
}

.app-settings-actions .text-icon-button.danger {
  border-color: rgba(255, 180, 180, 0.22);
  background: rgba(164, 63, 70, 0.38);
  color: #ffd0d0;
}

.text-icon-button.danger:hover {
  background: rgba(239, 68, 68, 0.16);
}

.app-runner {
  min-width: 0;
  width: min(920px, 100%);
  position: relative;
  display: block;
}

.app-runner textarea {
  display: block;
  min-height: 92px;
  max-height: 168px;
  padding: 12px 70px 12px 14px;
  border: 1px solid #303030;
  border-radius: 14px;
  background: #141414;
  color: #f4f4f4;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}

.app-runner .send-button {
  position: absolute;
  right: 10px;
  bottom: 10px;
}

.apps-status {
  margin: 0;
  color: #9ed9ff;
  font-size: 13px;
  font-weight: 650;
}

.apps-status.error {
  color: #ff8f8f;
}

.app-results {
  min-width: 0;
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
}

.app-results.empty {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
}

.app-run-list {
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
}

.app-run-list h3,
.app-schedule-list h3 {
  margin: 0 0 4px;
  color: #f5f5f5;
  font-size: 15px;
  font-weight: 720;
}

.app-run-item {
  min-width: 0;
  min-height: 52px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #111111;
  color: #f4f4f4;
  text-align: left;
}

.app-run-item:hover,
.app-run-item.active {
  border-color: #3a3a3a;
  background: #1d1d1d;
}

.app-run-item small {
  color: #a6a6a6;
  font-size: 12px;
}

.app-run-output {
  min-width: 0;
  min-height: 280px;
  padding: 16px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #050505;
  overflow: auto;
}

.app-run-output h3 {
  margin: 0 0 14px;
  color: #f5f5f5;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.app-schedule-list {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.app-schedule-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #242424;
  border-radius: 8px;
  background: #111111;
}

.app-schedule-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-schedule-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-schedule-row strong {
  color: #9ed9ff;
  font-size: 12px;
  text-transform: uppercase;
}

.app-schedule-row small {
  color: #a6a6a6;
  font-size: 12px;
}

.app-schedule-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.app-schedule-action {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid #2f2f2f;
  border-radius: 999px;
  background: #141414;
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease;
}

.app-schedule-action:hover {
  border-color: #4a4a4a;
  background: #1d1d1d;
}

.app-schedule-action.danger {
  border-color: rgba(255, 180, 180, 0.22);
  background: rgba(164, 63, 70, 0.24);
  color: #ffd0d0;
}

.app-schedule-action.danger:hover {
  background: rgba(239, 68, 68, 0.16);
}

.apps-empty {
  margin: 0;
  color: #a6a6a6;
  font-size: 14px;
}

.apps-empty-state {
  grid-column: 1 / -1;
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: #f4f4f4;
  text-align: center;
}

.apps-empty-state > svg {
  color: #8ecaff;
  font-size: 38px;
}

.apps-empty-state h2 {
  margin: 0;
  color: #f5f5f5;
  font-size: 22px;
}

@media (max-width: 980px) {
  .voice-workbench {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .voice-control-panel {
    overflow: visible;
  }

  .voice-settings-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voice-stage {
    width: min(460px, 100%);
    justify-self: center;
  }

  .voice-conversation-panel {
    min-height: 360px;
    overflow: visible;
  }

  .music-workbench {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .music-results-panel {
    min-height: 360px;
    overflow: visible;
  }

  .apps-workspace {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .apps-list {
    min-height: 82px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .app-list-item {
    width: min(260px, 78vw);
    flex: 0 0 auto;
  }

  .apps-detail {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .app-settings {
    grid-template-columns: 1fr;
  }

  .app-runner {
    grid-column: 1;
  }

  .app-results {
    grid-template-columns: 1fr;
  }

  .app-run-output {
    min-height: 220px;
  }
}

@media screen and (max-width: 760px) {
  .voice-page {
    height: auto;
    min-height: var(--app-viewport-height);
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .chat-shell.voice-mode {
    display: block;
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .voice-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.96);
  }

  .voice-workbench {
    gap: 12px;
    padding: 10px 10px 18px;
    overflow: visible;
  }

  .voice-settings-strip {
    grid-template-columns: 1fr;
  }

  .voice-control-panel,
  .voice-conversation-panel {
    border-radius: 8px;
    overflow: visible;
  }

  .voice-record-button {
    width: min(214px, 72vw);
    height: auto;
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .voice-orb-core {
    width: 64px;
    height: 64px;
  }

  .voice-orb-core svg {
    font-size: 28px;
  }

  .voice-record-label {
    bottom: 34px;
    font-size: 17px;
  }

  .voice-conversation-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
  }

  .voice-turns {
    padding: 14px;
  }

  .voice-turn {
    padding: 16px;
  }

  .voice-turn p,
  .voice-turn .message-content {
    font-size: 16px;
  }

  .music-page {
    height: auto;
    min-height: var(--app-viewport-height);
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .chat-shell.music-mode {
    display: block;
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .music-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #000000;
  }

  .music-workbench {
    gap: 10px;
    padding: 0 10px 18px;
    overflow: visible;
  }

  .music-settings,
  .music-results-panel {
    border-radius: 0;
    overflow: visible;
  }

  .music-results-panel {
    min-height: 0;
    grid-template-rows: auto;
  }

  .music-history-view,
  .music-result-list {
    overflow: visible;
  }

  .music-history-view {
    grid-template-rows: auto auto;
  }

  .music-lyrics-block pre {
    max-height: none;
    overflow: visible;
  }

  .music-results-head {
    align-items: stretch;
  }

  .music-results-title {
    width: 100%;
  }

  .music-result-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .music-result-artwork {
    width: 82px;
  }

  .music-audio-player {
    grid-template-columns: 38px minmax(38px, auto) minmax(0, 1fr) minmax(38px, auto);
    gap: 6px;
    border-radius: 20px;
  }

  .music-audio-volume {
    grid-column: 1 / -1;
  }

  .apps-page {
    overflow: auto;
  }

  .chat-shell.apps-mode {
    display: block;
    overflow: auto;
  }

  .apps-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #000000;
  }

  .apps-page-title h2 {
    font-size: 19px;
  }

  .apps-workspace {
    gap: 10px;
    padding: 0 10px 18px;
  }

  .apps-list {
    border-radius: 0;
  }

  .apps-detail {
    padding: 10px;
    border-radius: 0;
  }

  .app-schedule-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .app-schedule-copy span {
    white-space: normal;
  }
}

@media screen {
  body.chat-page {
    --chat-redesign-sidebar-width: 280px;
    --chat-redesign-max-content: 940px;
    --app-viewport-height: var(--visual-viewport-height, 100dvh);
    --chat-redesign-frame-height: var(--app-viewport-height, 100dvh);
    --chat-redesign-safe-top: env(safe-area-inset-top, 0px);
    --chat-redesign-safe-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    width: 100vw;
    min-height: var(--chat-redesign-frame-height);
    height: var(--chat-redesign-frame-height);
    padding: 0;
    overflow: hidden;
    background: #000000;
  }

  #chatRoot {
    width: 100vw;
    min-height: 0;
    height: var(--chat-redesign-frame-height);
    overflow: hidden;
  }

  .chat-shell {
    width: 100vw;
    min-height: 0;
    height: var(--chat-redesign-frame-height);
    display: grid;
    grid-template-columns: var(--chat-redesign-sidebar-width) minmax(0, 1fr);
    overflow: hidden;
    background: #000000;
  }

  .chat-sidebar {
    width: var(--chat-redesign-sidebar-width);
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 22px 8px 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 18px;
    overflow: hidden;
    border-right: 1px solid #242424;
    background: #050505;
  }

  .conversation {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: 60px minmax(0, 1fr) auto;
    overflow: hidden;
    background: #000000;
  }

  .conversation-topbar {
    min-height: 60px;
    padding: 10px 22px;
  }

  .conversation-scroll {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .message-list {
    width: min(var(--chat-redesign-max-content), calc(100% - 64px));
    min-height: 100%;
    gap: 30px;
    margin: 0 auto;
    padding: 18px 0 28px;
  }

  .assistant-message {
    width: min(760px, 100%);
  }

  .user-message-stack {
    max-width: min(620px, 76%);
  }

  .composer-dock,
  .composer-dock.empty-mode,
  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: min(var(--chat-redesign-max-content), calc(100% - 64px));
    max-width: none;
    position: static;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    display: block;
    margin: 0 auto;
    padding: 0 0 18px;
    transform: none;
  }

  .chat-composer {
    min-height: 62px;
    grid-template-columns: 42px minmax(0, 1fr) auto 46px;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #303030;
    border-radius: 18px;
    background: #242424;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
  }

  .chat-composer textarea {
    min-height: 30px;
    font-size: 18px;
  }
}

@supports (height: 100svh) {
  body.chat-page {
    --chat-redesign-frame-height: var(--app-viewport-height, 100svh);
  }
}

@media (pointer: coarse) and (min-width: 761px) {
  body.chat-page {
    --chat-redesign-safe-top: env(safe-area-inset-top, 0px);
    --chat-redesign-safe-bottom: env(safe-area-inset-bottom, 0px);
    --chat-redesign-frame-height: var(--app-viewport-height, 100dvh);
    padding-top: 0;
    padding-bottom: 0;
  }

  #chatRoot {
    height: var(--chat-redesign-frame-height);
  }

  .chat-shell {
    height: var(--chat-redesign-frame-height);
    border-radius: 0;
  }

  .conversation {
    grid-template-rows: 56px minmax(0, 1fr) auto;
  }

  .conversation-topbar {
    min-height: 56px;
    padding: 8px 22px;
  }

  .composer-dock,
  .composer-dock.empty-mode,
  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    padding-bottom: 0;
  }
}

@supports (height: 100lvh) {
  @media (pointer: coarse) and (min-width: 761px) {
    body.chat-page {
      --chat-redesign-frame-height: var(--app-viewport-height, 100dvh);
    }
  }
}

@media (max-width: 920px) {
  body.chat-page.chat-keyboard-active.visual-keyboard-open {
    overflow: hidden;
  }

  .chat-shell:not(.images-mode) {
    height: var(--app-viewport-height);
  }

  .chat-shell:not(.images-mode):not(.music-mode):not(.voice-mode):not(.apps-mode) {
    height: var(--chat-redesign-frame-height);
    grid-template-columns: 1fr;
  }

  .chat-shell.images-mode,
  .chat-shell.music-mode,
  .chat-shell.voice-mode,
  .chat-shell.apps-mode {
    grid-template-columns: 1fr;
  }

  .chat-shell.videos-mode {
    grid-template-columns: 1fr;
  }

  .chat-shell.images-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell.videos-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell.music-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .chat-shell.voice-mode {
    height: auto;
    min-height: var(--app-viewport-height);
    overflow: visible;
  }

  .image-page,
  .image-workbench,
  .voice-page,
  .voice-workbench {
    width: 100%;
  }

  .mobile-menu-button {
    top: 12px;
  }

  .chat-sidebar {
    width: min(88vw, 340px);
    height: 100%;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  .chat-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.62);
  }

  .mobile-only {
    display: inline-grid;
  }

  .conversation-topbar .text-icon-button {
    width: 44px;
    flex: 0 0 44px;
    justify-content: center;
    padding: 0;
  }

  .conversation-topbar .text-icon-button span {
    display: none;
  }

  .message-list,
  .composer-dock,
  .composer-dock.empty-mode,
  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: calc(100% - 24px);
  }
}

@media (max-width: 520px) {
  body.chat-page {
    --mobile-keyboard-composer-gap: 8px;
    --chat-redesign-frame-height: var(--app-viewport-height, 100svh);
  }

  .conversation {
    grid-template-rows: 54px minmax(0, 1fr) auto;
  }

  .conversation-topbar {
    min-height: 54px;
    gap: 6px;
    padding: 8px 10px;
  }

  .message-list {
    width: calc(100% - 20px);
    gap: 26px;
    padding-bottom: 20px;
  }

  .user-message-stack {
    max-width: 100%;
  }

  .composer-dock,
  .composer-dock.empty-mode,
  body.chat-page.touch-keyboard-device .composer-dock,
  body.chat-page.touch-keyboard-device .composer-dock.empty-mode,
  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    width: calc(100% - 20px);
    padding-bottom: 10px;
  }

  body.chat-page.visual-keyboard-open .composer-dock.keyboard-active,
  body.chat-page.touch-keyboard-device.chat-keyboard-active .composer-dock.keyboard-active {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(var(--visual-viewport-offset-top, 0px) + var(--visual-viewport-height, 100dvh));
    bottom: auto;
    z-index: 70;
    width: auto;
    margin: 0;
    padding-bottom: 0;
    transform: translateY(calc(-100% - var(--mobile-keyboard-composer-gap, 8px)));
  }

  .chat-composer {
    min-height: 60px;
    grid-template-columns: 38px minmax(0, 1fr) 40px 42px;
    gap: 5px;
    padding: 8px;
  }

  .composer-mode-trigger {
    width: 40px;
    justify-content: center;
    padding: 0;
  }

  .composer-mode-trigger span {
    display: none;
  }

  .composer-icon-button,
  .send-button {
    width: 38px;
    height: 38px;
  }
}

@media all and (max-width: 760px) {
  .notification-permission-backdrop {
    align-items: end;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .notification-permission-dialog {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .notification-permission-icon {
    width: 40px;
    height: 40px;
  }

  .notification-permission-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-permission-actions .modal-button {
    width: 100%;
  }
}
