:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --surface-strong: #eef2f7;
  --sidebar: #203f6d;
  --sidebar-soft: #294c7c;
  --navy: #203f6d;
  --navy-deep: #16355b;
  --border: #d9dde4;
  --border-strong: #c1cbda;
  --text: #203f6d;
  --text-soft: #6a778a;
  --text-faint: #8b97a8;
  --accent: #ff9708;
  --accent-strong: #ff8900;
  --accent-soft: rgba(255, 151, 8, 0.12);
  --danger: #cc5240;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 22px 56px rgba(32, 63, 109, 0.08);
  --font-sans: "Plus Jakarta Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top center, rgba(32, 63, 109, 0.1), transparent 26%),
    radial-gradient(circle at 20% 0%, rgba(255, 151, 8, 0.08), transparent 20%),
    linear-gradient(180deg, #f8f6f1 0%, #f4f2ed 100%);
  color: var(--text);
  font-family: var(--font-sans);
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  width: min(1440px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 18px 0 24px;
  display: grid;
  gap: 20px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0 10px;
  border-bottom: 1px solid rgba(32, 63, 109, 0.1);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo-image {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  padding: 6px;
  border: 1px solid rgba(32, 63, 109, 0.08);
  box-shadow: 0 12px 28px rgba(32, 63, 109, 0.08);
}

.header-brand-copy,
.hero-brand-copy,
.sidebar-head-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-brand-copy strong {
  font-size: 30px;
  line-height: 1;
  color: var(--navy);
  font-weight: 800;
}

.header-brand-copy span {
  color: var(--text-soft);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.header-tag {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(32, 63, 109, 0.12);
  background: rgba(255, 255, 255, 0.76);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 28px;
  min-height: 0;
}

.sidebar {
  background: linear-gradient(180deg, rgba(32, 63, 109, 0.98), rgba(22, 53, 91, 0.98));
  color: #ecf2ee;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 18px;
  gap: 14px;
  border-radius: 28px;
  box-shadow: 0 20px 44px rgba(32, 63, 109, 0.14);
  min-height: calc(100vh - 140px);
  position: sticky;
  top: 18px;
}

.sidebar-head {
  padding: 8px 10px 6px;
}

.sidebar-head-copy strong {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.sidebar-head-copy span,
.section-title,
.user-meta span {
  color: rgba(236, 242, 238, 0.7);
  font-size: 13px;
}

.primary-action,
.primary-button,
.send-button {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(255, 151, 8, 0.18);
}

.primary-action:hover,
.primary-button:hover,
.send-button:hover {
  filter: brightness(1.04);
}

.nav-group {
  display: grid;
  gap: 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #f3f7f4;
  border-radius: 18px;
  padding: 12px 13px;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-icon,
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

.session-list,
.task-list-mini {
  display: grid;
  gap: 8px;
}

.session-card,
.task-mini-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #eef6f1;
  width: 100%;
  text-align: left;
}

.session-card:hover,
.session-card.active,
.task-mini-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.session-title,
.task-mini-title,
.user-meta strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.session-meta,
.task-mini-meta {
  display: block;
  margin-top: 4px;
  color: rgba(236, 242, 238, 0.65);
  font-size: 12px;
}

.sidebar-foot {
  margin-top: auto;
}

.user-chip {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  color: white;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.user-chip:hover {
  transform: translateY(-1px);
}

.user-chip.is-ready {
  border-color: rgba(255, 151, 8, 0.28);
  background: rgba(255, 151, 8, 0.14);
}

.user-chip.is-warning {
  border-color: rgba(255, 151, 8, 0.4);
  background: rgba(255, 151, 8, 0.16);
}

.workspace {
  padding: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.app-footer {
  padding: 10px 2px 0;
  color: var(--text-faint);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.topbar-copy,
.hero-brand-card {
  border: 1px solid rgba(217, 221, 228, 0.95);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.topbar-copy {
  display: grid;
  gap: 16px;
  padding: 32px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(32, 63, 109, 0.06);
  color: var(--navy);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 48px;
  line-height: 1.02;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.topbar-desc {
  margin: 0;
  max-width: 720px;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 17px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-points,
.hero-brand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-point,
.hero-brand-list span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(32, 63, 109, 0.1);
  background: rgba(247, 249, 252, 0.92);
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}

.hero-brand-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 28px;
  min-width: 0;
}

.hero-brand-label {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-brand-copy strong {
  font-size: 28px;
  line-height: 1.1;
  color: var(--navy);
  font-weight: 800;
}

.hero-brand-copy p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 14px;
}

.ghost-button {
  border: 1px solid rgba(32, 63, 109, 0.35);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 18px;
  padding: 12px 18px;
  color: var(--navy);
  font-weight: 700;
}

.ghost-button:hover {
  border-color: var(--border-strong);
  background: rgba(32, 63, 109, 0.04);
}

.ghost-button.small {
  padding: 8px 12px;
}

.toast {
  min-height: 0;
}

.toast-message {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(32, 63, 109, 0.96);
  color: white;
  padding: 12px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.account-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.account-card,
.summary-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  padding: 20px 22px;
  box-shadow: 0 14px 28px rgba(32, 63, 109, 0.05);
}

.account-card-label,
.summary-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.account-card strong,
.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
  line-height: 1.25;
  color: var(--text);
}

.account-card-meta,
.summary-meta {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-soft);
}

.account-card.success {
  border-color: rgba(32, 63, 109, 0.18);
  background: linear-gradient(180deg, rgba(32, 63, 109, 0.06), rgba(32, 63, 109, 0.02));
}

.account-card.warning {
  border-color: rgba(255, 151, 8, 0.35);
  background: linear-gradient(180deg, rgba(255, 151, 8, 0.12), rgba(255, 151, 8, 0.04));
}

.account-card.muted {
  background: rgba(255, 255, 255, 0.82);
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}

.summary-card.emphasis {
  border-color: rgba(255, 151, 8, 0.35);
  background: linear-gradient(180deg, rgba(255, 151, 8, 0.16), rgba(255, 255, 255, 0.98));
}

.summary-card.warning {
  border-color: rgba(255, 151, 8, 0.35);
  background: rgba(255, 151, 8, 0.12);
}

.view {
  display: none;
  min-height: 0;
}

.view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  gap: 18px;
  min-height: 0;
}

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

.media-grid {
  grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
}

.single-grid {
  grid-template-columns: 1fr;
}

.surface {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(217, 221, 228, 0.92);
  border-radius: 26px;
  box-shadow: 0 18px 34px rgba(32, 63, 109, 0.05);
  padding: 24px;
  min-width: 0;
}

.surface.full-height {
  min-height: 70vh;
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.surface-head h2 {
  margin: 0 0 6px;
  font-size: 28px;
  color: var(--navy);
}

.surface-head p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 151, 8, 0.1);
  color: var(--accent);
  font-weight: 700;
}

.control-row,
.advanced-grid,
.prompt-stack,
.cta-row {
  display: grid;
  gap: 14px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  grid-column: span 4;
}

.field.compact {
  grid-column: span 2;
}

.field.align-end {
  justify-content: flex-end;
}

.field span,
.checkbox-field span,
.preset-section h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(255, 151, 8, 0.62);
  box-shadow: 0 0 0 4px rgba(255, 151, 8, 0.12);
}

.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: end;
  min-height: 52px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(32, 63, 109, 0.03), rgba(255, 151, 8, 0.04)),
    var(--surface-soft);
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dropzone strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}

.dropzone span {
  color: var(--text-soft);
  line-height: 1.5;
}

.dropzone input {
  margin-top: 6px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.asset-card,
.result-card,
.task-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  background: white;
  overflow: hidden;
}

.asset-card {
  position: relative;
  min-height: 130px;
}

.asset-preview {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: var(--surface-soft);
  display: block;
}

.asset-virtual-preview {
  display: grid;
  place-items: center;
  color: #5b6476;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.asset-meta {
  padding: 10px 12px 12px;
}

.asset-name,
.result-title,
.task-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.asset-type,
.result-meta,
.task-meta,
.empty-state,
.empty-tip {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.5;
}

.asset-warning,
.inline-hint,
.task-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.inline-hint {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(32, 63, 109, 0.06);
  color: var(--text-soft);
}

.asset-warning,
.task-error {
  color: var(--danger);
}

.asset-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(17, 24, 18, 0.8);
  color: white;
  border-radius: 999px;
  width: 28px;
  height: 28px;
}

