:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f7f0df;
  --ink: #17202a;
  --muted: #6d7480;
  --line: #e1e7ee;
  --line-strong: #cfd9e4;
  --brand: #d6ad62;
  --brand-strong: #a67622;
  --ios-blue: #007aff;
  --ios-blue-soft: #eaf4ff;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --blue: #2d6cdf;
  --amber: #b45309;
  --rose: #be123c;
  --cyan: #0e7490;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

/* Product Design upgrade: airy glass, soft depth, GSAP-like reveal motion. */
:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-raised: rgba(255, 255, 255, 0.86);
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --line-strong: #c8d4e1;
  --brand: #d6ad62;
  --brand-strong: #9a6b1f;
  --ios-blue: #0a84ff;
  --ios-blue-soft: #e8f3ff;
  --mint: #13b981;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --shadow: 0 28px 90px rgba(16, 24, 40, 0.16);
  --soft-shadow: 0 16px 42px rgba(16, 24, 40, 0.09);
  --lift-shadow: 0 24px 70px rgba(16, 24, 40, 0.14);
  --spring: cubic-bezier(0.2, 0.9, 0.22, 1);
}

::selection {
  background: rgba(10, 132, 255, 0.18);
}

body {
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
.command-card,
.metric-card,
.admin-kpi-card,
.admin-section,
.feature-card,
.trust-card,
.rate-card,
.composer,
.message-body,
.model-popover,
.channel-popover,
.modal {
  transition:
    transform 220ms var(--spring),
    box-shadow 220ms var(--spring),
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.lh-motion-seed {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  transition:
    opacity 540ms ease,
    transform 680ms var(--spring),
    box-shadow 220ms var(--spring),
    background 180ms ease;
  transition-delay: var(--motion-delay, 0ms);
}

.lh-motion-seed.is-visible,
.lh-reduced-motion .lh-motion-seed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@keyframes lh-soft-pop {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.975);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes lh-menu-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes lh-subtle-shine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

.home-nav,
.chat-header,
.admin-topbar,
.leftbar,
.admin-sidebar,
.composer,
.modal,
.model-popover,
.channel-popover,
.account-menu,
.admin-section,
.admin-editor-card,
.command-card,
.metric-card,
.admin-kpi-card,
.home-hero .hero-visual,
.trust-card,
.feature-card,
.rate-card {
  border-color: rgba(208, 219, 232, 0.78);
  background: var(--panel-raised);
  backdrop-filter: blur(22px) saturate(1.18);
}

.home-nav,
.chat-header,
.admin-topbar {
  box-shadow: 0 10px 34px rgba(16, 24, 40, 0.08);
}

.home-nav:hover,
.composer:focus-within,
.admin-kpi-card:hover,
.command-card:hover,
.metric-card:hover,
.feature-card:hover,
.trust-card:hover,
.rate-card:hover,
.model-admin-row:hover,
.model-interface-row:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--lift-shadow);
}

.primary-button,
.primary-link,
.send-button,
.home-nav-action {
  position: relative;
  overflow: hidden;
}

.primary-button::after,
.primary-link::after,
.send-button::after,
.home-nav-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.35) 48%, transparent 100%);
  transform: translateX(-120%);
  pointer-events: none;
}

.primary-button:hover::after,
.primary-link:hover::after,
.send-button:hover::after,
.home-nav-action:hover::after {
  animation: lh-subtle-shine 820ms ease;
}

.primary-button,
.primary-link {
  background: linear-gradient(135deg, #dbb765, #9d6a20);
  box-shadow: 0 16px 36px rgba(157, 106, 32, 0.22);
}

.secondary-button,
.secondary-link,
.icon-button,
.round-button,
.tool-chip,
.composer-control > button,
.model-type-button {
  border: 1px solid rgba(213, 223, 236, 0.86);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.secondary-button:hover,
.secondary-link:hover,
.icon-button:hover,
.round-button:hover,
.tool-chip:hover,
.composer-control > button:hover,
.model-type-button:hover {
  border-color: rgba(10, 132, 255, 0.24);
  background: #ffffff;
  color: var(--ios-blue);
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.12);
}

body.home-body {
  background:
    linear-gradient(120deg, rgba(255, 252, 246, 0.9) 0%, rgba(246, 249, 253, 0.8) 34%, rgba(239, 248, 255, 0.72) 68%, rgba(250, 251, 252, 1) 100%);
}

body.home-body::before {
  background:
    linear-gradient(120deg, rgba(214, 173, 98, 0.15) 0%, rgba(255, 255, 255, 0) 38%),
    linear-gradient(245deg, rgba(10, 132, 255, 0.12) 0%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(247, 249, 252, 0.9));
}

.home-hero {
  padding-top: 92px;
}

.hero-copy {
  transform: translate3d(0, var(--hero-copy-y, 0), 0);
  opacity: var(--hero-copy-opacity, 1);
}

.hero-copy h1 {
  letter-spacing: 0;
  color: #0b1220;
}

.hero-text,
.section-title p,
.admin-story-copy p,
.privacy-section p {
  color: #475467;
}

.hero-visual {
  transform: translate3d(0, var(--hero-visual-y, 0), 0) scale(var(--hero-visual-scale, 1));
  transform-origin: center top;
}

.hero-control-card {
  transform: translate3d(0, var(--hero-card-y, 0), 0);
}

.home-section {
  scroll-margin-top: 110px;
}

.section-title h2,
.admin-story-copy h2,
.privacy-section h2 {
  color: #0b1220;
}

.trust-card,
.feature-card,
.rate-card,
.setup-window {
  position: relative;
  overflow: hidden;
}

.trust-card::before,
.feature-card::before,
.rate-card::before,
.setup-window::before,
.admin-kpi-card::before,
.command-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.feature-card > *,
.trust-card > *,
.rate-card > *,
.setup-window > *,
.admin-kpi-card > *,
.command-card > *,
.metric-card > * {
  position: relative;
}

.shell {
  background:
    linear-gradient(115deg, rgba(255, 252, 246, 0.9) 0%, rgba(246, 249, 253, 0.78) 46%, rgba(232, 243, 255, 0.68) 100%),
    var(--bg);
}

.leftbar {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.68);
}

.profile,
.left-foot,
.nav-button,
.history-item {
  border-radius: 14px;
}

.nav-button:hover,
.nav-button.active,
.history-item:hover,
.history-item.active {
  transform: translate3d(3px, 0, 0);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.chat-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 251, 255, 0.94)),
    #fbfcfd;
}

.chat-header {
  border-bottom-color: rgba(210, 220, 233, 0.72);
}

.title-block h1 {
  color: #111827;
}

.messages {
  scroll-behavior: smooth;
}

.message {
  animation: lh-soft-pop 420ms var(--spring) both;
}

.message.user .message-body,
.message.assistant .message-body {
  border-radius: 20px;
}

.message.user .message-body {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(246, 248, 251, 0.92));
  border-color: rgba(190, 213, 255, 0.76);
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.08);
}

.message.assistant .message-body {
  padding: 2px 0;
}

.answer-card,
.message-asset-card,
.uploaded-attachment,
.composer-mode-panel {
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

.composer {
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(10, 132, 255, 0.12);
}

.composer:focus-within {
  transform: translate3d(0, -2px, 0);
}

.model-popover,
.channel-popover,
.account-menu {
  animation: lh-menu-in 220ms var(--spring) both;
  transform-origin: left bottom;
}

.model-row:hover,
.model-row.active,
.channel-menu-item:hover,
.channel-menu-item.active,
.model-category-heading:hover,
.model-category-heading.active,
.model-interface-option:hover,
.model-interface-option.active {
  background: rgba(232, 243, 255, 0.86);
  color: var(--ios-blue);
  transform: translate3d(2px, 0, 0);
}

body.admin-body {
  background:
    linear-gradient(125deg, rgba(240, 249, 255, 0.9), rgba(248, 250, 252, 0.94) 42%, rgba(255, 252, 246, 0.72)),
    #f5f8fb;
}

.admin-shell {
  background: transparent;
}

.admin-sidebar {
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.72);
}

.admin-nav button,
.user-console-nav button,
.admin-sidebar-foot a {
  border-radius: 14px;
}

.admin-nav button:hover,
.admin-nav button.active,
.user-console-nav button:hover,
.user-console-nav button.active,
.admin-sidebar-foot a:hover {
  transform: translate3d(3px, 0, 0);
  background: rgba(255, 247, 231, 0.88);
  box-shadow: 0 12px 28px rgba(157, 106, 32, 0.08);
}

.admin-topbar {
  background: rgba(248, 250, 252, 0.78);
}

.admin-content {
  gap: 20px;
}

.admin-kpi-card,
.admin-metric,
.admin-section,
.admin-empty,
.admin-editor-card,
.admin-chart-card,
.admin-users-toolbar,
.admin-filter-strip {
  border-color: rgba(211, 222, 235, 0.82);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 46px rgba(16, 24, 40, 0.08);
}

.admin-kpi-icon {
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}

.admin-dashboard-table-row,
.model-distribution-row,
.model-admin-row,
.model-interface-row {
  transition: background 160ms ease, transform 180ms var(--spring), box-shadow 180ms var(--spring);
}

.admin-dashboard-table-row:hover,
.model-distribution-row:hover {
  background: rgba(248, 250, 252, 0.78);
}

.modal-backdrop.show {
  backdrop-filter: blur(14px);
}

.modal-backdrop.show .modal {
  animation: lh-soft-pop 260ms var(--spring) both;
}

.modal {
  border: 1px solid rgba(224, 231, 240, 0.86);
  background: rgba(255, 255, 255, 0.92);
}

input,
textarea,
select {
  border-radius: 14px;
  border-color: rgba(208, 219, 232, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.11);
  outline: none;
}

.toast {
  border: 1px solid rgba(208, 219, 232, 0.86);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--lift-shadow);
}

@media (max-width: 980px) {
  .workbench-hero,
  .workbench-agent-grid,
  .workbench-workflow-grid {
    grid-template-columns: 1fr;
  }

  .workbench-hero {
    gap: 12px;
  }

  .workbench-head {
    align-items: flex-start;
  }

  .workbench-mini-node {
    width: 118px;
  }
}

@media (max-width: 640px) {
  .agent-workbench {
    width: 100%;
  }

  .workbench-feature-card,
  .workbench-canvas-preview,
  .workbench-section {
    border-radius: 18px;
    padding: 14px;
  }

  .workbench-feature-card h3 {
    font-size: 24px;
  }

  .workbench-mini-canvas {
    min-height: 300px;
  }

  .workbench-mini-node {
    left: 50%;
    top: calc(12px + var(--y));
    width: calc(100% - 28px);
    transform: translateX(-50%);
  }

  .workbench-mini-canvas svg {
    display: none;
  }
}

/* Absolute final homepage overrides. Keep this at EOF so legacy home rules cannot re-break the landing page. */
body.home-body {
  color: #0b1220;
  background:
    radial-gradient(circle at 74% 14%, rgba(37, 99, 235, 0.13), transparent 32%),
    radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.10), transparent 34%),
    linear-gradient(118deg, #ffffff 0%, #f7fbff 42%, #edf6ff 100%) !important;
}

.brand-intro {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.92) 0 17%, transparent 44%),
    radial-gradient(circle at 25% 50%, rgba(45, 212, 191, 0.12), transparent 26%),
    radial-gradient(circle at 70% 42%, rgba(37, 99, 235, 0.13), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f0f7ff 100%) !important;
}

.brand-intro::after {
  z-index: 1 !important;
  top: 50% !important;
  width: min(760px, 78vw) !important;
  height: 246px !important;
  border-color: rgba(37, 99, 235, 0.07) !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent) !important;
}

.intro-model-cloud {
  z-index: 2 !important;
}

.intro-model-tile {
  left: 50% !important;
  top: 50% !important;
  width: 108px !important;
  min-height: 82px !important;
  display: grid !important;
  grid-template-rows: 46px auto !important;
  place-items: center !important;
  gap: 4px !important;
  border-radius: 24px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.11) !important;
  animation: none !important;
  will-change: transform, opacity, filter !important;
  contain: layout paint style !important;
}

.intro-model-tile.major {
  width: 124px !important;
  min-height: 88px !important;
}

.intro-model-tile img {
  width: 44px !important;
  height: 44px !important;
  object-fit: contain !important;
  border: 1px solid rgba(219, 230, 242, 0.9) !important;
  border-radius: 15px !important;
  background: #ffffff !important;
  padding: 8px !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

.intro-model-tile.major img {
  width: 50px !important;
  height: 50px !important;
  border-radius: 17px !important;
}

.intro-model-tile small {
  color: #536174 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.brand-intro-center {
  z-index: 4 !important;
}

.home-nav,
.home-hero,
.home-section,
.model-logo-rail,
.home-footer {
  width: min(1280px, calc(100% - 56px)) !important;
}

.home-nav {
  border-radius: 24px !important;
  border-color: rgba(199, 218, 242, 0.82) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 18px 58px rgba(37, 99, 235, 0.11) !important;
}

.home-nav nav a.active,
.home-nav nav a:hover {
  color: #2563eb !important;
  background: #eef5ff !important;
}

.home-nav-action,
.primary-link,
.primary-link.hero-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  color: #ffffff !important;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.25) !important;
}

.home-hero {
  display: grid !important;
  grid-template-columns: minmax(560px, 0.95fr) minmax(600px, 1.05fr) !important;
  align-items: center !important;
  gap: 48px !important;
  padding-top: 84px !important;
  padding-bottom: 28px !important;
}

.hero-copy {
  max-width: 690px !important;
}

.hero-copy h1 {
  max-width: 690px !important;
  font-size: 64px !important;
  line-height: 1.09 !important;
  margin: 18px 0 22px !important;
}

.hero-copy h1 em {
  display: inline-block !important;
  white-space: nowrap !important;
}

.hero-text {
  max-width: 670px !important;
  font-size: 17px !important;
  line-height: 1.82 !important;
}

.hero-visual {
  border-radius: 36px !important;
  border-color: rgba(199, 218, 242, 0.78) !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.78)),
    rgba(255, 255, 255, 0.78) !important;
  box-shadow: 0 34px 92px rgba(37, 99, 235, 0.16) !important;
}

.model-logo-rail {
  margin-top: 6px !important;
  margin-bottom: 18px !important;
}

.model-logo-rail span {
  min-height: 70px !important;
  display: grid !important;
  grid-template-columns: 38px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  column-gap: 12px !important;
  align-items: center !important;
  align-content: center !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.84) !important;
}

.model-logo-rail img,
.verification-table img {
  object-fit: contain !important;
  border: 1px solid rgba(220, 230, 242, 0.9) !important;
  background: #ffffff !important;
}

.model-logo-rail img {
  grid-row: 1 / 3 !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 13px !important;
  padding: 7px !important;
}

.model-logo-rail b,
.model-logo-rail small {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.capability-strip,
.model-support-section,
.gateway-showcase,
.why-section,
.verification-section,
.code-access-section,
.pricing-section,
.faq-section,
.privacy-section {
  padding-top: 58px !important;
  padding-bottom: 58px !important;
}

.official-model-list {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.official-model-list article {
  min-height: 108px !important;
  display: grid !important;
  grid-template-columns: 48px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  column-gap: 14px !important;
  border: 1px solid rgba(205, 222, 244, 0.84) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.82) !important;
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.08) !important;
  padding: 18px !important;
}

.official-model-list img {
  grid-row: 1 / 3 !important;
  width: 48px !important;
  height: 48px !important;
  object-fit: contain !important;
  border: 1px solid rgba(220, 230, 242, 0.9) !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  padding: 9px !important;
}

.gateway-showcase,
.code-access-section,
.privacy-section {
  display: grid !important;
  grid-template-columns: minmax(0, 0.86fr) minmax(460px, 1.14fr) !important;
  align-items: center !important;
  gap: 32px !important;
}

.gateway-showcase {
  border: 1px solid rgba(205, 222, 244, 0.78) !important;
  border-radius: 34px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 255, 0.86)) !important;
  box-shadow: 0 24px 72px rgba(37, 99, 235, 0.10) !important;
  padding: 36px !important;
}

.feature-grid,
.trust-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.trust-card,
.feature-card,
.rate-card {
  border-color: rgba(205, 222, 244, 0.82) !important;
  background: rgba(255, 255, 255, 0.84) !important;
}

.trust-card > svg,
.feature-card > svg {
  background: linear-gradient(135deg, #eaf3ff, #ffffff) !important;
  color: #2563eb !important;
}

.verification-table {
  overflow: hidden !important;
  border: 1px solid rgba(205, 222, 244, 0.84) !important;
  border-radius: 26px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: 0 22px 58px rgba(37, 99, 235, 0.09) !important;
}

.verification-table > div {
  display: grid !important;
  grid-template-columns: 1.5fr 0.7fr 0.8fr 0.8fr 0.6fr !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 62px !important;
  border-top: 1px solid rgba(225, 233, 244, 0.9) !important;
  padding: 0 20px !important;
}

.verification-table > div:first-child {
  min-height: 52px !important;
  border-top: 0 !important;
  background: rgba(239, 246, 255, 0.72) !important;
}

.verification-table img {
  width: 30px !important;
  height: 30px !important;
  border-radius: 10px !important;
  padding: 5px !important;
}

.verification-table span:first-child {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  color: #0f172a !important;
  font-weight: 800 !important;
}

.verification-table em {
  width: fit-content !important;
  border-radius: 999px !important;
  background: #ecfdf5 !important;
  color: #059669 !important;
  font-style: normal !important;
  font-weight: 800 !important;
  padding: 5px 10px !important;
}

.code-window {
  overflow: auto !important;
  min-height: 236px !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  border-radius: 24px !important;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)) !important;
  color: #dbeafe !important;
  box-shadow: 0 26px 64px rgba(15, 23, 42, 0.22) !important;
  padding: 22px !important;
}

.code-window code {
  font-size: 13px !important;
  line-height: 1.8 !important;
}

.faq-list {
  display: grid !important;
  gap: 12px !important;
  max-width: 880px !important;
  margin: 0 auto !important;
}

.faq-list details {
  border: 1px solid rgba(205, 222, 244, 0.82) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.06) !important;
  padding: 16px 18px !important;
}

.faq-list summary {
  cursor: pointer !important;
  color: #0f172a !important;
  font-weight: 900 !important;
}

.faq-list p {
  margin: 12px 0 0 !important;
  color: #64748b !important;
  line-height: 1.75 !important;
}

.privacy-section {
  grid-template-columns: minmax(0, 1fr) auto !important;
  border: 1px solid rgba(205, 222, 244, 0.82) !important;
  border-radius: 30px !important;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.88)) !important;
  box-shadow: 0 24px 70px rgba(37, 99, 235, 0.10) !important;
  padding: 32px !important;
}

@media (max-width: 1180px) {
  .home-hero {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }

  .hero-copy,
  .hero-copy h1,
  .hero-text {
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .hero-actions,
  .hero-proof-row {
    justify-content: center !important;
  }
}

@media (max-width: 980px) {
  .home-nav,
  .home-hero,
  .home-section,
  .model-logo-rail,
  .home-footer {
    width: calc(100% - 24px) !important;
  }

  .hero-copy h1 {
    font-size: 48px !important;
  }

  .model-logo-rail,
  .official-model-list,
  .feature-grid,
  .trust-grid,
  .rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .gateway-showcase,
  .code-access-section,
  .privacy-section {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 640px) {
  .brand-intro::after {
    width: 94vw !important;
    height: 190px !important;
  }

  .intro-model-tile {
    width: 82px !important;
    min-height: 66px !important;
    border-radius: 18px !important;
  }

  .intro-model-tile img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 13px !important;
    padding: 7px !important;
  }

  .hero-copy h1 {
    font-size: 38px !important;
  }

  .model-logo-rail,
  .official-model-list,
  .feature-grid,
  .trust-grid,
  .rate-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-metric-grid,
  .hero-analytics,
  .hero-model-card {
    grid-template-columns: 1fr !important;
  }

  .verification-table {
    overflow-x: auto !important;
  }

  .verification-table > div {
    min-width: 720px !important;
  }
}

/* Homepage launch polish 2026-06-19. This final block owns the public landing page only. */
body.home-body {
  color: #0b1220;
  background:
    radial-gradient(circle at 74% 14%, rgba(37, 99, 235, 0.13), transparent 32%),
    radial-gradient(circle at 18% 8%, rgba(14, 165, 233, 0.10), transparent 34%),
    linear-gradient(118deg, #ffffff 0%, #f7fbff 42%, #edf6ff 100%);
}

body.home-body::before {
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.052) 1px, transparent 1px);
  background-size: 48px 48px;
}

