@font-face {
  font-family: "OFR Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   DESIGN TOKENS — OrbitAI Studio v2
   基于 docs/design-system-v2.md 设计规范
   ========================================================================== */

:root {
  color-scheme: light;

  /* ---- 主色 Primary ---- */
  --color-primary: #514dc7;
  --color-primary-strong: #4338ca;
  --color-primary-soft: #f1f2f4;  /* 弱化色块感；仅做选中底/不起视觉冲击 */
  --color-primary-ring: rgba(99, 102, 241, 0.28);

  /* ---- 中性色 Neutral ---- */
  --neutral-900: #1f2328;  /* 标题、正文（强）——视觉方向 color-text */
  --neutral-700: #5b6472;  /* 正文（常规）、次级文字 */
  --neutral-500: #858e9d;  /* 弱化文字、placeholder */
  --neutral-300: #e5e7eb;  /* 默认分隔线 */
  --neutral-200: #eef0f3;  /* 柔和边框 ——视觉方向 §1 弱化中性 */
  --color-border: #eef0f3; /* 统一柔和边框 token（覆盖 hardcoded var(--color-border)） */
  --color-text: #1f2328;   /* alias for cross-language naming */

  /* ---- 状态色 Semantic ---- */
  --color-success: #15803d;
  --color-warning: #b45309;
  --color-danger: #dc2626;

  /* ---- Orbit accent palette（compat, smoke-test 强约束）
     v2 已将 Orbit 圆环 / dot 收敛为单一 indigo 主色，但保留 token 别名以维持
     baseline 兼容（smoke-test.mjs:359 强制要求存在 --orbit-lime）。
     值映射现有 Orbit accent：lime/cyan/pink/amber → 现有 v2 token，
     与 styles.css .orbit-dot-lime/cyan/pink 的 v2 重映射规则保持一致。 */
  --orbit-lime: var(--color-primary);

  /* ---- 表面体系 Surface ---- */
  --bg: #f4f5f7;           /* 页面背景——视觉方向 更平，弱化与 surface 断层 */
  --surface: #ffffff;      /* 卡片/弹窗/输入框 */
  --surface-2: #f1f3f6;    /* 次级容器、嵌入区 */
  --surface-3: #f1f2f4;    /* 选中底（与 primary-soft 对齐，避免色块） */

  /* ---- 阴影 Shadow：默认 none，hover/focus 才允许轻量 ---- */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;

  /* ---- 字号 Font Size (5档 + H1 = 28) ---- */
  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-xl: 28px;            /* H1，视觉方向硬约束：首屏 ≤ 32 */

  /* ---- 字重 Font Weight (3档) ---- */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;

  /* ---- 间距 Spacing（视觉方向 4 步进，section = 24） ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;          /* 卡片内 padding */
  --space-4: 24px;          /* section 上下间距 */
  --space-5: 32px;          /* hero → 主区分隔 */

  /* ---- 圆角 Border Radius（视觉方向 §1 4 档：6 / 10 / 16 / 999） ---- */
  --radius-xs: 6px;         /* chip、checkbox、tag */
  --radius-sm: 10px;        /* 按钮、输入框 */
  --radius-md: 10px;        /* 次级卡片、列表卡片 */
  --radius-lg: 16px;        /* 主卡片、面板、弹窗 */
  --radius-full: 999px;     /* pill、avatar */

  /* ---- 布局 Layout（视觉方向 1280 四列骨架） ---- */
  --sidebar-width: 264px;   /* ~20.6% of 1280 */
  --right-panel-width: 300px; /* ≤ 25% 上限 */
  --header-height: 56px;
  --composer-width: 860px;

  /* ---- 字体 Font Family ---- */
  --font-ui: "OFR Inter", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-ui-zh: "OFR Inter", Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

  font-family: var(--font-ui);
}

/* 中文优先字体 */
html[data-locale="zh"] {
  font-family: var(--font-ui-zh);
}

/* ==========================================================================
   BASE — Reset & Global Styles
   ========================================================================== */

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--neutral-900);
  letter-spacing: 0;
  overflow-x: hidden;
  font-family: inherit;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

#creditBalance,
.billing-summary strong,
.billing-balance-grid b,
.billing-usage-amount strong,
.topup-credits strong,
.topup-price strong {
  font-variant-numeric: tabular-nums;
}

button {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

a {
  color: inherit;
}

::selection {
  background: rgba(99, 102, 241, 0.16);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: var(--radius-full);
  background: rgba(100, 116, 139, 0.32);
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 85, 105, 0.44);
  background-clip: padding-box;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--header-height) minmax(0, 1fr);
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

body:not([data-product-page="studio"]) .app-shell {
  grid-template-columns: 1fr;
}

body:not([data-product-page="studio"]) .side-panel {
  display: none;
}

body:not([data-product-page="studio"]) .workspace {
  grid-column: 1 / -1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(132px, 1fr) auto minmax(132px, 1fr);
  align-items: center;
  gap: 14px;
  height: var(--header-height);
  width: 100%;
  max-width: 100vw;
  padding: 0 18px;
  border-bottom: 1px solid var(--color-border);
  background: rgba(250, 252, 255, 0.86);
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: none;
}

.product-nav {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.78);
  padding: 4px;
  box-shadow: none;
}

.product-nav button {
  min-height: 32px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--neutral-700);
  padding: 0 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.product-nav button:hover {
  background: var(--surface-2);
  color: var(--neutral-900);
}

.product-nav button.active {
  background: var(--neutral-900);
  color: #fff;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  min-width: 0;
  padding: 2px 0;
}

.brand span:last-child,
.workspace,
.side-panel,
.side-section,
.credit-panel,
.auth-panel,
.studio-layout,
.studio-panel,
.inspector,
.model-strip,
.model-command-card,
.model-picker-card,
.panel-heading > div {
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 132px;
  height: 35px;
  flex: 0 0 auto;
}

.header-context {
  display: grid;
  min-width: 0;
}

.header-context-card {
  display: inline-grid;
  grid-template-columns: 10px minmax(0, auto) auto;
  align-items: center;
  justify-self: start;
  gap: 9px;
  max-width: min(430px, 100%);
  min-height: 42px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--neutral-900);
  padding: 7px 10px;
  text-align: left;
}

.header-context-card:hover,
.account-chip:hover,
.header-billing-button:hover,
.new-chat-button:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--surface);
  box-shadow: none;
  transform: translateY(-1px);
}

.header-context-card span,
.account-chip span {
  min-width: 0;
}

.header-context-card small,
.account-chip small {
  display: block;
  overflow: hidden;
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-context-card strong,
.account-chip strong {
  display: block;
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-context-card em {
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-context-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 14%, transparent);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  min-width: 0;
}

.language-toggle {
  min-width: 42px;
  min-height: 34px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--neutral-700);
  padding: 0 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.language-toggle:hover {
  border-color: rgba(99, 102, 241, 0.32);
  color: var(--neutral-900);
}

.account-menu {
  position: relative;
  min-width: 0;
}

.header-billing-button,
.new-chat-button,
.account-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--neutral-900);
}

.header-billing-button {
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border-color: rgba(10, 16, 32, 0.9);
  background:
    linear-gradient(180deg, var(--neutral-900) 0%, var(--neutral-900) 100%);
  color: #fff;
  padding: 0 13px;
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.new-chat-button {
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
}

.side-panel > .new-chat-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  border-color: rgba(99, 102, 241, 0.28);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--neutral-900);
  padding: 0 12px;
  box-shadow: none;
}

.side-panel > .new-chat-button:hover {
  border-color: rgba(99, 102, 241, 0.46);
  background: var(--color-primary-soft);
}

.new-chat-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-billing-button:hover {
  background:
    linear-gradient(180deg, #182033 0%, var(--neutral-900) 100%);
  color: #fff;
}

.header-billing-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.header-billing-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.account-chip {
  gap: 9px;
  max-width: 176px;
  min-height: 38px;
  padding: 4px 11px 4px 5px;
  text-align: left;
  box-shadow: none;
}

.account-chip.guest {
  max-width: 132px;
}

.account-chip[aria-expanded="true"] {
  border-color: rgba(99, 102, 241, 0.34);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.1),
    0 14px 38px var(--color-border);
}

.account-chip-avatar,
.account-chip-image,
.account-chip-brand-logo {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-full);
}

.account-chip-avatar {
  display: grid;
  place-items: center;
  background: var(--color-primary);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.account-chip-image {
  object-fit: cover;
}

.account-chip-brand-logo {
  display: block;
  object-fit: contain;
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 60;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 28px));
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  padding: 16px;
  box-shadow: none;
  backdrop-filter: blur(18px) saturate(130%);
}

.account-menu-panel .credit-panel,
.account-menu-panel .auth-panel,
.account-menu-quick-links {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.account-menu-panel .credit-panel,
.account-menu-quick-links {
  padding-top: 12px;
  border-top: 1px solid var(--neutral-300);
}

.account-settings {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--neutral-300);
}

.account-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.account-legal-links a {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.account-legal-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.account-delete-control {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.account-delete-control summary {
  width: fit-content;
  color: var(--color-danger);
  cursor: pointer;
  font-weight: 600;
}

.account-delete-control p {
  margin: 9px 0;
  line-height: 1.5;
}

.account-delete-control label {
  display: grid;
  gap: 6px;
}

.account-delete-control input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.danger-action {
  min-height: 36px;
  margin-top: 8px;
  border: 1px solid rgba(180, 35, 24, 0.26);
  border-radius: var(--radius);
  background: rgba(220, 38, 38, 0.07);
  color: var(--color-danger);
  padding: 7px 11px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.danger-action:hover {
  background: rgba(220, 38, 38, 0.12);
}

.account-menu-panel .credit-panel strong {
  font-size: var(--fs-xl);
}

.side-panel {
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  border-right: 1px solid var(--color-border);
  background: var(--bg);  /* 与主区统一浅色背景，消除深浅割裂 */
  padding: 14px 10px;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: calc(100vh - var(--header-height));
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 12px 20px 18px;
}

.product-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.product-page:not(.product-page-studio) {
  width: min(1180px, 100%);
  margin: 0 auto;
  overflow-y: auto;
  padding: 4px 0 18px;
}

.product-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(255, 255, 255, 0) 42%),
    #fff;
  padding: 18px;
}

.product-page-head h1 {
  margin: 4px 0 0;
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1.08;
}

.product-page-head p {
  max-width: 680px;
  margin: 8px 0 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.product-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

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

.product-dashboard-grid span,
.product-empty-panel,
.product-card-surface,
.product-filter-panel,
.product-library-main {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

.product-dashboard-grid span {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.product-dashboard-grid strong {
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1;
}

.product-dashboard-grid small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.product-library-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.product-filter-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.product-library-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.product-toolbar {
  border-radius: var(--radius-md) 12px 0 0;
}

.product-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.product-model-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 10px;
  min-width: 0;
  min-height: 214px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--neutral-900);
  padding: 14px;
  text-align: left;
}

.product-model-card:hover,
.product-model-card.active {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--neutral-300));
  box-shadow: none;
  transform: translateY(-1px);
}

.product-model-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.product-pagination button {
  min-height: 34px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  padding: 0 12px;
}

.product-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.product-pagination span {
  min-width: 58px;
  text-align: center;
  font-weight: 600;
}

.product-pagination small {
  color: var(--neutral-700);
}

.model-picker-pagination {
  border-radius: 0;
}

.product-tabs {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  padding: 4px;
}

.product-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--neutral-700);
  padding: 0 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.product-tabs button.active {
  background: var(--neutral-900);
  color: #fff;
}

.product-card-surface {
  min-height: 0;
  padding: 14px;
}

.product-list-page,
.product-asset-grid {
  max-height: none;
  overflow: visible;
}

.product-asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.product-empty-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 24px;
}

.product-empty-panel strong {
  color: var(--neutral-900);
  font-size: var(--fs-md);
}

.product-empty-panel p {
  margin: 0;
  color: var(--neutral-700);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(100%, 920px);
  margin: 0 auto;
  color: #5f697a;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 9px;
  box-shadow: none;
}

.trust-strip b {
  color: var(--neutral-900);
}

.credit-panel,
.auth-panel,
.side-section,
.studio-panel,
.inspector,
.model-picker-card {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.side-section {
  border: 0;
  background: transparent;
  padding: 6px 4px;
}

.credit-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.small-action {
  min-height: 34px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.small-action.primary {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
  color: #fff;
}

.small-action:hover {
  border-color: rgba(99, 102, 241, 0.28);
  background: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.small-action.primary:hover {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
}

.small-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.credit-panel strong {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-xl);
  line-height: 1;
}

.credit-panel.locked strong {
  color: var(--neutral-500);
}

.credit-panel.locked meter {
  opacity: 0.45;
}

.credit-panel small,
.section-heading small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

meter {
  width: 100%;
  height: 10px;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: var(--radius-full);
  background: #e6eaf0;
}

meter::-webkit-meter-optimum-value {
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-strong));
}

.auth-panel,
.billing-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.billing-panel {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow: none;
}

.billing-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 8px;
}

.billing-summary span,
.billing-balance-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
}

.billing-summary small,
.billing-balance-grid small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.billing-summary strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-md);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.billing-balance-grid b {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-warning {
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: var(--radius);
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  padding: 9px;
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.billing-feedback {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  margin: 16px 18px 0;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  padding: 10px 11px;
}

.billing-feedback.success {
  border-color: rgba(15, 122, 59, 0.24);
  background: rgba(22, 163, 74, 0.08);
  color: #08632e;
}

.billing-feedback.info {
  border-color: rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.1);
  color: #174ea6;
}

.billing-feedback.warning {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.billing-feedback.error {
  border-color: rgba(180, 35, 24, 0.24);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.billing-feedback-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.billing-feedback-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.billing-feedback-copy strong {
  color: currentColor;
  font-size: var(--fs-sm);
}

.billing-feedback-copy small {
  color: currentColor;
  font-size: var(--fs-xs);
  line-height: 1.45;
  opacity: 0.82;
  overflow-wrap: anywhere;
}

.billing-feedback-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: currentColor;
  font-size: var(--fs-lg);
  line-height: 1;
  opacity: 0.68;
}

.billing-feedback-close:hover {
  background: var(--color-border);
  opacity: 1;
}

.billing-subscription-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--neutral-300);
  border-bottom: 1px solid var(--neutral-300);
  padding: 11px 0;
}

.billing-subscription-control > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.billing-subscription-control small,
.billing-subscription-control em {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-style: normal;
}

.billing-subscription-control strong {
  color: var(--color-success);
  font-size: var(--fs-sm);
}

.billing-subscription-control.past_due strong {
  color: var(--color-warning);
}

.billing-subscription-control.canceled strong,
.billing-subscription-control.expired strong {
  color: var(--neutral-700);
}

.billing-group {
  display: grid;
  gap: 8px;
}

.billing-group > strong {
  font-size: var(--fs-xs);
  color: var(--neutral-900);
}

.billing-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: var(--surface-2);
}

.billing-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.billing-tabs button.active {
  background: var(--neutral-900);
  color: #fff;
  box-shadow: none;
}

.plan-grid {
  gap: 10px;
}

