:root {
  --tiffany: #7dd8d2;
  --tiffany-strong: #0f9f95;
  --tiffany-soft: #e9fbf9;
  --pink: #ffe3e8;
  --pink-soft: #fff7f8;
  --text: #171717;
  --muted: #6b7280;
  --line: #e7e9ee;
  --line-strong: #d9dde5;
  --panel: #ffffff;
  --bg: #f7f8fa;
  --gray: #f3f4f6;
  --danger: #dc2626;
  --warning: #b7791f;
  --success: #12805c;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.055);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-width: 248px;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

/* Mature AI SaaS redesign: ChatGPT + Flow + Vercel */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --tiffany: #14b8a6;
  --tiffany-strong: #0f766e;
  --tiffany-soft: #ecfdf5;
  --indigo: #6366f1;
  --radius: 20px;
  --radius-sm: 14px;
  --sidebar-width: 76px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.05);
}

body {
  background: var(--bg);
}

.app-saas {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
}

.app-sidebar {
  width: var(--sidebar-width);
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
}

.sidebar-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 48px;
  padding: 0;
}

.sidebar-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #111827;
}

.sidebar-brand span:last-child,
.sidebar-foot,
.side-nav .nav-button span,
.admin-tab-label {
  display: none;
}

.side-nav,
.admin-side .admin-tabs {
  gap: 10px;
  justify-items: center;
}

.side-nav .nav-button,
.admin-side .tab-button {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 16px;
  color: #64748b;
}

.side-nav .nav-button svg,
.admin-side .tab-button svg {
  width: 21px;
  height: 21px;
}

.side-nav .nav-button.active,
.admin-side .tab-button.active {
  border-color: transparent;
  background: #111827;
  color: white;
  box-shadow: none;
}

.side-nav .nav-button:hover,
.admin-side .tab-button:hover {
  background: #f1f5f9;
  color: #111827;
}