.brand-intro {
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.92) 0 17%, transparent 44%),
    radial-gradient(circle at 25% 50%, rgba(45, 212, 191, 0.12), transparent 26%),
    radial-gradient(circle at 70% 42%, rgba(37, 99, 235, 0.13), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f0f7ff 100%);
}

.brand-intro::after {
  z-index: 1;
  top: 50%;
  width: min(760px, 78vw);
  height: 246px;
  border-color: rgba(37, 99, 235, 0.07);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  box-shadow: inset 0 0 80px rgba(37, 99, 235, 0.035);
}

.intro-model-cloud {
  z-index: 2;
}

.intro-model-tile {
  left: 50%;
  top: 50%;
  width: 108px;
  min-height: 82px;
  grid-template-rows: 46px auto;
  gap: 4px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.11);
  transform: translate3d(-50%, -50%, 0) translate3d(var(--float-x, 0px), var(--float-y, 0px), 0) scale(1);
  transition:
    transform 720ms cubic-bezier(0.2, 0.9, 0.22, 1),
    opacity 420ms ease,
    filter 420ms ease,
    box-shadow 420ms ease;
  transition-delay: calc(var(--float-delay, 0ms) * 0.12);
  animation: none !important;
  will-change: transform, opacity, filter;
  contain: layout paint style;
}

.intro-model-tile.major {
  width: 124px;
  min-height: 88px;
}

.intro-model-tile img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border: 1px solid rgba(219, 230, 242, 0.9);
  border-radius: 15px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.intro-model-tile.major img {
  width: 50px;
  height: 50px;
  border-radius: 17px;
}

.intro-model-tile small {
  color: #536174;
  font-size: 11px;
  font-weight: 800;
}

.brand-intro.phase-circle .intro-model-tile {
  transform: translate3d(-50%, -50%, 0) translate3d(var(--ring-x, 0px), var(--ring-y, 0px), 0) scale(0.9);
  opacity: 0.86;
}

.brand-intro.phase-brand .intro-model-tile {
  transform: translate3d(-50%, -50%, 0) scale(0.32);
  opacity: 0;
  filter: blur(8px);
}

.brand-intro-center {
  z-index: 4;
}

.home-nav,
.home-hero,
.home-section,
.model-logo-rail,
.home-footer {
  width: min(1280px, calc(100% - 56px));
}

.home-nav {
  border-radius: 24px;
  border-color: rgba(199, 218, 242, 0.82);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 58px rgba(37, 99, 235, 0.11);
}

.home-nav nav a.active,
.home-nav nav a:hover {
  color: #2563eb !important;
  background: #eef5ff !important;
}

.home-nav-action,
.primary-link,
.primary-link.hero-primary {
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  color: #ffffff !important;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.25) !important;
}

.home-hero {
  grid-template-columns: minmax(560px, 0.95fr) minmax(600px, 1.05fr);
  align-items: center;
  gap: 48px;
  padding-top: 84px;
  padding-bottom: 28px;
}

.hero-copy {
  max-width: 690px;
}

.hero-copy h1 {
  max-width: 690px;
  font-size: 64px;
  line-height: 1.09;
  margin: 18px 0 22px;
}

.hero-copy h1 em {
  display: inline-block;
  white-space: nowrap;
}

.hero-text {
  max-width: 670px;
  font-size: 17px;
  line-height: 1.82;
}

.hero-visual {
  border-radius: 36px;
  border-color: rgba(199, 218, 242, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.78)),
    rgba(255, 255, 255, 0.78);
  box-shadow: 0 34px 92px rgba(37, 99, 235, 0.16);
}

.hero-dashboard {
  border-color: rgba(203, 222, 246, 0.86);
  background: rgba(255, 255, 255, 0.84);
}

.model-logo-rail {
  margin-top: 6px;
  margin-bottom: 18px;
}

.model-logo-rail span {
  min-height: 70px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  align-content: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
}

.model-logo-rail img {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  object-fit: contain;
  border: 1px solid rgba(220, 230, 242, 0.9);
  border-radius: 13px;
  background: #ffffff;
  padding: 7px;
}

.model-logo-rail b,
.model-logo-rail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-strip,
.model-support-section,
.gateway-showcase,
.why-section,
.verification-section,
.code-access-section,
.pricing-section,
.faq-section,
.privacy-section {
  padding-top: 58px;
  padding-bottom: 58px;
}

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

.official-model-list article {
  min-height: 108px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 14px;
  border: 1px solid rgba(205, 222, 244, 0.84);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 46px rgba(37, 99, 235, 0.08);
  padding: 18px;
}

.official-model-list img {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border: 1px solid rgba(220, 230, 242, 0.9);
  border-radius: 16px;
  background: #ffffff;
  padding: 9px;
}

.official-model-list strong {
  align-self: end;
  color: #0f172a;
  font-size: 16px;
}

.official-model-list span {
  align-self: start;
  color: #64748b;
  font-size: 13px;
}

.gateway-showcase,
.code-access-section,
.privacy-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(460px, 1.14fr);
  align-items: center;
  gap: 32px;
}

.gateway-showcase {
  border: 1px solid rgba(205, 222, 244, 0.78);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 246, 255, 0.86));
  box-shadow: 0 24px 72px rgba(37, 99, 235, 0.10);
  padding: 36px;
}

.setup-panel {
  background:
    radial-gradient(circle at 88% 10%, rgba(14, 165, 233, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.78));
}

.setup-window {
  border-color: rgba(202, 220, 244, 0.84);
}

.feature-grid,
.trust-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.trust-card,
.feature-card,
.rate-card {
  border-color: rgba(205, 222, 244, 0.82);
  background: rgba(255, 255, 255, 0.84);
}

.trust-card > svg,
.feature-card > svg {
  background: linear-gradient(135deg, #eaf3ff, #ffffff);
  color: #2563eb;
}

.verification-table {
  overflow: hidden;
  border: 1px solid rgba(205, 222, 244, 0.84);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 58px rgba(37, 99, 235, 0.09);
}

.verification-table > div {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 0.8fr 0.8fr 0.6fr;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  border-top: 1px solid rgba(225, 233, 244, 0.9);
  padding: 0 20px;
  color: #475569;
}

.verification-table > div:first-child {
  min-height: 52px;
  border-top: 0;
  background: rgba(239, 246, 255, 0.72);
  color: #334155;
}

.verification-table img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border: 1px solid rgba(220, 230, 242, 0.9);
  border-radius: 10px;
  background: #ffffff;
  padding: 5px;
}

.verification-table span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f172a;
  font-weight: 800;
}

.verification-table em {
  width: fit-content;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  font-style: normal;
  font-weight: 800;
  padding: 5px 10px;
}

.code-window {
  overflow: auto;
  min-height: 236px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  color: #dbeafe;
  box-shadow: 0 26px 64px rgba(15, 23, 42, 0.22);
  padding: 22px;
}

.code-window code {
  font-size: 13px;
  line-height: 1.8;
}

.faq-list {
  display: grid;
  gap: 12px;
  max-width: 880px;
  margin: 0 auto;
}

.faq-list details {
  border: 1px solid rgba(205, 222, 244, 0.82);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.06);
  padding: 16px 18px;
}

.faq-list summary {
  cursor: pointer;
  color: #0f172a;
  font-weight: 900;
}

.faq-list p {
  margin: 12px 0 0;
  color: #64748b;
  line-height: 1.75;
}

.privacy-section {
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid rgba(205, 222, 244, 0.82);
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.88));
  box-shadow: 0 24px 70px rgba(37, 99, 235, 0.10);
  padding: 32px;
}

@media (max-width: 1180px) {
  .home-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-copy,
  .hero-copy h1,
  .hero-text {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-proof-row {
    justify-content: center;
  }
}

@media (max-width: 980px) {
  .home-nav,
  .home-hero,
  .home-section,
  .model-logo-rail,
  .home-footer {
    width: calc(100% - 24px);
  }

  .hero-copy h1 {
    font-size: 48px;
  }

  .model-logo-rail,
  .official-model-list,
  .feature-grid,
  .trust-grid,
  .rate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gateway-showcase,
  .code-access-section,
  .privacy-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-intro::after {
    width: 94vw;
    height: 190px;
  }

  .intro-model-tile {
    width: 82px;
    min-height: 66px;
    border-radius: 18px;
  }

  .intro-model-tile img {
    width: 36px;
    height: 36px;
    border-radius: 13px;
    padding: 7px;
  }

  .hero-copy h1 {
    font-size: 38px;
  }

  .model-logo-rail,
  .official-model-list,
  .feature-grid,
  .trust-grid,
  .rate-grid {
    grid-template-columns: 1fr;
  }

  .hero-metric-grid,
  .hero-analytics,
  .hero-model-card {
    grid-template-columns: 1fr;
  }

  .verification-table {
    overflow-x: auto;
  }

  .verification-table > div {
    min-width: 720px;
  }
}

/* Brand launch intro: particles gather into copy, then resolve into the product mark. */
.brand-intro {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(90, 200, 250, 0.28), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(10, 132, 255, 0.18), transparent 30%),
    linear-gradient(180deg, #f9fcff 0%, #eef7ff 100%);
  opacity: 1;
  transition: opacity 640ms ease, visibility 640ms ease;
}

.brand-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(10, 132, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 132, 255, 0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 72%);
  pointer-events: none;
}

#brandIntroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brand-intro-center {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  opacity: 0;
  transform: translate3d(0, 20px, 0) scale(0.96);
  transition: opacity 520ms ease, transform 520ms var(--spring);
}

.brand-intro.phase-brand .brand-intro-center {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.intro-logo {
  width: 86px;
  height: 86px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 24px 70px rgba(10, 132, 255, 0.18);
}

.brand-intro-center strong {
  color: #07111f;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-intro-center span {
  color: #486176;
  font-size: 17px;
  line-height: 1.6;
}

.intro-skip {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(144, 173, 207, 0.5);
  border-radius: 999px;
  color: #466074;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.brand-intro.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.home-body:not(.intro-complete) > :not(.brand-intro) {
  pointer-events: none;
}

@media (max-width: 720px) {
  .intro-logo {
    width: 72px;
    height: 72px;
    border-radius: 20px;
  }

  .brand-intro-center strong {
    font-size: 34px;
  }

  .brand-intro-center span {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-intro {
    display: none;
  }
}

/* Interaction polish: keep message tools under the bubble, and keep image preview above the chat shell. */
.message .message-body .message-actions {
  margin: 8px 0 0;
  justify-content: flex-end;
}

.message.assistant .message-actions,
.message.user .message-actions {
  margin-left: 0;
  margin-top: 8px;
}

.media-preview-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
  pointer-events: auto;
}

.media-preview-dialog {
  position: relative;
  z-index: 10001;
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
}

.media-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10002;
}

.media-preview-dialog footer {
  flex-wrap: wrap;
}

.media-preview-dialog footer .secondary-button {
  min-height: 38px;
  border-radius: 14px;
}

.media-render-animation span {
  animation: none !important;
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.9), rgba(239, 246, 255, 0.92));
}

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

.layer-mode-tabs {
  display: inline-flex;
  gap: 6px;
  border: 1px solid rgba(224, 231, 240, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  padding: 4px;
}

.layer-mode-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #667085;
  font-weight: 800;
  padding: 0 12px;
}

.layer-mode-tabs button.active,
.layer-mode-tabs button:hover {
  background: #ffffff;
  color: var(--ios-blue);
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.12);
}

.layer-selection-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 20px;
  background: rgba(239, 246, 255, 0.82);
  padding: 12px;
}

.layer-selection-panel strong,
.layer-selection-panel span {
  display: block;
}

.layer-selection-panel span {
  color: var(--muted);
  font-size: 12px;
}

.layer-selection-panel textarea {
  min-height: 92px;
  resize: vertical;
}

.layer-selection-panel > div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-button.compact {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
}

.layer-canvas.select-mode {
  cursor: crosshair;
}

.layer-canvas.select-mode .layer-canvas-item {
  pointer-events: none;
}

.layer-selection-box {
  position: absolute;
  z-index: 3000;
  border: 1px dashed #0a84ff;
  border-radius: 14px;
  background: rgba(10, 132, 255, 0.24);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.16);
  pointer-events: none;
}

.message {
  position: relative;
}

.message-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 180ms var(--spring);
}

.message:hover .message-actions,
.message:focus-within .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.message.assistant .message-actions {
  margin-left: 54px;
  margin-top: 6px;
}

.message.user .message-actions {
  justify-content: flex-end;
  margin-top: 6px;
}

.message-action-button,
.uploaded-split {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(213, 223, 236, 0.86);
  background: rgba(255, 255, 255, 0.78);
  color: #475467;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(14px);
}

.message-action-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.message-action-button svg,
.uploaded-split svg {
  width: 16px;
  height: 16px;
}

.message-action-button:hover,
.uploaded-split:hover {
  border-color: rgba(10, 132, 255, 0.3);
  color: var(--ios-blue);
  transform: translateY(-1px);
}

.uploaded-split {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.layer-studio-backdrop {
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.layer-studio-dialog {
  width: min(1180px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 40px));
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  border: 1px solid rgba(224, 231, 240, 0.88);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 38px 110px rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(24px);
  padding: 18px;
  overflow: hidden;
  animation: lh-soft-pop 260ms var(--spring) both;
}

.layer-studio-head,
.layer-studio-status,
.layer-list-title,
.layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.layer-studio-head span {
  color: var(--muted);
  font-size: 13px;
}

.layer-studio-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: 0;
}

.layer-studio-status {
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.72));
  padding: 12px;
}

.layer-studio-status > div:last-child {
  min-width: 0;
  flex: 1;
}

.layer-studio-status strong,
.layer-studio-status span {
  display: block;
}

.layer-studio-status span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.layer-progress {
  width: 154px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.layer-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0a84ff, #65c7ff);
  transition: width 260ms ease;
}

.layer-error {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 63, 94, 0.22);
  border-radius: 16px;
  background: #fff1f2;
  color: #be123c;
  padding: 10px 12px;
}

.layer-error svg {
  width: 18px;
  height: 18px;
}

.layer-studio-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.layer-side,
.layer-canvas-wrap,
.layer-source-preview,
.layer-list {
  min-width: 0;
  min-height: 0;
}

.layer-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.layer-source-preview,
.layer-list,
.layer-canvas-wrap {
  border: 1px solid rgba(224, 231, 240, 0.9);
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.78);
}

.layer-source-preview {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.layer-source-preview span,
.layer-source-preview strong {
  display: block;
}

.layer-source-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.layer-source-preview strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-source-preview button {
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #ffffff;
  padding: 0;
}

.layer-source-preview img {
  width: 100%;
  max-height: 168px;
  display: block;
  object-fit: contain;
  background: #ffffff;
}

.layer-list {
  overflow: auto;
  padding: 12px;
}

.layer-list-title {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(248, 250, 252, 0.92);
  padding-bottom: 10px;
  backdrop-filter: blur(12px);
}

.secondary-button.compact {
  min-height: 32px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
}

.layer-row {
  border: 1px solid rgba(224, 231, 240, 0.9);
  border-radius: 16px;
  background: #ffffff;
  padding: 10px;
  margin-top: 8px;
}

.layer-row.hidden {
  opacity: 0.58;
}

.layer-eye {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #edf6ff;
  color: var(--ios-blue);
}

.layer-row > div {
  min-width: 0;
  flex: 1;
}

.layer-row input {
  width: 100%;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  padding: 0;
}

.layer-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.layer-canvas-wrap {
  overflow: hidden;
  padding: 14px;
}

.layer-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 22px;
  background:
    linear-gradient(45deg, rgba(203, 213, 225, 0.28) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(203, 213, 225, 0.28) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(203, 213, 225, 0.28) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(203, 213, 225, 0.28) 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.layer-canvas-item {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: filter 120ms ease;
}

.layer-canvas-item:active {
  cursor: grabbing;
  filter: drop-shadow(0 18px 36px rgba(10, 132, 255, 0.22));
}

.layer-empty,
.layer-source-empty {
  display: grid;
  place-items: center;
  min-height: 128px;
  border: 1px dashed rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  padding: 16px;
}

.canvas-empty {
  position: absolute;
  inset: 18px;
  min-height: 0;
}

.canvas-empty svg {
  width: 28px;
  height: 28px;
  color: var(--ios-blue);
}

@media (max-width: 900px) {
  .layer-studio-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 22px;
    padding: 12px;
  }

  .layer-studio-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .layer-side {
    grid-template-rows: auto auto;
  }

  .layer-canvas {
    min-height: 420px;
  }
}

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

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

body.home-body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background:
    linear-gradient(180deg, #f8fbff 0%, #ffffff 38%, #f6f8fb 100%);
}

body.home-body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(214, 173, 98, 0.13) 0%, rgba(214, 173, 98, 0) 34%),
    linear-gradient(244deg, rgba(0, 122, 255, 0.12) 0%, rgba(0, 122, 255, 0) 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(246, 248, 251, 0.92));
  transform: translate3d(0, calc(var(--page-scroll, 0) * -30px), 0);
}

body.home-body.scrolled .home-nav {
  min-height: 56px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.12);
}

body.admin-body {
  min-height: 100%;
  overflow: hidden;
  background: #f5f8fb;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.admin-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.admin-brand,
.admin-sidebar-foot a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand {
  min-height: 54px;
  margin-bottom: 18px;
}

.admin-brand > span {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff8ec;
  color: var(--brand-strong);
  font-weight: 900;
  overflow: hidden;
  border: 1px solid rgba(166, 118, 34, 0.16);
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small {
  color: var(--muted);
}

.admin-nav,
.user-console-nav {
  display: grid;
  gap: 6px;
}

.admin-nav button,
.user-console-nav button,
.admin-sidebar-foot a {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  padding: 0 12px;
  text-align: left;
}

.admin-nav button,
.user-console-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-nav button.active,
.admin-nav button:hover,
.user-console-nav button.active,
.user-console-nav button:hover,
.admin-sidebar-foot a:hover {
  background: #fff7e7;
  color: var(--brand-strong);
}

.admin-nav svg,
.user-console-nav svg,
.admin-sidebar-foot svg,
.admin-top-actions svg {
  width: 18px;
  height: 18px;
}

.user-console-nav[hidden],
.admin-nav[hidden] {
  display: none;
}

body.user-console-mode .admin-main {
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.36), transparent 34%),
    #f6f9fc;
}

.admin-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.admin-main {
  min-width: 0;
  height: 100vh;
  overflow: auto;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(18px);
  padding: 14px 24px;
}

.admin-topbar p,
.admin-topbar h1 {
  margin: 0;
}

.admin-topbar p {
  color: var(--muted);
  font-size: 13px;
}

.admin-topbar h1 {
  font-size: 24px;
}

.admin-top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-top-actions button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.admin-notice,
.admin-content {
  width: min(1540px, calc(100% - 40px));
  margin: 18px auto;
}

.admin-notice {
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 12px 14px;
}

.admin-notice strong,
.admin-notice span {
  display: block;
}