.mode-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.mode-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 16px 18px;
  text-align: left;
}

.mode-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.mode-card span {
  color: var(--text-soft);
  line-height: 1.45;
}

.mode-card.active,
.mode-card:hover {
  border-color: rgba(32, 63, 109, 0.18);
  box-shadow: 0 10px 22px rgba(32, 63, 109, 0.06);
}

.chat-surface {
  display: flex;
  flex-direction: column;
  min-height: 72vh;
}

.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.chat-welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 24px 8px 24px 4px;
}

.chat-welcome h2 {
  margin: 0;
  font-size: 44px;
  line-height: 1.02;
  max-width: 560px;
  letter-spacing: -0.03em;
}

.chat-welcome p {
  margin: 0;
  max-width: 620px;
  color: var(--text-soft);
  line-height: 1.6;
}

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

.template-card {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.template-card:hover {
  border-color: rgba(32, 63, 109, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(32, 63, 109, 0.06);
}

.template-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.template-card span {
  display: block;
  color: var(--text-soft);
  line-height: 1.5;
}

.message-row {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(216, 221, 213, 0.55);
}

.message-row:last-child {
  border-bottom: none;
}

.message-row.user .message-avatar {
  background: linear-gradient(180deg, var(--navy), var(--navy-deep));
  color: white;
}

.message-row.assistant .message-avatar {
  background: rgba(255, 151, 8, 0.12);
  color: var(--navy);
}

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex: none;
  font-weight: 700;
}

.message-content {
  min-width: 0;
  flex: 1;
}

.message-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.message-bubble {
  background: transparent;
  line-height: 1.7;
  word-break: break-word;
}

.message-row.user .message-bubble {
  background: var(--surface-soft);
  border-radius: 18px;
  padding: 14px 16px;
}

.message-bubble pre {
  background: #111714;
  color: #eef6f1;
  border-radius: 18px;
  padding: 16px;
  overflow-x: auto;
}

.message-bubble code:not(pre code) {
  background: rgba(255, 151, 8, 0.12);
  color: var(--navy);
  padding: 2px 6px;
  border-radius: 8px;
}

.message-bubble ul,
.message-bubble ol {
  padding-left: 18px;
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
  padding: 6px 0;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(32, 63, 109, 0.4);
  animation: bounce 1.1s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(217, 221, 228, 0.9);
}

.composer textarea {
  min-height: 58px;
  max-height: 220px;
  resize: vertical;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 16px 18px;
  line-height: 1.55;
}

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

.result-card img,
.result-card video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-soft);
}