.topbar {
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-context span {
  color: #94a3b8;
}

.topbar-context strong {
  font-size: 17px;
}

.quota-nav-badge,
.user-chip,
.topbar .icon-button,
.top-actions .icon-button {
  border-color: var(--line);
  box-shadow: none;
}

.main,
.admin-main {
  padding: 28px 34px 36px;
}

.workspace,
.admin-workspace {
  width: min(100%, 1680px);
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: none;
}

.panel-header,
.history-header {
  border-bottom-color: var(--line);
}

.primary-button,
.send-button {
  background: #111827;
  color: #fff;
  box-shadow: none;
}

.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

.status-pill,
.badge,
.credit-pill {
  border-color: rgba(20, 184, 166, 0.18);
  background: #f0fdfa;
  color: #0f766e;
}

/* ChatGPT-like text workspace */
.chat-workbench {
  position: relative;
  min-height: calc(100vh - 128px);
}

.chat-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: calc(100vh - 128px);
  max-width: 1080px;
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-hero-bar,
.flow-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

.chat-history-drawer {
  position: fixed;
  left: calc(var(--sidebar-width) + 18px);
  top: 86px;
  bottom: 24px;
  z-index: 50;
  width: min(320px, calc(100vw - 110px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.chat-history-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-history-drawer .history-header > div {
  display: inline-flex;
  gap: 8px;
}

.message-list {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 0 170px;
}

.message {
  max-width: min(760px, 100%);
}

.bubble {
  border-color: transparent;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

.message.user .bubble {
  background: #f1f5f9;
  border-color: transparent;
  color: #111827;
}

.avatar {
  border: 0;
  background: #f0fdfa;
}

.chat-empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 48vh;
  text-align: center;
}

.chat-empty-state > span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: #111827;
  color: white;
}

.chat-empty-state h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  letter-spacing: -0.04em;
}

.chat-empty-state p {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.chat-shell .composer {
  position: sticky;
  bottom: 20px;
  z-index: 10;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 60px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(18px);
}

.chat-drop-zone,
.chat-input-wrap {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-input-wrap {
  min-height: 60px;
}

/* Flow gallery */
.flow-workbench,
.jimeng-video-layout,
.voice-studio,
.task-workbench {
  min-height: calc(100vh - 128px);
}

.gallery-layout .floating-composer {
  position: static;
  width: 100%;
  max-width: none;
  margin: 0 0 24px;
  padding: 16px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.gallery-layout .capsule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
}

.gallery-layout .capsule-prompt {
  min-height: 54px;
  border-radius: 18px;
  background: #f8fafc;
}

.gallery-layout .composer-options {
  position: absolute;
  top: 156px;
  right: 34px;
  z-index: 20;
  width: min(330px, calc(100vw - 120px));
  grid-template-columns: 1fr;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.flow-masonry,
.jimeng-history-grid {
  display: block;
  column-count: 4;
  column-gap: 22px;
}

.media-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}

.media-card.image .media-surface,
.media-card.video .media-surface,
.media-surface {
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.media-thumb,
.media-card.image img.media-thumb,
.media-card.video .media-thumb {
  width: 100%;
  height: auto;
  min-height: 180px;
  object-fit: cover;
  background: #e5e7eb;
}

.media-card.video video.media-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.media-overlay {
  padding: 68px 14px 14px;
  opacity: 0.96;
}

.media-actions {
  top: 12px;
  right: 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.media-card:hover .media-actions {
  opacity: 1;
  transform: translateY(0);
}

.media-actions .icon-button {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.jimeng-video-toolbar {
  margin-bottom: 18px;
}

.jimeng-hero {
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.jimeng-capsule {
  max-width: none;
  border-radius: 28px;
  border-color: var(--line);
  box-shadow: none;
}

/* Voice studio */
.voice-studio {
  display: grid;
  gap: 22px;
}

.voice-editor {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
}

.voice-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.voice-editor-head h3 {
  margin: 0;
  font-size: 18px;
}

.voice-editor-head span {
  color: var(--muted);
  font-size: 13px;
}

.voice-text {
  min-height: 160px;
  border: 0;
  border-radius: 22px;
  background: #f8fafc;
}

.voice-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.audio-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.audio-card-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.audio-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
}

.audio-card-main strong,
.audio-card-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-card-main span {
  color: var(--muted);
  font-size: 12px;
}

.audio-card audio {
  width: 100%;
  height: 38px;
  border-radius: 999px;
}

/* Task center cards */
.task-card-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.task-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.task-preview {
  width: 96px;
  height: 96px;
  border-radius: 20px;
}

.task-main {
  align-content: start;
  gap: 8px;
}

.task-main .status {
  justify-self: start;
}

.task-row .task-actions {
  grid-column: 2;
  justify-content: flex-start;
}

/* Admin lightweight console */
.admin-main {
  background: var(--bg);
}

.admin-workspace > .panel,
.admin-workspace .panel {
  border-radius: 24px;
  box-shadow: none;
}

.config-list {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  gap: 16px;
}

.feature-config-card {
  border-radius: 22px;
}

.feature-config-card.open {
  grid-column: 1 / -1;
}

.drawer-body {
  border-top: 1px solid var(--line);
  background: #fff;
}

.table-wrap {
  border-radius: 20px;
  box-shadow: none;
}

th,
td {
  border-bottom-color: var(--line);
}

th {
  background: #f8fafc;
}

/* Floating stash as compact material gallery */
.floating-stash.open {
  width: min(420px, calc(100vw - 32px));
}

.stash-dropdown {
  border-radius: 24px;
}

.stash-body {
  grid-template-columns: 1fr;
  max-height: min(430px, calc(100vh - 180px));
}

.stash-item {
  border-radius: 18px;
  background: #f8fafc;
}

.stash-item img,
.stash-item video,
.stash-item-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

@media (max-width: 1280px) {
  .flow-masonry,
  .jimeng-history-grid {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 64px;
  }

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

  .app-sidebar {
    position: sticky;
    top: 0;
    grid-template-columns: 44px minmax(0, 1fr);
    width: auto;
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav,
  .admin-side .admin-tabs {
    display: flex;
    overflow-x: auto;
  }

  .topbar {
    min-height: auto;
    padding: 12px 16px;
  }

  .main,
  .admin-main {
    padding: 18px 14px 28px;
  }

  .flow-masonry,
  .jimeng-history-grid {
    column-count: 2;
  }

  .chat-history-drawer {
    left: 14px;
    top: 140px;
  }

  .gallery-layout .composer-options {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .config-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .flow-masonry,
  .jimeng-history-grid {
    column-count: 1;
  }

  .gallery-layout .capsule-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-layout .capsule-prompt {
    grid-column: 1 / -1;
  }

  .chat-hero-bar,
  .flow-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Final image workspace layout: Flow gallery + bottom prompt dock + right drawer */
.gallery-layout.flow-workbench {
  position: relative;
  min-height: calc(100vh - 128px);
  padding-bottom: 220px;
}

.gallery-layout .flow-topbar {
  position: sticky;
  top: 78px;
  z-index: 18;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(248, 250, 252, 0.72));
  backdrop-filter: blur(12px);
}

.gallery-layout .flow-masonry {
  min-height: 58vh;
  padding-bottom: 22px;
}

.gallery-empty {
  min-height: 58vh;
  border: 1px dashed var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.56);
}

.gallery-layout .floating-composer {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 24px;
  z-index: 60;
  width: min(980px, calc(100vw - var(--sidebar-width) - 68px));
  max-width: none;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(20px);
}

.gallery-layout .capsule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: end;
  gap: 10px;
}

.gallery-layout .capsule-prompt {
  min-height: 56px;
  max-height: 128px;
  padding: 15px 16px;
  border: 0;
  border-radius: 22px;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1.55;
}

.gallery-layout .capsule-row .function-credit-hint {
  align-self: center;
}

.gallery-layout .capsule-icon-button {
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border-radius: 18px;
}

.gallery-layout .capsule-submit-button {
  width: 58px;
  height: 50px;
  border-radius: 18px;
  background: #111827;
}

.gallery-layout .composer-thumbnail-zone {
  justify-content: flex-start;
  padding: 10px 8px 0;
}

.gallery-layout .composer-drop-zone {
  display: none;
}

.gallery-layout .composer-options {
  position: fixed;
  top: 86px;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  width: min(360px, calc(100vw - var(--sidebar-width) - 42px));
  padding: 18px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
  overflow: auto;
}

.gallery-layout .composer-options.hidden {
  display: none !important;
}

.drawer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-panel-head > div {
  display: grid;
  gap: 4px;
}

.drawer-panel-head strong {
  font-size: 16px;
}

.drawer-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gallery-layout .composer-options .field {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .gallery-layout.flow-workbench {
    padding-bottom: 230px;
  }

  .gallery-layout .flow-topbar {
    top: 64px;
  }

  .gallery-layout .floating-composer {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }

  .gallery-layout .composer-options {
    position: fixed;
    top: 84px;
    right: 14px;
    left: 14px;
    bottom: 108px;
    width: auto;
    margin-top: 0;
  }
}

@media (max-width: 560px) {
  .gallery-layout .capsule-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-layout .capsule-row > .capsule-prompt {
    grid-column: 1 / -1;
  }

  .gallery-layout .capsule-row .function-credit-hint {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 6px;
  }
}

/* Image Flow workspace: gallery first, bottom prompt dock, right parameter drawer */
.gallery-layout.flow-workbench {
  position: relative;
  min-height: calc(100vh - 128px);
  padding-bottom: 210px;
}

.gallery-layout .flow-topbar {
  position: sticky;
  top: 78px;
  z-index: 18;
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(248, 250, 252, 0.72));
  backdrop-filter: blur(12px);
}

.gallery-layout .flow-masonry {
  min-height: 58vh;
  padding-bottom: 22px;
}

.gallery-empty {
  min-height: 58vh;
  border: 1px dashed var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.56);
}

.gallery-layout .floating-composer {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 24px;
  z-index: 60;
  width: min(980px, calc(100vw - var(--sidebar-width) - 68px));
  max-width: none;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 70px rgba(15, 23, 42, 0.13);
  backdrop-filter: blur(20px);
}

.gallery-layout .capsule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: end;
  gap: 10px;
}

.gallery-layout .capsule-prompt {
  min-height: 56px;
  max-height: 128px;
  padding: 15px 16px;
  border: 0;
  border-radius: 22px;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1.55;
}

.gallery-layout .capsule-row .function-credit-hint {
  align-self: center;
}

.gallery-layout .capsule-icon-button {
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border-radius: 18px;
}

.gallery-layout .capsule-submit-button {
  width: 58px;
  height: 50px;
  border-radius: 18px;
  background: #111827;
}

.gallery-layout .composer-thumbnail-zone {
  justify-content: flex-start;
  padding: 10px 8px 0;
}

.gallery-layout .composer-drop-zone {
  display: none;
}

.gallery-layout .composer-options {
  position: fixed;
  top: 86px;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  width: min(360px, calc(100vw - var(--sidebar-width) - 42px));
  padding: 18px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
  overflow: auto;
}

.gallery-layout .composer-options.hidden {
  display: none !important;
}

.drawer-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-panel-head > div {
  display: grid;
  gap: 4px;
}

.drawer-panel-head strong {
  font-size: 16px;
}

.drawer-panel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gallery-layout .composer-options .field {
  margin-top: 14px;
}

@media (max-width: 900px) {
  .gallery-layout.flow-workbench {
    padding-bottom: 230px;
  }

  .gallery-layout .flow-topbar {
    top: 64px;
  }

  .gallery-layout .floating-composer {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }

  .gallery-layout .composer-options {
    top: 84px;
    right: 14px;
    left: 14px;
    bottom: 108px;
    width: auto;
  }
}

@media (max-width: 560px) {
  .gallery-layout .capsule-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-layout .capsule-row > .capsule-prompt {
    grid-column: 1 / -1;
  }

  .gallery-layout .capsule-row .function-credit-hint {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 6px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  background: var(--tiffany);
  color: white;
  box-shadow: 0 8px 24px rgba(12, 117, 109, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  font-weight: 800;
  font-size: 18px;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.brand-mark svg,
.icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

button svg,
a svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: block;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
}

.nav-button::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 4px;
  height: 3px;
  border-radius: 99px;
  background: transparent;
}

.nav-button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.nav-button.active {
  color: white;
  font-weight: 700;
}

.nav-button.active::after {
  background: white;
}

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 290px;
}

.quota-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 104px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.quota-nav-badge svg {
  width: 17px;
  height: 17px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 13px;
}

.user-chip-button {
  border: 0;
  cursor: pointer;
}

.admin-user-chip {
  background: var(--tiffany-soft);
  color: #146f69;
}

.profile-area {
  position: relative;
}

.avatar-face {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  overflow: hidden;
  background: var(--avatar-bg, #81d8d0);
  color: #12343a;
  border: 1px solid rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.avatar-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-top {
  width: 28px;
  height: 28px;
}

.avatar-message {
  width: 100%;
  height: 100%;
  border-color: transparent;
}

.avatar-table {
  width: 30px;
  height: 30px;
  border-color: var(--line);
}

.avatar-large {
  width: 58px;
  height: 58px;
  border-color: var(--line);
  font-size: 22px;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: 320px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--text);
  box-shadow: var(--shadow);
}

.profile-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.profile-menu-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-menu-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-menu-list {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.profile-menu-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffe;
}

.profile-menu-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #12343a;
}

.profile-menu-title > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
}

.profile-menu-title svg {
  width: 16px;
  height: 16px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.profile-info-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-info-grid strong {
  min-width: 0;
  overflow: hidden;
  color: #344054;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-balance-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: white;
}

.profile-balance-card > span:last-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-actions input {
  display: none;
}

.avatar-action-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  color: #641626;
}

.avatar-action-button svg {
  width: 22px;
  height: 22px;
  display: block;
}

.icon-button,
.round-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

.icon-button:hover,
.round-button:hover {
  background: rgba(255, 255, 255, 0.32);
}

.main {
  padding: 22px;
}

.workspace {
  max-width: 1440px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(230, 232, 236, 0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: minmax(220px, 285px) minmax(0, 1fr);
  gap: 18px;
}

.sidebar {
  position: sticky;
  top: 84px;
  overflow: hidden;
  align-self: start;
  max-height: calc(100vh - 106px);
  min-height: calc(100vh - 118px);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.history-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 174px);
  overflow: auto;
}

.history-item {
  width: 100%;
  min-height: 68px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 10px;
  text-align: left;
  color: var(--text);
}

.history-item:hover,
.history-item.active {
  background: var(--pink-soft);
  border-color: #f4c4ca;
}

.history-item-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr) auto;
  min-height: calc(100vh - 118px);
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  overflow: auto;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: min(780px, 100%);
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #12756f;
  border: 1px solid #c8eeeb;
}

.message.user .avatar {
  background: var(--pink);
  color: #9b3441;
  border-color: #f2b9c0;
}

.bubble {
  padding: 12px 14px;
  border-radius: 14px;
  background: white;
  border: 1px solid var(--line);
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: 0 6px 14px rgba(37, 51, 63, 0.04);
}

.message-text {
  white-space: pre-wrap;
}

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

.message-retry-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #c8eeeb;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #12756f;
  font-size: 13px;
  font-weight: 800;
}

