:root {
  --ink: #1d2433;
  --muted: #657087;
  --line: rgba(24, 33, 56, 0.1);
  --line-strong: rgba(24, 33, 56, 0.16);
  --accent: #ff7a18;
  --accent-strong: #d84a00;
  --accent-soft: #fff3ea;
  --blue: #6b4dff;
  --blue-soft: #f2edff;
  --green: #1f8b48;
  --red: #c24034;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --shadow-soft: 0 14px 36px rgba(33, 49, 90, 0.07);
  --shadow-lift: 0 16px 38px rgba(33, 49, 90, 0.1);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(107, 77, 255, 0.18), transparent 26%),
    radial-gradient(circle at 88% 12%, rgba(255, 122, 24, 0.18), transparent 30%),
    radial-gradient(circle at 82% 86%, rgba(107, 77, 255, 0.08), transparent 34%),
    linear-gradient(180deg, #f7f3ff 0%, #fff6ee 100%);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button,
input,
textarea,
select {
  font: inherit;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.6;
  z-index: -1;
  animation: floatBlob 18s ease-in-out infinite alternate;
}
body::before {
  width: 420px;
  height: 420px;
  left: -120px;
  top: 120px;
  background: radial-gradient(circle, rgba(107, 77, 255, 0.22), rgba(107, 77, 255, 0));
}
body::after {
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: 80px;
  background: radial-gradient(circle, rgba(255, 122, 24, 0.22), rgba(255, 122, 24, 0));
  animation-delay: -6s;
}
.hidden { display: none !important; }
@keyframes floatBlob {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -12px, 0) scale(1.06); }
  100% { transform: translate3d(-14px, 22px, 0) scale(0.96); }
}
button,
.link-btn,
.tier-cta,
.quick-chip,
.task-actions a,
.detail-line-btn,
.provider-choice,
.choice-pill {
  -webkit-tap-highlight-color: transparent;
  transition:
    transform .14s ease,
    box-shadow .14s ease,
    border-color .14s ease,
    background .14s ease,
    color .14s ease,
    filter .14s ease;
}
button:active:not(:disabled),
.link-btn:active,
.tier-cta:active,
.quick-chip:active,
.task-actions a:active,
.detail-line-btn:active,
.provider-choice:active,
.choice-pill:active {
  transform: translateY(1px) scale(0.985);
  filter: saturate(1.08) brightness(0.97);
}
button:focus-visible,
.link-btn:focus-visible,
.tier-cta:focus-visible,
.quick-chip:focus-visible,
.task-actions a:focus-visible,
.detail-line-btn:focus-visible,
.provider-choice:focus-visible,
.choice-pill:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(107, 77, 255, 0.22);
  outline-offset: 2px;
}
.shell { min-height: 100vh; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 70;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  backdrop-filter: blur(16px);
  box-shadow: 0 6px 22px rgba(31, 45, 78, 0.05);
}
.app-header-left,
.app-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.menu-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  display: grid;
  align-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.menu-btn span {
  display: block;
  height: 3px;
  width: 28px;
  border-radius: 999px;
  background: #3f4655;
  transition: transform .16s ease, opacity .16s ease;
}
body.nav-open .menu-btn span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.nav-open .menu-btn span:nth-child(2) { opacity: 0; }
body.nav-open .menu-btn span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 0; }
.brand-mark {
  width: 36px;
  height: 36px;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 246, 238, 0.92), rgba(255, 246, 238, 0) 24%),
    linear-gradient(145deg, #ffab69 0%, #ff8748 54%, #ffc986 100%);
  box-shadow:
    0 14px 30px rgba(255, 124, 58, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
}
.brand-mark::before {
  left: 6px;
  right: 6px;
  bottom: 7px;
  height: 21px;
  border-radius: 8px 10px 10px 10px;
  border: 1px solid rgba(255, 245, 236, 0.56);
  background:
    linear-gradient(180deg, rgba(255, 244, 234, 0.96), rgba(255, 226, 198, 0.82)),
    rgba(122, 47, 13, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 6px 14px rgba(129, 48, 12, 0.1);
}
.brand-mark::after {
  left: 9px;
  top: 8px;
  width: 14px;
  height: 8px;
  border-radius: 5px 5px 2px 2px;
  background: rgba(255, 235, 214, 0.94);
  box-shadow:
    0 11px 0 0 rgba(255, 250, 244, 0.92),
    11px 11px 0 0 rgba(255, 250, 244, 0.92),
    18px 13px 0 -8px rgba(255, 137, 72, 0.96);
}
.brand-name { font-size: 22px; font-weight: 750; letter-spacing: -0.035em; }
.brand-sub { font-size: 12px; color: #697287; }
.app-header .brand-sub { display: none; }
.app-header .brand-name {
  background: linear-gradient(90deg, #d85f94, #ff6d1f);
  -webkit-background-clip: text;
  color: transparent;
}
.nav { display: flex; gap: 8px; align-items: center; }
.app-nav {
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar { display: none; }
.nav-item {
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #5e6573;
  padding: 9px 12px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}
.nav-item:hover {
  background: rgba(242, 237, 255, 0.92);
  color: #5e42d8;
  border-color: rgba(107, 77, 255, 0.16);
  box-shadow: 0 8px 18px rgba(107, 77, 255, 0.08);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.96), rgba(255, 243, 234, 0.9));
  color: var(--blue);
  border-color: rgba(107, 77, 255, 0.18);
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.app-menu-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
  z-index: 88;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.app-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(486px, calc(100vw - 34px));
  z-index: 89;
  background: rgba(255, 255, 255, 0.98);
  border-right: 1px solid rgba(24, 33, 56, 0.1);
  box-shadow: 24px 0 60px rgba(31, 45, 78, 0.14);
  border-radius: 0 22px 22px 0;
  transform: translateX(-104%);
  transition: transform .22s ease;
  padding: 48px 28px 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 34px;
}
body.nav-open .app-menu-mask {
  opacity: 1;
  pointer-events: auto;
}
body.nav-open .app-menu-drawer {
  transform: translateX(0);
}
.app-menu-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-menu-brand .brand-name {
  font-size: 32px;
  background: linear-gradient(90deg, #d85f94, #ff6d1f);
  -webkit-background-clip: text;
  color: transparent;
}
.app-menu-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}
.app-menu-nav .nav-item {
  text-align: left;
  font-size: 24px;
  padding: 14px 20px;
  border-radius: 12px;
  color: #767b84;
}
.app-menu-nav .nav-item.active {
  background: #f4f4f5;
  color: #ff6d1f;
}
.app-menu-footer {
  display: grid;
  gap: 12px;
}
.drawer-lang {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 999px;
  padding: 12px 14px;
  color: #1d2433;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 10px 22px rgba(31, 45, 78, 0.06);
}
.drawer-lang .locale-switch-label {
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  color: #7a8293;
  letter-spacing: 0.04em;
}
.drawer-lang .locale-switch-label.active { color: #1d2433; }
.drawer-lang .locale-switch-divider {
  color: #c9d0dc;
  font-size: 12px;
}
.lang-chip {
  border: 1px solid rgba(24, 33, 56, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  color: #1d2433;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  box-shadow: 0 8px 18px rgba(31, 45, 78, 0.06);
}
.lang-chip:hover { background: #f3efff; color: #6b4dff; border-color: rgba(107, 77, 255, 0.16); }
.locale-switch-label {
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  color: #7a8293;
  letter-spacing: 0.04em;
}
.locale-switch-label.active { color: #1d2433; }
.locale-switch-divider {
  color: #c9d0dc;
  font-size: 12px;
}

body.theme-dark {
  --ink: #edf3ff;
  --muted: #9aa6b7;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.28);
  --panel: rgba(15, 23, 42, 0.88);
  --panel-strong: rgba(17, 24, 39, 0.94);
  --shadow-soft: 0 14px 36px rgba(2, 6, 23, 0.28);
  --shadow-lift: 0 18px 44px rgba(2, 6, 23, 0.36);
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 109, 31, 0.12), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(36, 95, 188, 0.16), transparent 30%),
    linear-gradient(180deg, #050816 0%, #0b1120 100%);
}
body.theme-dark .app-header,
body.theme-dark .card,
body.theme-dark .auth-card,
body.theme-dark .user-chip,
body.theme-dark .admin-table-wrap,
body.theme-dark .generator-main,
body.theme-dark .generator-side,
body.theme-dark .account-sheet,
body.theme-dark .upload-dropzone-inner,
body.theme-dark .user-menu,
body.theme-dark .topbar,
body.theme-dark .pricing-tier,
body.theme-dark .pricing-rate-card,
body.theme-dark .docs-article-card,
body.theme-dark .docs-model-section {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.16);
}
body.theme-dark .brand-sub,
body.theme-dark .section-subtitle,
body.theme-dark .hint,
body.theme-dark .upload-dropzone-subtitle,
body.theme-dark .upload-dropzone-meta,
body.theme-dark .account-desc,
body.theme-dark .account-balance-note,
body.theme-dark .account-note-card p,
body.theme-dark .topbar p,
body.theme-dark .hero-sub,
body.theme-dark .public-section-head span,
body.theme-dark .public-section-head p,
body.theme-dark .pricing-head p,
body.theme-dark .faq-item p,
body.theme-dark .billing-note p {
  color: #9aa6b7;
}
body.theme-dark .section-title,
body.theme-dark .topbar h1,
body.theme-dark .hero-title,
body.theme-dark .generator-hero h2,
body.theme-dark .account-title,
body.theme-dark .docs-article-card h2,
body.theme-dark .docs-article-card h3,
body.theme-dark .docs-model-section h3 {
  color: #eef3ff;
}
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark select {
  background: rgba(2, 6, 23, 0.34);
  color: #f3f6fb;
  border-color: rgba(148, 163, 184, 0.18);
}
body.theme-dark .upload-file-pill,
body.theme-dark .status-pill,
body.theme-dark .quick-chip,
body.theme-dark .provider-choice,
body.theme-dark .choice-pill {
  background: rgba(2, 6, 23, 0.3);
  color: #d9e2f2;
  border-color: rgba(148, 163, 184, 0.16);
}
.main {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 36px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 2px 0;
}
.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 32px);
  letter-spacing: -0.04em;
}
.topbar p {
  margin: 5px 0 0;
  color: #6d7484;
  font-size: 14px;
}
body.view-create .topbar {
  display: none;
}
body:not(.unauth) .topbar {
  display: none;
}
body.view-create .main {
  padding-top: 18px;
}
.panel { display: block; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: 1.3fr 0.9fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.compact { gap: 12px; }
.card, .auth-card {
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 253, 255, 0.9)),
    rgba(255,255,255,0.88);
  box-shadow:
    var(--shadow-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  padding: 22px;
}
.card.accent {
  border-color: rgba(255, 109, 31, 0.18);
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 109, 31, 0.12), transparent 40%),
    linear-gradient(180deg, #fff5ec 0%, #fffefc 100%);
}
.auth-panel {
  display: grid;
  place-items: center;
  min-height: 70vh;
}
.auth-card { width: min(440px, 100%); }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tab, .secondary-btn, .primary-btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
}
.auth-turnstile {
  min-height: 68px;
}
.tab { background: #f3efff; color: #6b4dff; border-color: rgba(107, 77, 255, 0.12); }
.tab.active, .primary-btn {
  background: linear-gradient(135deg, #6b4dff, #ff7a18);
  color: white;
  box-shadow: 0 12px 24px rgba(107, 77, 255, 0.22);
}
.tab:hover,
.secondary-btn:hover {
  background: #f4eeff;
  border-color: rgba(107, 77, 255, 0.16);
  color: #342971;
  box-shadow: 0 10px 20px rgba(33, 49, 90, 0.08);
}
.primary-btn:hover {
  background: linear-gradient(135deg, #7b5cff, #ff8a2b);
  box-shadow: 0 14px 28px rgba(107, 77, 255, 0.24);
}
.secondary-btn {
  background: #f5f0ff;
  color: #4b3d95;
  border-color: rgba(107, 77, 255, 0.12);
}
.form-stack { display: flex; flex-direction: column; gap: 12px; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(24, 33, 56, 0.12);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
}
textarea { resize: vertical; }
.hint { color: #6b7280; font-size: 13px; min-height: 18px; }
.field { display: grid; gap: 8px; }
.field-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8293;
  font-weight: 700;
}
.section-title {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}
.section-subtitle {
  margin: 5px 0 0;
  color: #737b8c;
  font-size: 13px;
  line-height: 1.45;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff2e4;
  color: #bf5c1f;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
}
.studio-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 20px;
}
.hero-copy, .hero-metrics {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 24px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 18px 50px rgba(33, 49, 90, 0.06);
  padding: 24px;
}
.hero-copy h2 {
  margin: 10px 0 12px;
  font-size: 30px;
  line-height: 1.1;
}
.hero-copy p {
  margin: 0;
  color: #5f687b;
  max-width: 58ch;
}
.eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b45e27;
  font-weight: 700;
}
.hero-metrics {
  display: grid;
  gap: 14px;
  align-content: start;
}
.metric-card {
  border-radius: 18px;
  background: #fff8f2;
  padding: 16px;
}
.metric-label {
  display: block;
  color: #7b6658;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.metric-value {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}
.notes-box {
  display: grid;
  gap: 10px;
  color: #5b6272;
}
.note-chip {
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(24, 33, 56, 0.08);
  font-size: 14px;
}
.scene-list {
  display: grid;
  gap: 14px;
}
.scene-item {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 249, 253, 0.96));
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow:
    0 12px 30px rgba(31, 45, 78, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.scene-item::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 109, 31, 0.9), rgba(36, 95, 188, 0.75));
  opacity: 0.18;
}
.scene-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.scene-index {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5f677a;
  font-weight: 800;
}
.danger-btn {
  border: 1px solid rgba(194, 64, 52, 0.14);
  background: #fff1f0;
  color: #c24034;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}
.danger-btn:hover {
  background: #ffe4e1;
  border-color: rgba(194, 64, 52, 0.24);
  box-shadow: 0 10px 20px rgba(194, 64, 52, 0.1);
}
.scene-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 14px;
  align-items: start;
}
.scene-item textarea,
.scene-item select {
  border-radius: 18px;
  border-color: rgba(24, 33, 56, 0.09);
  background: #fbfcff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 1px 0 rgba(255, 255, 255, 0.65);
}
.scene-item textarea {
  min-height: 120px;
  line-height: 1.65;
  padding: 14px 15px;
}
.scene-item select {
  min-height: 56px;
  font-weight: 700;
  color: #20283a;
}
.scene-item .field {
  gap: 10px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.compact-head {
  margin-bottom: 10px;
}
.small-btn {
  padding: 8px 12px;
  font-size: 12px;
}
.task-list { display: grid; gap: 14px; }
.task-item {
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.95));
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.task-item .section-head {
  margin-bottom: 10px;
}
.task-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(33, 49, 90, 0.08);
  border-color: rgba(255, 142, 79, 0.26);
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: #edf1f7;
  overflow: hidden;
  margin: 10px 0 12px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9d5b, #ffcb8d);
}
.task-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: #6a7284;
  font-size: 13px;
  margin: 8px 0;
}
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.status-submitted, .status-processing {
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.92), rgba(255, 243, 234, 0.82));
  color: #5e42d8;
}
.status-completed { background: #ecfbf0; color: #1f8b48; }
.status-failed { background: #fff1f0; color: #c24034; }
.kv { display: grid; gap: 10px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; }
.hero-number { font-size: 40px; font-weight: 800; color: #d26c2d; }
.account-page {
  display: grid;
  gap: 16px;
}
.account-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 28px;
  min-height: 260px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 122, 24, 0.12), transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(107, 77, 255, 0.12), transparent 30%),
    linear-gradient(135deg, rgba(255, 252, 248, 0.96), rgba(247, 241, 255, 0.9));
}
.account-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -80px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 109, 31, 0.12), rgba(255, 109, 31, 0));
  pointer-events: none;
}
.account-hero-copy,
.account-hero-balance {
  position: relative;
  z-index: 1;
}
.account-hero-copy {
  display: grid;
  align-content: start;
  gap: 8px;
}
.account-title {
  margin: 8px 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.03;
  letter-spacing: -0.055em;
  color: #151c2d;
}
.account-desc {
  margin: 0;
  max-width: 56ch;
  color: #5b6272;
  font-size: 14px;
  line-height: 1.65;
}
.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.account-hero-balance {
  justify-self: end;
  width: min(100%, 360px);
  border-radius: 24px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(252, 248, 255, 0.93));
  box-shadow:
    0 18px 38px rgba(31, 45, 78, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  padding: 22px;
}
.account-balance-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8293;
  font-weight: 800;
}
.account-balance-note {
  margin: 8px 0 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}