.result-card video {
  aspect-ratio: 16 / 9;
}

.result-body,
.task-body {
  padding: 14px;
}

.result-links,
.task-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.result-links a,
.task-links a,
.result-links button,
.task-links button,
.chat-message-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.preset-section {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.task-billing {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
}

.task-billing.settled {
  color: var(--accent);
}

.task-billing.pending {
  color: var(--text-faint);
}

.task-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.task-status.running {
  background: rgba(255, 151, 8, 0.12);
  color: var(--accent);
}

.task-status.success {
  background: rgba(32, 63, 109, 0.08);
  color: var(--navy);
}

.task-status.failed {
  background: rgba(207, 77, 77, 0.12);
  color: var(--danger);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 18, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: min(520px, 100%);
  border: 1px solid rgba(217, 221, 228, 0.92);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 54px rgba(32, 63, 109, 0.18);
  padding: 28px;
  display: grid;
  gap: 20px;
}

.modal-card h2 {
  margin: 12px 0 8px;
  font-size: 28px;
}

.modal-card p {
  margin: 0;
  line-height: 1.6;
  color: var(--text-soft);
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(32, 63, 109, 0.08);
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-soft);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
}

.auth-tab.active {
  background: white;
  color: var(--navy);
  box-shadow: 0 10px 24px rgba(32, 63, 109, 0.08);
}

.auth-current,
.auth-note,
.auth-error {
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-current {
  border: 1px solid rgba(32, 63, 109, 0.18);
  background: rgba(32, 63, 109, 0.08);
  color: var(--text);
}

.auth-note {
  border: 1px solid rgba(255, 151, 8, 0.18);
  background: rgba(255, 151, 8, 0.08);
  color: var(--text-soft);
}

.auth-error {
  border: 1px solid rgba(207, 77, 77, 0.16);
  background: rgba(207, 77, 77, 0.08);
  color: var(--danger);
}

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

#auth-logout-btn {
  margin-right: auto;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .account-strip,
  .task-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-tags {
    align-self: stretch;
    justify-content: flex-start;
  }

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

  .sidebar {
    min-height: auto;
    position: static;
  }

  .workspace {
    padding: 0;
  }

  .topbar-copy {
    padding: 22px;
  }

  .topbar h1 {
    font-size: 38px;
  }

  .topbar-desc {
    font-size: 16px;
  }

  .hero-brand-copy strong {
    font-size: 26px;
  }

  .account-strip,
  .task-summary-grid,
  .mode-strip {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: 1fr;
  }

  .field,
  .field.compact {
    grid-column: auto;
  }

  .app-footer {
    padding: 8px 0 0;
  }
}

/* ChatGPT-like simplification overrides */
body {
  background: #f7f7f8;
  color: #202123;
}

.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.app-header,
.app-footer {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 12px;
  align-self: start;
  height: calc(100vh - 24px);
  margin: 12px;
  padding: 10px;
  gap: 12px;
  border-radius: 18px;
  background: #17181c;
  box-shadow: none;
}

.sidebar-head {
  padding: 6px 8px 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
  padding: 4px;
}

.sidebar-head-copy strong {
  font-size: 14px;
  color: #ececf1;
}

.sidebar-head-copy span {
  font-size: 10px;
  color: rgba(236, 236, 241, 0.62);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-action {
  background: #24262d;
  border: 1px solid #2f323c;
  color: #ececf1;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: none;
  font-weight: 600;
  font-size: 13px;
}

.primary-action:hover {
  background: #2a2d35;
  filter: none;
}

.sidebar-section {
  padding: 8px 6px 6px;
  border-radius: 0;
  background: transparent;
  border: none;
}

.section-title,
.user-meta span,
.session-meta,
.task-mini-meta {
  color: rgba(236, 236, 241, 0.62);
  font-size: 12px;
}

.session-card,
.task-mini-card {
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
}

.session-card:hover,
.session-card.active,
.task-mini-card:hover {
  background: #2a2b32;
}

.session-title,
.task-mini-title,
.user-meta strong {
  color: #ececf1;
  font-size: 13px;
  font-weight: 600;
}

.user-chip {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #2b2f39;
  background: #20232a;
}

.user-chip.is-ready {
  background: #242834;
}

.user-chip.is-warning {
  background: #36281b;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #2f3040;
  color: #ececf1;
}

.workspace {
  padding: 12px 32px 24px 0;
  gap: 14px;
  background: #f7f7f8;
}

.topbar,
.account-strip {
  display: none !important;
}

.ghost-button {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #202123;
  box-shadow: none;
  font-weight: 600;
}

.ghost-button:hover {
  background: #f9f9fb;
  border-color: #e5e7eb;
}

.ghost-button.small {
  padding: 8px 12px;
}

.account-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.account-card,
.summary-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: none;
}

