body {
  background: var(--bg);
  font-family: var(--font-sans);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.workspace.subnav-open {
  grid-template-columns: 280px minmax(0, 1fr);
}

.workspace.subnav-open .sidebar {
  display: none;
}

.workspace.subnav-open .sub-sidebar {
  display: flex;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 16px;
  background: #F8F9F6;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}

.sub-sidebar {
  position: sticky;
  top: 0;
  display: none;
  height: 100vh;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  background: #F8F9F6;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: none;
}

#subNavContent {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.sub-back {
  width: 100%;
  height: 42px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #EEF0EA;
  color: #2864DC;
  font-size: 0;
  line-height: 1;
}

.sub-back::before {
  content: '返回主导航';
  font-size: 12px;
  font-weight: 800;
}

.sub-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 900;
  color: #151A19;
}

.sub-brand img {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  padding: 3px;
  background: #ffffff;
}

.sub-group-title {
  margin: 12px 0 4px;
  color: #858D8A;
  font-size: 12px;
  font-weight: 800;
}

.sub-item {
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #59615F;
  text-align: left;
  font-weight: 700;
}

.sub-item:hover,
.sub-item.active {
  border-color: rgba(27, 61, 130, 0.18);
  background: #EEF0EA;
  color: #2864DC;
}

.sub-item.strong {
  color: #8FB3FF;
}

.sub-empty {
  color: #858D8A;
  font-size: 12px;
  padding: 8px 12px;
}

.sub-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(205, 220, 216, 0.82);
  padding-top: 14px;
  color: #151A19;
}

.sub-user-wrap {
  position: relative;
  margin-top: auto;
}

.sub-user-wrap .sub-user {
  margin-top: 0;
}

.sub-user .plan {
  color: #858D8A;
  font-size: 12px;
}

.sub-conversation {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 10px 0 12px;
  color: #59615F;
  cursor: pointer;
}

.sub-conversation span {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-conversation:hover,
.sub-conversation.active {
  border-color: rgba(27, 61, 130, 0.18);
  background: #EEF0EA;
  color: #2864DC;
}

.sub-conversation button {
  display: none;
  border: 0;
  border-radius: 6px;
  padding: 4px 7px;
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  font-size: 12px;
}

.sub-conversation:hover button {
  display: inline-flex;
}

.side-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 26px;
  color: #151A19;
  font-weight: 800;
  text-decoration: none;
}

.side-brand-main {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.side-logo img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: contain;
  padding: 4px;
  background: #ffffff;
}

.side-home-link {
  flex: 0 0 auto;
  border: 1px solid rgba(27, 61, 130,0.18);
  border-radius: 4px;
  padding: 7px 12px;
  background: #EEF0EA;
  color: #2864DC;
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
}

.side-home-link:hover {
  background: #e0f2ed;
}

.sidebar button {
  width: 100%;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: #59615F;
  text-align: left;
  font-weight: 700;
  transition: all 0.2s ease;
}

.sidebar button:hover,
.sidebar button.active {
  border-color: rgba(27, 61, 130, 0.18);
  background: #EEF0EA;
  color: #2864DC;
}

.side-bottom {
  margin-top: auto;
  border-top: 1px solid rgba(205, 220, 216, 0.82);
  padding-top: 16px;
  color: #858D8A;
  font-size: 12px;
}

.manual-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 10px;
  border: 1px solid rgba(27, 61, 130,0.18);
  border-radius: 6px;
  background: #EEF0EA;
  color: #2864DC;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.manual-entry:hover {
  background: #e0f2ed;
}

.manual-entry svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sub-fixed-actions {
  display: grid;
  gap: 8px;
  margin: 0 4px 10px;
}

.sub-fixed-actions .manual-entry {
  margin: 0;
}

.sub-manual-entry {
  margin: 0;
}

.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding: 16px 18px 8px;
}

.panel-head {
  flex: 1;
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 20px 0 44px;
}

.panel-head.model-mode {
  width: 100%;
  max-width: none;
  align-content: start;
  padding: 0;
}

.panel-head.tools-mode {
  width: 100%;
  max-width: 1180px;
  align-content: start;
}

.content-grid {
  width: 100%;
}

.model-content {
  height: 100%;
}