.message-retry-button svg {
  width: 15px;
  height: 15px;
}

.message-retry-button:hover {
  background: #d4f6f2;
}

.thinking-bubble {
  padding: 10px 14px 12px;
}

.hotpot-thinking {
  position: relative;
  width: 76px;
  height: 48px;
}

.hotpot-rim {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 15px;
  height: 24px;
  border: 2px solid #13817a;
  border-radius: 9px 9px 14px 14px;
  background: linear-gradient(180deg, #eefdfa 0%, #b9f0ea 100%);
  overflow: hidden;
}

.soup-wave {
  position: absolute;
  left: -12px;
  right: -12px;
  top: 7px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 12px 6px, #22a8a0 0 5px, transparent 5.5px),
    radial-gradient(circle at 30px 3px, #22a8a0 0 5px, transparent 5.5px),
    radial-gradient(circle at 48px 6px, #22a8a0 0 5px, transparent 5.5px);
  opacity: 0.75;
  animation: soupWave 1.25s ease-in-out infinite;
}

.hotpot-bowl {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 4px;
  height: 15px;
  border-radius: 0 0 18px 18px;
  background: #13817a;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
}

.steam,
.bubble-dot {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.steam {
  bottom: 36px;
  width: 6px;
  height: 6px;
  background: #81d8d0;
  opacity: 0;
  animation: steamRise 1.8s ease-in-out infinite;
}

.steam.one {
  left: 23px;
}

.steam.two {
  left: 36px;
  animation-delay: 0.35s;
}

.steam.three {
  left: 50px;
  animation-delay: 0.7s;
}

.bubble-dot {
  bottom: 7px;
  width: 4px;
  height: 4px;
  background: #ffffff;
  animation: brothBubble 1.2s ease-in-out infinite;
}

.dot-one {
  left: 13px;
}

.dot-two {
  left: 26px;
  animation-delay: 0.25s;
}

.dot-three {
  left: 38px;
  animation-delay: 0.55s;
}

@keyframes steamRise {
  0% {
    transform: translateY(8px) scale(0.65);
    opacity: 0;
  }
  35% {
    opacity: 0.95;
  }
  100% {
    transform: translateY(-14px) scale(1.15);
    opacity: 0;
  }
}

@keyframes soupWave {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(9px);
  }
}

@keyframes brothBubble {
  0%,
  100% {
    transform: translateY(4px) scale(0.7);
    opacity: 0.3;
  }
  45% {
    transform: translateY(-4px) scale(1.05);
    opacity: 1;
  }
}

.message.user .bubble {
  background: var(--pink);
  border-color: #f3bec5;
}

.composer {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.chat-input-wrap {
  display: grid;
  grid-template-columns: 40px 1fr 44px;
  gap: 10px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: white;
  box-shadow: 0 8px 24px rgba(37, 51, 63, 0.06);
}

.chat-drop-zone,
.composer-drop-zone {
  border-radius: 24px;
}

.chat-drop-zone.dragging,
.composer-drop-zone.dragging,
.floating-composer.dragging {
  outline: 2px dashed var(--tiffany-strong);
  outline-offset: 4px;
}

.drop-hint,
.composer-footline {
  margin: 8px 18px 0;
  color: var(--muted);
  font-size: 12px;
}

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

.upload-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: #146f69;
  background: var(--tiffany-soft);
}

.upload-icon-button input,
.upload-pill input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 10px 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-height: 32px;
  padding: 0 7px 0 10px;
  border-radius: 999px;
  background: var(--pink-soft);
  border: 1px solid #f1c9cf;
  color: #7a4550;
  font-size: 12px;
  font-weight: 700;
}

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

.attachment-chip button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: white;
  color: #9b3441;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.message-attachment {
  margin: 0;
}

.message-attachment img,
.message-attachment video {
  display: block;
  max-width: min(360px, 100%);
  max-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
}

.message-attachment figcaption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.chat-input-wrap textarea {
  resize: none;
  min-height: 34px;
  max-height: 150px;
  padding: 8px 12px 8px 16px;
  border: 0;
  outline: none;
  background: transparent;
  line-height: 1.45;
}

.send-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--tiffany);
  color: #083f3b;
  font-weight: 800;
}

.send-button {
  width: 44px;
  height: 44px;
  color: white;
  background: var(--tiffany-strong);
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  white-space: nowrap;
}

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

.secondary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.secondary-button {
  background: var(--pink-soft);
  border-color: #f1c9cf;
}

.ghost-button {
  background: transparent;
}

.danger-button {
  color: var(--danger);
  border-color: #ffd0cc;
  background: #fff7f6;
}

.profile-actions .avatar-upload-action,
.profile-avatar-row .avatar-upload-action {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  background: #e8fbf8;
  border-color: #b8eee8;
  color: #0f827b;
}

.profile-actions .avatar-upload-action svg,
.profile-avatar-row .avatar-upload-action svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.8;
}

.gallery-layout {
  position: relative;
  min-height: calc(100vh - 118px);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
  font-size: 12px;
  font-weight: 700;
}

.badge.pink {
  background: var(--pink-soft);
  color: #9b3441;
}

.jimeng-video-layout {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 118px);
}

.jimeng-video-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.jimeng-hero {
  display: block;
  padding: 0;
}

.jimeng-capsule {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(129, 216, 208, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(37, 51, 63, 0.08);
}

.jimeng-mode-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.mode-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
}

.jimeng-mode-strip select,
.jimeng-param select,
.jimeng-param input {
  border: 0;
  outline: none;
  background: transparent;
  color: #12343a;
  font: inherit;
  font-weight: 800;
}

.model-chip {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.jimeng-capsule textarea {
  width: 100%;
  min-height: 58px;
  max-height: 118px;
  border: 0;
  outline: none;
  padding: 4px 4px 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}

.jimeng-reference-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.jimeng-ref-thumb,
.jimeng-upload-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(129, 216, 208, 0.74);
  border-radius: 16px;
  overflow: hidden;
  background: #f8fffe;
  color: #146f69;
}

.jimeng-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jimeng-ref-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #146f69;
  font-size: 11px;
  font-weight: 900;
}