.account-card strong,
.summary-card strong {
  margin-top: 6px;
  font-size: 16px;
  color: #202123;
}

.account-card-label,
.summary-label {
  font-size: 11px;
  color: #6b7280;
}

.account-card-meta,
.summary-meta {
  margin-top: 4px;
  color: #6e6e80;
  font-size: 12px;
}

.account-card.success,
.account-card.muted {
  background: #ffffff;
}

.account-card.warning,
.summary-card.warning,
.summary-card.emphasis {
  background: #fff7ed;
  border-color: #fed7aa;
}

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

.media-grid {
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
}

.single-grid {
  grid-template-columns: 1fr;
}

.controls-panel,
.mode-strip {
  display: none !important;
}

.surface {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: none;
}

.surface.full-height {
  min-height: auto;
}

.surface-head {
  margin-bottom: 16px;
}

.surface-head h2 {
  font-size: 22px;
  color: #202123;
}

.surface-head p {
  color: #6e6e80;
}

.chat-surface {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 164px);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 24px;
}

.chat-welcome {
  min-height: calc(100vh - 300px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 0 72px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e7e8ec;
  background: rgba(255, 255, 255, 0.9);
  color: #52525b;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chat-welcome h2 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.04;
  letter-spacing: -0.05em;
  color: #202123;
  font-weight: 700;
}

.chat-welcome p {
  max-width: 600px;
  margin: 0;
  color: #71717a;
  font-size: 13px;
  line-height: 1.5;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 720px;
  margin-top: 10px;
}

.template-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #ececf1;
  background: #ffffff;
  text-align: left;
  box-shadow: none;
}

.template-card:hover {
  background: #fafafc;
  border-color: #e7e8ec;
  transform: none;
  box-shadow: none;
}

.template-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  line-height: 1.3;
  color: #202123;
}

.template-card span {
  display: block;
  color: #71717a;
  font-size: 11px;
  line-height: 1.45;
}

.message-row {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px 0;
  display: block;
  border-bottom: none;
}

.message-avatar,
.message-role {
  display: none;
}

.message-content {
  width: 100%;
}

.message-bubble {
  background: transparent;
  color: #202123;
  font-size: 14px;
  line-height: 1.72;
}

.message-row.user {
  text-align: right;
}

.message-row.user .message-content {
  display: flex;
  justify-content: flex-end;
}

.message-row.user .message-bubble {
  display: inline-block;
  max-width: min(78%, 100%);
  padding: 13px 16px;
  border-radius: 20px;
  border: 1px solid #e8e8ef;
  background: #f3f4f6;
}

.message-row.user .message-bubble p {
  margin: 0;
}

.message-reference-block {
  width: min(100%, 420px);
  margin: 0 0 10px;
  text-align: left;
}