.workspace-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.model-workspace {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 92px);
  border: 1px solid rgba(213, 226, 221, 0.86);
  border-radius: 6px;
  padding: 30px 34px 24px;
  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.ai-disclaimer {
  width: min(960px, 100%);
  margin: 3px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
}

.workspace-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.workspace-card-head h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.workspace-card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}


/* Final workspace density pass: use more canvas, keep legal/disclaimer tiny. */
.workspace.subnav-open .content {
  padding: 12px 16px 4px;
}

.workspace.subnav-open .panel-head.model-mode {
  max-width: none;
  padding: 0;
}

.workspace.subnav-open .ai-disclaimer,
.workspace-icp,
.workspace-icp a {
  font-size: 12px;
  line-height: 1.05;
}

.workspace.subnav-open .ai-disclaimer {
  margin-top: 2px;
}

.workspace-icp {
  padding-top: 3px;
  padding-bottom: 0;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.send-action {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow);
}

.workspace-icp {
  padding-top: 4px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.1;
}

.workspace-icp a {
  color: var(--muted);
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* 支付弹窗 */
.payment-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 20, 18, 0.58);
  backdrop-filter: blur(7px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.payment-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.payment-card {
  position: relative;
  width: min(420px, calc(100% - 36px));
  border-radius: 6px;
  padding: 32px;
  background: #ffffff;
  text-align: center;
  box-shadow: var(--shadow);
}

.payment-card .close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  background: #f0f4f2;
  font-size: 20px;
}

.payment-card h2 {
  margin: 0 0 8px;
}

.payment-card .tool-name {
  color: var(--muted);
  margin-bottom: 18px;
}

.payment-card .price-display {
  margin-bottom: 24px;
  color: #c85f20;
  font-size: 38px;
  font-weight: 900;
}

.payment-card .price-display span:last-child {
  font-size: 18px;
}

.mock-qr {
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f8f6;
  color: var(--muted);
}

.pay-success-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 6px;
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.subnav-open {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 24px;
  }

  .prompt-row {
    grid-template-columns: 1fr;
  }

  .model-workspace {
    min-height: 560px;
    padding: 22px;
  }

  .chat-bubble {
    max-width: 92%;
  }
}

/* 2026-06 subscription, navigation, and library polish */
.sidebar,
.sub-sidebar {
  background: var(--surface);
  box-shadow: none;
}

.sub-sidebar {
  width: 264px;
  border-right: 1px solid rgba(205, 220, 216, 0.82);
}

.sub-brand {
  min-height: 52px;
  margin: 8px 4px 22px 10px;
  border: 1px solid rgba(205, 220, 216, 0.82);
  border-radius: 6px;
  padding: 8px 10px;
  background: #f7fbfa;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

#subNavContent {
  gap: 2px;
}

.sidebar button,
.sub-item,
.sub-conversation,
.composer,
.model-workspace,
.tool-card {
  border-radius: 6px;
}

.sub-back {
  border-radius: 6px;
  background: #EEF0EA;
  border-color: rgba(27, 61, 130, 0.16);
  color: #2864DC;
}

.sub-back:hover {
  background: #e2f3ee;
}