.account-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.account-tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  padding: 8px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 255, 0.9));
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow:
    0 10px 28px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.account-tabs::-webkit-scrollbar { display: none; }
.account-tab {
  border: 0;
  background: transparent;
  color: #767d8a;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.account-tab:hover {
  color: #5e42d8;
  background: rgba(243, 239, 255, 0.74);
}
.account-tab.active {
  color: #5e42d8;
  background:
    linear-gradient(135deg, rgba(242, 237, 255, 0.96), rgba(255, 242, 230, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 20px rgba(107, 77, 255, 0.1);
}
.account-panels {
  display: grid;
}
.account-panel {
  display: block;
}
.account-sheet {
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(24, 33, 56, 0.08);
  box-shadow:
    0 14px 38px rgba(31, 45, 78, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}
.account-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 18px;
  align-items: start;
}
.account-profile-box .kv-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(24, 33, 56, 0.06);
  align-items: center;
}
.account-profile-box .kv-row:last-child {
  border-bottom: 0;
}
.account-profile-box .kv-row span {
  color: #7a8293;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.account-profile-box .kv-row strong {
  color: #1d2433;
  font-size: 14px;
}
.account-note-card {
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.94));
  padding: 18px;
}
.account-note-card h3 {
  margin: 8px 0 8px;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: -0.04em;
}
.account-note-card p {
  margin: 0;
  color: #5b6272;
  font-size: 14px;
  line-height: 1.65;
}
.account-double-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.account-panel[data-account-panel="billing"] .account-double-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.92fr);
  align-items: start;
}
.account-block {
  display: grid;
  gap: 14px;
}
.account-flow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account-flow-step {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.94));
  display: grid;
  gap: 8px;
}
.account-flow-step span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b4dff, #ff8a2b);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.account-flow-step strong {
  color: #1d2433;
  font-size: 15px;
}
.account-flow-step p {
  margin: 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}