.plan-card {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px;
  color: var(--neutral-900);
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.plan-card:hover {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: none;
  transform: translateY(-1px);
}

.plan-card.current {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--neutral-300));
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-card-head strong {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.plan-card-head em {
  border-radius: var(--radius-full);
  background: rgba(20, 184, 166, 0.11);
  color: var(--color-primary-strong);
  padding: 4px 7px;
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-price del {
  color: var(--neutral-500);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration-thickness: 1px;
}

.plan-price b {
  font-size: var(--fs-xl);
  letter-spacing: 0;
}

.plan-price small,
.plan-facts small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.plan-facts {
  display: grid;
  gap: 4px;
}

.plan-facts b {
  color: var(--neutral-900);
  font-weight: 600;
}

.plan-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: var(--radius-full);
  background: var(--neutral-900);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.billing-note {
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: var(--radius-md);
  background: rgba(20, 184, 166, 0.08);
  color: #0f5f5b;
  padding: 9px 10px;
  font-size: var(--fs-xs);
  line-height: 1.45;
}

.billing-item,
.billing-order {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  text-align: left;
}

.billing-item:hover {
  border-color: rgba(37, 99, 235, 0.38);
  background: #f3f7ff;
}

.billing-item span,
.billing-order span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.billing-item strong,
.billing-order span {
  font-size: var(--fs-sm);
  color: var(--neutral-900);
}

.billing-item small,
.billing-order small,
.billing-empty {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.billing-item em,
.billing-order em {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.billing-usage-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid var(--neutral-300);
  padding-top: 12px;
}

.billing-usage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.billing-usage-head > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.billing-usage-head strong {
  color: var(--neutral-900);
  font-size: var(--fs-xs);
}

.billing-usage-head small,
.billing-usage-copy small,
.billing-usage-amount small,
.billing-usage-empty small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.billing-usage-refresh {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.billing-usage-list {
  display: grid;
  max-height: 390px;
  min-width: 0;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
  scrollbar-gutter: stable;
}

.billing-usage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 2px;
  border-bottom: 1px solid var(--color-border);
}

.billing-usage-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.billing-usage-copy > span {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.billing-usage-copy strong,
.billing-usage-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-usage-copy strong {
  color: var(--neutral-900);
  font-size: var(--fs-xs);
}

.billing-usage-status {
  flex: 0 0 auto;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 600;
}

.billing-usage-status.completed { color: #067647; }
.billing-usage-status.included { color: #175cd3; }
.billing-usage-status.pending { color: #b54708; }
.billing-usage-status.released { color: var(--neutral-700); }

.billing-usage-amount {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 64px;
}

.billing-usage-amount strong {
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.billing-usage-amount.debit strong {
  color: var(--color-danger);
}

.billing-usage-empty {
  display: grid;
  gap: 3px;
  padding: 18px 2px;
}

.billing-usage-empty strong {
  color: var(--neutral-900);
  font-size: var(--fs-xs);
}

.topup-grid {
  display: grid;
  gap: 10px;
}

.topup-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  width: 100%;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(255, 255, 255, 0) 48%),
    #fff;
  padding: 14px;
  color: inherit;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.topup-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 38%, var(--neutral-300));
  box-shadow: none;
  transform: translateY(-1px);
}

.topup-card:disabled,
.topup-card.locked {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.topup-card:disabled:hover,
.topup-card.locked:hover {
  border-color: var(--neutral-300);
  box-shadow: none;
}

.topup-card:disabled .topup-action,
.topup-card.locked .topup-action {
  background: #e5e7eb;
  color: #475569;
}

.topup-credits,
.topup-price {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.topup-credits strong {
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  line-height: 1;
}

.topup-price {
  justify-items: end;
}

.topup-price b {
  color: var(--neutral-900);
  font-size: var(--fs-base);
}

.topup-credits small,
.topup-price small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.topup-action {
  grid-column: 1 / -1;
  display: inline-flex;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--neutral-900);
  padding: 8px 10px;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.billing-dialog {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 24px;
}

.billing-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
}

.billing-sheet {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: none;
}

.billing-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--neutral-300);
  padding: 20px;
}

.billing-dialog-head h2 {
  margin: 4px 0 0;
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1.1;
}

.billing-dialog-head p {
  margin: 8px 0 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.billing-dialog-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.45fr);
  gap: 18px;
  padding: 18px;
}

.billing-account-summary,
.billing-purchase-area {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.billing-account-summary,
.billing-purchase-area,
.billing-loading-state {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 16px;
}

.billing-account-summary {
  background:
    linear-gradient(180deg, var(--surface-2), #fff);
}

.billing-loading-state {
  margin: 18px;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.billing-dialog .billing-summary {
  grid-template-columns: 1fr;
}

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

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

.billing-plan-grid > strong,
.billing-plan-grid .billing-empty {
  grid-column: 1 / -1;
}

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

.billing-dialog .topup-card {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.billing-dialog .topup-price {
  justify-items: start;
}

.product-page-billing .billing-sheet {
  width: 100%;
  max-height: none;
  overflow: visible;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.product-page-billing .billing-dialog-head {
  display: none;
}

.product-page-billing .billing-dialog-layout {
  padding: 0;
}

.product-page-billing .billing-feedback {
  margin: 0;
}

.product-page-billing .billing-loading-state {
  margin: 0;
}
  .checkout-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.checkout-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.checkout-sheet {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(920px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: none;
}

.checkout-head,
.checkout-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
}

.checkout-head {
  border-bottom: 1px solid var(--neutral-300);
}

.checkout-head h2 {
  margin-top: 4px;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  padding: 0 18px;
}

.checkout-summary-card,
.checkout-payment-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 16px;
}

.checkout-summary-card {
  background:
    linear-gradient(180deg, var(--surface-2), #fff);
}

.checkout-summary-card > strong {
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  line-height: 1.15;
}

.checkout-price-row {
  display: grid;
  gap: 4px;
}

.checkout-price-row span {
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1;
}

.checkout-price-row small,
.checkout-summary-card p,
.card-entry-preview small {
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.checkout-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.checkout-facts span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
}

.checkout-facts small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.checkout-facts b {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-methods {
  display: grid;
  gap: 8px;
}

.payment-method {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 11px;
  color: var(--neutral-900);
  text-align: left;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.payment-method.active {
  border-color: color-mix(in srgb, var(--color-primary) 52%, var(--neutral-300));
  background: color-mix(in srgb, var(--color-primary) 8%, #fff);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.payment-method:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: none;
  transform: translateY(-1px);
}

.payment-method span:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.payment-method strong {
  font-size: var(--fs-sm);
}

.payment-method small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.payment-method em {
  border-radius: var(--radius-full);
  background: var(--surface-2);
  padding: 5px 8px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.payment-method.active em {
  background: #fff;
  color: var(--color-primary);
}

.payment-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--neutral-900);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.card-entry-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 14px;
}

.card-preview-head,
.card-brand-row,
.wallet-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-preview-head span {
  color: var(--color-success);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.card-brand-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.card-brand-row span {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: #fff;
  padding: 5px 8px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.card-network-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-network-button {
  display: grid;
  gap: 3px;
  min-height: 56px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  color: var(--neutral-900);
  text-align: left;
}

.card-network-button.active {
  border-color: color-mix(in srgb, var(--color-primary) 48%, var(--neutral-300));
  background: color-mix(in srgb, var(--color-primary) 7%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.card-network-button strong,
.wallet-preview strong,
.card-entry-form-preview b {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-network-button small,
.wallet-preview small,
.card-entry-form-preview small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.card-entry-form-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.46fr);
  gap: 8px;
}

.card-entry-form-preview span {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
}

.card-entry-form-preview span:first-child,
.card-entry-form-preview span:last-child {
  grid-column: 1 / -1;
}

.wallet-preview {
  justify-content: flex-start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 12px;
}

.wallet-icon-large {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: var(--radius-md);
  background: var(--neutral-900);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.card-field-preview {
  min-height: 48px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 13px;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.checkout-footer {
  border-top: 1px solid var(--neutral-300);
  background: var(--surface-2);
}

.checkout-steps {
  display: grid;
  gap: 8px;
}

.checkout-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.checkout-steps b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: var(--radius-full);
  background: var(--neutral-900);
  color: #fff;
  font-size: var(--fs-xs);
}

.checkout-security-note {
  margin-right: auto;
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.auth-panel form {
  display: grid;
  gap: 10px;
}

.auth-panel label,
.option-row label,
.prompt-box {
  display: grid;
  gap: 6px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.prompt-box {
  position: relative;
  gap: 0;
}

.prompt-box > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.auth-panel input {
  width: 100%;
}

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

.auth-actions button,
.link-button {
  min-height: 38px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--neutral-900);
  font-weight: 600;
}

.auth-actions button:first-child {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
  color: #fff;
}

.link-button {
  width: 100%;
}

.auth-user {
  display: grid;
  gap: 10px;
}

.auth-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.google-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--neutral-900);
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
}

.google-button:hover,
.quick-prompts button:hover,
.icon-button:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.google-button svg {
  flex-shrink: 0;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--neutral-300);
}

.auth-error {
  color: var(--color-danger);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.side-section {
  display: grid;
  gap: 10px;
  padding: 8px 4px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading small {
  overflow: hidden;
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-action {
  min-height: 30px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--neutral-900);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.section-action:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.task-section {
  gap: 8px;
}

.task-nav {
  display: grid;
  gap: 7px;
}

.task-nav-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--neutral-900);
  padding: 7px 8px;
  text-align: left;
}

.task-nav-button:hover,
.task-nav-button.active {
  border-color: rgba(99, 102, 241, 0.22);
  background: #fff;
  box-shadow: none;
}

.task-nav-button.active {
  box-shadow:
    inset 3px 0 0 var(--color-primary),
    0 10px 24px rgba(99, 102, 241, 0.1);
}

.task-nav-button strong,
.asset-row span {
  display: block;
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-nav-button small,
.asset-row strong {
  display: block;
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-nav-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--color-primary-strong);
}

.task-nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: #fff;
  padding: 7px 9px;
  text-align: left;
}

.asset-row:hover {
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: none;
}

.asset-row strong {
  flex: 0 0 auto;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 3px 7px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.eyebrow {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-list {
  display: grid;
  gap: 12px;
  max-height: min(620px, calc(100vh - 170px));
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.model-nav-group {
  display: grid;
  gap: 7px;
}

.model-nav-group-label {
  padding: 0 4px;
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-nav-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.54);
  color: var(--neutral-900);
  padding: 7px 9px;
  text-align: left;
  isolation: isolate;
  box-shadow: none;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.model-nav-button.active {
  border-color: color-mix(in srgb, var(--color-primary) 28%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 8%, #fff) 0%, #fff 100%);
  box-shadow:
    inset 2px 0 0 var(--color-primary),
    0 12px 30px rgba(99, 102, 241, 0.09);
}

.model-nav-button:hover {
  border-color: rgba(99, 102, 241, 0.2);
  background: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.model-logo {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  box-shadow: none;
}

.model-logo svg {
  width: 17px;
  height: 17px;
  overflow: visible;
}

.model-logo-openai {
  background: var(--surface-2);
  color: var(--neutral-900);
}

.model-logo-anthropic {
  background: #f6f0ec;
  color: #191919;
}

.model-logo-gemini {
  background: #f1effb;
  color: #765fc5;
}

.model-logo-deepseek {
  background: #edf3ff;
  color: #4778ef;
}

.model-logo-qwen {
  background: #f1efff;
  color: #6950ef;
}

.model-logo-minimax {
  background: #fff0f4;
  color: #e73562;
}

.model-logo-glm {
  background: #edf8f8;
  color: #087f82;
}

.model-logo-kimi {
  background: #f1f3f7;
  color: #101828;
}

.model-logo-image {
  background: #fff0f5;
  color: #c2416b;
}

.model-logo-video {
  background: #f0f0ff;
  color: #5b5bd6;
}

.model-logo-bytedance {
  background: #eef6ff;
  color: #3c8cff;
}

.model-logo-xai {
  background: var(--surface-2);
  color: #050505;
}

.model-nav-button.active .model-logo {
  border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
  box-shadow: none;
}

.model-name {
  display: block;
  overflow: hidden;
  color: var(--neutral-900);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.model-kind {
  display: block;
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-strip {
  display: grid;
  min-width: 0;
  width: 100%;
}

.model-command-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 11px 12px;
  box-shadow: none;
}

.model-command-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.model-command-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.model-command-main h2 {
  margin: 0;
  color: var(--neutral-900);
  font-size: var(--fs-md);
  line-height: 1.16;
}

.model-command-main p {
  margin: 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.model-command-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.model-command-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow: hidden;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: #fff;
  padding: 4px 8px;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-command-meta small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-command-meta span.live {
  border-color: rgba(22, 163, 74, 0.18);
  background: var(--color-success);
  color: var(--color-success);
}

.model-command-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.model-command-actions .primary-button,
.model-command-actions .small-action {
  min-height: 36px;
  white-space: nowrap;
}

.model-picker-dialog,
.workspace-hub-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}

.model-picker-backdrop,
.workspace-hub-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(10px);
}

.model-picker-sheet,
.workspace-hub-sheet {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, 100%);
  max-height: min(840px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: none;
}

.model-picker-head,
.workspace-hub-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--neutral-300);
  padding: 20px;
}

.model-picker-head h2,
.workspace-hub-head h2 {
  margin: 4px 0 0;
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1.1;
}

.model-picker-head p,
.workspace-hub-head p {
  margin: 8px 0 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.workspace-hub-sheet {
  width: min(920px, 100%);
}

.workspace-hub-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
}

.workspace-hub-tabs {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border-right: 1px solid var(--neutral-300);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 100%);
  padding: 16px;
}

.workspace-hub-tabs button {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--neutral-700);
  padding: 10px;
  text-align: left;
}

.workspace-hub-tabs button strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
}

.workspace-hub-tabs button small {
  font-size: var(--fs-xs);
  font-weight: 600;
}

.workspace-hub-tabs button.active {
  border-color: color-mix(in srgb, var(--color-primary) 42%, var(--neutral-300));
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.workspace-hub-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  min-height: 0;
  padding: 18px;
}

.workspace-hub-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.workspace-hub-section-head h3 {
  margin: 4px 0;
  color: var(--neutral-900);
  font-size: var(--fs-md);
}

.workspace-hub-section-head p {
  max-width: 520px;
  margin: 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.workspace-asset-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
}

.workspace-asset-toolbar span {
  display: grid;
  gap: 2px;
  min-width: 92px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px 10px;
}

.workspace-asset-toolbar strong {
  color: var(--neutral-900);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
}

.workspace-asset-toolbar small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.workspace-hub-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.history-collection {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.history-search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.history-search-toolbar > small {
  flex: 0 0 auto;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.history-search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  width: min(460px, 100%);
}

.history-search-field > svg {
  position: absolute;
  left: 12px;
  z-index: 1;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--neutral-700);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.history-search-field input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  padding: 0 44px 0 38px;
  font-size: var(--fs-sm);
}

.history-search-field input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.16);
  border-color: var(--color-primary);
}

.history-search-clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--neutral-700);
}

.history-search-clear:hover {
  background: var(--surface-2);
  color: var(--neutral-900);
}

.history-search-clear svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.workspace-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.workspace-asset-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 9px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  padding: 9px;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.workspace-asset-card:hover {
  border-color: rgba(99, 102, 241, 0.26);
  box-shadow: none;
  transform: translateY(-1px);
}

.workspace-asset-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 0;
}

.workspace-asset-preview:disabled {
  cursor: default;
}

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

.workspace-asset-preview video {
  display: block;
  background: var(--neutral-900);
  pointer-events: none;
}

.workspace-asset-card[data-media-kind="video"] .workspace-asset-preview {
  background: var(--neutral-900);
}

.workspace-asset-card[data-media-kind="video"] .workspace-asset-preview video {
  object-fit: contain;
}

.workspace-asset-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.workspace-video-placeholder {
  align-content: center;
  gap: 10px;
  background: var(--neutral-900);
  color: var(--surface-2);
}

.workspace-video-placeholder i {
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 600;
}

.workspace-video-placeholder .model-logo {
  color: var(--surface-2);
}

.collection-load-more {
  display: flex;
  justify-content: center;
  padding: 18px 0 4px;
}

.collection-load-more .section-action {
  min-width: 180px;
}

.workspace-asset-logo {
  width: 38px;
  height: 38px;
}

.workspace-asset-copy,
.workspace-asset-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workspace-asset-copy strong,
.workspace-asset-copy small,
.workspace-asset-meta small,
.workspace-asset-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-asset-copy strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.workspace-asset-copy small {
  display: -webkit-box;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.workspace-asset-meta {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.workspace-asset-meta small {
  white-space: nowrap;
}

.workspace-asset-meta b {
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 3px 6px;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.workspace-asset-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.workspace-asset-actions button {
  min-height: 30px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--neutral-900);
  padding: 4px 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.workspace-asset-actions button:hover {
  border-color: rgba(99, 102, 241, 0.24);
  background: #fff;
}

.workspace-asset-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.workspace-hub-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  padding: 6px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.workspace-hub-row:hover {
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: none;
  transform: translateY(-1px);
}

.workspace-hub-row-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: inherit;
  padding: 5px 6px;
  text-align: left;
}

.workspace-hub-row .task-kind-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
}

.workspace-hub-row .task-kind-icon.kind-chat {
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-indigo);
}

.workspace-hub-row .task-kind-icon.kind-code {
  border-color: rgba(20, 184, 166, 0.22);
  background: rgba(20, 184, 166, 0.1);
  color: #0f766e;
}

.workspace-hub-row .task-kind-icon.kind-image {
  border-color: rgba(245, 158, 11, 0.24);
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
}

.workspace-hub-row .task-kind-icon.kind-video {
  border-color: rgba(244, 63, 94, 0.22);
  background: rgba(244, 63, 94, 0.1);
  color: #e11d48;
}

.workspace-hub-row-tags {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workspace-hub-kind-tag {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--neutral-700);
}

.workspace-hub-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
}

.workspace-hub-status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.workspace-hub-status-badge.running {
  color: var(--brand-indigo);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.24);
}

.workspace-hub-status-badge.done {
  color: var(--color-success);
  background: rgba(21, 128, 61, 0.1);
  border-color: rgba(21, 128, 61, 0.22);
}

.workspace-hub-status-badge.failed {
  color: var(--color-danger);
  background: rgba(220, 38, 38, 0.09);
  border-color: rgba(220, 38, 38, 0.22);
}

.workspace-hub-row-open:focus-visible,
.workspace-hub-row-actions button:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.28);
  outline-offset: 1px;
}

.workspace-hub-row-copy,
.workspace-hub-row-side {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workspace-hub-row strong,
.workspace-hub-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-hub-row strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
}

.workspace-hub-row small,
.workspace-hub-row-side b {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.workspace-hub-row-side {
  justify-items: end;
  max-width: 160px;
}

.workspace-hub-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workspace-hub-row-actions button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--neutral-700);
}

.workspace-hub-row-actions button:hover {
  border-color: var(--neutral-300);
  background: var(--surface-2);
  color: var(--neutral-900);
}

.workspace-hub-row-actions button.danger:hover {
  border-color: rgba(185, 28, 28, 0.2);
  background: var(--color-danger);
  color: #fff;
}

.workspace-hub-row-actions svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-action-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.conversation-action-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(8px);
}

.conversation-action-sheet {
  position: relative;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: none;
}

.conversation-action-sheet > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--neutral-300);
  padding: 18px 20px;
}

.conversation-action-sheet h2 {
  margin: 4px 0 0;
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  line-height: 1.2;
}

.conversation-action-sheet form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.conversation-title-field,
.conversation-delete-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.conversation-title-field > span {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.conversation-title-field input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  padding: 0 12px;
  font-size: var(--fs-sm);
}

.conversation-title-field input:focus {
  outline: 2px solid rgba(99, 102, 241, 0.16);
  border-color: var(--color-primary);
}

.conversation-title-field small,
.conversation-delete-copy p {
  margin: 0;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.conversation-delete-copy strong {
  overflow-wrap: anywhere;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
}

.conversation-action-error {
  margin: 0;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  padding: 10px 12px;
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.conversation-action-sheet footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.conversation-action-sheet footer button {
  min-width: 92px;
  min-height: 40px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.conversation-action-sheet .secondary-button {
  border: 1px solid var(--neutral-300);
  background: #fff;
  color: var(--neutral-900);
}

.conversation-action-sheet .danger-button {
  border: 1px solid var(--color-danger);
  background: var(--color-danger);
  color: #fff;
}

.conversation-action-sheet button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.workspace-hub-empty {
  border: 1px dashed var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--neutral-700);
  padding: 22px;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.workspace-hub-empty.warning {
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.model-picker-layout {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 0;
}

.model-picker-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  border-right: 1px solid var(--neutral-300);
  background:
    linear-gradient(180deg, var(--surface-2) 0%, var(--surface-2) 100%);
  padding: 16px;
}

.model-filter {
  display: grid;
  gap: 8px;
}

.model-filter button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--neutral-700);
  padding: 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: left;
}

.model-filter button span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.model-filter button strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-filter button small {
  color: var(--neutral-700);
  overflow: hidden;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-filter button.active {
  border-color: color-mix(in srgb, var(--color-primary) 42%, var(--neutral-300));
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.model-filter button:hover {
  border-color: rgba(99, 102, 241, 0.24);
  box-shadow: none;
  transform: translateY(-1px);
}

.model-filter b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.model-filter button.active b {
  background: var(--color-primary);
  color: #fff;
}

.model-picker-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}

.model-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-bottom: 1px solid var(--neutral-300);
  padding: 14px 16px;
}

.model-picker-toolbar label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-picker-toolbar input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  padding: 8px 10px;
  color: var(--neutral-900);
}

.model-picker-count {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.model-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(228px, auto);
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
}

.model-picker-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  gap: 10px;
  min-height: 228px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 14px;
  color: var(--neutral-900);
  text-align: left;
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.model-picker-card.active {
  border-color: color-mix(in srgb, var(--color-primary) 55%, transparent);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--color-primary) 14%, transparent),
    0 16px 38px var(--color-border);
}

.model-picker-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--neutral-300));
  transform: translateY(-1px);
  box-shadow: none;
}

.model-picker-card p {
  min-height: calc(var(--fs-sm) * 1.42 * 2);
  margin: 0;
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.model-picker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-picker-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--neutral-700);
  padding: 4px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-picker-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

.model-picker-facts span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 9px;
}

.model-picker-facts small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-picker-facts strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-picker-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--neutral-300);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 18px;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.empty-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.model-logo-tile {
  width: 38px;
  height: 38px;
}

.model-logo-tile svg {
  width: 21px;
  height: 21px;
}

.model-logo-empty {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
}

.model-logo-empty svg {
  width: 25px;
  height: 25px;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: min(100%, 1240px);
  margin: 0 auto;
}

.studio-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 4px 4px 10px;
  border-bottom: 0;
  background: transparent;
}

.selected-model-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.selected-model-title > div {
  min-width: 0;
}

.selected-model-logo {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.model-logo-current {
  width: 40px;
  height: 40px;
}

.model-logo-current svg {
  width: 22px;
  height: 22px;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: min(500px, 54%);
}

.provider-model-control {
  display: grid;
  gap: 4px;
  width: min(320px, 38vw);
  min-width: 220px;
}

.provider-model-control span {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.provider-model-control select {
  width: 100%;
  height: 36px;
  border-color: rgba(10, 16, 32, 0.12);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: none;
}

.provider-model-control small {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.provider-model-control small span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-model-control small b {
  color: var(--neutral-900);
  font-weight: 600;
}

.provider-model-logo {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.provider-model-logo svg {
  width: 12px;
  height: 12px;
}

.provider-kind-badge {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--neutral-900);
  padding: 2px 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h2 {
  margin-top: 3px;
  font-size: var(--fs-lg);
  line-height: 1.15;
  letter-spacing: 0.005em;
}

h3 {
  color: var(--neutral-900);
  font-size: var(--fs-md);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.status-pill,
.cost-chip,
.mode-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: var(--radius-full);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--neutral-900);
  color: #fff;
  white-space: nowrap;
}

.status-pill.live,
.mode-chip.live {
  background: var(--color-success);
  color: #fff;
}

.status-pill.demo,
.mode-chip {
  background: #fff7ed;
  color: var(--color-warning);
}

.cost-chip {
  border: 1px solid color-mix(in srgb, var(--color-primary) 20%, transparent);
  background: color-mix(in srgb, var(--color-primary) 10%, #fff);
  color: color-mix(in srgb, var(--color-primary) 80%, var(--neutral-900));
}

.output-feed {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 0;
  min-width: 0;
  width: min(100%, 1120px);
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 4px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  background: transparent;
  scroll-behavior: auto;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 15px;
  align-content: center;
  min-height: 320px;
  color: var(--neutral-700);
  text-align: center;
}

.home-empty-state {
  justify-items: stretch;
  align-content: start;
  gap: 14px;
  width: min(100%, 1120px);
  min-height: 430px;
  margin: 0 auto;
  color: var(--neutral-900);
  text-align: left;
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 26px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 4px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-command-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(400px, 0.95fr);
  gap: 18px;
  align-items: stretch;
  width: 100%;
}

.home-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 2px;
}

.home-copy h1 {
  margin: 0;
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 560px;
}

.home-copy p {
  max-width: 560px;
  color: var(--neutral-700);
  font-size: var(--fs-base);
  line-height: 1.58;
}

.home-trust-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-trust-signals span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  border-radius: var(--radius-full);
  background: rgba(238, 247, 245, 0.86);
  color: var(--color-primary-strong);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.home-primary-action,
.home-secondary-action {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  padding: 0 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.home-primary-action {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
  color: #fff;
  box-shadow: none;
}

.home-secondary-action {
  background: #fff;
  color: var(--neutral-900);
}

.home-primary-action:hover,
.home-secondary-action:hover,
.home-capability:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 2px var(--color-border);
}

.home-signal-panel {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 12px;
  box-shadow: none;
}

.home-signal-head {
  display: grid;
  gap: 4px;
  min-width: 0;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
}

.home-signal-head strong {
  color: var(--neutral-900);
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.16;
}

.home-signal-head small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.45;
}

.home-route-board {
  display: grid;
  gap: 7px;
}

.home-route-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 7px 8px;
}

.home-route-row > b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--neutral-900);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-route-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-route-row strong,
.home-route-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-route-row strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.home-route-row small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.home-brand-cloud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 6px 8px;
}