.sub-group-title {
  margin: 18px 10px 8px;
  color: #858D8A;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sub-item,
.sub-conversation {
  min-height: 44px;
  margin: 3px 0;
  border-radius: 6px;
  padding-inline: 14px;
}

.sub-item {
  position: relative;
  overflow: hidden;
}

.sub-item::before,
.sub-conversation::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(27, 61, 130, 0.72);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sub-item,
.sub-conversation {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sub-item.active::before,
.sub-item:hover::before,
.sub-conversation.active::before,
.sub-conversation:hover::before {
  opacity: 1;
}

.sub-item:hover,
.sub-item.active,
.sub-conversation:hover,
.sub-conversation.active {
  border-color: rgba(27, 61, 130,0.18);
  background: var(--surface-sunken);
  box-shadow: none;
}

.sub-item.strong {
  margin-top: 10px;
  border-color: rgba(27, 61, 130,0.22);
  background: #e7f6f1;
}

.sub-user {
  margin: auto 4px 0;
  border: 1px solid rgba(205, 220, 216, 0.82);
  border-radius: 6px;
  padding: 12px;
  background: #f7fbfa;
}

.sub-user .avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
}

.capability-hint {
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.icon-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.voice-btn {
  position: relative;
}

.voice-btn img {
  width: 19px;
  height: 19px;
  object-fit: contain;
  pointer-events: none;
}

.voice-btn.recording {
  border-color: rgba(210, 67, 67, 0.32);
  background: #fff1f1;
  color: #c93636;
  box-shadow: 0 0 0 6px rgba(210, 67, 67, 0.08);
  animation: voicePulse 1.05s ease-in-out infinite;
}

.app-toast-root {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 3000;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.app-toast {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border: 1px solid rgba(205, 220, 216, 0.9);
  border-radius: 6px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.96);
  color: #22312e;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: auto;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #2864DC;
}

.app-toast.success .app-toast-dot {
  background: #2864DC;
}

.app-toast.warning .app-toast-dot {
  background: #d59628;
}

.app-toast.error .app-toast-dot {
  background: #d24343;
}

.app-toast-text {
  min-width: 0;
  color: #22312e;
  font-size: 12px;
  line-height: 1.55;
}

.app-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2990;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 22, 20, 0.36);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.app-confirm-overlay.show {
  opacity: 1;
}

.app-confirm-card {
  width: min(390px, 100%);
  border: 1px solid rgba(205, 220, 216, 0.9);
  border-radius: 6px;
  padding: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transform: translateY(8px);
  transition: transform 0.18s ease;
}

.app-confirm-overlay.show .app-confirm-card {
  transform: translateY(0);
}

.app-confirm-card h3 {
  margin: 0 0 8px;
  color: #151A19;
  font-size: 18px;
}

.app-confirm-card p {
  margin: 0;
  color: #66736f;
  line-height: 1.7;
}

.app-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

@keyframes voicePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}


/* Refined light workspace theme */
.workspace,
.workspace button,
.workspace input,
.workspace textarea,
.workspace select {
  font-family: var(--font-sans);
}

.sub-item.strong {
  color: #2864DC;
  font-weight: 650;
}

.sub-user {
  cursor: pointer;
}

.workspace-card-head h2,
.model-workspace h2 {
  font-weight: 650;
}

.chat-bubble {
  font-weight: 400;
}

.btn.danger-light {
  border-color: rgba(220, 38, 38, 0.18);
  background: #fff7f7;
  color: #b91c1c;
}

.btn.disabled,
.btn[disabled],
label.btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.builder-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.xinghe-package-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.xinghe-package {
  display: grid;
  gap: 8px;
  min-height: 128px;
  border: 1px solid rgba(205, 220, 216, 0.9);
  border-radius: 6px;
  padding: 16px;
  background: #ffffff;
  color: #151A19;
  text-align: left;
  box-shadow: var(--shadow);
}

.xinghe-package strong {
  font-size: 18px;
  font-weight: 650;
}

.xinghe-package span,
.xinghe-package small {
  color: #66736f;
  line-height: 1.55;
}

.xinghe-package em {
  width: fit-content;
  border-radius: 4px;
  padding: 4px 9px;
  background: #fff1e8;
  color: #c85f20;
  font-style: normal;
  font-size: 12px;
}

.xinghe-package.active {
  border-color: rgba(27, 61, 130,0.5);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.xinghe-package.locked {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .xinghe-package-grid {
    grid-template-columns: 1fr;
  }
}

.sub-sidebar .sub-group-title,
.sub-sidebar .sub-empty,
.sub-sidebar .sub-user .plan {
  color: #858D8A;
}

#subNavContent {
  overflow: hidden;
}

.sub-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4px 14px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(27, 61, 130, 0.34) transparent;
}

.sub-nav-scroll::-webkit-scrollbar {
  width: 6px;
}

.sub-nav-scroll::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(27, 61, 130, 0.28);
}

.sub-sidebar .sub-user {
  flex: 0 0 auto;
  margin-top: 12px;
}

.sub-sidebar .sub-user > div:last-child {
  min-width: 0;
}