.admin-content {
  display: grid;
  gap: 16px;
  padding-bottom: 32px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric,
.admin-section,
.admin-empty,
.admin-editor-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.admin-metric {
  padding: 16px;
}

.admin-metric span {
  display: block;
  color: var(--muted);
}

.admin-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.admin-dashboard-shell,
.admin-users-page {
  display: grid;
  gap: 24px;
}

.admin-kpi-grid,
.admin-user-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-kpi-card {
  min-height: 94px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(221, 228, 238, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
  padding: 16px;
}

.admin-kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eaf2ff;
  color: #2563eb;
}

.admin-kpi-card.purple .admin-kpi-icon { background: #f1e7ff; color: #8b5cf6; }
.admin-kpi-card.green .admin-kpi-icon,
.admin-kpi-card.mint .admin-kpi-icon { background: #dcfce7; color: #16a34a; }
.admin-kpi-card.amber .admin-kpi-icon { background: #fff2c7; color: #d97706; }
.admin-kpi-card.indigo .admin-kpi-icon { background: #e4e9ff; color: #4f46e5; }
.admin-kpi-card.violet .admin-kpi-icon { background: #eee7ff; color: #7c3aed; }
.admin-kpi-card.rose .admin-kpi-icon { background: #ffe4ec; color: #e11d48; }

.admin-kpi-card small,
.admin-kpi-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.admin-kpi-card strong {
  display: block;
  margin: 2px 0;
  font-size: 25px;
  line-height: 1.1;
}

.admin-filter-strip,
.admin-users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(221, 228, 238, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
}

.admin-filter-group,
.admin-users-actions,
.admin-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-filter-group span {
  color: #334155;
  font-weight: 700;
}

.admin-filter-group button,
.admin-search-box,
.admin-users-actions .secondary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  padding: 0 14px;
}

.admin-filter-group button,
.admin-users-actions button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.admin-chart-card {
  min-height: 274px;
}

.admin-segmented {
  display: inline-flex;
  border-radius: 12px;
  background: #f1f5f9;
  padding: 4px;
}

.admin-segmented button {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.admin-segmented button.active {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.model-distribution-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  min-height: 210px;
}

.model-donut {
  width: 192px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 41%, transparent 42%),
    conic-gradient(#3b82f6 calc(var(--donut-fill) * 1%), #dbeafe 0);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.model-distribution-list,
.admin-dashboard-table {
  display: grid;
  gap: 2px;
}

.model-distribution-head,
.model-distribution-row,
.admin-dashboard-table-head,
.admin-dashboard-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 0.7fr 0.7fr 0.7fr;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
}

.admin-dashboard-table-head,
.admin-dashboard-table-row {
  grid-template-columns: minmax(0, 1.3fr) 0.8fr 1fr 0.8fr 0.7fr;
}

.model-distribution-head,
.admin-dashboard-table-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.model-distribution-row strong,
.admin-dashboard-table-row strong {
  min-width: 0;
  overflow: hidden;
  color: #2563eb;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-distribution-row span,
.model-distribution-row em,
.admin-dashboard-table-row span,
.admin-dashboard-table-row em {
  color: #64748b;
  font-style: normal;
}

.token-trend-card {
  min-height: 210px;
  display: grid;
  align-content: stretch;
  gap: 12px;
}

.trend-legend {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trend-legend i {
  width: 12px;
  height: 12px;
  border: 2px solid #3b82f6;
  border-radius: 50%;
}

.trend-legend span:nth-child(2) i { border-color: #10b981; }
.trend-legend span:nth-child(3) i { border-color: #f59e0b; }
.trend-legend span:nth-child(4) i { border-color: #06b6d4; }

.token-trend-svg {
  width: 100%;
  height: 176px;
  overflow: visible;
}

.token-trend-svg line {
  stroke: #e2e8f0;
  stroke-width: 0.7;
}

.token-trend-svg polyline {
  fill: none;
  stroke: #06b6d4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.admin-dashboard-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.admin-users-toolbar {
  padding: 12px 16px;
}

.admin-search-box {
  min-width: 320px;
  justify-content: flex-start;
}

.admin-search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.admin-users-table-card {
  padding: 0;
  overflow: visible;
}

.admin-users-table {
  display: grid;
  overflow-x: auto;
}

.admin-users-head,
.admin-users-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) 0.55fr 1fr 0.68fr 0.7fr 0.66fr 1fr 1fr 1fr 0.72fr;
  gap: 14px;
  align-items: center;
  min-width: 1160px;
  min-height: 62px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.82);
  padding: 0 20px;
}

.admin-users-head {
  min-height: 52px;
  border-radius: 20px 20px 0 0;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.admin-user-cell {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-cell strong,
.admin-users-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 900;
}

.role-pill,
.state-dot {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 0 9px;
}

.role-pill.admin {
  background: #f3e8ff;
  color: #7e22ce;
}

.state-dot.ok {
  background: transparent;
  color: #16a34a;
  padding-left: 0;
}

.state-dot.off {
  background: transparent;
  color: #e11d48;
  padding-left: 0;
}

.state-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.admin-user-ops {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-ops button {
  min-width: 48px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  padding: 0 10px;
  white-space: nowrap;
}

.admin-user-ops button:hover {
  background: #f1f5f9;
  border-color: #dbeafe;
  color: var(--ink);
}

.admin-more-wrap {
  position: relative;
}

.admin-more-menu {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 8;
  width: 168px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.16);
  padding: 6px;
}

.admin-more-menu button {
  width: 100%;
  height: 36px;
  justify-content: flex-start;
  gap: 8px;
  border-radius: 10px;
  padding: 0 9px;
  white-space: nowrap;
}

.admin-balance-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.92));
}

.admin-balance-target div {
  display: grid;
  gap: 3px;
}

.admin-balance-target small {
  color: var(--muted);
  font-size: 12px;
}

.admin-users-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #475569;
  padding: 0 20px;
}

.admin-users-pagination div {
  display: inline-flex;
  gap: 6px;
}

.admin-users-pagination button {
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
}

.admin-users-pagination button.active {
  border-color: #14b8a6;
  color: #0f766e;
}

.admin-user-log-modal {
  width: min(980px, calc(100vw - 42px));
  max-height: min(760px, calc(100vh - 42px));
  overflow: auto;
}

.admin-section,
.admin-empty {
  padding: 16px;
}

.admin-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
}

.admin-empty.compact {
  min-height: 160px;
}

.admin-notice.inline {
  width: auto;
  margin: 0;
  box-shadow: none;
}

.user-console-metrics .admin-metric {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
}

.user-profile-section {
  overflow: hidden;
}

.user-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  padding: 16px;
}

.user-profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff5df, #f7c968);
  color: #6f4500;
  font-size: 28px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(166, 118, 34, 0.16);
}

.user-profile-main {
  min-width: 0;
}

.user-profile-main strong,
.user-profile-main span {
  display: block;
}

.user-profile-main strong {
  font-size: 22px;
}

.user-profile-main span {
  color: var(--muted);
}

.user-profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.user-profile-tags em {
  border-radius: 999px;
  background: #edf6ff;
  color: #0b63ce;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 9px;
}

.user-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.user-info-grid article {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 14px;
}

.user-info-grid span {
  color: var(--muted);
  font-size: 13px;
}

.user-info-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-order-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.admin-section-head.inline-head {
  margin: 20px 0 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.admin-section-head h2 {
  margin: 0;
  font-size: 18px;
}

.admin-section-head span {
  color: var(--muted);
}

.admin-data-list,
.admin-provider-list,
.admin-agent-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fbfcfd;
}

.admin-row strong,
.admin-row span {
  display: block;
}

.admin-row span,
.admin-editor-card span,
.admin-editor-card small,
.admin-form-grid small {
  color: var(--muted);
  font-size: 12px;
}

.admin-row em {
  min-width: 64px;
  border-radius: 999px;
  padding: 5px 9px;
  text-align: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.recharge-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  padding: 14px;
}

.recharge-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  align-items: center;
}

.recharge-head strong,
.recharge-head span {
  display: block;
}

.recharge-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

.recharge-package {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  padding: 12px;
}

.recharge-package:hover {
  border-color: rgba(166, 118, 34, 0.4);
  background: #fff9ef;
}

.recharge-package span {
  width: fit-content;
  border-radius: 999px;
  background: rgba(214, 173, 98, 0.18);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.recharge-package strong {
  font-size: 16px;
}

.recharge-package b {
  font-size: 24px;
}

.recharge-package em,
.recharge-package small {
  color: var(--muted);
  font-style: normal;
}

.payment-order-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.payment-order-actions a {
  text-decoration: none;
}

.payment-config-card {
  margin-bottom: 12px;
}

.payment-package-grid {
  margin-bottom: 14px;
}

body.account-modal-open {
  overflow: hidden;
}

.account-modal-backdrop {
  z-index: 130;
  padding: 24px;
}

.account-modal {
  width: min(980px, 96vw);
  max-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
  overflow: hidden;
  backdrop-filter: blur(22px) saturate(1.12);
}

.account-modal-head {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
}

.account-modal-head span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.account-modal-head h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.account-modal-content {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 18px 22px 22px;
}

.account-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.account-stat-card,
.account-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.account-stat-card {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
}

.account-stat-card span,
.account-section-head span,
.account-redeem-box span,
.account-pay-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-stat-card strong {
  font-size: 30px;
  letter-spacing: 0;
}

.account-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.account-section-head,
.account-pay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.account-section-head h3 {
  margin: 0;
  font-size: 18px;
}

.account-chart-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.account-redeem-box {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 18px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  padding: 12px;
}

.account-redeem-box strong,
.account-pay-head strong {
  display: block;
  margin-bottom: 3px;
}

.account-redeem-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.account-redeem-action input {
  min-width: 0;
}

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

.account-package-card {
  min-height: 168px;
  display: grid;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
  padding: 14px;
}

.account-package-card:hover {
  border-color: rgba(0, 122, 255, 0.38);
  background: #f7fbff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.account-package-card span {
  width: fit-content;
  border-radius: 999px;
  background: rgba(214, 173, 98, 0.18);
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.account-package-card strong {
  font-size: 16px;
}

.account-package-card b {
  font-size: 28px;
}

.account-package-card em,
.account-package-card small {
  color: var(--muted);
  font-style: normal;
}

.account-external-recharge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(0, 122, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 122, 255, 0.08);
  color: #0875e1;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 14px;
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.12);
}

.account-external-recharge:hover {
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.45);
}

.account-usage-chart {
  position: relative;
  min-height: 210px;
  border-radius: 18px;
  background: #ffffff;
  padding: 24px 12px 30px;
  overflow: hidden;
}

.chart-grid-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1px;
  background: #dbe4f0;
}

.chart-grid-line.top {
  top: 28px;
}

.chart-grid-line.middle {
  top: 112px;
}

.chart-bars {
  position: relative;
  z-index: 1;
  height: 150px;
  display: grid;
  grid-template-columns: repeat(31, minmax(4px, 1fr));
  align-items: end;
  gap: 5px;
  padding: 0 4px;
}

.chart-bars span {
  min-height: 0;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, #ffcc48, #ffb100);
}

.chart-axis,
.account-usage-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
}

.account-usage-summary {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.account-usage-summary span {
  border-radius: 999px;
  background: #f8fafc;
  padding: 6px 10px;
}

.account-usage-summary strong {
  color: var(--ink);
}

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

.admin-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-form-grid label,
.admin-wide-label {
  display: grid;
  gap: 6px;
}

.admin-row-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-chat-log-list {
  display: grid;
  gap: 10px;
}

.admin-chat-log textarea,
.card-code-output {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 10px;
  line-height: 1.55;
}

.admin-chat-log small {
  color: var(--muted);
}

.admin-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-mini-list span {
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  font-size: 12px;
  padding: 5px 8px;
}

.admin-editor-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.admin-editor-card.compact-editor {
  background: #fbfcfd;
}

.browser-config-section {
  overflow: hidden;
}

.browser-pool-global {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.browser-pool-global label,
.browser-selector-box {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 12px;
}

.browser-pool-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: start;
}

.browser-model-list,
.browser-model-detail,
.browser-account-panel {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  padding: 12px;
}

.browser-model-detail {
  background: #fbfcfd;
}

.browser-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.browser-column-head strong,
.browser-column-head span {
  display: block;
}

.browser-column-head span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.browser-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.browser-model-stack,
.browser-account-stack {
  display: grid;
  gap: 8px;
}

.browser-model-card {
  min-height: 68px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  color: var(--ink);
  padding: 10px;
  text-align: left;
}

.browser-model-card:hover,
.browser-model-card.active {
  border-color: rgba(166, 118, 34, 0.35);
  background: #fff8ec;
}

.browser-model-card svg {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
}

.browser-model-card strong,
.browser-model-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-model-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.browser-model-card em {
  border-radius: 999px;
  padding: 4px 8px;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.browser-detail-card {
  box-shadow: none;
}

.browser-selector-box .admin-form-grid {
  gap: 8px;
}

.browser-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.browser-account-card {
  box-shadow: none;
}

.browser-account-card .admin-editor-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.browser-account-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.browser-empty-tip {
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  background: #fbfcfd;
  line-height: 1.7;
  padding: 14px;
}

.mini-danger {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--rose);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.mini-neutral {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: #fff8ec;
  color: var(--brand-strong);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.mini-neutral:hover {
  background: #ffecc7;
}

.browser-login-backdrop {
  z-index: 40;
}

.browser-login-modal {
  width: min(1120px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 16px;
}

.browser-login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.browser-login-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.browser-login-head h2 {
  margin: 0 0 6px;
}

.browser-login-url {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 12px;
  padding: 9px 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-login-screen-wrap {
  overflow: auto;
  max-height: min(62vh, 720px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f6f7f9;
}

.browser-login-screen {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.browser-login-controls {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.browser-login-controls input {
  flex: 1 1 340px;
}

.browser-login-tip {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-editor-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-editor-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-editor-head input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.admin-editor-head em {
  font-style: normal;
  color: var(--muted);
}

.admin-editor-card textarea {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  resize: vertical;
  outline: none;
}

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

.admin-pool-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 110px 86px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
}

.admin-pool-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-helper-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-helper-card,
.admin-guide-step {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 14px;
}

.admin-helper-card {
  display: grid;
  gap: 8px;
}

.admin-helper-card span,
.admin-guide-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.admin-guide-steps {
  display: grid;
  gap: 10px;
}

.admin-guide-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-guide-step b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff8ec;
  color: var(--brand-strong);
  font-weight: 900;
}

.model-admin-toolbar,
.model-interface-toolbar {
  display: flex;
  justify-content: flex-start;
  margin: 12px 0;
}

.model-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin: 12px 0;
  border: 1px solid rgba(224, 231, 240, 0.88);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.78);
}

.model-category-tabs button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 800;
}

.model-category-tabs button.active {
  background: #fff;
  color: var(--ios-blue);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08), inset 0 0 0 1px rgba(0, 122, 255, 0.12);
}

.model-category-tabs svg {
  width: 16px;
  height: 16px;
}

.model-category-tabs em {
  min-width: 22px;
  min-height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.72);
  color: inherit;
  font-size: 12px;
  font-style: normal;
}

.model-category-list {
  max-height: min(52vh, 520px);
  overflow: auto;
}

.model-admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.2fr);
  gap: 14px;
  align-items: start;
}

.model-admin-list,
.model-admin-detail,
.model-interface-list {
  display: grid;
  gap: 10px;
}

.model-admin-row,
.model-interface-row {
  border: 1px solid rgba(224, 231, 240, 0.96);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.model-admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.model-admin-row.active {
  border-color: rgba(0, 122, 255, 0.28);
  background: rgba(234, 244, 255, 0.54);
}

.model-admin-row > button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px;
}

.model-admin-row > div:first-child {
  min-width: 0;
  padding: 8px;
}

.model-admin-row strong,
.model-admin-row span,
.model-interface-row strong,
.model-interface-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-admin-row span,
.model-interface-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.model-admin-row > div:last-child {
  display: inline-flex;
  gap: 6px;
}

.model-admin-detail {
  border: 1px solid rgba(224, 231, 240, 0.96);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.72);
  padding: 14px;
}

.compact-head {
  margin-bottom: 4px;
}

.model-interface-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
}

.model-interface-row.default {
  border-color: rgba(245, 158, 11, 0.32);
  background: #fffaf0;
}

.model-interface-row em {
  color: var(--brand-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.interface-metrics {
  margin-top: 4px;
  color: #64748b;
}

.interface-runtime-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 14px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 12px;
}

.interface-runtime-box strong,
.interface-runtime-box span {
  display: block;
}

.interface-runtime-box span {
  color: #3b5f9b;
  font-size: 13px;
}

.admin-config-modal {
  z-index: 42;
}

.admin-form-modal {
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-form-modal .auth-form {
  overflow-y: auto;
  padding-right: 4px;
}

.split-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
}

.form-note {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle-line input {
  width: 16px;
  height: 16px;
}

.admin-workflow-steps {
  display: grid;
  gap: 10px;
}

.admin-workflow-step {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(130px, 0.55fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 12px;
}

.admin-workflow-step textarea,
.admin-workflow-step button {
  grid-column: 1 / -1;
}

.home-nav {
  position: sticky;
  top: 22px;
  z-index: 10;
  width: fit-content;
  max-width: calc(100% - 32px);
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 7px 8px 7px 14px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(26px) saturate(1.22);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
  transition: min-height 220ms ease, background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

.home-brand,
.home-nav nav,
.home-nav-action,
.hero-actions,
.home-footer {
  display: flex;
  align-items: center;
}

.home-brand {
  gap: 10px;
  font-weight: 800;
  padding-right: 8px;
}

.home-brand span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8ec;
  color: var(--brand-strong);
  overflow: hidden;
  border: 1px solid rgba(166, 118, 34, 0.16);
}

.home-nav nav {
  gap: 2px;
}

.home-nav nav a,
.home-nav-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.home-nav nav a:hover,
.home-nav-action {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.10);
}

.home-nav-action {
  color: var(--ios-blue);
}

.home-hero,
.home-section,
.home-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.home-hero {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(520px, 1fr);
  align-items: start;
  justify-items: stretch;
  gap: 38px;
  padding: 76px 0 34px;
  text-align: left;
}

.hero-copy {
  align-self: center;
  max-width: 560px;
}

.eyebrow,
.section-title span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(166, 118, 34, 0.18);
  border-radius: 999px;
  padding: 0 10px;
  background: #fff8ec;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h1 {
  max-width: 620px;
  margin: 18px 0 20px;
  font-size: 58px;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-text {
  width: 100%;
  margin: 0;
  color: #3c4652;
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  gap: 12px;
  justify-content: flex-start;
  margin: 26px 0 16px;
  flex-wrap: wrap;
}

.primary-link,
.secondary-link,
.rate-card a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-link {
  gap: 8px;
  background: linear-gradient(135deg, #dcb86c, #b17c2d);
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(166, 118, 34, 0.26);
}

.primary-link:hover {
  background: linear-gradient(135deg, #e4c77d, #a76f22);
}

.hero-primary {
  min-height: 60px;
  border-radius: 999px;
  padding: 0 34px;
  font-size: 20px;
}

.hero-secondary {
  min-height: 60px;
  gap: 8px;
  border-color: rgba(215, 224, 236, 0.96);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  font-size: 16px;
}

.hero-secondary svg,
.primary-link svg,
.secondary-link svg {
  width: 18px;
  height: 18px;
}

.hero-proof-row {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-proof-row span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(220, 228, 239, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: #485363;
  backdrop-filter: blur(18px);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
}

.hero-proof-row svg {
  width: 16px;
  height: 16px;
  color: var(--ios-blue);
}

.hero-visual {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 38px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.13);
  padding: 12px;
}

.hero-visual img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid rgba(210, 218, 228, 0.82);
  border-radius: 28px;
  background: #f4f7fb;
}

.hero-device-bar {
  position: absolute;
  top: 28px;
  left: 34px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(232, 237, 244, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  color: #465262;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.hero-device-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f57;
}

.hero-device-bar span:nth-child(2) {
  background: #ffbd2e;
}

.hero-device-bar span:nth-child(3) {
  background: #28c840;
  margin-right: 4px;
}

.hero-visual figcaption {
  padding: 14px 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-control-card {
  position: absolute;
  left: 50%;
  bottom: 14%;
  width: min(360px, 58%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 24px 64px rgba(23, 32, 42, 0.14);
  padding: 16px;
  text-align: left;
}

.hero-control-card strong {
  grid-column: 1 / -1;
  font-size: 16px;
}

.hero-control-card span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.86);
  color: #514233;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.hero-control-card svg {
  width: 16px;
  height: 16px;
  color: var(--brand-strong);
}

@media (prefers-reduced-motion: no-preference) {
  .home-enhanced .hero-copy,
  .home-enhanced .hero-visual,
  .home-enhanced .hero-control-card,
  .home-enhanced .scroll-reveal {
    will-change: transform, opacity, filter;
  }

  .home-enhanced .hero-copy {
    opacity: var(--hero-copy-opacity, 1);
    transform: translate3d(0, var(--hero-copy-y, 0px), 0);
  }

  .home-enhanced .hero-visual {
    transform: translate3d(0, var(--hero-visual-y, 0px), 0) scale(var(--hero-visual-scale, 1));
    transform-origin: center top;
  }

  .home-enhanced .hero-control-card {
    transform: translateX(-50%) translate3d(0, var(--hero-card-y, 0px), 0);
  }

  .home-enhanced .scroll-reveal {
    opacity: 0;
    filter: blur(8px);
    transform: translate3d(0, 34px, 0) scale(0.985);
    transition:
      opacity 620ms cubic-bezier(0.2, 0.8, 0.2, 1),
      transform 720ms cubic-bezier(0.2, 0.8, 0.2, 1),
      filter 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .home-enhanced .scroll-reveal.is-visible {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.secondary-link {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.secondary-link:hover,
.rate-card a:hover {
  border-color: var(--line-strong);
  box-shadow: var(--soft-shadow);
}

.home-section {
  padding: 64px 0;
}

.section-title {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 28px;
}

.section-title p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.section-title h2,
.privacy-section h2 {
  max-width: 720px;
  margin: 0;
  font-size: 40px;
  line-height: 1.18;
  letter-spacing: 0;
}

.feature-grid,
.rate-grid,
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card,
.rate-card,
.privacy-section,
.trust-card {
  border: 1px solid rgba(221, 229, 240, 0.86);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px) saturate(1.14);
}

.feature-card,
.trust-card {
  padding: 18px;
}

.feature-card,
.trust-card,
.rate-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.feature-card:hover,
.trust-card:hover,
.rate-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 122, 255, 0.18);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.12);
}

.feature-card svg,
.trust-card svg {
  width: 22px;
  height: 22px;
  color: var(--brand-strong);
}

.feature-card > svg,
.trust-card > svg {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff8ec, #ffffff);
  color: var(--brand-strong);
  padding: 11px;
  box-shadow: inset 0 0 0 1px rgba(166, 118, 34, 0.10);
}

.feature-card h3,
.trust-card h3,
.rate-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 18px;
}

.feature-card p,
.trust-card p,
.rate-card p,
.privacy-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.privacy-story {
  padding-top: 74px;
}

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

.trust-card {
  min-height: 224px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 241, 0.76));
}

.trust-card:nth-child(2) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.78));
}