.home-brand-pill small {
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-brand-logo {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.home-brand-logo svg {
  width: 15px;
  height: 15px;
}

.home-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-border);
}

.home-kind-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.home-kind-status {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 8px;
}

.home-kind-status > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-kind-status strong,
.home-kind-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-kind-status strong {
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-kind-status small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-kind-logo {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.home-kind-logo svg {
  width: 14px;
  height: 14px;
}

.home-metric {
  display: grid;
  gap: 3px;
  min-width: 0;
  background: #fff;
  padding: 7px;
}

.home-metric strong {
  color: var(--neutral-900);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1;
}

.home-metric small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.25;
}

.home-runtime-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-runtime-line span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-full);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 4px 9px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.home-capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
}

.home-capability {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  min-height: 168px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  padding: 12px;
  text-align: left;
}

.home-capability-icon {
  display: flex;
}

.home-capability-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
}

.home-capability-logo svg {
  width: 18px;
  height: 18px;
}

.home-capability span:nth-child(2) {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.home-capability strong {
  font-size: var(--fs-base);
  font-weight: 600;
}

.home-capability small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.55;
  overflow: hidden;
}

.home-capability b {
  color: var(--color-primary-strong);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-empty-state {
  justify-items: center;
  align-content: center;
  min-height: 360px;
  text-align: left;
}

.model-empty-card {
  display: grid;
  gap: 16px;
  width: min(620px, 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 22px;
  box-shadow: none;
}

.model-empty-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.model-empty-logo {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  box-shadow: none;
}

.model-empty-logo svg {
  width: 25px;
  height: 25px;
}

.model-empty-main h3 {
  margin: 4px 0 0;
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1.12;
}

.model-empty-main p {
  max-width: 520px;
  margin: 8px 0 0;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.model-empty-chips,
.model-empty-profile {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.model-empty-chips span,
.model-empty-profile span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--neutral-700);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-empty-chips span:first-child {
  border-color: color-mix(in srgb, var(--color-primary) 26%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 9%, #fff);
  color: color-mix(in srgb, var(--color-primary) 78%, var(--neutral-900));
}

.model-empty-action {
  justify-self: start;
}

.empty-state p {
  max-width: 500px;
  color: var(--neutral-700);
  line-height: 1.58;
}

.task-preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(760px, 100%);
  margin-top: 2px;
}

.task-preset-button {
  display: grid;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--neutral-900);
  padding: 12px;
  text-align: left;
}

.task-preset-button:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: none;
  transform: translateY(-1px);
}

.task-preset-button strong {
  font-size: var(--fs-sm);
  font-weight: 600;
}

.task-preset-button small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.proof-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.proof-strip span,
.current-mode-summary {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--neutral-700);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.current-mode-summary {
  gap: 7px;
  max-width: min(100%, 560px);
}

.current-mode-summary .model-logo-empty {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.current-mode-summary .model-logo-empty svg {
  width: 13px;
  height: 13px;
}

.model-profile-panel {
  display: grid;
  gap: 12px;
  width: min(620px, 100%);
  margin-top: 4px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
  padding: 14px;
  box-shadow: none;
}

.model-profile-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.model-profile-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--neutral-700);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.model-profile-metric {
  display: grid;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 10px;
  text-align: left;
}

.model-profile-metric small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.model-profile-metric strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.message {
  display: grid;
  gap: 10px;
  max-width: min(980px, 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: 15px;
  box-shadow: none;
}

.message.user {
  margin-left: auto;
  border-color: rgba(99, 102, 241, 0.16);
  background:
    linear-gradient(180deg, #eff6ff 0%, #f7fbff 100%);
}

.message-content {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: inherit;
  font-size: var(--fs-base);
  line-height: 1.7;
  letter-spacing: 0;
}

.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }

.message-content p,
.message-content ul,
.message-content ol,
.message-content pre,
.message-content h2,
.message-content h3,
.message-content h4 {
  margin: 0 0 12px;
}

.message-content h2,
.message-content h3,
.message-content h4 {
  color: var(--neutral-900);
  font-size: var(--fs-base);
  line-height: 1.45;
}

.message-content ul,
.message-content ol {
  padding-left: 22px;
}

.message-content li + li {
  margin-top: 5px;
}

.message-content pre {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #f6f8fb;
  padding: 12px 14px;
  color: #1f2937;
  font: 13px/1.6 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  tab-size: 2;
  white-space: pre;
}

.message-author {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

body:not(.image-mode):not(.video-mode) .output-feed {
  width: min(100%, 920px);
  gap: 4px;
  padding-inline: 12px;
}

body:not(.image-mode):not(.video-mode) .message {
  width: min(100%, 780px);
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 4px;
  box-shadow: none;
  content-visibility: auto;
  contain-intrinsic-size: auto 140px;
}

body:not(.image-mode):not(.video-mode) .message.user {
  width: auto;
  max-width: min(680px, 88%);
  margin: 8px 0 8px auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 11px 14px;
}

body:not(.image-mode):not(.video-mode) .message.assistant {
  margin-right: auto;
}

body:not(.image-mode):not(.video-mode) .message.assistant .message-content {
  color: #202939;
}

body:not(.image-mode):not(.video-mode) .chat-thinking-message {
  width: min(320px, 100%);
  min-height: 54px;
  border: 0;
  background: transparent;
  padding: 12px 4px;
}

body:not(.image-mode):not(.video-mode) .chat-thinking-message .thinking-body {
  grid-template-columns: 20px minmax(0, 1fr);
}

.message-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.message-copy-button {
  min-height: 28px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  color: var(--neutral-900);
  padding: 4px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.message-copy-button:hover {
  border-color: rgba(99, 102, 241, 0.32);
  background: #fff;
  box-shadow: none;
}

.thinking-message {
  border-color: rgba(99, 102, 241, 0.18);
  background:
    linear-gradient(180deg, #f5f9ff 0%, var(--surface) 100%);
}

.request-pending-message {
  width: min(440px, 100%);
  min-height: 58px;
  gap: 0;
  border-color: var(--color-border);
  background: var(--surface-2);
  padding: 10px 12px;
  box-shadow: none;
}

.request-pending-message .thinking-body {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 11px;
}

.thinking-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.thinking-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.thinking-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thinking-elapsed {
  min-width: 28px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.thinking-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--neutral-700);
}

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

.thinking-body strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
}

.thinking-body small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

.thinking-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(99, 102, 241, 0.18);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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

.provider-chip {
  display: inline-flex;
  align-items: center;
  max-width: 220px;
  min-height: 24px;
  border-radius: var(--radius-full);
  padding: 4px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-primary-soft);
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.billing-note {
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 7px 9px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
}

.generated-media {
  width: min(100%, 620px);
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: none;
}

img.generated-media {
  cursor: zoom-in;
}

img.generated-media:focus {
  outline: 3px solid rgba(99, 102, 241, 0.22);
  outline-offset: 3px;
}

.image-composer-heading {
  display: none;
}

body.image-mode .workspace {
  padding-right: 18px;
  padding-left: 18px;
}

body.image-mode .studio-layout {
  max-width: 1480px;
}

body.image-mode .studio-panel {
  grid-template-columns: 350px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 18px;
}

body.image-mode .panel-heading {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  max-width: none;
  padding: 4px 2px 12px;
}

body.image-mode .panel-heading-actions {
  min-width: min(560px, 58%);
}

body.image-mode .output-feed {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 6px 88px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.image-mode .composer {
  grid-column: 1;
  grid-row: 2;
  align-self: stretch;
  align-content: start;
  gap: 16px;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0 0 18px;
  border-color: rgba(10, 16, 32, 0.09);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: #fff;
  box-shadow: none;
  overflow-y: auto;
}

body.image-mode .image-composer-heading {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--neutral-300);
}

body.image-mode .image-composer-heading strong {
  font-size: var(--fs-lg);
}

body.image-mode .image-composer-heading small {
  color: var(--neutral-700);
  line-height: 1.5;
}

.image-reference-control {
  display: grid;
  gap: 9px;
}

.image-control-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.image-control-title small {
  color: var(--neutral-700);
  font-weight: 600;
}

.reference-dropzone {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 76px;
  border: 1px dashed rgba(10, 16, 32, 0.2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neutral-900);
  padding: 12px;
  text-align: left;
}

.reference-dropzone:hover,
.reference-dropzone.dragging {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, #fff);
}

.reference-dropzone.disabled,
.reference-dropzone:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.reference-dropzone svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reference-dropzone span {
  display: grid;
  gap: 3px;
}

.reference-dropzone strong { font-size: var(--fs-sm); }
.reference-dropzone small { color: var(--neutral-700); font-size: var(--fs-xs); line-height: 1.4; }

.reference-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.reference-item {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
}

.reference-item img { width: 100%; height: 100%; object-fit: cover; }
.reference-item figcaption {
  position: absolute;
  bottom: 4px;
  left: 4px;
  border-radius: var(--radius-xs);
  background: rgba(10, 16, 32, 0.72);
  color: #fff;
  padding: 2px 5px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.reference-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 16, 32, 0.76);
  color: #fff;
  padding: 0;
  font-size: var(--fs-base);
}

.image-enhance-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-top: 1px solid var(--neutral-300);
  border-bottom: 1px solid var(--neutral-300);
  padding: 10px 0;
}

.image-enhance-control > span { display: grid; gap: 3px; }
.image-enhance-control strong { color: var(--neutral-900); font-size: var(--fs-sm); }
.image-enhance-control small { color: var(--neutral-700); font-size: var(--fs-xs); }
.image-enhance-control input {
  width: 42px;
  height: 24px;
  accent-color: var(--color-primary);
}

.media-price-quote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  border: 1px solid rgba(10, 16, 32, 0.09);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 10px 12px;
}

.media-price-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.media-price-label {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.media-price-value {
  color: var(--neutral-900);
  font-size: var(--fs-md);
  line-height: 1;
  white-space: nowrap;
}

.media-price-value span {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.media-price-badge {
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: var(--radius-full);
  background: #eaf7f3;
  color: var(--color-primary-strong);
  padding: 5px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.media-price-quote > small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

.media-price-loading {
  width: 116px;
  height: 18px;
  border-radius: 5px;
  background: #dfe5eb;
  animation: media-price-pulse 1s ease-in-out infinite alternate;
}

.media-price-unavailable {
  color: var(--color-warning);
  font-size: var(--fs-sm);
}

.media-price-quote[data-state="error"] {
  border-color: rgba(154, 103, 0, 0.18);
  background: var(--surface)eb;
}

@keyframes media-price-pulse {
  to { opacity: 0.46; }
}

@media (prefers-reduced-motion: reduce) {
  .media-price-loading { animation: none; }
}

body.image-mode .option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.image-mode .option-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.image-mode .option-row label:first-child {
  grid-column: 1 / -1;
}

body.image-mode .option-row select,
body.image-mode .option-row input {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

body.image-mode .prompt-box {
  display: grid;
  gap: 8px;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.image-mode .prompt-box textarea {
  height: 190px;
  min-height: 150px;
  max-height: 300px;
  resize: vertical;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  padding: 13px;
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.65;
}

body.image-mode .quick-prompts {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  overflow: visible;
}

body.image-mode .quick-prompts button {
  width: 100%;
  min-height: 36px;
  border-radius: var(--radius-sm);
  text-align: left;
}

body.image-mode .composer-actions {
  display: grid;
  gap: 12px;
}

body.image-mode .composer .primary-button {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: var(--neutral-900);
}

body.video-mode .workspace {
  padding-right: 18px;
  padding-left: 18px;
}

body.video-mode .studio-layout {
  max-width: 1480px;
}

body.video-mode .studio-panel {
  grid-template-columns: minmax(390px, 420px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 18px;
}

body.video-mode .panel-heading {
  grid-column: 1 / -1;
  grid-row: 1;
  width: 100%;
  max-width: none;
  padding: 4px 2px 12px;
}

body.video-mode .panel-heading-actions {
  min-width: min(560px, 58%);
}

body.video-mode .output-feed {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 6px 88px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.video-mode .composer {
  grid-column: 1;
  grid-row: 2;
  align-self: stretch;
  align-content: start;
  gap: 16px;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0 0 18px;
  border-color: rgba(10, 16, 32, 0.09);
  border-radius: var(--radius-sm);
  padding: 18px;
  background: #fff;
  box-shadow: none;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

body.video-mode .quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  overflow: visible;
}

body.video-mode .quick-prompts button {
  width: 100%;
  min-height: 36px;
  border-radius: var(--radius-sm);
  text-align: left;
}

body.video-mode .quick-prompts button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

body.video-mode .option-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.video-mode .option-row label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.video-mode .option-row label:first-child {
  grid-column: 1 / -1;
}

body.video-mode .option-row select,
body.video-mode .option-row input {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}

body.video-mode .prompt-box {
  display: grid;
  gap: 8px;
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.video-mode .prompt-box textarea {
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-2);
  line-height: 1.55;
}

body.video-mode .media-price-quote {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  min-height: 76px;
}

body.video-mode .media-price-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  width: 100%;
}

body.video-mode .media-price-badge {
  grid-column: 1 / -1;
  justify-self: start;
}

body.video-mode .media-price-quote > small {
  max-width: 100%;
  text-align: left;
}

body.video-mode .composer-actions {
  display: grid;
  gap: 12px;
}

body.video-mode .composer .primary-button {
  width: 100%;
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: var(--neutral-900);
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 14px;
}

.image-gallery .image-message.user {
  display: none;
}

.image-gallery .image-result-card,
.image-gallery .image-thinking-card {
  max-width: none;
  margin: 0;
  border-radius: var(--radius-sm);
  padding: 10px;
  overflow: hidden;
}

.image-gallery .image-result-card .generated-media {
  order: -1;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: none;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  object-fit: contain;
  box-shadow: none;
}

.image-gallery .image-result-card pre {
  display: -webkit-box;
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-sm);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.image-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.image-result-actions button,
.image-result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-xs);
  background: #fff;
  color: var(--neutral-900);
  padding: 6px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.image-preview-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(12px);
}

.image-preview-sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0;
  width: min(1120px, 100%);
  max-height: min(820px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: var(--neutral-900);
  box-shadow: none;
}

.image-preview-stage {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: min(70vh, 680px);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.04) 25%, transparent 25%),
    var(--neutral-900);
  background-size: 22px 22px;
}

.image-preview-stage img,
.image-preview-stage video {
  width: 100%;
  height: 100%;
  max-height: min(78vh, 760px);
  object-fit: contain;
}

.video-preview-stage {
  background: var(--neutral-900);
}

.video-preview-stage video {
  display: block;
  background: var(--neutral-900);
}

.image-preview-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  border-left: 1px solid var(--neutral-300);
  background: #fff;
  padding: 18px;
}

.image-preview-panel header {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.image-preview-panel h2 {
  margin: 0;
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  line-height: 1.15;
}

.image-preview-panel header small,
.image-preview-panel p {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.45;
}

.image-preview-panel p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.image-preview-actions {
  display: grid;
  gap: 8px;
}

.image-preview-actions button,
.image-preview-close {
  min-height: 38px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  padding: 8px 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.image-preview-actions button.primary {
  border-color: var(--neutral-900);
  background: var(--neutral-900);
  color: #fff;
}

.image-preview-actions button:hover,
.image-preview-close:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: none;
  transform: translateY(-1px);
}

.image-preview-close {
  margin-top: 4px;
  background: var(--surface-2);
}

.image-empty-state {
  grid-column: 1 / -1;
  align-content: center;
  min-height: 520px;
  border: 1px dashed rgba(10, 16, 32, 0.12);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 30px;
}

.image-empty-grid {
  display: grid;
  grid-template-columns: repeat(4, 58px);
  gap: 8px;
  margin-top: 6px;
}

.image-empty-grid span {
  aspect-ratio: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: #fff;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  width: min(var(--composer-width), calc(100% - 24px));
  max-width: 100%;
  margin: 0 auto 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.studio-panel > .composer {
  border-top: 1px solid var(--color-border);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.option-row label {
  min-width: 160px;
}

select,
input,
textarea {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--color-primary) 58%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 11%, transparent);
}

select,
input {
  height: 40px;
  padding: 0 12px;
  background: var(--surface-2);
}

textarea {
  width: 100%;
  height: 88px;
  min-height: 88px;
  max-height: 220px;
  resize: none;
  border-color: transparent;
  padding: 4px 2px;
  line-height: 1.54;
  background: transparent;
}

textarea:focus {
  box-shadow: none;
}

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

.composer-submit-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.stop-generation-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 78px;
  min-height: 34px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-danger);
  padding: 0 11px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.stop-generation-button:hover {
  border-color: rgba(185, 28, 28, 0.34);
  background: #fff7f7;
}

.stop-generation-button:disabled {
  cursor: wait;
  opacity: 0.64;
}

.stop-generation-button svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.composer-notice {
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: var(--radius);
  background: var(--surface-3);
  color: var(--color-primary-strong);
  padding: 8px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.38;
}

.composer-notice.warning {
  border-color: rgba(154, 103, 0, 0.22);
  background: var(--color-warning);
  color: var(--color-warning);
}

.quick-prompts {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-prompts::-webkit-scrollbar {
  display: none;
}

.quick-prompts button {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--neutral-900);
  padding: 5px 9px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 98px;
  min-height: 34px;
  border: 0;
  border-radius: var(--radius-full);
  background:
    linear-gradient(180deg, var(--neutral-900) 0%, var(--neutral-900) 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.primary-button:hover {
  background:
    linear-gradient(180deg, var(--neutral-900) 0%, var(--neutral-900) 100%);
  transform: translateY(-1px);
  box-shadow: none;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.82);
  color: var(--neutral-900);
  box-shadow: none;
}

.icon-button svg,
.primary-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inspector {
  display: grid;
  gap: 0;
  min-height: 0;
  overflow-y: auto;
  border-color: var(--color-border);
  background: var(--surface-2);
  box-shadow: none;
}

.inspector-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--neutral-300);
}

.inspector-section:last-child {
  border-bottom: 0;
}

.adapter-list,
.history-list {
  display: grid;
  gap: 8px;
}

.adapter-row,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  padding: 9px 10px;
  background: var(--surface-2);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

button.history-row {
  width: 100%;
  color: inherit;
  text-align: left;
}

.history-row.active {
  border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
  background: color-mix(in srgb, var(--color-primary) 8%, #fff);
  box-shadow: inset 3px 0 0 var(--color-primary);
}

button.history-row:hover {
  border-color: rgba(99, 102, 241, 0.24);
  background: #fff;
  box-shadow: none;
  transform: translateY(-1px);
}

.adapter-row span,
.history-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adapter-model {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.model-logo-adapter {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  box-shadow: none;
}

.model-logo-adapter svg {
  width: 14px;
  height: 14px;
}

.history-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.history-main strong,
.history-main small,
.history-side small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main strong {
  color: var(--neutral-900);
  font-size: var(--fs-sm);
}

.history-main small,
.history-side small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
}

.history-side {
  display: grid;
  justify-items: end;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 92px;
}

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

.runtime-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 10px;
}

.runtime-row small {
  color: var(--neutral-500);
  font-size: var(--fs-xs);
  font-weight: 600;
}

.runtime-row strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-row.live strong {
  color: var(--color-success);
}

