/* FlowsToken console theme — variable-level overrides only.
   Loaded after the app bundle CSS; :root:root / .dark.dark beat the
   later lab() declarations in the bundle without !important hacks. */

:root:root {
  --primary: #1f4fd8;
  --primary-foreground: #fff;
  --ring: #1f4fd8;
  --radius: 10px;
  --background: #fbfbf9;
  --card: #fff;
  --border: #e3e3dc;
  --input: #e3e3dc;
  --muted: #f3f3ef;
  --muted-foreground: #6b7280;
  --foreground: #0e1220;
  --secondary: #eaeae4;
  --secondary-foreground: #0e1220;
  --sidebar: #fff;
  --sidebar-border: #e3e3dc;
  --sidebar-primary: #1f4fd8;
  --sidebar-accent: #e9eefc;
  --sidebar-accent-foreground: #163ba6;
  --font-sans: "Onest", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --chart-1: #1f4fd8;
}

.dark.dark {
  --primary: #4f7cf0;
}

/* ---------- Component-level overrides (safe-degrade) ----------
   Only stable hooks: data-slot, data-ft-*, header/nav semantics,
   aria-*, href attributes. If new-api changes these, rules simply
   stop matching — nothing functional is hidden or broken. */

/* Top bar only: the fixed z-50 header. Inner headers (e.g. the pricing
   page title block `header.mx-auto...text-center`) must stay untouched —
   transparent background, no border. Do NOT change pointer-events on the
   wrapper (it is intentionally pointer-events-none). */
header.fixed.top-0 {
  background: rgba(251, 251, 249, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
header.fixed.top-0 nav a,
header.fixed.top-0 a[data-ft-smart-nav],
header.fixed.top-0 a[data-ft-docs-nav],
header.fixed.top-0 a[data-ft-affiliate-nav] {
  font-size: 14px;
  font-weight: 500;
}
/* Normalize injected colored nav items to normal nav color */
a[data-ft-smart-nav],
a[data-ft-docs-nav],
a[data-ft-affiliate-nav],
a[data-ft-affiliate-sidebar] {
  color: var(--muted-foreground) !important;
  font-weight: 500 !important;
}
a[data-ft-smart-nav]:hover,
a[data-ft-docs-nav]:hover,
a[data-ft-affiliate-nav]:hover {
  color: var(--foreground) !important;
}
.dark a[data-ft-smart-nav],
.dark a[data-ft-docs-nav],
.dark a[data-ft-affiliate-nav],
.dark a[data-ft-affiliate-sidebar] {
  color: var(--muted-foreground) !important;
}

/* Brand logo injected by console-theme.js */
.ft-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--foreground);
  text-decoration: none;
  border: 0;
  background: transparent;
}
/* The host anchor (home-nav-fix.js clone / skeleton wrapper) may carry
   border/rounded/padding classes — strip them so the logo is frameless
   like the site .brand. */
