:root {
  --bg: #0b0c0f;
  --surface: #14161b;
  --surface2: #1a1d23;
  --fg: #f7f7fa;
  --muted: #b2b4bd;
  --faint: #7e828e;
  --line: #ffffff1a;
  --accent: #746df6;
  --accent-hover: #857ffc;
  --accent-soft: #746df61c;
  --coral: #ff7a90;
  --mint: #48d7ad;
  --sky: #59bff5;
  --shadow: 0 24px 70px #00000045;
}

html {
  background: var(--bg);
  color-scheme: dark;
  font-size: 16px;
}

html.light {
  background: #f5f6f8;
  color-scheme: light;
}

body {
  background: linear-gradient(180deg, #111219 0, #0b0c0f 34rem, #0b0c0f 100%);
  font-family: "Segoe UI Variable", "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
p,
a,
span,
small,
strong,
label,
code,
th,
td {
  letter-spacing: 0 !important;
}

:focus-visible {
  outline: 2px solid #9a95ff;
  outline-offset: 3px;
}

::selection {
  background: #746df65c;
  color: #fff;
}

.ambient,
.cta-glow,
.login-page::before,
.login-page::after {
  display: none;
}

.grain {
  opacity: .022;
}

/* Public landing page */
.topbar {
  width: min(100%, 1240px);
  max-width: none;
  height: 84px;
  padding: 0 32px;
}

.brand {
  gap: 10px;
  font-size: 20px;
  font-weight: 720;
}

.logo-img {
  width: 30px;
  height: 30px;
}

.topbar nav {
  gap: 6px;
  margin-left: 92px;
}

.topbar nav a {
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 14px;
  transition: color .18s ease, background .18s ease;
}

.topbar nav a:hover,
.topbar nav a.active {
  background: #ffffff0b;
}

.topbar nav a.active {
  box-shadow: inset 0 0 0 1px #ffffff18;
}

.actions {
  gap: 8px;
}

.landing-language,
.language-toggle,
.icon-btn {
  min-width: 42px;
  height: 40px;
  border-radius: 7px;
}

.ghost-btn,
.solid-btn {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 7px;
  font-size: 14px;
}

.solid-btn,
.composer button,
.submit,
.btn.primary {
  background: var(--accent);
  box-shadow: 0 14px 34px -18px #746df6cc;
}

.solid-btn:hover,
.composer button:hover,
.submit:hover:not(:disabled),
.btn.primary:hover {
  background: var(--accent-hover);
  filter: none;
  transform: translateY(-1px);
}

.hero {
  width: min(100%, 1160px);
  max-width: none;
  min-height: calc(100svh - 132px);
  padding: 56px 32px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  animation: polishRise .65s cubic-bezier(.2, .72, .25, 1) both;
}

.hero-art {
  height: 146px;
  position: relative;
  display: grid;
  place-items: center;
}

.mascot {
  width: 184px;
  height: 150px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 16px 26px #0007);
  animation: mascotFloat 5.5s ease-in-out infinite;
}

.mascot-aura {
  display: none;
}

.anime-stars {
  position: absolute;
  z-index: 3;
  font-size: 18px;
  animation: twinkle 4.5s ease-in-out infinite;
}

.star-a { left: calc(50% - 116px); top: 50px; color: #ffd77d; }
.star-b { left: calc(50% + 96px); top: 31px; color: var(--sky); animation-delay: 1.2s; }
.star-c { left: calc(50% + 76px); top: 104px; color: var(--coral); animation-delay: 2.4s; }

.eyebrow {
  min-height: 30px;
  gap: 10px;
  color: #c0c2ca;
  font-size: 14px;
}

.dot {
  width: 8px;
  height: 8px;
  background: var(--mint);
  box-shadow: 0 0 14px #48d7ad80;
}

.hero h1 {
  max-width: 1040px;
  margin: 24px auto 20px;
  font-size: 76px !important;
  font-weight: 760;
  line-height: 1.04;
}

.hero h1 span {
  color: #f8f8fb;
  background: none;
}

.hero h1 span + span {
  color: #cbc9ff;
}

.subtitle {
  max-width: 690px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.composer {
  width: min(100%, 720px);
  max-width: none;
  min-height: 66px;
  margin: 38px auto 15px;
  padding: 7px;
  gap: 10px;
  border-color: #ffffff24;
  border-radius: 10px;
  background: #17191f;
  box-shadow: 0 20px 55px -30px #000, inset 0 1px #ffffff0a;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.composer:focus-within {
  border-color: #918bff;
  box-shadow: 0 0 0 3px #746df624, 0 22px 60px -34px #746df6;
}

.prompt-icon {
  margin-left: 12px;
  color: #a8a4ff;
  font-size: 19px;
}

.composer input {
  font-size: 16px;
  padding: 13px 4px;
}

.composer input::placeholder {
  color: #858994;
}

.composer button {
  min-width: 116px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 7px;
  font-size: 15px;
  transition: transform .18s ease, background .18s ease;
}

.chips {
  gap: 9px;
}

.chips button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  background: #ffffff07;
  font-size: 13px;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.chips button:hover {
  border-color: #ffffff30;
  background: #ffffff0c;
}

.inspiration-section,
.section {
  width: min(100%, 1180px);
  max-width: none;
  margin: 0 auto;
  padding-inline: 32px;
}

.inspiration-section {
  padding-top: 12px;
  padding-bottom: 74px;
}

.inspiration-mask {
  margin-inline: -2vw;
  padding-inline: 2vw;
}

.inspiration-mask::before,
.inspiration-mask::after {
  width: 4vw;
}

.inspiration-card {
  width: 286px;
  height: 172px;
  border-radius: 8px;
  box-shadow: 0 18px 36px -25px #000;
}

.inspiration-card span {
  left: 17px;
  bottom: 16px;
  font-size: 15px;
}

.stats {
  max-width: 920px;
  margin-top: 68px;
  border-width: 1px 0;
  border-radius: 0;
  background: transparent;
}

.stats div {
  min-height: 96px;
  padding: 22px 16px;
  display: grid;
  align-content: center;
}

.stats b { font-size: 22px; }
.stats span { margin-top: 7px; color: #8f929d; font-size: 13px; }

.section {
  padding-top: 88px;
  padding-bottom: 96px;
}

.section-kicker {
  color: #a9a5ff;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.section h2 {
  max-width: 780px;
  margin: 14px 0 10px;
  font-size: 42px;
  line-height: 1.16;
}

.section-desc {
  max-width: 700px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.feature-grid-3 {
  gap: 16px;
  margin-top: 34px;
}

.feature-grid-3 .feature-card {
  min-height: 220px;
  padding: 30px;
  border-radius: 8px;
  background: #14161b;
  box-shadow: none;
}

.feature-grid-3 .feature-card:hover {
  border-color: #ffffff2b;
  box-shadow: 0 18px 45px -32px #000;
  transform: translateY(-3px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  border-radius: 8px;
}

.feature-card h3 { margin-bottom: 10px; font-size: 21px; }
.feature-card p { max-width: 420px; font-size: 15px; line-height: 1.7; }

.showcase-section,
.model-section {
  padding-top: 74px;
}

.showcase-grid {
  grid-template-rows: 270px 270px;
  gap: 14px;
  margin-top: 34px;
}

.showcase-item {
  border-radius: 8px;
}

.showcase-item span {
  left: 20px;
  right: 20px;
  bottom: 18px;
}

.showcase-item b { font-size: 17px; }
.showcase-item small { margin-top: 5px; font-size: 13px; }

.public-models {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
  margin-top: 32px;
}

.public-model {
  min-height: 172px;
  padding: 26px;
  border-radius: 8px;
  background: #14161b;
}

.public-model h3 { margin-bottom: 9px; font-size: 20px; }
.public-model p { font-size: 14px; }
.public-model div { gap: 7px; }
.public-model span { padding: 5px 8px; border-radius: 5px; font-size: 12px; }
.public-model .model-price { color: #cbc9ff; }

.cta {
  max-width: none;
  margin: 26px 0 72px;
  padding: 100px 32px;
  border-width: 1px 0;
  border-radius: 0;
  background: #101216;
}

.sparkle { color: var(--coral); }
.cta h2 { margin: 18px auto 14px; font-size: 48px; line-height: 1.18; }
.cta h2 span { color: #f7f7fa; background: none; }
.cta p { margin-bottom: 28px; color: var(--muted); font-size: 16px; }
.cta .large { min-height: 48px; }

footer {
  max-width: 1180px;
  padding: 0 32px 48px;
  color: #868995;
  font-size: 13px;
}

body.light {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface2: #eef0f3;
  --fg: #17191d;
  --muted: #61656f;
  --faint: #858a95;
  --line: #17191d1a;
  color-scheme: light;
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 36rem, #f5f6f8 100%);
  color: var(--fg);
}

body.light .grain {
  display: none;
}

body.light .brand,
body.light .topbar nav a:hover,
body.light .topbar nav a.active,
body.light .ghost-btn,
body.light .icon-btn,
body.light .landing-language {
  color: #1d2025;
}

body.light .topbar nav a:hover,
body.light .topbar nav a.active {
  background: #17191d0a;
}

body.light .topbar nav a.active {
  box-shadow: inset 0 0 0 1px #17191d16;
}

body.light .hero h1 span { color: #17191d; }
body.light .hero h1 span + span { color: #5750a7; }
body.light .eyebrow { color: #565b65; }
body.light .composer {
  border-color: #1d202522;
  background: #fff;
  box-shadow: 0 20px 55px -34px #25283242, inset 0 1px #fff;
}
body.light .composer input { color: #17191d; }
body.light .composer input::placeholder { color: #858a94; }
body.light .chips button {
  border-color: #1d20251c;
  background: #fff;
  color: #5e626c;
}
body.light .chips button:hover {
  border-color: #1d202536;
  color: #17191d;
}
body.light .inspiration-mask::before { background: linear-gradient(90deg, #f5f6f8, transparent); }
body.light .inspiration-mask::after { background: linear-gradient(-90deg, #f5f6f8, transparent); }
body.light .feature-grid-3 .feature-card,
body.light .public-model {
  border-color: #17191d16;
  background: #fff;
}
body.light .feature-card h3,
body.light .public-model h3 { color: #17191d; }
body.light .cta {
  border-color: #17191d14;
  background: #eceef2;
}
body.light .cta h2 span { color: #17191d; }
body.light footer,
body.light footer a { color: #676b75; }

/* Signed-in application */
.shell {
  max-width: 1280px;
  padding-inline: 32px;
}

.appbar {
  height: 76px;
  background: #0d0f12e8;
  border-color: #ffffff12;
  backdrop-filter: blur(18px);
}

.appbar .brand { font-size: 19px; }
.appbar .nav { gap: 3px; }
.appbar .nav a { padding: 10px 13px; border-radius: 7px; font-size: 14px; }
.appbar .nav a:hover,
.appbar .nav a.on { background: #ffffff0b; transform: none; }

.credit,
.user-menu,
.outline {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 13px;
}

.page {
  padding-top: 46px;
  padding-bottom: 88px;
}

.page-head { margin-bottom: 30px; }
.page-head h1 { margin-bottom: 7px; font-size: 38px; line-height: 1.15; }
.page-head p { font-size: 15px; line-height: 1.6; }

.panel {
  padding: 28px;
  border-radius: 8px;
  background: #14161bea;
  box-shadow: 0 18px 50px -38px #000;
}

.panel:hover {
  border-color: #ffffff22;
  box-shadow: 0 20px 55px -40px #000;
}

.field-label { margin-bottom: 9px; color: #e2e3e8; font-size: 13px; }
.text-input,
.select {
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 7px;
  background: #1a1d23;
  font-size: 14px;
}

.prompt {
  padding: 16px;
  border-radius: 7px;
  background: #101216;
  font-size: 15px;
  line-height: 1.7;
}

.prompt:focus,
.select:focus,
.text-input:focus {
  border-color: #8d87ff;
  box-shadow: 0 0 0 3px #746df624;
}

.btn,
.tab,
.choice,
.payment-method,
.table-action {
  min-height: 40px;
  border-radius: 7px;
  font-size: 13px;
}

.btn { padding: 9px 14px; }
.btn:hover { transform: none; background: #ffffff10; }
.btn.primary { border: 1px solid #8983ff; }
.tabs { gap: 5px; }
.tab { padding: 8px 14px; }
.tab.on { background: var(--accent-soft); border-color: #8a84ff78; }

.settings-grid { gap: 18px; }
.settings-card h2 { font-size: 20px; }
.settings-card > p { font-size: 13px; }
.kv { grid-template-columns: 116px 1fr; padding: 12px 0; font-size: 14px; }
.api-key { padding: 14px; border-radius: 7px; font-size: 13px; }
.package { padding: 18px; border-radius: 7px; background: #191c22; }
.package b { font-size: 14px; }
.package strong { color: #cbc9ff; font-size: 21px; }
.work { border-radius: 8px; }
.work .meta { padding: 38px 14px 13px; font-size: 12px; }
.work .meta b { font-size: 14px; }

/* Authentication */
.login-page {
  padding: 48px 20px;
  background: linear-gradient(180deg, #101217, #090a0d);
}

.auth-card {
  width: min(520px, 100%);
  padding: 44px;
  border-color: #ffffff20;
  border-top-color: #8e88ff70;
  border-radius: 8px;
  background: #13151a;
  box-shadow: 0 30px 90px -38px #000, 0 0 0 1px #0008, inset 0 1px #ffffff08;
  animation: authCardIn .55s cubic-bezier(.2, .72, .25, 1) both;
}

.auth-card:hover {
  border-color: #ffffff29;
  border-top-color: #9b96ff8c;
  box-shadow: 0 34px 100px -42px #000, 0 0 0 1px #0008, inset 0 1px #ffffff0b;
}

.auth-brand-visual {
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  overflow: hidden;
  border: 1px solid #ffffff1c;
  border-radius: 18px;
  background: #0d0f16;
  box-shadow: 0 20px 44px -24px #746df6cc, inset 0 1px 0 #ffffff18;
}

.auth-brand-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.light .auth-brand-visual {
  border-color: #17191d18;
  background: #f0f1f7;
  box-shadow: 0 16px 34px -24px #746df655;
}

.auth-card .brand { font-size: 23px; }
.auth-brand .logo-img { width: 34px; height: 34px; }
.auth-kicker { margin-top: 12px; font-size: 14px; line-height: 1.6; }
.auth-card .tabs {
  width: 100%;
  gap: 4px;
  margin: 30px 0 22px;
  padding: 4px;
  border: 1px solid #ffffff14;
  border-radius: 8px;
  background: #0d0f13;
}
.auth-card .tab {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 6px;
}
.auth-card .tab.on { background: #222530; box-shadow: inset 0 0 0 1px #8b85ff56; }
.auth-card .stack { gap: 17px; animation: authFormIn .3s ease both; }
.auth-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-card .field-label { margin: 0; color: #dfe0e5; font-size: 13px; }
.auth-card .text-input {
  min-height: 48px;
  margin-top: 8px;
  border-color: #ffffff1c;
  background: #191c22;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.auth-card .text-input:hover { border-color: #ffffff32; background: #1b1e25; }
.auth-card .submit { min-height: 50px; margin-top: 5px; border-radius: 7px; font-size: 15px; }
.auth-card .submit::after { display: none; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 9px; }
.auth-submit > span:last-child { transition: transform .18s ease; }
.auth-submit:hover > span:last-child { transform: translateX(3px); }
.auth-submit.loading { cursor: wait; opacity: .72; }
.auth-secondary-action { display: flex; justify-content: flex-end; margin-top: -8px; }
.auth-link {
  width: fit-content;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: #b7b3ff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.auth-link:hover { color: #dedcff; text-decoration: underline; text-underline-offset: 3px; }
.auth-back { justify-self: center; margin-top: 2px; }
.auth-form-heading { margin-bottom: 2px; }
.auth-form-heading h1 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; }
.auth-form-heading p { margin: 0; color: #9da0aa; font-size: 12px; line-height: 1.6; }
.auth-hint { padding: 11px 12px; border-left: 2px solid #746df678; background: #746df60b; color: #9da0aa; font-size: 12px; line-height: 1.6; }
.auth-message { min-height: 20px; margin-top: 15px; font-size: 12px; line-height: 1.55; }
.auth-message.success { color: #68ddb9; }
.verification-control { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 9px; align-items: end; }
.verification-control .text-input { min-width: 0; }
.verification-send { min-height: 48px; padding-inline: 12px; white-space: nowrap; }
.verification-send:disabled { cursor: not-allowed; opacity: .55; }

/* Studio */
.studio-page {
  max-width: 1340px;
  padding-top: 38px;
}

.studio-head { margin-bottom: 28px; }
.studio-kicker { margin-bottom: 8px; color: #aaa6ff; font-size: 12px; font-weight: 700; }
.studio-head h1 { margin-bottom: 7px; font-size: 38px; line-height: 1.15; }
.studio-head p { font-size: 15px; line-height: 1.6; }
.studio-workspace { grid-template-columns: minmax(400px, .82fr) minmax(520px, 1.18fr); gap: 20px; }
.studio-controls { padding: 28px; }
.studio-preview { min-height: 680px; padding: 14px; }
.control-section { margin-bottom: 22px; }
.control-title { margin-bottom: 10px; font-size: 13px; }
.capability-state { font-size: 12px; }
.studio-controls .prompt { min-height: 205px; border-radius: 7px; }
.prompt-presets { gap: 7px; margin-top: 10px; }
.prompt-presets button { min-height: 34px; padding: 0 10px; border-radius: 6px; font-size: 12px; }
.control-grid { gap: 18px; }
.studio-controls .choice { min-height: 38px; padding: 8px 11px; border-radius: 6px; font-size: 13px; }
.count-control { min-height: 54px; }
.count-control > div:first-child > span { font-size: 13px; }
.count-control small { font-size: 12px; }
.stepper { height: 38px; border-radius: 6px; }
.stepper button { width: 38px; }
.stepper strong { width: 38px; font-size: 14px; }
.studio-controls .submit { min-height: 48px; border-radius: 7px; font-size: 15px; }
.live-frame { min-height: 570px; border-radius: 7px; }
.live-status b { font-size: 14px; }
.live-status span { font-size: 12px; }
.result-grid { height: 580px; }
.result-grid a { border-radius: 7px; }
.recent-section { margin-top: 48px; }
.recent-head { margin-bottom: 16px; }
.recent-head h2 { font-size: 22px; }
.recent-head p,
.recent-head a { font-size: 13px; }
.recent-grid { gap: 14px; }
.recent-work,
.recent-empty { border-radius: 7px; }
.recent-work span { padding: 28px 12px 11px; font-size: 12px; }

/* API documentation */
.docs-page { padding-top: 58px; }
.docs-hero { max-width: 1020px; padding-bottom: 48px; }
.docs-badge { padding: 7px 10px; border-radius: 6px; font-size: 12px; }
.docs-hero h1 { margin: 18px 0 12px; font-size: 64px; line-height: 1.08; }
.docs-hero > p { max-width: 820px; font-size: 18px; }
.capability-callout { margin-top: 26px; font-size: 14px; }
.docs-split { gap: 18px; }
.docs-panel { padding: 28px; border-radius: 8px; background: #14161b; }
.docs-panel h2 { font-size: 17px; }
.docs-kv { padding: 11px 0; font-size: 14px; }
.endpoint-row { padding: 10px 0; font-size: 14px; }
.docs-note { font-size: 13px; }
.docs-section { padding-top: 78px; }
.docs-section-head { grid-template-columns: 48px 1fr; gap: 17px; margin-bottom: 26px; }
.docs-section-head > span { width: 42px; height: 42px; border-radius: 7px; }
.docs-section-head h2 { margin-top: 2px; font-size: 30px; }
.docs-section-head p { font-size: 15px; }
.code-block,
.model-reference,
.docs-table-wrap,
.billing-points { border-radius: 8px; }
.code-head { height: 48px; font-size: 13px; }
.code-block pre { padding: 24px; font-size: 13px; line-height: 1.8; }
.model-reference { padding: 24px; }
.model-reference-main strong { font-size: 17px; }
.model-capabilities span,
.model-capabilities code { font-size: 12px; }
.docs-table th,
.docs-table td { padding: 15px 16px; font-size: 13px; }
.ratio-reference > div { padding: 15px; border-radius: 7px; }
.billing-points > div { padding: 22px; background: #14161b; }
.billing-points strong { font-size: 15px; }
.billing-points span { font-size: 13px; }
.error-grid > div { padding: 15px; border-radius: 7px; font-size: 13px; }

/* Admin stays denser, but no longer tiny. */
.admin-body {
  --admin-bg: #0c0e11;
  --admin-panel: #15181d;
  --admin-line: #ffffff17;
  --admin-text: #f0f1f3;
  --admin-muted: #989da7;
  grid-template-columns: 260px minmax(0, 1fr);
  background: var(--admin-bg);
  font-size: 14px;
}

.admin-sidebar { padding: 18px 14px; background: #101216; }
.admin-brand { height: 48px; padding: 0 10px; font-size: 19px; }
.admin-nav { gap: 4px; margin-top: 28px; }
.admin-nav button { height: 46px; border-radius: 7px; padding: 0 14px; font-size: 14px; }
.admin-nav button.on { background: #746df619; box-shadow: inset 3px 0 #8e88ff; }
.admin-sidebar-foot a,
.admin-sidebar-foot button { font-size: 13px; }
.admin-main { padding: 0 42px 72px; }
.admin-topbar { height: 92px; margin-bottom: 32px; }
.admin-eyebrow { font-size: 11px; }
.admin-topbar h1 { font-size: 27px; }
.admin-account { font-size: 13px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2,
.panel-head h2 { font-size: 20px; }
.section-heading p,
.panel-head p { font-size: 13px; }
.metric-grid { gap: 12px; margin-bottom: 20px; }
.metric { padding: 19px; border-radius: 7px; }
.metric-head { font-size: 12px; }
.metric strong { margin: 12px 0 4px; font-size: 28px; }
.metric small { font-size: 11px; }
.overview-grid { gap: 16px; }
.data-panel { border-radius: 7px; }
.trend-panel,
.health-panel { padding: 21px; }
.health-item span,
.state { font-size: 13px; }
.admin-toolbar { gap: 10px; margin-bottom: 15px; }
.search-box { height: 42px; padding: 0 13px; border-radius: 7px; }
.admin-toolbar select,
.settings-form input,
.settings-form textarea,
.dialog-surface input,
.dialog-surface select { min-height: 42px; border-radius: 7px; }
.admin-table th { padding: 13px 15px; font-size: 11px; }
.admin-table td { padding: 14px 15px; font-size: 13px; }
.admin-table code { font-size: 12px; }
.cell-sub { margin-top: 4px; font-size: 11px; }
.role-pill,
.status-pill { padding: 4px 7px; border-radius: 5px; font-size: 11px; }
.channel-stack { gap: 14px; }
.channel-row { padding: 20px; border-radius: 7px; }
.channel-row { transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.channel-row:hover { border-color: #ffffff25; background: #171a20; transform: translateY(-1px); }
.channel-logo { width: 46px; height: 46px; border-radius: 7px; }
.channel-row h3 { font-size: 16px; }
.channel-meta { font-size: 12px; }
.channel-capabilities span { font-size: 11px; }
.settings-form { max-width: 980px; }
.setting-row { padding: 21px 24px; }
.setting-row label { font-size: 14px; }
.setting-row p { font-size: 12px; }
.settings-actions { padding: 18px 24px; background: #191c21; }
.system-item { padding: 15px; border-radius: 7px; }
.system-item span { font-size: 11px; }
.system-item strong { font-size: 13px; }
.dialog-surface { padding: 24px; border-radius: 8px; }
.admin-dialog .channel-dialog-surface { width: min(960px, calc(100vw - 30px)); max-height: min(900px, calc(100vh - 30px)); overflow: auto; }
.dialog-head h3 { font-size: 20px; }
.dialog-surface > label { font-size: 12px; }
.dialog-hint { font-size: 11px; }

@keyframes polishRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(.99); }
  to { opacity: 1; transform: none; }
}

@keyframes authFormIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1000px) {
  .hero h1 { font-size: 62px !important; }
  .studio-workspace { grid-template-columns: 1fr; }
  .studio-preview { min-height: 560px; }
  .feature-grid-3 { grid-template-columns: 1fr; }
  .feature-grid-3 .feature-card { min-height: 0; }
}

@media (min-width: 1001px) {
  .hero { min-height: calc(100svh - 210px); }
}

@media (max-width: 850px) {
  .shell { padding-inline: 22px; }
  /* A backdrop-filter creates a containing block for the fixed mobile nav. */
  .appbar { backdrop-filter: none; }
  .appbar .nav a { font-size: 12px; }
  .page,
  .studio-page,
  .docs-page { padding-bottom: 88px; }
  .showcase-grid { grid-template-rows: 250px 210px; }
  .admin-main { padding-inline: 22px; }
}

@media (max-width: 700px) {
  .topbar { height: 72px; padding: 0 18px; }
  .topbar nav.mobile-open {
    z-index: 10;
    gap: 2px;
    border-radius: 8px;
    background: #14161bf7;
    box-shadow: 0 20px 50px #0008;
  }
  body.light .topbar nav.mobile-open {
    border-color: #17191d1f;
    background: #fffffff7;
    box-shadow: 0 20px 50px #25283229;
  }
  body.light .topbar nav.mobile-open a { color: #5e626c; }
  body.light .topbar nav.mobile-open a:hover,
  body.light .topbar nav.mobile-open a.active {
    color: #17191d;
    background: #f0f1f4;
  }
  .brand { font-size: 18px; }
  .hero { min-height: calc(100svh - 86px); padding: 34px 18px 48px; }
  .hero-art { height: 118px; }
  .mascot { width: 146px; height: 122px; }
  .hero h1 { margin-top: 18px; font-size: 46px !important; line-height: 1.05; }
  .subtitle { font-size: 16px; }
  .composer { min-height: 60px; margin-top: 30px; }
  .composer button { min-width: 96px; min-height: 46px; padding: 0 16px; }
  .inspiration-section,
  .section { padding-inline: 18px; }
  .stats { margin-top: 52px; }
  .section { padding-top: 68px; padding-bottom: 74px; }
  .section h2 { font-size: 34px; }
  .cta { margin-bottom: 56px; padding: 76px 20px; }
  .cta h2 { font-size: 38px; }
  footer { padding-inline: 18px; }
  .auth-card { padding: 34px 26px; }
  .docs-hero h1 { font-size: 48px; }
  .docs-section { padding-top: 62px; }
  .settings-card { padding: 22px; }
}

@media (max-width: 520px) {
  .hero h1 { font-size: 40px !important; }
  .hero-art { height: 106px; }
  .eyebrow { font-size: 12px; }
  .composer { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 8px; }
  .composer button { grid-column: 1 / -1; width: 100%; }
  .chips button { font-size: 12px; }
  .inspiration-card { width: 240px; height: 148px; }
  .stats div { min-height: 84px; padding: 17px 10px; }
  .stats span { font-size: 11px; }
  .showcase-grid { grid-template-rows: 220px repeat(3, 190px); }
  .page-head h1,
  .studio-head h1 { font-size: 32px; }
  .panel { padding: 22px; }
  .login-page { align-items: start; padding: 24px 14px; }
  .auth-card { margin-block: auto; padding: 30px 22px; }
  .verification-control { grid-template-columns: 1fr; }
  .verification-send { width: 100%; }
  .auth-field-grid { grid-template-columns: 1fr; gap: 17px; }
  .studio-controls,
  .studio-preview { padding: 18px; }
  .studio-preview { min-height: 450px; }
  .live-frame { min-height: 360px; }
  .result-grid { height: 410px; }
  .docs-page { padding-inline: 16px; }
  .docs-hero h1 { font-size: 40px; }
  .docs-section-head { grid-template-columns: 1fr; }
  .docs-section-head > span { width: 38px; height: 38px; }
  .code-block pre { padding: 18px; font-size: 12px; }
  .admin-main { padding-inline: 14px; }
  .metric-grid { gap: 9px; }
  .metric { padding: 16px; }
}

/* Grid items use an automatic min-content width by default. Long localized
   labels in the auth tabs and verification copy could therefore make the
   card wider than a phone viewport. Explicitly bound the card to the
   available viewport while preserving the desktop 520px measure. */
.login-page,
.auth-card {
  min-width: 0;
}

.auth-card {
  width: min(520px, calc(100vw - 28px));
  max-width: 100%;
}

@media (max-width: 520px) {
  .auth-card {
    width: 100%;
  }

  .auth-card .tab {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

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

/* Public announcement modal. Content is inserted with textContent so markup
   supplied by an administrator can never become executable HTML. */
.announcement-modal{width:min(560px,calc(100vw - 32px));max-width:560px;padding:0;border:1px solid #ffffff24;border-radius:12px;background:#161521;color:var(--fg);box-shadow:0 28px 90px #000b}.announcement-modal::backdrop{background:#05050bcc;backdrop-filter:blur(4px)}.announcement-modal-surface{padding:22px}.announcement-modal-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.announcement-modal-kicker{font-size:10px;letter-spacing:.12em;color:#d8b4fe}.announcement-modal-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.75;color:#e8e6ef;font-size:14px;max-height:min(55vh,420px);overflow:auto}.announcement-modal-actions{display:flex;justify-content:flex-end;margin-top:22px}.announcement-modal .icon-action{border:1px solid #ffffff22;background:transparent;color:#aaa;cursor:pointer;border-radius:6px;width:30px;height:30px;font-size:18px}.announcement-modal .icon-action:hover{color:#fff;background:#ffffff0d}

/* Final landing pass: keep the first viewport compact and image-led. */
body#top {
  position: relative;
  isolation: isolate;
  padding-top: 64px;
  background: linear-gradient(180deg, #0e1015 0, #0b0c0f 34rem, #0b0c0f 100%);
}

body#top::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 64px 0 0;
  pointer-events: none;
  opacity: .24;
  background-image:
    radial-gradient(circle at 9% 18%, #ffffff 0 1px, transparent 1.5px),
    radial-gradient(circle at 23% 64%, #59bff5 0 1px, transparent 1.5px),
    radial-gradient(circle at 42% 28%, #ffffff 0 1px, transparent 1.5px),
    radial-gradient(circle at 63% 17%, #ff7a90 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 53%, #ffffff 0 1px, transparent 1.5px),
    radial-gradient(circle at 93% 31%, #59bff5 0 1px, transparent 1.5px);
  background-size: 420px 300px, 560px 420px, 680px 380px, 520px 460px, 740px 520px, 610px 360px;
  animation: landingStars 24s linear infinite;
}

body#top > .ambient,
body#top > .grain {
  z-index: 0;
}

body#top .topbar {
  position: fixed;
  top: 0;
  z-index: 12;
  left: 50%;
  width: min(100%, 1240px);
  height: 64px;
  margin: 0;
  padding-inline: 28px;
  background: #0d0f14c7;
  border-bottom: 1px solid #ffffff0d;
  backdrop-filter: blur(16px) saturate(1.1);
  transform: translateX(-50%);
}

body#top .topbar nav {
  margin-left: 74px;
}

body#top .topbar nav a {
  min-height: 36px;
  padding: 8px 14px;
}

body#top .actions {
  gap: 7px;
}

body#top .hero {
  isolation: isolate;
  overflow: hidden;
  min-height: 620px;
  width: min(100%, 1160px);
  padding: 30px 32px 34px;
}

/* Generated visual assets stay behind the live controls and copy while the
   vector logo remains the crisp small-size identity mark. */
body#top .hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url('/assets/generated/circles-hero-bg-v1.png') center / cover no-repeat;
  opacity: .3;
  border-radius: 18px;
}

body#top .hero-art {
  height: 180px;
}

body#top .mascot {
  width: 190px;
  height: 178px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 16px 30px #0009);
}

body#top .generated-mascot {
  object-fit: contain;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 48%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 48%, transparent 78%);
}

body#top .mascot-light-fallback {
  display: none;
}

@keyframes mascotFloat {
  0%, 100% { transform: translate(-50%, calc(-50% - 2px)); }
  50% { transform: translate(-50%, calc(-50% + 5px)); }
}

body#top .mascot-aura {
  display: block;
  position: absolute;
  z-index: 1;
  width: 258px;
  height: 258px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #746df62b 0, #746df610 38%, transparent 72%);
  filter: blur(7px);
  animation: landingAura 5.8s ease-in-out infinite;
}

body#top .anime-stars {
  font-size: 16px;
  text-shadow: 0 0 16px currentColor;
}

body#top .star-a { left: calc(50% - 126px); top: 54px; }
body#top .star-b { left: calc(50% + 106px); top: 36px; }
body#top .star-c { left: calc(50% + 84px); top: 116px; }

body#top .eyebrow {
  width: fit-content;
  margin-inline: auto;
  padding: 5px 11px;
  min-height: 26px;
  border: 1px solid #746df63d;
  border-radius: 999px;
  background: #746df60b;
  font-size: 13px;
}

body#top .hero h1 {
  margin: 16px auto 14px;
  font-size: 68px !important;
  line-height: 1.04;
}

body#top .subtitle {
  max-width: 660px;
  font-size: 16px;
  line-height: 1.55;
}

body#top .composer {
  width: min(100%, 672px);
  min-height: 61px;
  margin: 28px auto 10px;
  padding: 6px;
  gap: 8px;
  border-radius: 10px;
}

body#top .composer button {
  min-width: 108px;
  min-height: 47px;
  padding-inline: 17px;
  white-space: nowrap;
}

body#top .chips {
  gap: 7px;
}

body#top .chips button {
  min-height: 32px;
  padding-inline: 11px;
  font-size: 12px;
}

body#top .inspiration-section {
  padding-top: 4px;
  padding-bottom: 66px;
}

body#top .inspiration-mask {
  margin-top: 24px;
}

body#top .inspiration-card {
  width: 260px;
  height: 156px;
}

@keyframes landingStars {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 28px 18px, -24px 20px, 18px -16px, -30px 12px, 22px -18px, -18px 16px; }
}

@keyframes landingAura {
  0%, 100% { opacity: .62; transform: scale(.94); }
  50% { opacity: .94; transform: scale(1.04); }
}

body.light#top,
html.light body#top {
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 36rem, #f5f6f8 100%);
}

body.light#top::before,
html.light body#top::before {
  display: none;
}

body.light#top .topbar {
  background: #ffffffe8;
  border-bottom-color: #17191d12;
}

body.light#top .mascot-aura {
  opacity: .12;
  background: radial-gradient(circle, #746df61c 0, #746df608 40%, transparent 72%);
  animation: none;
}

body.light#top .mascot {
  filter: drop-shadow(0 12px 22px #4b4f5a33);
}

body.light#top .generated-mascot {
  display: none;
}

body.light#top .mascot-light-fallback {
  display: block;
}

/* Landing-page theme parity -------------------------------------------------
   The landing shell predates the shared signed-in theme contract and keeps a
   few rules scoped to `body.light:not(#top)`.  Mirror the essential light
   values on the root state as well so a freshly loaded page cannot render a
   light control with dark-canvas colors while the body class is settling. */
html.light body#top {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface2: #eef0f3;
  --fg: #17191d;
  --muted: #61656f;
  --faint: #858a95;
  --line: #17191d1a;
  color: var(--fg);
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 36rem, #f5f6f8 100%);
}

html.light body#top .topbar {
  background: #fffffff2;
  border-bottom-color: #17191d12;
}

html.light body#top .topbar nav a {
  color: #61656f;
}

html.light body#top .topbar nav a:hover,
html.light body#top .topbar nav a.active {
  color: #17191d;
  background: #17191d0b;
}

html.light body#top .topbar nav a.active {
  box-shadow: inset 0 0 0 1px #17191d16;
}

html.light body#top .hero::before {
  opacity: .14;
  filter: saturate(.78) brightness(1.12);
}

html.light body#top .hero h1 span {
  color: #17191d;
  background: none;
}

html.light body#top .hero h1 span + span {
  color: #5750a7;
}

html.light body#top .subtitle,
html.light body#top .section-desc {
  color: #61656f;
}

@media (max-width: 1000px) {
  body#top .hero h1 { font-size: 60px !important; }
}

@media (max-width: 700px) {
  body#top .topbar {
    height: 64px;
    padding-inline: 14px;
  }

  body#top .brand {
    gap: 8px;
    font-size: 17px;
  }

  body#top .brand .logo-img {
    width: 28px;
    height: 28px;
  }

  body#top .actions {
    gap: 5px;
  }

  body#top .landing-language,
  body#top .icon-btn {
    min-width: 36px;
    width: 36px;
    height: 36px;
    padding: 0;
  }

  /* The full language sentence does not fit in the compact landing header.
     Keep it in the button for assistive technology and the i18n tooltip,
     while showing a stable locale marker on screen. */
  body#top .landing-language {
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    text-align: center;
  }

  body#top .landing-language::after {
    content: "中";
    display: block;
    font-size: 12px;
    line-height: 1;
  }

  html[lang^="zh"] body#top .landing-language::after {
    content: "EN";
  }

  body#top .actions .ghost-btn { display: none; }

  body#top .actions .solid-btn {
    display: inline-flex;
    flex: 0 0 auto;
    width: 88px;
    min-width: 88px;
    min-height: 36px;
    height: 36px;
    padding: 0 8px;
    gap: 4px;
    border-radius: 7px;
    font-size: 12px;
    white-space: nowrap;
  }

  body#top .menu-btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 36px;
    padding: 0;
    font-size: 20px;
  }

  body#top .topbar nav.mobile-open {
    top: 60px;
    left: 14px;
    right: 14px;
    margin-left: 0;
  }

  body#top .hero {
    min-height: 580px;
    padding: 22px 18px 22px;
  }

  body#top .hero-art {
    height: 180px;
  }

  body#top .mascot {
    width: 178px;
    height: 156px;
    top: -10px;
  }

  body#top .mascot-aura {
    width: 224px;
    height: 224px;
    top: -18px;
  }

  body#top .star-a { left: calc(50% - 112px); top: 52px; }
  body#top .star-b { left: calc(50% + 94px); top: 34px; }
  body#top .star-c { left: calc(50% + 72px); top: 108px; }

  body#top .eyebrow {
    margin-top: 8px;
    min-height: 26px;
    gap: 7px;
    font-size: 12px;
    white-space: nowrap;
  }

  body#top .hero h1 {
    margin: 16px auto 14px;
    font-size: 38px !important;
    line-height: 1.04;
  }

  body#top .subtitle {
    max-width: 350px;
    font-size: 14px;
    line-height: 1.5;
  }

  body#top .composer {
    display: flex;
    width: 100%;
    min-height: 60px;
    margin-top: 22px;
    padding: 6px;
  }

  body#top .composer input {
    min-width: 0;
    font-size: 14px;
    padding-inline: 2px;
    text-overflow: ellipsis;
  }

  body#top .composer button {
    flex: 0 0 94px;
    width: 94px;
    min-width: 94px;
    min-height: 46px;
    padding-inline: 8px;
    font-size: 13px;
  }

  body#top .chips {
    gap: 6px;
  }

  body#top .chips button {
    min-height: 32px;
    padding-inline: 8px;
    font-size: 11px;
  }

  body#top .inspiration-section {
    padding-inline: 18px;
    padding-top: 0;
    padding-bottom: 58px;
  }

  body#top .inspiration-mask {
    margin: 20px -18px 0;
    padding-inline: 18px;
  }

  body#top .inspiration-card {
    width: 220px;
    height: 136px;
  }

  body#top .inspiration-card span {
    left: 14px;
    bottom: 13px;
    font-size: 13px;
  }

  /* Keep shorter localized copy aligned with the reference hero. */
  html[lang^="zh"] body#top .eyebrow { transform: translateY(16px); }
  html[lang^="zh"] body#top .hero h1 { transform: translateY(16px); }
  html[lang^="zh"] body#top .subtitle { transform: translateY(27px); }
  html[lang^="zh"] body#top .composer { transform: translateY(43px); }
  html[lang^="zh"] body#top .chips { transform: translateY(48px); }
}