.runtime-row.warn strong {
  color: var(--color-warning);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .app-header {
    grid-template-columns: minmax(160px, 1fr) minmax(0, auto) auto;
    gap: 12px;
  }

  .product-nav {
    justify-self: center;
    max-width: 100%;
    overflow-x: auto;
  }

  .account-chip {
    max-width: 220px;
  }

  .side-panel {
    position: relative;
    top: 0;
    height: auto;
    grid-column: 1;
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--neutral-300);
  }

  .model-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-height: 360px;
    overflow-y: auto;
  }

  .model-strip {
    min-width: 0;
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .home-command-deck {
    grid-template-columns: 1fr;
  }

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

  body.image-mode .studio-panel,
  body.video-mode .studio-panel {
    grid-template-columns: 320px minmax(0, 1fr);
  }

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

/* Production QA: keep Orbit metrics legible and mobile composer actions distinct. */
@media (min-width: 1041px) {
  body.global-home .orbit-home-panel {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  body.global-home .orbit-core {
    width: 112px;
  }

  body.global-home .orbit-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.global-home .orbit-status-grid span {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    padding: 6px 8px;
  }
}

/* Desktop chat keeps long replies inside the message scroller above the composer. */
@media (min-width: 781px) {
  body[data-product-page="studio"]:not(.global-home):not(.image-mode):not(.video-mode) .studio-panel {
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    overflow: hidden;
  }

  body[data-product-page="studio"]:not(.global-home):not(.image-mode):not(.video-mode) .output-feed {
    min-height: 0;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 28px;
  }

  body[data-product-page="studio"]:not(.global-home):not(.image-mode):not(.video-mode) .composer {
    position: relative;
    z-index: 2;
    align-self: end;
  }
}

@media (max-width: 780px) {
  body.global-home .orbit-status-grid span {
    padding: 5px;
  }

  body.global-home .orbit-status-grid small {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  body.global-home .composer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  body.global-home .quick-prompts {
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-right: 0;
  }

  body.global-home .quick-prompts button {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
  }

  body.global-home .composer-submit-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 780px) {
  .conversation-action-dialog {
    align-items: end;
    padding: 12px;
  }

  .conversation-action-sheet {
    width: 100%;
  }

  .conversation-action-sheet footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .conversation-action-sheet footer button {
    width: 100%;
  }
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
    min-height: 100dvh;
  }

  .app-header {
    position: sticky;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    height: auto;
    min-height: 56px;
    padding: 9px 12px;
  }

  .brand {
    flex: 1 1 auto;
    max-width: calc(100vw - 160px);
  }

  .product-nav {
    order: 3;
    flex: 1 0 100%;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
    padding: 3px;
    scrollbar-width: none;
  }

  .product-nav::-webkit-scrollbar {
    display: none;
  }

  .product-nav button {
    flex: 1 0 auto;
    min-height: 30px;
    padding-inline: 12px;
  }

  .header-actions {
    position: fixed;
    top: 10px;
    right: 12px;
    z-index: 80;
    flex: 0 0 auto;
    justify-self: auto;
  }

  .header-context {
    display: none;
  }

  .brand-logo {
    width: 118px;
    height: 31px;
  }

  .header-actions .status-pill {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .header-billing-button span,
  .account-chip small {
    display: none;
  }

  .account-chip > span:last-child {
    display: none;
  }

  .header-billing-button,
  .new-chat-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
  }

  .account-chip {
    width: 36px;
    max-width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 4px;
  }

  .account-menu-panel {
    width: min(360px, calc(100vw - 20px));
    max-height: calc(100vh - 76px);
  }

  .icon-button {
    width: 36px;
    height: 36px;
  }

  .workspace,
  .side-panel {
    padding: 12px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .side-panel {
    display: none;
  }

  .workspace {
    height: auto;
    min-height: 0;
    max-width: 100vw;
    padding-top: 10px;
  }

  .product-page:not(.product-page-studio) {
    width: 100%;
    padding: 0 0 14px;
  }

  .product-page-head {
    display: grid;
    padding: 14px;
  }

  .product-page-head h1 {
    font-size: var(--fs-xl);
  }

  .product-dashboard-grid,
  .product-library-layout,
  .product-billing-layout {
    grid-template-columns: 1fr;
  }

  .product-model-grid,
  .product-asset-grid {
    grid-template-columns: 1fr;
  }

  .product-card-surface {
    padding: 10px;
  }

  .trust-strip {
    display: none;
  }

  .studio-layout {
    height: 100%;
    width: min(100%, 360px);
    max-width: 360px;
    margin: 0;
  }

  .studio-panel {
    width: min(100%, 360px);
    max-width: 360px;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
  }

  body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-orbit-mount { display: none; }

  body.image-mode .workspace,
  body.video-mode .workspace {
    height: auto;
    min-height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 10px;
  }

  body.image-mode .studio-panel,
  body.video-mode .studio-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 12px;
    height: auto;
    overflow: visible;
  }

  body.image-mode .panel-heading,
  body.image-mode .composer,
  body.image-mode .output-feed,
  body.video-mode .panel-heading,
  body.video-mode .composer,
  body.video-mode .output-feed {
    grid-column: 1;
    width: 100%;
  }

  body.image-mode .panel-heading,
  body.video-mode .panel-heading { grid-row: 1; }
  body.image-mode .composer,
  body.video-mode .composer { grid-row: 2; margin: 0; overflow: visible; }
  body.image-mode .output-feed,
  body.video-mode .output-feed { grid-row: 3; padding: 0 0 16px; overflow: visible; }
  body.image-mode .panel-heading-actions,
  body.video-mode .panel-heading-actions { min-width: 0; }
  body.image-mode .prompt-box textarea,
  body.video-mode .prompt-box textarea { height: 140px; }

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

  .image-empty-state {
    min-height: 320px;
  }

  .image-empty-grid {
    grid-template-columns: repeat(4, minmax(0, 48px));
  }

  .panel-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 12px;
    width: min(100%, 360px);
    max-width: 360px;
    padding: 8px 4px 10px;
  }

  .panel-heading-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .provider-model-control {
    width: 100%;
    min-width: 0;
  }

  .panel-heading .section-action {
    width: 100%;
    min-height: 38px;
  }

  .panel-heading-actions .new-chat-button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 0 12px;
  }

  h2 {
    font-size: var(--fs-xl);
  }

  .output-feed {
    width: min(100%, 360px);
    max-width: 360px;
    padding: 10px 4px 16px;
    overflow-x: hidden;
  }

  .empty-state {
    width: 100%;
    max-width: 100%;
    min-height: 220px;
    gap: 12px;
    padding: 0 10px;
  }

  .empty-state h1,
  .empty-state h3,
  .empty-state p {
    width: min(100%, calc(100vw - 48px));
    max-width: 330px;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .empty-state p {
    font-size: var(--fs-sm);
  }

  .home-empty-state {
    min-height: 0;
    padding: 0;
  }

  .home-empty-state,
  .home-command-deck,
  .home-copy,
  .home-signal-panel,
  .home-brand-cloud,
  .home-metric-grid,
  .home-capability-grid {
    min-width: 0;
    max-width: 100%;
  }

  .home-copy,
  .home-signal-panel,
  .home-capability-grid,
  .home-trust-signals,
  .home-route-board,
  .home-kind-grid,
  .proof-strip,
  .current-mode-summary {
    width: min(100%, 340px);
  }

  .home-command-deck {
    gap: 12px;
  }

  .home-copy {
    gap: 9px;
    padding: 2px 0;
  }

  .home-copy h1 {
    width: min(100%, 340px);
    max-width: none;
    font-size: var(--fs-xl);
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .home-copy p {
    width: min(100%, 340px);
    max-width: none;
    font-size: var(--fs-sm);
  }

  .home-trust-signals {
    display: none;
  }

  .home-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: min(100%, 340px);
  }

  .home-primary-action,
  .home-secondary-action {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    font-size: var(--fs-sm);
    white-space: nowrap;
  }

  .model-empty-state {
    min-height: 230px;
    padding: 0;
  }

  .model-empty-card {
    width: min(100%, 340px);
    gap: 12px;
    padding: 16px;
  }

  .model-empty-main {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .model-empty-logo {
    width: 40px;
    height: 40px;
  }

  .model-empty-main h3 {
    font-size: var(--fs-xl);
  }

  .model-empty-main p {
    font-size: var(--fs-sm);
  }

  .model-empty-action {
    width: 100%;
  }

  .home-signal-panel {
    display: none;
  }

  .home-capability-grid {
    display: none;
  }

  .home-brand-cloud,
  .home-metric-grid,
  .home-kind-grid,
  .home-capability-grid {
    grid-template-columns: 1fr;
  }

  .home-trust-signals {
    gap: 6px;
  }

  .home-route-row {
    align-items: start;
  }

  .home-route-row small {
    display: -webkit-box;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .home-brand-pill {
    min-height: 38px;
  }

  .home-metric {
    padding: 9px 8px;
  }

  .home-runtime-line {
    display: none;
  }

  .task-preset-grid {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .task-preset-button {
    min-height: 68px;
    padding: 10px;
  }

  .proof-strip {
    display: none;
  }

  .current-mode-summary {
    max-width: calc(100vw - 42px);
  }

  .model-profile-panel {
    display: none;
  }

  .composer {
    width: min(100%, 360px);
    max-width: 360px;
    margin-bottom: 8px;
    border-radius: var(--radius-lg);
    padding: 10px 12px 11px;
  }

  textarea {
    height: 54px;
    min-height: 54px;
  }

  @media (max-width: 460px) {
    .home-hero-actions,
    .home-brand-cloud,
    .home-metric-grid,
    .home-kind-grid,
    .home-capability-grid {
      grid-template-columns: 1fr;
    }

    .home-capability {
      min-height: 118px;
    }
  }

  .billing-summary,
  .billing-balance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .billing-dialog {
    align-items: stretch;
    padding: 0;
  }

  .billing-sheet {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .billing-dialog-head {
    padding: 14px;
  }

  .billing-feedback {
    margin: 12px 14px 0;
  }

  .billing-dialog-head h2 {
    font-size: var(--fs-lg);
  }

  .billing-dialog-layout,
  .billing-plan-grid,
  .billing-dialog .topup-grid {
    grid-template-columns: 1fr;
  }

  .billing-dialog-layout {
    padding: 14px;
  }
  .checkout-dialog {
    align-items: stretch;
    padding: 0;
  }

  .checkout-sheet {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .checkout-layout {
    grid-template-columns: 1fr;
    padding: 0 14px;
  }

  .checkout-head,
  .checkout-footer {
    padding: 14px;
  }

  .checkout-footer {
    display: grid;
  }

  .checkout-security-note {
    margin-right: 0;
  }

  .checkout-facts {
    grid-template-columns: 1fr;
  }

  .card-network-picker,
  .card-entry-form-preview {
    grid-template-columns: 1fr;
  }

  .card-entry-form-preview span:first-child,
  .card-entry-form-preview span:last-child {
    grid-column: auto;
  }

  .payment-method {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .payment-method em {
    grid-column: 2;
    justify-self: start;
  }

  .topup-card {
    grid-template-columns: 1fr;
  }

  .topup-price {
    justify-items: start;
  }

  .model-strip,
  .model-list {
    width: 100%;
    max-width: 100%;
  }

  .model-list {
    max-height: none;
    overflow-y: visible;
  }

  .model-command-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .model-command-mark {
    width: 44px;
    height: 44px;
  }

  .model-command-main h2 {
    font-size: var(--fs-xl);
  }

  .model-command-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .model-command-actions {
    grid-template-columns: 1fr 1fr;
    display: grid;
  }

  .model-picker-dialog,
  .workspace-hub-dialog {
    align-items: stretch;
    padding: 0;
  }

  .model-picker-sheet,
  .workspace-hub-sheet {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .model-picker-head,
  .workspace-hub-head {
    padding: 14px;
  }

  .model-picker-head h2,
  .workspace-hub-head h2 {
    font-size: var(--fs-lg);
  }

  .model-picker-layout,
  .workspace-hub-layout {
    grid-template-columns: 1fr;
  }

  .workspace-hub-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-right: 0;
    border-bottom: 1px solid var(--neutral-300);
    padding: 14px;
  }

  .workspace-hub-main {
    padding: 14px;
  }

  .workspace-asset-grid {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-hub-section-head,
  .workspace-hub-row {
    grid-template-columns: 1fr;
  }

  .workspace-hub-row-open {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .workspace-hub-row-actions {
    justify-content: flex-end;
    border-top: 1px solid var(--neutral-300);
    padding-top: 6px;
  }

  .history-search-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .history-search-field {
    width: 100%;
  }

  .workspace-hub-section-head {
    display: grid;
  }

  .workspace-asset-toolbar {
    justify-content: stretch;
    min-width: 0;
  }

  .workspace-asset-toolbar span,
  .workspace-asset-toolbar .section-action {
    flex: 1 1 120px;
  }

  .image-preview-dialog {
    align-items: stretch;
    padding: 0;
  }

  .image-preview-sheet {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .image-preview-stage {
    min-height: 0;
  }

  .image-preview-stage img,
  .image-preview-stage video {
    max-height: calc(100vh - 260px);
  }

  .image-preview-panel {
    border-left: 0;
    border-top: 1px solid var(--neutral-300);
    padding: 14px;
  }

  .image-preview-panel h2 {
    font-size: var(--fs-lg);
  }

  .image-preview-panel p {
    -webkit-line-clamp: 3;
  }

  .image-preview-actions {
    grid-template-columns: 1fr 1fr;
  }

  .workspace-hub-row-side {
    justify-items: start;
    max-width: 100%;
  }

  .model-picker-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--neutral-300);
    padding: 14px;
  }

  .model-filter {
    grid-template-columns: 1fr 1fr;
  }

  .model-picker-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 14px;
  }

  .model-picker-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding: 14px;
  }

  .model-nav-button,
  .model-picker-card,
  .adapter-row,
  .history-row {
    min-width: 0;
  }

  .tile-top {
    flex-wrap: wrap;
  }

  .model-kind {
    white-space: normal;
  }

  .composer-actions,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-actions {
    display: flex;
    align-items: center;
    flex-direction: row;
  }

  .studio-panel {
    min-height: auto;
  }

  .primary-button {
    width: auto;
    flex: 0 0 auto;
  }
}

@media (max-width: 520px) {
  .workspace-hub-row-open {
    grid-template-columns: 1fr;
  }

  .workspace-hub-row-side {
    justify-items: start;
    max-width: 100%;
  }
}

/* Product continuity, decision-friendly models, and useful empty states. */
.side-work-section {
  margin-top: 4px;
}

.side-work-row {
  min-height: 44px;
  border-color: transparent;
  background: transparent;
}

.side-work-row:hover {
  border-color: var(--color-border);
  background: #fff;
}

.side-model-section {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}

.side-model-copy {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.side-model-section .model-list {
  display: none;
}

.product-model-card .mode-chip:not(.live) {
  background: #f1f3f5;
  color: var(--neutral-700);
}

.product-model-card .model-picker-facts strong {
  font-size: var(--fs-xs);
}

.asset-product-empty {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: 330px;
  padding: 48px 24px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  text-align: center;
}

.asset-empty-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.asset-product-empty > div:nth-child(2) {
  display: grid;
  gap: 7px;
}

.asset-product-empty strong {
  font-size: var(--fs-lg);
}

.asset-product-empty p {
  color: var(--neutral-700);
  font-size: var(--fs-sm);
}

.asset-starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 620px);
}

.asset-starter-grid button {
  min-height: 48px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.asset-starter-grid button:hover {
  border-color: color-mix(in srgb, var(--color-primary) 36%, var(--neutral-300));
  background: color-mix(in srgb, var(--color-primary) 6%, #fff);
}

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

@media (max-width: 780px) {
  .asset-product-empty {
    min-height: 300px;
    padding: 32px 16px;
  }

  .asset-starter-grid {
    grid-template-columns: 1fr;
  }

  .billing-balance-primary {
    grid-template-columns: 1fr 1fr;
  }
}

/* Product-first home and focused creation surfaces. */
body.global-home .trust-strip {
  display: none;
}

body.global-home .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.global-home .app-header {
  grid-template-columns: minmax(132px, 1fr) auto minmax(132px, 1fr);
}

body.global-home .brand {
  justify-self: start;
}

body.global-home .header-actions {
  justify-self: end;
}

body.global-home .side-panel {
  display: none;
}

body.global-home .workspace {
  grid-column: 1 / -1;
}

body.global-home .studio-panel {
  /* Frontend-integrator: home 三个子节点（studio-orbit-mount display:none 后剩 output-feed + composer）
     必须各自自然高度，不能用 1fr 撑满导致 output-feed 内容被 overflow:hidden 裁剪、capability 卡与 composer 重叠 */
  grid-template-rows: auto auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

/* P2-A fix: 断掉 .studio-panel 上层 height:100% 的继承链，
   让 studio-panel 的 height:auto 真正生效，capability grid 第二行不再被 composer 覆盖。
   实测：cap.bottom 730 vs composer.top 675 重叠 ~55px；
   修复后 cap.bottom 729 vs composer.top 857 间距 +128px。 */
body.global-home .product-page-studio,
body.global-home .studio-layout {
  height: auto;
  min-height: 0;
}

body.global-home .studio-layout {
  align-items: start;
}

body.global-home .output-feed {
  overflow: visible;
  height: auto;
  min-height: 0;
  flex: 0 0 auto;
}

body.global-home .panel-heading {
  display: none;
}

body.global-home .output-feed {
  justify-content: flex-end;
  width: min(100%, 920px);
  padding: clamp(34px, 8vh, 88px) 12px 18px;
}

body.global-home .home-empty-state {
  justify-content: center;
  gap: 22px;
  width: min(100%, 780px);
  min-height: 0;
}

body.global-home .home-command-deck {
  display: block;
  width: 100%;
}

body.global-home .home-copy {
  justify-items: center;
  gap: 14px;
  padding: 0;
  text-align: center;
}

body.global-home .home-copy h1 {
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

body.global-home .home-copy p {
  max-width: 620px;
  font-size: var(--fs-base);
}

body.global-home .home-trust-signals {
  justify-content: center;
}

body.global-home .home-capability-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

body.global-home .home-capability {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 94px;
  gap: 8px 10px;
  padding: 13px;
}

body.global-home .home-capability-icon {
  grid-row: 1 / -1;
}

body.global-home .home-capability b {
  color: var(--neutral-900);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.global-home .home-capability strong {
  font-weight: 600;
}

.task-kind-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(99, 102, 241, 0.15);
  background: var(--surface-3);
  color: var(--color-primary-strong);
}

.task-kind-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.global-home .composer {
  width: min(920px, calc(100% - 24px));
  gap: 10px;
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  background: #f7f7f8;
  box-shadow: none;
}

body.global-home .prompt-box textarea {
  min-height: 72px;
  font-size: var(--fs-base);
  line-height: 1.55;
}

body.image-mode .model-empty-card,
body.video-mode .model-empty-card {
  width: 100%;
  max-width: none;
}

body.image-mode .media-empty-stage,
body.video-mode .media-empty-stage {
  min-height: clamp(300px, 52vh, 560px);
}

@media (max-width: 780px) {
  .brand small {
    display: none;
  }

  body.global-home .workspace {
    height: auto;
    padding: 0 10px 10px;
  }

  body.global-home .studio-layout,
  body.global-home .studio-panel,
  body.global-home .output-feed {
    width: 100%;
    max-width: none;
  }

  body.global-home .output-feed {
    justify-content: flex-start;
    padding: 20px 6px 10px;
  }

  body.global-home .home-empty-state {
    gap: 16px;
  }

  body.global-home .home-copy {
    width: 100%;
  }

  body.global-home .home-copy h1 {
    width: 100%;
    font-size: var(--fs-xl);
  }

  body.global-home .home-copy p {
    width: 100%;
    font-size: var(--fs-sm);
  }

  body.global-home .home-capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 7px;
  }

  body.global-home .home-capability {
    min-height: 64px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
  }

  body.global-home .home-capability-icon {
    grid-row: auto;
  }

  body.global-home .home-capability small {
    display: none;
  }

  body.global-home .home-capability b {
    white-space: nowrap;
  }

  body.global-home .home-trust-signals {
    display: none;
  }

  body.global-home .composer {
    width: 100%;
    margin-bottom: 0;
    padding: 11px 12px;
  }

  body.global-home .quick-prompts {
    flex: 1 1 auto;
    max-width: 100%;
    padding-right: 8px;
    scroll-padding-inline: 8px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
  }

  body.global-home .quick-prompts button {
    scroll-snap-align: start;
  }

  body.global-home .prompt-box textarea {
    min-height: 60px;
  }

  body.image-mode .media-empty-stage,
  body.video-mode .media-empty-stage {
    min-height: 260px;
  }
}

/* Media creation surfaces: keep controls dense and give the result area a real canvas. */
body.image-mode .media-composer-heading,
body.video-mode .media-composer-heading {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--neutral-300);
}

body.image-mode .media-composer-heading strong,
body.video-mode .media-composer-heading strong {
  font-size: var(--fs-lg);
  line-height: 1.15;
}

body.image-mode .media-composer-heading small,
body.video-mode .media-composer-heading small {
  color: var(--neutral-700);
  line-height: 1.5;
}

body.image-mode .output-feed,
body.video-mode .output-feed {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  padding: 18px;
}

body.image-mode .composer,
body.video-mode .composer {
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: none;
}

.media-empty-state {
  align-content: start;
  justify-items: stretch;
  min-height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}

.media-empty-card {
  display: grid;
  align-content: start;
  gap: 14px;
  width: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.media-empty-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-primary) 22%, var(--color-border));
  border-radius: var(--radius-sm);
  background: #fff;
  isolation: isolate;
}

.image-empty-card .media-empty-stage {
  aspect-ratio: 4 / 3;
}

.video-empty-card .media-empty-stage {
  aspect-ratio: 16 / 9;
  min-height: 250px;
  background: var(--neutral-900);
  color: #fff;
}

.media-stage-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.7;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 32px 32px;
}

.video-empty-card .media-stage-grid {
  opacity: 0.36;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.09) 1px, transparent 1px);
}

.media-stage-center {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(330px, calc(100% - 32px));
  text-align: center;
}

.media-stage-logo {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.media-stage-logo svg {
  width: 28px;
  height: 28px;
}

.media-stage-center strong {
  color: var(--neutral-900);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.media-stage-center small {
  max-width: 300px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
}

.video-empty-card .media-stage-center strong {
  color: #fff;
}

.video-empty-card .media-stage-center small {
  color: rgba(255, 255, 255, 0.68);
}

.media-stage-corner {
  position: absolute;
  right: 12px;
  bottom: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.86);
  color: var(--neutral-700);
  padding: 5px 9px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.video-empty-card .media-stage-corner {
  border-color: var(--neutral-300);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
}

.media-empty-card .model-empty-main {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.media-empty-card .model-empty-main h3 {
  margin-top: 2px;
  font-size: var(--fs-md);
}

.media-empty-card .model-empty-main p {
  margin-top: 5px;
  font-size: var(--fs-xs);
}

.media-empty-card .model-empty-chips span,
.media-empty-card .model-empty-profile span {
  min-height: 26px;
  padding: 4px 9px;
  font-size: var(--fs-xs);
}

.media-empty-card .model-empty-action {
  display: none;
}

@media (max-width: 780px) {
  body.image-mode .output-feed,
  body.video-mode .output-feed {
    padding: 10px;
    border-radius: var(--radius-sm);
  }

  body.image-mode .composer,
  body.video-mode .composer {
    padding: 16px;
  }

  .media-empty-stage {
    min-height: 250px;
  }

  .video-empty-card .media-empty-stage {
    min-height: 190px;
  }
}

/* Product-wide refinement: one shell, fewer nested cards, steadier content. */
body {
  background: var(--bg);
}

.app-header {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

.side-panel {
  display: none;
  background: var(--surface-2);
  backdrop-filter: none;
}

.workspace {
  grid-column: 1 / -1;
}

.model-nav-button {
  border-color: transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  box-shadow: none;
}

.model-nav-button:hover {
  border-color: var(--color-border);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  transform: none;
}

.model-nav-button.active {
  border-color: var(--color-border);
  background: #fff;
  box-shadow: inset 2px 0 0 var(--color-primary);
}

.trust-strip {
  justify-content: flex-start;
  gap: 0;
  width: min(100%, 1120px);
  min-height: 34px;
  border-bottom: 1px solid var(--color-border);
  color: var(--neutral-700);
}

.trust-strip span {
  min-height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  box-shadow: none;
}

.trust-strip span:first-child {
  padding-left: 2px;
}

.trust-strip span + span {
  border-left: 1px solid var(--color-border);
}

.trust-strip-live {
  gap: 6px;
  color: var(--neutral-700);
}

.trust-strip-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px rgba(22, 163, 106, 0.12);
}

.trust-strip-balance {
  margin-left: auto;
  color: var(--neutral-900);
}

.product-page:not(.product-page-studio) {
  width: min(1240px, 100%);
  gap: 18px;
  padding-top: 12px;
}

.product-page-head {
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  padding: 8px 4px 16px;
}

.product-page-head h1 {
  margin-top: 5px;
  font-size: var(--fs-xl);
}

.product-page-head p {
  margin-top: 7px;
}

.product-dashboard-grid {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
}

.product-dashboard-grid span {
  flex: 1 1 0;
  border: 0;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  background: transparent;
  padding: 10px 18px 14px;
}

.product-dashboard-grid span:first-child {
  padding-left: 4px;
}

.product-dashboard-grid span:last-child {
  border-right: 0;
}

.product-dashboard-grid strong {
  font-size: var(--fs-xl);
}

.product-library-layout {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.product-page-models .product-library-layout {
  flex: 0 0 auto;
}

.product-filter-panel,
.product-library-main {
  border-radius: var(--radius-sm);
}

.product-page-models .product-library-main,
.product-page-models .product-model-grid {
  overflow: visible;
}

.product-filter-panel {
  padding: 10px;
}

.product-filter-panel .model-filter {
  gap: 3px;
}

.product-filter-panel .model-filter button {
  min-height: 52px;
  border-color: transparent;
  border-radius: var(--radius-xs);
  background: transparent;
}

.product-filter-panel .model-filter button:hover {
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: none;
  transform: none;
}

.product-filter-panel .model-filter button.active {
  border-color: transparent;
  background: color-mix(in srgb, var(--color-primary) 9%, var(--surface-2));
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.product-model-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.product-model-card {
  grid-template-rows: auto auto auto auto;
  min-height: 164px;
  border-radius: var(--radius-sm);
  padding: 13px;
}

.product-model-card:hover,
.product-model-card.active {
  box-shadow: none;
}

.product-model-card .model-picker-facts {
  gap: 10px;
  border-top: 1px solid var(--color-border);
  padding-top: 9px;
}

.product-model-card .model-picker-facts span {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.product-card-surface {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.product-asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 250px));
  gap: 12px;
}

.product-asset-grid > .workspace-hub-empty,
.product-list-page > .workspace-hub-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
}

.workspace-asset-card {
  border-radius: var(--radius-sm);
}

.workspace-asset-actions button {
  border-radius: var(--radius-xs);
}

.product-dashboard-skeleton span,
.product-asset-skeleton span {
  position: relative;
  overflow: hidden;
  background: #e9edf2;
}

.product-dashboard-skeleton span {
  min-height: 54px;
}

.product-asset-skeleton {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 250px));
  gap: 12px;
}

.product-asset-skeleton span {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
}

.product-dashboard-skeleton span::after,
.product-asset-skeleton span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.66) 48%, transparent 72%);
  transform: translateX(-100%);
  animation: product-skeleton 1.35s ease-in-out infinite;
}