.sub-sidebar .sub-user .name,
.sub-sidebar .sub-user .plan {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sub-sidebar .sub-user .plan {
  margin-top: 3px;
  font-size: 12px;
}

/* Compact workspace typography and uncropped brand marks */
.workspace {
  font-size: 14px;
}

.side-logo {
  font-size: 14px;
}

.sub-back::before {
  font-size: 12px;
  font-weight: 650;
}

.workspace-card-head h2,
.model-workspace h2,
.tool-section-head h2 {
  font-size: 20px;
  font-weight: 560;
}

.workspace-card-head p {
  font-size: 12px;
}

.model-workspace {
  border-radius: 6px;
  padding: 24px 28px 20px;
}

.tool-card h3 {
  font-size: 14px;
}

.workspace.subnav-open .panel-head.model-mode {
  width: 100%;
  max-width: none;
  padding: 0;
}

.workspace.subnav-open .model-content {
  height: 100%;
}

.workspace.subnav-open .ai-disclaimer,
.workspace.subnav-open .workspace-icp,
.workspace.subnav-open .workspace-icp a {
  font-size: 12px;
  line-height: 1.05;
}

.workspace.subnav-open .ai-disclaimer {
  margin: 1px auto 0;
}

.workspace.subnav-open .workspace-icp {
  padding-top: 2px;
  padding-bottom: 0;
}

/* UI normalization pass: unify the workspace chrome without touching business logic. */
:root {
  --ws-nav-width: 280px;
  --ws-page-max: 1180px;
  --ws-bg: #f6faf8;
  --ws-bg-soft: #eef6f3;
  --ws-surface: rgba(255, 255, 255, 0.94);
  --ws-surface-solid: #ffffff;
  --ws-line: rgba(198, 215, 209, 0.82);
  --ws-line-soft: rgba(213, 226, 221, 0.72);
  --ws-text: #151A19;
  --ws-text-soft: #59615F;
  --ws-muted: #72817c;
  --ws-brand: #2864DC;
  --ws-brand-dark: #2864DC;
  --ws-brand-soft: #EEF0EA;
  --ws-radius-sm: 4px;
  --ws-radius-md: 4px;
  --ws-radius-lg: 6px;
  --ws-radius-xl: 6px;
  --ws-shadow-sm: 0 8px 22px rgba(20, 35, 31, 0.05);
  --ws-shadow-md: 0 18px 44px rgba(20, 35, 31, 0.08);
}

body {
  background: var(--ws-bg);
  color: var(--ws-text);
}

.sidebar,
.sub-sidebar {
  padding: 18px 20px;
}

.side-logo {
  min-height: 42px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ws-line-soft);
  padding-bottom: 14px;
  color: var(--ws-text);
}

.side-logo img,
.sub-brand img {
  width: 34px;
  height: 34px;
  border-radius: var(--ws-radius-sm);
  object-fit: contain;
  padding: 3px;
  background: #ffffff;
  border: 1px solid var(--ws-line-soft);
}

.side-home-link {
  border-radius: 4px;
  padding: 5px 10px;
  background: var(--ws-brand-soft);
  color: var(--ws-brand-dark);
  font-size: 12px;
  font-weight: 650;
}

.sub-back {
  height: 38px;
  margin-bottom: 12px;
  border-color: var(--ws-line);
  border-radius: var(--ws-radius-md);
  background: var(--ws-surface-solid);
  color: var(--ws-brand-dark);
}

.sub-brand,
.sub-group-title {
  letter-spacing: 0;
}

.sub-group-title {
  margin: 14px 0 6px;
  color: #7b8c87;
  font-size: 12px;
}

.sub-user {
  border: 1px solid var(--ws-line-soft);
  border-radius: var(--ws-radius-lg);
  padding: 10px;
  background: rgba(255,255,255,0.72);
}

.content {
  background: transparent;
}

.workspace.subnav-open .content {
  padding: 12px;
}

.panel-head,
.panel-head.model-mode,
.panel-head.tools-mode {
  align-content: start;
}

.model-workspace {
  padding: 24px;
}

@media (max-width: 960px) {
  :root {
    --ws-nav-width: 248px;
  }
}

.sub-user-wrap {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.sub-fixed-actions {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
}

.sub-fixed-actions::before {
  content: "固定入口";
  display: block;
  margin: 0 0 2px;
  color: var(--ws-muted);
  font-size: 12px;
  font-weight: 680;
}

.sub-fixed-actions .manual-entry {
  justify-content: flex-start;
  min-height: 40px;
  border-color: var(--ws-line-soft);
  border-radius: var(--ws-radius-md);
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ws-text);
}

.sub-fixed-actions .manual-entry:hover,
.sub-fixed-actions .manual-entry.active {
  border-color: rgba(27, 61, 130, 0.24);
  background: var(--ws-brand-soft);
  color: var(--ws-brand-dark);
}