@media (max-width: 380px) {
  body#top .landing-language { display: none; }
  body#top .hero h1 { font-size: 35px !important; }
  body#top .actions .solid-btn { width: 84px; min-width: 84px; }
}

@media (max-width: 360px) {
  body#top .eyebrow {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 2px;
    white-space: normal;
    border-radius: 12px;
  }

  body#top .eyebrow > span:nth-child(3) { display: none; }
  body#top #platformStatus { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  body#top::before,
  body#top .mascot,
  body#top .mascot-aura,
  body#top .anime-stars,
  body#top .inspiration-rail {
    animation: none !important;
  }

  body#top .inspiration-rail {
    transform: none !important;
  }
}

/* Signed-in chrome: keep the navigation calm and make the language, balance,
   and account controls read as one intentional utility group. */
@media (min-width: 851px) {
  .appbar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
  }

  .appbar .nav {
    justify-content: center;
    min-width: 0;
  }
}

.appbar .bar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 42px;
  padding: 3px;
  border: 1px solid #ffffff18;
  border-radius: 9px;
  background: #14161bcc;
  box-shadow: inset 0 1px 0 #ffffff08, 0 8px 24px -20px #000;
}

.appbar .language-toggle,
.appbar .credit,
.appbar .user-menu,
.appbar .bar-actions .outline {
  min-height: 34px;
  border-radius: 6px;
}