.message-reference-title {
  margin-bottom: 7px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.message-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.message-reference-item {
  min-width: 0;
  display: grid;
  gap: 5px;
  color: #202123;
  text-decoration: none;
}

.message-reference-item img,
.message-reference-item video,
.message-reference-file {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid #e4e7ef;
  border-radius: 12px;
  background: #ffffff;
  object-fit: cover;
  overflow: hidden;
}

.message-reference-file {
  display: grid;
  place-items: center;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.message-reference-item span,
.message-reference-more {
  color: #6b7280;
  font-size: 11px;
  line-height: 1.25;
}

.message-reference-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-reference-more {
  display: block;
  margin-top: 6px;
}

.message-bubble pre {
  background: #111827;
  color: #eef2ff;
  border-radius: 14px;
  padding: 16px;
}

.message-bubble code:not(pre code) {
  background: #f3f4f6;
  color: #202123;
  padding: 2px 6px;
  border-radius: 8px;
}

.chat-generation-card {
  display: grid;
  gap: 12px;
  width: min(100%, 760px);
}

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

.chat-generation-meta {
  color: #6b7280;
  font-size: 13px;
}

.chat-message-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.chat-generation-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.chat-task-card,
.chat-result-card {
  width: 100%;
  margin: 0;
}

.chat-task-card .asset-preview,
.chat-task-card video,
.chat-task-card img,
.chat-result-card img {
  max-height: 360px;
  object-fit: contain;
  background: #f8fafc;
}

.typing-dots span {
  background: rgba(32, 33, 35, 0.35);
}

.composer {
  position: sticky;
  bottom: 0;
  padding: 10px 0 24px;
  border: none;
  background: linear-gradient(180deg, rgba(247, 247, 248, 0) 0, rgba(247, 247, 248, 0.88) 26px, #f7f7f8 56px);
}

.composer-shell {
  width: min(100%, 920px);
  margin: 0 auto;
  display: grid;
  gap: 8px;
  padding: 12px 14px 10px;
  border: 1px solid #e8eaf0;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.composer-stage {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-height: 156px;
}

.composer-upload-tile {
  min-height: 116px;
  border: 1px dashed #d9dfef;
  border-radius: 18px;
  background: #f7f8fc;
  color: #8a90ad;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 18px 14px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.composer-upload-tile:hover {
  border-color: #c8d1ea;
  background: #f3f5fb;
  color: #6f7696;
}

.composer-upload-plus {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 300;
}

.composer-upload-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
}

.composer-editor {
  min-height: 0;
  display: flex;
}

.composer textarea {
  width: 100%;
  min-height: 36px;
  max-height: 192px;
  padding: 2px 2px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  resize: none;
  color: #202123;
  font-size: 14px;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #a3a8bf;
  font-size: 14px;
  line-height: 1.5;
}

.composer-mode-panel {
  display: grid;
  gap: 8px;
  padding: 4px 0 2px;
}

.composer-mode-surface {
  display: grid;
  gap: 9px;
  padding: 10px 12px 12px;
  border: 1px solid #ececf1;
  border-radius: 16px;
  background: #fbfbfc;
}

.composer-mode-section {
  display: grid;
  gap: 7px;
}

.composer-mode-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-mode-head span {
  color: #6e6e80;
  font-size: 11px;
  font-weight: 600;
}

.composer-mode-head strong {
  color: #202123;
  font-size: 12px;
  font-weight: 600;
}

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

.composer-mode-split-bottom {
  align-items: end;
}

.composer-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}

.composer-choice-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

.composer-choice-grid.ratio {
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
}

#composer-image-size-group {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#composer-image-response-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#composer-video-mode-group {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#composer-video-resolution-group {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#composer-video-duration-mode-group {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#composer-video-panel {
  gap: 8px;
}

.composer-choice {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.composer-choice.compact {
  min-height: 34px;
}

.composer-choice.ratio {
  min-height: 34px;
  padding: 7px 9px;
  flex-direction: row;
  gap: 6px;
}

.composer-choice:hover {
  border-color: #d8dbe6;
  background: #f8f9fb;
  color: #202123;
}

.composer-choice.active {
  border-color: #d8dbe6;
  background: #f8fafc;
  color: #202123;
  box-shadow: none;
}

.composer-choice-box {
  position: relative;
  width: 14px;
  height: 14px;
  flex: none;
  border: 1.5px solid #c7ccd9;
  border-radius: 4px;
  background: #ffffff;
}

.composer-choice.active .composer-choice-box {
  border-color: #202123;
  background: #202123;
}

.composer-choice.active .composer-choice-box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 3px;
  height: 7px;
  border-right: 1.5px solid #ffffff;
  border-bottom: 1.5px solid #ffffff;
  transform: rotate(45deg);
}

.composer-choice-text {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.composer-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-range-row.is-disabled {
  opacity: 0.58;
}

.composer-range {
  width: 100%;
  margin: 0;
  accent-color: #202123;
}

.composer-range-value {
  min-width: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1px solid #dfe3ef;
  border-radius: 14px;
  background: #ffffff;
  color: #202123;
}

.composer-range-value strong {
  font-size: 13px;
  font-weight: 700;
}

.composer-range-value span {
  color: #6e6e80;
  font-size: 11px;
}

.composer-mode-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.composer-toggle-chip {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d9ddea;
  border-radius: 999px;
  background: #ffffff;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
}

.composer-toggle-chip.active {
  border-color: #cbd1e0;
  background: #eef2ff;
  color: #27324a;
}

.composer-mode-note {
  padding: 7px 2px 0;
  border-top: 1px solid #ececf1;
  background: transparent;
  color: #868b98;
  font-size: 11px;
  line-height: 1.45;
}

.composer-mode-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 11px;
  font-weight: 600;
}

.advanced-grid {
  width: 100%;
  margin: 0;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eceef5;
  border-radius: 20px;
  background: #fafbff;
}

.compact-control-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field span,
.checkbox-field span,
.preset-section h3 {
  color: #6e6e80;
}

.field input,
.field select,
.field textarea {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #202123;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #c7c9d1;
  box-shadow: 0 0 0 4px rgba(32, 33, 35, 0.06);
}

.inline-model-input {
  min-width: 0;
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  padding: 11px 14px;
  color: #202123;
}

.composer-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 0;
}

.composer-pill-group,
.composer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.composer-icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.composer-icon-button:hover {
  background: #f9fafb;
  color: #202123;
}