.jimeng-ref-thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #9b3441;
}

.jimeng-upload-chip input {
  display: none;
}

.jimeng-drop-tip {
  color: var(--muted);
  font-size: 12px;
}

.jimeng-control-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.jimeng-param {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfffe;
  color: #146f69;
}

.jimeng-param svg {
  width: 16px;
  height: 16px;
}

.jimeng-param.seed {
  width: 98px;
}

.jimeng-param.seed input {
  min-width: 0;
  width: 42px;
}

.jimeng-submit {
  min-width: 112px;
  min-height: 38px;
  margin-left: auto;
  box-shadow: 0 10px 22px rgba(40, 170, 160, 0.2);
}

.jimeng-clear {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.jimeng-history-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.video-canvas-layout {
  min-height: calc(100vh - 118px);
}

.video-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.video-canvas-shell {
  display: grid;
  grid-template-columns: 92px minmax(720px, 1fr) 260px;
  gap: 14px;
  min-height: calc(100vh - 188px);
}

.video-node-palette,
.video-inspector {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.video-node-palette {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.palette-item {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfffe;
  color: #146f69;
  font-size: 11px;
}

.palette-item span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--tiffany-soft);
}

.video-canvas-stage {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(129, 216, 208, 0.55);
  border-radius: 18px;
  background:
    linear-gradient(rgba(40, 170, 160, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 170, 160, 0.06) 1px, transparent 1px),
    #fbfffe;
  background-size: 28px 28px;
  box-shadow: var(--shadow-soft);
}

.canvas-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.canvas-lines path {
  fill: none;
  stroke: rgba(40, 170, 160, 0.42);
  stroke-width: 3;
  stroke-linecap: round;
}

.canvas-node {
  position: absolute;
  z-index: 2;
  width: 250px;
  padding: 12px;
  border: 1px solid rgba(129, 216, 208, 0.7);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 30px rgba(37, 51, 63, 0.1);
}

.node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #12343a;
  cursor: grab;
  user-select: none;
}

.node-head span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
}

.canvas-node textarea,
.canvas-node select,
.canvas-node input:not([type="file"]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  font: inherit;
}

.canvas-node textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.45;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.node-output {
  width: 260px;
}

.canvas-reference-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.canvas-ref-thumb,
.canvas-upload-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(129, 216, 208, 0.75);
  border-radius: 14px;
  background: #f8fffe;
  color: #146f69;
  overflow: hidden;
}

.canvas-ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-ref-thumb span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #146f69;
  font-size: 11px;
  font-weight: 900;
}

.canvas-ref-thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #9b3441;
}

.canvas-upload-tile input {
  display: none;
}

.canvas-output-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: var(--gray);
}

.canvas-output-preview img,
.canvas-output-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.canvas-output-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.canvas-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

.canvas-output-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  border-radius: 12px;
  background: var(--gray);
  color: var(--muted);
}

.canvas-drop-hint {
  position: absolute;
  left: 18px;
  bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.video-inspector {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.panel-section {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-section span {
  color: var(--muted);
  font-size: 12px;
}

.video-generate-button {
  width: 100%;
}

.video-timeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.video-timeline span {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 10px;
  background: var(--tiffany-soft);
  color: #146f69;
  font-weight: 800;
}

.canvas-task-list {
  display: grid;
  gap: 8px;
}

.canvas-task-mini {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}

.canvas-task-mini strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.canvas-task-mini small {
  overflow: hidden;
  color: var(--danger);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 124px;
}

.media-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border-radius: var(--radius);
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.media-card.image {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.media-surface {
  position: relative;
}

.media-card.image .media-surface {
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: 0 18px 42px rgba(31, 41, 48, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.media-card.image .media-surface:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 54px rgba(31, 41, 48, 0.18);
}

.media-card.image .media-open {
  position: relative;
  z-index: 1;
  background: transparent;
}

.media-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  background: var(--gray);
}

.media-card.image img.media-thumb {
  position: relative;
  z-index: 2;
  height: auto;
  aspect-ratio: auto;
  object-fit: initial;
  background: transparent;
}

.media-card.video .media-thumb {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-body {
  padding: 12px;
}

.media-prompt {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.media-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.media-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  padding: 50px 12px 12px;
  color: white;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 17, 19, 0), rgba(9, 17, 19, 0.22) 26%, rgba(9, 17, 19, 0.72));
}

.media-overlay .media-prompt {
  min-height: 0;
  color: white;
  font-size: 13px;
  line-height: 1.42;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.32);
}

.media-overlay .media-meta {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.86);
}

.media-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 4;
}

.media-surface[data-media-drag] {
  cursor: grab;
}

.media-surface[data-media-drag] .media-thumb {
  pointer-events: none;
}

.media-surface.dragging-media {
  opacity: 0.72;
  cursor: grabbing;
  outline: 2px solid var(--tiffany-strong);
  outline-offset: 3px;
}

.media-actions .icon-button {
  width: 34px;
  height: 34px;
  color: #18433f;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 18px rgba(37, 51, 63, 0.12);
}

.media-actions .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.media-actions .danger-lite {
  color: #9b3441;
}

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(0, 0, 0, 0.12);
}

.play-cover span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: rgba(40, 170, 160, 0.9);
}

.floating-composer {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 25;
  width: min(760px, calc(100vw - 56px));
  border: 1px solid rgba(129, 216, 208, 0.55);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.capsule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  align-items: center;
  gap: 7px;
  padding: 8px;
}

.capsule-row .capsule-prompt {
  min-width: 0;
  min-height: 38px;
  max-height: 96px;
  padding: 8px 12px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  line-height: 1.45;
  resize: none;
  overflow-y: auto;
  white-space: pre-wrap;
}

.capsule-row .secondary-button,
.capsule-row .primary-button {
  min-height: 40px;
  padding: 0;
  gap: 0;
  font-size: 0;
  line-height: 1;
}

.capsule-row .secondary-button svg,
.capsule-row .primary-button svg {
  width: 18px;
  height: 18px;
}

.capsule-row .capsule-icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--tiffany);
  color: #083f3b;
}

.capsule-row .capsule-icon-button:hover {
  filter: brightness(0.96);
}

.capsule-row .capsule-upload-button {
  border: 1px solid rgba(40, 170, 160, 0.28);
  background: var(--tiffany-soft);
  color: #146f69;
}

.capsule-row .capsule-submit-button {
  background: var(--tiffany-strong);
  color: white;
  box-shadow: 0 8px 18px rgba(40, 170, 160, 0.24);
}

.capsule-row .capsule-submit-button svg {
  width: 19px;
  height: 19px;
}

.composer-thumbnail-zone {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 8px 8px;
}

.composer-thumb {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(129, 216, 208, 0.75);
  border-radius: 999px;
  background: #f8fffe;
  color: #146f69;
  box-shadow: 0 6px 14px rgba(37, 51, 63, 0.06);
}

.composer-thumb img {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
}

.composer-thumb > svg {
  width: 20px;
  height: 20px;
}

.composer-thumb button {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #f4c4ca;
  border-radius: 999px;
  background: white;
  color: #9b3441;
  box-shadow: 0 4px 10px rgba(37, 51, 63, 0.12);
}

.composer-thumb button svg {
  width: 11px;
  height: 11px;
}

.floating-stash {
  position: fixed;
  z-index: 1000;
  color: var(--text);
  touch-action: none;
  contain: layout style;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
  transition:
    opacity 160ms ease,
    box-shadow 160ms ease;
}