.account-panel[data-account-panel="billing"] .account-block {
  padding: 22px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.94));
  box-shadow:
    0 14px 34px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  position: relative;
  overflow: hidden;
}
.account-panel[data-account-panel="billing"] .account-block::before,
.redeem-card::before,
.redeem-success-card::before,
.topup-plan-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(107, 77, 255, 0.15), rgba(255, 138, 43, 0.22), rgba(107, 77, 255, 0.16));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.75;
  animation: accountBorderShift 6s linear infinite;
  pointer-events: none;
}
.account-panel[data-account-panel="billing"] .account-block:last-child {
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 255, 0.95));
}
.account-form {
  max-width: none;
}
.account-panel[data-account-panel="billing"] #topup-note {
  min-height: 152px;
}
.account-panel[data-account-panel="billing"] .redeem-card {
  padding: 22px;
  position: sticky;
  top: 24px;
}
.topup-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.topup-plan-card {
  min-height: 120px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  padding: 16px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.topup-plan-card:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 77, 255, 0.24);
  box-shadow:
    0 12px 28px rgba(107, 77, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
.topup-plan-card.active {
  border-color: rgba(107, 77, 255, 0.34);
  background:
    radial-gradient(circle at 10% 0%, rgba(107, 77, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #f7f1ff 0%, #ffffff 100%);
  box-shadow:
    0 14px 30px rgba(107, 77, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.topup-plan-name {
  font-size: 12px;
  color: #7a8293;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.topup-plan-price {
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #1d2433;
}
.topup-plan-balance {
  font-size: 13px;
  color: #5b6272;
  font-weight: 700;
}
.topup-summary-line {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(243, 239, 255, 0.96), rgba(255, 244, 235, 0.88));
  border: 1px solid rgba(107, 77, 255, 0.14);
  color: #5e42d8;
  font-size: 12px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}
.redeem-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 255, 0.96));
  padding: 16px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 14px 34px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.redeem-success-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 22px;
  padding: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(107, 77, 255, 0.16), transparent 34%),
    radial-gradient(circle at 100% 100%, rgba(255, 138, 43, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 255, 0.95));
  box-shadow:
    0 16px 36px rgba(31, 45, 78, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.redeem-success-kicker {
  color: #5e42d8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.redeem-success-amount {
  color: #1d2433;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: 900;
}
.redeem-success-balance {
  color: #5b6272;
  font-size: 14px;
}
.redeem-success-balance strong {
  color: #1d2433;
}
.redeem-success-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.redeem-card-text {
  margin: 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}
.redeem-callout,
.account-inline-note {
  border: 1px solid rgba(107, 77, 255, 0.14);
  border-radius: 16px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(243, 239, 255, 0.94), rgba(255, 244, 235, 0.88));
  display: grid;
  gap: 4px;
}
.redeem-callout strong,
.account-inline-note strong {
  color: #5e42d8;
  font-size: 13px;
}
.redeem-callout span,
.account-inline-note span {
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}
.prompt-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}
.drawer-submit-btn {
  min-width: 180px;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6b4dff, #ff7a18);
  box-shadow: 0 16px 32px rgba(107, 77, 255, 0.2);
}
.drawer-submit-btn:hover {
  background: linear-gradient(135deg, #7b5cff, #ff8a2b);
  box-shadow: 0 20px 40px rgba(107, 77, 255, 0.24);
}
.account-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.topup-history-list {
  display: grid;
  gap: 14px;
}
.topup-history-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 20px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 12px;
}
.topup-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.topup-history-head strong {
  color: #1d2433;
  font-size: 16px;
}
.topup-history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.topup-history-meta span {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(243, 239, 255, 0.64);
  color: #5e42d8;
  font-size: 12px;
  font-weight: 700;
}
.topup-history-code {
  display: grid;
  gap: 6px;
}
.topup-history-code span {
  color: #7a8293;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}
.topup-history-note {
  margin: 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}
.account-table-wrap .admin-table {
  min-width: 860px;
}
.upload-field {
  gap: 10px;
}
.upload-dropzone {
  position: relative;
}
.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-dropzone-inner {
  min-height: 112px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 22px;
  background:
    radial-gradient(circle at 10% 0%, rgba(36, 95, 188, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  padding: 18px 18px 16px;
  display: grid;
  gap: 6px;
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}
.upload-dropzone:hover .upload-dropzone-inner,
.upload-dropzone:focus-within .upload-dropzone-inner {
  border-color: rgba(255, 109, 31, 0.26);
  box-shadow:
    0 14px 28px rgba(255, 109, 31, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.upload-dropzone-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1d2433;
}
.upload-dropzone-subtitle {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}
.upload-dropzone-meta {
  color: #6b4dff;
  font-size: 12px;
  font-weight: 700;
}
.upload-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}
.upload-file-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f4f7fb;
  color: #526077;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(24, 33, 56, 0.08);
}
.account-page .admin-table th {
  background:
    linear-gradient(180deg, #fbfdff, #eef4ff);
}
.account-page .admin-table tr:hover td {
  background: #fffaf5;
}
.account-id-badge {
  background: #f2f5fa;
  color: #526077;
  text-transform: none;
  letter-spacing: 0;
}
.userbox {
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(24, 33, 56, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}
.admin-table-wrap {
  overflow: auto;
  border: 1px solid rgba(24, 33, 56, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(248, 251, 255, 0.965));
  box-shadow:
    0 16px 38px rgba(33, 49, 90, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 820px;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-table th {
  background:
    linear-gradient(180deg, #fbfcff, #f2f3ff);
  color: #526077;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1;
  box-shadow: inset 0 -1px 0 rgba(24, 33, 56, 0.08);
}
.admin-table tbody tr:nth-child(even) td {
  background: rgba(250, 251, 255, 0.66);
}
.admin-table tr:hover td {
  background: #fffbf6;
}
.admin-table tr:last-child td {
  border-bottom: 0;
}
.admin-table td code,
.admin-table td .id-mono {
  font-size: 12px;
}
.admin-task-row {
  cursor: pointer;
}
.admin-user-row,
.admin-task-row {
  position: relative;
}
.admin-user-row td:first-child,
.admin-task-row td:first-child {
  border-left: 3px solid transparent;
}
.admin-user-row:hover td:first-child,
.admin-task-row:hover td:first-child {
  border-left-color: #ff8e4f;
}
.table-empty {
  color: #6b7280;
  text-align: center !important;
  padding: 28px 18px !important;
  background: linear-gradient(180deg, rgba(249, 250, 255, 0.96), rgba(255, 255, 255, 0.94));
}
.preview-frame {
  border-radius: 18px;
  overflow: hidden;
  background: #f1f4fa;
  border: 1px solid rgba(24, 33, 56, 0.08);
}
.preview-frame video,
.preview-frame img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #111827;
}
.detail-grid {
  display: grid;
  gap: 20px;
}
.detail-section {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 18px;
  background: #fbfcff;
  padding: 16px;
}
.detail-meta {
  display: grid;
  gap: 10px;
}
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.detail-meta-row span:first-child {
  color: #7a8293;
}
.detail-line-btn {
  width: 100%;
  border: 1px solid rgba(24, 33, 56, 0.1);
  background:
    linear-gradient(180deg, #fff, #fbfcff);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}
.detail-line-btn:hover {
  background: #fff8f2;
  border-color: rgba(255, 142, 79, 0.26);
}
.hint-line {
  margin-top: 4px;
  font-size: 12px;
  color: #7a8293;
}
.credit-positive {
  color: #1f8b48;
}
.credit-negative {
  color: #c24034;
}
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.92), rgba(255, 243, 234, 0.82));
  color: #5e42d8;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid rgba(107, 77, 255, 0.14);
}
.link-btn:hover {
  background: linear-gradient(135deg, rgba(238, 231, 255, 0.96), rgba(255, 236, 222, 0.9));
  box-shadow: 0 10px 20px rgba(107, 77, 255, 0.12);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 24px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: 0 24px 80px rgba(20, 31, 53, 0.25);
  padding: 24px;
}
.bullet-list { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: #5b6272; }
.mobile-nav { display: none; }

/* ── topbar v2 ─────────────────────────────────────────────── */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.crumbs {
  display: none;
  align-items: center;
  gap: 8px;
  color: #5b6272;
  font-size: 13px;
  margin-bottom: 4px;
}
.crumbs .crumb-current { color: #1d2433; font-weight: 600; }
.crumbs .crumb-sep { color: #b8bfcd; }
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 12px;
  background: #ffe7d4;
  color: #ff6d1f;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid rgba(255, 109, 31, 0.16);
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(255, 109, 31, 0.12);
}
.balance-pill:hover {
  background: #ffdcc1;
  box-shadow: 0 12px 24px rgba(255, 109, 31, 0.18);
}
.balance-pill.low { background: linear-gradient(135deg, #fff1f0, #ffd9d4); color: #c24034; border-color: rgba(194, 64, 52, 0.3); }
.balance-pill .balance-num { font-size: 15px; }
.create-btn {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 14px;
  background: linear-gradient(135deg, #6b4dff, #ff7a18);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(107, 77, 255, 0.22);
}
.create-btn:hover {
  background: linear-gradient(135deg, #7b5cff, #ff8a2b);
  box-shadow: 0 14px 28px rgba(107, 77, 255, 0.26);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(24, 33, 56, 0.08);
  position: relative;
}
.lang-chip {
  border: 1px solid rgba(24, 33, 56, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  color: #1d2433;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  box-shadow: 0 8px 18px rgba(31, 45, 78, 0.06);
}
.lang-chip:hover { background: #f3efff; color: #6b4dff; border-color: rgba(107, 77, 255, 0.16); }
.locale-switch-label {
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  color: #7a8293;
  letter-spacing: 0.04em;
}
.locale-switch-label.active { color: #1d2433; }
.locale-switch-divider {
  color: #c9d0dc;
  font-size: 12px;
}
.icon-btn {
  border: 1px solid transparent;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  color: #333947;
  font-size: 26px;
  cursor: pointer;
}
.icon-btn:hover {
  background: #fff2e8;
  color: #bf5c1f;
  border-color: rgba(255, 109, 31, 0.16);
}
.user-chip .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9257, #ffcb99);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-menu-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 54px rgba(31, 45, 78, 0.14);
  z-index: 90;
  display: grid;
  gap: 8px;
}
.user-menu-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 8px 12px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
}
.user-menu-head strong {
  display: block;
  color: #1d2433;
  font-size: 15px;
  line-height: 1.2;
}
.user-menu-head small {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin: 4px 0 8px;
}
.user-menu .status-pill {
  display: inline-flex;
  width: fit-content;
}
.user-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #273041;
  text-align: left;
  padding: 11px 10px;
  border-radius: 12px;
  font: inherit;
  cursor: pointer;
}
.user-menu button:hover {
  background: #f4f7fb;
}

/* ── overview page ─────────────────────────────────────────── */
.overview-greeting {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.overview-greeting h2 { margin: 0 0 4px; font-size: 22px; }
.overview-greeting p { margin: 0; color: #6d7484; font-size: 14px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 109, 31, 0.07), transparent 42%),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px rgba(33, 49, 90, 0.06);
  padding: 18px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(33, 49, 90, 0.1);
}
.stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8293;
  font-weight: 700;
  margin-bottom: 8px;
}
.stat-value { font-size: 28px; font-weight: 800; color: #1d2433; }
.stat-value.warn { color: #c24034; }
.stat-value.good { color: #1f8b48; }

.overview-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.active-task-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
}
.active-task-row:hover { background: #fbfcff; }
.active-task-row .meta { color: #6d7484; font-size: 13px; }
.active-task-row .progress {
  margin: 6px 0 0;
  width: 220px;
}

.quick-create .quick-section { margin-bottom: 14px; }
.quick-create h4 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a8293;
}
.quick-create .quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.quick-chip {
  border: 1px solid rgba(24, 33, 56, 0.12);
  border-radius: 999px;
  padding: 6px 12px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  color: #445066;
}
.quick-chip:hover {
  background: #fff5ec;
  border-color: #ff9257;
  color: #b45e27;
  box-shadow: 0 8px 16px rgba(255, 109, 31, 0.1);
}

.thumb-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}
.thumb-card {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.95));
  border: 1px solid rgba(24, 33, 56, 0.08);
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.thumb-card:hover {
  transform: translateY(-2px);
  border-color: rgba(107, 77, 255, 0.18);
  box-shadow: 0 20px 42px rgba(33, 49, 90, 0.12);
}
.thumb-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f0f3f8;
}
.thumb-card .badge-corner {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(17, 22, 34, 0.62);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
}
.thumb-card img, .thumb-card video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}
.thumb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.thumb-card .thumb-prompt {
  color: #1d2433;
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.thumb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.thumb-meta span {
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244, 246, 252, 0.94), rgba(250, 251, 255, 0.92));
  border: 1px solid rgba(24, 33, 56, 0.06);
  padding: 5px 10px;
  font-size: 12px;
  color: #5f6778;
  font-weight: 600;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 10px;
  min-height: 180px;
  padding: 34px 24px;
  border: 1px dashed rgba(107, 77, 255, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(107, 77, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.92));
  color: #7a8293;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 28px rgba(31, 45, 78, 0.04);
}
.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(243, 239, 255, 0.96), rgba(255, 244, 235, 0.88));
  color: #6b4dff;
  font-size: 18px;
  font-weight: 800;
}
.empty-state h3 { margin: 0; color: #1d2433; font-size: 18px; }
.empty-state p { margin: 0; font-size: 14px; max-width: 34ch; line-height: 1.6; }
.empty-warn .empty-icon {
  background: linear-gradient(135deg, rgba(255, 241, 240, 0.96), rgba(255, 245, 235, 0.9));
  color: #c24034;
}
.empty-soft .empty-icon {
  background: linear-gradient(135deg, rgba(244, 246, 252, 0.96), rgba(249, 250, 255, 0.92));
  color: #7a8293;
}

/* ── status pills (override + extend) ──────────────────────── */
.status-pill { text-transform: none; letter-spacing: 0; }
.status-submitted { background: #f1f3f8; color: #5b6272; }
.status-processing {
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.92), rgba(255, 243, 234, 0.82));
  color: #5e42d8;
}
.status-completed { background: #ecfbf0; color: #1f8b48; }
.status-failed { background: #fff1f0; color: #c24034; }
.status-cancelled { background: #f4f4f4; color: #999; }

/* ── drawer ────────────────────────────────────────────────── */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100vw);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 109, 31, 0.08), transparent 34%),
    #fff;
  z-index: 100;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.18);
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #7a8293;
  line-height: 1;
}
.drawer-tabs {
  display: flex;
  gap: 6px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.06);
}
.drawer-tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 14px 4px;
  margin-right: 18px;
  cursor: pointer;
  color: #5b6272;
  font-weight: 600;
  border-bottom: 2px solid transparent;
}
.drawer-tab:hover {
  color: #b45e27;
  background: rgba(255, 242, 232, 0.68);
}
.drawer-tab.active { color: #b45e27; border-bottom-color: #ff9257; }
.drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.drawer-foot {
  padding: 14px 24px;
  border-top: 1px solid rgba(24, 33, 56, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fbfcff;
}
.drawer-foot .estimate { color: #5b6272; font-size: 13px; }
.drawer-foot .actions { display: flex; gap: 10px; }

.generator-page {
  display: grid;
  gap: 16px;
}
.generator-hero {
  min-height: auto;
  border-radius: 28px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 133, 66, 0.18), transparent 32%),
    radial-gradient(circle at 92% 10%, rgba(107, 77, 255, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255, 250, 245, 0.96) 0%, rgba(245, 240, 255, 0.94) 62%, rgba(255, 255, 255, 0.96) 100%);
  border: 1px solid rgba(24, 33, 56, 0.08);
  box-shadow: 0 12px 32px rgba(31, 45, 78, 0.06);
}
.generator-hero h2 {
  margin: 5px 0 6px;
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: #151c2d;
}
.generator-hero p {
  margin: 0;
  max-width: 760px;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.45;
}
.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.generator-main,
.generator-side {
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(248, 250, 255, 0.95));
  border: 1px solid rgba(24, 33, 56, 0.09);
  box-shadow:
    0 20px 52px rgba(31, 45, 78, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.generator-main { padding: 0; overflow: hidden; }
.generator-mode-row {
  padding: 22px 26px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.07);
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(251, 252, 255, 0.9);
}
.generator-mode-row .field-label { flex: 0 0 auto; }
.generator-main .drawer-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 999px;
  background: #f2f5fa;
}
.generator-main .drawer-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  margin: 0;
  color: #5f677a;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}
.generator-main .drawer-tab.active {
  color: #151c2d;
  background: #fff;
  box-shadow: 0 8px 20px rgba(31, 45, 78, 0.1);
}
.create-body {
  padding: 20px 22px 24px;
  overflow: visible;
}
.create-form {
  display: grid;
  gap: 16px;
}
.generator-section {
  border: 1px solid rgba(24, 33, 56, 0.09);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(248, 250, 255, 0.96));
  padding: 20px;
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.reference-section {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 250, 255, 0.97));
}
.generator-section::before { display: none; }
.generator-section::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -90px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 109, 31, 0.09), rgba(255, 109, 31, 0));
  pointer-events: none;
}
.generator-section > * {
  position: relative;
  z-index: 1;
}
.generator-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.generator-section-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: #151c2d;
}
.generator-section-head p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 12.5px;
  line-height: 1.6;
}
.generator-section-head .summary-line {
  max-width: 420px;
  color: #6b4dff;
  font-weight: 800;
  text-align: right;
  font-size: 13px;
}
.provider-card-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}
.provider-choice {
  min-height: 92px;
  border: 1px solid rgba(24, 33, 56, 0.12);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 5px;
  background:
    radial-gradient(circle at 18% 0%, rgba(107, 77, 255, 0.09), transparent 36%),
    linear-gradient(180deg, rgba(251, 252, 255, 0.98), rgba(247, 244, 255, 0.92));
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.provider-choice:hover {
  transform: translateY(-2px);
  border-color: rgba(107, 77, 255, 0.26);
  box-shadow: 0 14px 30px rgba(107, 77, 255, 0.08);
}
.provider-choice span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #f1ebff;
  color: #6b4dff;
  font-weight: 900;
}
.provider-choice strong { color: #151c2d; font-size: 15px; }
.provider-choice small { color: #7a8293; }
.provider-choice.active {
  border-color: rgba(107, 77, 255, 0.36);
  background:
    radial-gradient(circle at 18% 0%, rgba(107, 77, 255, 0.16), transparent 42%),
    #fff8ef;
  box-shadow: 0 16px 34px rgba(107, 77, 255, 0.1);
}
.provider-choice.active span { background: linear-gradient(135deg, #6b4dff, #ff7a18); color: #fff; }
.generator-selects {
  margin-top: 2px;
  display: grid;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}
.choice-field {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.choice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.choice-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}
.choice-pill {
  min-height: 58px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 255, 0.93));
  color: #354052;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 10px 12px;
  text-align: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 1px 0 rgba(255, 255, 255, 0.72);
}
.choice-pill small {
  color: #7a8293;
  font-size: 11px;
  font-weight: 800;
}
.choice-pill:hover {
  border-color: rgba(107, 77, 255, 0.28);
  background:
    radial-gradient(circle at 20% 0%, rgba(107, 77, 255, 0.1), transparent 38%),
    #fff;
  box-shadow: 0 12px 26px rgba(107, 77, 255, 0.08);
}
.choice-pill.active {
  color: #151c2d;
  border-color: rgba(107, 77, 255, 0.46);
  background:
    radial-gradient(circle at 12% 0%, rgba(107, 77, 255, 0.2), transparent 42%),
    linear-gradient(180deg, #f7f1ff, #fff);
  box-shadow:
    0 14px 30px rgba(107, 77, 255, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}
.choice-pill.active small { color: #6b4dff; }
.parameter-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 5% 0%, rgba(107, 77, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(251, 252, 255, 0.98), rgba(246, 241, 255, 0.96));
  box-shadow:
    0 12px 28px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}
.reference-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.veo-reference-layout {
  display: grid;
  gap: 14px;
  grid-column: 1 / -1;
}
.veo-reference-layout:not(.hidden) {
  display: grid;
}
#veo-frame-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#veo-ingredient-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.image-reference-board {
  grid-template-columns: minmax(0, 1fr);
}
.reference-board .field {
  gap: 10px;
}
.reference-board textarea {
  min-height: 132px;
  border-radius: 18px;
  border-color: rgba(24, 33, 56, 0.09);
  background: #fbfcff;
  line-height: 1.6;
  padding: 14px 15px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 1px 0 rgba(255, 255, 255, 0.65);
}
.image-param-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.image-style-field {
  grid-column: 1 / -1;
}
.grid.four { grid-template-columns: repeat(4, 1fr); }
.grid.five { grid-template-columns: repeat(5, 1fr); }
.prompt-section {
  background:
    linear-gradient(180deg, rgba(255, 250, 245, 0.98), rgba(255, 255, 255, 0.98));
}
#prompt-input,
#image-prompt {
  min-height: 230px;
  border-radius: 20px;
  border: 1px solid rgba(24, 33, 56, 0.12);
  background: #fff;
  font-size: 15px;
  line-height: 1.7;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
#prompt-input:focus,
#image-prompt:focus {
  border-color: rgba(255, 109, 31, 0.42);
  background: #fffdfb;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 0 0 4px rgba(255, 109, 31, 0.08);
}
.prompt-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: #f2f5fa;
  color: #7a8293;
  font-size: 12px;
  font-weight: 800;
}
.prompt-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 6px 11px;
  border-radius: 999px;
}
.prompt-tabs button:hover { background: rgba(255, 255, 255, 0.82); color: #6b4dff; }
.prompt-tabs button.active {
  background: #fff;
  color: #151c2d;
  box-shadow: 0 6px 14px rgba(31, 45, 78, 0.08);
}
.advanced-prompt-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(107, 77, 255, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(107, 77, 255, 0.12), transparent 30%),
    radial-gradient(circle at 100% 100%, rgba(255, 122, 24, 0.08), transparent 30%),
    #fbfcff;
}
.generator-side {
  position: sticky;
  top: 104px;
  padding: 12px;
  display: grid;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.975), rgba(248, 244, 255, 0.94));
  box-shadow:
    0 14px 34px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.preview-frame {
  min-height: 264px;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(107, 77, 255, 0.84), rgba(255, 122, 24, 0.58)),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(180deg, #2f3650, #1d2433);
}
.preview-frame-generator {
  cursor: default;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  box-shadow:
    0 24px 40px rgba(66, 44, 131, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.preview-frame-generator[role="button"] { cursor: pointer; }
.preview-frame-generator[role="button"]:hover {
  transform: translateY(-2px);
  box-shadow:
    0 30px 46px rgba(66, 44, 131, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.preview-frame-generator:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 3px;
}
.preview-media-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.preview-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.26), transparent 26%),
    linear-gradient(180deg, rgba(18, 24, 40, 0.12), rgba(18, 24, 40, 0.2));
  background-size: cover;
  background-position: center;
  opacity: 0.7;
  transform: scale(1.02);
}
.preview-media-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
}
.preview-media-layer img,
.preview-media-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.preview-glow {
  position: absolute;
  inset: 24px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0));
  filter: blur(24px);
}
.preview-status-orb {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 3;
  pointer-events: none;
}
.preview-status-rings {
  position: absolute;
  width: 132px;
  height: 132px;
}
.preview-status-rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  animation: preview-pulse 2.4s ease-out infinite;
}
.preview-status-rings span:nth-child(2) {
  inset: 10px;
  animation-delay: .35s;
}
.preview-status-rings span:nth-child(3) {
  inset: 22px;
  animation-delay: .7s;
}
.preview-play {
  position: relative;
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 28px;
  font-size: 30px;
  color: rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow:
    0 20px 36px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  text-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  z-index: 4;
}
.preview-status-pill {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(16, 22, 34, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}
.preview-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(16, 22, 34, 0.4);
  backdrop-filter: blur(10px);
  color: #fff;
  z-index: 4;
}
.preview-caption span { color: rgba(255, 255, 255, 0.72); font-size: 12px; }
.preview-meta-card {
  display: grid;
  gap: 10px;
  padding: 14px 14px 4px;
}
.preview-meta-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(24, 33, 56, 0.07);
}
.preview-meta-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.preview-meta-label {
  color: #7a8293;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.preview-meta-value {
  text-align: right;
  color: #1d2433;
  font-size: 13px;
  line-height: 1.45;
  max-width: 22ch;
}
.preview-progress-card {
  margin-top: 4px;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 56, 0.07);
  background:
    linear-gradient(180deg, rgba(248, 243, 255, 0.88), rgba(255, 248, 241, 0.82));
}
.preview-progress-head,
.preview-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-progress-label {
  color: #7a8293;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.preview-progress-value {
  color: #6b4dff;
  font-size: 14px;
}
.preview-progress-track {
  position: relative;
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(107, 77, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(31, 45, 78, 0.08);
}
.preview-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #6b4dff 0%, #a66bff 34%, #ff8d4d 72%, #ffc37d 100%);
  box-shadow:
    0 8px 18px rgba(107, 77, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: width .45s ease;
}
.preview-progress-meta {
  color: #667085;
  font-size: 12px;
  line-height: 1.45;
}
.preview-progress-meta span:last-child {
  text-align: right;
  color: #8b6f48;
  font-weight: 700;
}
.preview-cancel-btn {
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
}
.generation-cost-card {
  border: 1px solid rgba(255, 109, 31, 0.16);
  border-radius: 20px;
  padding: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 109, 31, 0.12), transparent 38%),
    #fffaf5;
  display: grid;
  gap: 10px;
}
.generation-cost-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #6b7280;
  font-size: 13px;
}
.generation-cost-card strong { color: #151c2d; }
.generation-cost-card p { margin: 0; color: #ff6d1f; font-weight: 800; }
.generator-submit {
  width: 100%;
  font-size: 16px;
  padding: 15px 18px;
  box-shadow: 0 16px 32px rgba(255, 109, 31, 0.2);
}
.generator-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(255, 109, 31, 0.26);
}
.generator-submit:active {
  transform: translateY(1px) scale(0.985);
  box-shadow: 0 8px 18px rgba(255, 109, 31, 0.18);
}
.generator-cancel { width: 100%; }
.preview-prompt { padding: 4px 2px 2px; }
.preview-prompt span { color: #6b4dff; font-size: 12px; font-weight: 900; }
.preview-prompt p {
  margin: 6px 0 0;
  color: #667085;
  font-size: 13px;
  line-height: 1.55;
}
.preview-state-idle .preview-status-pill {
  background: rgba(16, 22, 34, 0.26);
}
.preview-state-processing .preview-status-pill {
  background: linear-gradient(135deg, rgba(92, 59, 255, 0.4), rgba(255, 134, 60, 0.28));
}
.preview-state-processing .preview-play {
  animation: preview-spin 1s linear infinite;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid rgba(166, 175, 196, 0.26);
  border-top-color: #a0a7b8;
  border-right-color: rgba(160, 167, 184, 0.5);
  background: transparent;
  box-shadow: none;
  color: transparent;
  text-shadow: none;
}
.preview-state-processing .preview-status-rings { display: none; }
.preview-state-processing .preview-glow { display: none; }
.preview-state-processing .preview-backdrop {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 252, 0.96));
  opacity: 1;
  transform: none;
}
.preview-state-processing .preview-caption {
  left: 0;
  right: 0;
  bottom: auto;
  top: 50%;
  transform: translateY(26px);
  text-align: center;
  background: transparent;
  backdrop-filter: none;
  color: #98a2b3;
  padding: 0;
}
.preview-state-processing .preview-caption strong {
  font-size: 18px;
  font-weight: 500;
  color: #98a2b3;
}
.preview-state-processing .preview-caption span {
  color: #6b7280;
  font-size: 28px;
  font-weight: 800;
  margin-top: 10px;
}
.preview-state-processing .preview-status-pill {
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: transparent;
  border: 0;
  backdrop-filter: none;
  color: #9aa3b2;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 0;
}
.preview-state-processing .preview-meta-card {
  padding-top: 10px;
}
.generator-side-processing .preview-prompt,
.generator-side-processing .preview-meta-row {
  display: none;
}
.generator-side-processing .preview-meta-card {
  padding: 10px 10px 2px;
}
.preview-state-processing .preview-meta-row {
  border-bottom-color: rgba(24, 33, 56, 0.05);
}
.preview-state-processing .preview-progress-card {
  margin-top: 0;
  padding: 6px 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.preview-state-processing .preview-progress-track {
  display: none;
}
.preview-state-processing .preview-progress-bar {
  display: none;
}
.preview-state-processing .preview-progress-head {
  display: none;
}
.preview-state-processing .preview-progress-meta {
  display: grid;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.preview-state-processing .preview-progress-meta span:first-child {
  color: #a0a7b8;
  font-size: 13px;
}
.preview-state-processing .preview-progress-meta span:last-child {
  color: #c0a07a;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.generator-side-processing .preview-cancel-btn {
  margin-top: 10px;
}
.preview-state-completed .preview-backdrop {
  opacity: 0.55;
  transform: scale(1.08);
}
.preview-state-completed .preview-status-rings span {
  border-color: rgba(255, 255, 255, 0.12);
}
.preview-state-completed .preview-play {
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.26), rgba(18, 28, 44, 0.14));
}
.preview-state-failed {
  background:
    linear-gradient(150deg, rgba(166, 46, 57, 0.88), rgba(76, 18, 32, 0.84)),
    linear-gradient(180deg, #2f3650, #1d2433);
}
.preview-state-failed .preview-status-pill,
.preview-state-cancelled .preview-status-pill {
  background: rgba(16, 22, 34, 0.42);
}
.preview-state-cancelled {
  background:
    linear-gradient(150deg, rgba(93, 101, 126, 0.88), rgba(47, 54, 80, 0.82)),
    linear-gradient(180deg, #2f3650, #1d2433);
}

@keyframes preview-pulse {
  0% { transform: scale(0.92); opacity: 0.18; }
  55% { transform: scale(1.05); opacity: 0.34; }
  100% { transform: scale(1.14); opacity: 0; }
}

@keyframes preview-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 20px 36px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26); }
  50% { transform: scale(1.05); box-shadow: 0 28px 44px rgba(15, 23, 42, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.32); }
}