.admin-story {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
  gap: 28px;
  align-items: center;
}

.admin-story-copy h2 {
  margin: 14px 0 16px;
  font-size: 42px;
  line-height: 1.18;
  letter-spacing: 0;
}

.admin-story-copy p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.setup-panel {
  border: 1px solid rgba(224, 231, 241, 0.88);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.88), rgba(238, 246, 255, 0.86));
  box-shadow: 0 24px 62px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(18px);
  padding: 34px;
}

.setup-window {
  overflow: hidden;
  border: 1px solid rgba(212, 221, 232, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 28px 70px rgba(23, 32, 42, 0.12);
  backdrop-filter: blur(18px);
}

.setup-window-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
}

.setup-window-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f97316;
}

.setup-window-head span:nth-child(2) {
  background: #facc15;
}

.setup-window-head span:nth-child(3) {
  background: #22c55e;
}

.setup-window-head strong {
  margin-left: 8px;
}

.setup-fields {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.setup-fields label {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(223, 231, 240, 0.9);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.92);
  padding: 12px 14px;
}

.setup-fields span,
.setup-save span {
  color: var(--muted);
  font-size: 13px;
}

.setup-fields b {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setup-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px 18px;
}

.setup-save button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--ink), #334155);
  color: #ffffff;
  padding: 0 16px;
  font-weight: 800;
}

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

.rate-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 22px;
}

.rate-card.premium {
  border-color: rgba(0, 122, 255, 0.22);
}

.rate-card.economy {
  border-color: rgba(166, 118, 34, 0.24);
}

.rate-card.auto {
  border-color: rgba(180, 83, 9, 0.22);
}

.rate-card a {
  margin-top: auto;
  border: 1px solid rgba(224, 231, 240, 0.9);
  background: rgba(255, 255, 255, 0.84);
}

.architecture-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.architecture-steps div {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(223, 231, 240, 0.86);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(14px);
  padding: 12px;
}

.architecture-steps b {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff8ec;
  color: var(--brand-strong);
}

.architecture-steps span {
  font-weight: 800;
}

.privacy-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  margin-bottom: 48px;
}

.privacy-section p {
  max-width: 720px;
  margin-top: 12px;
}

.home-footer {
  min-height: 76px;
  justify-content: center;
  gap: 18px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 6%, rgba(214, 173, 98, 0.14), transparent 26%),
    radial-gradient(circle at 86% 2%, rgba(0, 122, 255, 0.12), transparent 28%),
    var(--bg);
}

.shell.panel-open {
  grid-template-columns: 268px minmax(0, 1fr) 400px;
}

.leftbar {
  position: relative;
  background: rgba(247, 249, 252, 0.82);
  border-right: 1px solid rgba(209, 219, 230, 0.78);
  backdrop-filter: blur(22px) saturate(1.22);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.profile,
.left-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.avatar,
.small-avatar,
.message-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8ec;
  color: var(--brand-strong);
  font-weight: 800;
  overflow: hidden;
  border: 1px solid rgba(166, 118, 34, 0.14);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.small-avatar,
.message-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

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

.profile strong,
.profile span {
  display: block;
}

.profile span,
.history p,
.left-foot,
.panel-head p,
.routing-bar span,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: grid;
  gap: 6px;
  margin: 18px 0 18px;
}

.nav-button,
.history-item,
.history-open,
.history-delete,
.icon-button,
.tool-chip,
.round-button,
.send-button,
.suggestions button,
.agent-card,
.command-card {
  border: 0;
  border-radius: 8px;
}

.nav-button,
.history-open {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
}

.nav-button:hover,
.nav-button.active,
.history-item:hover,
.history-item.active {
  background: var(--glass-strong);
  box-shadow: var(--soft-shadow);
}

.nav-button.active {
  color: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.10);
}

.history-item {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
  padding: 0 5px 0 0;
  background: transparent;
  color: var(--ink);
}

.history-open,
.history-delete {
  border: 0;
  background: transparent;
  color: inherit;
}

.history-open {
  min-width: 0;
  padding: 0 6px 0 12px;
  text-align: left;
}

.history-delete {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, color 140ms ease;
}

.history-item:hover .history-delete,
.history-delete:focus-visible {
  opacity: 1;
  transform: translateX(0);
}

.history-delete:hover {
  background: #fff1f2;
  color: var(--rose);
}

.nav-button svg,
.history-open svg,
.history-delete svg,
.icon-button svg,
.tool-chip svg,
.round-button svg,
.send-button svg {
  width: 18px;
  height: 18px;
}

.history {
  min-height: 0;
  overflow: auto;
}

.history p {
  margin: 0 0 8px 4px;
}

.history-empty {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  padding: 10px;
  font-size: 12px;
  line-height: 1.6;
}

.history-empty svg {
  width: 16px;
  height: 16px;
  color: var(--brand-strong);
  flex: 0 0 auto;
}

.history-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-list {
  display: grid;
  gap: 6px;
}

.history-open small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.left-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.left-foot svg {
  width: 16px;
  height: 16px;
  margin-left: auto;
}

.account-menu {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 62px;
  z-index: 12;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(23, 32, 42, 0.16);
  padding: 10px;
}

.account-menu[hidden] {
  display: none;
}

.account-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}

.account-menu-head strong,
.account-menu-head span {
  display: block;
}

.account-menu-head span {
  color: var(--muted);
  font-size: 12px;
}

.account-menu button {
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 8px;
}

.account-menu button:hover {
  background: #f3f6f9;
}

.account-menu button svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.chat-main {
  min-width: 0;
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 250, 253, 0.92)),
    #fbfcfd;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.chat-header {
  position: relative;
  z-index: 36;
  height: 58px;
  border-bottom: 1px solid rgba(214, 222, 232, 0.78);
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) minmax(320px, 420px);
  align-items: center;
  padding: 0 14px;
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.25);
}

.header-left,
.header-right {
  display: flex;
  gap: 6px;
}

.header-right {
  position: relative;
  justify-content: flex-end;
}

.icon-button,
.round-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
}

.icon-button:hover,
.round-button:hover {
  border-color: rgba(0, 122, 255, 0.12);
  background: var(--glass-strong);
  color: var(--ios-blue);
}

.icon-button.danger {
  color: var(--rose);
}

.icon-button.danger:hover {
  background: #fff1f2;
}

.title-block {
  text-align: center;
  min-width: 0;
}

.title-block h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.title-block span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.routing-bar {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(150px, 220px) minmax(240px, 320px);
  gap: 10px;
  align-items: end;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfbfa;
}

.sr-config {
  display: none;
}

.routing-bar label {
  display: grid;
  gap: 4px;
}

select,
input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

select:focus,
input:focus {
  border-color: rgba(0, 122, 255, 0.38);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.11);
}

.mode-picker {
  min-height: 36px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef0f2;
}

.mode-picker label {
  display: block;
}

.mode-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-picker span {
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}

.mode-picker input:checked + span {
  background: #ffffff;
  color: var(--brand-strong);
  font-weight: 800;
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 30px 22px 18px;
}

.discover-page {
  min-height: 0;
  overflow: auto;
  padding: 38px 24px;
}

.workflow-page {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.workflow-inner {
  width: 100%;
  height: 100%;
  margin: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

.workflow-head,
.workflow-canvas-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workflow-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 24px;
  backdrop-filter: blur(16px);
}

.workflow-head h2,
.workflow-head p,
.workflow-canvas-top h3,
.workflow-canvas-top p {
  margin: 0;
}

.workflow-head h2 {
  font-size: 22px;
}

.workflow-head p,
.workflow-canvas-top p,
.workflow-library-group span,
.workflow-empty-text,
.workflow-help-card p,
.workflow-node p,
.workflow-node small {
  color: var(--muted);
}

.workflow-head p {
  margin-top: 4px;
  line-height: 1.55;
}

.workflow-actions,
.workflow-canvas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workflow-actions button,
.workflow-canvas-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.workflow-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 320px;
  gap: 0;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.workflow-library,
.workflow-canvas-wrap,
.workflow-editor-card,
.workflow-help-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.workflow-library {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 14px;
  position: relative;
  top: auto;
}

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

.workflow-library-group > strong,
.workflow-library-group > span {
  padding: 0 4px;
}

.workflow-list-card {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  padding: 9px;
}

.workflow-list-card:hover,
.workflow-list-card.active {
  border-color: rgba(166, 118, 34, 0.26);
  background: #fff8ec;
}

.workflow-list-card svg {
  width: 18px;
  height: 18px;
  color: var(--brand-strong);
}

.workflow-list-card > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
}

.workflow-list-card strong,
.workflow-list-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-list-card small,
.workflow-empty-text {
  font-size: 12px;
}

.workflow-palette-node {
  min-height: 62px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  padding: 9px;
}

.workflow-palette-node:hover {
  border-color: rgba(45, 108, 223, 0.32);
  background: #f4f8ff;
}

.workflow-palette-node:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.workflow-palette-node > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef6ff;
  color: var(--blue);
}

.workflow-palette-node svg {
  width: 18px;
  height: 18px;
}

.workflow-palette-node strong,
.workflow-palette-node small {
  display: block;
}

.workflow-palette-node small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-canvas-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 0;
  border-radius: 0;
  background: #f7fbff;
  box-shadow: none;
  padding: 0;
}

.workflow-canvas-top {
  min-height: 82px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
}

.workflow-canvas-top span {
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.workflow-canvas-top h3 {
  margin-top: 4px;
  font-size: 22px;
}

.workflow-canvas {
  display: grid;
  gap: 0;
  min-height: 0;
  padding: 0;
}

.workflow-canvas-board {
  position: relative;
  height: 100%;
  min-height: 680px;
  margin-top: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(rgba(45, 108, 223, 0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(45, 108, 223, 0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(circle at 28% 18%, rgba(214, 173, 98, 0.16), transparent 26%),
    linear-gradient(135deg, #fbfcfd, #f4f8fc);
}

.workflow-canvas-surface {
  position: relative;
  width: 2600px;
  height: 1400px;
  transform-origin: 0 0;
}

.workflow-edge-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.workflow-edge-layer path {
  fill: none;
  stroke: rgba(45, 108, 223, 0.34);
  stroke-width: 2.5;
  stroke-linecap: round;
  cursor: pointer;
  pointer-events: stroke;
}

.workflow-edge-layer path:hover {
  stroke: rgba(220, 38, 38, 0.72);
}

.workflow-edge-layer .workflow-edge-preview {
  stroke: rgba(34, 197, 94, 0.72);
  stroke-dasharray: 8 8;
  pointer-events: none;
}

.workflow-canvas-node {
  position: absolute;
  width: 360px;
  min-height: 218px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid rgba(125, 211, 252, 0.72);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(23, 32, 42, 0.12);
  padding: 12px;
  user-select: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.workflow-canvas-node.editable {
  cursor: grab;
}

.workflow-canvas-node.dragging {
  cursor: grabbing;
  opacity: 0.9;
  transform: translateY(-2px);
}

.workflow-canvas-node.active {
  z-index: 3;
  border-color: rgba(166, 118, 34, 0.62);
  box-shadow: 0 0 0 4px rgba(166, 118, 34, 0.14), 0 18px 44px rgba(23, 32, 42, 0.14);
}

.workflow-canvas-node.disabled {
  opacity: 0.58;
  border-color: rgba(148, 163, 184, 0.58);
  background: rgba(248, 250, 252, 0.9);
  filter: grayscale(0.28);
}

.workflow-canvas-node.locked {
  cursor: default;
}

.workflow-canvas-node.breakpoint {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18), 0 14px 34px rgba(23, 32, 42, 0.12);
}

.workflow-canvas-node.expanded {
  z-index: 6;
  width: 360px;
  max-height: min(650px, calc(100vh - 150px));
  overflow: auto;
  cursor: default;
}

.workflow-node-headline,
.workflow-node-model-row,
.workflow-node-chip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-node-headline {
  justify-content: space-between;
}

.workflow-node-type {
  min-width: 0;
  max-width: 150px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-node-type svg {
  width: 17px;
  height: 17px;
  color: #0891b2;
}

.workflow-canvas-node .workflow-node-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workflow-canvas-node .workflow-node-actions button,
.workflow-node-model-row button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(203, 213, 225, 0.72);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  padding: 0;
}

.workflow-canvas-node .workflow-node-actions button:hover,
.workflow-node-model-row button:hover {
  border-color: rgba(14, 165, 233, 0.45);
  color: #0284c7;
}

.workflow-canvas-node .workflow-node-actions button.active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(239, 246, 255, 0.96);
  color: #2563eb;
}

.workflow-canvas-node .workflow-node-actions button.status-running {
  color: #0284c7;
}

.workflow-canvas-node .workflow-node-actions button.status-done {
  color: #16a34a;
}

.workflow-canvas-node .workflow-node-actions button.status-error {
  color: #dc2626;
}

.workflow-canvas-node .workflow-node-actions svg,
.workflow-node-model-row svg {
  width: 14px;
  height: 14px;
}

.workflow-node-model-row {
  min-height: 36px;
  border: 1px solid rgba(34, 211, 238, 0.72);
  border-radius: 7px;
  background: rgba(236, 254, 255, 0.78);
  padding: 6px 8px;
}

.workflow-canvas-node .workflow-node-index {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 7px;
  font-size: 12px;
}

.workflow-node-model-row span:not(.workflow-node-index) {
  min-width: 0;
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  color: #0e7490;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-node-chip-row {
  flex-wrap: wrap;
}

.workflow-node-chip-row span {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.9);
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  padding: 0 8px;
}

.workflow-node-chip-row .muted-chip {
  background: rgba(226, 232, 240, 0.85);
  color: #64748b;
}

.workflow-node-chip-row .muted-chip.warning {
  background: rgba(254, 243, 199, 0.95);
  color: #b45309;
}

.workflow-node-chip-row .muted-chip.success {
  background: rgba(220, 252, 231, 0.95);
  color: #15803d;
}

.workflow-node-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.workflow-node-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.workflow-node-artifacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.workflow-node-artifacts span {
  min-width: 0;
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px dashed rgba(125, 211, 252, 0.78);
  border-radius: 8px;
  background: rgba(240, 249, 255, 0.74);
  color: #0369a1;
  font-size: 11px;
  font-weight: 800;
  padding: 0 8px;
}

.workflow-node-artifacts svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.workflow-node-preview-trigger {
  display: block;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.workflow-node-preview-trigger:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  border-radius: 12px;
}

.workflow-node-preview {
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border: 1px dashed rgba(125, 211, 252, 0.85);
  border-radius: 10px;
  background: rgba(240, 253, 255, 0.68);
  padding: 9px;
}

.workflow-node-preview.text {
  background: rgba(248, 250, 252, 0.9);
}

.workflow-node-preview.file {
  border-color: rgba(191, 219, 254, 0.9);
  background: rgba(239, 246, 255, 0.82);
}

.workflow-node-preview.image,
.workflow-node-preview.video {
  grid-template-columns: 76px minmax(0, 1fr) auto;
}

.workflow-node-preview-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(224, 242, 254, 0.95);
  color: #0284c7;
}

.workflow-node-media {
  width: 76px;
  height: 48px;
  overflow: hidden;
  border-radius: 8px;
  background: #e2e8f0;
}

.workflow-node-media img,
.workflow-node-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.workflow-node-preview-copy {
  min-width: 0;
}

.workflow-node-preview-copy strong,
.workflow-node-preview-copy p {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-node-preview-copy strong {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
}

.workflow-node-preview-copy p {
  margin: 3px 0 0;
  color: #94a3b8;
  font-size: 11px;
}

.workflow-node-preview > span {
  align-self: start;
  min-height: 18px;
  border-radius: 999px;
  background: rgba(207, 250, 254, 0.95);
  color: #0891b2;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
}

.workflow-node-menu {
  position: absolute;
  top: 44px;
  right: 12px;
  z-index: 24;
  width: 186px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
  padding: 6px;
}

.workflow-node-menu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #334155;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  padding: 0 10px;
}

.workflow-node-menu button:hover {
  background: rgba(239, 246, 255, 0.95);
  color: #2563eb;
}

.workflow-node-menu button.danger {
  color: #dc2626;
}

.workflow-node-menu svg {
  width: 15px;
  height: 15px;
}

.workflow-node-inline-config {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  border-top: 1px solid rgba(226, 232, 240, 0.92);
  padding-top: 10px;
}

.workflow-node-inline-head,
.workflow-node-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.workflow-node-inline-head strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.workflow-node-inline-head .mini-neutral {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  padding: 0 10px;
}

.workflow-node-inline-head svg {
  width: 14px;
  height: 14px;
}

.workflow-node-inline-config .workflow-step-editor {
  display: grid;
  gap: 9px;
}

.workflow-node-inline-config label {
  display: grid;
  gap: 5px;
}

.workflow-node-inline-config label span,
.workflow-node-inline-config .workflow-step-model-summary > span {
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.workflow-node-inline-config input,
.workflow-node-inline-config textarea,
.workflow-node-inline-config select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 13px;
  outline: 0;
  padding: 7px 10px;
}

.workflow-node-inline-config textarea {
  min-height: 72px;
  resize: vertical;
}

.workflow-node-inline-config input:focus,
.workflow-node-inline-config textarea:focus,
.workflow-node-inline-config select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.workflow-node-inline-config .workflow-step-model-summary {
  border-radius: 12px;
  padding: 10px;
}

.workflow-node-inline-actions .secondary-button {
  width: 100%;
  min-height: 34px;
  justify-content: center;
}

.workflow-node-port {
  position: absolute;
  top: 59px;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(45, 108, 223, 0.35);
  cursor: crosshair;
  z-index: 2;
}

.workflow-node-port:hover {
  transform: scale(1.35);
  box-shadow: 0 0 0 5px rgba(45, 108, 223, 0.14);
}

.workflow-node-port.left {
  left: -8px;
}

.workflow-node-port.right {
  right: -8px;
}

.workflow-node {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 26px;
}

.workflow-node:last-child {
  padding-bottom: 0;
}

.workflow-node-index {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #18202a;
  color: #ffffff;
  font-weight: 900;
  z-index: 1;
}

.workflow-connector {
  position: absolute;
  left: 18px;
  top: 42px;
  bottom: 4px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(166, 118, 34, 0.42), rgba(45, 108, 223, 0.18));
}

.workflow-node-body {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 13px;
}

.workflow-node.editable .workflow-node-body {
  background: #ffffff;
}

.workflow-node-head {
  display: grid;
  gap: 5px;
}

.workflow-node-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 800;
}