.floating-stash.open {
  width: min(380px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  overflow: visible;
}

.floating-stash.collapsed {
  width: 58px;
  height: 58px;
}

.floating-stash.dragging {
  opacity: 0.96;
  transition: none !important;
  user-select: none;
}

.floating-stash.dragging .stash-trigger,
.floating-stash.dragging .stash-dropdown {
  box-shadow: 0 18px 42px rgba(37, 51, 63, 0.18);
}

.floating-stash.drag-over {
  box-shadow: none;
}

.floating-stash.open.drag-over .stash-dropdown {
  border-color: var(--tiffany-strong);
  box-shadow: 0 0 0 5px rgba(40, 170, 160, 0.18), var(--shadow);
}

.floating-stash.collapsed.drag-over .stash-trigger {
  background: var(--tiffany-strong);
  color: white;
  box-shadow: 0 0 0 5px rgba(40, 170, 160, 0.2), var(--shadow);
}

.stash-trigger {
  position: relative;
  order: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(129, 216, 208, 0.68);
  border-radius: 999px;
  background: var(--tiffany);
  color: #083f3b;
  box-shadow: var(--shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.stash-trigger.active {
  background: var(--tiffany-strong);
  color: white;
}

.floating-stash.dragging .stash-trigger,
.floating-stash.dragging .stash-head {
  cursor: grabbing;
}

.stash-trigger svg {
  width: 34px;
  height: 34px;
  stroke-width: 2.1;
}

.stash-trigger span {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid white;
  border-radius: 999px;
  background: var(--pink);
  color: #641626;
  font-size: 11px;
  font-weight: 900;
}

.stash-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 5px 7px 5px 10px;
  border-radius: 15px 15px 0 0;
  background: var(--pink-soft);
  border-bottom: 1px solid rgba(244, 196, 202, 0.64);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.stash-dropdown {
  order: 1;
  width: 100%;
  overflow: visible;
  border: 1px solid rgba(244, 196, 202, 0.82);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.stash-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.stash-head strong {
  font-size: 13px;
  line-height: 1.2;
}

.stash-head span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stash-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stash-head-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(244, 196, 202, 0.8);
  border-radius: 999px;
  background: white;
  color: #641626;
}

.stash-head-button svg {
  width: 15px;
  height: 15px;
}

.stash-dock-menu {
  position: absolute;
  top: 36px;
  right: 7px;
  z-index: 2;
  display: grid;
  width: 136px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 30px rgba(37, 51, 63, 0.14);
}

.stash-dock-menu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.stash-dock-menu button:hover {
  background: var(--pink-soft);
}

.stash-dock-menu svg {
  width: 15px;
  height: 15px;
  color: var(--tiffany-strong);
}

.stash-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  background: #fffefe;
}

.stash-tabs button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 34px;
  padding: 4px 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.stash-tabs button svg {
  width: 14px;
  height: 14px;
}

.stash-tabs button small {
  display: grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--gray);
  color: #344054;
  font-size: 9px;
  line-height: 1;
}

.stash-tabs button.active {
  border-color: rgba(40, 170, 160, 0.42);
  background: var(--tiffany-soft);
  color: #0f827b;
}

.stash-tabs button.active small {
  background: var(--tiffany);
  color: #083f3b;
}

.stash-body {
  display: grid;
  gap: 8px;
  max-height: min(390px, calc(100vh - 160px));
  overflow: auto;
  padding: 10px;
}

.stash-text-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border: 1px solid rgba(40, 170, 160, 0.38);
  border-radius: 12px;
  background: #fbfffe;
}

.stash-text-input {
  min-height: 78px;
  max-height: 150px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  outline: none;
  font-size: 13px;
  line-height: 1.55;
}

.stash-text-input:focus {
  border-color: var(--tiffany-strong);
  box-shadow: 0 0 0 3px rgba(40, 170, 160, 0.12);
}

.stash-text-add {
  display: grid;
  place-items: center;
  width: 38px;
  border: 0;
  border-radius: 999px;
  background: var(--tiffany);
  color: #083f3b;
}

.stash-text-add svg {
  width: 18px;
  height: 18px;
}

.stash-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 152px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.stash-empty svg {
  width: 30px;
  height: 30px;
  color: var(--tiffany-strong);
}

.stash-empty strong {
  color: var(--text);
  font-size: 14px;
}

.stash-empty span {
  max-width: 210px;
  font-size: 12px;
  line-height: 1.5;
}

.stash-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.stash-item.text {
  grid-template-columns: 42px minmax(0, 1fr);
  border-color: rgba(129, 216, 208, 0.58);
  background: #fbfffe;
}

.stash-item img,
.stash-item video,
.stash-item-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--gray);
}

.stash-item img,
.stash-item video {
  object-fit: cover;
}

.stash-item-icon {
  display: grid;
  place-items: center;
  color: #146f69;
  background: var(--tiffany-soft);
}

.stash-item-icon svg {
  width: 22px;
  height: 22px;
}

.stash-item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stash-item-main strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stash-item-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stash-item-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.stash-text-content {
  grid-column: 1 / -1;
  max-height: 112px;
  overflow: auto;
  margin: 0;
  padding: 9px 10px;
  border-radius: 10px;
  background: white;
  color: #344054;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.stash-audio {
  grid-column: 1 / -1;
  width: 100%;
  height: 32px;
}

[data-media-drag] {
  cursor: grab;
}

.stash-item-actions .icon-button {
  width: 30px;
  height: 30px;
  color: #146f69;
  background: var(--tiffany-soft);
  border: 1px solid rgba(129, 216, 208, 0.62);
}

.stash-item-actions .danger-lite {
  color: #9b3441;
  background: var(--pink-soft);
  border-color: rgba(244, 196, 202, 0.78);
}

.stash-item-actions svg {
  width: 15px;
  height: 15px;
}

.composer-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.composer-drop-zone {
  display: grid;
  gap: 2px;
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
}

.composer-drop-zone .attachment-strip {
  padding: 0;
}

.upload-pill {
  position: relative;
  min-width: 40px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: white;
  color: var(--text);
  outline: none;
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

.voice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
}

.voice-editor {
  padding: 18px;
}

.voice-text {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  background: #f8fafb;
  font-size: 16px;
  line-height: 1.7;
}

.voice-controls {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

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

.voice-card {
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: left;
}

.voice-card.active {
  border-color: var(--tiffany-strong);
  background: var(--tiffany-soft);
}

.voice-card strong {
  display: block;
  font-size: 14px;
}

.voice-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

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

.slider-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.slider-field label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.slider-field input {
  width: 100%;
  accent-color: var(--tiffany-strong);
}

.player-panel {
  padding: 16px;
}

.audio-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--pink-soft);
}

.audio-card audio {
  width: 100%;
}

.history-drawer {
  min-height: calc(100vh - 118px);
}

.task-tabs,
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-weight: 700;
}

.tab-button.active {
  background: var(--tiffany);
  border-color: var(--tiffany);
  color: #063d39;
}

.task-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.task-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.task-preview {
  display: grid;
  place-items: center;
  width: 74px;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gray);
  color: var(--muted);
}

.task-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-main {
  min-width: 0;
}

.task-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-main small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

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

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.status.compact {
  min-width: 48px;
  min-height: 28px;
  padding: 0 10px;
}

.status.completed {
  background: #e8f7ef;
  color: var(--success);
}

.status.running,
.status.queued {
  background: #fff4dc;
  color: var(--warning);
}

.status.failed {
  background: #fff0ef;
  color: var(--danger);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
}

.empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 17px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 450px);
  background: #fbfeff;
}

.login-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 58px;
  background: #f3fbfa;
  border-right: 1px solid #d7f2ef;
}

.login-hero-brand {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.login-hero-brand .brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.62);
  color: #146f69;
}

.login-hero-brand .brand-mark svg {
  width: 28px;
  height: 28px;
}

.login-hero-title {
  margin: 0;
  max-width: 680px;
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: 0;
}

.login-hero-subtitle {
  margin: 0;
  color: #53636d;
  font-size: clamp(18px, 2vw, 26px);
  font-weight: 800;
  line-height: 1.35;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
}

