:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --teal: #14b8a6;
  --teal-dark: #0f8f84;
  --lavender: #a78bfa;
  --lavender-strong: #635bff;
  --lavender-soft: #f4f3ff;
  --mint: #dffcf3;
  --coral: #f97373;
  --amber: #f59e0b;
  --graphite: #374151;
  --blue: #2563eb;
  --shadow: 0 18px 48px rgba(17, 24, 39, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f6f7fb 0%, #eef7f4 100%);
  color: var(--ink);
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(99, 91, 255, 0.24);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px 0;
}

.auth-panel,
.auth-workspace-preview {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 28px;
}

.auth-brand {
  margin-bottom: 42px;
}

.auth-copy {
  margin-bottom: 24px;
}

.auth-copy h1 {
  margin-bottom: 12px;
  font-size: 40px;
  line-height: 1.12;
}

.auth-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
}

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #b42318;
  background: #fff1f0;
  border: 1px solid #ffd2cc;
  border-radius: var(--radius);
  font-size: 14px;
}

.demo-code {
  margin: 0 0 12px;
  padding: 10px 12px;
  color: #065f46;
  background: #ecfdf3;
  border: 1px solid #b7ebc6;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 800;
}

.auth-visual {
  min-width: 0;
}

.auth-workspace-preview {
  width: min(520px, 100%);
  min-height: 520px;
  margin-left: auto;
  padding: 22px;
}

.preview-topline,
.workspace-preview-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
}

.preview-topline span,
.workspace-preview-toolbar span {
  width: 10px;
  height: 10px;
  background: #cbd5e1;
  border-radius: 999px;
}

.preview-search {
  height: 56px;
  margin-bottom: 18px;
  background: linear-gradient(90deg, #eef2ff, #ecfeff);
  border: 1px solid #dbe4ff;
  border-radius: var(--radius);
}

.preview-stack {
  display: grid;
  gap: 14px;
}

.preview-agent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  min-height: 112px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preview-agent.active {
  background: #f0fdfa;
  border-color: rgba(20, 184, 166, 0.45);
}

.preview-agent span,
.preview-agent strong {
  display: block;
  height: 12px;
  background: #cbd5e1;
  border-radius: 999px;
}

.preview-agent span {
  width: 58%;
  margin-bottom: 12px;
}

.preview-agent strong {
  width: 84%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 40px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(217, 207, 255, 0.7);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--lavender-strong));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(124, 108, 255, 0.24);
}

.brand-name {
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: rgba(245, 239, 255, 0.86);
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
}

.topnav a {
  color: #716a9e;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  white-space: nowrap;
}

.topnav a.active,
.topnav a:hover {
  color: var(--ink);
  background: linear-gradient(135deg, #ffffff, #ecfff7);
  box-shadow: 0 8px 20px rgba(116, 96, 205, 0.1);
}

.account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 170px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: #6654c9;
  background: linear-gradient(135deg, #effff8, #f2edff);
  border: 1px solid #d9ccff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
}

.hero-section {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: 42px;
  align-items: center;
  min-height: 680px;
  padding: 36px 0 28px;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 18px 0 18px 38%;
  z-index: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 254, 255, 0.7));
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--lavender-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 680px;
  margin-bottom: 18px;
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-lead {
  max-width: 620px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.composer {
  max-width: 680px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 255, 252, 0.9));
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(116, 96, 205, 0.14);
}

.composer label,
.field-group label,
.field-group legend {
  display: block;
  margin-bottom: 8px;
  color: var(--graphite);
  font-size: 14px;
  font-weight: 800;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

textarea,
input,
select {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dcd1ff;
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 92px;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--lavender-strong);
  box-shadow: 0 0 0 3px rgba(140, 120, 240, 0.14);
}

.primary-button,
.secondary-button,
.outline-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--lavender-strong));
  border-color: transparent;
  box-shadow: 0 12px 26px rgba(124, 108, 255, 0.22);
}

.primary-button:hover {
  background: linear-gradient(135deg, #39cdb0, #7a65e8);
  border-color: transparent;
}

.secondary-button {
  padding: 0 16px;
  color: var(--graphite);
  background: #ffffff;
  border-color: #dacfff;
}

.outline-button {
  padding: 0 16px;
  color: #6d5bd5;
  background: transparent;
  border-color: #c6b8ff;
}

.ghost-button {
  padding: 0 12px;
  color: var(--graphite);
  background: transparent;
  border-color: transparent;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-chips button,
.filter-tabs button,
.payment-methods button {
  min-height: 34px;
  padding: 0 12px;
  color: #665f9a;
  background: linear-gradient(135deg, #f4fff9, #f5f0ff);
  border: 1px solid #ded2ff;
  border-radius: 8px;
}

.quick-chips button:hover,
.filter-tabs button.active,
.filter-tabs button:hover,
.payment-methods button.active,
.payment-methods button:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal-dark), var(--lavender-strong));
  border-color: transparent;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin-top: 18px;
}

.metric-row div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(215, 202, 255, 0.86);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(116, 96, 205, 0.08);
}

.metric-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
  line-height: 1;
}

.metric-row span {
  color: var(--muted);
  font-size: 13px;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.workspace-preview {
  width: min(560px, 100%);
  margin-left: auto;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.workspace-preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 14px;
}

.workspace-preview-main,
.workspace-preview-side {
  min-height: 320px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workspace-preview-main span,
.workspace-preview-main strong,
.workspace-preview-main em,
.workspace-preview-side span,
.workspace-preview-side strong {
  display: block;
  background: #cbd5e1;
  border-radius: 999px;
}

.workspace-preview-main span {
  width: 46%;
  height: 12px;
  margin-bottom: 18px;
}

.workspace-preview-main strong {
  width: 82%;
  height: 20px;
  margin-bottom: 28px;
}

.workspace-preview-main em {
  width: 100%;
  height: 72px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #eef2ff, #ecfeff);
  border-radius: var(--radius);
}

.workspace-preview-side {
  display: grid;
  place-items: center;
  align-content: center;
}

.workspace-preview-side .agent-portrait {
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
}

.workspace-preview-side span {
  width: 70%;
  height: 12px;
  margin-bottom: 10px;
}

.workspace-preview-side strong {
  width: 88%;
  height: 14px;
}

.recommend-section,
.market-section,
.orders-section,
.custom-section {
  padding: 48px 0;
  border-top: 1px solid rgba(215, 202, 255, 0.72);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-actions,
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact {
  align-items: center;
}

.agent-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 18px;
}

.agent-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 420px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(116, 96, 205, 0.1);
}

.agent-card.featured {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 255, 250, 0.93));
  border-color: rgba(83, 215, 189, 0.72);
  box-shadow: 0 22px 52px rgba(83, 215, 189, 0.18);
}

.agent-card.is-selected,
.mini-agent.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18), 0 14px 34px rgba(17, 24, 39, 0.1);
}