.product-page-billing .billing-sheet {
  border: 0;
  background: transparent;
}

.product-page-billing .billing-account-summary,
.product-page-billing .billing-purchase-area,
.product-page-billing .plan-card,
.product-page-billing .topup-card {
  border-radius: var(--radius-sm);
}

@keyframes product-skeleton {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .product-dashboard-skeleton span::after,
  .product-asset-skeleton span::after,
  .thinking-spinner {
    animation: none;
  }
}

@media (max-width: 780px) {
  .product-page:not(.product-page-studio) {
    gap: 14px;
    padding-top: 2px;
  }

  .product-page-head {
    padding: 10px 2px 14px;
  }

  .product-page-head h1 {
    font-size: var(--fs-xl);
  }

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

  .product-dashboard-grid span {
    padding: 9px 8px 12px;
  }

  .product-dashboard-grid span:first-child {
    padding-left: 2px;
  }

  .product-dashboard-grid strong {
    font-size: var(--fs-lg);
  }

  .product-dashboard-grid small {
    font-size: var(--fs-xs);
  }

  .product-library-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-model-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-filter-panel {
    border: 0;
    background: transparent;
    padding: 0;
  }

  .product-filter-panel > .eyebrow {
    display: none;
  }

  .product-filter-panel .model-filter {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .product-filter-panel .model-filter button {
    flex: 0 0 150px;
    min-height: 48px;
    border: 1px solid var(--color-border);
    background: #fff;
  }

  .product-asset-grid,
  .product-asset-skeleton {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-price-quote {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .media-price-main {
    flex-wrap: wrap;
  }

  .media-price-quote > small {
    text-align: left;
  }
}

/* Video creation stays task-focused: controls and the primary action fit together. */
body.video-mode .quick-prompts {
  display: none;
}

body.video-mode .video-empty-state,
body.video-mode .video-empty-card {
  min-width: 0;
  min-height: 0;
}

body.video-mode .video-empty-card {
  gap: 0;
}

body.video-mode .video-empty-card .media-empty-stage {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

@media (min-width: 781px) {
  body.video-mode .output-feed {
    overflow-x: hidden;
    padding: 12px;
  }

  body.video-mode .composer {
    gap: 12px;
    margin-bottom: 0;
    padding: 16px;
  }

  body.video-mode .media-composer-heading {
    gap: 3px;
    padding-bottom: 10px;
  }

  body.video-mode .media-composer-heading strong {
    font-size: var(--fs-md);
  }

  body.video-mode .media-composer-heading small {
    font-size: var(--fs-xs);
    line-height: 1.4;
  }

  body.video-mode .option-row {
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 8px;
  }

  body.video-mode .option-row label:first-child {
    grid-column: auto;
  }

  body.video-mode .option-row select,
  body.video-mode .option-row input {
    height: 42px;
    padding-inline: 10px;
  }

  body.video-mode .prompt-box textarea {
    height: 96px;
    min-height: 96px;
    resize: none;
  }

  body.video-mode .media-price-quote {
    min-height: 58px;
    gap: 5px;
  }

  body.video-mode .composer-actions {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
    gap: 0;
  }

  body.video-mode .composer .primary-button {
    width: 100%;
  }
}

/* Keep the image workspace actionable inside a single desktop viewport. */
@media (min-width: 781px) {
  body.image-mode .option-row label:first-child {
    grid-column: auto;
  }

  body.image-mode .prompt-box textarea {
    height: 112px;
    min-height: 112px;
    max-height: 180px;
  }

  body.image-mode .quick-prompts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.image-mode .quick-prompts button {
    min-width: 0;
    padding-inline: 8px;
    text-align: center;
    white-space: nowrap;
  }

  body.image-mode .composer-actions {
    position: static;
    margin-inline: 0;
    padding: 0;
    background: transparent;
  }

  body.image-mode .media-empty-state,
  body.image-mode .image-empty-state,
  body.image-mode .media-empty-card {
    min-height: 0;
  }

  body.image-mode .media-empty-stage {
    min-height: 0;
    max-height: min(460px, 58vh);
  }

  body.image-mode .image-empty-card .media-empty-stage {
    height: min(460px, 58vh);
    aspect-ratio: auto;
  }

  body.image-mode .workspace {
    height: auto;
    min-height: calc(100vh - var(--header-height));
    overflow: visible;
  }

  body.image-mode .product-page-studio,
  body.image-mode .studio-layout,
  body.image-mode .studio-panel {
    height: auto;
  }

  body.image-mode .studio-panel {
    grid-template-rows: auto auto;
  }

  body.image-mode .composer {
    height: auto;
    overflow: visible;
  }

  body.image-mode .output-feed {
    height: min(496px, calc(58vh + 36px));
  }

  body.image-mode .output-feed:has(.image-empty-state) {
    overflow-y: auto;
  }

  body.image-mode .output-feed:has(.image-inspiration-panel) {
    align-self: stretch;
    height: auto;
  }

  body.image-mode .output-feed:has(.image-inspiration-panel) .image-empty-state,
  body.image-mode .output-feed:has(.image-inspiration-panel) .image-inspiration-panel {
    min-height: 100%;
  }
}

.image-inspiration-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  width: 100%;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.image-inspiration-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.image-inspiration-head > div {
  display: grid;
  gap: 4px;
}

.image-inspiration-head strong {
  color: var(--neutral-900);
  font-size: var(--fs-md);
  line-height: 1.2;
}

.image-inspiration-head small {
  max-width: 280px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.45;
  text-align: right;
}

.image-inspiration-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.image-inspiration-card {
  display: grid;
  grid-template-rows: minmax(125px, 1fr) auto;
  gap: 9px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--neutral-900);
  overflow: hidden;
  text-align: left;
}

.image-inspiration-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
  box-shadow: none;
  transform: translateY(-1px);
}

.image-inspiration-card > img,
.image-prompt-starter-art,
.image-inspiration-skeleton > span {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-prompt-starter-art {
  position: relative;
  display: grid;
  place-items: end start;
  padding: 14px;
  background: #e8edf5;
  color: rgba(15, 23, 42, 0.5);
}

.image-prompt-starter-art::after {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-sm);
  content: "";
}

.image-prompt-starter-art > span {
  position: relative;
  z-index: 1;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.starter-image-lab { background: #f5d9e3; }
.starter-gemini-image { background: #d9eee7; }
.starter-gpt-image { background: #dce9ed; }

.image-inspiration-copy small {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.image-inspiration-skeleton {
  pointer-events: none;
}

.image-inspiration-skeleton > span,
.image-inspiration-skeleton > i {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-2) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: inspiration-shimmer 1.3s linear infinite;
}

.image-inspiration-skeleton > i {
  width: calc(100% - 22px);
  height: 27px;
  margin: 0 11px 11px;
  border-radius: 5px;
}

@keyframes inspiration-shimmer {
  to { background-position: -200% 0; }
}

.image-inspiration-copy {
  display: grid;
  gap: 3px;
  padding: 0 11px 11px;
}

.image-inspiration-copy strong {
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-inspiration-copy small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
}

@media (max-width: 780px) {
  .image-inspiration-panel {
    padding: 12px;
  }

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

  .image-inspiration-head {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .image-inspiration-head small {
    max-width: none;
    text-align: left;
  }
}

/* UX polish pass for compact desktop and mobile product flows. */
.product-page-billing .billing-dialog-layout {
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.36fr);
  align-items: start;
}

.product-page-billing .billing-account-summary,
.product-page-billing .billing-purchase-area {
  min-width: 0;
}

.product-page-billing .billing-summary {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
}

.product-page-billing .billing-summary strong {
  overflow: visible;
  line-height: 1.18;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.product-page-billing .billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.product-page-billing .topup-grid {
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
}

.product-page-billing .plan-card-head,
.product-page-billing .plan-price {
  flex-wrap: wrap;
}

.product-page-billing .plan-card-head {
  align-items: flex-start;
}

.product-page-billing .plan-card-head em {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

body.image-mode .media-price-quote {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px 12px;
}

body.image-mode .media-price-main {
  flex: 1 1 190px;
  flex-wrap: wrap;
  row-gap: 6px;
}

body.image-mode .media-price-quote > small {
  flex: 1 1 170px;
  min-width: 0;
  max-width: 100%;
}

body.image-mode .quick-prompts button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.workspace-asset-preview:disabled {
  border-style: dashed;
  background:
    linear-gradient(135deg, var(--surface-2), #eef2f6);
}

.workspace-asset-preview:disabled .workspace-asset-placeholder {
  gap: 8px;
  color: var(--neutral-700);
}

.workspace-asset-preview:disabled .workspace-asset-placeholder:not(.workspace-video-placeholder)::after {
  content: "Preview unavailable";
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
}

.workspace-asset-actions button:disabled {
  border-color: var(--neutral-300);
  background: var(--surface-2);
  color: var(--neutral-500);
  opacity: 1;
}

@media (max-width: 1180px) {
  .product-page-billing .billing-dialog-layout {
    grid-template-columns: minmax(258px, 0.72fr) minmax(0, 1.4fr);
    gap: 12px;
  }

  .product-page-billing .billing-account-summary,
  .product-page-billing .billing-purchase-area {
    padding: 12px;
  }

  .product-page-billing .plan-price b {
    font-size: var(--fs-xl);
  }
}

@media (max-width: 960px) {
  body.image-mode .media-price-quote > small {
    text-align: left;
  }
}

@media (max-width: 780px) {
  body.image-mode .media-price-main,
  body.image-mode .media-price-quote > small {
    flex: 0 1 auto;
  }

  body.image-mode .media-price-main {
    width: 100%;
  }

  .product-page-billing .billing-dialog-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
  }

  .product-page-billing .billing-purchase-area {
    order: 1;
    width: 100%;
  }

  .product-page-billing .billing-account-summary {
    order: 2;
    width: 100%;
  }

  .product-page-billing .billing-usage-list {
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }

  .product-page-billing .billing-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-page-billing .billing-summary span,
  .product-page-billing .billing-balance-grid span {
    padding: 8px;
  }

  .product-page-billing .billing-summary strong {
    font-size: var(--fs-sm);
  }

  .product-filter-panel {
    position: relative;
  }

  .product-filter-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 2px;
    width: 34px;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(248, 250, 252, 0), var(--surface-2) 78%);
  }

  .product-filter-panel .model-filter {
    scroll-snap-type: x proximity;
    padding: 0 30px 6px 2px;
  }

  .product-filter-panel .model-filter button {
    flex-basis: 142px;
    min-height: 60px;
    align-content: center;
    scroll-snap-align: start;
  }

  .product-filter-panel .model-filter button strong,
  .product-filter-panel .model-filter button small {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.18;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .product-filter-panel .model-filter b {
    align-self: start;
    margin-top: 1px;
  }
}

@media (max-width: 430px) {
  .product-page-billing .billing-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-page-billing .plan-price b {
    font-size: var(--fs-xl);
  }
}

/* Keep the result preview pane fixed instead of trapping wheel scroll. */
.product-page-studio .output-feed {
  overflow: hidden;
  overflow-y: hidden;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
  touch-action: auto;
}

body:not(.image-mode):not(.video-mode) .product-page-studio .output-feed,
body.image-mode .product-page-studio .output-feed,
body.image-mode .product-page-studio .output-feed:has(.image-empty-state),
body.image-mode .product-page-studio .output-feed:has(.image-inspiration-panel),
body.video-mode .product-page-studio .output-feed {
  overflow: hidden;
  overflow-y: hidden;
  overscroll-behavior: auto;
  scrollbar-gutter: auto;
}

body:not(.image-mode):not(.video-mode) .product-page-studio .output-feed {
  min-height: clamp(300px, 44vh, 390px);
  max-height: clamp(300px, 44vh, 390px);
}

body.image-mode .product-page-studio .output-feed,
body.video-mode .product-page-studio .output-feed {
  min-height: clamp(330px, 56vh, 520px);
  max-height: clamp(330px, 56vh, 520px);
  padding-bottom: 18px;
}

.product-page-studio .empty-state,
.product-page-studio .model-empty-state,
.product-page-studio .media-empty-state,
.product-page-studio .model-empty-card,
.product-page-studio .media-empty-card {
  min-height: 100%;
}

.prompt-box textarea,
body:not(.image-mode):not(.video-mode) .prompt-box textarea {
  height: 42px;
  min-height: 42px;
}

@media (min-width: 781px) {
  body.image-mode .prompt-box textarea,
  body.video-mode .prompt-box textarea {
    height: 76px;
    min-height: 76px;
    max-height: 120px;
  }
}

@media (max-width: 780px) {
  .product-page-studio .output-feed {
    overflow: visible;
    max-height: none;
  }

  body:not(.image-mode):not(.video-mode) .product-page-studio .output-feed {
    min-height: 220px;
  }

  body.image-mode .product-page-studio .output-feed,
  body.video-mode .product-page-studio .output-feed {
    min-height: 260px;
  }

  .prompt-box textarea,
  body.image-mode .prompt-box textarea,
  body.video-mode .prompt-box textarea {
    height: 72px;
    min-height: 72px;
    max-height: 110px;
  }
}

/* Single-screen media studio: no nested wheel zones on desktop. */
@media (min-width: 781px) {
  body[data-product-page="studio"].image-mode,
  body[data-product-page="studio"].video-mode {
    overflow: hidden;
  }

  body[data-product-page="studio"].image-mode .app-shell,
  body[data-product-page="studio"].video-mode .app-shell,
  body[data-product-page="studio"].image-mode .workspace,
  body[data-product-page="studio"].video-mode .workspace {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  body[data-product-page="studio"].image-mode .workspace,
  body[data-product-page="studio"].video-mode .workspace {
    height: calc(100vh - var(--header-height));
  }

  body[data-product-page="studio"].image-mode .product-page-studio,
  body[data-product-page="studio"].video-mode .product-page-studio,
  body[data-product-page="studio"].image-mode .studio-layout,
  body[data-product-page="studio"].video-mode .studio-layout,
  body[data-product-page="studio"].image-mode .studio-panel,
  body[data-product-page="studio"].video-mode .studio-panel {
    min-height: 0;
    overflow: hidden;
  }

  body[data-product-page="studio"].image-mode .product-page-studio,
  body[data-product-page="studio"].video-mode .product-page-studio {
    height: 100%;
  }

  body[data-product-page="studio"].image-mode .studio-layout,
  body[data-product-page="studio"].video-mode .studio-layout {
    flex: 1 1 auto;
    height: auto;
  }

  body[data-product-page="studio"].image-mode .studio-panel,
  body[data-product-page="studio"].video-mode .studio-panel {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-product-page="studio"].image-mode .app-shell,
  body[data-product-page="studio"].video-mode .app-shell {
    height: 100vh;
  }

  body[data-product-page="studio"].image-mode .workspace,
  body[data-product-page="studio"].video-mode .workspace {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body[data-product-page="studio"].image-mode .product-page-studio,
  body[data-product-page="studio"].video-mode .product-page-studio {
    gap: 8px;
  }

  body[data-product-page="studio"].image-mode .trust-strip,
  body[data-product-page="studio"].video-mode .trust-strip {
    flex: 0 0 auto;
  }

  body[data-product-page="studio"].image-mode .studio-panel,
  body[data-product-page="studio"].video-mode .studio-panel {
    flex: 1 1 auto;
    grid-template-rows: auto minmax(0, 1fr);
    align-content: stretch;
  }

  body[data-product-page="studio"].image-mode .panel-heading,
  body[data-product-page="studio"].video-mode .panel-heading {
    padding-bottom: 8px;
  }

  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer,
  body[data-product-page="studio"].image-mode .output-feed,
  body[data-product-page="studio"].video-mode .output-feed,
  body[data-product-page="studio"].image-mode .output-feed:has(.image-empty-state),
  body[data-product-page="studio"].image-mode .output-feed:has(.image-inspiration-panel) {
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow: hidden;
    overscroll-behavior: auto;
    scrollbar-width: none;
  }

  body[data-product-page="studio"].image-mode .composer::-webkit-scrollbar,
  body[data-product-page="studio"].video-mode .composer::-webkit-scrollbar,
  body[data-product-page="studio"].image-mode .output-feed::-webkit-scrollbar,
  body[data-product-page="studio"].video-mode .output-feed::-webkit-scrollbar {
    display: none;
  }

  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    align-self: stretch;
    gap: 10px;
    margin: 0;
    padding: 14px 16px;
  }

  body[data-product-page="studio"].image-mode .media-composer-heading,
  body[data-product-page="studio"].video-mode .media-composer-heading {
    gap: 3px;
    padding-bottom: 9px;
  }

  body[data-product-page="studio"].image-mode .media-composer-heading strong,
  body[data-product-page="studio"].video-mode .media-composer-heading strong {
    font-size: var(--fs-md);
    line-height: 1.15;
  }

  body[data-product-page="studio"].image-mode .media-composer-heading small,
  body[data-product-page="studio"].video-mode .media-composer-heading small {
    line-height: 1.35;
  }

  body[data-product-page="studio"].image-mode .reference-dropzone {
    min-height: 62px;
    padding: 10px;
  }

  body[data-product-page="studio"].image-mode .option-row,
  body[data-product-page="studio"].video-mode .option-row {
    gap: 8px;
  }

  body[data-product-page="studio"].image-mode .option-row label,
  body[data-product-page="studio"].video-mode .option-row label {
    min-width: 0;
  }

  body[data-product-page="studio"].image-mode .option-row select,
  body[data-product-page="studio"].video-mode .option-row select,
  body[data-product-page="studio"].video-mode .option-row input {
    height: 38px;
  }

  body[data-product-page="studio"].image-mode .prompt-box textarea,
  body[data-product-page="studio"].video-mode .prompt-box textarea {
    height: 84px;
    min-height: 84px;
    max-height: 128px;
  }

  body[data-product-page="studio"].image-mode .image-enhance-control {
    min-height: 44px;
    padding: 7px 0;
  }

  body[data-product-page="studio"].image-mode .media-price-quote,
  body[data-product-page="studio"].video-mode .media-price-quote {
    min-height: 50px;
    padding: 8px 10px;
  }

  body[data-product-page="studio"].image-mode .quick-prompts button,
  body[data-product-page="studio"].video-mode .quick-prompts button {
    min-height: 36px;
  }

  body[data-product-page="studio"].image-mode .image-inspiration-panel,
  body[data-product-page="studio"].image-mode .image-empty-state,
  body[data-product-page="studio"].video-mode .video-empty-state,
  body[data-product-page="studio"].image-mode .media-empty-card,
  body[data-product-page="studio"].video-mode .media-empty-card {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body[data-product-page="studio"].image-mode .image-inspiration-grid {
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
}

/* Keep the media submit action visible while the studio remains scrollbar-free. */
@media (min-width: 781px) {
  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    position: relative;
    padding-bottom: 108px;
  }

  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    position: absolute;
    right: 16px;
    bottom: 14px;
    left: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-top: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 18%);
  }

  body[data-product-page="studio"].image-mode .composer-submit-actions,
  body[data-product-page="studio"].video-mode .composer-submit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  body[data-product-page="studio"].image-mode .composer .primary-button,
  body[data-product-page="studio"].video-mode .composer .primary-button {
    width: 100%;
    min-height: 46px;
  }

  body[data-product-page="studio"].image-mode .quick-prompts,
  body[data-product-page="studio"].video-mode .quick-prompts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  body[data-product-page="studio"].image-mode .quick-prompts button,
  body[data-product-page="studio"].video-mode .quick-prompts button {
    min-height: 30px;
    padding: 3px 5px;
    font-size: var(--fs-xs);
    line-height: 1.15;
  }

  body[data-product-page="studio"].image-mode .media-price-quote,
  body[data-product-page="studio"].video-mode .media-price-quote {
    gap: 6px 8px;
  }

  body[data-product-page="studio"].image-mode .media-price-value,
  body[data-product-page="studio"].video-mode .media-price-value {
    font-size: var(--fs-base);
  }
}

@media (min-width: 781px) and (max-height: 820px) {
  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    gap: 8px;
    padding-bottom: 70px;
  }

  body[data-product-page="studio"].image-mode .quick-prompts,
  body[data-product-page="studio"].video-mode .quick-prompts {
    display: none;
  }

  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    bottom: 12px;
  }

  body[data-product-page="studio"].image-mode .media-composer-heading small,
  body[data-product-page="studio"].video-mode .media-composer-heading small {
    display: none;
  }

  body[data-product-page="studio"].image-mode .reference-dropzone {
    min-height: 54px;
  }

  body[data-product-page="studio"].image-mode .prompt-box textarea,
  body[data-product-page="studio"].video-mode .prompt-box textarea {
    height: 72px;
    min-height: 72px;
  }
}

/* Media studio scroll model: scroll content, pin the generation action. */
@media (min-width: 781px) {
  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-product-page="studio"].image-mode .output-feed,
  body[data-product-page="studio"].video-mode .output-feed,
  body[data-product-page="studio"].image-mode .output-feed:has(.image-empty-state),
  body[data-product-page="studio"].image-mode .output-feed:has(.image-inspiration-panel) {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-product-page="studio"].image-mode .composer::-webkit-scrollbar,
  body[data-product-page="studio"].video-mode .composer::-webkit-scrollbar,
  body[data-product-page="studio"].image-mode .output-feed::-webkit-scrollbar,
  body[data-product-page="studio"].video-mode .output-feed::-webkit-scrollbar {
    display: block;
    width: 8px;
  }

  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    z-index: 5;
    border-top: 1px solid var(--color-border);
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 22%),
      #fff;
  }

  body[data-product-page="studio"].image-mode .image-inspiration-panel,
  body[data-product-page="studio"].image-mode .image-empty-state,
  body[data-product-page="studio"].video-mode .video-empty-state,
  body[data-product-page="studio"].image-mode .media-empty-card,
  body[data-product-page="studio"].video-mode .media-empty-card {
    height: auto;
    min-height: 100%;
    overflow: visible;
  }

  body[data-product-page="studio"].image-mode .image-inspiration-grid {
    align-content: start;
    grid-template-rows: none;
    overflow: visible;
  }
}

/* Final media studio interaction model: both panes scroll, action stays pinned. */
@media (min-width: 781px) {
  body[data-product-page="studio"].image-mode .output-feed,
  body[data-product-page="studio"].video-mode .output-feed,
  body[data-product-page="studio"].image-mode .output-feed:has(.image-empty-state),
  body[data-product-page="studio"].image-mode .output-feed:has(.image-inspiration-panel) {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  body[data-product-page="studio"].image-mode .output-feed::-webkit-scrollbar,
  body[data-product-page="studio"].video-mode .output-feed::-webkit-scrollbar {
    display: block;
    width: 8px;
  }

  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    align-content: start;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    padding-bottom: 0;
  }

  body[data-product-page="studio"].image-mode .image-composer-heading,
  body[data-product-page="studio"].video-mode .image-composer-heading {
    order: 1;
  }

  body[data-product-page="studio"].image-mode .image-reference-control,
  body[data-product-page="studio"].video-mode .image-reference-control {
    order: 2;
  }

  body[data-product-page="studio"].image-mode .prompt-box,
  body[data-product-page="studio"].video-mode .prompt-box {
    order: 3;
  }

  body[data-product-page="studio"].image-mode .image-enhance-control,
  body[data-product-page="studio"].video-mode .image-enhance-control {
    order: 4;
  }

  body[data-product-page="studio"].image-mode #mediaOptions,
  body[data-product-page="studio"].video-mode #mediaOptions {
    order: 5;
  }

  body[data-product-page="studio"].image-mode .media-price-quote,
  body[data-product-page="studio"].video-mode .media-price-quote {
    order: 6;
  }

  body[data-product-page="studio"].image-mode .composer-notice,
  body[data-product-page="studio"].video-mode .composer-notice {
    order: 7;
  }

  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    position: sticky;
    right: auto;
    bottom: 0;
    left: auto;
    order: 8;
    margin: 4px -16px 0;
    border-top: 1px solid var(--color-border);
    padding: 10px 16px 14px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 24%),
      #fff;
    box-shadow: none;
  }
}