.composer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #202123;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.composer-select-pill span {
  color: #6f7696;
  font-size: 9px;
  font-weight: 600;
}

.composer-select-pill select {
  min-width: 156px;
  border: none;
  background: transparent;
  color: #202123;
  font-size: 11px;
  font-weight: 600;
  outline: none;
}

.composer-view-pill select {
  min-width: 92px;
}

.composer-action-pill {
  color: #5c6384;
  background: #ffffff;
}

.composer-action-pill.active {
  border-color: #d7dbe6;
  background: #f3f5f9;
  color: #202123;
}

.composer-price {
  max-width: min(520px, 52vw);
  padding: 8px 10px;
  border: 1px solid #dfe6dc;
  border-radius: 999px;
  background: #f3f8f0;
  color: #35543b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consumption-estimate-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid #dfe6dc;
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(109, 141, 97, 0.14), transparent 34%),
    linear-gradient(135deg, #f7fbf5 0%, #ffffff 100%);
  color: #2f4d35;
}

.consumption-estimate-card span {
  color: #6c7b68;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.consumption-estimate-card strong {
  justify-self: end;
  color: #203326;
  font-size: 16px;
  line-height: 1.2;
}

.consumption-estimate-card small {
  grid-column: 1 / -1;
  color: #6e7b6a;
  font-size: 11px;
  line-height: 1.45;
}

.composer .consumption-estimate-card {
  margin-top: 2px;
}

.send-button,
.primary-button {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: #202123;
  color: #ffffff;
  box-shadow: none;
  font-weight: 600;
}

.composer-send-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #202123;
  color: #ffffff;
  font-size: 16px;
  font-weight: 400;
}

.chat-asset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.chat-asset-grid .asset-card {
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 18px;
  border-color: #ececf1;
  background: #fafafa;
  overflow: visible;
}

.chat-asset-grid .asset-preview {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: none;
}

.chat-asset-grid .asset-meta {
  padding: 0 18px 0 0;
}

.chat-asset-grid .asset-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-asset-grid .asset-type,
.chat-asset-grid .asset-warning {
  font-size: 10px;
}

.chat-asset-grid .asset-remove {
  width: 20px;
  height: 20px;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  color: #6b7280;
}

.send-button:hover,
.primary-button:hover {
  background: #2b2d31;
  filter: none;
}

.composer-send-button:hover {
  background: #2b2d31;
}

.dropzone {
  background: #fafafa;
  border-color: #d1d5db;
}

.inline-hint {
  background: #f3f4f6;
}

.asset-card,
.result-card,
.task-card,
.empty-state {
  border-radius: 16px;
}

.task-status.running {
  background: #fff7ed;
  color: #b45309;
}

.task-status.success {
  background: #f3f4f6;
  color: #202123;
}

.modal-overlay {
  background: rgba(17, 24, 39, 0.46);
  backdrop-filter: blur(4px);
}

.modal-card {
  border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.modal-card.auth-modal-card {
  width: min(420px, calc(100vw - 32px));
  padding: 20px;
  gap: 12px;
  border: 1px solid #ebedf3;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.modal-card.auth-modal-card.account-mode {
  width: min(720px, calc(100vw - 32px));
  padding: 18px 18px 16px;
}

.modal-card.auth-modal-card.account-mode .auth-brand {
  display: none;
}

.modal-card.auth-modal-card.account-mode .auth-hero {
  gap: 2px;
}

.modal-card.auth-modal-card.account-mode h2 {
  font-size: 21px;
}

.modal-card.auth-modal-card.account-mode p.hidden {
  display: none !important;
}

.auth-hero {
  display: grid;
  gap: 10px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 14px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #eceef4;
}

.auth-brand-copy strong,
.auth-brand-copy span {
  display: block;
}

.auth-brand-copy strong {
  color: #202123;
  font-size: 15px;
  font-weight: 700;
}

.auth-brand-copy span {
  margin-top: 3px;
  color: #949ab0;
  font-size: 12px;
}

.auth-copy {
  display: grid;
  gap: 4px;
}

.auth-modal-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.auth-modal-card p {
  margin: 0;
  color: #7f859d;
  font-size: 13px;
  line-height: 1.5;
}

.auth-modal-card .auth-tabs {
  width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid #eceef4;
  border-radius: 16px;
  background: #f5f6fa;
}

.auth-modal-card .auth-tab {
  min-height: 40px;
  border-radius: 12px;
  color: #7f859d;
  font-size: 13px;
  font-weight: 600;
}

.auth-modal-card .auth-tab.active {
  background: #ffffff;
  color: #202123;
  box-shadow: none;
}

.auth-modal-card .auth-current {
  padding: 0;
  border: none;
  background: transparent;
  color: #8d93aa;
  font-size: 12px;
  line-height: 1.5;
}

.auth-modal-card .auth-note {
  padding: 0;
  border: none;
  background: transparent;
  color: #8d93aa;
  font-size: 12px;
  line-height: 1.5;
}

.auth-modal-card .auth-error {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(207, 77, 77, 0.14);
  background: rgba(207, 77, 77, 0.06);
  font-size: 12px;
}

.auth-modal-card .field {
  gap: 8px;
}

.auth-modal-card .field span {
  font-size: 12px;
  font-weight: 600;
  color: #8d93aa;
}

.auth-modal-card .field input {
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid #e6e8ef;
  background: #fbfbfd;
  padding: 0 14px;
  color: #202123;
}

.auth-modal-card .field input::placeholder {
  color: #b2b7c9;
}

.auth-modal-card .field input:focus {
  border-color: #d2d7e6;
  box-shadow: 0 0 0 4px rgba(32, 33, 35, 0.04);
}

.auth-modal-card .modal-actions {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

.auth-modal-card .modal-actions .primary-button,
.auth-modal-card .modal-actions .ghost-button {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
}

.auth-modal-card .modal-actions .ghost-button {
  border: 1px solid #e6e8ef;
  background: #ffffff;
  color: #565d75;
}

.auth-modal-card #auth-submit-btn {
  order: -1;
}

.auth-modal-card #auth-logout-btn {
  margin-right: 0;
}