.feature-tile {
  min-height: 104px;
  padding: 14px;
  border: 1px solid #d5f0ee;
  border-radius: var(--radius);
  background: white;
}

.feature-tile strong {
  display: block;
  margin-top: 12px;
}

.feature-tile span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.login-card-wrap {
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: 100%;
  max-width: 390px;
  padding: 24px;
}

.login-card h1 {
  margin: 0;
  font-size: 24px;
}

.login-card p {
  margin: 8px 0 22px;
  color: var(--muted);
  line-height: 1.55;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-switch-button {
  width: 100%;
  justify-content: center;
  margin-top: 12px;
}

.hint-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--pink-soft);
  color: #7a4550;
  font-size: 13px;
  line-height: 1.55;
}

.admin-shell {
  min-height: 100vh;
  background: #f8fafb;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.admin-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.admin-side {
  align-self: start;
  padding: 12px;
}

.admin-side .tab-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  padding: 0 42px;
  border-radius: 10px;
  text-align: center;
}

.admin-side .tab-button svg {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.admin-tab-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: nowrap;
}

.admin-side .tab-button::after {
  content: none;
}

.admin-side .admin-tabs {
  display: grid;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.form-grid.compact {
  padding: 14px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

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

.inline-check input {
  width: auto;
  min-height: auto;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--line);
}

.access-code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid rgba(40, 170, 160, 0.28);
  border-radius: 10px;
  background: var(--tiffany-soft);
}

.access-code-card div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.access-code-card span {
  color: #146f69;
  font-size: 13px;
  font-weight: 800;
}

.access-code-card code {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 8px;
  background: white;
  color: #17423e;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.access-code-card small {
  color: var(--muted);
  line-height: 1.45;
}

.config-list {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.feature-config-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.config-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.config-card-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.drawer-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: #146f69;
}

.drawer-toggle:hover {
  background: var(--tiffany-soft);
  border-color: rgba(40, 170, 160, 0.32);
}

.drawer-toggle svg {
  width: 16px;
  height: 16px;
}

.feature-config-card.open .config-card-head {
  border-bottom-color: rgba(40, 170, 160, 0.24);
  background: linear-gradient(0deg, rgba(228, 251, 249, 0.55), rgba(255, 255, 255, 0.92));
}

.drawer-body {
  background: white;
}

.config-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.config-card-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.gemini-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 0;
}

.config-chip {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffefe;
}

.config-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.config-chip code {
  justify-self: start;
  max-width: 100%;
  overflow-wrap: anywhere;
  border-radius: 8px;
  padding: 6px 8px;
  background: #eef2f4;
  color: #304457;
  font-size: 12px;
}

.gemini-fields {
  padding-top: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  background: #fbfcfd;
}

.member-table {
  min-width: 1120px;
}

.member-table th,
.member-table td {
  padding: 10px 12px;
  white-space: nowrap;
}

.member-table td:nth-child(1),
.member-table td:nth-child(2) {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-identity {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.member-identity strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f4f6f8;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.usage-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.usage-mini span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f4f6f8;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.usage-mini .usage-credit svg {
  width: 13px;
  height: 13px;
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.member-actions .compact-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
}

.bulk-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffe;
}

.member-select-all,
.quota-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tiny-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.tiny-action svg {
  width: 15px;
  height: 15px;
}

.danger-action {
  border-color: #f3bec5 !important;
  background: var(--pink-soft) !important;
  color: #9b3441 !important;
}

.credit-rule-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.credit-rule-card {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 128px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfffe;
}

.credit-rule-card strong {
  color: var(--text);
}

.credit-rule-card span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.credit-icon,
.credit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #146f69;
}

.credit-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--tiffany-soft);
}

.credit-icon svg {
  width: 20px;
  height: 20px;
}

.credit-pill {
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.credit-pill svg {
  width: 15px;
  height: 15px;
}

.function-credit-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.function-credit-hint.insufficient {
  color: #b42318;
}

.function-credit-hint.insufficient .credit-pill {
  background: #fff0ed;
  color: #b42318;
}

.credit-hint-separator {
  width: 1px;
  height: 14px;
  background: rgba(17, 24, 39, 0.12);
}

.credit-hint-balance {
  max-width: 160px;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
}

.workflow-notice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 11px 12px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 14px;
  background: #fff7f5;
  color: #b42318;
}

.workflow-notice > span:first-child {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fff0ed;
}

.workflow-notice svg {
  width: 18px;
  height: 18px;
}

.workflow-notice strong,
.workflow-notice small {
  display: block;
}

.workflow-notice strong {
  color: #8f1d12;
  font-size: 13px;
  font-weight: 900;
}

.workflow-notice small {
  margin-top: 2px;
  color: #b42318;
  line-height: 1.45;
}

.creative-empty-state > div {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.creative-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: var(--primary);
}

.creative-empty-icon svg {
  width: 22px;
  height: 22px;
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.send-button:disabled,
.icon-button:disabled,
.capsule-submit-button:disabled,
.jimeng-submit:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
}

.is-loading svg {
  transform-origin: center;
  animation: hotpot-spin 0.9s linear infinite;
}

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

.quota-table {
  min-width: 980px;
}

.quota-table th,
.quota-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.quota-input {
  width: 138px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  font: inherit;
}

.quota-progress {
  width: 120px;
  height: 10px;
  border-radius: 999px;
  background: #edf2f4;
  overflow: hidden;
}

.quota-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--tiffany-strong);
}

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

.voice-submit-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.usage-rank-table {
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
}

.usage-rank-table th,
.usage-rank-table td {
  padding: 14px 18px;
}

.usage-rank-table th {
  border-bottom: 1px solid var(--line-strong);
  background: #f3f6f8;
}

.usage-rank-table tbody tr:nth-child(odd) {
  background: #fffefe;
}

.usage-rank-table tbody tr:nth-child(even) {
  background: #f8fafb;
}

.usage-rank-table tbody tr:hover {
  background: var(--tiffany-soft);
}

.usage-rank-table th:not(:first-child),
.usage-rank-table td:not(:first-child) {
  text-align: center;
}

.usage-rank-table td:first-child {
  border-left: 4px solid transparent;
}

.usage-rank-table tbody tr:hover td:first-child {
  border-left-color: var(--tiffany-strong);
}

.usage-rank-table td span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 30px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: #344054;
  font-weight: 800;
}

.usage-rank-table td:last-child span {
  min-width: 74px;
  background: #f4f6f8;
}