.agent-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.agent-portrait {
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
  width: 108px;
  height: 108px;
  background:
    radial-gradient(circle at 50% 36%, #ffffff 0 18%, transparent 19%),
    linear-gradient(135deg, var(--avatar-a, #99f6e4), var(--avatar-b, #c4b5fd));
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.agent-portrait::before,
.agent-portrait::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.agent-portrait::before {
  top: 24%;
  width: 31%;
  aspect-ratio: 1;
  background: #ffffff;
  border: 2px solid rgba(17, 24, 39, 0.12);
  border-radius: 999px;
}

.agent-portrait::after {
  bottom: 18%;
  width: 58%;
  height: 30%;
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px 999px 18px 18px;
}

.sprite-0 {
  --avatar-a: #fde68a;
  --avatar-b: #38bdf8;
}

.sprite-1 {
  --avatar-a: #bfdbfe;
  --avatar-b: #a7f3d0;
}

.sprite-2 {
  --avatar-a: #99f6e4;
  --avatar-b: #c4b5fd;
}

.sprite-3 {
  --avatar-a: #fecdd3;
  --avatar-b: #93c5fd;
}

.sprite-4 {
  --avatar-a: #bae6fd;
  --avatar-b: #fde68a;
}

.sprite-5 {
  --avatar-a: #ddd6fe;
  --avatar-b: #86efac;
}

.agent-meta {
  min-width: 0;
}

.agent-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-name-row h3 {
  margin-bottom: 0;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 6px;
}

.badge.recommend {
  color: #ffffff;
  background: linear-gradient(135deg, var(--coral), var(--amber));
}

.badge.neutral {
  color: #6654c9;
  background: #f0ebff;
}

.agent-role {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.score-row span {
  display: block;
  padding: 10px;
  background: linear-gradient(135deg, #f2fff9, #f4efff);
  border: 1px solid #e0d6ff;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.score-row strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 16px;
}

.agent-summary {
  color: var(--graphite);
  line-height: 1.65;
}

.agent-reason {
  margin-top: auto;
  padding: 12px;
  color: #4f5480;
  background: linear-gradient(135deg, #effff8, #f4efff);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.tag-list span {
  padding: 6px 8px;
  color: var(--muted);
  background: #f8f4ff;
  border: 1px solid #e4d9ff;
  border-radius: 6px;
  font-size: 12px;
}

.agent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.agent-actions .primary-button {
  grid-column: 1 / -1;
}

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

.mini-agent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  min-height: 128px;
  padding: 14px;
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
}

.mini-agent:hover {
  border-color: var(--teal);
  background: #ffffff;
}

.empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 22px;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
}

.empty-state strong {
  color: var(--ink);
}

.mini-agent .agent-portrait {
  width: 72px;
  height: 72px;
}

.mini-agent h3 {
  margin-bottom: 4px;
  font-size: 17px;
}

.mini-agent p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.mini-agent span {
  color: #6d5bd5;
  font-size: 12px;
  font-weight: 800;
}

.order-board {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(242, 255, 249, 0.92));
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
}

.order-board h3 {
  margin-bottom: 6px;
}

.order-board p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.order-price {
  display: grid;
  place-items: center;
  min-width: 96px;
  padding: 14px;
  background: linear-gradient(135deg, #fff8dc, #f0ebff);
  border: 1px solid #e8d7a0;
  border-radius: 8px;
}

.order-price strong {
  font-size: 28px;
  line-height: 1;
}

.order-price span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.order-action {
  display: grid;
  gap: 10px;
  justify-items: stretch;
}

.custom-section {
  display: grid;
  grid-template-columns: 0.75fr 1fr 0.75fr;
  gap: 24px;
  align-items: start;
  padding-bottom: 72px;
}

.custom-section > div:first-child p {
  color: var(--muted);
  line-height: 1.7;
}

.custom-form,
.custom-preview {
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(215, 202, 255, 0.9);
  border-radius: 8px;
}

.field-group {
  margin-bottom: 14px;
  padding: 0;
  border: 0;
}

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

.capability-group legend {
  grid-column: 1 / -1;
}

.capability-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--graphite);
  font-weight: 600;
}

.capability-group input {
  width: 16px;
  height: 16px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--teal);
}

.full-width {
  width: 100%;
}

.custom-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 168px;
}

.custom-preview .agent-portrait {
  width: 116px;
  height: 116px;
}

.preview-kicker {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-pill {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--lavender-strong));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 25, 31, 0.48);
}