.workflow-node-head svg {
  width: 15px;
  height: 15px;
}

.workflow-node-head strong {
  font-size: 16px;
}

.workflow-node p {
  margin: 8px 0 0;
  line-height: 1.6;
}

.workflow-node small {
  display: block;
  margin-top: 8px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.workflow-node-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.workflow-node-actions button {
  min-height: 28px;
  border: 0;
  border-radius: 10px;
  background: #f1f3f5;
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
}

.workflow-node-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.workflow-editor {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: #f8fafc;
  padding: 14px;
  position: relative;
  top: auto;
}

.workflow-editor-card,
.workflow-help-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.workflow-editor-card h3 {
  margin: 0;
  font-size: 16px;
}

.workflow-editor-card label,
.workflow-step-editor {
  display: grid;
  gap: 7px;
}

.workflow-editor-card span {
  color: var(--muted);
  font-size: 12px;
}

.workflow-editor-card textarea {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 14px;
  resize: vertical;
  padding: 10px;
  outline: none;
}

.workflow-step-editor {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 12px;
}

.workflow-help-card p {
  margin: 0;
  line-height: 1.7;
}

.workflow-builder {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  background: #f8fafc;
}

.workflow-builder-bar {
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 255, 0.94);
  backdrop-filter: blur(18px);
}

.workflow-builder-left,
.workflow-builder-actions,
.workflow-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workflow-builder-left {
  min-width: 0;
}

.workflow-app-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #22c55e;
  color: #ffffff;
}

.workflow-title-row h2,
.workflow-builder-left p {
  margin: 0;
}

.workflow-title-row h2 {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.workflow-title-row span,
.workflow-builder-left p {
  color: var(--muted);
  font-size: 12px;
}

.workflow-builder-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workflow-builder-actions select {
  min-width: 188px;
  min-height: 38px;
}

.workflow-canvas-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.workflow-project-strip {
  position: absolute;
  z-index: 9;
  left: 18px;
  right: 18px;
  top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  pointer-events: none;
}

.workflow-project-card {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 9px;
  row-gap: 4px;
  align-items: center;
  border: 1px solid rgba(191, 219, 254, 0.72);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  padding: 10px;
  pointer-events: auto;
}

.workflow-project-card svg {
  grid-row: span 2;
  width: 18px;
  height: 18px;
  border-radius: 10px;
  background: rgba(239, 246, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(191, 219, 254, 0.9);
  color: #0b84ff;
  padding: 7px;
}

.workflow-project-card span {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.workflow-project-card strong {
  min-width: 0;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .workflow-project-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 720px) {
  .workflow-project-strip {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    overflow-x: auto;
    right: 12px;
    left: 12px;
  }

  .workflow-project-card {
    min-width: 150px;
  }
}

.workflow-canvas-stage .workflow-canvas-board {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  touch-action: none;
  cursor: grab;
  user-select: none;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(0deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px) 0 0 / 72px 72px,
    radial-gradient(circle, rgba(100, 116, 139, 0.22) 1px, transparent 1.2px) 0 0 / 18px 18px,
    linear-gradient(180deg, rgba(247, 250, 255, 0.94), rgba(255, 255, 255, 0.98));
  padding: 28px;
}

.workflow-canvas-stage .workflow-canvas-board::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.workflow-canvas-stage .workflow-canvas-board.panning {
  cursor: grabbing;
}

.workflow-canvas-stage .workflow-canvas-surface {
  position: relative;
  width: 2600px;
  height: 1400px;
  margin-top: 104px;
  transform-origin: 0 0;
}

.workflow-canvas-stage .workflow-edge-layer path {
  stroke: rgba(99, 139, 236, 0.52);
  stroke-width: 3;
}

.workflow-canvas-stage .workflow-canvas-node {
  width: 360px;
  min-height: 218px;
  gap: 9px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
  padding: 12px;
}

.workflow-canvas-stage .workflow-canvas-node.active {
  z-index: 6;
  border-color: rgba(214, 173, 98, 0.84);
  box-shadow: 0 0 0 3px rgba(214, 173, 98, 0.18), 0 16px 34px rgba(15, 23, 42, 0.12);
}

.workflow-canvas-stage .workflow-canvas-node.expanded {
  width: 360px;
  max-height: min(650px, calc(100vh - 150px));
  overflow: auto;
}

.workflow-canvas-stage .workflow-node-index {
  border-radius: 10px;
}

.workflow-canvas-stage .workflow-node-port {
  top: 50%;
  transform: translateY(-50%);
}

.workflow-canvas-stage .workflow-node-port:hover {
  transform: translateY(-50%) scale(1.35);
}

.workflow-canvas-stage .workflow-canvas-node.expanded .workflow-node-port {
  top: 109px;
}

.workflow-preview-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(5px);
}

.workflow-preview-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 41;
  width: min(980px, calc(100% - 56px));
  max-height: min(760px, calc(100% - 56px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.24);
  transform: translate(-50%, -50%);
}

.workflow-preview-head,
.workflow-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
}

.workflow-preview-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.workflow-preview-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 850;
}

.workflow-preview-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 22px;
  font-weight: 950;
}

.workflow-preview-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
}

.workflow-preview-toolbar {
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.74), rgba(255, 255, 255, 0.94));
}

.workflow-preview-tabs,
.workflow-preview-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-preview-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #64748b;
  font-size: 13px;
  font-weight: 850;
  padding: 0 12px;
}

.workflow-preview-tabs button.active {
  border-color: rgba(37, 99, 235, 0.36);
  background: rgba(239, 246, 255, 0.96);
  color: #2563eb;
}

.workflow-preview-tabs svg,
.workflow-preview-actions svg {
  width: 15px;
  height: 15px;
}

.workflow-preview-body {
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.workflow-preview-loading,
.workflow-preview-error,
.workflow-preview-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed rgba(191, 219, 254, 0.95);
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.86);
  color: #64748b;
  text-align: center;
}

.workflow-preview-loading svg {
  width: 30px;
  height: 30px;
  color: #2563eb;
  animation: spin 900ms linear infinite;
}

.workflow-preview-error {
  border-color: rgba(252, 165, 165, 0.92);
  background: rgba(254, 242, 242, 0.92);
  color: #991b1b;
}

.workflow-preview-result {
  display: grid;
  gap: 14px;
}

.workflow-preview-result.media {
  justify-items: center;
}

.workflow-preview-result.media img,
.workflow-preview-result.media video {
  max-width: min(100%, 880px);
  max-height: 520px;
  display: block;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: #f8fafc;
  object-fit: contain;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.10);
}

.workflow-preview-result.text pre,
.workflow-preview-code {
  margin: 0;
  min-height: 260px;
  overflow: auto;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 16px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  padding: 16px;
}

.workflow-preview-detail-grid,
.workflow-preview-usage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.workflow-preview-detail-grid article,
.workflow-preview-usage article {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.92);
  padding: 14px;
}

.workflow-preview-detail-grid span,
.workflow-preview-usage span {
  color: #64748b;
  font-size: 12px;
  font-weight: 820;
}

.workflow-preview-detail-grid strong,
.workflow-preview-usage strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 16px;
  font-weight: 950;
}

.workflow-preview-note {
  margin: 12px 0 0;
  color: #64748b;
  font-size: 13px;
}

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

.workflow-step-model-summary {
  display: flex;
  align-items: center;
}

.workflow-step-model-summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border: 1px solid rgba(186, 230, 253, 0.95);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(236, 254, 255, 0.9));
  padding: 12px;
}

.workflow-step-model-summary span,
.workflow-step-model-summary small {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.workflow-step-model-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step-model-summary small {
  grid-column: 1 / 2;
  color: #2563eb;
}

.workflow-step-model-summary button {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  min-height: 34px;
  padding: 0 12px;
}

.workflow-bottom-bar {
  position: absolute;
  z-index: 9;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 50px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(16px);
}

.workflow-tool-icon,
.workflow-zoom-chip,
.workflow-add-node-button,
.workflow-run-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  white-space: nowrap;
}

.workflow-tool-icon {
  width: 38px;
  background: #f5f7fb;
  color: var(--ink);
}

.workflow-tool-icon.active,
.workflow-tool-icon:hover {
  background: #edf4ff;
  color: var(--blue);
}

.workflow-zoom-chip {
  min-width: 62px;
  padding: 0 12px;
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
}

.workflow-add-node-button {
  padding: 0 18px;
  background: #eef2ff;
  color: #3b5bdb;
  font-weight: 800;
}

.workflow-run-button {
  padding: 0 20px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 900;
}

.workflow-picker-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(15, 23, 42, 0.02);
}

.workflow-node-picker {
  position: absolute;
  z-index: 11;
  left: 50%;
  bottom: 80px;
  width: min(560px, calc(100% - 36px));
  max-height: min(620px, calc(100% - 120px));
  overflow: auto;
  transform: translateX(-50%);
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
  padding: 12px;
}

.workflow-node-search {
  height: 40px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  color: var(--muted);
}

.workflow-node-search input {
  border: 0;
  outline: 0;
  background: transparent;
}

.workflow-node-picker-group {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.workflow-node-picker-group > strong {
  color: #64748b;
  font-size: 13px;
}

.workflow-node-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}

.workflow-picker-empty {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.75);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.86);
  color: #64748b;
}

.workflow-picker-empty strong {
  color: #0f172a;
}

.workflow-model-backdrop {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(10px);
}

.workflow-model-modal {
  position: absolute;
  z-index: 21;
  left: 50%;
  top: 50%;
  width: min(820px, calc(100% - 48px));
  max-height: min(760px, calc(100% - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.28);
}

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

.workflow-model-modal-head {
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
}

.workflow-model-modal-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.workflow-model-modal-head h3 {
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 18px;
}

.workflow-model-modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.workflow-model-list-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  border-right: 1px solid rgba(226, 232, 240, 0.88);
  background: rgba(248, 250, 252, 0.9);
  padding: 12px;
}

.workflow-model-search {
  min-height: 40px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: #ffffff;
  padding: 0 10px;
  color: #94a3b8;
}

.workflow-model-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.workflow-model-category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.workflow-model-category-tabs button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 10px;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.workflow-model-category-tabs button.active,
.workflow-model-category-tabs button:hover {
  border-color: rgba(37, 99, 235, 0.24);
  background: #eff6ff;
  color: #2563eb;
}

.workflow-model-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}

.workflow-model-list button,
.workflow-interface-list button {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #0f172a;
  text-align: left;
  padding: 9px;
}

.workflow-model-list button:hover,
.workflow-model-list button.active,
.workflow-interface-list button:hover,
.workflow-interface-list button.active {
  border-color: rgba(125, 211, 252, 0.9);
  background: rgba(236, 254, 255, 0.9);
}

.workflow-model-list button > svg,
.workflow-interface-list button > svg {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #ffffff;
  color: #0891b2;
  padding: 7px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.workflow-model-list strong,
.workflow-model-list small,
.workflow-interface-list strong,
.workflow-interface-list small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-model-list strong,
.workflow-interface-list strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 950;
}

.workflow-model-list small,
.workflow-interface-list small {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 11px;
}

.workflow-model-detail-panel {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px;
}

.workflow-model-detail-title {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.workflow-model-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
  color: #2563eb;
}

.workflow-model-mark svg {
  width: 26px;
  height: 26px;
}

.workflow-model-detail-title h4 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
}

.workflow-model-detail-title p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.workflow-model-requirement,
.workflow-model-setting-block {
  display: grid;
  gap: 9px;
}

.workflow-model-requirement span,
.workflow-model-setting-block > strong {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.workflow-model-requirement div {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  padding: 0 12px;
}

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

.workflow-route-grid button {
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.workflow-route-grid button.active,
.workflow-route-grid button:hover {
  border-color: rgba(37, 99, 235, 0.26);
  background: #eff6ff;
  color: #2563eb;
}

.workflow-interface-list {
  display: grid;
  gap: 7px;
}

.workflow-model-empty {
  border: 1px dashed rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  color: #94a3b8;
  font-size: 13px;
  text-align: center;
  padding: 18px;
}

.workflow-model-empty.large {
  min-height: 280px;
  display: grid;
  place-items: center;
}

.workflow-model-modal-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(226, 232, 240, 0.88);
  background: rgba(248, 250, 252, 0.82);
}

.workflow-picker-item {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 7px;
}

.workflow-picker-item:hover {
  background: #f4f7fb;
}

.workflow-picker-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.workflow-picker-item i {
  grid-row: span 2;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
}

.workflow-picker-item svg {
  width: 15px;
  height: 15px;
}

.workflow-picker-item span,
.workflow-picker-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-picker-item span {
  font-weight: 800;
}

.workflow-picker-item small {
  color: var(--muted);
  font-size: 12px;
}

.workflow-picker-item.tone-black i { background: #111827; }
.workflow-picker-item.tone-violet i { background: #6366f1; }
.workflow-picker-item.tone-cyan i { background: #06b6d4; }
.workflow-picker-item.tone-orange i { background: #f97316; }
.workflow-picker-item.tone-blue i { background: #3b82f6; }
.workflow-picker-item.tone-green i { background: #22c55e; }

.canvas-template-dock {
  position: absolute;
  z-index: 8;
  top: 18px;
  left: 18px;
  bottom: 86px;
  width: 252px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 54px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(18px);
  padding: 14px;
}

.canvas-template-head {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.canvas-template-head strong {
  color: #0f172a;
  font-size: 18px;
}

.canvas-template-head span,
.canvas-template-section p,
.canvas-template-card small,
.canvas-template-empty {
  color: var(--muted);
  font-size: 12px;
}

.canvas-template-section {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.canvas-template-section p {
  margin: 0;
  font-weight: 900;
}

.canvas-template-card {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.82);
  color: var(--ink);
  text-align: left;
  padding: 9px;
  transition: transform 180ms var(--spring), background 160ms ease, border-color 160ms ease, box-shadow 180ms ease;
}

.canvas-template-card:hover,
.canvas-template-card.active {
  transform: translate3d(2px, 0, 0);
  border-color: rgba(37, 99, 235, 0.24);
  background: #eef6ff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.1);
}

.canvas-template-card > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
  color: var(--blue);
}

.canvas-template-card span,
.canvas-template-card strong,
.canvas-template-card small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-template-card strong {
  font-size: 13px;
}

.canvas-template-empty {
  border: 1px dashed rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  padding: 12px;
  line-height: 1.5;
}

.message-assets {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.media-asset-card {
  max-width: 640px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.media-asset-card.image {
  padding: 10px;
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.08);
}

.media-asset-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.media-asset-head > i {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef6ff;
  color: var(--blue);
}

.media-asset-head strong,
.media-asset-head span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-asset-head span {
  color: var(--muted);
  font-size: 12px;
}

.media-asset-head em {
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  padding: 5px 10px;
}

.media-video,
.media-image,
.media-preview {
  width: 100%;
  border-radius: 14px;
  background: #f8fafc;
}

.media-video {
  max-height: 320px;
}

.media-image-button {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 16px;
  background: #f8fafc;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
}

.media-image {
  display: block;
  max-height: 520px;
  object-fit: contain;
  transition: transform 180ms ease, filter 180ms ease;
}

.media-image-button:hover .media-image {
  transform: scale(1.012);
  filter: saturate(1.02);
}

.media-zoom-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.media-zoom-hint svg {
  width: 14px;
  height: 14px;
}

.media-image-button:hover .media-zoom-hint,
.media-image-button:focus-visible .media-zoom-hint {
  opacity: 1;
  transform: translateY(0);
}

.media-preview {
  min-height: 116px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.media-preview svg {
  width: 24px;
  height: 24px;
  color: var(--brand-strong);
}

.media-rendering {
  min-height: 240px;
  justify-items: center;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.92));
  overflow: hidden;
}

.media-rendering strong {
  color: var(--ink);
  font-size: 14px;
}

.media-render-animation {
  width: min(320px, 82%);
  aspect-ratio: 16 / 10;
  display: grid;
  grid-template-columns: 1.35fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  padding: 9px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.media-render-animation span {
  border-radius: 12px;
  background:
    linear-gradient(110deg, rgba(226, 232, 240, 0.9) 8%, rgba(255, 255, 255, 0.95) 18%, rgba(209, 224, 255, 0.9) 33%);
  background-size: 220% 100%;
  animation: media-render-sheen 1.35s ease-in-out infinite;
}

.media-render-animation span:first-child {
  grid-row: span 2;
}

.media-render-animation span:nth-child(2) { animation-delay: 120ms; }
.media-render-animation span:nth-child(3) { animation-delay: 240ms; }
.media-render-animation span:nth-child(4) { animation-delay: 360ms; }

@keyframes media-render-sheen {
  0% { background-position: 100% 0; opacity: 0.7; }
  50% { opacity: 1; }
  100% { background-position: -100% 0; opacity: 0.78; }
}

.media-asset-actions {
  display: flex;
  justify-content: flex-end;
}

.media-asset-actions a,
.media-asset-actions button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.preview-open {
  overflow: hidden;
}

.media-preview-modal {
  z-index: 140;
  padding: 28px;
}

.media-preview-dialog {
  position: relative;
  width: min(1120px, 96vw);
  max-height: min(88vh, 920px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.28);
  padding: 14px;
  backdrop-filter: blur(22px) saturate(1.15);
}

.media-preview-dialog img {
  min-width: 0;
  max-width: 100%;
  max-height: calc(88vh - 96px);
  justify-self: center;
  align-self: center;
  border-radius: 16px;
  object-fit: contain;
  background: #f8fafc;
}

.media-preview-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.media-preview-dialog footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.86);
}

.discover-inner {
  width: min(920px, 100%);
  margin: 0 auto;
}

.discover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.discover-head h2 {
  margin: 0;
  font-size: 24px;
}

.discover-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.discover-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.discover-actions .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.discover-actions svg {
  width: 16px;
  height: 16px;
}

.discover-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.discover-tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 18px;
}

.discover-tabs button.active {
  border-color: #18202a;
  background: #18202a;
  color: #ffffff;
}

.discover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.discover-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.discover-card-main {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}

.discover-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #eef6ff;
  color: var(--blue);
}

.discover-icon svg {
  width: 26px;
  height: 26px;
}

.discover-card strong,
.discover-card p,
.discover-card span {
  display: block;
}

.discover-card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.discover-card span {
  color: var(--muted);
  font-size: 12px;
}

.discover-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.agent-workbench {
  width: min(1180px, 100%);
}

.workbench-head {
  align-items: center;
}

.workbench-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.9);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.workbench-head h2 {
  max-width: 720px;
  margin-top: 10px;
  font-size: clamp(26px, 3vw, 40px);
  letter-spacing: 0;
  line-height: 1.12;
}

.workbench-head p {
  max-width: 720px;
  line-height: 1.8;
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  gap: 14px;
  margin-bottom: 18px;
}

.workbench-feature-card,
.workbench-canvas-preview,
.workbench-section,
.workbench-workflow-card {
  border: 1px solid rgba(191, 213, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 54px rgba(42, 99, 204, 0.1);
}

.workbench-feature-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, rgba(59, 130, 246, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(239, 246, 255, 0.92));
}

.workbench-feature-top,
.workbench-feature-actions,
.workbench-section-head,
.workbench-chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.workbench-feature-top {
  justify-content: space-between;
  flex-wrap: wrap;
}

.workbench-feature-top span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-weight: 900;
}

.workbench-feature-top svg,
.workbench-feature-actions svg,
.workbench-workflow-main svg,
.workbench-canvas-toolbar svg {
  width: 17px;
  height: 17px;
}

.workbench-feature-top small,
.workbench-section-head p,
.workbench-workflow-card p,
.workbench-canvas-toolbar small {
  color: var(--muted);
}

.workbench-feature-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.16;
  letter-spacing: 0;
}

.workbench-feature-card p {
  margin: 0;
  color: #475569;
  line-height: 1.85;
}

.workbench-feature-actions {
  flex-wrap: wrap;
}

.workbench-canvas-preview {
  min-height: 320px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
}

.workbench-canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.workbench-canvas-toolbar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.workbench-mini-canvas {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 18px;
  background:
    radial-gradient(circle, rgba(59, 130, 246, 0.22) 1px, transparent 1.4px) 0 0 / 18px 18px,
    linear-gradient(135deg, rgba(248, 251, 255, 0.96), rgba(236, 246, 255, 0.9));
}

.workbench-mini-canvas svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.workbench-mini-canvas path {
  fill: none;
  stroke: rgba(37, 99, 235, 0.34);
  stroke-width: 0.8;
  stroke-linecap: round;
}

.workbench-mini-node {
  position: absolute;
  z-index: 1;
  left: var(--x);
  top: var(--y);
  width: 132px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(191, 213, 255, 0.92);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
}

.workbench-mini-node i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--blue);
}