.sub-user {
  margin-top: 0;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20, 35, 31, 0.04);
}

.sub-user .avatar {
  flex: 0 0 auto;
}

.sub-user .name {
  color: var(--ws-text);
  font-weight: 680;
}

.sub-user .plan {
  color: var(--ws-muted);
}

.sub-user:hover {
  border-color: rgba(27, 61, 130, 0.24);
  background: #ffffff;
}

/* Product UI system v1: restrained light SaaS workspace. CSS-only, layout-preserving. */
:root {
  --ui-nav-width: 280px;
  --ui-font: var(--font-sans);
  --ui-bg: #f5faf8;
  --ui-bg-raised: #fbfefd;
  --ui-surface: #ffffff;
  --ui-surface-soft: #F7F8F5;
  --ui-border: #DEE3DE;
  --ui-border-soft: #E8ECE8;
  --ui-text: #151A19;
  --ui-text-2: #59615F;
  --ui-text-3: #858D8A;
  --ui-brand: #2864DC;
  --ui-brand-2: #3974E8;
  --ui-brand-soft: #EAF1FF;
  --ui-danger: #dc2626;
  --ui-warning: #d87a2f;
  --ui-radius-xs: 6px;
  --ui-radius-sm: 8px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 14px;
  --ui-radius-xl: 16px;
  --ui-shadow-xs: 0 1px 2px rgba(20, 24, 40, 0.04);
  --ui-shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.04), 0 8px 24px rgba(50, 60, 120, 0.06);
  --ui-shadow-md: 0 12px 40px rgba(50, 60, 120, 0.10);
  --ui-control-h: 40px;
  --ui-control-lg: 44px;
}

body,
.workspace,
button,
input,
textarea,
select {
  font-family: var(--ui-font);
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--ui-bg);
}

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(27, 61, 130, 0.16);
  outline-offset: 2px;
}

.side-logo,
.sub-brand {
  min-height: 44px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--ui-border-soft);
  padding-bottom: 14px;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 700;
}

.side-logo img,
.header-logo,
.sub-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 1px solid var(--ui-border-soft);
  border-radius: var(--ui-radius-xs);
  padding: 3px;
  background: #ffffff;
}

.side-home-link {
  min-height: 28px;
  border: 1px solid rgba(27, 61, 130, 0.16);
  border-radius: 4px;
  padding: 5px 10px;
  background: var(--ui-brand-soft);
  color: var(--ui-brand-2);
  font-size: 12px;
  font-weight: 650;
}

.sub-fixed-actions {
  padding: 12px;
}

.sub-fixed-actions .manual-entry {
  justify-content: flex-start;
  margin: 0;
  border-color: var(--ui-border-soft);
  background: #ffffff;
  color: var(--ui-text);
}

.sub-fixed-actions .manual-entry svg,
.manual-entry svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}

.sub-user {
  gap: 10px;
  padding: 10px;
}

.sub-user .avatar {
  border: 1px solid var(--ui-border-soft);
  box-shadow: none;
}

.sub-user .name {
  color: var(--ui-text);
  font-size: 12px;
  font-weight: 700;
}

.sub-user .plan {
  color: var(--ui-text-3);
  font-size: 12px;
  font-weight: 550;
}

.workspace-card,
.model-workspace {
  padding: 24px;
}

.workspace-card-head {
  margin-bottom: 20px;
}

.btn.danger-light,
.btn.danger {
  border-color: rgba(220, 38, 38, 0.22);
  background: #fff5f5;
  color: var(--ui-danger);
}

.icon-btn {
  border: 1px solid var(--ui-border-soft);
  background: #ffffff;
  color: var(--ui-text-2);
}

.icon-btn:hover,
.icon-btn.active,
.send-action {
  border-color: rgba(27, 61, 130, 0.24);
  background: var(--ui-brand-soft);
  color: var(--ui-brand-2);
}

.send-action {
  background: var(--ui-brand);
  color: #ffffff;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 4px;
  background: rgba(27, 61, 130, 0.25);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 61, 130, 0.38);
  background-clip: padding-box;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: 0.01ms;
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
  }
}

@media (max-width: 960px) {
  :root {
    --ui-nav-width: 248px;
  }
}