.account-center {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding-right: 2px;
}

.account-center-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 10px;
  align-items: start;
}

.account-center-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.account-center-user {
  min-width: 0;
  flex: 1;
}

.account-center-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #ececf1;
  background: #ffffff;
  color: #6e6e80;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.account-center-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #ececf1;
  border-radius: 18px;
  background: #ffffff;
}

.account-center-block.recharge-focus {
  border-color: rgba(255, 138, 76, 0.8);
  box-shadow: 0 0 0 4px rgba(255, 138, 76, 0.16);
}

.account-center-block:has(#account-recharge-panel) {
  order: 1;
}

.account-center-block:has(#account-pricing-panel) {
  order: 2;
}

.account-center-block:has(#task-mini-list) {
  order: 3;
}

.account-center-toolbar {
  order: 4;
}

.account-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.account-center-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #202123;
}

.account-center-head span {
  display: none;
}

.account-inline-action {
  padding: 0;
  border: none;
  background: transparent;
  color: #6e6e80;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.account-inline-action:hover {
  color: #202123;
}

.account-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #ececf1;
  border-radius: 18px;
  background: #ffffff;
}

.account-user-card-placeholder {
  background: #fafafa;
}

.account-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #202123;
  color: #ffffff;
  font-weight: 700;
  flex: none;
}

.account-user-copy strong,
.account-user-copy span {
  display: block;
}

.account-user-copy strong {
  color: #202123;
  font-size: 13px;
}

.account-user-copy span {
  margin-top: 3px;
  color: #6e6e80;
  font-size: 11px;
}

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

.account-developer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.developer-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fbfbfc;
}

.developer-stack {
  display: grid;
  gap: 10px;
}

.developer-item {
  display: grid;
  gap: 6px;
}

.developer-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.developer-card-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #6b7280;
  text-transform: uppercase;
}

.developer-card-meta {
  color: #6e6e80;
  font-size: 12px;
  line-height: 1.55;
}

.developer-secret,
.developer-endpoint {
  display: block;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid #ececf1;
  background: #ffffff;
  color: #202123;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
}

.developer-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.developer-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.developer-doc-links a {
  color: #6e6e80;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.developer-doc-links a:hover {
  color: #202123;
}

.account-pricing-grid {
  display: grid;
  gap: 12px;
}

.pricing-empty {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fbfbfc;
  color: #6e6e80;
  font-size: 12px;
}

.pricing-group {
  display: grid;
  gap: 8px;
}

.pricing-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #202123;
}

.pricing-group-head strong {
  font-size: 13px;
}

.pricing-group-head span {
  color: #6e6e80;
  font-size: 11px;
}

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

.pricing-model-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e1e8df;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf5 100%);
}

.pricing-model-head {
  display: grid;
  gap: 3px;
}

.pricing-model-head strong {
  color: #202123;
  font-size: 13px;
  line-height: 1.25;
}

.pricing-model-head span {
  color: #7b829a;
  font-size: 10px;
  word-break: break-all;
}

.pricing-model-price {
  padding: 8px 9px;
  border-radius: 12px;
  background: #eef7eb;
  color: #31553a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.pricing-detail-list {
  display: grid;
  gap: 4px;
}

.pricing-detail-list span,
.pricing-model-note {
  color: #6e6e80;
  font-size: 11px;
  line-height: 1.45;
}

.account-center-grid .account-card {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #fbfbfc;
  box-shadow: none;
}

.account-center-grid .account-card.account-card-wide {
  grid-column: 1 / -1;
}

.account-center-grid .account-card strong {
  margin-top: 5px;
  font-size: 15px;
  color: #202123;
}

.account-center-grid .account-card-label {
  font-size: 10px;
  color: #6b7280;
  text-transform: uppercase;
}

.account-center-grid .account-card-meta {
  margin-top: 4px;
  color: #6e6e80;
  font-size: 11px;
  line-height: 1.45;
}