.appbar .language-toggle {
  min-width: 46px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #dfe1e7;
  font-size: 12px;
}

.appbar .language-toggle:hover {
  border-color: transparent;
  background: #ffffff0d;
}

.appbar .credit {
  display: inline-flex;
  align-items: center;
  min-width: 82px;
  height: 34px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid #ffffff12;
  border-radius: 0 6px 6px 0;
  color: #bdb8ff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.appbar .user-menu,
.appbar .bar-actions .outline {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-left: 1px solid #ffffff12;
  border-radius: 0 6px 6px 0;
  background: transparent;
  color: #dfe1e7;
  font-size: 12px;
  white-space: nowrap;
}

.appbar .user-menu:hover,
.appbar .bar-actions .outline:hover {
  border-color: #ffffff12;
  background: #ffffff0d;
}

.appbar .nav a {
  transition: color .18s ease, background-color .18s ease;
}

@media (max-width: 850px) {
  .appbar .bar-actions {
    min-height: 38px;
    padding: 2px;
    border-radius: 8px;
  }

  .appbar .language-toggle,
  .appbar .credit,
  .appbar .user-menu,
  .appbar .bar-actions .outline {
    min-height: 32px;
    height: 32px;
  }

  .appbar .language-toggle {
    min-width: 42px;
    padding-inline: 8px;
  }

  .appbar .credit {
    min-width: 0;
    padding-inline: 8px;
  }
}

/* Registration verification -------------------------------------------------
   Keep this control visually separate from the password fields so the
   verification step is obvious when an operator enables it.  The same rules
   also style the loading/unavailable states rendered by login.html; those
   states remain useful on installations that have not configured SMTP yet. */
.auth-config-status {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #f3be5345;
  border-radius: 8px;
  background: #f3be530c;
  color: #e7c67d;
  font-size: 12px;
  line-height: 1.55;
}

.auth-config-status.error {
  border-color: #fb718155;
  background: #fb718110;
  color: #fecaca;
}

.auth-verification-field,
.auth-verification-panel {
  position: relative;
  display: block;
  margin: 0 !important;
  padding: 14px;
  border: 1px solid #a78bfa38;
  border-radius: 10px;
  background: linear-gradient(135deg, #a855f70f, #ffffff03);
  box-shadow: inset 0 1px 0 #ffffff08;
}

.auth-verification-field:focus-within,
.auth-verification-panel:focus-within {
  border-color: #a78bfa80;
  box-shadow: inset 0 1px 0 #ffffff0c, 0 0 0 3px #746df61b;
}

.auth-verification-field[data-state="loading"],
.auth-verification-panel[data-state="loading"] {
  border-color: #ffffff20;
  background: #ffffff03;
}

.auth-verification-field[data-state="unavailable"],
.auth-verification-panel[data-state="unavailable"] {
  border-color: #f3be5338;
  background: #f3be5309;
}

.auth-verification-field[data-state="error"],
.auth-verification-panel[data-state="error"] {
  border-color: #fb718155;
  background: #fb71810b;
}

.field-label-text,
.auth-verification-title {
  display: block;
  color: #ecebf3;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.auth-verification-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-verification-heading-copy {
  min-width: 0;
}

.auth-verification-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.auth-verification-state {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid #a78bfa45;
  border-radius: 999px;
  color: #c4bfff;
  background: #a855f718;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
}

.auth-verification-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #a78bfa40;
  border-radius: 8px;
  color: #c4bfff;
  background: #a855f716;
  font-size: 15px;
}

.auth-verification-help,
.auth-field-help,
.auth-verification-status {
  display: block;
  margin: 5px 0 0;
  color: #a5a4b3;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
}

.auth-verification-status {
  margin-top: 9px;
  color: #c4bfff;
}

.auth-verification-status.error {
  color: #fecaca;
}

.auth-verification-status.success {
  color: #86efac;
}

.auth-verification-input-label {
  display: block;
  margin: 0 0 7px;
  color: #b9b7c5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .01em;
}

.auth-verification-controls {
  margin-top: 2px;
}

.verification-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 9px;
  align-items: stretch;
}

