:root {
  color-scheme: light;
  --ink: #2f2f2f;
  --muted: #666666;
  --quiet: #8a8a8a;
  --disabled: #b4b4b4;
  --paper: #ffffff;
  --sidebar: #f9f9f9;
  --panel: #ffffff;
  --elevated: #f7f7f8;
  --hover: #ececec;
  --selected: #e8e8e8;
  --line: #e5e5e5;
  --accent: #2f2f2f;
  --accent-hover: #444444;
  --green: #1f6f5c;
  --green-soft: #eef6f3;
  --placeholder: #9b9b9b;
  --soft-accent: #f7f7f8;
  --amber: #e2a000;
  --red: #d00e17;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.035);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body:not([data-auth-checked="yes"]) .app-shell {
  visibility: hidden;
}
a { color: inherit; }
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  background: var(--paper);
}
body[data-auth-gate] .app-shell {
  grid-template-columns: minmax(0, 1fr);
}
body[data-auth-gate] .sidebar,
body[data-auth-gate] .context-panel,
body[data-auth-gate] .context-scrim {
  display: none;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 6;
  height: 100vh;
  padding: 16px 12px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  overflow-y: auto;
}
.brand h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.15;
  letter-spacing: 0;
}
.brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 500;
}
.role-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}
.role-pill {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-weight: 500;
}
.role-pill[aria-pressed="true"] {
  color: var(--ink);
  border-color: #d3d3d3;
  background: var(--selected);
}
.nav {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}
.nav-caption,
.nav-section-label {
  margin: 16px 8px 6px;
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 500;
}
.nav-role-group,
.nav-bottom {
  display: grid;
  gap: 2px;
}
body[data-role="buyer"] [data-role-group="supplier_factory"],
body[data-role="supplier_factory"] [data-role-group="buyer"],
body[data-role="buyer"] [data-role-panel="supplier_factory"],
body[data-role="supplier_factory"] [data-role-panel="buyer"],
body[data-role="buyer"] [data-role-message="supplier_factory"],
body[data-role="supplier_factory"] [data-role-message="buyer"],
body[data-role="buyer"] [data-role-action="supplier_factory"],
body[data-role="supplier_factory"] [data-role-action="buyer"],
body[data-role="buyer"] [data-role-cta="supplier_factory"],
body[data-role="supplier_factory"] [data-role-cta="buyer"] {
  display: none;
}
.advanced-nav {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.advanced-nav summary {
  cursor: pointer;
  padding: 8px 10px;
  color: var(--muted);
  font-weight: 500;
}
.content-more {
  grid-column: 1 / -1;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.content-more summary {
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--elevated);
}
.nav a {
  display: block;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}
.nav a[aria-current="page"],
.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
  background: var(--hover);
  outline: none;
}
.nav-intent {
  display: block;
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 520;
}
.main {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px clamp(18px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
}
.topbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}
.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 75ch;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.auth-controls {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.account-chip {
  display: inline-grid;
  gap: 2px;
  min-height: 38px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.account-chip strong,
.account-chip small {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-chip small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}
.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.84rem;
  font-weight: 500;
}
.language-switcher select {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.mobile-menu {
  display: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.button:hover,
.button:focus-visible {
  background: var(--hover);
  outline: none;
}
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.button.primary:hover,
.button.primary:focus-visible {
  background: var(--accent-hover);
}
.button[aria-disabled="true"] {
  color: var(--red);
  border-color: #f1c3c5;
  background: #fff7f7;
  pointer-events: none;
}
.image-upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
}
.image-upload-button:hover,
.image-upload-button:focus-within {
  background: var(--hover);
}
.image-upload-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}
.image-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.image-upload-status {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}
.content {
  width: min(980px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 128px;
}
[data-canonical-workspace] { min-width: 0; padding-bottom: 24px; }
[data-canonical-workspace] h2 { font-size: 22px; }
[data-canonical-workspace] h3 { font-size: 18px; overflow-wrap: anywhere; }
[data-canonical-workspace] form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
[data-canonical-workspace] label { display: grid; gap: 6px; min-width: 0; }
[data-canonical-workspace] input:not([type=checkbox]),
[data-canonical-workspace] select,
[data-canonical-workspace] textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
[data-canonical-workspace] textarea { min-height: 90px; resize: vertical; }
[data-canonical-workspace] label:has([type=checkbox]) { display: flex; align-items: center; grid-column: 1 / -1; }
[data-canonical-workspace] form button { min-height: 44px; justify-self: start; }
[data-canonical-workspace] article { padding: 16px 0; border-top: 1px solid var(--line); }
[data-canonical-workspace] dl { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 8px 16px; }
[data-canonical-workspace] dt { color: var(--muted); }
[data-canonical-workspace] dd { margin: 0; overflow-wrap: anywhere; }
[data-canonical-workspace] [data-status]:empty { display: none; }
.role-home {
  display: grid;
  gap: 44px;
  max-width: 820px;
  padding: clamp(34px, 9vh, 96px) 0 72px;
}
.role-home-intro { max-width: 720px; }
.role-home h2 { margin: 8px 0 24px; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; letter-spacing: -0.02em; }
.home-kicker { margin: 0; color: var(--muted); font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; }
.role-home-composer { margin: 0; }
.role-home-composer textarea { min-height: 92px; padding: 16px; border-radius: 14px; background: var(--paper); box-shadow: 0 8px 28px rgba(28, 32, 34, 0.06); resize: vertical; }
.role-home-composer-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.role-home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.role-home-actions .button { min-height: 38px; border-color: transparent; background: var(--hover); }
.role-home-priority { min-width: 0; }
.role-home-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.role-home-heading span { color: var(--muted); font-size: 0.86rem; }
.role-home-item { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.role-home-item:hover strong { color: var(--green); }
.role-home-item strong { font-weight: 600; }
.role-home-item span { color: var(--muted); font-size: 0.9rem; text-align: right; }
.secondary-page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.secondary-page-heading h2 { margin: 6px 0 0; }
.task-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.task-row h3 { margin: 0 0 6px; }
.task-row p { margin: 0; color: var(--muted); }
.task-empty { padding: 32px 0; color: var(--muted); }
.task-editor-actions { display: flex; gap: 8px; grid-column: 1 / -1; }
.app-shell.chat-shell { grid-template-columns: 48px 286px minmax(0, 1fr); }
.chat-shell .icon-rail { display: flex; position: sticky; top: 0; z-index: 8; height: 100vh; flex-direction: column; align-items: center; gap: 8px; padding: 12px 7px; border-right: 1px solid var(--line); background: var(--sidebar); }
.icon-rail-button, .icon-rail-avatar { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); text-decoration: none; font: inherit; font-size: 20px; }
.icon-rail-button:hover, .icon-rail-button:focus-visible, .icon-rail-avatar:hover, .icon-rail-avatar:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.icon-rail-avatar { margin-top: auto; border: 1px solid var(--line); border-radius: 50%; font-size: 11px; font-weight: 600; }
.icon-rail-spacer { flex: 1; }
.chat-shell .chat-sidebar { min-width: 0; padding: 18px 14px; background: var(--sidebar); }
.chat-brand { display: grid; gap: 2px; padding: 1px 8px 20px; }
.chat-brand strong { font-size: 18px; letter-spacing: 0; }
.chat-brand span { color: var(--muted); font-size: 12px; }
.chat-new-button, .chat-search-button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; text-align: left; }
.chat-new-button { border-color: var(--line); background: var(--panel); }
.chat-new-button:hover, .chat-search-button:hover, .chat-new-button:focus-visible, .chat-search-button:focus-visible { background: var(--hover); outline: none; }
.chat-search-button { margin-top: 4px; color: var(--muted); }
.chat-search-wrap { display: grid; gap: 4px; }
.chat-search-wrap input { width: 100%; min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.82rem; }
.chat-search-wrap input:focus { border-color: var(--muted); outline: 2px solid color-mix(in srgb, var(--muted) 20%, transparent); outline-offset: 1px; }
.chat-sidebar-section { display: grid; gap: 4px; margin-top: 28px; }
.chat-sidebar-section p { margin: 0 8px 3px; color: var(--quiet); font-size: 0.76rem; }
.chat-sidebar-section a, .chat-sidebar-section > span { display: block; padding: 7px 8px; border-radius: 7px; color: var(--muted); font-size: 0.88rem; text-decoration: none; }
.chat-sidebar-section a:hover, .chat-sidebar-section a:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.chat-sidebar-recent > span { color: var(--quiet); }
.chat-shell .chat-topbar { position: relative; display: flex; min-height: 66px; align-items: center; justify-content: flex-end; padding: 12px 26px; }
.chat-shell .chat-topbar-title { position: absolute; left: 22px; visibility: hidden; }
.chat-mode-switch { position: absolute; left: 50%; display: flex; transform: translateX(-50%); padding: 3px; border-radius: 999px; background: var(--elevated); }
.chat-mode-switch a { padding: 5px 18px; border-radius: 999px; color: var(--muted); font-size: 0.86rem; text-decoration: none; }
.chat-mode-switch a:hover, .chat-mode-switch a:focus-visible { color: var(--ink); outline: none; }
.chat-mode-switch .chat-mode-active { background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,0.08); color: var(--ink); }
.chat-shell .content { display: flex; width: 100%; max-width: none; min-height: calc(100vh - 66px); margin: 0; padding: 0 24px; }
.chat-shell .role-home { display: flex; width: 100%; max-width: none; min-height: calc(100vh - 66px); align-items: center; justify-content: center; padding: 0 0 8vh; }
.role-home-stage { display: grid; width: min(760px, 100%); gap: 22px; }
.role-home-intro { width: 100%; max-width: none; text-align: center; }
.role-home h2 { margin: 6px 0 22px; color: var(--ink); font-size: 30px; font-weight: 450; line-height: 1.2; letter-spacing: 0; }
.role-home .home-kicker { color: var(--muted); font-size: 0.84rem; }
.chat-composer { display: flex; width: 100%; min-height: 62px; align-items: center; padding: 7px 8px 7px 12px; border: 1px solid var(--line); border-radius: 31px; background: var(--paper); box-shadow: 0 8px 26px rgba(28, 32, 34, 0.055); }
.chat-composer-row { display: flex; width: 100%; min-width: 0; align-items: center; gap: 8px; }
.chat-composer textarea { flex: 1; width: auto; min-height: 42px; max-height: 120px; padding: 9px 4px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; line-height: 1.45; }
.chat-composer textarea::placeholder { color: var(--quiet); }
.chat-composer-tools { display: flex; align-items: center; gap: 3px; }
.chat-composer-tools select { max-width: 104px; padding: 6px 4px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.8rem; }
.chat-icon-button { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: inherit; font-size: 21px; }
.chat-icon-button:hover, .chat-icon-button:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.chat-icon-button:disabled { cursor: not-allowed; opacity: 0.42; }
.chat-send { display: grid; flex: 0 0 auto; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; font: inherit; font-size: 20px; line-height: 1; }
.chat-send:hover, .chat-send:focus-visible { background: var(--accent-hover); outline: none; }
.chat-attachment-status { display: none; }
.role-home-actions { justify-content: center; gap: 8px; margin-top: 1px; }
.chat-suggestion { padding: 5px 9px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 0.86rem; text-decoration: none; }
.chat-suggestion:hover, .chat-suggestion:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.role-home-priority { width: 100%; margin-top: 4px; }
.role-home-heading { justify-content: center; margin-bottom: 3px; }
.role-home-heading .home-kicker { font-size: 0.76rem; }
.role-home-heading span { font-size: 0.76rem; }
.role-home-item { justify-content: center; gap: 8px; padding: 7px 0; border: 0; font-size: 0.84rem; }
.role-home-item strong { font-weight: 500; }
.role-home-item span { color: var(--quiet); font-size: 0.82rem; text-align: left; }
.role-home-item:hover strong { color: var(--ink); }
.public-auth-content {
  min-height: calc(100vh - 140px);
  display: grid;
  align-items: center;
}
.public-auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: start;
}
.public-auth-card h2 {
  margin: 0;
  max-width: 11ch;
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: 0;
}
.public-auth-card p {
  max-width: 62ch;
  color: var(--muted);
}
.public-auth-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.auth-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.auth-tabs button,
.auth-card button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}
.auth-tabs button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--selected);
}
.auth-card form {
  display: grid;
  gap: 10px;
}
.auth-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}
.auth-card input,
.auth-card select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  padding: 0 10px;
}
.auth-card fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.auth-card fieldset label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
}
.auth-card fieldset input {
  width: auto;
  min-height: 0;
}
.form-message {
  min-height: 20px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.form-message.error {
  color: var(--red);
}
.role-panel {
  margin-bottom: 22px;
  padding: 12px 0 18px;
  border-bottom: 1px solid var(--line);
}
.role-panel h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.02;
  letter-spacing: 0;
}
.role-panel p {
  max-width: 68ch;
  margin: 12px 0 0;
  color: var(--muted);
}
.role-panel .quick-actions {
  margin-top: 16px;
}
.ai-thread {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}
.message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--ink);
  font-weight: 500;
}
.message-body {
  padding: 2px 0 0;
}
.message-body p {
  margin: 0;
}
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.artifact-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}
.artifact-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-align: left;
  font: inherit;
}
.artifact-card:hover,
.artifact-card:focus-visible {
  border-color: #d3d3d3;
  background: var(--selected);
  outline: none;
}
.artifact-card span {
  display: block;
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 500;
}
.artifact-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.artifact-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}
.composer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  width: min(980px, calc(100% - 36px));
  margin: 0 auto 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}
.composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  resize: vertical;
  border: 0;
  outline: none;
  color: var(--ink);
  background: transparent;
  font: inherit;
}
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}
.send-button {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}
.send-button:hover,
.send-button:focus-visible {
  background: var(--accent-hover);
}
.context-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 8;
  height: 100vh;
  width: min(380px, 100vw);
  padding: 16px;
  border-left: 1px solid var(--line);
  background: var(--sidebar);
  box-shadow: var(--shadow);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 180ms ease;
}
body.context-open .context-panel {
  transform: translateX(0);
}
.context-scrim {
  position: fixed;
  inset: 0;
  z-index: 7;
  border: 0;
  background: rgba(13, 13, 13, 0.14);
  opacity: 0;
  pointer-events: none;
}
body.context-open .context-scrim {
  opacity: 1;
  pointer-events: auto;
}
.context-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.context-panel h2 {
  margin: 0;
  font-size: 1rem;
}
.context-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}
.context-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.context-item {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  text-align: left;
  font: inherit;
}
.context-item:hover,
.context-item:focus-visible {
  border-color: #d3d3d3;
  background: var(--selected);
  outline: none;
}
.context-item span {
  display: block;
  color: var(--quiet);
  font-size: 0.78rem;
  font-weight: 500;
}
.context-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.metric,
.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.metric {
  min-height: 0;
  padding: 8px 10px;
  border-radius: 999px;
}
.metric span,
.field span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.metric strong,
.field strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.section {
  padding: 16px;
}
.section.wide {
  grid-column: 1 / -1;
}
.section h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.25;
}
.customer-home {
  display: grid;
  gap: 26px;
  padding: clamp(28px, 7vw, 76px) 0 36px;
}
.home-panel {
  display: grid;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto;
}
.home-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}
.home-panel h2 {
  margin: 0;
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: 0;
}
.home-composer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.home-composer textarea {
  width: 100%;
  min-height: 118px;
  resize: vertical;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.home-composer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-actions,
.home-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-examples {
  color: var(--muted);
}
.home-example {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--elevated);
  color: var(--muted);
  font-size: 0.9rem;
}
.home-context {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}
.home-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.home-note {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--elevated);
}
.home-note span {
  display: block;
  color: var(--quiet);
  font-size: 0.8rem;
  font-weight: 500;
}
.home-note strong {
  display: block;
  margin-top: 4px;
}
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--elevated);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.badge.ready { color: var(--ink); border-color: #d3d3d3; background: var(--selected); }
.badge.pending { color: #7a5700; border-color: #f0d98c; background: #fff8df; }
.badge.locked { color: var(--red); border-color: #f1c3c5; background: #fff7f7; }
.badge.info { color: #323232; border-color: var(--line); background: var(--elevated); }
.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.list li {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.table-wrap {
  overflow-x: auto;
}
.subheading {
  margin: 16px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}
table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}
th,
td {
  border-top: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.chat-shell { grid-template-columns: 1fr; }
  .chat-shell .icon-rail { display: none; }
  .chat-shell .chat-sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 88vw); transform: translateX(-100%); }
  body.nav-open .chat-shell .chat-sidebar { transform: translateX(0); }
  .chat-shell .chat-main { min-width: 0; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    border-bottom: 0;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open .context-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar,
  .public-auth-card,
  .section-grid {
    grid-template-columns: 1fr;
  }
  .actions { justify-content: flex-start; }
  .mobile-menu { display: inline-flex; }
  .artifact-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar { position: relative; }
  [data-canonical-workspace] form { grid-template-columns: minmax(0, 1fr); }
  .role-home { padding-top: 38px; }
  .chat-shell .chat-topbar { padding-inline: 12px; }
  .chat-mode-switch { left: 50%; }
  .chat-shell .content { padding-inline: 12px; }
  .chat-shell .role-home { padding-bottom: 4vh; }
  .role-home h2 { font-size: 28px; }
  .chat-composer { min-height: 58px; border-radius: 29px; }
  .chat-composer-tools select { max-width: 72px; }
  .chat-composer-tools .chat-icon-button:first-of-type { display: none; }
  .role-home-actions { gap: 2px; }
  .role-home-item { align-items: flex-start; flex-direction: column; gap: 6px; }
  .role-home-item span { text-align: left; }
  .content { width: min(100% - 24px, 1240px); }
  .fields,
  .home-context-grid,
  .nav,
  .role-switcher { grid-template-columns: 1fr; }
  .button { width: 100%; }
  .image-upload-button { width: 100%; }
  .message { grid-template-columns: 1fr; }
  .artifact-rail { grid-template-columns: 1fr; }
  .composer {
    position: fixed;
    left: 10px;
    right: 10px;
    width: auto;
    margin: 0 0 10px;
  }
  .composer-row { display: grid; }
}

/* Public conversation and auth share the existing workspace tokens. */
[hidden] { display: none !important; }
body[data-authenticated="yes"] .content > .customer-home { display: none; }
body[data-simple-home="true"] .composer { display: none; }
.context-panel { display: none; transform: none; }
body.context-open .context-panel { display: block; }
[data-canonical-workspace] .fields > * { min-width: 0; overflow-wrap: anywhere; }
h1, h2, h3, h4, strong { font-weight: 600; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.65; }
input::placeholder, textarea::placeholder { color: var(--placeholder); opacity: 1; }
:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.button, .role-pill, .image-upload-button { font-weight: 500; }
.nav a, .language-switcher, .language-switcher select { font-weight: 500; }
.nav-caption, .nav-section-label, .advanced-nav summary { font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
body[data-auth-gate] .main { display: block; }
.public-topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 22px 40px;
  gap: 20px;
  border-bottom: 0;
  background: var(--paper);
}
.public-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.public-brand strong { font-size: 24px; font-weight: 600; }
.public-brand span { color: var(--muted); font-size: 13px; }
.public-topbar .actions { align-items: center; gap: 10px; }
.public-link { padding: 10px; text-decoration: none; color: var(--muted); font-size: 14px; }
.public-topbar .button { min-height: 40px; border-radius: 12px; padding-inline: 18px; }
.public-topbar .language-switcher { order: -1; border: 0; padding: 0 8px; font-weight: 400; }
.public-topbar .language-switcher span { display: none; }
.public-home { width: min(100% - 64px, 1520px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 58fr) minmax(460px, 42fr); column-gap: clamp(48px, 7vw, 118px); align-items: center; padding: 58px 0 28px; }
.public-product { padding: 24px 0 18px; }
.public-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; padding: 8px 14px; color: #666; background: #f1f6f3; border-radius: 16px; font-size: 14px; }
.public-eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: #2f6f61; }
.public-product h1 { max-width: 710px; margin: 0; color: #343434; font-size: clamp(52px, 5.15vw, 78px); line-height: 1.04; font-weight: 500; letter-spacing: 0; text-wrap: balance; }
.public-product h1 span, .public-product h1 em { display: block; font-style: normal; }
.public-product h1 em { color: #2f6f61; }
.public-subtitle { max-width: 680px; margin: 24px 0 34px; color: #4a4a4a; font-size: 19px; line-height: 1.52; text-wrap: pretty; }
.public-features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; max-width: 760px; }
.public-feature { display: grid; justify-items: start; gap: 7px; min-width: 0; padding: 0; border: 0; background: transparent; color: #343434; text-align: left; font: inherit; }
.public-feature i { display: inline-grid; place-items: center; width: 58px; height: 58px; margin-bottom: 3px; border-radius: 15px; font-style: normal; }
.public-feature svg { width: 28px; height: 28px; }
.feature-green i { color: #237664; background: #eaf4f0; }.feature-amber i { color: #ae7715; background: #fff5df; }.feature-blue i { color: #3677d7; background: #eaf2ff; }.feature-violet i { color: #7168df; background: #f0efff; }
.public-feature strong { font-size: 16px; font-weight: 500; line-height: 1.25; }.public-feature span { color: #8a8a8a; font-size: 14px; line-height: 1.35; }
.public-auth-slot { width: 100%; max-width: 556px; justify-self: end; }
.home-auth-card { padding: 36px 42px; border: 1px solid #e7e7e7; border-radius: 24px; background: #fff; box-shadow: 0 12px 32px rgba(42, 42, 42, 0.05); }
.home-auth-card .auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; margin: 0 0 36px; border-radius: 0; border-bottom: 1px solid #e7e7e7; background: transparent; }
.home-auth-card .auth-tabs button { min-height: 46px; border-radius: 0; box-shadow: none; color: #8a8a8a; }.home-auth-card .auth-tabs button[aria-pressed="true"] { color: #343434; border-bottom: 2px solid #343434; background: transparent; box-shadow: none; }
.home-auth-card h2 { margin: 0; color: #343434; font-size: 28px; line-height: 1.25; font-weight: 500; }.home-auth-card form > p { color: #666; }
.home-auth-card .auth-footnote { color: #666; }.home-auth-card .text-button { color: #2f6f61; }
.public-visual { grid-column: 1; display: flex; align-items: end; gap: 20px; min-height: 242px; padding-top: 6px; overflow: hidden; }
.public-visual img { display: block; width: min(72%, 470px); max-height: 250px; object-fit: contain; object-position: left bottom; mix-blend-mode: multiply; filter: drop-shadow(0 14px 16px rgba(23, 23, 23, 0.12)); }
.public-visual div { max-width: 190px; padding-bottom: 40px; color: #4a4a4a; }.public-visual strong, .public-visual span { display: block; }.public-visual strong { font-size: 16px; line-height: 1.35; font-weight: 500; }.public-visual span { margin-top: 7px; color: #8a8a8a; font-size: 13px; line-height: 1.45; }
.public-trust { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: end; gap: 28px; padding: 22px 0 6px; color: #777; font-size: 14px; }.public-trust span::before { content: '◌'; margin-right: 8px; color: #2f6f61; }
.public-auth-content { width: min(100% - 32px, 440px); min-height: 0; padding: 42px 0 72px; }
.public-auth-card { display: block; }
.auth-card { padding: 30px; border-radius: 24px; box-shadow: var(--shadow); }
.auth-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--elevated); border-radius: 12px; margin-bottom: 24px; }
.auth-tabs button { border: 0; background: transparent; font-weight: 500; color: var(--muted); }
.auth-tabs button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06); }
.auth-card form { gap: 16px; }
.auth-card h1 { margin: 0; font-size: 26px; line-height: 1.25; text-wrap: balance; }
.auth-card form > p { margin: -6px 0 4px; font-size: 14px; color: var(--muted); }
.auth-card label { font-weight: 400; gap: 8px; }
.auth-card input, .auth-card select { min-height: 50px; border-radius: 12px; padding-inline: 14px; font-size: 16px; }
.auth-card input:focus, .auth-card select:focus { border-color: #b8cdc5; }
.auth-card button.button { min-height: 48px; font-weight: 500; border-radius: 12px; background: var(--accent); color: var(--paper); }
.auth-card .text-button { border: 0; background: transparent; color: var(--green); font-weight: 500; padding: 4px; min-height: 32px; }
.auth-card .auth-footnote { margin: 0; text-align: center; }
.auth-role { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0 !important; padding: 0 !important; }
.auth-role legend { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.auth-role label { padding: 10px; background: var(--elevated); border-radius: 10px; font-size: 13px; }
.auth-role label:has(:checked) { background: var(--green-soft); }
.auth-role input { padding: 0; accent-color: var(--green); }
.auth-options { color: var(--muted); font-size: 13px; }
.auth-options summary { min-height: 32px; cursor: pointer; }
.auth-options label { margin-block: 12px; }
.form-message:empty { display: none; }
.form-message.error { padding: 10px 12px; border-radius: 8px; background: #fff7f7; }
@media (hover: hover) {
  .public-link:hover { color: #343434; }
  .public-feature:hover strong { color: #2f6f61; }
}
@media (max-width: 800px) {
  .public-topbar { padding: 18px 24px; gap: 12px; }
  .public-brand span { display: none; }
  .public-topbar .optional-link { display: none; }
  .public-home { width: calc(100% - 48px); grid-template-columns: 1fr; padding-top: 24px; }
  .public-auth-slot { grid-row: 2; justify-self: stretch; max-width: none; margin-top: 34px; }
  .public-visual { grid-row: 3; min-height: 210px; margin-top: 24px; }.public-trust { grid-row: 4; justify-content: start; }
}
@media (max-width: 540px) {
  .public-topbar { padding: 16px; gap: 12px; }
  .public-topbar .actions { gap: 6px; }
  .public-topbar .public-link { display: none; }
  .public-topbar .button { width: auto; padding-inline: 12px; min-height: 38px; font-size: 13px; }
  .public-brand strong { font-size: 20px; }
  .public-topbar .language-switcher { padding: 0; }
  .public-topbar .language-switcher select { max-width: 90px; font-size: 13px; }
  .public-home { width: calc(100% - 32px); padding-top: 18px; }
  .public-eyebrow { margin-bottom: 20px; font-size: 12px; }.public-product h1 { font-size: 44px; }.public-subtitle { margin: 18px 0 28px; font-size: 16px; }
  .public-features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }.public-feature i { width: 52px; height: 52px; }.public-feature strong { font-size: 15px; }.public-feature span { font-size: 13px; }
  .home-auth-card { padding: 26px 22px; }.home-auth-card .auth-tabs { margin-bottom: 28px; }.home-auth-card h2 { font-size: 25px; }
  .public-visual { min-height: 182px; gap: 6px; }.public-visual img { width: 67%; max-height: 182px; }.public-visual div { padding-bottom: 16px; font-size: 13px; }.public-visual strong { font-size: 14px; }.public-visual span { font-size: 12px; }
  .public-trust { gap: 12px 18px; padding-top: 18px; font-size: 12px; }
  .public-auth-content { padding-top: 24px; }
  .auth-card { padding: 24px; }
  .auth-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