.workbench-mini-node svg {
  position: static;
  width: 16px;
  height: 16px;
}

.workbench-mini-node strong {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-tabs {
  margin-top: 2px;
}

.workbench-section {
  display: grid;
  gap: 16px;
  margin-top: 14px;
  padding: 16px;
}

.workbench-section-head {
  justify-content: space-between;
  flex-wrap: wrap;
}

.workbench-section-head h3 {
  margin: 0;
  font-size: 20px;
}

.workbench-section-head p {
  margin: 5px 0 0;
}

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

.workbench-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workbench-workflow-card {
  padding: 12px;
}

.workbench-workflow-main {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0;
}

.workbench-workflow-main > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6ff;
  color: var(--blue);
}

.workbench-workflow-main strong,
.workbench-workflow-main p {
  display: block;
}

.workbench-workflow-main p {
  margin: 5px 0 0;
  line-height: 1.55;
}

.workbench-chip-row {
  flex-wrap: wrap;
  margin-top: 12px;
}

.workbench-chip-row span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.privacy-note {
  width: min(860px, calc(100% - 36px));
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.privacy-note svg {
  width: 16px;
  height: 16px;
  color: var(--brand-strong);
}

.front-announcement {
  position: relative;
  width: min(860px, calc(100% - 36px));
  margin: 14px auto 10px;
  border: 1px solid rgba(190, 213, 255, 0.72);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 42px rgba(45, 108, 223, 0.12);
  backdrop-filter: blur(18px) saturate(1.2);
  overflow: hidden;
}

.front-announcement[hidden] {
  display: none;
}

.front-announcement > a,
.front-announcement > div {
  min-height: 74px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  padding: 12px 46px 12px 14px;
}

.front-announcement.has-image > a,
.front-announcement.has-image > div {
  grid-template-columns: minmax(160px, 280px) minmax(0, 1fr) auto;
}

.front-announcement img {
  width: 100%;
  aspect-ratio: 16 / 5;
  object-fit: cover;
  border-radius: 14px;
  background: #f1f5f9;
}

.front-announcement-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(219, 234, 254, 0.9));
  color: var(--ios-blue);
}

.front-announcement-icon svg,
.front-announcement-cta svg,
.front-announcement-close svg {
  width: 17px;
  height: 17px;
}

.front-announcement-copy {
  min-width: 0;
}

.front-announcement-copy strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.front-announcement-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.front-announcement-cta {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.94);
  color: var(--ios-blue);
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
  white-space: nowrap;
}

.front-announcement-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #64748b;
}

.front-announcement-close:hover {
  color: #0f172a;
  background: #ffffff;
}

@media (max-width: 720px) {
  .front-announcement > a,
  .front-announcement > div,
  .front-announcement.has-image > a,
  .front-announcement.has-image > div {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px 44px 12px 12px;
  }

  .front-announcement.text-only > a,
  .front-announcement.text-only > div {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .front-announcement-cta {
    width: fit-content;
  }
}

.message {
  width: min(880px, 100%);
  margin: 0 auto 24px;
  display: flex;
  gap: 12px;
}

.message.user {
  justify-content: flex-end;
}

.message.user .message-body {
  width: auto;
  max-width: min(620px, 82%);
  background: rgba(239, 242, 247, 0.92);
  border: 1px solid rgba(223, 229, 237, 0.86);
  border-radius: 18px;
  padding: 10px 14px;
}

.message-body {
  width: 100%;
  line-height: 1.75;
}

.message-body p {
  margin: 0 0 10px;
}

.message-body p:last-child {
  margin-bottom: 0;
}

.writing-card {
  margin: 14px 0;
  border: 1px solid rgba(190, 213, 255, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 48px rgba(53, 102, 190, 0.12);
  overflow: hidden;
}

.writing-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(220, 230, 245, 0.86);
  background: linear-gradient(135deg, rgba(248, 251, 255, 0.98), rgba(240, 247, 255, 0.78));
}

.writing-card-head div {
  display: grid;
  gap: 2px;
}

.writing-card-head span {
  color: var(--muted);
  font-size: 12px;
}

.writing-card-head strong {
  color: var(--ink);
  font-size: 15px;
}

.writing-paragraph-list {
  display: grid;
  gap: 2px;
  padding: 10px;
}

.writing-paragraph {
  position: relative;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 12px 118px 12px 12px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.writing-paragraph:hover {
  border-color: rgba(121, 170, 255, 0.55);
  background: rgba(248, 251, 255, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.writing-paragraph p {
  margin: 0;
  color: var(--ink);
}

.writing-paragraph-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.writing-paragraph:hover .writing-paragraph-tools,
.writing-paragraph:focus-within .writing-paragraph-tools {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.writing-paragraph-tools button,
.writing-selection-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(207, 220, 238, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  box-shadow: 0 8px 20px rgba(45, 73, 120, 0.08);
}

.writing-paragraph-tools button:hover,
.writing-selection-toolbar button:hover {
  border-color: rgba(37, 124, 255, 0.44);
  color: var(--brand);
  background: #ffffff;
}

.writing-paragraph-tools svg,
.writing-selection-toolbar svg {
  width: 14px;
  height: 14px;
}

.writing-selection-toolbar {
  position: fixed;
  z-index: 2200;
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: calc(100vw - 24px);
  padding: 7px;
  border: 1px solid rgba(197, 213, 236, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 46px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(18px);
}

.writing-selection-toolbar[hidden] {
  display: none;
}

.writing-edit-modal {
  z-index: 2300;
}

.writing-edit-dialog {
  width: min(640px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  border: 1px solid rgba(210, 223, 242, 0.92);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.22);
  padding: 22px;
}

.writing-edit-dialog header,
.writing-edit-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.writing-edit-dialog header span,
.writing-edit-dialog label span {
  color: var(--muted);
  font-size: 13px;
}

.writing-edit-dialog h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.writing-edit-dialog blockquote {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  border-left: 3px solid var(--brand);
  border-radius: 14px;
  background: rgba(246, 250, 255, 0.92);
  color: #334155;
  padding: 12px 14px;
}

.writing-edit-dialog label {
  display: grid;
  gap: 8px;
}

.writing-edit-dialog textarea {
  min-height: 118px;
  resize: vertical;
  border: 1px solid rgba(203, 216, 235, 0.96);
  border-radius: 16px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  outline: none;
}

.writing-edit-dialog textarea:focus {
  border-color: rgba(37, 124, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(37, 124, 255, 0.12);
}

.thinking {
  color: var(--muted);
  font-size: 13px;
}

.answer-card {
  display: grid;
  gap: 6px;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.answer-card span {
  color: var(--muted);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.suggestions button {
  min-height: 34px;
  padding: 0 12px;
  background: #f1f3f5;
  color: var(--ink);
}

.suggestions button:hover {
  background: #e7eaee;
}

.composer {
  position: relative;
  width: min(860px, calc(100% - 36px));
  margin: 0 auto 18px;
  border: 1px solid rgba(190, 213, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(22px) saturate(1.28);
  box-shadow: 0 18px 48px rgba(45, 108, 223, 0.13);
  padding: 12px 12px 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.composer:focus-within {
  border-color: rgba(0, 122, 255, 0.4);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 56px rgba(0, 122, 255, 0.16);
}

.composer.drag-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(24, 160, 88, 0.12), 0 18px 48px rgba(23, 32, 42, 0.12);
}

.drop-hint {
  position: absolute;
  inset: 8px;
  z-index: 2;
  display: none;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(24, 160, 88, 0.56);
  border-radius: 12px;
  background: rgba(240, 253, 244, 0.94);
  color: var(--brand-strong);
  font-weight: 800;
  pointer-events: none;
}

.drop-hint svg {
  width: 24px;
  height: 24px;
}

.composer.drag-active .drop-hint {
  display: grid;
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  max-height: 180px;
  resize: none;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  color: var(--ink);
  background: transparent;
  padding: 8px 10px 12px;
  line-height: 1.6;
}

.composer-mode-panel {
  display: grid;
  gap: 12px;
  margin: 0 2px 8px;
  border: 1px solid rgba(216, 226, 238, 0.9);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 250, 254, 0.84));
  padding: 12px;
}

.composer-mode-head {
  display: grid;
  gap: 3px;
}

.composer-mode-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

.composer-mode-head svg {
  width: 17px;
  height: 17px;
  color: var(--ios-blue);
}

.composer-mode-head small {
  color: var(--muted);
  line-height: 1.5;
}

.composer-mode-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer-mode-group {
  display: inline-grid;
  gap: 6px;
  min-width: 128px;
}

.composer-mode-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.composer-mode-group > div {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(224, 231, 240, 0.92);
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.92);
}

.composer-mode-group button {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.composer-mode-group button:hover,
.composer-mode-group button.active {
  background: #ffffff;
  color: var(--ios-blue);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.13);
}

.composer textarea:focus {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.model-popover {
  position: absolute;
  left: 62px;
  bottom: 58px;
  z-index: 8;
  width: min(620px, calc(100vw - 36px));
  display: grid;
  gap: 10px;
  border: 1px solid rgba(215, 224, 236, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(24px) saturate(1.25);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
  padding: 12px;
}

.model-popover[hidden] {
  display: none;
}

.model-popover-main {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(210px, 0.9fr);
  gap: 10px;
}

.model-popover-section {
  display: grid;
  gap: 2px;
}

.model-list-section {
  border-right: 1px solid var(--line);
  padding-right: 10px;
  max-height: 390px;
  overflow: auto;
}

.model-popover-section > span {
  color: var(--muted);
  font-size: 12px;
  padding: 4px 8px;
}

.model-category {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
}

.model-category + .model-category {
  border-top: 1px solid rgba(226, 232, 240, 0.86);
  padding-top: 8px;
}

.model-category-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.model-category-heading svg {
  width: 15px;
  height: 15px;
}

.model-channel-caption {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 0 8px 6px;
}

.model-row {
  min-height: 50px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 6px 8px;
}

.model-row:hover,
.model-row.active {
  background: rgba(242, 246, 251, 0.94);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08);
}

.model-row svg {
  width: 18px;
  height: 18px;
}

.model-row.active svg {
  color: var(--brand-strong);
}

.model-add-row {
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}

.model-add-row:hover {
  border-radius: 14px;
}

.model-detail-card {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(222, 230, 240, 0.94);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px;
}

.model-detail-card strong {
  font-size: 16px;
}

.model-detail-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
}

.model-detail-card .model-channel-summary {
  border-radius: 14px;
  background: rgba(246, 248, 251, 0.9);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
}

.model-route-badge {
  width: max-content;
  border-radius: 999px;
  background: #fff8ec;
  color: var(--brand-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
}

.model-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.model-kind-badge {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: var(--ios-blue-soft);
  color: var(--ios-blue);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  line-height: 1.35;
}

.model-kind-badge svg {
  width: 14px;
  height: 14px;
}

.model-mode-preview {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(0, 122, 255, 0.16);
  border-radius: 16px;
  background: rgba(234, 244, 255, 0.78);
  color: #14539a;
  padding: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.model-mode-preview svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.model-detail-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.model-detail-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.model-detail-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
}

.model-detail-card li svg {
  width: 16px;
  height: 16px;
  color: var(--brand-strong);
}

.model-row strong,
.model-row small {
  display: block;
}

.model-row small {
  margin-top: 2px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-static-note {
  display: grid;
  gap: 4px;
  border-radius: 16px;
  background: #f6f8fb;
  border: 1px solid var(--line);
  padding: 12px 14px;
}

.model-static-note strong,
.model-static-note small {
  display: block;
}

.model-static-note strong {
  color: var(--ink);
  font-size: 14px;
}

.model-static-note small {
  color: var(--muted);
  line-height: 1.6;
}

.tool-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  overflow: visible;
}

.composer-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.tool-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(219, 228, 240, 0.88);
}

.tool-chip:hover,
.tool-chip.active {
  border-color: rgba(0, 122, 255, 0.22);
  background: var(--ios-blue-soft);
  color: var(--ios-blue);
}

.model-type-button {
  max-width: 220px;
}

.model-type-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-settings-host {
  position: relative;
}

.generation-settings-button {
  max-width: 150px;
}

.generation-settings-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-settings-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 26;
  width: min(360px, calc(100vw - 34px));
  display: grid;
  gap: 12px;
  border: 1px solid rgba(215, 224, 236, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(24px) saturate(1.2);
  padding: 12px;
}

.generation-settings-popover[hidden] {
  display: none;
}

.generation-settings-head {
  display: grid;
  gap: 5px;
}

.generation-settings-head strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 14px;
}

.generation-settings-head svg {
  width: 17px;
  height: 17px;
  color: var(--ios-blue);
}

.generation-settings-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.generation-settings-groups {
  display: grid;
  gap: 10px;
}

.generation-settings-group {
  display: grid;
  gap: 7px;
}

.generation-settings-group > span,
.generation-custom-ratio > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.generation-settings-group > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.generation-settings-group button {
  min-height: 32px;
  border: 1px solid rgba(219, 228, 240, 0.88);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}

.generation-settings-group button:hover,
.generation-settings-group button.active {
  border-color: rgba(0, 122, 255, 0.22);
  background: var(--ios-blue-soft);
  color: var(--ios-blue);
  box-shadow: 0 8px 18px rgba(0, 122, 255, 0.12);
}

.generation-custom-ratio {
  display: grid;
  gap: 6px;
}

.generation-custom-ratio input {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  outline: 0;
}

.generation-custom-ratio input:focus {
  border-color: rgba(0, 122, 255, 0.36);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.composer-current-config {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 420px);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-control .model-popover,
.channel-popover {
  position: absolute;
  z-index: 24;
  border: 1px solid rgba(215, 224, 236, 0.9);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.25);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.16);
}

.composer-control .model-popover {
  left: 0;
  right: auto;
  bottom: calc(100% + 10px);
  width: auto;
  max-width: calc(100vw - 28px);
  min-width: 220px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px;
}

.composer-control .model-popover[hidden],
.channel-popover[hidden] {
  display: none;
}

.model-cascade-main,
.model-cascade-submenu {
  display: grid;
  gap: 4px;
}

.model-cascade-main {
  width: 210px;
}

.model-cascade-submenu {
  width: 260px;
  max-height: 320px;
  overflow: auto;
  border-left: 1px solid rgba(226, 232, 240, 0.9);
  padding-left: 8px;
}

.model-cascade-interfaces {
  width: 330px;
}

.route-strategy-section {
  display: grid;
  gap: 8px;
}

.route-section-title {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 6px;
}

.route-section-title.divider {
  margin-top: 6px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding-top: 10px;
  text-align: center;
}

.route-strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.route-strategy-card {
  min-height: 70px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 4px 7px;
  align-items: start;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
  color: var(--ink);
  text-align: left;
  padding: 9px;
}

.route-strategy-card.active,
.route-strategy-card:hover {
  border-color: rgba(0, 122, 255, 0.36);
  background: rgba(234, 244, 255, 0.92);
  color: var(--ios-blue);
}

.route-strategy-card svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.route-strategy-card strong,
.route-strategy-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-strategy-card strong {
  font-size: 13px;
}

.route-strategy-card small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.cascade-menu-item,
.cascade-submenu-item {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 8px 10px;
}

.cascade-menu-item:hover,
.cascade-menu-item.active,
.cascade-submenu-item:hover,
.cascade-submenu-item.active {
  background: rgba(242, 246, 251, 0.96);
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08);
  color: var(--ios-blue);
}

.cascade-menu-item svg,
.cascade-submenu-item svg,
.channel-menu-item svg {
  width: 17px;
  height: 17px;
}

.cascade-menu-item strong,
.cascade-menu-item small,
.cascade-submenu-item strong,
.cascade-submenu-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cascade-menu-item strong,
.cascade-submenu-item strong {
  color: inherit;
  font-size: 14px;
}

.cascade-menu-item small,
.cascade-submenu-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.cascade-empty {
  width: 240px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
}

.channel-popover {
  left: 0;
  right: auto;
  top: calc(100% + 8px);
  min-width: 148px;
  display: grid;
  gap: 4px;
  padding: 7px;
}

.channel-menu-item {
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 0 10px;
}

.channel-menu-item:hover,
.channel-menu-item.active {
  background: rgba(234, 244, 255, 0.9);
  color: var(--ios-blue);
}

.attachment-tray,
.uploaded-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-tray {
  padding: 0 6px 8px;
}

.uploaded-attachments {
  margin-top: 10px;
}

.composer-attachments {
  margin-top: 0;
}

.uploaded-attachment {
  position: relative;
  width: min(260px, 100%);
  min-height: 58px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.94);
  padding: 7px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.message.user .uploaded-attachment {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(191, 219, 254, 0.9);
}

.uploaded-thumb,
.uploaded-file-icon {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #eaf4ff;
}

.uploaded-thumb {
  display: block;
  padding: 0;
  cursor: zoom-in;
}

.uploaded-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.uploaded-file-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
}

.uploaded-file-icon svg {
  width: 20px;
  height: 20px;
}

.uploaded-attachment-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.uploaded-attachment-meta strong,
.uploaded-attachment-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-attachment-meta strong {
  font-size: 13px;
  color: var(--ink);
}

.uploaded-attachment-meta span {
  color: var(--muted);
  font-size: 12px;
}

.uploaded-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-self: start;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}

.uploaded-remove:hover {
  background: #eff6ff;
  color: var(--blue);
}

.uploaded-remove svg {
  width: 14px;
  height: 14px;
}

.attachment-chip {
  min-height: 32px;
  max-width: 260px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 8px;
}

.attachment-chip svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
  flex: 0 0 auto;
}

.attachment-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.attachment-chip small {
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}

.attachment-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
}