@keyframes preview-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── provider health grid ──────────────────────────────────── */
.provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.provider-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.provider-card .head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.provider-card .name { font-weight: 700; font-size: 15px; color: #1d2433; }
.provider-card .health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.provider-card .health-pill::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.health-good { background: #ecfbf0; color: #1f8b48; }
.health-good::before { background: #1f8b48; }
.health-warn { background: #fff7e6; color: #b8730e; }
.health-warn::before { background: #f0a020; }
.health-bad { background: #fff1f0; color: #c24034; }
.health-bad::before { background: #c24034; }
.health-idle { background: #f1f3f8; color: #7a8293; }
.health-idle::before { background: #b8bfcd; }
.provider-card .stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}
.provider-card .stats div { color: #5b6272; }
.provider-card .stats strong { color: #1d2433; font-size: 13px; }
.provider-card .errors {
  border-top: 1px dashed rgba(24, 33, 56, 0.1);
  padding-top: 8px;
  font-size: 12px;
  color: #5b6272;
}
.provider-card .errors-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.provider-card .errors-row code {
  font-size: 11px;
  color: #c24034;
  background: #fff1f0;
  padding: 1px 6px;
  border-radius: 6px;
}

/* provider strip on overview bottom */
.provider-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}
.provider-strip .strip-label {
  font-size: 12px;
  color: #7a8293;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: center;
}
.provider-strip .strip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #1d2433;
  cursor: pointer;
}
.provider-strip .strip-item::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.provider-strip .strip-item.h-good::before { background: #1f8b48; }
.provider-strip .strip-item.h-warn::before { background: #f0a020; }
.provider-strip .strip-item.h-bad::before { background: #c24034; }
.provider-strip .strip-item.h-idle::before { background: #b8bfcd; }

/* unstable banner inside detail drawer */
.unstable-banner {
  background: linear-gradient(135deg, #fff7e6, #ffe8c4);
  color: #8a5a0c;
  border: 1px solid rgba(240, 160, 32, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 24px 14px;
}

/* ── modal (confirm / prompt / form) ───────────────────────── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-mask[hidden] { display: none; }
.modal-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
}
.modal-title { margin: 0 0 6px; font-size: 18px; color: #1d2433; }
.modal-desc { margin: 0 0 14px; color: #5b6272; }
.modal-desc.hidden, .modal-desc:empty { display: none; }
.modal-body { display: grid; gap: 12px; }
.modal-body .field { display: grid; gap: 6px; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-foot .danger {
  background: linear-gradient(135deg, #d04835, #e2664a) !important;
}

/* ── public top nav (brand homepage) ───────────────────────── */
.public-nav {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(24, 33, 56, 0.06);
  padding: 14px 28px;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 0;
}
body.unauth .public-nav { display: flex; }
.public-nav .pn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.public-nav .pn-brand .pn-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 246, 238, 0.92), rgba(255, 246, 238, 0) 24%),
    linear-gradient(145deg, #ffab69 0%, #ff8748 54%, #ffc986 100%);
  box-shadow:
    0 10px 22px rgba(255, 124, 58, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}
.public-nav .pn-brand .pn-mark::before,
.public-nav .pn-brand .pn-mark::after {
  content: "";
  position: absolute;
}
.public-nav .pn-brand .pn-mark::before {
  left: 5px;
  right: 5px;
  bottom: 5px;
  height: 16px;
  border-radius: 6px 8px 8px 8px;
  border: 1px solid rgba(255, 245, 236, 0.52);
  background:
    linear-gradient(180deg, rgba(255, 244, 234, 0.96), rgba(255, 226, 198, 0.82)),
    rgba(122, 47, 13, 0.12);
}
.public-nav .pn-brand .pn-mark::after {
  left: 7px;
  top: 6px;
  width: 11px;
  height: 7px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(255, 235, 214, 0.94);
  box-shadow:
    0 8px 0 0 rgba(255, 250, 244, 0.92),
    8px 8px 0 0 rgba(255, 250, 244, 0.92),
    14px 10px 0 -6px rgba(255, 137, 72, 0.96);
}
.public-nav .pn-brand .pn-name { font-weight: 800; font-size: 16px; color: #1d2433; }
.public-nav .pn-links {
  display: flex;
  gap: 22px;
  align-items: center;
}
.public-nav .pn-link {
  background: transparent;
  border: 0;
  font-size: 14px;
  color: #5b6272;
  cursor: pointer;
  font-weight: 600;
}
.public-nav .pn-link:hover { color: #1d2433; }
.public-nav .pn-actions {
  display: flex;
  gap: 10px;
}
.public-nav .pn-actions button {
  border: 0;
  border-radius: 10px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.public-nav .pn-login {
  background: transparent;
  color: #5b6272;
}
.public-nav .pn-login:hover { color: #1d2433; }
.public-nav .pn-signup {
  background: linear-gradient(135deg, #ff8e4f, #ffb56e);
  color: #fff;
}

@media (max-width: 700px) {
  .public-nav { padding: 10px 16px; }
  .public-nav .pn-links { display: none; }
}

/* footer */
.public-footer {
  display: none;
  padding: 30px 0 20px;
  border-top: 1px solid rgba(24, 33, 56, 0.06);
  margin-top: 24px;
  color: #7a8293;
  font-size: 13px;
  text-align: center;
}
body.unauth .public-footer { display: block; }
.public-footer .footer-brand {
  color: #1d2433;
  font-weight: 800;
  font-size: 16px;
  margin-bottom: 10px;
}
.public-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.public-footer .footer-links a {
  color: #5b6272;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  margin: 0;
}
.public-footer .footer-links a:hover { color: #1d2433; }
.public-footer a { color: #5b6272; text-decoration: none; margin: 0 8px; }
.public-footer a:hover { color: #1d2433; }

.admin-subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 8px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(238, 244, 255, 0.72));
  box-shadow: 0 12px 28px rgba(33, 49, 90, 0.05);
}
.admin-subnav-btn {
  border: 1px solid rgba(24, 33, 56, 0.1);
  background: #fff;
  color: #5b6272;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-subnav-btn:hover {
  background: #fff5ec;
  color: #b45e27;
  border-color: rgba(255, 109, 31, 0.2);
  box-shadow: 0 8px 18px rgba(255, 109, 31, 0.08);
}
.admin-subnav-btn.active {
  background: linear-gradient(135deg, #f1ebff, #fff5ec);
  color: #5e42d8;
  border-color: rgba(107, 77, 255, 0.24);
  box-shadow: 0 8px 18px rgba(107, 77, 255, 0.08);
}
.admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.admin-nav-badge {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.94), rgba(216, 74, 0, 0.96));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 18px rgba(216, 74, 0, 0.18);
}
.admin-inline-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 122, 24, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 122, 24, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 248, 242, 0.98), rgba(255, 255, 255, 0.94));
  box-shadow: 0 12px 28px rgba(255, 122, 24, 0.08);
}
.admin-inline-alert strong {
  display: block;
  margin-bottom: 4px;
  color: #b45e27;
  font-size: 14px;
}
.admin-inline-alert span {
  display: block;
  color: #6b7283;
  font-size: 13px;
}
.admin-head-select {
  min-width: 164px;
  min-height: 42px;
}
.admin-filter-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.08), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 243, 255, 0.84));
  box-shadow:
    0 14px 32px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.admin-filter-bar-two {
  grid-template-columns: minmax(0, 1fr) auto;
}
.admin-filter-bar-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-filter-bar-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.admin-filter-bar .field {
  min-width: 0;
}
.admin-filter-bar .field input,
.admin-filter-bar .field select,
.admin-head-select {
  min-height: 50px;
  border-radius: 18px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 255, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 4px 12px rgba(31, 45, 78, 0.04);
}
.admin-filter-bar .field select,
.admin-head-select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #1d2433 50%),
    linear-gradient(135deg, #1d2433 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 255, 0.94));
  background-position:
    calc(100% - 24px) calc(50% - 3px),
    calc(100% - 17px) calc(50% - 3px),
    0 0;
  background-size:
    8px 8px,
    8px 8px,
    100% 100%;
  background-repeat: no-repeat;
  padding-right: 50px;
}
.admin-filter-actions {
  align-content: end;
}
.admin-filter-meta {
  margin-bottom: 16px;
}
.admin-code-form {
  margin-bottom: 14px;
  max-width: none;
}
.admin-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.admin-code-actions .secondary-btn {
  border-radius: 999px;
  font-weight: 800;
}
.code-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.code-stat-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 255, 0.94));
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 6px;
}
.code-stat-card span {
  color: #7a8293;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.code-stat-card strong {
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}
.code-row-recent td {
  background:
    linear-gradient(135deg, rgba(243, 239, 255, 0.58), rgba(255, 244, 235, 0.52)) !important;
}
.code-row-recent td:first-child {
  border-left: 3px solid #6b4dff;
}
.recent-code-pill {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b4dff, #ff8a2b);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

@keyframes accountBorderShift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* ── auth state ────────────────────────────────────────────── */
body.unauth .app-header { display: none; }
body.unauth .topbar,
body.unauth .topbar-actions,
body.unauth .crumbs,
body.unauth #page-title,
body.unauth #page-subtitle { display: none; }
body.unauth {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(242,245,251,0.92)),
    radial-gradient(circle at 16% 8%, rgba(255, 146, 87, 0.22), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(107, 77, 255, 0.14), transparent 30%),
    linear-gradient(180deg, #f7f1ea 0%, #f2efff 100%);
}
body.unauth .main { width: 100%; padding: 0 24px 24px; }

/* ── public landing ────────────────────────────────────────── */
.landing {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 38px;
  padding-bottom: 36px;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.8fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 56px 0 24px;
}
.hero-text .eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b4dff;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 12px;
}
.hero-title {
  font-size: 54px;
  line-height: 1.05;
  margin: 0 0 18px;
  color: #1d2433;
  font-weight: 800;
  max-width: 780px;
}
.hero-sub {
  color: #5b6272;
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 26px;
  max-width: 62ch;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-console {
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(33, 49, 90, 0.15);
  overflow: hidden;
}
.console-top {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  background: rgba(251, 252, 255, 0.9);
}
.console-top span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c8d0dd;
}
.console-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px;
}
.console-panel {
  min-height: 104px;
  border-radius: 12px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  background: #fff;
  padding: 14px;
}
.console-panel.wide { grid-column: span 2; }
.console-label {
  font-size: 11px;
  color: #7a8293;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.console-title {
  margin-top: 10px;
  font-weight: 800;
  color: #1d2433;
}
.console-number {
  margin-top: 12px;
  font-size: 28px;
  font-weight: 800;
  color: #6b4dff;
}
.console-progress {
  height: 8px;
  border-radius: 99px;
  background: #edf1f7;
  margin-top: 16px;
  overflow: hidden;
}
.console-progress span {
  display: block;
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, #6b4dff, #ff8e4f);
}
.console-panel.media {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
}
.media-tile {
  aspect-ratio: 1;
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(36,95,188,0.1), rgba(255,142,79,0.22)),
    linear-gradient(160deg, #dbe5f5, #fff1e6);
}
.media-lines { display: grid; gap: 8px; }
.media-lines span {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: #e9edf5;
}
.media-lines span:last-child { width: 68%; }
.console-panel.prompt p {
  margin: 10px 0 0;
  color: #4f5a70;
  font-size: 13px;
  line-height: 1.55;
}

.public-section-head {
  display: grid;
  gap: 8px;
  max-width: 760px;
}
.public-section-head span {
  color: #6b4dff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.public-section-head h3 {
  margin: 0;
  color: #1d2433;
  font-size: 28px;
  line-height: 1.2;
}
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-card {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  padding: 22px;
  display: grid;
  gap: 6px;
  box-shadow: 0 14px 36px rgba(33, 49, 90, 0.06);
}
.feature-card .feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.92), rgba(255, 243, 234, 0.82));
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #6b4dff;
  margin-bottom: 6px;
}
.feature-card h3 { margin: 0; font-size: 16px; color: #1d2433; }
.feature-card p { margin: 0; color: #5b6272; font-size: 13.5px; line-height: 1.55; }
.legal-block {
  margin-top: 28px;
}
.legal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.legal-card {
  align-items: flex-start;
}
.auth-agree {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  justify-content: start;
  justify-items: start;
  width: 100%;
  font-size: 13px;
  color: #5b6272;
  line-height: 1.5;
}
.auth-agree input {
  margin: 3px 0 0 0;
  width: 18px;
  height: 18px;
  justify-self: start;
}
.auth-agree span {
  min-width: 0;
  display: block;
  text-align: left;
}
.auth-agree a {
  color: #5e42d8;
  text-decoration: none;
}
.auth-agree a:hover {
  text-decoration: underline;
}

/* pricing block (shared by public + authed) */
.pricing-block { display: grid; gap: 20px; }
.pricing-block .pricing-head {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 24px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 109, 31, 0.12), transparent 34%),
    radial-gradient(circle at 92% 0%, rgba(107, 77, 255, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(245, 240, 255, 0.88));
  box-shadow: 0 18px 42px rgba(33, 49, 90, 0.07);
}
.pricing-block .pricing-head h2 { margin: 0 0 4px; font-size: 24px; }
.pricing-block .pricing-head p { margin: 0; color: #5b6272; font-size: 14px; }
.pricing-lite .pricing-tiers {
  grid-template-columns: repeat(3, 1fr);
}
.pricing-lite .pricing-tier ul,
.pricing-lite .billing-notes,
.pricing-lite .faq-block {
  display: none;
}
.pricing-tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.pricing-tier {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(24, 33, 56, 0.11);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.94));
  padding: 18px;
  display: grid;
  gap: 10px;
  box-shadow:
    0 12px 28px rgba(31, 45, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.pricing-tier::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, rgba(107, 77, 255, 0.74), rgba(255, 122, 24, 0.5));
  opacity: 0.42;
}
.pricing-tier:hover {
  transform: translateY(-2px);
  border-color: rgba(107, 77, 255, 0.22);
  box-shadow:
    0 18px 38px rgba(107, 77, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.pricing-tier.featured {
  border-color: rgba(107, 77, 255, 0.34);
  box-shadow: 0 18px 40px rgba(107, 77, 255, 0.14);
}
.pricing-tier .tier-name { font-weight: 800; color: #1d2433; font-size: 16px; }
.pricing-tier .tier-price { font-size: 30px; font-weight: 800; color: #6b4dff; line-height: 1; }
.pricing-tier .tier-price small { font-size: 13px; color: #7a8293; font-weight: 600; }
.pricing-tier .tier-credits { font-size: 13px; color: #5b6272; }
.pricing-tier ul { margin: 8px 0 0; padding: 0 0 0 18px; color: #5b6272; font-size: 13px; line-height: 1.7; }
.pricing-tier .tier-cta {
  border: 1px solid rgba(107, 77, 255, 0.14);
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.92), rgba(255, 243, 234, 0.82));
  color: #5e42d8;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
}
.pricing-tier .tier-cta:hover {
  background: linear-gradient(135deg, rgba(238, 231, 255, 0.96), rgba(255, 236, 222, 0.9));
  box-shadow: 0 10px 20px rgba(107, 77, 255, 0.12);
}
.pricing-tier.featured .tier-cta {
  background: linear-gradient(135deg, #6b4dff, #ff7a18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.pricing-tier.featured .tier-cta:hover { background: linear-gradient(135deg, #7b5cff, #ff8a2b); }
.pricing-rate-card {
  border-color: rgba(107, 77, 255, 0.14);
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 246, 255, 0.94));
  box-shadow:
    0 16px 38px rgba(31, 45, 78, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.pricing-rate-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}
.billing-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.billing-note {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(249, 246, 255, 0.84));
  padding: 16px;
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}
.billing-note strong {
  display: block;
  color: #1d2433;
  font-size: 14px;
  margin-bottom: 6px;
}
.billing-note p {
  margin: 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.55;
}
.faq-block {
  display: grid;
  gap: 14px;
}
.faq-list {
  display: grid;
  gap: 10px;
}
.faq-item {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 251, 255, 0.92));
  padding: 14px 16px;
  box-shadow:
    0 10px 24px rgba(31, 45, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.faq-item summary {
  cursor: pointer;
  color: #1d2433;
  font-weight: 800;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  color: #7a8293;
}
.faq-item[open] summary::after { content: "-"; }
.faq-item p {
  margin: 10px 0 0;
  color: #5b6272;
  font-size: 13px;
  line-height: 1.6;
}

.rate-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.rate-table th, .rate-table td {
  border-bottom: 1px solid rgba(24, 33, 56, 0.06);
  padding: 10px 12px;
  text-align: left;
}
.rate-table th {
  color: #7a8293;
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: #f8fbff;
}
.rate-table td strong { color: #6b4dff; }

/* api docs block */
.docs-block { display: grid; gap: 18px; }
.docs-block .docs-head h2 { margin: 0 0 4px; font-size: 24px; }
.docs-block .docs-head p { margin: 0; color: #5b6272; font-size: 14px; }
.docs-page {
  gap: 0;
  background: #fff;
  border: 1px solid rgba(24, 33, 56, 0.06);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(31, 45, 78, 0.06);
}
.docs-topbar {
  min-height: 68px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.96);
}
.docs-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1d2433;
}
.docs-logo-dot {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff9257, #6b4dff);
  box-shadow: 0 8px 22px rgba(107, 77, 255, 0.2);
}
.docs-search {
  border: 1px solid rgba(24, 33, 56, 0.1);
  background: #f8fafc;
  color: #7a8293;
  border-radius: 10px;
  padding: 9px 14px;
  min-width: 240px;
  text-align: left;
  cursor: default;
}
.docs-lite-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.docs-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.doc-model-browser {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.docs-shell {
  grid-template-columns: 280px minmax(0, 1fr) 210px;
  gap: 0;
  align-items: stretch;
}
.doc-model-sidebar {
  display: grid;
  gap: 10px;
  position: sticky;
  top: 24px;
}
.docs-left-nav {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow: auto;
  border-right: 1px solid rgba(24, 33, 56, 0.08);
  padding: 22px 16px;
  background: #fff;
}
.doc-model-sidebar .section-title {
  font-size: 16px;
}
.docs-nav-group {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}
.docs-nav-group-title {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  color: #1d2433;
  font-weight: 800;
  cursor: default;
}
.docs-nav-link {
  color: #5b6272;
  text-decoration: none;
  padding: 8px 10px 8px 18px;
  border-radius: 9px;
  font-size: 13px;
}
.docs-nav-link:hover,
.docs-nav-link.active {
  color: #6b4dff;
  background: #f3efff;
}
.doc-model-tabs {
  display: grid;
  gap: 8px;
}
.doc-folder {
  border: 0;
  border-radius: 10px;
  background: transparent;
  overflow: hidden;
}
.doc-folder > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 10px;
  font-weight: 700;
  color: #1d2433;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-folder > summary::-webkit-details-marker { display: none; }
.doc-folder-icon {
  color: #7a8293;
  transition: transform .15s ease;
  display: inline-block;
}
.doc-folder[open] .doc-folder-icon { transform: rotate(90deg); }
.doc-folder-list {
  display: grid;
  gap: 2px;
  padding: 0 0 8px 18px;
}
.doc-model-tab {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 2px;
  color: #445066;
}
.doc-model-tab small {
  color: #7a8293;
  font-size: 12px;
}
.doc-model-tab.active {
  background: #fff5ec;
  color: #b45e27;
  box-shadow: inset 3px 0 0 #ff9257;
}
.doc-model-panel {
  display: grid;
  gap: 20px;
}
.docs-content {
  padding: 42px 56px 72px;
  min-width: 0;
}
.docs-article-card,
.docs-model-section {
  max-width: 860px;
  margin: 0 auto 42px;
}
.docs-article-card {
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  padding-bottom: 38px;
}
.docs-article-card h2 {
  margin: 0 0 14px;
  color: #151c2d;
  font-size: clamp(38px, 5vw, 56px);
  letter-spacing: -0.055em;
  line-height: 0.98;
}
.docs-article-card h3,
.docs-model-section h3 {
  margin: 0 0 10px;
  color: #151c2d;
  font-size: 30px;
  letter-spacing: -0.035em;
}
.docs-article-card p,
.docs-model-section > p {
  color: #5b6272;
  line-height: 1.7;
}
.docs-kicker {
  color: #6b4dff;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.docs-lead {
  font-size: 17px;
  max-width: 760px;
}
.docs-quick-grid {
  margin-top: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.docs-model-section .doc-model-panel {
  margin-top: 18px;
}
.docs-model-section .doc-model-panel > .card,
.docs-article-card .card {
  border-radius: 16px;
  box-shadow: none;
  border-color: rgba(24, 33, 56, 0.08);
}
.docs-model-section .doc-model-panel > .card {
  padding: 22px;
  background: #fff;
}
.docs-on-page {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: calc(100vh - 90px);
  overflow: auto;
  border-left: 1px solid rgba(24, 33, 56, 0.08);
  padding: 34px 22px;
  background: #fff;
}
.docs-on-page p {
  margin: 0 0 10px;
  color: #1d2433;
  font-weight: 800;
  font-size: 13px;
}
.docs-on-page a {
  display: block;
  color: #6b7280;
  text-decoration: none;
  font-size: 13px;
  padding: 7px 0;
}
.docs-on-page a:hover {
  color: #6b4dff;
}
.doc-model-path {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f3efff;
  color: #6b4dff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.table-scroll {
  overflow: auto;
  margin-top: 12px;
}
.docs-param-table {
  min-width: 620px;
}
.docs-status-table {
  min-width: 520px;
}
.rate-table code {
  color: #6b4dff;
  background: #f3efff;
  border-radius: 6px;
  padding: 2px 6px;
}
.endpoint {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 14px;
  background: #fbfcff;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}
.endpoint .ep-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.endpoint .ep-method {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
}
.ep-method.get { background: #ecfbf0; color: #1f8b48; }
.ep-method.post { background: #f3efff; color: #6b4dff; }
.endpoint .ep-path {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
  color: #1d2433;
}
.endpoint .ep-desc { color: #5b6272; font-size: 13px; }
.endpoint .ep-auth { font-size: 11px; color: #7a8293; padding: 2px 8px; background: #f4f6fb; border-radius: 6px; }
.endpoint .ep-auth.required { background: #fff5ec; color: #b45e27; }

.code-block {
  background: #1d2433;
  color: #e6e9ef;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 12px 0 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}
.code-block .comment { color: #889098; }
.code-block .key { color: #ffb56e; }

@media (max-width: 980px) {
  .account-hero,
  .account-profile-grid,
  .account-double-grid {
    grid-template-columns: 1fr;
  }
  .account-tabs {
    width: 100%;
  }
  .account-panel[data-account-panel="billing"] .redeem-card {
    position: static;
  }
  .topup-plan-grid {
    grid-template-columns: 1fr;
  }
  .account-hero-balance {
    justify-self: stretch;
    width: auto;
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 32px;
  }
  .hero-title { font-size: 38px; }
  .hero-console { max-width: 620px; }
  .features { grid-template-columns: 1fr; }
  .pricing-lite .pricing-tiers { grid-template-columns: 1fr; }
  .pricing-tiers { grid-template-columns: repeat(2, 1fr); }
  .billing-notes { grid-template-columns: 1fr; }
  .docs-two { grid-template-columns: 1fr; }
  .docs-lite-grid { grid-template-columns: 1fr; }
  .legal-grid { grid-template-columns: 1fr; }
  .doc-model-browser { grid-template-columns: 1fr; }
  .doc-model-sidebar { position: static; }
  .docs-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-left-nav,
  .docs-on-page {
    position: static;
    max-height: none;
    border: 0;
  }
  .docs-content {
    padding: 28px 24px 40px;
  }
  .create-form { grid-template-columns: 1fr; }
  .form-section-hero,
  .form-section-config { grid-column: auto; grid-row: auto; }
  #prompt-input,
  #image-prompt { min-height: 280px; }
}
@media (max-width: 560px) {
  body.unauth .main { padding: 0 16px 24px; }
  .account-page { gap: 16px; }
  .account-hero { padding: 20px; border-radius: 24px; }
  .account-sheet { padding: 18px; }
  .account-title { font-size: 30px; }
  .account-hero-actions {
    flex-direction: column;
  }
  .account-hero-actions .primary-btn,
  .account-hero-actions .secondary-btn {
    width: 100%;
  }
  .account-flow-steps {
    grid-template-columns: 1fr;
  }
  .topup-history-head {
    flex-direction: column;
  }
  .account-tabs {
    gap: 8px;
    padding: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-padding-inline: 12px;
  }
  .account-tab {
    flex: 0 0 auto;
    font-size: 14px;
    padding: 10px 13px;
  }
  .topup-plan-price { font-size: 24px; }
  .pricing-tiers { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
  .hero-sub { font-size: 15px; }
  .public-section-head h3 { font-size: 22px; }
  .console-grid { grid-template-columns: 1fr; }
  .console-panel.wide { grid-column: span 1; }
  .docs-topbar,
  .docs-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .docs-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .docs-search {
    min-width: 0;
    width: 100%;
  }
  .table-scroll {
    margin-inline: -4px;
    padding-bottom: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .docs-status-table,
  .docs-param-table {
    min-width: 0;
  }
  .docs-content .rate-table {
    display: block;
    width: 100%;
  }
  .docs-content .rate-table tbody,
  .docs-content .rate-table tr {
    display: block;
  }
  .docs-content .rate-table thead {
    display: none;
  }
  .docs-content .rate-table tr {
    border: 1px solid rgba(24, 33, 56, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    margin-bottom: 12px;
    overflow: hidden;
  }
  .docs-content .rate-table td {
    display: grid;
    grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    width: 100%;
    padding: 10px 12px;
    white-space: normal;
  }
  .docs-content .rate-table td::before {
    content: attr(data-label);
    color: #7a8293;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .docs-content .rate-table td:empty::after {
    content: "-";
    color: #7a8293;
  }
}

/* ── task list/grid v3 ─────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 255, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 24px rgba(31, 45, 78, 0.05);
}
.view-toggle .view-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #5b6272;
}
.view-toggle .view-btn:hover {
  background: rgba(243, 239, 255, 0.92);
  color: #6b4dff;
}
.view-toggle .view-btn.active {
  background: linear-gradient(135deg, rgba(242, 237, 255, 0.96), rgba(255, 242, 230, 0.9));
  color: #5e42d8;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 18px rgba(107, 77, 255, 0.08);
}

.task-list { display: grid; gap: 16px; }
.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.task-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  align-items: stretch;
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 24px;
  padding: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(107, 77, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.95));
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow:
    0 12px 28px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.task-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(33, 49, 90, 0.12);
  border-color: rgba(107, 77, 255, 0.22);
}
.task-row-completed-fresh {
  border-color: rgba(31, 139, 72, 0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 139, 72, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 253, 249, 0.96));
  box-shadow:
    0 16px 34px rgba(31, 139, 72, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.task-row-thumb {
  width: 112px;
  height: 112px;
  border-radius: 18px;
  overflow: hidden;
  background: #f0f3f8;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.task-row-thumb img,
.task-row-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-fallback {
  font-size: 28px;
  color: #b8bfcd;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #f4f6fb;
}
.thumb-fallback.processing { color: #6b4dff; background: #f3efff; }
.thumb-fallback.completed { color: #1f8b48; background: #ecfbf0; }
.thumb-fallback.failed { color: #c24034; background: #fff1f0; }

.task-row-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.task-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.task-row-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.task-id-badge,
.task-family-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}
.task-id-badge {
  background: #f3efff;
  color: #6b4dff;
  border: 1px solid rgba(107, 77, 255, 0.12);
}
.task-family-badge {
  background: #fff2e8;
  color: #b45e27;
  border: 1px solid rgba(255, 109, 31, 0.16);
}
.task-model-name {
  font-weight: 800;
  color: #1d2433;
  font-size: 15px;
  letter-spacing: -0.015em;
}
.task-row-prompt {
  color: #1d2433;
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-row .task-meta {
  margin: 0;
  gap: 8px;
  display: flex;
  flex-wrap: wrap;
}
.task-row .task-meta span {
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244, 246, 252, 0.94), rgba(250, 251, 255, 0.92));
  border: 1px solid rgba(24, 33, 56, 0.06);
  padding: 5px 10px;
  font-size: 12px;
  color: #5f6778;
  font-weight: 600;
}
.task-row-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.task-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.task-submeta-item {
  color: #788194;
  font-size: 12px;
  line-height: 1.5;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.task-actions button,
.task-actions a {
  border: 1px solid rgba(24, 33, 56, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 246, 252, 0.94));
  color: #485268;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}
.task-actions button:hover,
.task-actions a:hover {
  background: linear-gradient(135deg, rgba(243, 239, 255, 0.96), rgba(255, 244, 235, 0.88));
  border-color: rgba(107, 77, 255, 0.14);
  box-shadow: 0 10px 18px rgba(107, 77, 255, 0.08);
}
.task-actions .danger { background: #fff1f0; color: #c24034; }
.task-actions .danger:hover { background: #ffe2e0; }

.task-card {
  border: 1px solid rgba(24, 33, 56, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.95));
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
}
.task-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(33, 49, 90, 0.11);
  border-color: rgba(255, 142, 79, 0.26);
}
.task-card-completed-fresh {
  border-color: rgba(31, 139, 72, 0.18);
  background:
    radial-gradient(circle at 0% 0%, rgba(31, 139, 72, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(247, 253, 249, 0.96));
  box-shadow:
    0 18px 36px rgba(31, 139, 72, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}
.task-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f0f3f8;
  overflow: hidden;
}
.task-card-thumb img,
.task-card-thumb video,
.task-card-thumb .thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.task-card-thumb .status-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.92);
}
.task-card-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.task-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #7a8293;
  font-weight: 800;
}
.task-card-prompt { font-size: 13px; color: #1d2433; line-height: 1.45; }

@media (max-width: 700px) {
  .task-row { grid-template-columns: 72px 1fr; }
  .task-row-thumb { width: 72px; height: 72px; }
}

/* disabled primary button */
.primary-btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  background: linear-gradient(135deg, #d6a48c, #d8b794);
}

/* admin recent failures */
.failure-row {
  display: grid;
  grid-template-columns: 80px 1fr 24px;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
}
.failure-row:hover { background: rgba(255, 241, 240, 0.6); }
.failure-row .failure-when {
  color: #7a8293;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.failure-row .failure-main { font-size: 13px; color: #1d2433; }
.failure-row .failure-main .hint { font-size: 11px; }
.failure-row .failure-code {
  background: #fff1f0;
  color: #c24034;
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.failure-row .failure-arrow { color: #b8bfcd; }

/* ledger row task link */
.ledger-task-link {
  color: #6b4dff;
  cursor: pointer;
  text-decoration: underline;
}
.ledger-task-link:hover { color: #5e42d8; }

/* extend banner inside create drawer */
.extend-banner {
  background: linear-gradient(135deg, #fff5ec, #ffe8d3);
  color: #b45e27;
  border: 1px solid rgba(255, 146, 87, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.extend-banner .clear-btn {
  border: 0;
  background: transparent;
  color: #b45e27;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

/* ── lightbox ──────────────────────────────────────────────── */
.lightbox-mask {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 22, 0.88);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 32px;
}
.lightbox-mask[hidden] { display: none; }
.lightbox-stage {
  position: relative;
  max-width: min(1100px, 100vw);
  max-height: 80vh;
  display: grid;
  place-items: center;
}
.lightbox-stage img,
.lightbox-stage video {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: #000;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }
.lightbox-meta {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(900px, 92vw);
}
.lightbox-meta .lb-prompt {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
  opacity: 0.9;
}
.lightbox-meta .lb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.lightbox-meta a, .lightbox-meta button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.lightbox-meta a:hover, .lightbox-meta button:hover {
  background: rgba(255, 255, 255, 0.25);
}
.thumb-card.zoomable { cursor: zoom-in; }
.preview-frame.zoomable { cursor: zoom-in; }

/* ── form sections (create drawer) ─────────────────────────── */
.form-section {
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.form-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
  color: #1d2433;
  font-size: 14px;
}
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::after {
  content: "▾";
  color: #7a8293;
  font-size: 12px;
  transition: transform .15s ease;
}
.form-section[open] > summary::after { transform: rotate(180deg); }
.form-section > summary .summary-line {
  font-weight: 500;
  color: #7a8293;
  font-size: 12.5px;
}
.form-section[open] > summary .summary-line { display: none; }
.form-section .form-section-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 12px;
}

/* ── detail drawer ─────────────────────────────────────────── */
.drawer-detail { width: min(720px, 100vw); }
.drawer-detail .drawer-body {
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(247, 249, 255, 0.95));
}
.detail-header {
  padding: 24px;
  border-bottom: 1px solid rgba(24, 33, 56, 0.08);
  display: grid;
  gap: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.1), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 244, 255, 0.92));
}
.detail-kicker {
  color: #6b4dff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.detail-header .summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.detail-title-wrap {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.detail-header .summary-row .title {
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1d2433;
}
.detail-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(243, 239, 255, 0.96), rgba(255, 244, 235, 0.88));
  border: 1px solid rgba(107, 77, 255, 0.14);
  color: #5e42d8;
  font-size: 12px;
  font-weight: 700;
}
.detail-header .id-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #6d7484;
  font-size: 13px;
}
.detail-layout {
  display: grid;
  gap: 16px;
  padding: 18px;
}
.detail-main-column,
.detail-side-column {
  display: grid;
  gap: 16px;
}
.detail-header .id-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f4f6fb;
  border-radius: 8px;
  padding: 2px 8px;
}
.detail-header .copy-btn {
  border: 0;
  background: transparent;
  color: #6b4dff;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}
.detail-section-block {
  padding: 18px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(248, 251, 255, 0.95));
  box-shadow:
    0 12px 28px rgba(31, 45, 78, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}
.detail-section-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1d2433;
}
.detail-section-block .empty {
  color: #7a8293;
  font-size: 13px;
}
.detail-section-primary {
  border-color: rgba(107, 77, 255, 0.12);
}
.detail-section-secondary {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 250, 255, 0.94));
}
.prompt-box {
  white-space: pre-wrap;
  background:
    radial-gradient(circle at 0% 0%, rgba(107, 77, 255, 0.08), transparent 34%),
    #fbfcff;
  border: 1px solid rgba(24, 33, 56, 0.06);
  border-radius: 16px;
  padding: 14px 16px;
  color: #1d2433;
  font-size: 14px;
  line-height: 1.65;
}
.kv-table {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 8px;
  column-gap: 12px;
  font-size: 13.5px;
}
.kv-table dt { color: #7a8293; }
.kv-table dd { margin: 0; color: #1d2433; word-break: break-all; }

.timeline {
  display: grid;
  gap: 10px;
  padding-left: 4px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 16px 80px 1fr;
  gap: 10px;
  align-items: start;
  font-size: 13px;
  color: #5b6272;
  position: relative;
}
.timeline-item::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  margin-top: 4px;
}
.timeline-item.done::before { background: #1f8b48; }
.timeline-item.active::before { background: #6b4dff; box-shadow: 0 0 0 4px rgba(107, 77, 255, 0.15); }
.timeline-item.fail::before { background: #c24034; }
.timeline-item .ts { color: #7a8293; font-variant-numeric: tabular-nums; }
.timeline-item .label { color: #1d2433; }
.timeline-item.fail .label { color: #c24034; }
.timeline-item .hint-line {
  color: #7a8293;
  margin-top: 2px;
  font-size: 12.5px;
}
.detail-thumb-row {
  margin-top: 12px;
}

.admin-fold {
  border-radius: 12px;
  background: #fbfcff;
  border: 1px solid rgba(24, 33, 56, 0.08);
}
.admin-fold summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13px;
  color: #5b6272;
  list-style: none;
}
.admin-fold summary::-webkit-details-marker { display: none; }
.admin-fold[open] summary { color: #1d2433; border-bottom: 1px solid rgba(24, 33, 56, 0.06); }
.admin-fold .fold-body { padding: 14px; }
.admin-fold pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 12px;
  background: #f4f6fb;
  border-radius: 10px;
  padding: 10px;
  color: #1d2433;
  max-height: 220px;
  overflow: auto;
}

.detail-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid rgba(24, 33, 56, 0.08);
  background:
    linear-gradient(180deg, rgba(251, 252, 255, 0.98), rgba(246, 243, 255, 0.92));
}
.detail-foot-row .left { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-foot-row .right { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-danger-btn {
  padding: 8px 12px;
  font-size: 12px;
}

/* preview overrides for detail drawer */
.drawer-detail .preview-frame { border-radius: 14px; }
.drawer-detail .preview-frame video,
.drawer-detail .preview-frame img { max-height: 320px; }

/* ── task list v2 ──────────────────────────────────────────── */
.tasks-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(24, 33, 56, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(107, 77, 255, 0.1), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 243, 255, 0.84));
  box-shadow:
    0 14px 32px rgba(31, 45, 78, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.tasks-toolbar select {
  appearance: none;
  width: auto;
  min-width: 174px;
  min-height: 58px;
  padding: 14px 52px 14px 22px;
  border-radius: 24px;
  border: 1px solid rgba(24, 33, 56, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 255, 0.94));
  background-image:
    linear-gradient(45deg, transparent 50%, #1d2433 50%),
    linear-gradient(135deg, #1d2433 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 252, 255, 0.94));
  background-position:
    calc(100% - 24px) calc(50% - 3px),
    calc(100% - 17px) calc(50% - 3px),
    0 0;
  background-size:
    8px 8px,
    8px 8px,
    100% 100%;
  background-repeat: no-repeat;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 4px 12px rgba(31, 45, 78, 0.04);
  color: #1d2433;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tasks-toolbar select:hover {
  border-color: rgba(107, 77, 255, 0.18);
  box-shadow:
    0 10px 22px rgba(107, 77, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}
.tasks-toolbar select:focus-visible {
  outline: none;
  border-color: rgba(107, 77, 255, 0.32);
  box-shadow:
    0 0 0 6px rgba(107, 77, 255, 0.12),
    0 12px 24px rgba(107, 77, 255, 0.08);
}
.tasks-toolbar .spacer { flex: 1; }
.tasks-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: -2px 0 18px;
}
.tasks-result-note {
  color: #5f6778;
  font-size: 13px;
  font-weight: 700;
}
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(107, 77, 255, 0.14);
  background: linear-gradient(135deg, rgba(243, 239, 255, 0.96), rgba(255, 244, 235, 0.88));
  color: #5e42d8;
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

@media (max-width: 980px) {
  .shell { padding-bottom: 64px; }
  .app-header {
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    min-height: 68px;
  }
  .app-nav { display: none; }
  .brand-name { font-size: 18px; }
  .brand-sub { display: none; }
  .app-header-actions { gap: 8px; }
  .app-header-actions .lang-chip,
  .app-header-actions .icon-btn { display: none; }
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
  .studio-hero { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-row { grid-template-columns: 1fr; }
  .thumb-row { grid-template-columns: repeat(2, 1fr); }
  .drawer { width: 100vw; }
  .main { width: 100%; padding: 16px; }
  .generator-hero {
    min-height: auto;
    padding: 22px;
    border-radius: 24px;
    flex-direction: column;
  }
  .generator-hero h2 { font-size: clamp(30px, 9vw, 42px); }
  .generator-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .generator-side {
    position: static;
    order: -1;
    padding: 10px;
    border-radius: 24px;
  }
  .preview-frame {
    min-height: 208px;
    border-radius: 22px;
  }
  .preview-meta-card {
    padding: 10px 12px 2px;
  }
  .preview-meta-row {
    padding: 10px 0;
  }
  .preview-prompt {
    padding: 2px 2px 4px;
  }
  .provider-card-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.four,
  .grid.five,
  .image-param-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .choice-grid,
  .parameter-board,
  .reference-board,
  .image-param-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #veo-frame-layout,
  #veo-ingredient-layout {
    grid-template-columns: 1fr;
  }
  .generator-mode-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .generator-main .drawer-tabs,
  .generator-main .drawer-tab {
    width: 100%;
  }
  .generator-main .drawer-tab {
    text-align: center;
  }
  .admin-subnav {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 10px;
    scroll-padding-inline: 8px;
  }
  .admin-subnav::-webkit-scrollbar { display: none; }
  .admin-subnav-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .admin-filter-bar-two,
  .admin-filter-bar-three,
  .admin-filter-bar-four {
    grid-template-columns: 1fr;
  }
  .code-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-head-actions {
    justify-content: flex-start;
  }
  .admin-table th,
  .admin-table td {
    padding: 9px 10px;
    font-size: 12px;
  }
  .topbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .topbar h1 { font-size: 24px; }
  .topbar p { font-size: 13px; }
  .crumbs { font-size: 12px; }
  .topbar-actions { flex-wrap: wrap; }
  .topbar-actions .balance-pill,
  .topbar-actions .create-btn,
  .topbar-actions .user-chip { flex-shrink: 0; }
  .app-header-actions .user-chip {
    max-width: 112px;
  }
  .tasks-toolbar select { min-width: auto; flex: 1 1 calc(50% - 6px); }
  .tasks-feedback {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-pills {
    justify-content: flex-start;
  }
  .tasks-toolbar .view-toggle,
  .tasks-toolbar #filter-reset { width: 100%; }
  .task-row {
    grid-template-columns: 88px 1fr;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
  }
  .task-row-thumb {
    width: 88px;
    height: 88px;
    border-radius: 16px;
  }
  .task-row-prompt {
    -webkit-line-clamp: 2;
    font-size: 13px;
  }
  .task-row-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .task-actions {
    width: 100%;
  }
  .task-actions button,
  .task-actions a {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    text-align: center;
  }
  .task-card {
    border-radius: 18px;
  }
  .task-card-thumb {
    aspect-ratio: 16 / 10;
  }
  .task-card-body {
    padding: 14px;
  }
  .drawer-foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .drawer-foot .actions { width: 100%; }
  .drawer-foot .actions .secondary-btn,
  .drawer-foot .actions .primary-btn { flex: 1; }
  .advanced-prompt-box { grid-template-columns: 1fr; }
  .detail-foot-row { flex-wrap: wrap; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }
  .lightbox-mask { padding: 16px; }
  .lightbox-meta { padding: 8px 12px; }
  .lightbox-meta .lb-prompt { max-width: 60vw; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(24, 33, 56, 0.08);
    z-index: 80;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .mobile-nav .nav-item {
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 600;
    color: #7a8293;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
  }
  .mobile-nav .nav-item.active {
    color: #ff8e4f;
  }
  .mobile-nav .nav-item .nav-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 2px;
  }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: 1fr; }
  .generator-page { gap: 14px; }
  .generator-hero { padding: 18px; }
  .generator-hero p { font-size: 13px; }
  .create-body { padding: 16px; }
  .generator-section { padding: 18px; border-radius: 18px; }
  .generator-main,
  .generator-side {
    border-radius: 22px;
  }
  .generator-mode-row {
    padding: 18px 18px 14px;
  }
  .generator-section-head {
    flex-direction: column;
    gap: 10px;
  }
  .generator-section-head .summary-line {
    text-align: left;
    max-width: none;
  }
  .provider-card-row,
  .grid.four,
  .grid.five,
  .image-param-grid {
    grid-template-columns: 1fr;
  }
  .choice-grid,
  .choice-grid-compact,
  .parameter-board,
  .reference-board,
  .image-param-grid {
    grid-template-columns: 1fr;
  }
  #prompt-input,
  #image-prompt {
    min-height: 176px;
    padding: 16px;
    font-size: 14px;
  }
  .task-row {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }
  .task-row-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
  .task-row-title-group {
    gap: 6px;
  }
  .task-model-name {
    font-size: 14px;
  }
  .task-row-foot {
    flex-direction: column;
  }
  .task-actions {
    width: 100%;
    gap: 6px;
  }
  .task-actions button,
  .task-actions a {
    flex: 1 1 100%;
    min-height: 38px;
  }
  .task-row-head {
    align-items: flex-start;
  }
  .task-submeta {
    flex-direction: column;
    gap: 4px;
  }
  .preview-frame {
    min-height: 186px;
    border-radius: 20px;
  }
  .preview-play {
    width: 48px;
    height: 48px;
  }
  .preview-state-processing .preview-caption strong {
    font-size: 16px;
  }
  .preview-state-processing .preview-caption span {
    font-size: 24px;
  }
  .preview-meta-card {
    padding: 8px 10px 2px;
  }
  .preview-meta-value {
    max-width: 18ch;
    font-size: 12px;
  }
  .preview-prompt p {
    font-size: 12px;
    line-height: 1.5;
  }
  .drawer-submit-btn,
  .generator-submit {
    width: 100%;
  }
  .detail-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .detail-header {
    padding: 20px 18px;
  }
  .topbar h1 { font-size: 20px; }
  .topbar-actions .balance-pill { font-size: 11px; padding: 6px 10px; }
  .topbar-actions .create-btn { padding: 8px 12px; font-size: 13px; }
  .user-chip .info { display: none; }
  .user-chip { padding: 4px; }
  .user-chip .avatar { width: 28px; height: 28px; font-size: 13px; }
  .app-header-actions .user-chip { max-width: none; }
  .user-menu {
    width: min(88vw, 300px);
    right: 0;
  }
  .auth-card { padding: 18px; }
  .balance-pill .balance-num { font-size: 13px; }
}

/* ── Toast Notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #fff;
  border-radius: 12px;
  padding: 12px 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(24, 33, 56, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: #1d2433;
  pointer-events: auto;
  animation: toast-slide-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { border-left: 4px solid #1f8b48; }
.toast-error { border-left: 4px solid #c24034; }
.toast-fadeout { animation: toast-fade-out 0.3s forwards; }
@keyframes toast-slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-fade-out {
  to { transform: translateY(-20px); opacity: 0; }
}