.payment-modal {
  position: relative;
  width: min(440px, 100%);
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #f6fff9);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f5f0ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.checkout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.checkout-row strong {
  font-size: 22px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.checkout-note {
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(380px, calc(100vw - 48px));
  padding: 14px 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #51468b, #28a891);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1100px) {
  .auth-screen {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 28px 0;
  }

  .auth-workspace-preview {
    width: 100%;
    min-height: 360px;
    margin-left: 0;
  }

  .topbar {
    padding: 12px 20px;
  }

  .hero-section {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 28px;
  }

  .hero-section::before {
    inset: 0;
    opacity: 0.38;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 253, 250, 0.88) 100%);
  }

  .hero-visual {
    display: none;
  }

  .agent-grid {
    grid-template-columns: 1fr;
  }

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

  .custom-section {
    grid-template-columns: 1fr;
  }

  .order-board {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .order-action {
    justify-items: start;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    width: min(100% - 24px, 1180px);
    align-items: start;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-copy h1 {
    font-size: 32px;
  }

  .auth-visual {
    display: none;
  }

  main {
    width: min(100% - 24px, 1280px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .account {
    width: 100%;
    justify-content: space-between;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 25px;
  }

  .hero-lead {
    font-size: 16px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .code-row,
  .workspace-preview-body {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .score-row,
  .payment-methods,
  .capability-group {
    grid-template-columns: 1fr;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-actions,
  .filter-tabs {
    justify-content: flex-start;
  }

  .agent-top,
  .custom-preview {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-actions,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .mini-agent {
    grid-template-columns: auto 1fr;
  }
}

/* Gezhi Universe app layout */
body {
  overflow: hidden;
  background: #f6f7fb;
}

.brand {
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 126px;
  height: 70px;
  object-fit: contain;
}

.auth-brand .brand-logo {
  width: 170px;
  height: 126px;
}

.auth-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 40px;
  width: 100%;
  min-height: 100vh;
  padding: 44px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.76) 38%, rgba(255, 255, 255, 0.1) 100%),
    url("assets/gezhiyuzhou-home.png") center / cover no-repeat;
}

.auth-hero {
  align-self: end;
  max-width: 600px;
  padding-bottom: 56px;
}

.auth-hero h1 {
  margin-bottom: 14px;
  font-size: 58px;
}

.auth-lead {
  max-width: 560px;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.7;
}

.auth-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.auth-metrics span {
  padding: 9px 12px;
  color: #0f766e;
  background: rgba(240, 253, 250, 0.9);
  border: 1px solid rgba(20, 184, 166, 0.32);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.auth-panel {
  align-self: center;
  width: min(400px, 100%);
  margin-left: auto;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.auth-copy h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

.app-shell {
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.topbar {
  position: static;
  display: grid;
  grid-template-columns: 220px minmax(260px, 1fr) auto;
  height: 76px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.topbar .brand-logo {
  width: 112px;
  height: 64px;
}

.global-search {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
}

.global-search span {
  position: absolute;
  left: 14px;
  color: var(--muted);
  font-size: 18px;
}

.global-search input {
  height: 42px;
  padding-left: 42px;
  background: #f8fafc;
  border-color: var(--line);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 360px;
  gap: 16px;
  min-height: 0;
  padding: 16px;
  background: #f3f4f8;
}

.sidebar,
.workspace-main,
.detail-panel {
  min-height: 0;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.side-nav a {
  padding: 10px 12px;
  color: #4b5563;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.side-nav a.active,
.side-nav a:hover {
  color: #0f172a;
  background: #eefaf7;
}

.sidebar-card,
.workspace-panel,
.detail-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.sidebar-card {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.sidebar-card strong {
  color: var(--ink);
  line-height: 1.35;
}

.sidebar-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.workspace-main {
  width: auto;
  margin: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 16px;
  padding-right: 2px;
}

.workspace-panel,
.workspace-panel.recommend-section,
.workspace-panel.market-section,
.workspace-panel.custom-section {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.workspace-heading h1 {
  margin-bottom: 8px;
  font-size: 30px;
}

.workspace-heading p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.workspace-heading .metric-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  margin-top: 0;
}

.composer {
  max-width: none;
  padding: 14px;
  background: #f8fafc;
  border-color: var(--line);
  box-shadow: none;
}

.input-row {
  grid-template-columns: minmax(0, 1fr) 116px;
}

textarea {
  min-height: 76px;
  max-height: 140px;
}

.section-header {
  margin-bottom: 14px;
}

.section-header h2,
.detail-card h2 {
  font-size: 22px;
}

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

.agent-card {
  min-height: 0;
  padding: 14px;
  box-shadow: none;
}

.agent-card.featured {
  box-shadow: none;
}

.agent-top {
  gap: 10px;
}

.agent-portrait {
  width: 68px;
  height: 68px;
}

.score-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 10px 0;
}

.score-row span:nth-child(3) {
  grid-column: 1 / -1;
}

.agent-summary,
.agent-reason {
  font-size: 13px;
  line-height: 1.55;
}

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

.agent-actions .primary-button {
  grid-column: auto;
}

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

.mini-agent {
  min-height: 96px;
  box-shadow: none;
}

.mini-agent .agent-portrait {
  width: 54px;
  height: 54px;
}

.custom-section {
  grid-template-columns: 0.8fr 1fr 0.8fr;
  padding-bottom: 18px;
}

.custom-form,
.custom-preview {
  padding: 14px;
  box-shadow: none;
}

.custom-preview {
  min-height: 100%;
}

.custom-preview .agent-portrait {
  width: 78px;
  height: 78px;
}

.detail-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow: auto;
}

.detail-card {
  padding: 18px;
}

.detail-agent-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.detail-agent-head .agent-portrait {
  width: 88px;
  height: 88px;
}

.detail-agent-head h2 {
  margin-bottom: 4px;
}

.detail-agent-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.detail-stats span {
  padding: 10px;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}

.detail-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.detail-summary {
  color: var(--graphite);
  line-height: 1.65;
}

.detail-card.orders-section {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.detail-card .order-board {
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0;
  background: transparent;
  border: 0;
}

.detail-card .order-price {
  justify-self: stretch;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    grid-template-columns: 160px minmax(0, 1fr);
    height: auto;
    min-height: 76px;
    padding: 10px 16px;
  }

  .account {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .workspace-shell {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .auth-screen {
    grid-template-columns: 1fr;
    padding: 24px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0.88) 100%),
      url("assets/gezhiyuzhou-home.png") center / cover no-repeat;
  }

  .auth-hero {
    align-self: auto;
    padding-bottom: 0;
  }

  .auth-hero h1 {
    font-size: 40px;
  }

  .auth-brand .brand-logo {
    width: 132px;
    height: 98px;
  }

  .auth-panel {
    width: 100%;
    margin-left: 0;
  }

  .topbar,
  .workspace-shell,
  .workspace-heading,
  .agent-grid,
  .library-grid,
  .custom-section,
  .detail-panel {
    grid-template-columns: 1fr;
  }

  .global-search {
    max-width: none;
  }

  .sidebar {
    order: 2;
  }

  .workspace-main {
    order: 1;
    overflow: visible;
  }

  .detail-panel {
    order: 3;
  }

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

  .input-row,
  .agent-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
    overflow: hidden;
  }

  .workspace-shell {
    min-height: 0;
    overflow: auto;
  }

  .workspace-main,
  .detail-panel {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
  }

  .workspace-shell {
    align-content: start;
    padding: 12px;
  }
}

/* Clean paged workspace refinement */
.brand-title {
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.auth-brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  width: auto;
  margin-bottom: 34px;
}

.auth-brand .brand-logo {
  width: 112px;
  height: 84px;
}

.auth-brand .brand-title {
  font-size: 34px;
}

.auth-metrics {
  display: none;
}

.topbar {
  grid-template-columns: 210px 220px minmax(260px, 1fr) auto;
  gap: 16px;
  height: 72px;
  padding: 0 20px;
}

.topbar .brand {
  gap: 8px;
}

.topbar .brand-logo {
  width: 74px;
  height: 54px;
}

.topbar .brand-title {
  font-size: 18px;
}

.workspace-switcher {
  display: grid;
  gap: 4px;
  align-self: center;
}

.workspace-switcher label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-switcher select {
  height: 36px;
  border-color: var(--line);
  background: #ffffff;
}

.workspace-shell {
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar {
  min-width: 0;
}

.side-nav button {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  color: #4b5563;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
}

.side-nav button.active,
.side-nav button:hover {
  color: #0f172a;
  background: #eefaf7;
}

.workspace-main {
  display: block;
  padding: 0;
}

.workspace-page {
  display: none;
  min-height: 100%;
}

.workspace-page.is-active {
  display: grid;
  align-content: start;
  gap: 16px;
}

.workspace-panel,
.workspace-page {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

.workspace-page {
  padding: 20px;
}

.workspace-page .workspace-panel {
  padding: 16px;
}

.workspace-page.recommend-section,
.workspace-page.market-section,
.workspace-page.custom-section,
.workspace-page.orders-section,
.workspace-page.workspace-documents,
.workspace-page.conversation-history,
.workspace-page.connected-agents {
  border-top: 1px solid var(--line);
}

.page-grid {
  display: grid;
  gap: 16px;
}

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

.workspace-context {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 10px 12px;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: var(--radius);
  font-size: 13px;
}

.workspace-context strong,
.workspace-context em {
  font-style: normal;
}

.workspace-heading .metric-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.compact-list {
  grid-template-columns: 1fr;
}

.asset-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 96px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.asset-card h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.asset-card p {
  margin-bottom: 6px;
  color: var(--graphite);
  font-size: 13px;
  line-height: 1.5;
}

.asset-card span {
  color: var(--muted);
  font-size: 12px;
}

.asset-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #0f766e;
  background: #ccfbf1;
  border-radius: 8px;
  font-weight: 900;
}

.connection-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 7px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.connection-pill.is-connected {
  color: #0f766e;
  background: #ccfbf1;
}

.order-space {
  margin-top: 8px;
  font-size: 13px;
}

.orders-section .order-board {
  grid-template-columns: minmax(0, 1fr) 140px 160px;
  background: #f8fafc;
  border-color: var(--line);
}

.workspace-usage {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.workspace-usage span {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 180px minmax(180px, 240px) minmax(0, 1fr);
  }

  .account {
    grid-column: auto;
  }

  .workspace-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .auth-screen {
    align-content: start;
  }

  .auth-brand .brand-logo {
    width: 88px;
    height: 66px;
  }

  .auth-brand .brand-title {
    font-size: 28px;
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    height: auto;
    padding: 12px;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

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

  .workspace-page {
    padding: 14px;
  }

  .workspace-heading,
  .two-columns,
  .asset-grid,
  .agent-grid,
  .library-grid,
  .orders-section .order-board {
    grid-template-columns: 1fr;
  }

  .workspace-context {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 156px minmax(0, 1fr);
    height: auto;
    overflow: auto;
  }

  .sidebar,
  .workspace-main {
    order: initial;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .side-nav button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  .sidebar-card {
    padding: 10px;
  }

  .sidebar-card span {
    display: none;
  }
}

@media (max-width: 520px) {
  .workspace-shell {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
}

.auth-hero {
  align-self: center;
  padding-bottom: 0;
  transform: translateY(-32px);
}

.auth-brand {
  margin-bottom: 14px;
}

.auth-hero .eyebrow {
  margin-bottom: 14px;
}

.auth-hero h1 {
  margin-bottom: 4px;
}

@media (max-width: 820px) {
  .auth-hero {
    transform: none;
  }
}

/* Current app polish */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0, 0, 0, 0);
}

.app-shell {
  grid-template-rows: 72px minmax(0, 1fr);
  background: #f5f7fb;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  padding: 8px 18px;
  background: #f5f7fb;
  border-bottom: 0;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, 100%);
  height: 56px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.topbar .brand {
  min-width: 0;
  gap: 8px;
}

.topbar .brand-logo {
  width: 44px;
  height: 40px;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.topbar .brand-title {
  font-size: 17px;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.account {
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.account .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  color: #4b5563;
  background: #f8fafc;
  border-color: var(--line);
}

.workspace-shell {
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 18px 18px;
  background: #f5f7fb;
}

.side-nav {
  padding: 8px;
}

.side-nav button {
  min-height: 40px;
  color: #4b5563;
}

.side-nav button.active,
.side-nav button:hover {
  color: #0f172a;
  background: #eef4ff;
}

.workspace-main {
  overflow: auto;
}

.workspace-page.home-page {
  display: none;
  min-height: calc(100vh - 112px);
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.workspace-page.home-page.is-active {
  display: grid;
  place-items: center;
}

.dialogue-box {
  display: grid;
  justify-items: center;
  width: min(860px, 100%);
  padding: 12px 0 44px;
}

.dialogue-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.dialogue-logo {
  width: 42px;
  height: 36px;
  object-fit: contain;
}

.dialogue-title h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(430px, 100%);
  margin-bottom: 56px;
  padding: 2px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mode-toggle button {
  min-height: 46px;
  color: #374151;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
}

.mode-toggle button.active {
  color: #2563eb;
  background: #eef4ff;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.search-composer {
  width: min(820px, 100%);
  min-height: 156px;
  padding: 22px 18px 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
}

.search-composer textarea {
  min-height: 78px;
  padding: 0;
  color: #111827;
  background: transparent;
  border: 0;
  box-shadow: none;
  resize: none;
  font-size: 18px;
}

.search-composer textarea::placeholder {
  color: #9ca3af;
}

.composer-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
}

.search-composer .quick-chips {
  margin-top: 0;
}

.search-composer .quick-chips button {
  min-height: 34px;
  color: #2563eb;
  background: #eef4ff;
  border-color: #c7d2fe;
  border-radius: 999px;
}

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

.icon-button,
.send-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  font-weight: 900;
}

.icon-button {
  color: #374151;
  background: transparent;
  border: 1px solid transparent;
}

.icon-button:hover {
  background: #f3f4f6;
  border-color: var(--line);
}

.send-button {
  color: #ffffff;
  background: #9fb6ff;
  border: 0;
  font-size: 24px;
  line-height: 1;
}

.send-button:hover {
  background: #2563eb;
}

.workspace-page.recommend-section,
.workspace-page.workspace-knowledge,
.workspace-page.connected-agents,
.workspace-page.market-section,
.workspace-page.orders-section {
  padding: 22px;
  background: #ffffff;
}

.workspace-page.recommend-section {
  grid-template-columns: minmax(0, 1fr);
}

.agent-detail-card {
  margin-top: 2px;
}

.agent-portrait {
  overflow: hidden;
  width: 74px;
  height: 74px;
  background:
    radial-gradient(circle at 43% 40%, #111827 0 2px, transparent 3px),
    radial-gradient(circle at 57% 40%, #111827 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% 49%, #f8d8c4 0 24%, transparent 25%),
    radial-gradient(ellipse at 50% 78%, rgba(255, 255, 255, 0.92) 0 32%, transparent 33%),
    linear-gradient(135deg, var(--avatar-a, #99f6e4), var(--avatar-b, #c4b5fd));
  border-radius: 999px;
}

.agent-portrait::before {
  top: 21%;
  width: 42%;
  height: 18%;
  background: var(--hair, #1f2937);
  border: 0;
  border-radius: 999px 999px 10px 10px;
}

.agent-portrait::after {
  bottom: 11%;
  width: 58%;
  height: 28%;
  background: rgba(255, 255, 255, 0.86);
  border: 0;
  border-radius: 999px 999px 22px 22px;
}

.sprite-0 {
  --avatar-a: #dbeafe;
  --avatar-b: #bfdbfe;
  --hair: #1e3a8a;
}

.sprite-1 {
  --avatar-a: #dcfce7;
  --avatar-b: #a7f3d0;
  --hair: #065f46;
}

.sprite-2 {
  --avatar-a: #fef3c7;
  --avatar-b: #fde68a;
  --hair: #92400e;
}

.agent-card {
  border-color: var(--line);
  box-shadow: none;
}

.agent-card.featured {
  background: #f8fbff;
  border-color: #bfdbfe;
}

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

.agent-actions .primary-button {
  grid-column: auto;
}

.knowledge-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.knowledge-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.knowledge-head h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.knowledge-head p {
  margin-bottom: 7px;
  color: var(--graphite);
  font-size: 14px;
  line-height: 1.55;
}

.knowledge-head span,
.knowledge-file span {
  color: var(--muted);
  font-size: 12px;
}

.knowledge-files {
  display: grid;
  gap: 8px;
}

.knowledge-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.knowledge-file strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.empty-file strong {
  color: var(--muted);
}

.knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.knowledge-actions .secondary-button,
.knowledge-actions .outline-button {
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 1180px) {
  .topbar {
    height: 72px;
    padding: 8px 14px;
  }

  .account {
    width: auto;
    justify-content: flex-end;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    height: auto;
  }

  .topbar-inner {
    width: 100%;
  }

  .workspace-shell {
    grid-template-columns: 150px minmax(0, 1fr);
    padding: 12px;
  }

  .dialogue-box {
    padding: 18px 0;
  }

  .dialogue-title {
    align-items: flex-start;
    margin-bottom: 22px;
  }

  .dialogue-title h1 {
    font-size: 24px;
  }

  .mode-toggle {
    margin-bottom: 28px;
  }

  .composer-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .composer-actions {
    justify-content: flex-end;
  }

  .asset-grid,
  .agent-grid,
  .library-grid,
  .orders-section .order-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar .brand-logo {
    width: 38px;
    height: 34px;
  }

  .topbar .brand-title {
    font-size: 15px;
  }

  .brand-subtitle {
    font-size: 10px;
  }

  .workspace-shell {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }

  .side-nav button {
    min-height: 36px;
    padding: 0 8px;
    font-size: 12px;
  }

  .sidebar-card {
    display: none;
  }

  .workspace-page.recommend-section,
  .workspace-page.workspace-knowledge,
  .workspace-page.connected-agents,
  .workspace-page.market-section,
  .workspace-page.orders-section {
    padding: 14px;
  }
}

/* Sidebar-integrated shell */
.app-shell {
  display: block;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  background: #f5f7fb;
}

.workspace-shell {
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 18px;
  height: 100vh;
  min-height: 0;
  padding: 16px 18px 18px 16px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  margin-bottom: 14px;
  color: var(--ink);
  text-decoration: none;
}

.sidebar-brand .brand-logo {
  width: 46px;
  height: 40px;
  object-fit: contain;
}

.sidebar-brand .brand-title {
  font-size: 17px;
  line-height: 1.1;
}

.sidebar-brand .brand-subtitle {
  font-size: 11px;
}

.side-nav {
  flex: 1;
  padding: 0;
  background: transparent;
  border: 0;
}

.side-nav button {
  min-height: 42px;
  padding: 0 12px;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.sidebar-user strong {
  margin-bottom: 2px;
  font-size: 14px;
}

.sidebar-user span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-main {
  min-height: 0;
  overflow: auto;
}

.workspace-page.home-page {
  min-height: calc(100vh - 34px);
}

.dialogue-box {
  padding-bottom: 90px;
}

.dialogue-title {
  display: block;
  width: min(740px, 100%);
  margin-bottom: 34px;
  text-align: center;
}

.dialogue-title h1 {
  max-width: none;
  margin: 0;
  font-size: 34px;
  line-height: 1.28;
}

.dialogue-logo,
.mode-toggle,
.topbar {
  display: none !important;
}

.search-composer {
  border-color: #d9dde7;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-composer:focus-within {
  border-color: #cfd6e4;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
}

.search-composer textarea,
.search-composer textarea:focus,
.search-composer textarea:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
  caret-color: #2563eb;
}

.cat-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  width: 42px;
  height: 42px;
  background:
    radial-gradient(circle at 39% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(circle at 61% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(ellipse at 50% 64%, #f8fafc 0 8%, transparent 9%),
    linear-gradient(135deg, #f9d9b4, #f3b56c);
  border: 1px solid #f3c78e;
  border-radius: 999px;
}

.cat-avatar::before,
.cat-avatar::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 14px;
  height: 14px;
  background: #f3b56c;
  border: 1px solid #e5a45b;
  transform: rotate(45deg);
}

.cat-avatar::before {
  left: 5px;
}

.cat-avatar::after {
  right: 5px;
}

.cat-avatar.small {
  width: 38px;
  height: 38px;
}

.cat-avatar.large {
  width: 76px;
  height: 76px;
}

.cat-avatar.large::before,
.cat-avatar.large::after {
  top: 10px;
  width: 22px;
  height: 22px;
}

.cat-avatar.tiny {
  width: 32px;
  height: 32px;
}

.cat-avatar.tiny::before,
.cat-avatar.tiny::after {
  top: 5px;
  width: 10px;
  height: 10px;
}

.cat-avatar.is-blue {
  background:
    radial-gradient(circle at 39% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(circle at 61% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(ellipse at 50% 64%, #eff6ff 0 8%, transparent 9%),
    linear-gradient(135deg, #dbeafe, #60a5fa);
  border-color: #bfdbfe;
}

.cat-avatar.is-blue::before,
.cat-avatar.is-blue::after {
  background: #60a5fa;
  border-color: #3b82f6;
}

.cat-avatar.is-green {
  background:
    radial-gradient(circle at 39% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(circle at 61% 48%, #111827 0 1.8px, transparent 2.4px),
    radial-gradient(ellipse at 50% 64%, #ecfdf5 0 8%, transparent 9%),
    linear-gradient(135deg, #bbf7d0, #34d399);
  border-color: #86efac;
}

.cat-avatar.is-green::before,
.cat-avatar.is-green::after {
  background: #34d399;
  border-color: #10b981;
}

.user-center-section {
  gap: 18px;
}

.user-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 520px);
}

.profile-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 4px;
}

.profile-head h3 {
  margin-bottom: 2px;
}

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

.avatar-field {
  margin-bottom: 0;
}

.avatar-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.avatar-options button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.avatar-options button.active,
.avatar-options button:hover {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.user-avatar-preview {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #ffffff;
  border-radius: 999px;
  font-weight: 900;
}

.user-avatar-preview.blue {
  background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.user-avatar-preview.green {
  background: linear-gradient(135deg, #059669, #34d399);
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logout-button {
  min-height: 42px;
  padding: 0 16px;
  color: #b42318;
  background: #fff7f6;
  border: 1px solid #ffd2cc;
  border-radius: var(--radius);
  font-weight: 900;
}

.logout-button:hover {
  color: #ffffff;
  background: #dc2626;
  border-color: #dc2626;
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 156px minmax(0, 1fr);
    height: 100vh;
    padding: 10px;
  }

  .sidebar {
    padding: 10px;
  }

  .sidebar-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
  }

  .sidebar-brand .brand-logo {
    width: 42px;
    height: 36px;
  }

  .dialogue-title h1 {
    font-size: 26px;
  }

  .workspace-page.home-page {
    min-height: calc(100vh - 20px);
  }
}

@media (max-width: 560px) {
  .workspace-shell {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .sidebar-user {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 9px;
  }

  .sidebar-user span {
    display: none;
  }

  .dialogue-title h1 {
    font-size: 22px;
  }

  .search-composer {
    padding: 16px 14px 12px;
  }
}

/* Compact integrated navigation and detail pages */
body {
  background: #f5f7fb;
}

.workspace-shell {
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 16px 8px;
}

.sidebar {
  padding: 12px 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar-brand {
  gap: 7px;
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 8px;
}

.sidebar-brand .brand-logo {
  width: 36px;
  height: 32px;
}

.sidebar-brand .brand-title {
  font-size: 15px;
  font-weight: 900;
}

.sidebar-brand .brand-subtitle {
  font-size: 10px;
  transform: translateY(-1px);
}

.side-nav {
  gap: 2px;
}

.side-nav button {
  min-height: 34px;
  padding: 0 9px;
  color: #374151;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.side-nav button.active,
.side-nav button:hover {
  background: #eaf1ff;
}

.sidebar-user {
  gap: 8px;
  margin: 12px 4px 0;
  padding: 9px;
  background: rgba(255, 255, 255, 0.58);
}

.sidebar-user strong {
  font-size: 13px;
}

.sidebar-user span {
  font-size: 11px;
}

.workspace-page.recommend-section,
.workspace-page.workspace-knowledge,
.workspace-page.knowledge-detail-section,
.workspace-page.connected-agents,
.workspace-page.market-section,
.workspace-page.orders-section,
.workspace-page.agent-detail-page,
.workspace-page.user-center-section {
  padding: 20px;
}

.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 24px;
}

.section-header p {
  font-size: 14px;
}

.dialogue-title {
  width: min(680px, 100%);
  margin-bottom: 28px;
}

.dialogue-title h1 {
  font-size: 30px;
}

.search-composer {
  width: min(760px, 100%);
  min-height: 138px;
  padding: 20px 18px 14px;
}

.search-composer textarea {
  min-height: 62px;
  font-size: 17px;
}

.composer-toolbar {
  align-items: center;
}

.send-button {
  width: auto;
  min-width: 104px;
  height: 38px;
  min-height: 38px;
  padding: 0 16px;
  background: #2563eb;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.send-button:hover {
  background: #1d4ed8;
}

.agent-portrait {
  width: 78px;
  height: 78px;
  background-image: url("assets/agent-avatar-sprite.png");
  background-repeat: no-repeat;
  background-size: 300% 100%;
  background-color: #eef2ff;
  border: 1px solid #d9e0ec;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.agent-portrait::before,
.agent-portrait::after {
  content: none;
}

.sprite-0 {
  background-position: 0% 50%;
}

.sprite-1 {
  background-position: 50% 50%;
}

.sprite-2 {
  background-position: 100% 50%;
}

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

.agent-card {
  min-height: 360px;
  padding: 15px;
}

.agent-card:hover,
.mini-agent:hover,
.compact-agent:hover,
.simple-knowledge-card:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
}

.agent-name-row h3,
.mini-agent h3,
.asset-card h3,
.knowledge-head h3 {
  font-size: 17px;
}

.agent-summary,
.agent-reason,
.asset-card p,
.knowledge-head p {
  font-size: 13px;
}

.agent-detail-page .agent-detail-card {
  max-width: 680px;
}

.detail-agent-head .agent-portrait {
  width: 104px;
  height: 104px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

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

.simple-knowledge-card {
  position: relative;
  width: 100%;
  min-height: 112px;
  color: inherit;
  text-align: left;
  box-shadow: none;
}

.simple-knowledge-card .knowledge-head {
  padding-right: 20px;
}

.card-arrow {
  position: absolute;
  right: 15px;
  top: 50%;
  color: #9ca3af;
  font-size: 24px;
  transform: translateY(-50%);
}

.knowledge-detail-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.knowledge-detail-meta span {
  padding: 6px 9px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.knowledge-file-card {
  min-height: 82px;
}

.compact-agent {
  width: 100%;
  color: inherit;
  text-align: left;
}

.mini-agent .agent-portrait {
  width: 58px;
  height: 58px;
}

@media (max-width: 1100px) {
  .agent-grid,
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
  }

  .sidebar {
    padding: 8px 4px;
  }

  .sidebar-brand {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 7px;
  }

  .side-nav button {
    min-height: 32px;
    padding: 0 7px;
    font-size: 12px;
  }

  .asset-grid,
  .agent-grid,
  .library-grid {
    grid-template-columns: 1fr;
  }

  .dialogue-title h1 {
    font-size: 24px;
  }
}

/* Latest layout pass: Google-like controls and full-height sidebar */
:root {
  --google-blue: #1a73e8;
  --google-blue-hover: #1765cc;
  --google-blue-soft: #e8f0fe;
}

.workspace-shell {
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 0;
  height: 100vh;
  padding: 0;
  background: #f5f7fb;
  transition: grid-template-columns 0.18s ease;
}

.workspace-shell.is-sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  height: 100vh;
  padding: 14px 10px;
  background: #ffffff;
  border: 0;
  border-right: 1px solid #e5e7eb;
  border-radius: 0;
  box-shadow: none;
}

.workspace-main {
  padding: 18px;
}

.sidebar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  margin-bottom: 10px;
}

.sidebar-brand {
  min-width: 0;
  min-height: 38px;
  margin: 0;
  padding: 0 4px;
}

.sidebar-brand .brand-logo {
  width: 34px;
  height: 30px;
}

.sidebar-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #5f6368;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: #f1f3f4;
  border-color: #dadce0;
}

.side-nav {
  gap: 1px;
}

.side-nav button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  color: #3c4043;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.side-nav button::before {
  content: attr(data-icon);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: #5f6368;
  font-size: 12px;
  font-weight: 800;
}

.side-nav button.active,
.side-nav button:hover {
  color: #174ea6;
  background: var(--google-blue-soft);
}

.side-nav button.active::before,
.side-nav button:hover::before {
  color: #174ea6;
}

.sidebar-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  margin: auto 0 0;
  padding: 8px;
  color: inherit;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.sidebar-user:hover,
.sidebar-user.active {
  background: var(--google-blue-soft);
  border-color: #d2e3fc;
}

.workspace-shell.is-sidebar-collapsed .sidebar {
  padding: 14px 8px;
}

.workspace-shell.is-sidebar-collapsed .sidebar-head {
  grid-template-columns: 1fr;
}

.workspace-shell.is-sidebar-collapsed .brand-copy,
.workspace-shell.is-sidebar-collapsed .nav-label,
.workspace-shell.is-sidebar-collapsed .sidebar-user div {
  display: none;
}

.workspace-shell.is-sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 0;
}

.workspace-shell.is-sidebar-collapsed .sidebar-toggle {
  justify-self: center;
}

.workspace-shell.is-sidebar-collapsed .side-nav button {
  justify-content: center;
  width: 42px;
  min-height: 36px;
  margin: 0 auto;
  padding: 0;
}

.workspace-shell.is-sidebar-collapsed .side-nav button::before {
  width: 22px;
  height: 22px;
}

.workspace-shell.is-sidebar-collapsed .sidebar-user {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  width: 42px;
  margin: auto auto 0;
  padding: 7px;
}

.primary-button,
.secondary-button,
.outline-button,
.ghost-button,
.send-button,
.logout-button {
  border-radius: 999px;
  box-shadow: none;
  font-weight: 700;
}

.primary-button,
.send-button {
  color: #ffffff;
  background: var(--google-blue);
  border-color: var(--google-blue);
}

.primary-button:hover,
.send-button:hover {
  background: var(--google-blue-hover);
  border-color: var(--google-blue-hover);
}

.secondary-button,
.outline-button {
  color: #1a73e8;
  background: #ffffff;
  border-color: #dadce0;
}

.secondary-button:hover,
.outline-button:hover {
  background: #f8fbff;
  border-color: #c2dbff;
}

.workspace-page.home-page {
  min-height: calc(100vh - 36px);
}

.workspace-page.home-page.is-active {
  display: grid;
  place-items: center;
}

.dialogue-box {
  width: min(760px, 100%);
  padding: 0 0 36px;
}

.dialogue-title {
  width: min(720px, 100%);
  margin: 0 auto 26px;
  text-align: center;
}

.dialogue-title h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.28;
}

.dialogue-title p {
  max-width: 680px;
  margin: 0 auto;
  color: #5f6368;
  font-size: 15px;
  line-height: 1.7;
}

.search-composer {
  width: min(760px, 100%);
  min-height: 166px;
  padding: 22px 22px 16px;
  border-color: #dadce0;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(60, 64, 67, 0.08);
}

.search-composer textarea {
  min-height: 78px;
  font-size: 17px;
}

.search-composer:focus-within {
  border-color: #c9d7f8;
  box-shadow: 0 16px 36px rgba(60, 64, 67, 0.1);
}

.quick-chips button,
.filter-tabs button,
.payment-methods button {
  border-radius: 999px;
  font-weight: 700;
}

.order-table-wrap {
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.order-table th,
.order-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid #edf0f2;
  vertical-align: middle;
  font-size: 14px;
}

.order-table th {
  color: #5f6368;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 800;
}

.order-table tr:last-child td {
  border-bottom: 0;
}

.order-table td > span {
  display: block;
  margin-top: 4px;
  color: #5f6368;
  font-size: 13px;
  line-height: 1.45;
}

.order-table .primary-button {
  min-height: 36px;
  padding: 0 14px;
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 150px minmax(0, 1fr);
  }

  .workspace-shell.is-sidebar-collapsed {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .workspace-main {
    padding: 10px;
  }

  .side-nav button {
    min-height: 31px;
    font-size: 12px;
  }

  .dialogue-title h1 {
    font-size: 24px;
  }

  .dialogue-title p {
    font-size: 13px;
  }
}

/* Client-requested compact pass */
:root {
  --google-blue: #3f6fb6;
  --google-blue-hover: #335f9d;
  --google-blue-soft: #eef3fa;
}

textarea,
input,
select {
  font-size: 14px;
}

.composer label,
.field-group label,
.field-group legend {
  font-size: 13px;
}

.primary-button,
.secondary-button,
.outline-button,
.ghost-button,
.logout-button {
  min-height: 38px;
  padding-inline: 14px;
  font-size: 13px;
}

.quick-chips button,
.filter-tabs button,
.payment-methods button {
  min-height: 28px;
  padding: 0 10px;
  color: #4f6689;
  background: #f4f7fb;
  border-color: #d8e0ea;
  font-size: 12.5px;
}

.quick-chips button:hover,
.filter-tabs button.active,
.filter-tabs button:hover,
.payment-methods button.active,
.payment-methods button:hover {
  color: #26364c;
  background: #e9eef6;
  border-color: #c8d3e2;
}

.workspace-shell {
  grid-template-columns: 174px minmax(0, 1fr);
}

.workspace-shell.is-sidebar-collapsed {
  grid-template-columns: 132px minmax(0, 1fr);
}

.sidebar {
  padding: 12px 8px;
}

.sidebar-head {
  min-height: 36px;
  margin-bottom: 6px;
}

.sidebar-brand {
  min-height: 34px;
}

.sidebar-brand .brand-logo {
  width: 30px;
  height: 27px;
}

.sidebar-brand .brand-title {
  font-size: 14px;
}

.sidebar-brand .brand-subtitle {
  font-size: 9.5px;
}

.sidebar-toggle {
  width: 28px;
  height: 28px;
}

.side-nav {
  display: grid;
  flex: 0 0 auto;
  gap: 0;
  align-content: start;
  padding: 4px 0;
}

.side-nav button {
  gap: 0;
  min-height: 0;
  padding: 5px 10px;
  color: #3f4856;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.5;
}

.side-nav button::before {
  content: none;
  display: none;
}

.side-nav button.active,
.side-nav button:hover {
  color: #26364c;
  background: #edf2f7;
}

.workspace-shell.is-sidebar-collapsed .side-nav button {
  justify-content: flex-start;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 5px 10px;
}

.workspace-shell.is-sidebar-collapsed .nav-label {
  display: inline;
}

.workspace-shell.is-sidebar-collapsed .sidebar-user {
  width: 100%;
}

.workspace-page.home-page.is-active {
  align-content: center;
  justify-content: center;
  place-items: center;
}

.dialogue-box {
  padding: 0;
  transform: translateY(24px);
}

.dialogue-title {
  margin-bottom: 22px;
}

.dialogue-title h1 {
  font-size: 29px;
}

.dialogue-title p {
  font-size: 14px;
  line-height: 1.65;
}

.search-composer {
  min-height: 148px;
  padding: 20px 20px 14px;
  border-color: #d8dee8;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.search-composer textarea {
  min-height: 68px;
  font-size: 15px;
}

.search-composer textarea,
.search-composer textarea:focus,
.search-composer textarea:focus-visible {
  caret-color: var(--google-blue);
}

.composer-toolbar {
  gap: 12px;
  margin-top: 10px;
}

.send-button {
  width: auto;
  min-width: 92px;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  background: var(--google-blue);
  border-color: var(--google-blue);
  font-size: 13px;
  line-height: 1;
}

.send-button:hover {
  background: var(--google-blue-hover);
  border-color: var(--google-blue-hover);
}

.toast {
  top: 16px;
  right: auto;
  bottom: auto;
  left: 50%;
  display: flex;
  align-items: center;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 42px;
  padding: 10px 14px;
  color: #344054;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #d0d5dd;
  border-left: 3px solid #8ea5c9;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
  font-size: 13px;
  font-weight: 650;
  transform: translate(-50%, -18px);
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  animation: toast-slide-down 0.22s ease-out both;
}

@keyframes toast-slide-down {
  from {
    opacity: 0;
    transform: translate(-50%, -18px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 138px minmax(0, 1fr);
  }

  .workspace-shell.is-sidebar-collapsed {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .side-nav button {
    min-height: 0;
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.5;
  }

  .dialogue-box {
    transform: translateY(8px);
  }

  .dialogue-title h1 {
    font-size: 23px;
  }

  .search-composer {
    padding: 16px 14px 12px;
  }
}

/* Sidebar menu visual pass inspired by modern task apps */
.workspace-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.workspace-shell.is-sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 12px;
}

.side-nav {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  align-content: initial;
  padding: 8px 0;
}

.nav-section-title {
  margin: 14px 10px 6px;
  color: #8a95aa;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.nav-section-title:first-child {
  margin-top: 2px;
}

.side-nav button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 8px 12px;
  color: #4d5870;
  background: transparent;
  border: 0;
  border-radius: 22px;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.5;
  text-align: left;
}

.side-nav button::before {
  content: none;
  display: none;
}

.side-nav button.active,
.side-nav button:hover {
  color: #396ff1;
  background: #edf3ff;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #586176;
  background: #f6f8fc;
  border-radius: 15px;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-nav button.active .nav-icon,
.side-nav button:hover .nav-icon {
  color: #396ff1;
  background: rgba(255, 255, 255, 0.72);
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  color: #396ff1;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.workspace-shell.is-sidebar-collapsed .sidebar {
  padding: 18px 10px;
}

.workspace-shell.is-sidebar-collapsed .sidebar-head {
  grid-template-columns: 1fr;
}

.workspace-shell.is-sidebar-collapsed .brand-copy,
.workspace-shell.is-sidebar-collapsed .nav-section-title,
.workspace-shell.is-sidebar-collapsed .nav-label,
.workspace-shell.is-sidebar-collapsed .nav-badge,
.workspace-shell.is-sidebar-collapsed .sidebar-user div {
  display: none;
}

.workspace-shell.is-sidebar-collapsed .side-nav button {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 52px;
  padding: 6px;
  border-radius: 18px;
}

.workspace-shell.is-sidebar-collapsed .nav-icon {
  width: 40px;
  height: 40px;
}

@media (max-width: 820px) {
  .workspace-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  .workspace-shell.is-sidebar-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .sidebar {
    padding: 14px 10px;
  }

  .side-nav {
    gap: 7px;
  }

  .nav-section-title {
    margin: 12px 8px 4px;
    font-size: 12.5px;
  }

  .side-nav button {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 54px;
    padding: 7px 10px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.5;
  }

  .nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .nav-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Anthropomorphic user avatars and lighter sidebar typography */
.cat-avatar {
  --avatar-bg: #edf4ff;
  --avatar-bg-soft: #f8fbff;
  --skin: #efc7aa;
  --hair: #2f3a52;
  --shirt: #6f8ff2;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  width: 44px;
  height: 44px;
  background:
    radial-gradient(circle at 39% 49%, #1f2937 0 3.2%, transparent 3.8%),
    radial-gradient(circle at 61% 49%, #1f2937 0 3.2%, transparent 3.8%),
    radial-gradient(ellipse at 50% 62%, #a45752 0 3.4%, transparent 4.2%),
    radial-gradient(circle at 50% 50%, var(--skin) 0 29%, transparent 30%),
    linear-gradient(180deg, var(--avatar-bg), var(--avatar-bg-soft));
  border: 1px solid rgba(126, 151, 190, 0.26);
  border-radius: 999px;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.82);
}

.cat-avatar::before,
.cat-avatar::after {
  content: "";
  position: absolute;
  border: 0;
  transform: none;
}

.cat-avatar::before {
  top: 15%;
  left: 24%;
  width: 52%;
  height: 24%;
  background: var(--hair);
  border-radius: 54% 46% 42% 38%;
  box-shadow:
    -8px 7px 0 -4px var(--hair),
    8px 7px 0 -4px var(--hair);
}

.cat-avatar::after {
  left: 28%;
  bottom: 8%;
  width: 44%;
  height: 20%;
  background: var(--shirt);
  border-radius: 999px 999px 38% 38%;
  box-shadow: 0 -7px 0 -4px var(--skin);
}

.cat-avatar.small {
  width: 46px;
  height: 46px;
}

.cat-avatar.large {
  width: 76px;
  height: 76px;
}

.cat-avatar.tiny {
  width: 32px;
  height: 32px;
}

.avatar-consultant {
  --avatar-bg: #eaf2ff;
  --avatar-bg-soft: #f8fbff;
  --skin: #efc7aa;
  --hair: #334155;
  --shirt: #6e8ef2;
}

.avatar-analyst {
  --avatar-bg: #eef6ff;
  --avatar-bg-soft: #f7fbff;
  --skin: #f2d0b8;
  --hair: #1f3c6d;
  --shirt: #4f82d9;
}

.avatar-operator {
  --avatar-bg: #eefbf6;
  --avatar-bg-soft: #f8fefb;
  --skin: #e7b995;
  --hair: #27483f;
  --shirt: #45a788;
}

.avatar-planner {
  --avatar-bg: #fff2f5;
  --avatar-bg-soft: #fff9fb;
  --skin: #f0c2b7;
  --hair: #724053;
  --shirt: #d36d8c;
}

.avatar-researcher {
  --avatar-bg: #fff7e8;
  --avatar-bg-soft: #fffdf7;
  --skin: #e8b78d;
  --hair: #5b4636;
  --shirt: #d39a41;
}

.avatar-product {
  --avatar-bg: #f3efff;
  --avatar-bg-soft: #fbf9ff;
  --skin: #e7c1a7;
  --hair: #48336c;
  --shirt: #8a75d6;
}

.avatar-analyst::before {
  border-radius: 44% 56% 35% 48%;
  box-shadow:
    -10px 6px 0 -4px var(--hair),
    5px 9px 0 -5px var(--hair);
}

.avatar-operator::before {
  top: 13%;
  left: 22%;
  width: 56%;
  border-radius: 60% 40% 52% 34%;
}

.avatar-planner::before {
  top: 12%;
  left: 20%;
  width: 58%;
  height: 28%;
  border-radius: 46% 54% 58% 34%;
  box-shadow:
    -6px 9px 0 -3px var(--hair),
    10px 8px 0 -5px var(--hair);
}

.avatar-researcher::before {
  top: 17%;
  left: 28%;
  width: 44%;
  height: 20%;
  border-radius: 999px 999px 40% 40%;
}

.avatar-product::before {
  top: 12%;
  left: 25%;
  width: 54%;
  height: 28%;
  border-radius: 58% 42% 50% 36%;
  box-shadow:
    -7px 8px 0 -3px var(--hair),
    7px 8px 0 -4px var(--hair);
}

.sidebar-user {
  gap: 9px;
  padding: 9px;
  background: #f7f9fc;
  border-color: #dfe6f0;
  border-radius: 16px;
}

.sidebar-user strong {
  margin-bottom: 1px;
  color: #202938;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}

.sidebar-user span {
  color: #697386;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
}

.side-nav button {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

.nav-section-title,
.nav-badge {
  font-weight: 400;
}

@media (max-width: 820px) {
  .side-nav button {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
  }

  .sidebar-user strong {
    font-size: 12.5px;
    font-weight: 400;
  }

  .sidebar-user span {
    font-size: 11.5px;
  }
}

/* User avatars now mirror the agent portrait illustration system */
.cat-avatar {
  --user-avatar-position: 0% 50%;
  --user-avatar-bg: #eef2ff;
  --user-avatar-filter: none;
  position: relative;
  display: block;
  flex: 0 0 auto;
  overflow: hidden;
  width: 48px;
  height: 48px;
  background-color: var(--user-avatar-bg);
  background-image: url("assets/agent-avatar-sprite.png");
  background-repeat: no-repeat;
  background-position: var(--user-avatar-position);
  background-size: 300% 100%;
  border: 1px solid #d8e1ee;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  filter: var(--user-avatar-filter);
}

.cat-avatar::before,
.cat-avatar::after {
  content: none;
}

.cat-avatar.small {
  width: 50px;
  height: 50px;
}

.cat-avatar.large {
  width: 92px;
  height: 92px;
}

.cat-avatar.tiny {
  width: 34px;
  height: 34px;
}

.avatar-consultant {
  --user-avatar-position: 0% 50%;
  --user-avatar-bg: #eef4ff;
}

.avatar-analyst {
  --user-avatar-position: 50% 50%;
  --user-avatar-bg: #eef6ff;
}

.avatar-operator {
  --user-avatar-position: 100% 50%;
  --user-avatar-bg: #effaf6;
}

.avatar-planner {
  --user-avatar-position: 0% 50%;
  --user-avatar-bg: #fff1f5;
  --user-avatar-filter: hue-rotate(318deg) saturate(0.95);
}

.avatar-researcher {
  --user-avatar-position: 50% 50%;
  --user-avatar-bg: #fff7e8;
  --user-avatar-filter: hue-rotate(24deg) saturate(0.9);
}

.avatar-product {
  --user-avatar-position: 100% 50%;
  --user-avatar-bg: #f3efff;
  --user-avatar-filter: hue-rotate(46deg) saturate(0.92);
}

.cat-avatar.initials-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-image: none;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  filter: none;
}

.cat-avatar.initials-avatar.small {
  font-size: 16px;
}

.cat-avatar.initials-avatar.large {
  font-size: 28px;
}

.payment-qr-panel {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-qr-panel img {
  width: 220px;
  height: 220px;
  object-fit: contain;
}

.payment-qr-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.connected-agent-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.connected-agent-copy {
  min-width: 0;
}

.connected-agent-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.connected-agent-actions .secondary-button,
.connected-agent-actions .outline-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 400;
}

.outline-button.danger {
  color: #a14b4b;
  background: #fff7f7;
  border-color: #ead0d0;
}

.outline-button.danger:hover {
  color: #7f2f2f;
  background: #fff0f0;
  border-color: #ddb8b8;
}

@media (max-width: 820px) {
  .connected-agent-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .connected-agent-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 0;
  }
}

.agent-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  min-height: 22px;
  padding: 0 7px 0 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.agent-source-badge.official {
  color: #0f5f87;
  background: linear-gradient(135deg, #eef9ff, #e9fbf6);
  border-color: rgba(20, 184, 166, 0.32);
}

.agent-source-badge.developer {
  color: #6d3fc8;
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
  border-color: rgba(124, 58, 237, 0.26);
}

.agent-source-icon {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
}

.agent-source-badge span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.agent-source-badge.official .agent-source-icon {
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  clip-path: polygon(50% 0, 91% 17%, 83% 68%, 50% 100%, 17% 68%, 9% 17%);
}

.agent-source-badge.official .agent-source-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 4px;
  height: 7px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.agent-source-badge.developer .agent-source-icon {
  background: #ffffff;
  border: 1.5px solid #7c3aed;
  border-radius: 4px;
}

.agent-source-badge.developer .agent-source-icon::before,
.agent-source-badge.developer .agent-source-icon::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 4px;
  height: 4px;
  border-color: #7c3aed;
  border-style: solid;
}

.agent-source-badge.developer .agent-source-icon::before {
  left: 2px;
  border-width: 0 0 1.5px 1.5px;
  transform: rotate(45deg);
}

.agent-source-badge.developer .agent-source-icon::after {
  right: 2px;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}

.mini-agent-title,
.compact-agent-name,
.detail-agent-source {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.mini-agent-title h3,
.compact-agent-name h3 {
  margin-bottom: 0;
}

.detail-agent-source {
  margin-top: 8px;
}