.usage-rank-table td .credit-pill,
.usage-rank-table td .credit-pill span {
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.usage-rank-table td .credit-pill {
  gap: 5px;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: #146f69;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1050;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: #24303a;
  color: white;
  box-shadow: var(--shadow);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

/* SaaS workspace refactor */
.app-saas {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(125, 216, 210, 0.16), transparent 34vw),
    linear-gradient(180deg, #fbfcfd 0%, var(--bg) 42%, #f5f6f8 100%);
}

.app-body {
  min-width: 0;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 22px;
  height: 100vh;
  padding: 18px 14px;
  border-right: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px;
  border-radius: 16px;
  color: var(--text);
}

.sidebar-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(15, 159, 149, 0.16);
  border-radius: 14px;
  background: #111827;
  color: white;
}

.sidebar-brand .brand-mark svg {
  width: 23px;
  height: 23px;
}

.sidebar-brand span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-brand strong {
  overflow: hidden;
  font-size: 15px;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-nav .nav-button,
.admin-side .tab-button {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #4b5563;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
}

.side-nav .nav-button::after,
.admin-side .tab-button::after {
  content: none;
}

.side-nav .nav-button svg,
.admin-side .tab-button svg {
  position: static;
  width: 18px;
  height: 18px;
  transform: none;
}

.side-nav .nav-button:hover,
.admin-side .tab-button:hover {
  border-color: rgba(226, 232, 240, 0.9);
  background: rgba(249, 250, 251, 0.92);
  color: #111827;
}

.side-nav .nav-button.active,
.admin-side .tab-button.active {
  border-color: rgba(15, 159, 149, 0.2);
  background: linear-gradient(180deg, #ffffff, #f1fbfa);
  color: #0f766e;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.admin-tab-label {
  position: static;
  width: auto;
  transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-foot {
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 250, 251, 0.9));
}

.sidebar-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-foot strong {
  font-size: 13px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.topbar-context {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topbar-context span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-context strong {
  font-size: 18px;
  letter-spacing: 0;
}

.top-actions {
  min-width: 0;
  gap: 10px;
}

.topbar .icon-button,
.top-actions .icon-button {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: white;
  color: #374151;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.topbar .icon-button:hover,
.top-actions .icon-button:hover {
  background: #f9fafb;
}

.quota-nav-badge,
.user-chip {
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: white;
  color: #111827;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.quota-nav-badge {
  min-width: 92px;
}

.quota-nav-badge svg {
  color: #0f766e;
}

.main,
.admin-main {
  padding: 28px;
}

.workspace,
.admin-workspace {
  width: min(100%, 1480px);
  max-width: none;
  margin: 0 auto;
}

.panel {
  border-color: rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 22px 60px rgba(15, 23, 42, 0.045);
}

.panel-header {
  padding: 18px 20px;
  border-bottom-color: rgba(226, 232, 240, 0.88);
}

.panel-title {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  color: #6b7280;
}

.primary-button,
.send-button {
  background: #111827;
  color: white;
  box-shadow: 0 12px 26px rgba(17, 24, 39, 0.12);
}

.secondary-button,
.ghost-button,
.danger-button {
  border-color: rgba(226, 232, 240, 0.95);
  background: white;
  color: #1f2937;
}

.secondary-button {
  background: #ffffff;
}

.status-pill,
.badge,
.credit-pill {
  border: 1px solid rgba(15, 159, 149, 0.16);
  background: #eefbf9;
  color: #0f766e;
}

.badge.pink {
  border-color: rgba(226, 232, 240, 0.9);
  background: #f8fafc;
  color: #4b5563;
}

.split {
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  top: 96px;
  max-height: calc(100vh - 124px);
  min-height: calc(100vh - 132px);
}

.history-header {
  padding: 16px;
}

.history-item {
  border-radius: 12px;
}

.history-item:hover,
.history-item.active {
  border-color: rgba(15, 159, 149, 0.18);
  background: #f1fbfa;
}

.chat-shell {
  min-height: calc(100vh - 124px);
}

.message-list {
  padding: 24px;
}

.bubble {
  border-color: rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045);
}

.message.user .bubble {
  background: #111827;
  border-color: #111827;
  color: white;
}

.message.user .avatar {
  background: #111827;
  color: white;
  border-color: #111827;
}

.composer,
.chat-drop-zone,
.floating-composer,
.jimeng-capsule {
  border-color: rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.gallery-layout,
.jimeng-video-layout {
  min-height: calc(100vh - 124px);
}

.toolbar {
  margin-bottom: 18px;
}

.gallery-grid,
.jimeng-history-grid {
  gap: 18px;
}

.media-actions .icon-button {
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
}

.feature-config-card,
.config-chip,
.credit-rule-card,
.access-code-card,
.stat-card {
  border-color: rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.035);
}

.config-card-head {
  padding: 16px 18px;
  border-bottom-color: rgba(226, 232, 240, 0.88);
  background: linear-gradient(180deg, #ffffff, #fbfcfd);
}

.feature-config-card.open .config-card-head {
  background: linear-gradient(180deg, #ffffff, #f4fbfa);
}

.drawer-toggle {
  border-color: rgba(226, 232, 240, 0.95);
  color: #111827;
}

.drawer-toggle:hover {
  background: #f8fafc;
}

.table-wrap {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 16px;
  background: white;
}

.table-wrap table {
  overflow: hidden;
}

th {
  background: #f9fafb;
  color: #6b7280;
  letter-spacing: 0.04em;
}

tbody tr:hover {
  background: #fbfefd;
}

.bulk-action-bar {
  border-color: rgba(226, 232, 240, 0.92);
  background: white;
}

.quota-input,
.field input,
.field select,
.field textarea,
.stash-text-input {
  border-color: rgba(209, 213, 219, 0.88);
  border-radius: 12px;
  background: #ffffff;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.stash-text-input:focus {
  border-color: rgba(15, 159, 149, 0.58);
  box-shadow: 0 0 0 4px rgba(15, 159, 149, 0.09);
}

.floating-stash {
  z-index: 70;
}

.stash-trigger {
  border-color: rgba(17, 24, 39, 0.08);
  background: #111827;
  color: white;
}

.stash-dropdown {
  border-color: rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(16px);
}

.stash-head {
  border-bottom-color: rgba(226, 232, 240, 0.86);
  background: #ffffff;
}

.stash-tabs {
  border-bottom-color: rgba(226, 232, 240, 0.86);
  background: #fbfcfd;
}

.stash-tabs button {
  border-color: rgba(226, 232, 240, 0.86);
  background: white;
}

.stash-tabs button.active {
  border-color: rgba(15, 159, 149, 0.24);
  background: #eefbf9;
  color: #0f766e;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 88px;
  }

  .app-sidebar {
    padding: 14px 10px;
  }

  .sidebar-brand {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .sidebar-brand span:last-child,
  .sidebar-foot {
    display: none;
  }

  .side-nav .nav-button,
  .admin-side .tab-button {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0;
    min-height: 48px;
    padding: 0;
  }

  .side-nav .nav-button span,
  .admin-tab-label {
    display: none;
  }

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

  .voice-layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-side .admin-tabs {
    display: grid;
  }

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

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

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

  .app-sidebar {
    position: sticky;
    top: 0;
    z-index: 55;
    grid-template-rows: auto;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
  }

  .sidebar-brand {
    grid-template-columns: 36px;
    padding: 0;
  }

  .sidebar-brand .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }

  .side-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
  }

  .side-nav .nav-button,
  .admin-side .tab-button {
    flex: 0 0 44px;
    min-height: 40px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    min-height: auto;
    padding: 12px;
  }

  .brand,
  .top-actions {
    min-width: 0;
  }

  .top-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    width: 100%;
  }

  .main {
    padding: 14px;
  }

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

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

  .history-list {
    max-height: none;
  }

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

  .video-canvas-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .jimeng-video-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .video-node-palette {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .video-canvas-stage {
    min-height: 880px;
  }

  .canvas-lines {
    display: none;
  }

  .voice-cards,
  .feature-strip,
  .form-grid,
  .gemini-summary,
  .composer-options {
    grid-template-columns: 1fr;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: auto;
    padding: 34px 24px;
  }

  .login-hero-title {
    font-size: 48px;
  }

  .task-row {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .task-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .access-code-card {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .profile-menu {
    right: auto;
    left: 0;
    width: min(320px, calc(100vw - 24px));
  }

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

  .jimeng-hero {
    padding: 0;
  }

  .jimeng-capsule {
    border-radius: 18px;
    padding: 10px;
  }

  .jimeng-capsule textarea {
    font-size: 16px;
  }

  .jimeng-control-row {
    align-items: stretch;
  }

  .jimeng-param,
  .jimeng-submit {
    flex: 1 1 calc(50% - 8px);
  }

  .jimeng-submit {
    margin-left: 0;
  }

  .jimeng-history-grid {
    grid-template-columns: 1fr;
  }

  .video-node-palette {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .canvas-node {
    position: static;
    width: auto;
    margin: 10px;
  }

  .video-canvas-stage {
    min-height: 0;
    padding: 8px 0 42px;
  }

  .floating-composer {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

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

  .capsule-row > .capsule-prompt {
    grid-column: 1 / -1;
  }

  .composer-thumbnail-zone {
    justify-content: flex-start;
    padding: 0 8px 8px;
  }

  .capsule-row .secondary-button,
  .capsule-row .primary-button {
    width: 100%;
    min-width: 0;
    padding: 0;
    font-size: 0;
  }

  .slider-grid,
  .stats-grid,
  .credit-rule-grid {
    grid-template-columns: 1fr;
  }
}

/* Final product-level override: make the app feel like ChatGPT + Flow + Vercel */
:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --tiffany: #14b8a6;
  --tiffany-strong: #0f766e;
  --tiffany-soft: #f0fdfa;
  --indigo: #6366f1;
  --radius: 20px;
  --sidebar-width: 76px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.05);
}

body {
  background: var(--bg);
}

.app-saas {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  background: var(--bg);
}

.app-sidebar {
  width: var(--sidebar-width);
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 48px;
  padding: 0;
}

.sidebar-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: #111827;
  color: #fff;
}

.sidebar-brand span:last-child,
.sidebar-foot,
.side-nav .nav-button span,
.admin-tab-label {
  display: none;
}

.side-nav,
.admin-side .admin-tabs {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.side-nav .nav-button,
.admin-side .tab-button {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  width: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
}

.side-nav .nav-button svg,
.admin-side .tab-button svg {
  position: static;
  width: 21px;
  height: 21px;
  transform: none;
}

.side-nav .nav-button.active,
.admin-side .tab-button.active {
  background: #111827;
  color: #fff;
}

.topbar {
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.84);
  color: var(--text);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.topbar-context span {
  color: #94a3b8;
}

.topbar-context strong {
  font-size: 17px;
}

.quota-nav-badge,
.user-chip,
.topbar .icon-button,
.top-actions .icon-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #111827;
  box-shadow: none;
}

.main,
.admin-main {
  padding: 28px 34px 36px;
  background: var(--bg);
}

.workspace,
.admin-workspace {
  width: min(100%, 1680px);
  max-width: none;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

.primary-button,
.send-button {
  background: #111827;
  color: #fff;
  box-shadow: none;
}

.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  border-color: var(--line);
  background: #fff;
  box-shadow: none;
}

.status-pill,
.badge,
.credit-pill {
  border: 1px solid rgba(20, 184, 166, 0.18);
  background: #f0fdfa;
  color: #0f766e;
}

.badge.pink {
  border-color: var(--line);
  background: #f8fafc;
  color: #475569;
}

.chat-workbench {
  position: relative;
  min-height: calc(100vh - 128px);
}

.chat-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-width: 1080px;
  min-height: calc(100vh - 128px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-hero-bar,
.flow-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

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

.chat-history-drawer {
  position: fixed;
  left: calc(var(--sidebar-width) + 18px);
  top: 86px;
  bottom: 24px;
  z-index: 80;
  width: min(320px, calc(100vw - 110px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
  transform: translateX(calc(-100% - 28px));
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.chat-history-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-history-drawer .history-header > div {
  display: inline-flex;
  gap: 8px;
}

.message-list {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 0 170px;
}

.bubble {
  border-color: transparent;
  border-radius: 20px;
  background: #fff;
  box-shadow: none;
}

.message.user .bubble {
  background: #f1f5f9;
  border-color: transparent;
  color: #111827;
}

.chat-empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 48vh;
  text-align: center;
}

.chat-empty-state > span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 22px;
  background: #111827;
  color: #fff;
}

.chat-empty-state h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -0.04em;
}

.chat-empty-state p {
  max-width: 520px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.chat-shell .composer {
  position: sticky;
  bottom: 20px;
  z-index: 10;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 60px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(18px);
}

.chat-drop-zone,
.chat-input-wrap {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gallery-layout .floating-composer {
  position: static;
  width: 100%;
  max-width: none;
  margin: 0 0 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
  box-shadow: none;
}

.gallery-layout .capsule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 10px;
}

.gallery-layout .capsule-prompt {
  min-height: 54px;
  border-radius: 18px;
  background: #f8fafc;
}

.gallery-layout .composer-options {
  position: absolute;
  top: 156px;
  right: 34px;
  z-index: 30;
  width: min(330px, calc(100vw - 120px));
  grid-template-columns: 1fr;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.flow-masonry,
.jimeng-history-grid {
  display: block;
  column-count: 4;
  column-gap: 22px;
}

.media-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
}

.media-card.image .media-surface,
.media-card.video .media-surface,
.media-surface {
  overflow: hidden;
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.media-thumb,
.media-card.image img.media-thumb,
.media-card.video .media-thumb {
  width: 100%;
  height: auto;
  min-height: 180px;
  object-fit: cover;
  background: #e5e7eb;
}

.media-card.video video.media-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.media-actions {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.media-card:hover .media-actions {
  opacity: 1;
  transform: translateY(0);
}

.media-actions .icon-button {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.jimeng-hero {
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  background: transparent;
}

.jimeng-capsule {
  max-width: none;
  border-color: var(--line);
  border-radius: 28px;
  box-shadow: none;
}

.voice-studio,
.task-workbench,
.flow-workbench,
.jimeng-video-layout {
  min-height: calc(100vh - 128px);
}

.voice-studio {
  display: grid;
  gap: 22px;
}

.voice-editor {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #fff;
}

.voice-editor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.voice-editor-head h3 {
  margin: 0;
}

.voice-editor-head span {
  color: var(--muted);
  font-size: 13px;
}

.voice-text {
  min-height: 160px;
  border: 0;
  border-radius: 22px;
  background: #f8fafc;
}

.voice-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.audio-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: none;
}

.audio-card-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.audio-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
}

.audio-card audio {
  width: 100%;
  height: 38px;
  border-radius: 999px;
}

.task-card-flow {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.task-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
}

.task-preview {
  width: 96px;
  height: 96px;
  border-radius: 20px;
}

.task-row .task-actions {
  grid-column: 2;
  justify-content: flex-start;
}

.config-list {
  display: grid;
  grid-template-columns: minmax(280px, 430px) minmax(0, 1fr);
  gap: 16px;
}

.table-wrap {
  border-radius: 20px;
  box-shadow: none;
}

.admin-workspace .feature-config-card.open {
  position: fixed;
  top: 86px;
  right: 28px;
  bottom: 24px;
  z-index: 95;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(620px, calc(100vw - 122px));
  overflow: hidden;
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.admin-workspace .feature-config-card.open .drawer-body {
  overflow: auto;
}

.floating-stash.open {
  width: min(420px, calc(100vw - 32px));
}

.stash-dropdown {
  border-radius: 24px;
}

.stash-item {
  border-radius: 18px;
  background: #f8fafc;
}

@media (max-width: 1280px) {
  .flow-masonry,
  .jimeng-history-grid {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 64px;
  }

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

  .app-sidebar {
    position: sticky;
    top: 0;
    grid-template-columns: 44px minmax(0, 1fr);
    width: auto;
    height: auto;
    padding: 10px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav,
  .admin-side .admin-tabs {
    display: flex;
    overflow-x: auto;
  }

  .topbar {
    min-height: auto;
    padding: 12px 16px;
  }

  .main,
  .admin-main {
    padding: 18px 14px 28px;
  }

  .flow-masonry,
  .jimeng-history-grid {
    column-count: 2;
  }

  .chat-history-drawer {
    left: 14px;
    top: 140px;
  }

  .gallery-layout .composer-options {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .config-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .flow-masonry,
  .jimeng-history-grid {
    column-count: 1;
  }

  .gallery-layout .capsule-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-layout .capsule-prompt {
    grid-column: 1 / -1;
  }

  .chat-hero-bar,
  .flow-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}
