/* 手机信息架构 v1.1：推荐卡片 / 独立素材生产 / 居中助手。
   保留智言讯紫青品牌；不依赖外部图片、字体或参考品牌资产。 */
:root {
  --muted: #69677d;
  --bg: #f8f7fc;
}
.cloud-preview {
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 14px;
  margin: 15px 0;
  background: #f3f0f8;
}
.wx-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  margin: 20px auto;
}
.checkline {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.7;
}
.checkline[hidden] {
  display: none !important;
}
.checkline input {
  width: 20px !important;
  min-height: 20px !important;
  flex-shrink: 0;
}
.cloud-job {
  padding: 16px !important;
}
audio {
  width: 100%;
  margin: 18px 0;
}
.form input[type='file'] {
  font-size: 14px;
  max-width: 100%;
  min-height: 80px;
  padding: 13px 12px;
  border: 1px dashed #aa94d1;
  background: #f9f7ff;
}
.form input[type='file']::file-selector-button {
  min-height: 44px;
  padding: 10px 12px;
  margin-right: 10px;
  border: 0;
  border-radius: 9px;
  color: #6339aa;
  background: #eee6ff;
  font: inherit;
}
.form .row:has(> input) {
  gap: 8px;
}
#account-status-refresh {
  margin-top: 16px;
}
#pending-logout {
  min-height: 44px;
}
body {
  background:
    radial-gradient(ellipse at 95% 8%, #e9faf9 0, transparent 40%),
    radial-gradient(ellipse at 0 40%, #f0eaff 0, transparent 50%), #f8f7fc;
}
.topbar {
  padding-top: calc(16px + env(safe-area-inset-top));
}
.brand small {
  letter-spacing: 1px;
}
main {
  padding-bottom: calc(var(--mobile-tabbar-height) + 36px + env(safe-area-inset-bottom));
}
.section-head h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
.home-greeting {
  font-size: 22px;
  margin-top: 4px;
}
.home-subtitle {
  margin-bottom: 18px;
}
.brand-banner {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 23px;
  border-radius: 23px;
  background: linear-gradient(115deg, #30214f, #6241a2 62%, #4b8a96);
  color: white;
  min-height: 144px;
  margin: 12px 0 23px;
}
.brand-banner:after {
  content: '';
  position: absolute;
  right: -45px;
  top: -65px;
  width: 210px;
  height: 210px;
  border: 25px solid #ffffff10;
  transform: rotate(-22deg);
  border-radius: 62px;
  z-index: -1;
}
.brand-banner .eyebrow {
  color: #d8c9f4;
  letter-spacing: 2px;
  font-size: 9px;
}
.brand-banner h2 {
  font-size: 24px;
  line-height: 1.45;
  margin: 5px 0;
}
.brand-banner p {
  font-size: 11px;
  color: #e2d9f4;
}
.banner-symbol {
  font-size: 61px;
  flex-shrink: 0;
  color: #d3f9f4;
  text-shadow: 0 0 22px #83ead790;
}
.feature-mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 119px 108px;
  gap: 12px;
}
.feature-tile {
  border-radius: 21px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.feature-tile h2 {
  font-size: 19px;
  margin: 7px 0 4px;
  z-index: 1;
}
.feature-tile p {
  font-size: 11px;
  line-height: 1.65;
  z-index: 1;
  margin: 0;
}
.feature-tile .tile-kicker {
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 700;
  z-index: 1;
}
.feature-tile:after {
  position: absolute;
  right: 7px;
  bottom: -16px;
  font-size: 97px;
  opacity: 0.14;
  line-height: 1.1;
  pointer-events: none;
}
.feature-assistant {
  grid-row: span 2;
  background: linear-gradient(155deg, #7744df, #9771eb 70%, #b4a5ef);
  color: #fff;
}
.feature-assistant:after {
  content: '✦';
  font-size: 145px;
  bottom: 0;
  right: -18px;
  color: #fff;
}
.feature-assistant h2 {
  font-size: 25px;
  margin-top: 15px;
  line-height: 1.3;
}
.feature-assistant p {
  color: #efe7ff;
}
.feature-assistant .tile-cta {
  margin-top: auto;
  min-height: 36px;
  border-radius: 22px;
  background: #fff;
  color: #6736bf;
  padding: 9px 13px;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}
.feature-materials {
  background: linear-gradient(130deg, #cff7ef, #e2f9fa);
  color: #166c70;
}
.feature-materials:after {
  content: '▱';
  transform: rotate(-15deg);
}
.feature-knowledge {
  background: linear-gradient(130deg, #eee6ff, #f3eeff);
  color: #624693;
}
.feature-knowledge:after {
  content: '✧';
}
.business-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.business-tile {
  display: block;
  min-height: 125px;
  border-radius: 19px;
  padding: 17px 14px;
  background: #f0ebfc;
  border: 1px solid #e8dff940;
  position: relative;
}
.business-tile .tile-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.business-tile .icon-box {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 29px;
  height: 29px;
  background: #9a76e5;
  color: #fff;
  border-radius: 9px;
}
.business-tile .icon {
  width: 17px;
  height: 17px;
}
.business-tile h3 {
  font-size: 14px;
  margin: 0;
  line-height: 1.45;
}
.business-tile p {
  font-size: 11px;
  color: #716785;
  line-height: 1.7;
  margin: 0;
}
.business-tile .availability {
  display: block;
  font-size: 9px;
  color: #81728e;
  margin-top: 10px;
}
.business-tile.cyan {
  background: #eaf8f8;
}
.business-tile.cyan .icon-box {
  background: #35a9a8;
}
.business-tile.blue {
  background: #edf3fc;
}
.business-tile.blue .icon-box {
  background: #699ce5;
}
.business-tile.peach {
  background: #fff3ec;
}
.business-tile.peach .icon-box {
  background: #eaa371;
}
.business-tile.peach p {
  color: #867263;
}
.business-tile .availability.pc {
  color: #82694a;
}
.home-stats {
  padding: 17px;
}
.home-stats .stats strong {
  font-size: 21px;
}
.tabbar {
  overflow: visible;
  border-top: 1px solid #ece7f5;
  background: #fffffff5;
  box-shadow: 0 -5px 24px #48386605;
  padding-top: 9px;
}
.tabbar a {
  font-size: 11px;
  color: #88869c;
}
.tabbar .assistant-tab {
  position: relative;
  justify-content: flex-end;
  gap: 2px;
}
.tabbar .assistant-orb {
  position: absolute;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  background:
    radial-gradient(circle at 72% 22%, #afe8ef 0, transparent 33%),
    linear-gradient(135deg, #9669ee, #6839cd 65%, #39bdc0);
  border: 4px solid #fbfaff;
  border-radius: 50%;
  color: #fff;
  box-shadow:
    0 0 0 1px #e4e5f5,
    0 4px 17px #8466d94a;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
}
.assistant-orb i {
  font-style: normal;
  font-size: 14px;
  position: absolute;
  top: 8px;
  right: 6px;
}
.tabbar .assistant-tab small {
  font-size: 10px;
}
.tabbar .assistant-tab.active > .assistant-orb {
  background:
    radial-gradient(circle at 72% 22%, #afe8ef 0, transparent 33%),
    linear-gradient(135deg, #9669ee, #6839cd 65%, #39bdc0);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px #c6b5ec,
    0 4px 17px #8466d94a;
}
.material-intro {
  padding: 23px;
  background: linear-gradient(125deg, #d9f5f0, #f1ecfc);
  border: 0;
}
.material-intro h2 {
  font-size: 22px;
}
.category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  font-size: 15px;
  font-weight: 700;
}
.category-label span {
  font-size: 10px;
  font-weight: 400;
  color: var(--muted);
}
.mobile-only-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pc-tools {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 19px;
  overflow: hidden;
}
.pc-tools a {
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.pc-tools a:last-child {
  border: 0;
}
.pc-tools .grow {
  flex: 1;
  min-width: 0;
}
.pc-tools h3 {
  font-size: 14px;
  margin: 0 0 4px;
}
.pc-tools p {
  font-size: 11px;
  color: var(--muted);
}
.assistant-welcome {
  text-align: center;
  padding: 23px 0 8px;
}
.assistant-avatar {
  width: 72px;
  height: 72px;
  border-radius: 25px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #ded1fa, #eee7ff 50%, #bcf1e9);
  color: #7142c4;
  font-size: 30px;
  font-weight: 800;
  margin: 0 auto 18px;
  box-shadow: 0 8px 22px #865fd918;
}
.assistant-welcome h1 {
  font-size: 25px;
}
.assistant-welcome p {
  font-size: 12px;
  color: var(--muted);
}
.assistant-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 20px 0;
}
.assistant-prompts button {
  background: #fff;
  border: 1px solid #e8e2f1;
  border-radius: 13px;
  padding: 13px 10px;
  min-height: 49px;
  text-align: left;
  font-size: 12px;
  color: #6e5b84;
}
.chat-history {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 22px 0;
}
.chat-message {
  max-width: 94%;
  border: 1px solid #e9e4ef;
  background: #fff;
  padding: 15px;
  border-radius: 17px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 13px;
}
.chat-message.user {
  align-self: flex-end;
  background: #eee6ff;
  border-color: #e6dbfa;
}
.chat-message.assistant {
  align-self: flex-start;
}
.chat-message small {
  display: block;
  color: #8b789a;
  margin-bottom: 5px;
  font-size: 10px;
}
.chat-message.incomplete {
  border-color: #e2c79f;
}
.assistant-compose {
  margin-top: 18px;
  padding: 17px;
}
.assistant-compose textarea {
  min-height: 93px;
}
.assistant-compose .actions {
  align-items: center;
}
.assistant-compose .actions .primary {
  margin-top: 0;
}
.assistant-privacy {
  font-size: 10px;
  color: #80758d;
  line-height: 1.7;
}
.assistant-status {
  font-size: 12px;
  color: #92744a;
  line-height: 1.7;
}
.assistant-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 15px;
}
.assistant-actions button {
  min-height: 44px;
  background: none;
  color: #765696;
  font-size: 12px;
}
.assistant-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.assistant-shortcuts a {
  padding: 9px 13px;
  background: #edf7f5;
  color: #278780;
  border-radius: 12px;
  min-height: 38px;
  font-size: 11px;
}
@media (min-width: 600px) {
  .feature-mosaic {
    grid-template-rows: 145px 120px;
  }
  .feature-tile {
    padding: 24px;
  }
  .feature-assistant h2 {
    font-size: 32px;
  }
  .business-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .business-tile {
    padding: 22px;
    min-height: 140px;
  }
  .business-tile h3 {
    font-size: 17px;
  }
  .brand-banner {
    min-height: 170px;
  }
  .mobile-only-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 350px) {
  main {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .feature-mosaic {
    gap: 10px;
    grid-template-rows: 115px 108px;
  }
  .feature-tile {
    padding: 15px;
  }
  .feature-assistant h2 {
    font-size: 22px;
  }
  .feature-tile h2 {
    font-size: 17px;
  }
  .business-tile {
    padding: 14px 11px;
  }
  .business-tile h3 {
    font-size: 13px;
  }
  .business-tile .tile-heading {
    gap: 6px;
  }
  .brand-banner {
    padding: 19px;
  }
  .brand-banner h2 {
    font-size: 21px;
  }
  .banner-symbol {
    font-size: 45px;
  }
}

/* Rows expand with system text size; controls stay usable above the keyboard. */
.feature-mosaic {
  grid-template-rows: minmax(119px, auto) minmax(108px, auto);
}
.feature-tile {
  overflow: hidden;
  isolation: isolate;
}
.feature-tile:after {
  z-index: -1;
}
.feature-assistant .tile-cta {
  margin-top: 18px;
}
.assistant-prompts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.assistant-prompts button,
.assistant-shortcuts a,
.assistant-privacy {
  overflow-wrap: anywhere;
}
.assistant-shortcuts a {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.assistant-privacy {
  font-size: 12px;
}
.assistant-compose textarea {
  scroll-margin-bottom: 28px;
}
.assistant-status:empty {
  display: none;
}
.chat-message {
  min-width: 0;
}
.brand-banner > div {
  min-width: 0;
}
.tabbar a {
  min-width: 0;
  text-align: center;
}
.tabbar .assistant-orb {
  max-width: calc(100vw / 5 - 6px);
}
@media (min-width: 600px) {
  .feature-mosaic {
    grid-template-rows: minmax(145px, auto) minmax(120px, auto);
  }
}
@media (max-width: 350px) {
  .feature-mosaic {
    grid-template-rows: minmax(115px, auto) minmax(108px, auto);
  }
  .brand {
    font-size: 18px;
  }
  .topbar {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
    gap: 10px;
  }
  .form .row {
    grid-template-columns: 1fr;
  }
  .actions > * {
    min-width: 0;
  }
  .assistant-prompts {
    grid-template-columns: 1fr;
  }
  .brand-banner {
    align-items: flex-start;
  }
  .banner-symbol {
    font-size: 35px;
  }
  .feature-tile h2 {
    overflow-wrap: anywhere;
  }
}

/* Shared library: reserve media space while loading and keep file actions
   outside the clipped preview so native playback controls stay reachable. */
.library-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.library-toolbar > input,
.library-toolbar > label:first-child {
  grid-column: 1 / -1;
}
.library-toolbar :is(input, select) {
  width: 100%;
  min-height: 48px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}
.library-toolbar label {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.library-toolbar > label {
  margin: 8px 0 0;
}
.library-toolbar > label:first-child {
  margin-top: 0;
}
.library-toolbar > button {
  margin-top: 6px;
}
.library-toolbar > p {
  margin: 0;
  font-size: 12px;
}
.library-toolbar > p:empty {
  display: none;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.library-asset.card {
  padding: 12px;
  margin: 0;
  min-width: 0;
}
.library-asset h3,
.library-upload-item {
  overflow-wrap: anywhere;
  word-break: normal;
}
.library-asset h3 {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 6px;
}
.library-asset small {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}
.library-media-frame {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  position: relative;
  min-height: 132px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 12px;
  background: #f2eff8;
  margin: 10px 0;
}
.library-media-frame :is(img, video),
.library-preview {
  display: block;
  width: 100%;
  max-height: 280px;
  min-height: 120px;
  height: auto;
  object-fit: contain;
  border-radius: inherit;
  margin: 0;
}
.library-media-frame audio {
  margin: 12px 0;
  min-width: 0;
}
.library-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 132px;
  padding: 12px;
  border-radius: inherit;
  background: #f2eff8;
  color: #674997;
  font-size: 13px;
  line-height: 1.7;
}
.library-play img {
  max-height: 200px;
}
.library-media-status {
  font-size: 12px;
  text-align: center;
  line-height: 1.7;
  margin: 0;
  padding: 12px;
}
.material-download-status,
.result-media-status {
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.material-download-status:empty,
.result-media-status:empty {
  display: none;
}
.library-media-status.skeleton::before {
  width: 20px;
  height: 20px;
  margin-bottom: 8px;
}
.library-media-retry,
.library-more,
.library-asset :is(a.secondary, button) {
  min-height: 44px;
}
.library-asset .secondary {
  width: 100%;
  padding: 10px;
  font-size: 12px;
}
.library-asset > .inline-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
}
.library-more {
  width: 100%;
  margin-top: 18px;
}
.library-upload-list {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.library-upload-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: #faf9fd;
  border-radius: 12px;
  line-height: 1.7;
  min-width: 0;
}
.library-upload-item :is(img, video) {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 10px;
}
.library-upload-item > :is(strong, small, span) {
  display: block;
  overflow-wrap: anywhere;
}
.library-upload-item > small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.library-upload-item button {
  min-height: 44px;
}
.library-upload-progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 12px 0;
  accent-color: var(--purple);
}
.library-projects > .list-row {
  margin: 10px 0;
}
.library-picker .library-toolbar {
  margin-top: 0;
}
.library-picker-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 12px 0;
}
.library-picker-item.card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 80px;
  padding: 12px;
  margin: 0;
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
  background: #fff;
}
.library-picker-item img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #f2eff8;
  flex-shrink: 0;
}
.library-picker-item > span {
  min-width: 0;
  flex: 1;
}
.library-picker-item :is(strong, small) {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.7;
}
.library-picker-item strong {
  font-size: 14px;
}
.library-picker-item small {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.library-picker-item.selected {
  border-color: #8d65df;
  background: #f4efff;
  box-shadow: inset 0 0 0 1px #8d65df;
}
.library-picker-item.selected small {
  color: #6b3db7;
}
.library-picker .library-picker-status {
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}
.library-picker .library-picker-status:empty {
  display: none;
}
.library-picker .library-picker-status.skeleton {
  padding: 24px 12px;
}
.library-picker .library-picker-count {
  font-size: 12px;
  line-height: 1.6;
}
.library-picker .library-picker-use {
  margin-top: 8px;
  min-height: 48px;
}
.cloud-library-choose {
  min-height: 48px;
  margin-top: 10px;
  background: #f6f1ff;
  border-color: #ddd0f5;
  color: #6b3db7;
}
@media (min-width: 351px) {
  .library-toolbar:has(#library-kind) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-toolbar:has(#library-kind) > label[for='library-kind'] {
    grid-row: 3;
    grid-column: 1;
  }
  .library-toolbar:has(#library-kind) > label[for='library-order'] {
    grid-row: 3;
    grid-column: 2;
  }
  .library-toolbar:has(#library-kind) > #library-kind {
    grid-row: 4;
    grid-column: 1;
  }
  .library-toolbar:has(#library-kind) > #library-order {
    grid-row: 4;
    grid-column: 2;
  }
  .library-toolbar:has(#library-kind) > :is(button, p) {
    grid-column: 1 / -1;
  }
  .library-toolbar:has(#results-kind) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-toolbar > label[for='results-kind'] {
    grid-column: 1;
    grid-row: 3;
  }
  .library-toolbar > #results-kind {
    grid-column: 1;
    grid-row: 4;
  }
  .library-toolbar > label[for='results-status'] {
    grid-column: 2;
    grid-row: 3;
  }
  .library-toolbar > #results-status {
    grid-column: 2;
    grid-row: 4;
  }
  .library-toolbar:has(#results-kind) > :is(label[for='results-order'], #results-order, button, p) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 430px) {
  .library-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .library-asset.card {
    padding: 15px;
  }
  .library-media-frame {
    min-height: 160px;
  }
}
@media (max-width: 350px) {
  .library-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Every surface owns its foreground. These tokens also keep native controls
   readable when Android/iOS follows the system appearance. */
:root {
  color-scheme: light;
  --bg: #f8f7fc;
  --ink: #252537;
  --muted: #625f73;
  --purple: #6734cb;
  --on-primary: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f4f1f9;
  --surface-tint: #eee7fb;
  --control: #faf9fc;
  --line: #d6cfe3;
  --focus: #6734cb;
  --disabled-bg: #e9e5ef;
  --disabled-ink: #615b70;
  --success-bg: #e7f5ef;
  --success-ink: #235f50;
  --warning-bg: #fff3dd;
  --warning-ink: #77520e;
  --danger-bg: #fff0f2;
  --danger-ink: #a72c43;
  --studio-ink: var(--ink);
  --studio-muted: var(--muted);
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #16131e;
  --ink: #f2eef8;
  --muted: #c3b9d2;
  --purple: #bda0ff;
  --on-primary: #211037;
  --surface: #231e2f;
  --surface-soft: #2d263b;
  --surface-tint: #392d4d;
  --control: #1c1826;
  --line: #625570;
  --focus: #c9b2ff;
  --disabled-bg: #383043;
  --disabled-ink: #c1b5ce;
  --success-bg: #203d35;
  --success-ink: #b2e9d4;
  --warning-bg: #423321;
  --warning-ink: #f8d492;
  --danger-bg: #442530;
  --danger-ink: #ffc0cd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #16131e;
    --ink: #f2eef8;
    --muted: #c3b9d2;
    --purple: #bda0ff;
    --on-primary: #211037;
    --surface: #231e2f;
    --surface-soft: #2d263b;
    --surface-tint: #392d4d;
    --control: #1c1826;
    --line: #625570;
    --focus: #c9b2ff;
    --disabled-bg: #383043;
    --disabled-ink: #c1b5ce;
    --success-bg: #203d35;
    --success-ink: #b2e9d4;
    --warning-bg: #423321;
    --warning-ink: #f8d492;
    --danger-bg: #442530;
    --danger-ink: #ffc0cd;
  }
}
body { background: var(--bg); color: var(--ink); }
button { color: inherit; }
.card, .tool, .pc-tools, .production-dialog, dialog, .production-tools a,
.production-recent button, .mobile-editing-choice, .material-groups .business-tile,
.assistant-prompts button, .chat-message, .library-picker-item.card,
.compute-recharge, .cr-payment-dialog {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
.hero, .material-intro, .material-summary, .business-tile,
.business-tile:is(.cyan, .blue, .peach), .feature-materials, .feature-knowledge,
.chat-message.user, .generation-quote, .studio-reference-role,
.selected-file-preview, .library-upload-item, .production-tools [aria-current],
.library-picker-item.selected {
  color: var(--ink);
  background: var(--surface-tint);
  border-color: var(--line);
}
.result-header, .result-footer, .production-submit, #confirm .actions,
.result-close, .library-media-frame, .library-play, .cloud-preview,
.selected-file-preview :is(img, video), .mobile-editing-choice :is(img, video) {
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}
.tabbar { color: var(--ink); background: var(--surface); border-color: var(--line); }
.tabbar a { color: var(--muted); }
.tabbar a.active > span { background: var(--surface-tint); box-shadow: 0 0 0 5px var(--surface-tint); }
.form label, .production-section legend, .text-task-filters label,
.production-guide ol, .cr-packages strong, .cr-pay-amount { color: var(--ink); }
.hero p, .business-tile p, .business-tile.peach p, .production-tools span,
.production-submit p, .production-guide p, .production-recent button span,
.selected-file-preview p, .material-summary p, .material-groups .section-head p,
.result-header p, .result-footer p, dialog p, .fineprint, .assistant-privacy, .skeleton,
.chat-message small, .cr-packages small, .cr-note, .cr-orders small,
.cr-payment-dialog .cr-note, .compute-recharge [data-cr-status] { color: var(--muted); }
.availability { color: var(--muted) !important; }
.production-section, .production-advanced, .result-header, .result-footer { border-color: var(--line); }
.form :is(input, select, textarea), .form input[type='file'], .production-section input[type='file'],
.search, .library-toolbar :is(input, select),
.text-task-filters :is(input, select) {
  color: var(--ink);
  background: var(--control);
  border-color: var(--line);
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
select option { color: var(--ink); background: var(--control); }
.primary, .chip.active, .cr-payment-dialog [data-cr-paid] {
  color: var(--on-primary);
  background: var(--purple);
  border-color: var(--purple);
}
.primary :is(span, strong, small, svg), .chip.active :is(span, strong, small) { color: inherit; }
.secondary, .chip, .avatar, .pill, .flow-step b, .production-section legend b,
.selected-file-preview button, .result-status button, .assistant-shortcuts a,
.cloud-library-choose, .compute-recharge :is(button, a), .cr-payment-dialog button,
.cr-payment-channels label, .cr-payment-channels label:has(input:checked) {
  color: var(--purple);
  background: var(--surface-tint);
  border-color: var(--line);
}
.cr-payment-dialog [data-cr-paid] { color: var(--on-primary); background: var(--purple); }
.form input[type='file']::file-selector-button, .production-section input[type='file']::file-selector-button {
  color: var(--purple); background: var(--surface-tint);
}
.assistant-actions button, .back, summary, .library-picker-item.selected small { color: var(--purple); }
.note, .pill.green, .status-line, .production-draft { color: var(--success-ink); }
.note, .pill.green { background: var(--success-bg); }
.note.warn, .pill.amber, .result-fallback, .result-media-error, .cr-pending, .network {
  color: var(--warning-ink); background: var(--warning-bg);
}
.assistant-status { color: var(--warning-ink); }
.danger, .note.error, .pill.red { color: var(--danger-ink); background: var(--danger-bg); border-color: var(--line); }
.production-error { color: var(--danger-ink); }
.feature-assistant { color: #fff; background: linear-gradient(155deg, #6540bf, #7744c8 70%, #6546a7); }
.feature-assistant :is(h2, p, .tile-kicker), .brand-banner h2 { color: #fff; }
.brand-banner { background: linear-gradient(115deg, #30214f, #55378d 62%, #336670); }
.brand-banner :is(p, .eyebrow) { color: #f1eafa; }
.balance { color: #fff; background: #302344; }
.balance p { color: #e0d3ef; }
.cr-qr-area { background: #fff; color: #252537; }
:is(button, input, textarea, select, a, summary):focus-visible,
.form :is(input, textarea, select):focus-visible,
.compute-recharge :is(button, a):focus-visible, .cr-payment-dialog button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.form :is(input, textarea, select):focus { border-color: var(--focus); }
button:disabled, input:disabled, textarea:disabled, select:disabled,
.form :is(input, textarea, select):disabled, .library-picker-item:disabled,
.compute-recharge button:disabled, .cr-payment-dialog button:disabled, [aria-disabled='true'] {
  color: var(--disabled-ink);
  -webkit-text-fill-color: var(--disabled-ink);
  background: var(--disabled-bg);
  border-color: var(--line);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}
button:disabled *, [aria-disabled='true'] * { color: inherit; }
@media (hover: hover) {
  .primary:not(:disabled):hover, .secondary:not(:disabled):hover, .chip:not(:disabled):hover {
    box-shadow: inset 0 0 0 2px currentColor;
  }
  .compute-recharge button:hover:not(:disabled) { color: var(--purple); background: var(--surface-tint); border-color: var(--purple); }
}
.mobile-dialog[open] { animation: mobile-dialog-in 200ms cubic-bezier(.2,.7,.2,1) both; }
.mobile-dialog[open]::backdrop { animation: mobile-backdrop-in 200ms ease both; }
.mobile-dialog.dialog-closing[open] { animation: mobile-dialog-out 180ms ease-in both; pointer-events: none; }
.mobile-dialog.dialog-closing[open]::backdrop { animation: mobile-backdrop-out 180ms ease-in both; }
@keyframes mobile-dialog-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes mobile-dialog-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes mobile-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes mobile-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, dialog::backdrop {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