a:has(> .ft-brand),
div:has(> .ft-brand) {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
}
.ft-brand-img {
  height: 24px;
  width: auto;
  display: block;
  flex: none;
}
.ft-brand-word {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ft-brand-word b {
  font-weight: 600;
  color: #238df7;
}

/* Use the site's existing left-aligned navigation rhythm on both app headers. */
body:has(header[data-ft-top-header="app"]) {
  --app-header-height: 64px;
}

header[data-ft-top-header] [data-ft-top-container] {
  width: calc(100% - 48px);
  max-width: none;
  margin-inline: auto;
  padding: 0;
}

header[data-ft-top-header] [data-ft-top-row] {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding-block: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

header[data-ft-top-header="public"] [data-ft-top-row] {
  padding-inline: 0;
}

header[data-ft-top-header="public"] :is([data-ft-top-container], [data-ft-top-row]) {
  transition-property: background-color, color, border-color;
}

header[data-ft-top-header="app"] [data-ft-top-row] {
  padding-inline-start: 0;
  padding-inline-end: 16px;
}

header[data-ft-top-header] [data-ft-top-brand] {
  flex: none;
  height: auto;
}

header[data-ft-top-header] .ft-brand {
  height: auto;
  padding: 0;
  gap: 10px;
}

header[data-ft-top-header] .ft-brand-img { height: 26px; }
header[data-ft-top-header] .ft-brand-word { font-size: 17px; }

header[data-ft-top-header] [data-ft-top-desktop] {
  flex: 1;
  min-width: 0;
  margin-inline-start: 36px;
  gap: 4px;
}

header[data-ft-top-header] [data-ft-top-link] {
  flex: none;
  margin-inline: 0 !important;
  padding: 7px 11px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400 !important;
  line-height: 1.65;
  white-space: nowrap;
  border-radius: 6px;
}

header[data-ft-top-header] [data-ft-top-tools-start] {
  margin-inline-start: auto;
}

header[data-ft-top-header] [data-ft-top-nav] > [data-ft-top-link] {
  font-size: 16px !important;
}

header[data-ft-top-header="public"] [data-ft-top-link]:first-child {
  margin-inline-start: var(--ft-top-menu-offset, 0px) !important;
}

header[data-ft-top-header="app"] [data-ft-top-desktop] {
  flex: none;
  margin-inline-start: auto;
}

header[data-ft-top-header="app"] [data-ft-top-nav-holder] {
  position: absolute;
  left: 50%;
  top: 32px;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: calc(100% - 640px);
  min-width: 0;
  margin-inline-end: 0;
}

header[data-ft-top-header="app"] [data-ft-top-nav] {
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

header[data-ft-top-header="app"] [data-ft-top-search] {
  flex: none;
  width: 128px;
}

header[data-ft-top-header="app"] [data-ft-top-sidebar-toggle] {
  position: absolute;
  inset-inline-start: auto;
  inset-inline-end: 4px;
  top: 16px;
}

@media (min-width: 1181px) {
  html[lang="en"] header[data-ft-top-header] [data-ft-top-link] { font-size: 16px; }
  html[lang="en"] header[data-ft-top-header] [data-ft-top-nav] { gap: 2px; }
}

@media (max-width: 1180px) {
  header[data-ft-top-header="app"] [data-ft-top-desktop] { margin-inline-start: auto; }
  header[data-ft-top-header="public"] [data-ft-top-desktop] { display: none; }
  header[data-ft-top-header="public"] [data-ft-top-mobile] {
    display: flex;
    margin-inline-start: auto;
  }
  [data-ft-top-overlay] { display: block; }
  [data-ft-top-overlay].pointer-events-auto { pointer-events: auto; visibility: visible; }
  [data-ft-top-overlay].pointer-events-none { pointer-events: none; visibility: hidden; }
  [data-ft-top-overlay] nav > a {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 400 !important;
    line-height: 1.65;
    padding-block: 7px;
  }
}

@media (max-width: 1259px) {
  header[data-ft-top-header="app"] [data-ft-top-nav-holder] { max-width: calc(100% - 440px); }
  header[data-ft-top-header="app"] [data-ft-top-search] {
    width: 32px;
    padding: 0;
  }
  header[data-ft-top-header="app"] [data-ft-top-search] > :is(span, kbd) { display: none; }
  header[data-ft-top-header="app"] [data-ft-top-search] > svg { inset-inline-start: 7px; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  html[lang="en"] header[data-ft-top-header="public"] [data-ft-top-desktop] { display: none; }
  html[lang="en"] header[data-ft-top-header="public"] [data-ft-top-mobile] { display: flex; margin-inline-start: auto; }
  html[lang="en"] [data-ft-top-overlay] { display: block; }
  html[lang="en"] [data-ft-top-overlay].pointer-events-auto { pointer-events: auto; visibility: visible; }
  html[lang="en"] [data-ft-top-overlay].pointer-events-none { pointer-events: none; visibility: hidden; }
}

@media (max-width: 760px) {
  header[data-ft-top-header] [data-ft-top-container] { width: calc(100% - 32px); }
  header[data-ft-top-header="app"] [data-ft-top-row] { padding-inline-end: 24px; }
}

@media (max-width: 359px) {
  header[data-ft-top-header="app"] .ft-brand-word { display: none; }
}

/* Decorative radial-gradient overlay on /pricing (and likely /sign-in):
   `div.pointer-events-none.absolute.inset-x-0.top-0` with h-[600px] +
   opacity-20 + inline background-image. Pure decoration — hide via
   opacity (not display) in case layout depends on it. */
.pointer-events-none.absolute.inset-x-0.top-0[class*="h-[600px]"] {
  opacity: 0 !important;
}

/* Gradient hero/section banners (pricing 模型广场 etc.) -> flat paper */
[class*="bg-gradient-to-"],
[class*="from-overview-accent-"],
[class*="via-overview-accent-"],
[class*="to-overview-accent-"] {
  background-image: none !important;
  background-color: var(--card) !important;
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
}
[class*="bg-gradient-to-"] h1,
[class*="bg-gradient-to-"] h2,
[class*="bg-gradient-to-"] p,
[class*="from-overview-accent-"] h1,
[class*="from-overview-accent-"] p {
  color: inherit;
}

/* Cards: 1px border, 10px radius, minimal shadow */
[data-slot=card] {
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(14, 18, 32, 0.04);
}
[data-slot=card-title] {
  letter-spacing: -0.015em;
}

/* Inputs / search / select triggers: site .copy spec */
[data-slot=input-group],
[data-slot=input-group-control],
[data-slot=select-trigger],
input[type="search"] {
  border-color: var(--input);
  border-radius: 6px;
}

/* Badges / pills: mono 11px hairline pill like site .ep */
[data-slot=badge-cell],
[data-slot=provider-badge],
[data-slot=status-badge] {
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Filter/sidebar active states: accent-soft bg + accent-ink text */
[data-slot=navigation-menu-link][aria-current],
[data-slot=navigation-menu-link].active,
a[data-state="active"],
button[data-state="on"] {
  color: var(--sidebar-accent-foreground);
  background: var(--sidebar-accent);
}

/* Tables: mono uppercase header like table.prices */
[data-slot=table] th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Login/auth page: flat paper background */
div[class*="bg-gradient-to-b"],
.min-h-screen[class*="bg-gradient"] {
  background: var(--background);
  background-image: none !important;
}

/* Dark mode: only ensure nothing breaks */
.dark header.fixed.top-0 {
  background: rgba(14, 18, 32, 0.85);
}
.dark [class*="bg-gradient-to-"],
.dark [class*="from-overview-accent-"],
.dark [class*="via-overview-accent-"],
.dark [class*="to-overview-accent-"] {
  background-color: var(--card) !important;
}

/* Sidebar typography, step 1. Scope to the expanded desktop sidebar and
   mobile drawer so the upstream 32px icon rail and collapse transitions
   keep their original dimensions. These rules only style existing hooks. */
:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-menu-button"] {
  height: 44px;
  padding-inline: 12px;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

/* The existing affiliate overlay sets a global 500 !important weight.
   Let an inactive sidebar entry follow the other regular-weight items. */
:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-menu-button"][data-ft-affiliate-sidebar]:not([data-active]:not([data-active="false"])):not([data-state="active"]) {
  font-weight: 400 !important;
}

:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-menu-button"][data-active]:not([data-active="false"]),
:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-menu-button"][data-state="active"] {
  font-weight: 500;
}

/* The first icon is the navigation icon; trailing disclosure arrows and
   badges retain their upstream sizing. */
:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-menu-button"] > svg:first-child {
  width: 18px;
  height: 18px;
}

:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-group-label"] {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted-foreground);
}

:is([data-slot="sidebar"][data-state="expanded"], [data-slot="sidebar"][data-mobile="true"])
  [data-slot="sidebar-group"] + [data-slot="sidebar-group"] {
  margin-block-start: 12px;
}

/* Page polish: independent presentation hooks, no layout/overflow changes. */
html:not(.dark) body[data-ft-page] {
  --background: #f6f7fb;
  --border: #e4e8ef;
  --input: #dfe5ee;
  --muted: #eef1f6;
  --card: #fff;
}

html.dark body[data-ft-page] {
  --background: #10141f;
  --foreground: #e7edf8;
  --card: #181e2b;
  --border: #2b3445;
  --input: #354056;
  --muted: #222b3c;
  --muted-foreground: #a4b0c5;
  --secondary: #242d40;
  --secondary-foreground: #e7edf8;
  --sidebar: #141a26;
  --sidebar-border: #2b3445;
  --sidebar-foreground: #dce6f7;
  --sidebar-accent: #20345c;
  --sidebar-accent-foreground: #bfd2ff;
}

body[data-ft-page] header.fixed.top-0 {
  background: color-mix(in srgb, var(--background) 88%, transparent);
}

main[data-ft-console-page] {
  font-size: 15px;
  line-height: 1.6;
}

main[data-ft-console-page] [data-ft-page-header] {
  padding: 24px 24px 16px;
}

main[data-ft-console-page] [data-ft-page-title] {
  font-size: 26px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

main[data-ft-console-page] [data-ft-page-content] {
  padding-inline: 24px;
  padding-block-start: 8px;
  padding-block-end: 24px;
}

body[data-ft-page] [data-slot="card"] {
  border-radius: 14px;
  box-shadow: 0 2px 12px rgb(15 23 42 / 3%);
}

main[data-ft-console-page] [data-slot="card-header"] {
  padding-inline: 22px;
  padding-block-start: 20px;
  padding-block-end: 20px !important;
}

main[data-ft-console-page] [data-slot="card-content"] {
  padding-inline: 22px;
  padding-block-end: 22px;
}

main[data-ft-console-page] [data-slot="card-header"].border-b + [data-slot="card-content"] {
  padding-block-start: 20px;
}

body[data-ft-page] [data-slot="card-title"] {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

body[data-ft-page] [data-slot="card-description"] {
  font-size: 14px;
  line-height: 1.65;
}

main[data-ft-console-page] [data-ft-panel-title] {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

main[data-ft-console-page] [data-ft-panel-description] {
  font-size: 14px;
  line-height: 1.6;
}

main[data-ft-console-page] [data-ft-stat-value] {
  font-family: var(--font-sans);
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

body[data-ft-page] :is([data-slot="form-label"], [data-slot="field-label"]) {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

body[data-ft-page] :is([data-slot="form-description"], [data-slot="field-description"]) {
  font-size: 13px;
  line-height: 1.65;
}

body[data-ft-page] :is([data-slot="input"], [data-slot="select-trigger"]) {
  font-size: 15px;
}

body[data-ft-page] [data-slot="tabs-trigger"] {
  font-size: 14px;
  font-weight: 500;
}

body[data-ft-page] [data-slot="table-head"] {
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

body[data-ft-page] [data-slot="table-head"] > :is(button, div, span) {
  font-family: inherit;
  font-size: 13px;
  line-height: inherit;
}

body[data-ft-page] [data-slot="table-cell"] {
  padding: 11px 12px;
  font-size: 14px;
  line-height: 1.55;
}

body[data-ft-page] :is([data-slot="badge-cell"], [data-slot="provider-badge"], [data-slot="status-badge"]) {
  font-size: 12px;
  letter-spacing: 0;
}

body[data-ft-page="wallet"] .ft-topup-overlay-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

body[data-ft-page="wallet"] .ft-pay-box {
  padding: 20px;
  border-radius: 12px;
}

body[data-ft-page="wallet"] .ft-pay-box-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

body[data-ft-page="wallet"] .ft-pay-box-hint {
  font-size: 13px;
  line-height: 1.65;
}

body[data-ft-page="wallet"] .ft-topup-custom-row label {
  font-size: 14px;
  line-height: 1.5;
}

body[data-ft-page="wallet"] .ft-topup-custom-row input {
  font-size: 15px;
}

html.dark body[data-ft-page="wallet"] .ft-topup-overlay {
  background: var(--card);
  border-color: var(--border);
}

html.dark body[data-ft-page="wallet"] :is(.ft-pay-box, .ft-topup-chip, .ft-topup-mirror) {
  background: var(--background);
  border-color: var(--input);
}

html.dark body[data-ft-page="wallet"] :is(.ft-topup-overlay-title, .ft-pay-box-title, .ft-topup-custom-row, .ft-topup-custom-input, .ft-topup-chip) {
  color: var(--foreground);
}

html.dark body[data-ft-page="wallet"] .ft-pay-box-hint {
  color: var(--muted-foreground);
}

html.dark body[data-ft-page="wallet"] .ft-topup-chip.is-active,
html.dark body[data-ft-page="wallet"] .ft-topup-chip:hover {
  background: var(--sidebar-accent);
  border-color: var(--primary);
}

/* Model Square: preserve controls, data order, prices and native scrolling. */
body[data-ft-page="pricing"] [data-ft-pricing-header] {
  margin-block-end: 20px;
  padding-block-start: 0;
}

/* Retain the accessible page heading while the visual header is search-only. */
body[data-ft-page="pricing"] [data-ft-pricing-header] > h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
body[data-ft-page="pricing"] [data-ft-pricing-header] > p { display: none; }
body[data-ft-page="pricing"] [data-ft-pricing-search] { margin-block-start: 0; }

body[data-ft-page="pricing"] [data-ft-pricing-header] h1 {
  font-size: 38px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

body[data-ft-page="pricing"] [data-ft-pricing-header] p {
  font-size: 15px;
  line-height: 1.65;
}

body[data-ft-page="pricing"] [data-ft-pricing-header] input {
  min-height: 46px;
  font-size: 15px;
}

body[data-ft-page="pricing"] [data-ft-pricing-filters] {
  padding: 18px;
}

body[data-ft-page="pricing"] [data-ft-pricing-filters] [data-slot="collapsible-trigger"] {
  font-size: 14px;
  font-weight: 500;
}

body[data-ft-page="pricing"] [data-ft-pricing-filters] [data-slot="collapsible-content"] button[type="button"][title] {
  padding: 6px 9px;
  font-size: 13px;
  line-height: 1.35;
}

body[data-ft-page="pricing"] [data-ft-pricing-toolbar] {
  padding: 16px;
  border-radius: 12px;
}

body[data-ft-page="pricing"] [data-ft-pricing-toolbar] button[aria-pressed] {
  font-size: 13px;
}

body[data-ft-page="pricing"] [data-ft-model-grid] {
  gap: 20px;
}

body[data-ft-page="pricing"] [data-ft-model-card] {
  padding: 22px;
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 8px rgb(15 23 42 / 2%);
}

body[data-ft-page="pricing"] [data-ft-model-card] h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

body[data-ft-page="pricing"] [data-ft-model-card] > p {
  font-size: 14px;
  line-height: 1.65;
  min-height: 46px;
  margin-block-start: 14px;
}

body[data-ft-page="pricing"] [data-ft-model-details] h1 {
  font-size: 24px;
  line-height: 1.35;
}

body[data-ft-page="pricing"] [data-ft-model-details] h2 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

body[data-ft-page="pricing"] [data-ft-model-details] p {
  font-size: 14px;
  line-height: 1.65;
}

/* Horizontal group navigation delegates to the existing native filters. */
body[data-ft-page="pricing"] [data-ft-pricing-toolbar-row] {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body[data-ft-page="pricing"] [data-ft-pricing-summary] {
  flex: 1 1 320px;
  min-width: 0;
  gap: 12px;
}

body[data-ft-page="pricing"] [data-ft-pricing-count] {
  flex: none;
  white-space: nowrap;
}

body[data-ft-page="pricing"] [data-ft-pricing-actions] {
  flex: none;
  margin-inline-start: auto;
}

body[data-ft-page="pricing"] [data-ft-model-groups] {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: stretch;
  justify-content: flex-start;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: thin;
}

body[data-ft-page="pricing"] [data-ft-model-groups] > button {
  flex: none;
  min-width: 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  padding: 7px 8px 6px;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  cursor: pointer;
}

body[data-ft-page="pricing"] [data-ft-model-groups] > button[aria-pressed="true"] {
  color: var(--foreground);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

body[data-ft-page="pricing"] [data-ft-model-groups] > button:hover {
  color: var(--foreground);
}

body[data-ft-page="pricing"] [data-ft-model-groups] > button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: -2px;
  border-radius: 4px;
}

body[data-ft-page="pricing"] [data-ft-model-groups] > button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body[data-ft-page="pricing"] [data-ft-group-source] {
  display: none;
}

body[data-ft-page="pricing"] [data-ft-vendor-grid] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 8px;
}

body[data-ft-page="pricing"] [data-ft-pricing-filters] [data-ft-vendor-grid] > button[type="button"][title] {
  display: flex;
  width: 100%;
  min-height: 40px;
  gap: 5px;
  padding: 8px 6px;
  font-size: 14px;
  line-height: 1.4;
  justify-content: flex-start;
  text-align: start;
}

body[data-ft-page="pricing"] [data-ft-vendor-logo] {
  display: inline-flex;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

body[data-ft-page="pricing"] [data-ft-vendor-logo] :is(svg, img) {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

body[data-ft-page="pricing"] [data-ft-vendor-grid] > button::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border: 1px solid var(--input);
  border-radius: 50%;
}

body[data-ft-page="pricing"] [data-ft-vendor-grid] > button > span.truncate {
  min-width: 0;
  max-width: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Keep React's original counts intact; show the current group's counts. */
body[data-ft-page="pricing"] [data-ft-vendor-empty="true"] { display: none !important; }
body[data-ft-page="pricing"] [data-ft-vendor-count] { font-size: 0; }
body[data-ft-page="pricing"] [data-ft-vendor-count]::after {
  content: attr(data-ft-vendor-count);
  font-size: 12px;
  line-height: 1.5;
}

/* Keep names aligned when the original vendor has no logo. */
body[data-ft-page="pricing"] [data-ft-vendor-grid] > button:not([data-ft-vendor-rank="0"]) > span.truncate:first-child {
  margin-inline-start: 23px;
}

body[data-ft-page="pricing"] [data-ft-vendor-grid] > button[data-ft-vendor-selected="true"]::before {
  border-color: var(--primary);
  background: radial-gradient(circle, var(--primary) 0 4px, transparent 4.5px);
}

body[data-ft-page="pricing"] [data-ft-vendor-grid] > button[data-ft-vendor-rank="0"],
body[data-ft-page="pricing"] [data-ft-vendor-grid] > button[data-ft-vendor-wide="true"] {
  grid-column: 1 / -1;
}

@media (min-width: 1280px) and (max-width: 1599px) {
  body[data-ft-page="pricing"] [data-ft-model-grid] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  body[data-ft-page="pricing"] [data-ft-pricing-layout] {
    grid-template-columns: 384px minmax(0, 1fr);
    gap: 20px;
  }
}

@media (max-width: 767px) {
  main[data-ft-console-page] [data-ft-page-header] {
    padding: 18px 16px 12px;
  }
  main[data-ft-console-page] [data-ft-page-title] {
    font-size: 22px;
  }
  main[data-ft-console-page] [data-ft-stat-value] {
    font-size: 26px;
  }
  main[data-ft-console-page] [data-ft-page-content] {
    padding-inline: 16px;
    padding-block-end: 16px;
  }
  main[data-ft-console-page] :is([data-slot="card-header"], [data-slot="card-content"]) {
    padding-inline: 16px;
  }
  main[data-ft-console-page] [data-slot="card-header"] {
    padding-block: 16px !important;
  }
  main[data-ft-console-page] [data-slot="card-header"].border-b + [data-slot="card-content"] {
    padding-block-start: 16px;
  }
  body[data-ft-page] :is([data-slot="input"], [data-slot="select-trigger"]) {
    font-size: 16px;
  }
  body[data-ft-page="wallet"] .ft-topup-custom-row input {
    font-size: 16px;
  }
  body[data-ft-page="wallet"] .ft-pay-box {
    padding: 16px;
  }
  body[data-ft-page="pricing"] [data-ft-pricing-header] h1 {
    font-size: 28px;
  }
  body[data-ft-page="pricing"] [data-ft-model-grid] {
    gap: 16px;
  }
  body[data-ft-page="pricing"] [data-ft-model-card] {
    padding: 16px;
  }
  body[data-ft-page="pricing"] [data-ft-pricing-header] input {
    font-size: 16px;
  }
  body[data-ft-page="pricing"] [data-ft-pricing-summary] {
    gap: 8px;
  }
  body[data-ft-page="pricing"] [data-ft-pricing-actions] {
    margin-inline-start: 0;
  }
  body[data-ft-page="pricing"] [data-ft-model-groups] > button {
    font-size: 14px;
    padding-inline: 6px;
  }
}

/* Flowstoken auth presentation */
/* Display-only left panel. Its containing auth layout should use flex on
   desktop; keep the existing form as the right sibling, flex: 1 1 45%.
   Everything below is scoped to the owned panel, including motion. */
[data-ft-auth-brand-panel] {
  --ft-auth-brand-blue: #275cc7;
  position: relative;
  isolation: isolate;
  flex: 0 1 55%;
  width: 55%;
  min-width: 0;
  min-height: 100svh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 112px clamp(32px, 5vw, 80px) 96px;
  color: #142744;
  background: #f5f8fd;
  font-family: var(--font-sans, "Onest", "PingFang SC", sans-serif);
}

[data-ft-auth-brand-panel] .ft-auth-brand-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 80% 75%, rgb(185 210 251 / 24%), transparent 56%);
}

[data-ft-auth-brand-panel] .ft-auth-brand-grid {
  display: block;
  width: 100%;
  height: 100%;
}

[data-ft-auth-brand-panel] .ft-auth-brand-infinity {
  opacity: 0.11;
  transform: translate(185px, 190px) scale(1.25);
  transform-origin: center;
}

[data-ft-auth-brand-panel] .ft-auth-brand-wordmark {
  position: absolute;
  top: 40px;
  left: clamp(32px, 5vw, 80px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1a2b47;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.025em;
  text-decoration: none;
}

[data-ft-auth-brand-panel] .ft-auth-brand-wordmark > svg {
  flex: none;
  width: 44px;
  height: 28px;
  color: var(--ft-auth-brand-blue);
}

[data-ft-auth-brand-panel] .ft-auth-brand-wordmark > span > span {
  color: var(--ft-auth-brand-blue);
}

[data-ft-auth-brand-panel] .ft-auth-brand-wordmark:focus-visible {
  outline: 2px solid var(--ft-auth-brand-blue);
  outline-offset: 6px;
  border-radius: 4px;
}

[data-ft-auth-brand-panel] .ft-auth-brand-copy {
  position: relative;
  max-width: 600px;
  margin-top: -26px;
}

[data-ft-auth-brand-panel] .ft-auth-brand-eyebrow {
  margin: 0 0 24px;
  color: #5f789a;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.12em;
}

[data-ft-auth-brand-panel] .ft-auth-brand-title {
  margin: 0;
  font-size: clamp(38px, 4.6vw, 68px);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

[data-ft-auth-brand-panel] .ft-auth-brand-description {
  max-width: 440px;
  margin: 24px 0 0;
  color: #62748f;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
}

[data-ft-auth-brand-panel] .ft-auth-brand-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 36px;
}

[data-ft-auth-brand-panel] .ft-auth-brand-groups > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #dce5f2;
  border-radius: 999px;
  background: rgb(255 255 255 / 48%);
  padding: 8px 13px;
  color: #405e85;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
}

[data-ft-auth-brand-panel] .ft-auth-brand-group-dot {
  display: block;
  width: 4px;
  height: 4px;
  flex: none;
  border-radius: 50%;
  background: #6a95dd;
}

[data-ft-auth-brand-panel] [data-ft-auth-language-only="en"] {
  display: none;
}

[data-ft-auth-brand-panel][data-ft-auth-language="en"] [data-ft-auth-language-only="zh"] {
  display: none;
}

[data-ft-auth-brand-panel][data-ft-auth-language="en"] [data-ft-auth-language-only="en"] {
  display: inline;
}

[data-ft-auth-brand-panel] .ft-auth-brand-point {
  opacity: 0.45;
  transform-box: fill-box;
  transform-origin: center;
  animation: ft-auth-brand-breathe 7.5s ease-in-out infinite;
}

[data-ft-auth-brand-panel] .ft-auth-brand-point-two {
  animation-delay: -2.5s;
  animation-duration: 9s;
}

[data-ft-auth-brand-panel] .ft-auth-brand-point-three {
  animation-delay: -5s;
  animation-duration: 10s;
}

@keyframes ft-auth-brand-breathe {
  0%, 100% { opacity: 0.24; transform: scale(0.82); }
  50% { opacity: 0.70; transform: scale(1.12); }
}

@media (max-width: 1023px) {
  [data-ft-auth-brand-panel] {
    padding-inline: 32px;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-wordmark {
    left: 32px;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-title {
    font-size: 42px;
  }
}

@media (max-width: 767px) {
  [data-ft-auth-brand-panel] {
    flex: none;
    width: 100%;
    min-height: 0;
    padding: 24px 24px 22px;
    background: #f7f9fd;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-art,
  [data-ft-auth-brand-panel] .ft-auth-brand-eyebrow,
  [data-ft-auth-brand-panel] .ft-auth-brand-description,
  [data-ft-auth-brand-panel] .ft-auth-brand-groups {
    display: none;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-wordmark {
    position: static;
    align-self: flex-start;
    font-size: 20px;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-wordmark > svg {
    width: 34px;
    height: 24px;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-copy {
    margin-top: 18px;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-title {
    font-size: 23px;
    line-height: 1.45;
    letter-spacing: -0.02em;
    text-wrap: pretty;
  }
  [data-ft-auth-brand-panel] .ft-auth-brand-break {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-ft-auth-brand-panel] .ft-auth-brand-point {
    animation: none;
    opacity: 0.4;
    transform: none;
  }
}

body[data-ft-auth] { background: #fbfcfe; }
body[data-ft-auth] [data-ft-auth-layout] { height: auto; min-height: 100svh; isolation: isolate; }
body[data-ft-auth] [data-ft-auth-layout]::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .32; background-image: repeating-linear-gradient(45deg, transparent 0 159px, #e7edf6 159px 160px); }
body[data-ft-auth] [data-ft-auth-home] { top: 24px; left: 24px; z-index: 3; }
body[data-ft-auth] .ft-brand { height: auto; padding: 0; gap: 10px; }
body[data-ft-auth] .ft-brand-img { height: 28px; }
body[data-ft-auth] .ft-brand-word { font-size: 19px; }
body[data-ft-auth] .ft-language-floating { top: 24px; right: 24px; }
body[data-ft-auth] [data-ft-auth-stage] { width: calc(100% - 96px); max-width: 1280px; min-height: 100svh; margin-inline: auto; padding: 100px 0 64px; display: grid; align-items: center; }
body[data-ft-auth="login"] [data-ft-auth-stage] { grid-template-columns: 55% 45%; }
body[data-ft-auth="login"] [data-ft-auth-card] { grid-column: 2; }
body[data-ft-auth="register"] [data-ft-auth-stage] { grid-template-columns: 1fr; }
body[data-ft-auth] [data-ft-auth-card] { width: 100%; max-width: 500px; margin: 0; padding: 40px; justify-self: center; background: #fff; border: 1px solid #edf0f6; border-radius: 28px; box-shadow: 0 28px 72px rgb(20 39 68 / 8%); }
body[data-ft-auth] [data-ft-auth-content] { display: flex; flex-direction: column; gap: 26px; }
body[data-ft-auth] [data-ft-auth-content] > * { margin-block: 0; }
body[data-ft-auth] [data-ft-auth-content] h2 { text-align: left; font-size: 30px; font-weight: 600; line-height: 1.3; letter-spacing: -.025em; }
body[data-ft-auth] [data-ft-auth-content] p { font-size: 14px; line-height: 1.65; }
body[data-ft-auth] form { gap: 20px; grid-template-columns: minmax(0, 1fr); }
body[data-ft-auth] form > * { min-width: 0; }
/* The existing invitation field uses a copy of the upstream card classes. */
body[data-ft-auth] form > .mx-auto { width: 100%; padding: 0; }
body[data-ft-auth] form > .flex.items-end > button { min-height: 46px; }
body[data-ft-auth] [data-slot="form-label"] { font-size: 14px; font-weight: 500; }
body[data-ft-auth] form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) { min-height: 46px; font-size: 16px; border-radius: 10px; }
body[data-ft-auth] form button[type="submit"] { min-height: 48px; border-radius: 10px; font-size: 16px; font-weight: 500; }
body[data-ft-auth] [data-slot="form-message"] { font-size: 13px; line-height: 1.5; }
body[data-ft-auth] [data-ft-auth-content] a { text-underline-offset: 4px; }
body[data-ft-auth] [data-ft-auth-brand-panel] { position: absolute; top: 0; left: 0; z-index: 0; width: 55%; min-height: 100svh; height: max(100svh, 720px); padding: 112px clamp(48px, 7vw, 112px) 96px; pointer-events: none; background: transparent; }
body[data-ft-auth] #root { position: relative; z-index: 1; }
body[data-ft-auth] .ft-auth-brand-title [data-ft-auth-language-only="zh"] { color: #152039; }
body[data-ft-auth] .ft-auth-brand-title { font-size: clamp(44px, 4.5vw, 68px); }
@media (max-width: 1023px) {
  body[data-ft-auth] [data-ft-auth-brand-panel] { display: none; }
  body[data-ft-auth="login"] [data-ft-auth-stage] { grid-template-columns: 1fr; }
  body[data-ft-auth="login"] [data-ft-auth-card] { grid-column: 1; }
  body[data-ft-auth] [data-ft-auth-stage] { width: calc(100% - 48px); padding-top: 92px; }
}
@media (max-width: 600px) {
  body[data-ft-auth] [data-ft-auth-home] { top: 20px; left: 20px; }
  body[data-ft-auth] .ft-language-floating { top: 20px; right: 20px; }
  body[data-ft-auth] [data-ft-auth-stage] { width: calc(100% - 32px); padding: 90px 0 32px; }
  body[data-ft-auth] [data-ft-auth-card] { padding: 26px 20px; border-radius: 22px; }
  /* Keep the upstream 300px challenge intact, borrowing only card whitespace. */
  body[data-ft-auth] form > div.mt-2:not(.space-y-1) { margin-inline: -20px; display: flex; justify-content: center; }
  body[data-ft-auth] [data-ft-auth-content] h2 { font-size: 26px; }
}
@media (max-width: 360px) {
  body[data-ft-auth] [data-ft-auth-stage] { width: calc(100% - 16px); }
}
html.dark body[data-ft-auth] {
  --background: #101722; --foreground: #e7edf8; --card: #172131;
  --border: #2b3445; --input: #354056; --muted: #222b3c;
  --muted-foreground: #a4b0c5; --secondary: #242d40;
  --secondary-foreground: #e7edf8;
  background: #101722; color: var(--foreground);
}
html.dark body[data-ft-auth] [data-ft-auth-layout]::before { opacity: .4; background-image: repeating-linear-gradient(45deg, transparent 0 159px, #29364a 159px 160px); }
html.dark body[data-ft-auth] [data-ft-auth-card] { background: #172131; border-color: #29364a; }
html.dark body[data-ft-auth] [data-ft-auth-brand-panel] { color: #dce8fb; }
html.dark body[data-ft-auth] .ft-auth-brand-title [data-ft-auth-language-only="zh"] { color: #e6efff; }
html.dark body[data-ft-auth] .ft-auth-brand-eyebrow,
html.dark body[data-ft-auth] .ft-auth-brand-description { color: #98accb; }
html.dark body[data-ft-auth] .ft-auth-brand-groups > span { color: #bccdeb; border-color: #35445e; background: rgb(255 255 255 / 4%); }