.attachment-chip button:hover {
  background: #e5e7eb;
}

.send-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ios-blue), #5ac8fa);
  box-shadow: 0 12px 24px rgba(0, 122, 255, 0.22);
}

.send-button:hover {
  background: linear-gradient(135deg, #0b84ff, #46bdf4);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(20, 23, 31, 0.38);
}

.modal-backdrop.show {
  display: grid;
}

.modal {
  width: min(520px, 100%);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff8ec;
  color: var(--brand-strong);
  margin-bottom: 12px;
}

.modal-icon svg {
  width: 22px;
  height: 22px;
}

.modal h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-tabs {
  margin: 16px 0 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: #eef0f2;
}

.auth-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.auth-tabs button.active {
  background: #ffffff;
  color: var(--brand-strong);
  font-weight: 800;
}

.auth-error {
  margin: 0 0 12px;
  padding: 11px 12px;
  border: 1px solid rgba(239, 68, 68, 0.26);
  border-radius: 14px;
  background: rgba(254, 242, 242, 0.92);
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
  box-shadow: 0 10px 28px rgba(239, 68, 68, 0.08);
}

.auth-error[hidden] {
  display: none;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
}

.auth-form span {
  color: var(--muted);
  font-size: 12px;
}

.captcha-line {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(0, 1fr);
  gap: 8px;
}

.captcha-question {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 800;
}

.auth-form input.is-invalid,
.captcha-line input.is-invalid {
  border-color: rgba(239, 68, 68, 0.72);
  background: #fff7f7;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
  animation: lh-invalid-nudge 180ms ease both;
}

@keyframes lh-invalid-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-3px);
  }
  70% {
    transform: translateX(3px);
  }
}

.redeem-card-form {
  grid-template-columns: minmax(0, 1fr) 180px;
}

.primary-button,
.secondary-button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-strong);
}

.secondary-button {
  background: #f1f3f5;
  color: var(--ink);
}

.secondary-button:hover {
  background: #e7eaee;
}

.side-panel {
  min-width: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #f8fafc;
  display: flex;
  flex-direction: column;
}

.panel-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.panel-head p,
.panel-head h2 {
  margin: 0;
}

.panel-head h2 {
  font-size: 18px;
}

.panel-content {
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.agent-grid,
.ops-grid,
.command-list,
.data-list {
  display: grid;
  gap: 10px;
}

.agent-card,
.command-card,
.metric-card,
.data-row,
.layer-card {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 12px;
}

.command-card.active-card {
  border-color: rgba(166, 118, 34, 0.32);
  background: #fff8ec;
}

.command-card,
.agent-card {
  text-align: left;
}

button.command-card:hover,
.agent-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--soft-shadow);
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h3,
.panel-content h3 {
  margin: 8px 0 0;
  font-size: 15px;
}

.mode-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.agent-card {
  display: grid;
  gap: 8px;
}

.agent-card.active {
  border-color: rgba(166, 118, 34, 0.34);
  box-shadow: 0 0 0 3px rgba(166, 118, 34, 0.12);
}

.agent-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-title i {
  width: 18px;
  height: 18px;
}

.agent-card p,
.command-card p,
.data-row span,
.layer-card span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.starter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.starter-row button,
.badge {
  border: 0;
  border-radius: 8px;
  min-height: 26px;
  padding: 0 8px;
  background: #f1f3f5;
  color: var(--ink);
  font-size: 12px;
}

.ops-grid {
  grid-template-columns: 1fr 1fr;
}

.metric-card strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.layer-card {
  display: grid;
  gap: 8px;
}

.layer-card.core {
  border-color: rgba(166, 118, 34, 0.32);
  background: #fff8ec;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.status-pill {
  min-width: 64px;
  border: 0;
  text-align: center;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.ok {
  background: #fff8ec;
  color: var(--brand-strong);
}

.warn {
  background: #fff7ed;
  color: var(--amber);
}

.off {
  background: #fff1f2;
  color: var(--rose);
}

.settings {
  display: grid;
  gap: 8px;
}

.admin-config,
.config-section,
.provider-config-list,
.provider-config-card,
.agent-config-list,
.agent-config-card,
.pool-account-config {
  display: grid;
  gap: 10px;
}

.admin-config {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #ffffff;
  padding: 12px;
}

.config-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.config-section:last-of-type {
  border-bottom: 0;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.config-grid label,
.provider-config-card label {
  display: grid;
  gap: 6px;
}

.config-grid span,
.provider-config-card span,
.config-grid small,
.provider-config-card small {
  color: var(--muted);
  font-size: 12px;
}

.provider-config-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfd;
  padding: 12px;
}

.agent-config-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
}

.agent-config-card textarea {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  resize: vertical;
  padding: 10px;
  outline: none;
}

.agent-config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.agent-config-card label {
  display: grid;
  gap: 6px;
}

.agent-config-card span,
.agent-config-card small {
  color: var(--muted);
  font-size: 12px;
}

.agent-config-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.danger-text {
  color: var(--rose);
}

.recharge-card-manager {
  gap: 14px;
}

.admin-card-table {
  display: grid;
  gap: 10px;
}

.admin-card-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 92px minmax(170px, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px;
}

.admin-card-code {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-card-code strong,
.admin-card-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-code span,
.admin-card-row small {
  color: var(--muted);
  font-size: 12px;
}

.admin-card-row em {
  justify-self: start;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 9px;
}

.admin-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-card-actions .secondary-button {
  min-height: 34px;
  padding: 0 12px;
}

.provider-config-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.provider-config-head label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.provider-config-head input,
.pool-account-row input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.provider-config-card textarea {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 14px;
  resize: vertical;
  padding: 10px;
  outline: none;
}

.pool-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 86px 68px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 8px;
}

.pool-account-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.pool-account-row input,
.pool-account-row select {
  min-height: 32px;
}

.usage-meter {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
}

.usage-meter div {
  height: 10px;
  border-radius: 999px;
  background: #edf2f7;
  overflow: hidden;
}

.usage-meter div span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--blue));
}

.usage-meter p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  min-width: 200px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #151922;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.nav-button,
.history-item,
.history-open,
.history-delete,
.icon-button,
.tool-chip,
.round-button,
.send-button,
.primary-button,
.secondary-button,
.agent-card,
.command-card,
.metric-card,
.data-row,
.layer-card,
.attachment-chip,
.starter-row button,
.badge,
.status-pill,
.left-foot,
select,
input {
  border-radius: 12px;
}

.modal,
.feature-card,
.rate-card,
.privacy-section {
  border-radius: 24px;
}

.answer-card,
.composer,
.discover-card,
.account-menu,
.model-popover,
.modal,
.side-panel,
.usage-meter {
  border-radius: 20px;
}

.nav-button,
.history-item,
.history-open,
.history-delete,
.icon-button,
.tool-chip,
.round-button,
.send-button,
.primary-button,
.secondary-button,
.command-card,
.agent-card,
.metric-card,
.data-row,
.layer-card,
.discover-tabs button,
.account-menu button,
.model-popover button,
.starter-row button,
.attachment-chip,
select,
input {
  border-radius: 14px;
}

.answer-card {
  max-width: 560px;
  padding: 16px 18px;
}

.composer {
  border-radius: 24px;
  padding: 14px 14px 12px;
}

.drop-hint {
  border-radius: 18px;
}

.message.user .message-body {
  border-radius: 18px;
}

.avatar,
.home-brand span {
  border-radius: 14px;
}

body.left-collapsed .shell {
  grid-template-columns: 72px minmax(0, 1fr) 0;
}

body.left-collapsed .shell.panel-open {
  grid-template-columns: 72px minmax(0, 1fr) 400px;
}

body.left-collapsed .leftbar {
  padding: 12px 8px;
}

/* Final chat/layer studio overrides for the image editing workflow. */
.message-stack {
  display: grid;
  gap: 6px;
  max-width: min(720px, 78%);
}

.message.user .message-stack {
  justify-items: end;
  margin-left: auto;
}

.message.assistant .message-stack {
  justify-items: start;
}

.message-stack .message-body {
  max-width: 100%;
}

.message.user .message-stack .message-body {
  max-width: 100%;
}

.message .message-body .message-actions {
  display: none !important;
}

.message .message-stack > .message-actions {
  width: 100%;
  margin: 0 !important;
  opacity: 0.72;
  transform: none;
}

.message:hover .message-stack > .message-actions,
.message:focus-within .message-stack > .message-actions {
  opacity: 1;
}

.message.user .message-stack > .message-actions {
  justify-content: flex-end;
  padding-right: 6px;
}

.message.assistant .message-stack > .message-actions {
  justify-content: flex-start;
  padding-left: 2px;
}

.layer-studio-backdrop {
  position: fixed !important;
  inset: 0 !important;
  z-index: 9990 !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
  background: rgba(15, 23, 42, 0.44) !important;
  pointer-events: auto !important;
}

.layer-studio-dialog {
  position: relative;
  z-index: 9991;
  width: 100vw !important;
  height: 100vh !important;
  max-height: none !important;
  border-radius: 0 !important;
  padding: 16px 18px !important;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px !important;
  overflow: hidden !important;
}

.layer-studio-dialog.selecting {
  grid-template-rows: auto auto auto auto minmax(0, 1fr) !important;
}

.layer-studio-dialog.editing {
  grid-template-rows: auto auto auto minmax(0, 1fr) !important;
}

.layer-studio-head .icon-button,
[data-close-layer-studio] {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  z-index: 10050 !important;
  width: 44px !important;
  height: 44px !important;
  pointer-events: auto !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
}

.layer-studio-dialog > .layer-selection-panel {
  grid-template-columns: 220px minmax(360px, 1fr) auto;
  align-items: center;
  min-height: 76px;
  overflow: visible;
}

.layer-studio-grid {
  height: 100%;
  min-height: 0;
  grid-template-columns: 380px minmax(0, 1fr) !important;
}

.layer-selection-panel > div:first-child {
  min-width: 0;
}

.layer-selection-panel textarea {
  min-height: 54px;
  max-height: 112px;
}

.layer-canvas {
  background: #ffffff !important;
  min-height: 0 !important;
  height: 100% !important;
}