/* Video generator panel: closer to a purpose-built creation card. */
.video-workbench[hidden] {
  display: none;
}

.video-workbench {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.video-workbench-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 12px;
  box-shadow: none;
}

.video-workbench-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--neutral-900);
}

.video-workbench-title strong {
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
}

.video-workbench-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-primary) 11%, #fff);
  color: var(--color-primary);
  flex: 0 0 auto;
}

.video-workbench-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-tools-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--neutral-700);
  padding: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.video-tools-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-asset-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px;
  background: var(--surface-2);
}

.video-asset-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--neutral-700);
  padding: 0 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.video-asset-tabs button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.video-asset-tabs button.active {
  background: var(--surface);
  color: var(--neutral-900);
  box-shadow: none;
}

.video-keyframes-control,
.video-reference-control {
  display: grid;
  gap: 9px;
  min-width: 0;
}

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

.video-keyframe-tile {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 108px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neutral-900);
  padding: 10px;
  text-align: center;
}

.video-keyframe-tile:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 4%, #fff);
}

.video-keyframe-preview {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 16%, #fff), var(--color-primary-soft));
  color: var(--color-primary);
  overflow: hidden;
}

.video-keyframe-preview svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.video-keyframe-tile.has-preview .video-keyframe-preview {
  background: var(--neutral-900);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.video-keyframe-tile.has-preview .video-keyframe-preview svg {
  display: none;
}

.video-keyframe-tile strong {
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.2;
}

.video-keyframe-tile small {
  display: block;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.video-template-card,
.video-model-card {
  display: grid;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--neutral-900);
  padding: 10px 12px;
  text-align: left;
  box-shadow: none;
}

.video-template-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 64px;
}

.video-model-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
}

.video-template-card:hover,
.video-model-card:hover {
  border-color: rgba(10, 16, 32, 0.16);
  background: var(--surface-2);
}

.video-template-icon,
.video-model-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-primary) 11%, #fff);
  color: var(--color-primary);
}

.video-template-logo,
.video-model-logo {
  width: 22px;
  height: 22px;
  box-shadow: none;
}

.video-template-logo svg,
.video-model-logo svg {
  width: 18px;
  height: 18px;
}

.video-template-copy,
.video-model-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.video-template-copy strong,
.video-model-copy strong {
  overflow: hidden;
  font-size: var(--fs-base);
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-template-copy small,
.video-model-copy small {
  overflow: hidden;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-template-card > svg,
.video-model-card > svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body.video-mode .media-composer-heading {
  display: none;
}

body.video-mode .quick-prompts,
body.video-mode .media-price-quote {
  display: none;
}

body.video-mode .prompt-box textarea {
  height: 88px;
  min-height: 88px;
  max-height: 120px;
}

body.video-mode .video-reference-control {
  min-width: 0;
}

body.video-mode .video-reference-control .reference-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.video-mode .composer .primary-button {
  min-height: 52px;
  border: 0;
  background: linear-gradient(180deg, var(--color-warning), color-mix(in srgb, var(--color-warning) 80%, var(--neutral-900)));
  color: var(--neutral-900);
  box-shadow: none;
}

body.video-mode .composer .primary-button:focus-visible {
  outline: 3px solid var(--color-primary-ring);
  outline-offset: 2px;
}

body.video-mode .composer .primary-button svg {
  fill: currentColor;
}

body.video-mode .composer-actions {
  gap: 6px;
}

@media (min-width: 781px) {
  body.video-mode .studio-panel {
    grid-template-columns: minmax(340px, 382px) minmax(0, 1fr);
  }

  body.video-mode .media-composer-heading {
    padding-bottom: 6px;
  }

  body.video-mode .media-composer-heading small {
    display: none;
  }

  body.video-mode .video-workbench {
    order: 2;
  }

  body[data-product-page="studio"].video-mode #mediaOptions {
    order: 4;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-product-page="studio"].video-mode .prompt-box {
    order: 3;
  }

  body[data-product-page="studio"].video-mode .media-price-quote {
    order: 5;
    min-height: 46px;
    padding: 7px 10px;
  }

  body[data-product-page="studio"].video-mode .composer-notice {
    order: 6;
  }

  body[data-product-page="studio"].video-mode .composer-actions {
    order: 7;
  }

  body[data-product-page="studio"].video-mode .option-row label:first-child {
    grid-column: auto;
  }

  body[data-product-page="studio"].video-mode .media-price-quote > small {
    display: none;
  }

  body.video-mode .video-empty-card {
    width: min(100%, 920px, calc((100vh - 220px) * 16 / 9));
    margin: 0 auto;
  }

  body.video-mode .video-empty-card .media-empty-stage {
    width: 100%;
    min-height: 260px;
  }
}

/* Mobile media actions stay full-width and predictable below the scrollable controls. */
@media (max-width: 780px) {
  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
  }

  body[data-product-page="studio"].image-mode .composer-submit-actions,
  body[data-product-page="studio"].video-mode .composer-submit-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-width: 0;
  }

  body[data-product-page="studio"].image-mode .composer .primary-button,
  body[data-product-page="studio"].video-mode .composer .primary-button {
    width: 100%;
    min-width: 0;
  }

  /* Frontend-integrator: 移动端 home — 必须释放 .app-shell / .workspace 的固定高度，
     让 studio-panel 按内容自然流（h1 → orbit panel → 8 capability 卡 → creation rail → composer）。
     否则 .app-shell { min-height: 100dvh } + .workspace { overflow:hidden } 会把 outputFeed 内容
     裁剪，让 orbit-creation-card 与 capability 卡重叠、capability 卡被 composer 覆盖。 */
  body.global-home {
    overflow-y: auto;
  }
  body.global-home .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  body.global-home .workspace {
    height: auto;
    overflow: visible;
    padding-bottom: 14px;
  }
  body.global-home .studio-panel {
    height: auto;
    grid-template-rows: auto auto;
    overflow: visible;
  }
  body.global-home .output-feed {
    overflow: visible;
    height: auto;
  }
}

/* Mobile media workflow: controls first, results second. */
@media (max-width: 780px) {
  body[data-product-page="studio"].image-mode .studio-panel,
  body[data-product-page="studio"].video-mode .studio-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: auto;
    overflow: visible;
  }

  body[data-product-page="studio"].image-mode .panel-heading,
  body[data-product-page="studio"].video-mode .panel-heading {
    order: 1;
  }

  body[data-product-page="studio"].image-mode .composer,
  body[data-product-page="studio"].video-mode .composer {
    order: 2;
  }

  body[data-product-page="studio"].image-mode .output-feed,
  body[data-product-page="studio"].video-mode .output-feed {
    order: 3;
  }

  body[data-product-page="studio"].image-mode .media-composer-heading,
  body[data-product-page="studio"].video-mode .media-composer-heading {
    display: none;
  }

  body[data-product-page="studio"].image-mode .prompt-box,
  body[data-product-page="studio"].video-mode .prompt-box {
    order: 1;
  }

  body[data-product-page="studio"].image-mode .media-price-quote,
  body[data-product-page="studio"].video-mode .media-price-quote {
    order: 2;
  }

  body[data-product-page="studio"].image-mode .composer-notice,
  body[data-product-page="studio"].video-mode .composer-notice {
    order: 3;
  }

  body[data-product-page="studio"].image-mode .composer-actions,
  body[data-product-page="studio"].video-mode .composer-actions {
    order: 4;
  }

  body[data-product-page="studio"].image-mode .image-reference-control,
  body[data-product-page="studio"].video-mode .video-workbench {
    order: 5;
  }

  body[data-product-page="studio"].image-mode .image-enhance-control,
  body[data-product-page="studio"].video-mode .image-reference-control {
    order: 6;
  }

  body[data-product-page="studio"].image-mode #mediaOptions,
  body[data-product-page="studio"].video-mode #mediaOptions {
    order: 7;
  }
}

/* ==========================================================================
   HOME PAGE — body.global-home 统一浅色主题
   保留 Orbit 圆环作为品牌点缀
   ========================================================================== */

body.global-home {
  background: var(--bg);
  color: var(--neutral-900);
}

body.app-loading {
  background: var(--bg);
}

body.app-loading .app-shell {
  visibility: hidden;
}

body.app-loading::after {
  position: fixed;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: auto;
  border: 2px solid rgba(99, 102, 241, 0.18);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  content: "";
  animation: spin 0.8s linear infinite;
}

body.global-home .app-header {
  border-color: var(--neutral-300);
  background: var(--surface);
  color: var(--neutral-900);
  box-shadow: none;
}

/* brand-logo: 保留原始颜色，不做翻转 */

body.global-home .product-nav {
  border-color: var(--neutral-300);
  background: var(--surface-2);
  box-shadow: none;
}

body.global-home .product-nav button {
  border-radius: var(--radius-sm);
  color: var(--neutral-700);
}

body.global-home .product-nav button:hover {
  background: var(--surface-2);
  color: var(--neutral-900);
}

body.global-home .product-nav button.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 0 1px var(--color-primary-soft);
}

body.global-home .language-toggle,
body.global-home .header-billing-button,
body.global-home .account-chip {
  border-color: var(--neutral-300);
  background: var(--surface-2);
  color: var(--neutral-900);
}

body.global-home .account-chip strong {
  color: var(--neutral-900);
}

body.global-home .account-chip small,
body.global-home .header-billing-button span {
  color: var(--neutral-700);
}

body.global-home .workspace {
  background: transparent;
}