.verification-control .text-input {
  min-width: 0;
  margin-top: 0;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.verification-control .text-input::placeholder {
  letter-spacing: 0;
}

.verification-send {
  min-height: 48px;
  padding-inline: 12px;
  white-space: nowrap;
}

.verification-send:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

@media (max-width: 520px) {
  .auth-verification-field,
  .auth-verification-panel {
    padding: 13px;
  }

  .verification-control {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .verification-send {
    width: 100%;
  }

  .auth-verification-heading {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-verification-field,
  .auth-verification-panel {
    transition: none;
  }
}

/* Shared theme contract ---------------------------------------------------
   All signed-in pages use the same html/body theme state. These overrides
   intentionally sit at the end of the polish sheet so page-specific legacy
   colors cannot leave a light page with unreadable dark controls. */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dfe1e7;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  transition: background-color .18s ease, color .18s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  outline: none;
  background: #ffffff12;
  color: #fff;
}

.appbar .bar-actions .theme-toggle {
  border-right: 1px solid #ffffff12;
  border-radius: 6px 0 0 6px;
}

@media (min-width: 851px) {
  .appbar-inner { gap: clamp(12px, 2vw, 28px); }
  .appbar .nav { overflow-x: auto; scrollbar-width: none; }
  .appbar .nav::-webkit-scrollbar { display: none; }
  .appbar .nav a { white-space: nowrap; }
  .appbar .bar-actions { max-width: 42vw; overflow: hidden; }
  .appbar .bar-actions > * { flex: 0 0 auto; }
  .appbar .user-menu { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 850px) {
  .appbar .bar-actions { max-width: min(68vw, 420px); overflow: hidden; }
  .appbar .bar-actions .theme-toggle { width: 32px; height: 32px; }
  .appbar .bar-actions .language-toggle { max-width: 42px; overflow: hidden; text-overflow: clip; }
  .appbar .bar-actions .user-menu { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}

/* A full sentence such as "Switch to Chinese" cannot fit beside the
   compact mobile navigation controls. Keep the accessible label in the DOM,
   but render a stable locale marker so the action cluster never wraps. */
@media (max-width: 850px) {
  .appbar .bar-actions .language-toggle {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    padding-inline: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    text-align: center;
  }

  .appbar .bar-actions .language-toggle::after {
    content: "中";
    display: block;
    font-size: 12px;
    line-height: 1;
  }

  html[lang^="zh"] .appbar .bar-actions .language-toggle::after {
    content: "EN";
  }
}

body.light:not(#top) {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface2: #eef0f3;
  --fg: #17191d;
  --muted: #61656f;
  --faint: #858a95;
  --line: #17191d1a;
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 36rem, #f5f6f8 100%);
  color: var(--fg);
}

body.light:not(#top) .appbar {
  background: #fffffff2;
  border-color: #17191d18;
  box-shadow: 0 8px 24px -24px #25283280;
}

body.light:not(#top) .brand { color: #17191d; }
body.light:not(#top) .nav a { color: #61656f; }
body.light:not(#top) .nav a:hover,
body.light:not(#top) .nav a.on { color: #17191d; background: #17191d0b; }
body.light:not(#top) .appbar .bar-actions { border-color: #17191d1c; background: #fff; box-shadow: 0 5px 18px -16px #25283266; }
body.light:not(#top) .theme-toggle { color: #4f5360; }
body.light:not(#top) .theme-toggle:hover,
body.light:not(#top) .theme-toggle:focus-visible { color: #17191d; background: #17191d0b; }
body.light:not(#top) .appbar .bar-actions .theme-toggle,
body.light:not(#top) .appbar .credit,
body.light:not(#top) .appbar .user-menu,
body.light:not(#top) .appbar .bar-actions .outline,
body.light:not(#top) .appbar .bar-actions .language-toggle { border-color: #17191d14; color: #343842; }
body.light:not(#top) .appbar .bar-actions .language-toggle:hover,
body.light:not(#top) .appbar .bar-actions .language-toggle:focus-visible { color: #17191d; background: #17191d0b; }
body.light:not(#top) .appbar .credit { color: #5a47a8; }
body.light:not(#top) .panel,
body.light:not(#top) .settings-card,
body.light:not(#top) .docs-panel,
body.light:not(#top) .data-panel { background: #ffffff; border-color: #17191d18; box-shadow: 0 18px 50px -42px #30323d55; }
body.light:not(#top) .field-label,
body.light:not(#top) .control-title,
body.light:not(#top) .settings-card h2,
body.light:not(#top) .docs-panel h2,
body.light:not(#top) .page-head h1,
body.light:not(#top) .studio-head h1 { color: #17191d; }
body.light:not(#top) .page-head p,
body.light:not(#top) .studio-head p,
body.light:not(#top) .settings-card > p,
body.light:not(#top) .docs-note { color: #61656f; }
body.light:not(#top) .text-input,
body.light:not(#top) .select,
body.light:not(#top) .prompt,
body.light:not(#top) .auth-card .text-input { color: #17191d; background: #f7f8fa; border-color: #17191d22; }
body.light:not(#top) .text-input::placeholder,
body.light:not(#top) .prompt::placeholder,
body.light:not(#top) .auth-card .text-input::placeholder { color: #858a95; }
body.light:not(#top) .choice,
body.light:not(#top) .tab,
body.light:not(#top) .btn,
body.light:not(#top) .payment-method { color: #4f5360; background: #fff; border-color: #17191d22; }
body.light:not(#top) .choice.on,
body.light:not(#top) .tab.on,
body.light:not(#top) .payment-method.on { color: #403477; background: #eeeaff; border-color: #887be6; }
body.light:not(#top) .btn.primary,
body.light:not(#top) .submit { color: #fff; background: #6554d9; border-color: #6554d9; }
body.light:not(#top) .dropzone { color: #61656f; background: #f6f4ff; border-color: #8b7ce055; }
body.light:not(#top) .preview,
body.light:not(#top) .studio-preview,
body.light:not(#top) .video-preview { background: #f7f8fa; }
body.light:not(#top) .live-frame,
body.light:not(#top) .video-status-visual,
body.light:not(#top) .video-result-frame { background: #e9ebef; }
body.light:not(#top) .work,
body.light:not(#top) .recent-work,
body.light:not(#top) .video-history-card { background: #fff; border-color: #17191d18; color: #17191d; }
body.light:not(#top) .code-block,
body.light:not(#top) .model-reference,
body.light:not(#top) .docs-table-wrap,
body.light:not(#top) .billing-points > div { background: #fff; border-color: #17191d18; }
body.light:not(#top) .code-block pre { background: #f2f3f6; color: #242730; }
body.light:not(#top) .docs-table th { background: #f1f2f5; color: #555a66; }
body.light:not(#top) .docs-table td { color: #3d414b; border-color: #17191d12; }
body.light:not(#top) .toast { background: #fff; color: #17191d; border-color: #17191d22; box-shadow: 0 12px 40px -22px #25283266; }
body.light:not(#top) .auth-card { background: #fff; border-color: #17191d1c; box-shadow: 0 30px 90px -42px #25283255; }
body.light:not(#top) .auth-card .tabs { background: #f1f2f5; border-color: #17191d15; }
body.light:not(#top) .auth-card .tab { color: #61656f; }
body.light:not(#top) .auth-card .tab.on { color: #30275e; background: #e9e7ff; }
body.light:not(#top) .auth-card .field-label,
body.light:not(#top) .auth-verification-title { color: #343842; }
body.light:not(#top) .auth-utility .language-toggle { color: #4f5360; }

/* Circles visual system v3: one coherent theme contract for the landing page. */
body#top .hero-art { height: 156px; margin-bottom: 4px; }
body#top .hero-art::before,
body#top .hero-art::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
body#top .hero-art::before { width: 250px; height: 110px; border: 1px solid #8b7cff52; box-shadow: 0 0 80px #746df62e, inset 0 0 40px #5de1ff12; transform: translate(-50%,-50%) rotate(28deg); }
body#top .hero-art::after { width: 170px; height: 170px; border: 1px solid #5de1ff45; transform: translate(-50%,-50%) rotate(-32deg); }
body#top .generated-mascot { width: 112px; height: 112px; mix-blend-mode: normal; mask-image: none; -webkit-mask-image: none; z-index: 2; filter: drop-shadow(0 14px 28px #0008); }
body#top .mascot-aura { width: 230px; height: 230px; background: radial-gradient(circle, #746df63a 0, #5de1ff0f 42%, transparent 72%); }
body#top .anime-stars, body#top .mascot-light-fallback { display: none !important; }
body.light#top .hero::before, html.light body#top .hero::before { display: none; }
body.light#top .hero-art::before { border-color: #746df63d; box-shadow: 0 0 70px #746df61f, inset 0 0 32px #5d8dff10; }
body.light#top .hero-art::after { border-color: #5d8dff38; }
body.light#top .mascot-aura { background: radial-gradient(circle, #746df626 0, #5d8dff09 42%, transparent 72%); }
body.light#top .generated-mascot { filter: drop-shadow(0 12px 24px #39415a28); }
body.light#top .inspiration-card::after { background: linear-gradient(transparent, #151925d9); }
body.light#top .inspiration-card span { color: #fff; }
body.light#top .stats { background: #ffffff; border-color: #17191d18; }
body.light#top .stats div { border-color: #17191d12; }
body.light#top .stats b, body.light#top .stats span { color: #17191d; }
body.light#top .stats span { color: #69707b; }
body.light#top .section h2, body.light#top .cta h2 { color: #17191d; }
body.light#top .cta { background: #ffffff; box-shadow: 0 20px 70px -50px #1d243355; }
body.light#top .solid-btn, body.light#top .composer button { background: #5547c7; }
body#top .public-model, body#top .feature-card, body#top .stats { box-shadow: 0 18px 50px -42px #0008; }
@media (max-width: 700px) { body#top .hero-art { height: 132px; } body#top .generated-mascot { width: 92px; height: 92px; } body#top .hero h1 { font-size: 48px !important; } }

/* Login utility controls stay aligned when localized labels change length. */
.auth-utility { position: absolute; top: 18px; right: 18px; display: inline-flex; align-items: center; gap: 4px; }
.auth-utility .language-toggle { position: static; }
@media (max-width: 520px) { .auth-utility { top: 12px; right: 12px; } }

/* The auth utility sits inside the card on narrow screens. Keep the locale
   control a fixed-size icon so a translated sentence cannot wrap over the
   logo or push the form horizontally. The full label remains available to
   assistive technology and the title tooltip. */
@media (max-width: 520px) {
  .auth-utility .language-toggle {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 34px;
    padding-inline: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    text-align: center;
  }

  .auth-utility .language-toggle::after {
    content: "中";
    display: block;
    font-size: 12px;
    line-height: 1;
  }

html[lang^="zh"] .auth-utility .language-toggle::after {
    content: "EN";
  }
}

/* Admin's account cluster shares the compact topbar on phones. Preserve the
   same fixed locale affordance used by the public and auth headers so the
   heading never competes with a wrapped translation label. */
@media (max-width: 520px) {
  .admin-account .language-toggle {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 32px;
    padding-inline: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
    text-align: center;
  }

  .admin-account .language-toggle::after {
    content: "中";
    display: block;
    font-size: 12px;
    line-height: 1;
  }

  html[lang^="zh"] .admin-account .language-toggle::after {
    content: "EN";
  }
}

/* Final theme and shell pass. Keep authentication and documentation on the
   same page canvas as the shared toggle; legacy auth rules otherwise leave a
   dark halo around the light card and wash out code labels. */
body.light .login-page {
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 100%);
  color: #17191d;
}

/* The root class is applied before body styles on a cold navigation. Keep
   the auth canvas light even if the body class is briefly unavailable. */
html.light .login-page {
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 100%);
  color: #17191d;
}

html.light body {
  color-scheme: light;
  background: linear-gradient(180deg, #ffffff 0, #f5f6f8 36rem, #f5f6f8 100%);
  color: #17191d;
}

body.light .login-page::before,
body.light .login-page::after {
  display: none;
}

body.light .auth-card {
  background: #ffffff;
  border-color: #17191d1c;
  border-top-color: #7668dc66;
  box-shadow: 0 30px 90px -42px #25283255, 0 0 0 1px #17191d08;
}

html.light .auth-card {
  background: #ffffff;
  border-color: #17191d1c;
  border-top-color: #7668dc66;
  box-shadow: 0 30px 90px -42px #25283255, 0 0 0 1px #17191d08;
}

body.light .auth-card .tabs {
  background: #f1f2f5;
  border-color: #17191d18;
}

body.light .auth-card .tab.on {
  background: #e9e7ff;
  color: #30275e;
  box-shadow: inset 0 0 0 1px #887be655;
}

body.light .auth-card .field-label,
body.light .auth-card .auth-verification-title,
body.light .auth-card .auth-form-heading h1 {
  color: #343842;
}

body.light .auth-card .auth-kicker,
body.light .auth-card .auth-form-heading p,
body.light .auth-card .auth-hint,
body.light .auth-card .auth-verification-help,
body.light .auth-card .auth-verification-state {
  color: #61656f;
}

body.light .auth-card .text-input {
  color: #17191d;
  background: #f7f8fa;
  border-color: #17191d24;
}

body.light .auth-card .text-input:hover,
body.light .auth-card .text-input:focus {
  background: #ffffff;
  border-color: #7668dc88;
}

body.light .auth-card .auth-link {
  color: #5147a5;
}

body.light .auth-card .auth-link:hover {
  color: #30275e;
}

/* Shared signed-in navigation contrast. Legacy app.css leaves these links
   on a muted inherited value that becomes too faint against the dark shell. */
html:not(.light) body .appbar .nav a {
  color: #b7bbc7;
}

html:not(.light) body .appbar .nav a:hover,
html:not(.light) body .appbar .nav a.on {
  color: #f7f7fa;
}

body.light .docs-badge,
body.light .docs-section-head > span {
  border-color: #7668dc55;
  background: #eeeaff;
  color: #5147a5;
}

body.light .capability-callout {
  border-color: #7668dc;
  color: #61656f;
}

body.light .capability-callout strong,
body.light .docs-section-head h2,
body.light .docs-panel h2,
body.light .docs-subtitle,
body.light .model-reference strong {
  color: #17191d;
}

body.light .docs-kv,
body.light .endpoint-row,
body.light .docs-section-head p,
body.light .docs-hero > p {
  color: #4f5360;
}

body.light .docs-kv code,
body.light .endpoint-row code,
body.light .docs-table td:first-child,
body.light .docs-table code,
body.light .ratio-reference code,
body.light .copy-code,
body.light .model-reference-main code {
  color: #5147a5;
}

body.light .method.get {
  background: #d9f8ec;
  color: #08744f;
}

body.light .method.post {
  background: #d9f1fb;
  color: #126487;
}

body.light .code-block {
  background: #ffffff;
  border-color: #17191d1c;
}

body.light .code-head {
  color: #555a66;
  border-color: #17191d18;
}

body.light .code-block pre {
  color: #242730;
}

body.light .model-reference,
body.light .model-capabilities span,
body.light .model-capabilities code,
body.light .ratio-reference > div,
body.light .example-tabs button,
body.light .error-grid > div {
  background: #ffffff;
  border-color: #17191d1c;
}

body.light .model-reference-main span,
body.light .model-reference-description,
body.light .model-capabilities span,
body.light .model-capabilities code,
body.light .error-grid > div,
body.light .ratio-reference > div {
  color: #4f5360;
}

body.light .example-tabs button {
  color: #4f5360;
}

body.light .example-tabs button.on {
  color: #30275e;
  background: #eeeaff;
  border-color: #887be6;
}

body.light .billing-points {
  background: #17191d18;
  border-color: #17191d18;
}

body.light .billing-points > div {
  background: #ffffff;
}

body.light .billing-points strong {
  color: #17191d;
}

body.light .error-grid code {
  color: #a03d55;
}

/* Desktop navigation yields space to the action cluster, while the existing
   mobile bottom bar remains horizontally scrollable. */
@media (min-width: 851px) {
  .appbar-inner {
    gap: clamp(10px, 1.7vw, 28px);
  }

  .appbar .nav {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    gap: 2px;
    margin-inline: clamp(4px, 1vw, 18px);
  }

  .appbar .nav a {
    padding-inline: clamp(8px, 0.9vw, 13px);
  }

  .appbar .bar-actions {
    flex: 0 0 auto;
  }
}

@media (max-width: 850px) {
  .appbar .nav a {
    min-width: max-content;
  }
}