.account-center-grid .account-card.success,
.account-center-grid .account-card.muted {
  background: #fbfbfc;
}

.account-center-grid .account-card.warning {
  background: #fffaf5;
  border-color: #f4d7b4;
}

.personal-task-list {
  display: grid;
  gap: 8px;
  max-height: 176px;
  overflow-y: auto;
}

.personal-task-list .task-mini-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 9px 11px;
  background: #ffffff;
}

.personal-task-list .task-mini-card:hover {
  background: #f9f9fb;
}

.personal-task-list .task-mini-title {
  display: block;
  color: #202123;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-task-list .task-mini-meta,
.personal-task-list .empty-tip {
  color: #6e6e80;
  font-size: 11px;
}

.account-recharge-panel {
  display: grid;
  gap: 10px;
}

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

.recharge-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fbfbfc;
}

.recharge-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recharge-head strong {
  color: #202123;
  font-size: 13px;
}

.recharge-note,
.recharge-meta span,
.recharge-inline-hint,
.recharge-order-meta,
.recharge-empty {
  color: #6e6e80;
  font-size: 11px;
  line-height: 1.5;
}

.recharge-amount-grid,
.recharge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recharge-amount-chip {
  min-width: 68px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #202123;
  font-size: 12px;
  font-weight: 700;
}

.recharge-amount-chip.active {
  border-color: #202123;
  background: #202123;
  color: #ffffff;
}

.recharge-meta {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #ececf1;
  border-radius: 14px;
  background: #ffffff;
}

.recharge-meta strong,
.recharge-order-no {
  color: #202123;
  font-size: 14px;
  font-weight: 700;
}

.recharge-inline-hint {
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px dashed #d8dbe6;
}

.recharge-order-focus {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #ececf1;
  border-radius: 14px;
  background: #ffffff;
}

.recharge-order-list {
  display: grid;
  gap: 8px;
  max-height: 228px;
  overflow-y: auto;
}

.recharge-order-card {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  text-align: left;
}

.recharge-order-card.active,
.recharge-order-card:hover {
  background: #f9f9fb;
}

.recharge-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.recharge-order-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.recharge-order-status.pending {
  background: #fff7ed;
  color: #b45309;
}

.recharge-order-status.success {
  background: #ecfdf3;
  color: #15803d;
}

.recharge-order-status.failed {
  background: #fef2f2;
  color: #b91c1c;
}

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

.account-center-toolbar {
  justify-content: flex-end;
  padding-top: 2px;
}

.account-center-toolbar .ghost-button,
.account-center-toolbar .primary-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
}

.account-more-actions {
  position: relative;
}

.account-more-actions summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #565d75;
  font-size: 12px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.account-more-actions summary::-webkit-details-marker {
  display: none;
}

.account-more-actions[open] summary {
  background: #f7f7f8;
}

.account-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 8;
  display: grid;
  gap: 6px;
  min-width: 132px;
  padding: 8px;
  border: 1px solid #ececf1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.account-more-menu .ghost-button {
  justify-content: flex-start;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    margin: 12px 12px 0;
  }

  .workspace {
    padding: 12px;
  }

  .account-center-shell,
  .recharge-grid,
  .template-grid,
  .compact-control-row,
  .account-center-grid,
  .account-developer-grid,
  .pricing-model-list {
    grid-template-columns: 1fr;
  }

  .account-center-toolbar {
    justify-content: stretch;
  }

  .account-more-actions {
    flex: 1 1 0;
  }

  .account-center-toolbar .ghost-button,
  .account-center-toolbar .primary-button,
  .account-more-actions summary {
    flex: 1 1 0;
    justify-content: center;
  }

  .composer-shell {
    padding: 16px;
    border-radius: 24px;
  }

  .composer-mode-split {
    grid-template-columns: 1fr;
  }

  .composer-choice-grid.ratio {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #composer-image-size-group,
  #composer-video-mode-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #composer-video-resolution-group {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .composer-mode-actions {
    justify-content: stretch;
  }

  .composer-toggle-chip {
    width: 100%;
  }

  .composer-stage {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: 0;
  }

  .composer-upload-tile {
    min-height: 88px;
  }

  .composer-editor,
  .composer textarea {
    min-height: 96px;
  }

  .composer-footer-row,
  .composer-pill-group,
  .composer-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .composer-select-pill {
    justify-content: space-between;
  }

  .composer-select-pill select {
    min-width: 0;
    width: 100%;
  }

  .composer-price {
    max-width: 100%;
    width: 100%;
    text-align: left;
  }

  .consumption-estimate-card {
    grid-template-columns: 1fr;
  }

  .consumption-estimate-card strong {
    justify-self: start;
  }

  .composer-icon-button,
  .composer-send-button {
    align-self: flex-start;
  }

  .account-center-hero,
  .account-center-head {
    flex-direction: column;
    align-items: stretch;
  }

  .developer-inline-grid {
    grid-template-columns: 1fr;
  }

  .modal-card.auth-modal-card {
    width: min(100%, calc(100vw - 24px));
    padding: 20px;
  }
}