body.global-home .studio-panel {
  width: 100%;
  background: transparent;
}

body.global-home .output-feed {
  width: min(100%, 1180px);
  padding: clamp(24px, 5vh, 58px) 14px 14px;
}

body.global-home .home-empty-state {
  width: 100%;
  max-width: 1180px;
  gap: 16px;
}

body.global-home .home-command-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 18px;
  align-items: stretch;
}

body.global-home .home-copy {
  align-content: center;
  justify-items: start;
  text-align: left;
}

body.global-home .home-kicker {
  border-color: var(--color-primary-soft);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

body.global-home .home-copy h1 {
  max-width: 620px;
  color: var(--neutral-900);
  font-size: var(--fs-xl);  /* 28px —— 视觉方向硬约束 ≤ 32 */
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

body.global-home .home-copy p {
  max-width: 620px;
  color: var(--neutral-700);
}

body.global-home .home-trust-signals {
  justify-content: flex-start;
}

body.global-home .home-trust-signals span {
  border-color: var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neutral-900);
}

.orbit-home-panel,
.studio-orbit-panel {
  min-width: 0;
  max-width: var(--right-panel-width);  /* ≤25% 上限，1280 视口 300px */
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--neutral-900);
  box-shadow: none;
}

.orbit-home-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.orbit-core {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 210px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  isolation: isolate;
}

.orbit-core::before {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: conic-gradient(from 230deg, var(--color-primary), var(--color-primary-soft), var(--color-primary), var(--color-primary-soft), var(--color-primary));
  content: "";
  filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.24));
}

.orbit-core::after {
  position: absolute;
  inset: 42px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--neutral-300);
  content: "";
}

.orbit-core strong,
.orbit-core small {
  position: relative;
  z-index: 2;
  display: block;
}

.orbit-core strong {
  color: var(--color-primary);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1;
}

.orbit-core small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.orbit-ring,
.orbit-dot {
  position: absolute;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
}

.orbit-ring {
  border: 1px solid var(--neutral-300);
}

.orbit-ring-a { inset: 3px; }
.orbit-ring-b { inset: 28px; transform: rotate(18deg) scaleX(0.92); }
.orbit-ring-c { inset: 58px; transform: rotate(-22deg) scaleY(0.82); }

.orbit-dot {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 18px currentColor;
}

.orbit-dot-lime {
  top: 22px;
  right: 54px;
  background: var(--color-primary);
  color: var(--color-primary);
}

.orbit-dot-cyan {
  right: 20px;
  bottom: 64px;
  background: var(--color-primary);
  color: var(--color-primary);
}

.orbit-dot-pink {
  bottom: 34px;
  left: 48px;
  background: var(--color-danger);
  color: var(--color-danger);
}

.orbit-status-grid,
.studio-orbit-metrics {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--neutral-300);
}

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

.orbit-status-grid span,
.studio-orbit-metrics span {
  display: grid;
  gap: 4px;
  min-width: 0;
  background: var(--surface-2);
  padding: 10px;
}

.orbit-status-grid strong,
.studio-orbit-metrics b {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orbit-status-grid small,
.studio-orbit-metrics small,
.orbit-balance-line small,
.studio-orbit-copy small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.3;
}

.orbit-balance-line {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(209, 254, 23, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(209, 254, 23, 0.08);
  padding: 10px;
}

.orbit-balance-line strong {
  overflow: hidden;
  color: var(--color-primary);
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orbit-route-board {
  display: grid;
  gap: 7px;
}

body.global-home .home-route-row {
  border-color: var(--neutral-300);
  background: var(--surface-2);
}

body.global-home .home-route-row > b {
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--neutral-900);
}

body.global-home .home-route-row strong {
  color: var(--neutral-900);
}

body.global-home .home-route-row small {
  color: var(--neutral-700);
}

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

body.global-home .home-kind-status,
body.global-home .home-brand-pill {
  border-color: var(--neutral-300);
  background: var(--surface-2);
}

body.global-home .home-kind-status strong,
body.global-home .home-brand-pill small {
  color: var(--neutral-900);
}

body.global-home .home-kind-status small {
  color: var(--neutral-700);
}

.orbit-brand-cloud {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.orbit-brand-cloud::-webkit-scrollbar {
  display: none;
}

.orbit-brand-cloud .home-brand-pill {
  flex: 0 0 auto;
}

body.global-home .home-capability-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.global-home .home-capability {
  border-color: var(--neutral-300);
  background: var(--surface-2);
  color: var(--neutral-900);
}

body.global-home .home-capability:hover {
  border-color: var(--color-primary-soft);
  background: var(--surface-3);
}

body.global-home .home-capability strong,
body.global-home .home-capability b {
  color: var(--neutral-900);
}

body.global-home .home-capability small {
  color: var(--neutral-700);
}

body.global-home .task-kind-icon {
  border-color: var(--color-primary-soft);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.orbit-creation-rail {
  display: flex;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  min-height: 90px;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 6px;
  contain: inline-size;
  scrollbar-width: none;
}

.orbit-creation-rail::-webkit-scrollbar {
  display: none;
}

.orbit-creation-card {
  display: grid;
  gap: 5px;
  flex: 0 0 190px;
  min-height: 82px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 12px;
}

.orbit-creation-card b {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-sm);
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orbit-creation-card small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
}

body.global-home .composer {
  border-color: var(--neutral-300);
  background: var(--surface);
  box-shadow: none;
}

body.global-home .composer .primary-button {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: none;
}

.studio-orbit-mount {
  display: none;
  min-width: 0;
}

body.global-home .studio-orbit-mount,
body[data-product-page="studio"]:not(.image-mode):not(.video-mode):not(.show-orbit) .studio-orbit-mount {
  display: none;
}

.studio-orbit-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  height: 100%;
  padding: 14px;
}

.studio-orbit-graphic {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 116px);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
}

.studio-orbit-graphic span {
  position: absolute;
  border-radius: 50%;
}

.studio-orbit-graphic span:nth-child(1) {
  inset: 5px;
  background: transparent;
  border: 2px solid var(--color-primary);
  border-top-color: var(--color-primary-strong);
}

.studio-orbit-graphic span:nth-child(2) {
  inset: 22px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.studio-orbit-graphic span:nth-child(3) {
  inset: 44px;
  border: 1px solid var(--color-border);
}

.studio-orbit-graphic strong {
  position: relative;
  z-index: 1;
  color: var(--color-primary);
  font-size: var(--fs-md);
  font-weight: 600;
}

.studio-orbit-graphic .studio-orbit-icon,
.studio-orbit-graphic svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
}

@media (max-width: 390px) {
  .studio-orbit-graphic { width: 40px !important; height: 40px !important; opacity: 0.85; }
  .studio-orbit-graphic span:nth-child(1) { inset: 2px; border-width: 1px; }
  .studio-orbit-graphic span:nth-child(2) { inset: 8px; }
  .studio-orbit-graphic span:nth-child(3) { inset: 18px; }
  .studio-orbit-graphic .studio-orbit-icon, .studio-orbit-graphic svg { width: 12px; height: 12px; }
}

.model-route-badge {
  width: 56px; height: 56px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
}

.model-route-badge .studio-orbit-graphic { width: 100%; height: 100%; }
.model-route-badge .studio-orbit-graphic span:nth-child(1) { inset: 2px; border-width: 1.5px; }
.model-route-badge .studio-orbit-graphic span:nth-child(2) { inset: 10px; }
.model-route-badge .studio-orbit-graphic span:nth-child(3) { inset: 22px; }
.model-route-badge .studio-orbit-graphic .studio-orbit-icon,
.model-route-badge .studio-orbit-graphic svg { width: 16px; height: 16px; }

@media (max-width: 390px) { .model-route-badge { display: none; } }

.studio-orbit-copy {
  display: grid;
  gap: 5px;
  text-align: center;
}

.studio-orbit-copy .eyebrow {
  color: var(--color-primary);
}