.layer-canvas-item {
  will-change: transform;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.layer-canvas-item[data-layer-category="background"] {
  mix-blend-mode: normal;
}

.layer-canvas-item.active {
  outline: 2px solid rgba(10, 132, 255, 0.75);
  outline-offset: 4px;
  filter: drop-shadow(0 16px 28px rgba(10, 132, 255, 0.2));
  pointer-events: auto;
}

.layer-row.active {
  border-color: rgba(10, 132, 255, 0.42);
  background: rgba(232, 243, 255, 0.72);
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.layer-row-main {
  display: grid;
  min-width: 0;
  flex: 1 1 auto !important;
  gap: 4px;
  cursor: pointer;
}

.layer-row-controls {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto !important;
  gap: 6px;
}

.layer-row-controls .icon-button {
  width: 34px;
  height: 34px;
}

.icon-button.danger {
  color: #e11d48;
  background: #fff1f2;
  border-color: rgba(244, 63, 94, 0.22);
}

.icon-button.danger:hover {
  color: #be123c;
  background: #ffe4e6;
  border-color: rgba(244, 63, 94, 0.36);
}

.media-preview-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
}

.media-preview-dialog {
  z-index: 10001 !important;
}

.media-preview-close {
  z-index: 10002 !important;
  pointer-events: auto !important;
}

.composer,
.composer-bottom {
  isolation: isolate;
}

.composer-bottom {
  position: relative;
  z-index: 3;
}

.send-button {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.send-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.send-button.loading svg {
  animation: lh-send-spin 880ms linear infinite;
}

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

.media-video-shell {
  display: grid;
  gap: 10px;
}

.media-video-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.media-preview-dialog.video {
  width: min(980px, 96vw);
  background: rgba(8, 11, 18, 0.92);
}

.media-preview-video {
  width: 100%;
  max-height: calc(88vh - 104px);
  justify-self: center;
  align-self: center;
  border-radius: 18px;
  background: #000;
}

.media-preview-dialog.video footer {
  color: rgba(255, 255, 255, 0.78);
}

/* 2026 visual direction: blue-white API platform, model-icon intro, dashboard-grade panels. */
:root {
  --brand: #2563eb;
  --brand-strong: #155eef;
  --ios-blue: #2563eb;
  --ios-blue-soft: #e9f2ff;
  --mint: #10b981;
  --violet: #7c3aed;
  --amber: #f59e0b;
  --panel-raised: rgba(255, 255, 255, 0.84);
  --shadow: 0 26px 90px rgba(37, 99, 235, 0.14);
  --soft-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --lift-shadow: 0 26px 80px rgba(37, 99, 235, 0.18);
}

body.home-body {
  background:
    linear-gradient(120deg, rgba(219, 234, 254, 0.58), transparent 34%),
    linear-gradient(240deg, rgba(225, 239, 255, 0.72), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #eef6ff 38%, #ffffff 100%);
}

body.home-body::before,
body.admin-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
  z-index: -1;
}

.brand-intro {
  background:
    linear-gradient(115deg, rgba(219, 234, 254, 0.8), transparent 34%),
    linear-gradient(245deg, rgba(236, 253, 245, 0.72), transparent 36%),
    linear-gradient(180deg, #fbfdff 0%, #eef7ff 100%);
}

.brand-intro::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(720px, 86vw);
  height: 220px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(37, 99, 235, 0.08);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
  filter: blur(1px);
  opacity: 0.9;
}

.intro-model-cloud {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.intro-model-tile {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 116px;
  min-height: 94px;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f172a;
  box-shadow: 0 22px 54px rgba(37, 99, 235, 0.13);
  transform: translate(var(--float-x, 0), var(--float-y, 0)) scale(1);
  transition:
    transform 780ms cubic-bezier(0.2, 0.9, 0.22, 1),
    opacity 520ms ease,
    filter 520ms ease,
    box-shadow 520ms ease;
  transition-delay: calc(var(--float-delay, 0ms) * 0.18);
  animation: intro-model-drift var(--float-speed, 4200ms) ease-in-out infinite alternate;
}

.intro-model-tile.major {
  width: 132px;
  min-height: 102px;
  border-radius: 26px;
}

.intro-model-tile img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border: 1px solid rgba(219, 230, 242, 0.9);
  border-radius: 15px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.intro-model-tile strong {
  max-width: calc(100% - 14px);
  overflow: hidden;
  color: #101827;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.intro-model-tile b {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  font-size: 15px;
  letter-spacing: 0;
}

.intro-model-tile small {
  color: #526173;
  font-size: 10px;
  font-weight: 800;
}

.intro-model-tile[data-model-brand="Claude"] b { background: linear-gradient(135deg, #f97316, #fbbf24); }
.intro-model-tile[data-model-brand="Gemini"] b { background: linear-gradient(135deg, #2563eb, #a855f7); }
.intro-model-tile[data-model-brand="DeepSeek"] b { background: linear-gradient(135deg, #1d4ed8, #38bdf8); }
.intro-model-tile[data-model-brand="Qwen"] b { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.intro-model-tile[data-model-brand="Sora"] b { background: linear-gradient(135deg, #0f172a, #2563eb); }
.intro-model-tile[data-model-brand="Llama"] b { background: linear-gradient(135deg, #06b6d4, #2563eb); }
.intro-model-tile[data-model-brand="Grok"] b { background: linear-gradient(135deg, #111827, #475569); }
.intro-model-tile[data-model-brand="Kimi"] b { background: linear-gradient(135deg, #0ea5e9, #14b8a6); }
.intro-model-tile[data-model-brand="Doubao"] b { background: linear-gradient(135deg, #f59e0b, #2563eb); }
.intro-model-tile[data-model-brand="Midjourney"] b { background: linear-gradient(135deg, #6d28d9, #ec4899); }

.brand-intro.phase-circle .intro-model-tile {
  transform: translate(var(--ring-x, 0), var(--ring-y, 0)) scale(0.86);
  opacity: 0.82;
  animation-play-state: paused;
}

.brand-intro.phase-brand .intro-model-tile {
  transform: translate(0, -18px) scale(0.36);
  opacity: 0;
  filter: blur(8px);
}

.brand-intro.phase-brand::after {
  opacity: 0;
  transition: opacity 520ms ease;
}

@keyframes intro-model-drift {
  from { margin-top: -8px; }
  to { margin-top: 10px; }
}

.home-nav {
  width: min(1180px, calc(100% - 56px));
  top: 14px;
  min-height: 62px;
  justify-content: space-between;
  border-radius: 22px;
  border-color: rgba(204, 222, 245, 0.76);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 20px 70px rgba(37, 99, 235, 0.12);
  padding: 8px 12px 8px 14px;
}

.home-brand span,
.admin-brand .brand-logo {
  border-radius: 14px;
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.18);
}

.home-nav nav a.active,
.home-nav nav a:hover,
.home-nav-action {
  color: var(--brand-strong);
  background: #eef5ff;
  box-shadow: none;
}

.home-nav-action,
.primary-link,
.primary-button,
.send-button {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.24);
  color: #ffffff;
}

.primary-link:hover,
.primary-button:hover,
.send-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

.home-hero {
  width: min(1220px, calc(100% - 56px));
  grid-template-columns: minmax(0, 0.9fr) minmax(560px, 1.08fr);
  gap: 42px;
  padding-top: 86px;
}

.eyebrow,
.section-title span {
  gap: 7px;
  border-color: rgba(37, 99, 235, 0.16);
  background: rgba(239, 246, 255, 0.92);
  color: var(--brand-strong);
}

.hero-copy h1 {
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.06;
  color: #0b1220;
}

.hero-copy h1 em {
  display: inline-block;
  color: #2563eb;
  font-style: normal;
}

.hero-text {
  color: #475569;
  font-size: 18px;
  line-height: 1.82;
}

.hero-proof-row span {
  border-color: rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.76);
}

.hero-visual {
  border-color: rgba(201, 220, 244, 0.72);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(239, 246, 255, 0.72)),
    rgba(255, 255, 255, 0.74);
  padding: 14px;
  box-shadow: 0 32px 90px rgba(37, 99, 235, 0.18);
}

.hero-dashboard {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(205, 221, 242, 0.84);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  padding: 16px;
}

.hero-dashboard-head,
.hero-metric-grid,
.hero-analytics,
.hero-model-card li {
  display: flex;
  align-items: center;
}

.hero-dashboard-head {
  justify-content: space-between;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.hero-dashboard-head span,
.hero-dashboard-head em {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: rgba(239, 246, 255, 0.9);
  padding: 7px 10px;
  font-style: normal;
}

.hero-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hero-metric-grid article,
.hero-chart-card,
.hero-model-card,
.model-logo-rail span,
.trust-card,
.feature-card,
.rate-card,
.admin-kpi-card,
.admin-section,
.admin-editor-card,
.admin-filter-strip,
.admin-users-toolbar,
.command-card,
.metric-card {
  border: 1px solid rgba(207, 222, 241, 0.82);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 52px rgba(37, 99, 235, 0.08);
}

.hero-metric-grid article {
  display: grid;
  gap: 5px;
  border-radius: 16px;
  padding: 14px;
}

.hero-metric-grid span,
.hero-metric-grid small {
  color: #64748b;
  font-size: 12px;
}

.hero-metric-grid strong {
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
}

.hero-metric-grid small {
  color: #10b981;
  font-weight: 800;
}

.hero-analytics {
  align-items: stretch;
  gap: 12px;
}

.hero-chart-card,
.hero-model-card {
  border-radius: 18px;
  padding: 14px;
}

.hero-chart-card {
  flex: 1 1 56%;
  min-height: 210px;
}

.hero-model-card {
  flex: 1 1 44%;
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.hero-chart-card strong,
.hero-model-card strong {
  display: block;
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: #0f172a;
}

.hero-chart-lines {
  position: relative;
  min-height: 156px;
  display: flex;
  align-items: end;
  gap: 14px;
  border-radius: 16px;
  background:
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(239, 246, 255, 0.58), rgba(255, 255, 255, 0.2));
  background-size: 100% 38px, 100% 100%;
  padding: 16px;
}

.hero-chart-lines i {
  flex: 1;
  height: var(--h);
  min-height: 20px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
}

.hero-chart-lines span {
  position: absolute;
  left: 16px;
  right: 16px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.66), rgba(124, 58, 237, 0.14));
}

.hero-chart-lines span:nth-child(1) { top: 48px; transform: rotate(-5deg); }
.hero-chart-lines span:nth-child(2) { top: 76px; transform: rotate(7deg); }
.hero-chart-lines span:nth-child(3) { top: 104px; transform: rotate(-3deg); }
.hero-chart-lines span:nth-child(4) { top: 128px; transform: rotate(5deg); }

.hero-model-donut {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0 43%, transparent 44%),
    conic-gradient(#2563eb 0 36%, #10b981 36% 58%, #f59e0b 58% 75%, #7c3aed 75% 100%);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1), 0 12px 28px rgba(37, 99, 235, 0.1);
}

.hero-model-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-model-card li {
  justify-content: space-between;
  gap: 8px;
  color: #475569;
  font-size: 12px;
}

.hero-model-card li b {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2563eb;
}

.hero-model-card li:nth-child(2) b { background: #10b981; }
.hero-model-card li:nth-child(3) b { background: #f59e0b; }
.hero-model-card li:nth-child(4) b { background: #7c3aed; }

.model-logo-rail {
  width: min(1220px, calc(100% - 56px));
  margin: 0 auto 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}

.model-logo-rail span {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  border-radius: 16px;
  padding: 12px 16px;
}

.model-logo-rail b {
  color: #0f172a;
  font-size: 14px;
}

.model-logo-rail small {
  color: #64748b;
  font-size: 12px;
}

.home-section {
  width: min(1220px, calc(100% - 56px));
}

.trust-card,
.feature-card,
.rate-card {
  border-radius: 22px;
}

.trust-card > svg,
.feature-card > svg {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  color: var(--brand-strong);
}

body.admin-body {
  background:
    linear-gradient(130deg, rgba(219, 234, 254, 0.86), transparent 42%),
    linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.admin-shell {
  background: transparent;
}

.admin-sidebar {
  border-right-color: rgba(207, 222, 241, 0.82);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(22px) saturate(1.14);
  box-shadow: 18px 0 50px rgba(37, 99, 235, 0.06);
}

.admin-topbar {
  border-color: rgba(207, 222, 241, 0.72);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(22px) saturate(1.12);
}

.admin-nav button.active,
.admin-nav button:hover,
.user-console-nav button.active,
.user-console-nav button:hover {
  background: #edf5ff;
  color: var(--brand-strong);
}

.admin-kpi-icon,
.modal-icon {
  border-radius: 14px;
  background: #eaf2ff;
  color: var(--brand-strong);
}

.admin-section,
.admin-editor-card,
.admin-empty,
.account-modal,
.modal {
  border-radius: 24px;
}

.admin-dashboard-shell,
.admin-users-page,
.model-admin-page {
  position: relative;
}

.hero-primary,
.home-nav-action,
.primary-link.hero-primary,
.primary-button,
.primary-link,
.send-button {
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  color: #ffffff !important;
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.24) !important;
}

.hero-primary:hover,
.home-nav-action:hover,
.primary-button:hover,
.primary-link:hover,
.send-button:hover {
  background: linear-gradient(135deg, #1d4ed8, #0284c7) !important;
}

.home-nav nav a.active,
.home-nav nav a:hover {
  background: #eef5ff !important;
  color: var(--brand-strong) !important;
}

.eyebrow,
.section-title span {
  border-color: rgba(37, 99, 235, 0.18) !important;
  background: rgba(239, 246, 255, 0.94) !important;
  color: var(--brand-strong) !important;
}

@media (max-width: 980px) {
  .home-nav,
  .home-hero,
  .home-section,
  .model-logo-rail {
    width: calc(100% - 24px);
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding-top: 36px;
  }

  .model-logo-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-metric-grid,
  .hero-analytics,
  .hero-model-card {
    grid-template-columns: 1fr 1fr;
  }

  .hero-analytics {
    display: grid;
  }

  .intro-model-tile {
    width: 76px;
    min-height: 62px;
    border-radius: 18px;
  }

  .intro-model-tile small {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero-metric-grid,
  .hero-model-card,
  .model-logo-rail {
    grid-template-columns: 1fr;
  }

  .home-nav {
    border-radius: 18px;
  }

  .home-nav nav {
    display: none;
  }
}

@media (max-width: 900px) {
  .message-stack {
    max-width: 92%;
  }

  .layer-studio-dialog > .layer-selection-panel {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

body.left-collapsed .profile div:last-child,
body.left-collapsed .nav-button span,
body.left-collapsed .history,
body.left-collapsed .left-foot span,
body.left-collapsed .left-foot svg {
  display: none;
}

body.left-collapsed .nav-button,
body.left-collapsed .left-foot {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

@media (max-width: 980px) {
  .admin-shell {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .admin-brand div,
  .admin-nav span,
  .user-console-nav span,
  .admin-sidebar-foot span {
    display: none;
  }

  .admin-nav button,
  .user-console-nav button,
  .admin-sidebar-foot a {
    justify-content: center;
    padding: 0;
  }

  .admin-metrics,
  .admin-helper-grid,
  .user-info-grid,
  .account-overview-grid,
  .account-package-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .admin-form-grid,
  .admin-form-grid.two,
  .admin-form-grid.three,
  .admin-form-grid.four,
  .admin-workflow-step,
  .browser-pool-global,
  .browser-pool-shell {
    grid-template-columns: 1fr;
  }

  .redeem-card-form,
  .captcha-line,
  .user-profile-card,
  .account-redeem-box {
    grid-template-columns: 1fr;
  }

  .model-admin-row,
  .model-interface-row {
    grid-template-columns: 1fr;
  }

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

  .workflow-library,
  .workflow-editor {
    position: static;
  }

  .workflow-canvas-board {
    height: 520px;
  }

  .workflow-builder {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .workflow-builder-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workflow-builder-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .workflow-canvas-stage .workflow-canvas-board {
    height: 100%;
    padding: 18px;
  }

  .canvas-template-dock {
    left: 12px;
    right: 12px;
    top: 12px;
    bottom: auto;
    width: auto;
    max-height: 104px;
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .canvas-template-head {
    border-bottom: 0;
    border-right: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0 10px 0 0;
  }

  .canvas-template-section {
    grid-auto-flow: column;
    grid-auto-columns: minmax(170px, 1fr);
    overflow-x: auto;
  }

  .canvas-template-section p {
    display: none;
  }

  .workflow-model-modal {
    width: calc(100% - 24px);
    max-height: calc(100% - 24px);
  }

  .workflow-model-modal-body {
    grid-template-columns: 1fr;
  }

  .workflow-model-list-panel {
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.88);
  }

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

  .workflow-bottom-bar {
    max-width: calc(100% - 24px);
    overflow-x: auto;
  }

  .model-popover {
    left: 8px;
    right: 8px;
    width: auto;
  }

  .model-popover-main {
    grid-template-columns: 1fr;
  }

  .model-list-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 8px;
  }

  .home-nav {
    width: calc(100% - 24px);
    justify-content: space-between;
  }

  .home-nav nav {
    display: none;
  }

  .home-hero,
  .home-section,
  .home-footer {
    width: calc(100% - 24px);
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 30px 0 10px;
    justify-items: center;
    text-align: center;
  }

  .hero-copy {
    max-width: 820px;
  }

  .hero-copy h1,
  .hero-text {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-proof-row {
    justify-content: center;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .hero-text {
    font-size: 16px;
  }

  .feature-grid,
  .rate-grid,
  .trust-grid,
  .architecture-steps {
    grid-template-columns: 1fr 1fr;
  }

  .admin-story {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    padding: 24px;
  }

  .privacy-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .shell,
  .shell.panel-open {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  body.left-collapsed .shell,
  body.left-collapsed .shell.panel-open {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .leftbar {
    padding: 10px 8px;
  }

  .profile div:last-child,
  .nav-button span,
  .history,
  .left-foot span,
  .left-foot svg {
    display: none;
  }

  .nav-button {
    justify-content: center;
    padding: 0;
  }

  .side-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(390px, 92vw);
    z-index: 5;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 180ms ease;
  }

  .shell.panel-open .side-panel {
    transform: translateX(0);
  }

  .recharge-head,
  .recharge-packages {
    grid-template-columns: 1fr;
  }

  .generation-settings-popover {
    right: -72px;
    left: auto;
    width: min(330px, calc(100vw - 94px));
  }

  .media-asset-card {
    max-width: 100%;
  }

  .media-preview-modal {
    padding: 10px;
  }

  .media-preview-dialog {
    width: min(100%, 96vw);
    border-radius: 18px;
    padding: 10px;
  }

  .media-preview-dialog footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .home-brand strong {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-nav-action {
    padding: 0 10px;
  }

  .hero-copy h1 {
    font-size: 36px;
    margin-bottom: 14px;
  }

  .hero-text {
    line-height: 1.7;
  }

  .hero-actions {
    margin: 18px 0 12px;
  }

  .hero-visual img {
    aspect-ratio: 16 / 7;
    border-radius: 24px;
  }

  .hero-device-bar {
    display: none;
  }

  .hero-control-card {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    margin: 0;
    transform: none;
    padding: 12px;
  }

  .home-enhanced .hero-control-card {
    transform: translate3d(0, var(--hero-card-y, 0px), 0);
  }

  .hero-control-card span {
    min-height: 28px;
    font-size: 12px;
  }

  .hero-visual figcaption {
    display: none;
  }

  .hero-visual {
    box-shadow: 0 22px 54px rgba(23, 32, 42, 0.13);
  }

  .section-title h2,
  .admin-story-copy h2,
  .privacy-section h2 {
    font-size: 28px;
  }

  .privacy-story {
    padding-top: 10px;
  }

  .feature-grid,
  .rate-grid,
  .trust-grid,
  .architecture-steps {
    grid-template-columns: 1fr;
  }

  .setup-panel {
    border-radius: 24px;
    padding: 14px;
  }

  .setup-window {
    border-radius: 18px;
  }

  .setup-save {
    align-items: flex-start;
    flex-direction: column;
  }

  .setup-save button {
    width: 100%;
  }

  .shell,
  .shell.panel-open {
    display: block;
  }

  .leftbar {
    height: 58px;
    flex-direction: row;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile {
    min-width: 42px;
  }

  .main-nav {
    flex: 1;
    display: flex;
    margin: 0;
    overflow-x: auto;
  }

  .chat-main {
    height: calc(100vh - 58px);
  }

  .chat-header {
    grid-template-columns: 72px minmax(0, 1fr) minmax(250px, 266px);
  }

  .header-right {
    justify-content: flex-start;
    gap: 4px;
    overflow: visible;
  }

  .routing-bar {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .messages {
    padding: 18px 12px;
  }

  .message {
    gap: 8px;
  }

  .message.user .message-body {
    max-width: 90%;
  }

  .composer {
    width: calc(100% - 18px);
    margin-bottom: 10px;
    border-radius: 14px;
  }

  .composer-mode-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .composer-mode-group {
    min-width: 0;
  }

  .tool-row {
    gap: 5px;
  }

  .model-type-button {
    max-width: 160px;
    padding-inline: 10px;
  }

  .composer-current-config {
    flex-basis: 100%;
    max-width: 100%;
    padding-left: 2px;
  }

  .composer-control .model-popover {
    left: -42px;
    gap: 6px;
    padding: 7px;
  }

  .model-cascade-main {
    width: clamp(142px, 38vw, 190px);
  }

  .model-cascade-submenu {
    width: clamp(170px, 46vw, 230px);
  }

  .privacy-note {
    width: calc(100% - 18px);
  }

  .ops-grid {
    grid-template-columns: 1fr;
  }
}

/* Product Design final overrides. Keep this block last so the upgrade wins over legacy rules. */
:root {
  --bg: #f6f8fb;
  --panel-raised: rgba(255, 255, 255, 0.86);
  --ink: #101828;
  --muted: #667085;
  --line: #d9e2ec;
  --brand-strong: #9a6b1f;
  --ios-blue: #0a84ff;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --lift-shadow: 0 24px 70px rgba(16, 24, 40, 0.14);
  --spring: cubic-bezier(0.2, 0.9, 0.22, 1);
}

.lh-motion-seed {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  transition: opacity 540ms ease, transform 680ms var(--spring), box-shadow 220ms var(--spring), background 180ms ease;
  transition-delay: var(--motion-delay, 0ms);
}

.lh-motion-seed.is-visible,
.lh-reduced-motion .lh-motion-seed {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

body.home-body,
body.admin-body,
.shell {
  background:
    linear-gradient(118deg, rgba(255, 252, 246, 0.9) 0%, rgba(246, 249, 253, 0.82) 44%, rgba(232, 243, 255, 0.68) 100%),
    #f6f8fb;
}

.home-nav,
.chat-header,
.admin-topbar,
.leftbar,
.admin-sidebar,
.composer,
.modal,
.model-popover,
.channel-popover,
.account-menu,
.admin-section,
.admin-editor-card,
.command-card,
.metric-card,
.admin-kpi-card,
.admin-metric,
.admin-empty,
.admin-users-toolbar,
.admin-filter-strip,
.admin-chart-card,
.home-hero .hero-visual,
.trust-card,
.feature-card,
.rate-card,
.answer-card,
.message-asset-card,
.uploaded-attachment,
.composer-mode-panel {
  border-color: rgba(208, 219, 232, 0.78);
  background: var(--panel-raised);
  backdrop-filter: blur(22px) saturate(1.18);
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
}

.home-nav,
.chat-header,
.admin-topbar {
  box-shadow: 0 10px 34px rgba(16, 24, 40, 0.08);
}

.home-nav:hover,
.composer:focus-within,
.admin-kpi-card:hover,
.command-card:hover,
.metric-card:hover,
.feature-card:hover,
.trust-card:hover,
.rate-card:hover,
.model-admin-row:hover,
.model-interface-row:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: var(--lift-shadow);
}

.primary-button,
.primary-link {
  background: linear-gradient(135deg, #dbb765, #9d6a20);
  box-shadow: 0 16px 36px rgba(157, 106, 32, 0.22);
}

.secondary-button,
.secondary-link,
.icon-button,
.round-button,
.tool-chip,
.composer-control > button,
.model-type-button {
  border: 1px solid rgba(213, 223, 236, 0.86);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.secondary-button:hover,
.secondary-link:hover,
.icon-button:hover,
.round-button:hover,
.tool-chip:hover,
.composer-control > button:hover,
.model-type-button:hover {
  border-color: rgba(10, 132, 255, 0.24);
  background: #ffffff;
  color: var(--ios-blue);
  box-shadow: 0 12px 28px rgba(10, 132, 255, 0.12);
}

.primary-button,
.primary-link,
.send-button,
.home-nav-action {
  position: relative;
  overflow: hidden;
}

.primary-button::after,
.primary-link::after,
.send-button::after,
.home-nav-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.35) 48%, transparent 100%);
  transform: translateX(-120%);
  pointer-events: none;
}

.primary-button:hover::after,
.primary-link:hover::after,
.send-button:hover::after,
.home-nav-action:hover::after {
  animation: lh-subtle-shine 820ms ease;
}

.hero-copy {
  transform: translate3d(0, var(--hero-copy-y, 0), 0);
  opacity: var(--hero-copy-opacity, 1);
}

.hero-visual {
  transform: translate3d(0, var(--hero-visual-y, 0), 0) scale(var(--hero-visual-scale, 1));
  transform-origin: center top;
}

.hero-control-card {
  transform: translate3d(0, var(--hero-card-y, 0), 0);
}

.hero-copy h1,
.section-title h2,
.admin-story-copy h2,
.privacy-section h2,
.title-block h1,
.admin-topbar h1 {
  color: #0b1220;
  letter-spacing: 0;
}

.hero-text,
.section-title p,
.admin-story-copy p,
.privacy-section p,
.message-body,
.admin-kpi-card small,
.admin-kpi-card em {
  color: #475467;
}

.trust-card,
.feature-card,
.rate-card,
.setup-window,
.admin-kpi-card,
.command-card,
.metric-card {
  position: relative;
  overflow: hidden;
}

.trust-card::before,
.feature-card::before,
.rate-card::before,
.setup-window::before,
.admin-kpi-card::before,
.command-card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.feature-card > *,
.trust-card > *,
.rate-card > *,
.setup-window > *,
.admin-kpi-card > *,
.command-card > *,
.metric-card > * {
  position: relative;
}

.profile,
.left-foot,
.nav-button,
.history-item,
.admin-nav button,
.user-console-nav button,
.admin-sidebar-foot a {
  border-radius: 14px;
}

.nav-button:hover,
.nav-button.active,
.history-item:hover,
.history-item.active,
.admin-nav button:hover,
.admin-nav button.active,
.user-console-nav button:hover,
.user-console-nav button.active,
.admin-sidebar-foot a:hover {
  transform: translate3d(3px, 0, 0);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.messages {
  scroll-behavior: smooth;
}

.message {
  animation: lh-soft-pop 420ms var(--spring) both;
}

.message.user .message-body,
.message.assistant .message-body {
  border-radius: 20px;
}

.message.user .message-body {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), rgba(246, 248, 251, 0.92));
  border-color: rgba(190, 213, 255, 0.76);
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.08);
}

.composer {
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(10, 132, 255, 0.12);
}

.composer:focus-within {
  transform: translate3d(0, -2px, 0);
}

.model-popover,
.channel-popover,
.account-menu {
  animation: lh-menu-in 220ms var(--spring) both;
  transform-origin: left bottom;
}

.model-row:hover,
.model-row.active,
.channel-menu-item:hover,
.channel-menu-item.active,
.model-category-heading:hover,
.model-category-heading.active,
.model-interface-option:hover,
.model-interface-option.active {
  background: rgba(232, 243, 255, 0.86);
  color: var(--ios-blue);
  transform: translate3d(2px, 0, 0);
}

.admin-dashboard-table-row,
.model-distribution-row,
.model-admin-row,
.model-interface-row {
  transition: background 160ms ease, transform 180ms var(--spring), box-shadow 180ms var(--spring);
}

.admin-dashboard-table-row:hover,
.model-distribution-row:hover {
  background: rgba(248, 250, 252, 0.78);
}

.modal-backdrop.show {
  backdrop-filter: blur(14px);
}

.modal-backdrop.show .modal {
  animation: lh-soft-pop 260ms var(--spring) both;
}

.modal {
  border: 1px solid rgba(224, 231, 240, 0.86);
}

input,
textarea,
select {
  border-radius: 14px;
  border-color: rgba(208, 219, 232, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.11);
  outline: none;
}

.toast {
  border: 1px solid rgba(208, 219, 232, 0.86);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: var(--lift-shadow);
}