.studio-orbit-copy strong {
  overflow: hidden;
  color: var(--neutral-900);
  font-size: var(--fs-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-orbit-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-orbit-metrics {
  grid-template-columns: minmax(0, 1fr);
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-panel {
  width: min(100%, 1240px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto auto;
  column-gap: 0;
  row-gap: 8px;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .workspace {
  padding: 12px 8px 18px;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .panel-heading {
  grid-column: 1 / -1;
  width: 100%;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .output-feed {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-height: auto;
  overflow: visible;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .composer {
  grid-column: 1;
  grid-row: 3;
  width: 100%;
  max-width: none;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .composer textarea {
  min-height: 88px;
  max-height: 320px;
  padding: 12px 4px;
  line-height: 1.6;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-orbit-mount {
  grid-column: 1;
  grid-row: 4;
  min-height: 0;
  width: 100%;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-orbit-panel,
body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .preset-pill,
body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .preset-name {
  width: 240px;
  max-width: 240px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .model-empty-card { max-width: none; width: 100%; }

body.image-mode .studio-orbit-mount,
body.video-mode .studio-orbit-mount {
  display: none;
}

@media (max-width: 1040px) {
  body.global-home .home-command-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  body.global-home .home-copy {
    justify-items: center;
    text-align: center;
  }

  body.global-home .home-trust-signals {
    justify-content: center;
  }

  body.global-home .orbit-brand-cloud {
    display: none;
  }

  body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .studio-orbit-panel { position: static; width: 100%; max-width: none; }

  body[data-product-page="studio"]:not(.image-mode):not(.video-mode) .composer {
    grid-row: 4;
  }

  .studio-orbit-panel {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    height: auto;
  }

  .studio-orbit-graphic {
    width: 116px;
  }

  .studio-orbit-copy {
    text-align: left;
  }

  .studio-orbit-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  body.global-home .output-feed {
    padding: 18px 6px 10px;
  }

  body.global-home .home-command-deck {
    gap: 12px;
  }

  body.global-home .home-copy h1 {
    font-size: var(--fs-xl);
  }

  .orbit-home-panel {
    grid-template-columns: 118px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 10px;
  }

  .orbit-core {
    grid-row: 1 / span 2;
    width: 118px;
  }

  .orbit-core strong {
    font-size: var(--fs-xl);
  }

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

  body.global-home .orbit-route-board,
  body.global-home .orbit-kind-grid,
  body.global-home .orbit-brand-cloud {
    display: none;
  }

  body.global-home .orbit-balance-line,
  body.global-home .orbit-status-grid span {
    padding: 7px;
  }

  body.global-home .home-capability-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    min-height: 102px;
    padding-bottom: 5px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.global-home .home-capability-grid::-webkit-scrollbar {
    display: none;
  }

  body.global-home .home-capability {
    grid-template-columns: 34px minmax(0, 1fr);
    grid-template-rows: auto auto;
    flex: 0 0 238px;
    min-height: 92px;
    scroll-snap-align: start;
  }

  body.global-home .home-capability-icon {
    grid-row: 1 / -1;
  }

  body.global-home .home-capability small {
    display: block;
  }

  body.global-home .home-capability b {
    grid-column: 2;
  }

  .orbit-creation-card {
    flex-basis: 168px;
  }

  .studio-orbit-panel {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-orbit-copy {
    text-align: center;
  }

  .studio-orbit-metrics {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Orbit desktop fit pass: keep the first screen actionable. */
@media (min-width: 1041px) {
  body.global-home .output-feed {
    padding-top: clamp(16px, 3vh, 30px);
  }

  body.global-home .home-empty-state {
    gap: 12px;
  }

  body.global-home .home-command-deck {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  }

  body.global-home .home-copy {
    gap: 10px;
  }

  body.global-home .home-copy h1 {
    font-size: var(--fs-xl);
  }

  body.global-home .orbit-home-panel {
    grid-template-columns: 148px minmax(0, 1fr);
    align-items: center;
    align-content: start;
    gap: 9px;
    padding: 12px;
  }

  body.global-home .orbit-core {
    grid-row: 1 / span 2;
    width: 148px;
  }

  body.global-home .orbit-core strong {
    font-size: var(--fs-xl);
  }

  body.global-home .orbit-core small {
    font-size: var(--fs-xs);
  }

  body.global-home .orbit-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.global-home .orbit-status-grid span,
  body.global-home .studio-orbit-metrics span,
  body.global-home .orbit-balance-line {
    padding: 7px;
  }

  body.global-home .orbit-route-board,
  body.global-home .orbit-kind-grid {
    grid-column: 1 / -1;
  }

  body.global-home .home-route-row {
    min-height: 42px;
    padding: 5px 7px;
  }

  body.global-home .home-route-row > b {
    width: 28px;
    height: 28px;
  }

  body.global-home .orbit-kind-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  body.global-home .home-kind-status {
    min-height: 62px;
    padding: 7px;
  }

  body.global-home .orbit-brand-cloud {
    display: none;
  }

  body.global-home .home-capability {
    min-height: 94px;
    padding: 11px;
  }

  body.global-home .orbit-creation-card {
    min-height: 70px;
    padding: 10px;
  }

  body.global-home .orbit-creation-rail {
    min-height: 78px;
  }

  body.global-home .composer {
    padding: 12px 14px;
  }

  body.global-home .prompt-box textarea {
    min-height: 58px;
  }
}

/* Spec alignment pass: keep the real app close to the Orbit prototype. */
@media (min-width: 1181px) {
  body[data-product-page="studio"] .app-shell {
    grid-template-columns: 276px minmax(0, 1fr);
  }

  body[data-product-page="studio"] .side-panel {
    grid-column: 1;
    grid-row: 2;
  }

  body[data-product-page="studio"] .workspace {
    grid-column: 2;
    grid-row: 2;
  }
}

body.global-home .app-shell {
  grid-template-columns: 276px minmax(0, 1fr);
}

body.global-home .side-panel {
  display: flex;
  border-right-color: var(--color-border);
  background: var(--bg);  /* 与主区统一浅色背景，遵守视觉方向 §1 */
  color: var(--neutral-900);
}

body.global-home .side-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px;
}

body.global-home .section-heading small,
body.global-home .side-model-copy,
body.global-home .task-nav-button small,
body.global-home .asset-row strong {
  color: var(--neutral-700);
}

body.global-home .section-heading .eyebrow {
  color: var(--color-primary);
}

body.global-home .task-nav {
  gap: 8px;
}

body.global-home .task-nav-button {
  min-height: 54px;
  border-color: var(--surface-2);
  border-radius: var(--radius-sm);
  background: rgba(247, 247, 248, 0.05);
  color: var(--neutral-900);
}

body.global-home .task-nav-button:hover,
body.global-home .task-nav-button.active {
  border-color: var(--color-primary-soft);
  background: rgba(247, 247, 248, 0.09);
  box-shadow: none;
}

body.global-home .task-nav-button strong,
body.global-home .asset-row span,
body.global-home .model-nav-group-label,
body.global-home .model-name {
  color: var(--neutral-900);
}

body.global-home .task-nav-icon {
  border-color: rgba(209, 254, 23, 0.24);
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

body.global-home .asset-row,
body.global-home .section-action {
  border-color: var(--neutral-300);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neutral-900);
}

body.global-home .model-nav-button {
  border-color: var(--surface-2);
  border-radius: var(--radius-sm);
  background: rgba(247, 247, 248, 0.04);
}

body.global-home .model-kind {
  color: var(--neutral-700);
}

body.global-home .studio-layout {
  max-width: none;
}

body.global-home .studio-panel {
  /* Frontend-integrator: home 三个子节点（studio-orbit-mount display:none 后剩 output-feed + composer）
     必须各自自然高度，不能用 1fr + height:100% 让 output-feed 内容被 overflow:hidden 裁剪，
     且 composer 在 grid 第二行与 capability 卡重叠（VisualQA 390 视口 elementFromPoint 实测）。 */
  grid-template-rows: auto auto;
  height: auto;
  min-height: 0;
  overflow: visible;
}

body.global-home .output-feed {
  overflow: visible;
  height: auto;
  min-height: 0;
}

body.global-home .output-feed {
  justify-content: flex-start;
  width: min(100%, 1180px);
  padding: clamp(18px, 3.6vh, 34px) 14px 12px;
}

body.global-home:not(.image-mode):not(.video-mode) .product-page-studio .output-feed {
  min-height: 0;
  max-height: none;
  overflow: visible;
  overflow-y: visible;
}

body.global-home .home-empty-state {
  width: 100%;
  max-width: 1180px;
  gap: 12px;
  min-height: 0;
}

body.global-home .home-command-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 18px;
  align-items: start;
}

body.global-home .home-copy {
  justify-items: start;
  align-content: center;
  text-align: left;
}

body.global-home .home-copy h1 {
  max-width: 680px;
  font-size: var(--fs-xl);
}

body.global-home .home-copy p {
  max-width: 620px;
}

body.global-home .home-trust-signals {
  justify-content: flex-start;
}

body.global-home .home-capability-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.global-home .home-capability {
  min-height: 168px;
  border-radius: var(--radius-sm);
  padding: 10px;
}

body.global-home .home-capability b {
  color: var(--color-primary);
}

body.global-home .composer {
  width: min(100%, 1180px);
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
}

body.global-home .orbit-creation-rail {
  min-height: 74px;
}

body.global-home .orbit-creation-card {
  flex-basis: 176px;
  min-height: 68px;
}

body.global-home .orbit-home-panel {
  max-height: none;
  overflow: visible;
}

body.global-home .orbit-kind-grid {
  display: none;
}

@media (min-width: 781px) {
  body.global-home .studio-panel {
    row-gap: 12px;
  }

  body.global-home:not(.image-mode):not(.video-mode) .product-page-studio,
  body.global-home:not(.image-mode):not(.video-mode) .studio-layout,
  body.global-home:not(.image-mode):not(.video-mode) .studio-panel {
    height: 100%;
    min-height: 0;
  }

  body.global-home:not(.image-mode):not(.video-mode) .studio-panel {
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: visible;
  }

  body.global-home:not(.image-mode):not(.video-mode) .product-page-studio .output-feed {
    overflow: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding-bottom: 28px;
  }
}

@media (max-width: 1180px) {
  body.global-home .app-shell {
    grid-template-columns: 1fr;
  }

  body.global-home .side-panel {
    display: none;
  }

  body.global-home .workspace {
    grid-column: 1;
  }

  body.global-home .home-command-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  body.global-home .home-copy,
  body.global-home .home-trust-signals {
    justify-items: center;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 780px) {
  body.global-home .home-capability-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.global-home .home-capability-grid::-webkit-scrollbar {
    display: none;
  }

  body.global-home .home-capability {
    flex: 0 0 236px;
    scroll-snap-align: start;
  }
}

/* Orbit V2 product pages: models, creations, and plans share one product language. */
body[data-product-page="models"] .workspace,
body[data-product-page="assets"] .workspace,
body[data-product-page="billing"] .workspace {
  background: var(--surface-2);
  color: var(--neutral-900);
}

.product-page:not(.product-page-studio) {
  width: min(1220px, 100%);
  gap: 18px;
  padding: 18px 4px 40px;
}

.product-page:not(.product-page-studio) .product-page-head {
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 2px 16px;
}

.product-page:not(.product-page-studio) .product-page-head h1 {
  max-width: 760px;
  margin-top: 8px;
  font-size: var(--fs-xl);
  line-height: 1.08;
  letter-spacing: 0;
}

.product-page:not(.product-page-studio) .product-page-head p {
  max-width: 740px;
  font-size: var(--fs-sm);
}

.product-page:not(.product-page-studio) .section-action {
  min-height: 40px;
  border-color: var(--neutral-900);
  border-radius: var(--radius-xs);
  background: var(--neutral-900);
  color: #fff;
}

.product-model-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--color-border);
}

.product-model-overview > span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 18px;
  border-right: 1px solid var(--color-border);
}

.product-model-overview > span:first-child { padding-left: 2px; }
.product-model-overview > span:last-child { border-right: 0; }

.product-model-overview strong {
  color: var(--neutral-900);
  font-size: var(--fs-xl);
  line-height: 1;
}

.product-model-overview small {
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.product-page-models .product-library-layout {
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 18px;
}

.product-page-models .product-filter-panel,
.product-page-models .product-library-main {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.product-page-models .product-filter-panel {
  gap: 10px;
  padding: 0;
}

.product-page-models .product-filter-panel .model-filter {
  display: grid;
  gap: 4px;
}

.product-page-models .product-filter-panel .model-filter button {
  min-height: 58px;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 9px 10px;
}

.product-page-models .product-filter-panel .model-filter button.active {
  background: var(--neutral-900);
  color: #fff;
  box-shadow: none;
}

.product-page-models .product-filter-panel .model-filter button.active small,
.product-page-models .product-filter-panel .model-filter button.active b {
  color: var(--color-primary);
}

.product-page-models .product-toolbar {
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.product-page-models .product-model-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  overflow: visible;
  padding: 0;
}

.product-page-models .product-pagination {
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 9px 10px;
}

.product-model-card {
  grid-template-rows: auto auto auto auto auto;
  gap: 12px;
  min-height: 326px;
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  padding: 15px;
  cursor: default;
}

.product-model-card:hover,
.product-model-card.active {
  border-color: color-mix(in srgb, var(--color-primary) 48%, var(--neutral-500));
  box-shadow: none;
}

.product-model-card.active { box-shadow: inset 3px 0 0 var(--color-primary); }

.product-model-card-head,
.product-model-status,
.product-model-use,
.plan-credit-line,
.plan-feature-list small,
.plan-action {
  display: flex;
  align-items: center;
}

.product-model-card-head { justify-content: space-between; gap: 10px; }

.product-model-status {
  gap: 6px;
  color: var(--neutral-700);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.product-model-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neutral-500);
}

.product-model-status.live { color: var(--color-success); }
.product-model-status.live i { background: var(--color-success); box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12); }

.product-model-copy { display: grid; gap: 5px; }
.product-model-copy h2 { margin: 0; color: var(--neutral-900); font-size: var(--fs-lg); line-height: 1.15; }
.product-model-copy p { min-height: 38px; margin: 0; }

.product-model-kind {
  color: var(--color-primary);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.product-model-facts {
  display: grid;
  gap: 0;
  margin: 0;
  border-block: 1px solid var(--color-border);
}

.product-model-facts > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--color-border);
}

.product-model-facts > div:last-child { border-bottom: 0; }
.product-model-facts dt { color: var(--neutral-700); font-size: var(--fs-xs); font-weight: 600; }
.product-model-facts dd { overflow: hidden; margin: 0; color: var(--neutral-700); font-size: var(--fs-xs); font-weight: 600; text-align: right; text-overflow: ellipsis; white-space: nowrap; }

.product-model-use {
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--neutral-900);
  color: #fff;
  padding: 0 11px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.product-model-use svg,
.plan-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-model-use:disabled { cursor: not-allowed; background: var(--neutral-300); color: var(--neutral-500); }

.product-page-assets .product-dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-block: 1px solid var(--color-border);
}

.product-page-assets .product-dashboard-grid span {
  display: flex;
  align-items: baseline;
  gap: 8px;
  border: 0;
  border-right: 1px solid var(--color-border);
  border-radius: 0;
  padding: 12px 16px;
}

.product-page-assets .product-dashboard-grid span:first-child { padding-left: 2px; }
.product-page-assets .product-dashboard-grid span:last-child { border-right: 0; }

.product-page-assets .product-tabs {
  align-self: flex-start;
  gap: 3px;
  width: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  padding: 3px;
}

.product-page-assets .product-tabs button { min-height: 34px; border-radius: 5px; padding: 0 16px; }
.product-page-assets .product-tabs button.active { background: var(--neutral-900); color: #fff; }

.product-page-assets .product-card-surface {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.creation-library-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.creation-kind-filter { display: flex; align-items: center; gap: 5px; }

.creation-kind-filter button {
  min-height: 36px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--neutral-700);
  padding: 0 12px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.creation-kind-filter button { transition: border-color 120ms ease, background 120ms ease; }
.creation-kind-filter button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.creation-kind-filter button.active { border-color: var(--neutral-900); background: var(--neutral-900); color: var(--surface); }

.creation-search-field {
  position: relative;
  display: flex;
  align-items: center;
  justify-self: end;
  width: min(420px, 100%);
}

.creation-search-field svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--neutral-700);
  stroke-width: 1.8;
}

.creation-search-field input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  padding: 0 12px 0 38px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.creation-search-field input:focus-visible {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--color-primary-ring);
}

.creation-library-toolbar > small { color: var(--neutral-700); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }

.product-page-assets .product-asset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-page-assets .workspace-asset-card {
  grid-template-rows: auto auto auto auto;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 10px;
}

.product-page-assets .workspace-asset-preview { aspect-ratio: 4 / 3; border-radius: var(--radius-xs); }

.workspace-text-preview {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  background: #edf7f2;
  padding: 22px;
}

.workspace-text-preview i { display: block; width: 84%; height: 7px; border-radius: 2px; background: #b6d7c7; }
.workspace-text-preview i:nth-child(2) { width: 100%; }
.workspace-text-preview i:nth-child(3) { width: 66%; }
.workspace-text-preview b { position: absolute; right: 12px; bottom: 10px; color: var(--color-success); font-size: var(--fs-xs); }

.product-page-assets .workspace-asset-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-page-assets .workspace-asset-actions button { min-height: 34px; border-radius: var(--radius-xs); font-size: var(--fs-xs); }

.product-page-billing .billing-sheet { display: grid; gap: 18px; }

.product-page-billing .billing-hero-summary {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(340px, auto);
  align-items: center;
  gap: 22px;
  min-height: 174px;
  border-radius: var(--radius-sm);
  background: var(--neutral-900);
  color: #fff;
  padding: 22px 26px;
}

.billing-orbit {
  display: grid;
  place-items: center;
  width: 116px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) var(--billing-progress), var(--neutral-300) 0);
}

.billing-orbit::before {
  grid-area: 1 / 1;
  width: 88px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--neutral-900);
  content: "";
}

.billing-orbit > span { z-index: 1; display: grid; grid-area: 1 / 1; text-align: center; }
.billing-orbit strong { max-width: 76px; overflow: hidden; font-size: var(--fs-md); line-height: 1; text-overflow: ellipsis; }
.billing-orbit small { margin-top: 4px; color: var(--color-primary); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }

.billing-hero-copy { display: grid; gap: 5px; }
.billing-hero-copy .eyebrow { color: var(--color-primary); }
.billing-hero-copy h2 { margin: 0; color: #fff; font-size: var(--fs-xl); }
.billing-hero-copy p { max-width: 480px; margin: 0; color: var(--neutral-500); font-size: var(--fs-xs); line-height: 1.5; }

.billing-hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(96px, 1fr)); border-left: 1px solid var(--neutral-300); }
.billing-hero-metrics > span { display: grid; gap: 5px; padding: 9px 16px; border-right: 1px solid var(--neutral-300); }
.billing-hero-metrics > span:last-child { border-right: 0; }
.billing-hero-metrics small { color: var(--neutral-500); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }
.billing-hero-metrics strong { color: #fff; font-size: var(--fs-md); }

.product-page-billing .billing-dialog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.product-page-billing .billing-purchase-area,
.product-page-billing .billing-account-summary {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.billing-plan-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 2px;
}

.billing-plan-intro h2 { margin: 5px 0 0; color: var(--neutral-900); font-size: var(--fs-lg); }
.billing-plan-intro .billing-tabs { width: 310px; border-radius: var(--radius-xs); }
.billing-plan-intro .billing-tabs button { border-radius: 5px; }

.product-page-billing .billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.product-page-billing .plan-card {
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 12px;
  min-height: 386px;
  border-radius: var(--radius-sm);
  padding: 17px;
}

.product-page-billing .plan-card:hover { transform: translateY(-2px); }
.product-page-billing .plan-card.current { border-color: var(--color-success); box-shadow: inset 0 3px 0 var(--color-success); }
.product-page-billing .plan-card:disabled { cursor: default; opacity: 1; }
.product-page-billing .plan-card:disabled:not(.current) .plan-action { background: var(--neutral-300); color: var(--neutral-700); }

.product-page-billing .plan-card-head > span { display: grid; gap: 3px; }
.product-page-billing .plan-card-head > span small { color: var(--neutral-500); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; }
.product-page-billing .plan-card-head strong { font-size: var(--fs-lg); }
.product-page-billing .plan-card-head em { border-radius: 5px; }

.product-page-billing .plan-price b { font-size: var(--fs-xl); }
.plan-credit-line { gap: 6px; padding-bottom: 11px; border-bottom: 1px solid var(--color-border); }
.plan-credit-line b { color: var(--color-success); font-size: var(--fs-md); }
.plan-credit-line small { color: var(--neutral-700); font-size: var(--fs-xs); }

.plan-feature-list { display: grid; align-content: start; gap: 9px; }
.plan-feature-list small { align-items: flex-start; gap: 7px; color: var(--neutral-700); font-size: var(--fs-xs); line-height: 1.4; }
.plan-feature-list svg { flex: 0 0 auto; width: 15px; height: 15px; fill: none; stroke: var(--color-success); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.plan-billing-note { color: var(--neutral-700); font-size: var(--fs-xs); line-height: 1.35; }

.product-page-billing .plan-action {
  justify-content: space-between;
  min-height: 40px;
  border-radius: var(--radius-xs);
  background: var(--neutral-900);
  color: #fff;
  padding: 0 11px;
}

.billing-topup-section { display: grid; gap: 10px; padding-top: 8px; }
.billing-topup-section .section-heading span,
.product-page-billing .billing-account-summary > .section-heading span { display: grid; gap: 3px; }
.billing-topup-section .section-heading small,
.product-page-billing .billing-account-summary > .section-heading small { color: var(--neutral-700); font-size: var(--fs-xs); }

.product-page-billing .billing-account-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.4fr);
  gap: 14px 18px;
  border-top: 1px solid var(--color-border);
  padding-top: 18px;
}

.product-page-billing .billing-account-summary > .section-heading { grid-column: 1 / -1; }
.product-page-billing .billing-account-summary .billing-summary,
.product-page-billing .billing-account-summary .billing-balance-grid,
.product-page-billing .billing-account-summary .billing-subscription-control,
.product-page-billing .billing-account-summary > .billing-note,
.product-page-billing .billing-account-summary > .billing-warning { grid-column: 1; }
.product-page-billing .billing-account-summary .billing-usage-group,
.product-page-billing .billing-account-summary > .billing-group { grid-column: 2; }

@media (max-width: 1040px) {
  .product-page-models .product-model-grid,
  .product-page-assets .product-asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-page-billing .billing-hero-summary { grid-template-columns: 112px minmax(0, 1fr); }
  .product-page-billing .billing-hero-metrics { grid-column: 1 / -1; border-top: 1px solid var(--neutral-300); border-left: 0; padding-top: 10px; }
}

@media (max-width: 780px) {
  .product-page:not(.product-page-studio) { gap: 14px; padding: 6px 0 28px; }
  .product-page:not(.product-page-studio) .product-page-head { align-items: flex-start; flex-direction: column; padding: 8px 2px 10px; }
  .product-page:not(.product-page-studio) .product-page-head h1 { font-size: var(--fs-xl); }
  .product-page:not(.product-page-studio) .product-page-actions { width: 100%; }
  .product-page:not(.product-page-studio) .product-page-actions .section-action { width: 100%; }

  .product-model-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-model-overview > span { display: grid; gap: 3px; padding: 10px 8px; }
  .product-model-overview > span:first-child { padding-left: 2px; }
  .product-model-overview strong { font-size: var(--fs-lg); }
  .product-model-overview small { font-size: 8px; }

  .product-page-models .product-library-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .product-page-models .product-filter-panel > .eyebrow { display: none; }
  /* P2-B fix: chip 在 ≤780 视口不再横滑，改 flex-wrap 让它自然换行。
     实测：原 flex:0 0 154px + overflow-x:auto → 5 chips × 154px = 770 > viewport → 横滑 462px。
     修复后 flex:1 1 130px + flex-wrap:wrap，chip 自动换行，每行 2 个 (390/768)。 */
  .product-page-models .product-filter-panel .model-filter { display: flex; flex-wrap: wrap; overflow: visible; scrollbar-width: none; }
  .product-page-models .product-filter-panel .model-filter button { flex: 1 1 130px; min-width: 0; min-height: 52px; border: 1px solid var(--color-border); }
  .product-page-models .product-model-grid { grid-template-columns: minmax(0, 1fr); }
  .product-model-card { min-height: 306px; }

  .product-page-assets .product-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-page-assets .product-dashboard-grid span { display: grid; gap: 3px; border-bottom: 1px solid var(--color-border); }
  .creation-library-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .creation-kind-filter { grid-column: 1 / -1; overflow-x: auto; scrollbar-width: none; }
  .creation-kind-filter button { flex: 0 0 auto; }
  .creation-search-field { grid-column: 1 / -1; justify-self: stretch; width: 100%; }
  .creation-library-toolbar > small { grid-column: 1 / -1; justify-self: end; margin-top: -5px; }
  .product-page-assets .product-asset-grid { grid-template-columns: minmax(0, 1fr); }

  .product-page-billing .billing-hero-summary { grid-template-columns: 82px minmax(0, 1fr); gap: 14px; min-height: 0; padding: 16px; }
  .billing-orbit { width: 78px; }
  .billing-orbit::before { width: 58px; }
  .billing-orbit strong { max-width: 50px; font-size: var(--fs-sm); }
  .billing-hero-copy h2 { font-size: var(--fs-lg); }
  .billing-hero-metrics { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .billing-hero-metrics > span { padding: 8px; }
  .billing-hero-metrics strong { font-size: var(--fs-sm); overflow-wrap: anywhere; }

  .billing-plan-intro { align-items: stretch; flex-direction: column; gap: 10px; }
  .billing-plan-intro .billing-tabs { width: 100%; }
  .product-page-billing .billing-plan-grid { grid-template-columns: minmax(0, 1fr); }
  .product-page-billing .plan-card { min-height: 360px; }
  .product-page-billing .billing-account-summary { grid-template-columns: minmax(0, 1fr); }
  .product-page-billing .billing-account-summary > *,
  .product-page-billing .billing-account-summary .billing-usage-group,
  .product-page-billing .billing-account-summary > .billing-group { grid-column: 1; }
}

/* ==========================================================================
   PASS 3 收敛 — 显式 ≥1024 视口右栏 ≤ 300（验收清单 §4）
   ========================================================================== */

@media (min-width: 1024px) {
  body.global-home .home-command-deck {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  }

  body.global-home .home-signal-panel,
  body.global-home .orbit-home-panel,
  body.global-home .studio-orbit-panel,
  body[data-product-page="studio"]:not(.global-home) .studio-orbit-panel {
    width: 100%;
    max-width: var(--right-panel-width); /* 300px —— 1280 视口 ≤ 25% */
  }
}

@media (min-width: 1280px) {
  /* 1280+ 视口：右栏硬上限 300（≤ 25% × 1280 = 320） */
  body.global-home .home-command-deck {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}

/* ==========================================================================
   PASS 5 防御性硬约束（QA 实测反馈 768/390 兜底）

   教训：Pass 3 / Pass 4 的 `!important` 兜底块覆盖了 max-width:1040/780 原生 media，
   导致 768 / 390 视口下 home-command-deck 仍强制两列（右栏 ≥260px）+ sidebar 264px
   → 主区总宽 > viewport 但被 overflow-x:hidden 截掉，造成任务按钮被裁到 x=755..1967。

   PASS 5 只锁**字号 / 单元素宽高 / 背景**——绝不覆盖 layout 的 grid-template-columns。
   ========================================================================== */

/* 字号硬约束：所有视口（含 ≤780 / ≤460）H1 统一 28px（视觉方向 §2 "H1 28px, ≤32"），
   仅放开 max-width 让窄屏能完整换行不溢出 viewport。不做"小屏缩小"——避免
   VisualQA 反馈的"首屏 ≤ 32px"硬约束违反。 */
body.global-home .home-copy h1,
body.global-home .home-copy h3,
body.global-home .home-empty-state h1,
body.global-home .home-empty-state h3,
body.global-home .empty-state h1,
body.global-home .empty-state h3,
.home-copy h1,
.home-empty-state h1,
.home-empty-state h3,
.empty-state h1,
.empty-state h3,
.model-empty-main h3 {
  font-size: var(--fs-xl) !important; /* 28px 全视口统一 */
  line-height: 1.25 !important;
  letter-spacing: -0.01em !important;
  max-width: 560px !important;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 780px) {
  /* ≤780：仅放开 max-width 让 28px h1 在窄屏能完整换行；字号仍 28px */
  body.global-home .home-copy h1,
  body.global-home .home-copy h3,
  body.global-home .home-empty-state h1,
  body.global-home .home-empty-state h3,
  body.global-home .empty-state h1,
  body.global-home .empty-state h3,
  .home-copy h1,
  .home-empty-state h1,
  .home-empty-state h3,
  .empty-state h1,
  .empty-state h3,
  .model-empty-main h3 {
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Orbit / studio-orbit 面板硬性：max-width ≤ 300（≤25% × 1280），不依赖任何媒体 */
.orbit-home-panel,
.studio-orbit-panel,
body.global-home .orbit-home-panel,
body.global-home .studio-orbit-panel,
body[data-product-page="studio"] .studio-orbit-panel {
  max-width: var(--right-panel-width) !important; /* 300 */
  box-sizing: border-box;
}

/* 小屏（≤780）单列布局下：orbit 让位主区，按视口比例收敛，避免抢占主工作区 */
@media (max-width: 780px) {
  body.global-home .orbit-home-panel,
  body.global-home .studio-orbit-panel,
  .orbit-home-panel,
  .studio-orbit-panel {
    /* ≤780 视口下，单列布局，无 sidebar，主区 ≈ viewport - 32 padding；
       让 orbit 比例化（≤25% 视口 = 视口基线），不显式 max-width:100% 撑满 */
    max-width: calc(100% - 0px) !important; /* 仍在 300 上限内（基线规则胜出） */
    width: 100% !important;
  }
}

@media (max-width: 460px) {
  /* 极小屏：单列下确实需要让 orbit 撑满避免 300 > 视口导致水平滚动 */
  body.global-home .orbit-home-panel,
  .orbit-home-panel {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* 侧栏与主区同背景 —— 防御深色 gradient 复活（不限视口） */
body.global-home .side-panel,
body[data-product-page="studio"] .side-panel,
.side-panel {
  background: var(--bg) !important;
  background-image: none !important;
  color: var(--neutral-900);
  backdrop-filter: none !important;
}

body.global-home .side-section {
  background: var(--surface) !important;
  background-image: none !important;
  border: 1px solid var(--color-border);
}

/* 防止横向溢出 —— min-width:0 让 grid/flex 子元素可压缩，不依赖 !important */
body, .app-shell, .workspace, .home-command-deck, .home-capability-grid, .home-hero-actions, .home-copy, .home-signal-panel {
  min-width: 0;
}

/* 任务按钮 / 快捷操作 / hero actions 小屏收窄 + wrap */
@media (max-width: 780px) {
  body.global-home .home-hero-actions,
  .home-hero-actions {
    display: flex !important;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  body.global-home .home-hero-actions > *,
  .home-hero-actions > * {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    max-width: 100%;
  }
  /* capability grid 容器在小屏切回 2 列 grid（避免 flex 单 button 超出 viewport） */
  body.global-home .home-capability-grid,
  .home-capability-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
  body.global-home .home-capability,
  .home-capability {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
  }
}

@media (max-width: 460px) {
  body.global-home .home-hero-actions > *,
  .home-hero-actions > * {
    flex: 1 1 100%;
  }
  body.global-home .home-capability-grid,
  .home-capability-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Orbit v18 UX: production interaction targets and motion preferences. */
.product-nav button,
.language-toggle {
  min-height: 40px;
}

.primary-button,
.video-tools-button {
  min-height: 40px;
}

.video-tools-button {
  padding-inline: 10px;
}

@media (max-width: 780px) {
  body .side-drawer-toggle {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 460px) {
  .app-header {
    justify-content: flex-start;
  }

  .brand {
    flex: 0 0 94px;
    width: 94px;
    max-width: 94px;
    margin-left: 8px;
  }

  .brand-logo {
    width: 94px;
    height: auto;
  }
}

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

/* Keep the compact desktop Orbit summary readable inside its 300px rail. */
@media (min-width: 1041px) {
  body.global-home .orbit-home-panel {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  body.global-home .orbit-core {
    width: 112px;
  }

  body.global-home .orbit-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.global-home .orbit-status-grid span {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
    padding: 5px 8px;
  }

  body.global-home .orbit-status-grid small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
