:root {
  --bg: #f4f6f5;
  --ink: #18201d;
  --muted: #66736d;
  --line: #dbe2de;
  --panel: #ffffff;
  --panel-soft: #f8faf8;
  --green: #2f7d59;
  --green-weak: #dff1e8;
  --blue: #286f9e;
  --yellow: #b7791f;
  --shadow: 0 16px 40px rgba(33, 45, 38, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #e0e5e2;
  background: #fff;
  overflow: hidden;
}

.brand-mark img,
.tenant-logo img { width: 100%; height: 100%; display: block; object-fit: contain; }

.main {
  min-width: 0;
  padding: 24px;
}

.page { display: none; }
.page.active { display: block; }

.page-header,
.chat-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.primary-action,
.primary,
.secondary,
.ghost,
.composer button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.primary-action,
.primary,
.composer button {
  background: var(--green);
  color: #fff;
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.ghost {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--green);
}

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

.home-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.home-header {
  padding: 26px 0 18px;
}

.home-header p:last-child {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.home-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.entry-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.entry-card {
  min-height: 168px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  display: grid;
  align-content: start;
  gap: 8px;
}

.entry-card:hover {
  border-color: var(--green);
  background: #f6fbf8;
}

.entry-card strong,
.entry-card span,
.entry-card b {
  display: block;
}

.entry-card span {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.entry-card b {
  margin-top: 4px;
  color: var(--green);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.wide { grid-column: 1 / -1; }

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tag {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: #e5f0f6;
  font-size: 12px;
  white-space: nowrap;
}

.tag.ok {
  color: var(--green);
  background: var(--green-weak);
}

.tag.danger {
  color: #b42318;
  background: #fff1ef;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.identity-card strong,
.identity-card span { display: block; }
.identity-card span { color: var(--muted); margin-top: 4px; }

.kv-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
}

.kv-list div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.kv-list dt {
  color: var(--muted);
}

.kv-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.code-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 8px;
  background: #111815;
  color: #dbf3e6;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.panel-subtitle { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.key-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; }
.key-layout .field textarea { min-height: 132px; font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.integration-code { margin-top: 16px; padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.integration-code code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.integration-code a { color: var(--green); font-weight: 700; }
.generator-card { padding: 16px; border: 1px solid #b9d6c7; border-radius: 8px; background: #f4faf7; }
.wide-card, .employee-generator { grid-column: 1 / -1; }
.generator-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.generator-head strong, .generator-head span { display: block; }
.generator-head span { margin-top: 5px; color: var(--muted); font-size: 13px; }
.wizard-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.wizard-steps span { padding: 8px; border-radius: 6px; background: #fff; color: var(--muted); font-size: 12px; text-align: center; }
.wizard-steps span.active { background: var(--green); color: #fff; }
.wizard-workspace { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.wizard-workspace .interaction-result { grid-column: 1 / -1; margin-top: 0; }
.saas-host-shell { max-width: 1440px; margin: 0 auto; }
.saas-host-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.saas-host-layout { min-height: calc(100vh - 110px); display: grid; grid-template-columns: 190px 1fr; border: 1px solid var(--line); background: var(--panel); }
.saas-module-nav { padding: 18px; display: grid; align-content: start; gap: 8px; border-right: 1px solid var(--line); }
.saas-module-nav b { margin-bottom: 10px; }
.saas-module-nav span { padding: 10px; border-radius: 6px; color: var(--muted); }
.saas-module-nav span.active { background: var(--green-weak); color: var(--green); font-weight: 700; }
.iframe-stage { padding: 18px; background: #eef2f0; }
.iframe-stage-toolbar, .embedded-chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.iframe-stage-toolbar small, .embedded-chat-head span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.iframe-browser-bar { margin-top: 14px; padding: 10px 12px; border-radius: 8px 8px 0 0; background: #18201d; color: #b9d6c7; font: 12px "SFMono-Regular", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embedded-chat-preview { min-height: 520px; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line); background: #fff; }
.embedded-chat-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.embedded-chat-body { padding: 28px; background: #f2f6f4; }
.embed-prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.embed-prompts button { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.embedded-composer { margin: 12px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.embedded-composer button { padding: 8px 14px; border: 0; border-radius: 8px; background: var(--green); color: #fff; }
.integration-details { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.integration-details p { color: var(--muted); line-height: 1.6; }

.api-contract { margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.api-contract-tabs { display: flex; gap: 4px; padding: 6px; background: var(--panel-soft); border-bottom: 1px solid var(--line); overflow-x: auto; }
.api-contract-tabs button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); white-space: nowrap; }
.api-contract-tabs button.active { background: #fff; color: var(--green); font-weight: 700; box-shadow: 0 3px 10px rgba(33,45,38,.08); }
.api-contract-pane { display: none; padding: 16px; }
.api-contract-pane.active { display: block; }
.api-contract-pane pre, .schema-columns pre, .package-result pre { margin: 0; padding: 14px; border-radius: 8px; background: #111815; color: #dbf3e6; font: 12px/1.6 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.integration-document-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.integration-document-head p { max-width: 760px; margin: 6px 0 0; color: var(--muted); line-height: 1.55; }
.integration-document-head .button-row { flex: 0 0 auto; margin: 0; }
.integration-document-actions { flex: 0 0 auto; display: grid; justify-items: end; gap: 7px; }
.integration-document-actions .interaction-result { min-height: 18px; color: var(--green); font-weight: 700; }
.integration-document-actions .interaction-result.error { color: #b42318; }
.integration-document-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); color: var(--muted); font-size: 12px; }
.integration-document-meta b { color: var(--ink); }
.integration-markdown-view { max-height: 660px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); line-height: 1.72; overflow: auto; }
.integration-markdown-view > :first-child { margin-top: 0; }
.integration-markdown-view > :last-child { margin-bottom: 0; }
.integration-markdown-view h1 { margin: 30px 0 16px; font-size: 24px; line-height: 1.35; }
.integration-markdown-view h2 { margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 19px; line-height: 1.4; }
.integration-markdown-view h3 { margin: 22px 0 10px; font-size: 16px; line-height: 1.45; }
.integration-markdown-view p { margin: 10px 0; }
.integration-markdown-view blockquote { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--green); background: var(--green-weak); color: var(--muted); }
.integration-markdown-view ul, .integration-markdown-view ol { margin: 10px 0; padding-left: 24px; }
.integration-markdown-view li + li { margin-top: 5px; }
.integration-markdown-view code { padding: 2px 5px; border-radius: 4px; background: #edf2ef; color: #24533d; font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.api-contract-pane .integration-markdown-view pre { margin: 14px 0; padding: 16px; border-radius: 8px; background: #111815; color: #dbf3e6; white-space: pre; overflow: auto; }
.api-contract-pane .integration-markdown-view pre code { padding: 0; background: transparent; color: inherit; }
.markdown-table-scroll { max-width: 100%; margin: 14px 0; overflow-x: auto; }
.integration-markdown-view table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 13px; }
.integration-markdown-view th, .integration-markdown-view td { padding: 9px 11px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.integration-markdown-view th { background: var(--panel-soft); font-weight: 700; }
.integration-markdown-view hr { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.markdown-task { display: flex; align-items: flex-start; gap: 8px; list-style: none; }
.markdown-task input { margin-top: 5px; }
.endpoint-line { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.endpoint-line code { min-width: 0; padding: 10px; border-radius: 6px; background: var(--panel-soft); overflow-wrap: anywhere; }
.method-get, .method-post { display: inline-flex; justify-content: center; min-width: 52px; padding: 5px 8px; border-radius: 6px; font-size: 12px; font-weight: 800; }
.method-get { color: #1769aa; background: #e5f0f8; }
.method-post { color: #286b49; background: #def0e6; }
.contract-table, .mapping-table { display: grid; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.contract-table div, .mapping-table div { display: grid; grid-template-columns: .7fr .35fr 1.5fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mapping-table div { grid-template-columns: 1fr 1fr 1.3fr; }
.contract-table div:first-child, .mapping-table div:first-child { background: var(--panel-soft); }
.contract-table div:last-child, .mapping-table div:last-child { border-bottom: 0; }
.contract-note { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.contract-flow { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.contract-flow span { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.builder-note { margin: 12px 0 0; color: var(--muted); line-height: 1.5; }

.modal-open { overflow: hidden; }
.preview-chat-modal[hidden] { display: none; }
.preview-chat-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; background: rgba(12, 20, 16, .62); overflow: auto; }
.preview-chat-dialog { width: min(560px, 100%); border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.28); overflow: hidden; }
.preview-chat-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.preview-chat-header h2 { margin-top: 4px; font-size: 22px; }
.preview-chat-header p:last-child { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.preview-chat-form { display: grid; gap: 16px; padding: 22px 24px 24px; }
.preview-chat-form .field small { margin-top: 6px; color: var(--muted); line-height: 1.45; }
.preview-chat-security-note { margin: 0; padding: 11px 12px; border: 1px solid #cfe1d6; border-radius: 7px; background: var(--green-weak); color: #315b47; font-size: 12px; line-height: 1.55; }
.preview-chat-result { min-height: 20px; color: var(--green); font-size: 13px; font-weight: 700; }
.preview-chat-result.error { color: #b42318; }
.preview-chat-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.preview-chat-actions button { min-width: 112px; }
.builder-modal { position: fixed; inset: 0; z-index: 100; padding: 24px; background: rgba(12, 20, 16, .62); overflow: auto; }
.builder-dialog { width: min(1180px, 100%); min-height: calc(100vh - 48px); margin: 0 auto; display: grid; grid-template-rows: auto auto 1fr auto; border-radius: 8px; background: var(--panel); box-shadow: 0 24px 80px rgba(0,0,0,.25); overflow: hidden; }
.builder-header { padding: 20px 24px; display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.builder-header p:last-child { margin: 7px 0 0; color: var(--muted); }
.icon-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 24px; line-height: 1; }
.builder-progress { padding: 10px 16px; display: grid; grid-template-columns: repeat(8, minmax(105px, 1fr)); gap: 6px; border-bottom: 1px solid var(--line); background: var(--panel-soft); overflow-x: auto; }
.builder-progress button { min-height: 42px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); white-space: nowrap; }
.builder-progress button.active { border-color: var(--green); background: var(--green); color: #fff; }
.builder-progress button.done { border-color: #b8d4c5; background: var(--green-weak); color: var(--green); }
.builder-body { min-height: 500px; padding: 24px; overflow: auto; background: #f7f9f8; }
.builder-step { display: none; max-width: 980px; margin: 0 auto; }
.builder-step.active { display: block; }
.step-heading { margin-bottom: 18px; }
.step-heading > span { color: var(--green); font-size: 12px; font-weight: 700; }
.step-heading h2 { margin-top: 6px; font-size: 21px; }
.step-heading p { margin: 7px 0 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.source-choice, .runtime-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.runtime-choice { grid-template-columns: 1fr 1fr; }
.source-choice label, .runtime-choice label { padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.source-choice label.selected, .runtime-choice label.selected { border-color: var(--green); background: #f1f8f4; }
.source-choice small, .runtime-choice small { grid-column: 2; color: var(--muted); }
.parse-summary { margin-top: 16px; padding: 14px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.operation-list, .skill-picker { display: grid; gap: 10px; }
.operation-list label, .skill-picker label { padding: 14px; display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.operation-list label.selected { border-color: var(--green); background: #f1f8f4; }
.operation-list small, .skill-picker small { display: block; margin-top: 4px; color: var(--muted); }
.skill-picker label { grid-template-columns: auto 1fr auto; }
.schema-columns, .package-result { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.schema-columns > div { display: grid; gap: 8px; }
.mini-bubble-preview { margin-top: 14px; padding: 16px; max-width: 520px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.mini-bubble-preview p { color: var(--muted); }
.mini-bubble-preview span { margin-right: 10px; color: var(--blue); }
.mini-bubble-preview button { padding: 7px 10px; border: 0; border-radius: 6px; background: var(--green-weak); color: var(--green); }
.test-console { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.test-console > div { padding: 14px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.test-console ul { list-style: none; margin: 0; padding: 14px; display: grid; gap: 10px; }
.test-console .pass { color: var(--green); }
.validation-checks { padding: 16px; display: grid; align-content: start; gap: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.validation-checks span { color: var(--green); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-grid b { display: block; margin-bottom: 9px; }
.profile-grid span { display: inline-block; margin: 3px; padding: 6px 8px; border-radius: 6px; background: var(--green-weak); color: var(--green); font-size: 12px; }
.kb-editor { min-height: 340px; display: grid; grid-template-columns: 190px 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.kb-editor aside { padding: 14px; display: grid; align-content: start; gap: 8px; border-right: 1px solid var(--line); }
.kb-editor aside span { padding: 8px; border-radius: 6px; color: var(--muted); }
.kb-editor aside span.active { background: var(--green-weak); color: var(--green); }
.kb-editor textarea { width: 100%; min-height: 340px; padding: 16px; border: 0; resize: none; outline: none; font: 13px/1.7 "SFMono-Regular", Consolas, monospace; }
.policy-list, .agent-trace { display: grid; gap: 10px; }
.policy-list div { padding: 14px; display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.agent-trace div { padding: 14px; display: grid; gap: 5px; border-left: 4px solid var(--line); background: #fff; }
.agent-trace div.done { border-color: var(--green); }
.agent-trace div.current { border-color: var(--yellow); }
.agent-trace span { color: var(--muted); }
.builder-footer { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-top: 1px solid var(--line); }
.builder-footer > span { color: var(--muted); font-size: 13px; }
.builder-footer > div { display: flex; gap: 8px; }
.profile-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-preview { margin-top: 14px; padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.profile-preview div { min-width: 0; }
.profile-preview b, .profile-preview span { display: block; }
.profile-preview b { margin-bottom: 5px; color: var(--green); font-size: 12px; }
.profile-preview span { color: var(--muted); overflow-wrap: anywhere; }
.toggle-field { min-height: 62px; padding: 12px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.toggle-field input { width: 18px; height: 18px; accent-color: var(--green); }
.toggle-field b, .toggle-field small { display: block; }
.toggle-field small { margin-top: 4px; color: var(--muted); }
.api-import-box { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.api-import-box textarea { min-height: 116px; }
.kb-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.kb-toolbar button.active { border-color: var(--green); color: var(--green); background: var(--green-weak); }
.kb-workbench { min-height: 400px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.kb-workbench textarea { width: 100%; min-height: 400px; padding: 16px; border: 0; border-right: 1px solid var(--line); outline: none; resize: none; font: 13px/1.7 "SFMono-Regular", Consolas, monospace; }
.kb-workbench article { min-width: 0; padding: 20px; overflow: auto; line-height: 1.7; }
.kb-workbench article h1 { margin: 0 0 12px; font-size: 21px; }
.kb-workbench article h2 { margin: 18px 0 9px; font-size: 17px; }
.kb-workbench[data-mode="edit"] { grid-template-columns: 1fr; }
.kb-workbench[data-mode="edit"] article { display: none; }
.kb-workbench[data-mode="preview"] { grid-template-columns: 1fr; }
.kb-workbench[data-mode="preview"] textarea { display: none; }
.policy-editor { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.policy-editor > div { display: grid; grid-template-columns: 1.2fr .8fr 1fr 1.1fr; gap: 10px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fff; }
.policy-editor > div:first-child { background: var(--panel-soft); }
.policy-editor > div:last-child { border-bottom: 0; }
.policy-editor select { width: 100%; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.risk-options, .trial-options { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.risk-options label, .trial-options label { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.trial-input { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.trial-input textarea { min-height: 90px; }
.trial-input > button { margin-top: 14px; }
.trial-bubble { max-width: 620px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.trial-bubble p { color: var(--muted); line-height: 1.6; }
.compile-summary { margin-bottom: 14px; padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.compile-summary > div { display: flex; gap: 14px; flex-wrap: wrap; }
.compile-summary b { width: 100%; }
.compile-summary em { color: var(--green); font-style: normal; }
.validation-checks span.passed { color: var(--green); font-weight: 700; }
.publish-actions { margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.manifest-preview { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.manifest-preview b, .manifest-preview span { display: block; }
.manifest-preview span { margin-top: 5px; color: var(--muted); }
.request-config { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mapping-editor { display: grid; margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.mapping-editor > div { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: #fff; }
.mapping-editor > div:first-child { background: var(--panel-soft); }
.mapping-editor > div:last-child { border-bottom: 0; }
.mapping-editor input, .mapping-editor select { width: 100%; min-height: 35px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.schema-editor-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.schema-editor-columns label { display: grid; gap: 8px; }
.schema-editor-columns textarea { width: 100%; min-height: 240px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; outline: none; resize: vertical; background: #111815; color: #dbf3e6; font: 12px/1.65 "SFMono-Regular", Consolas, monospace; }
.examples-preview { margin-top: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.examples-preview div { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.examples-preview b, .examples-preview code { display: block; }
.examples-preview code { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.bubble-options { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.bubble-options label { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }

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

.flow-row div {
  min-height: 70px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
}

.auth-gate {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

[data-auth-gate="tenant"] .auth-panel { width: min(580px, 100%); }

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

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

.brand-row span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.tenant-brand-copy { min-width: 0; }
.tenant-brand-copy > strong { font-size: 17px; }
.tenant-brand-copy .brand-headline { margin: 7px 0 0; color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.45; }
.tenant-brand-copy .brand-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.auth-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.auth-tabs button.active {
  background: #fff;
  color: var(--green);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(33,45,38,.08);
}

.auth-register-only {
  display: none;
}

.auth-panel.register-mode .auth-register-only {
  display: grid;
}

.auth-login-only {
  display: block;
}

.auth-panel.register-mode .auth-login-only {
  display: none;
}

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

.auth-company-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.auth-company-row button { min-height: 42px; }

.enterprise-match {
  margin-bottom: 12px;
  padding: 13px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.enterprise-match strong,
.enterprise-match p { margin: 0; }
.enterprise-match p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.enterprise-match.verified { border-color: #d9b66c; background: #fffaf0; }
.enterprise-match.warning { border-color: #e5c98d; background: #fffdf7; }
.enterprise-match.clear { border-color: #b8d8c6; background: #f4faf6; }
.enterprise-match.pending { border-color: #9bbfd7; background: #f3f8fb; }

.auth-code-row button {
  min-height: 42px;
  white-space: nowrap;
}

.auth-hint {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
}

.admin-dashboard {
  max-width: 1280px;
  margin: 0 auto;
}

.admin-dashboard[data-admin-dashboard="tenant"] {
  max-width: 1440px;
}

.tenant-header {
  min-height: 76px;
  padding: 4px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tenant-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.tenant-logo {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid #e0e5e2;
  background: #fff;
  overflow: hidden;
}

.tenant-brand h1 { font-size: 25px; }
.tenant-brand p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.tenant-header-actions { display: flex; align-items: center; gap: 8px; }

.tenant-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.tenant-overview > div {
  min-height: 104px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
}

.tenant-overview > div:last-child { border-right: 0; }
.tenant-overview span, .tenant-overview small { color: var(--muted); }
.tenant-overview span { font-size: 13px; }
.tenant-overview strong { font-size: 24px; letter-spacing: 0; }
.tenant-overview small { font-size: 12px; }

.tenant-workspace-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-top: 16px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 250, 248, .96);
  box-shadow: 0 8px 24px rgba(33, 45, 38, .06);
}

.tenant-workspace-nav button {
  min-width: 0;
  min-height: 54px;
  padding: 8px 12px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.tenant-workspace-nav button span { font-weight: 700; color: var(--ink); }
.tenant-workspace-nav button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-workspace-nav button:hover { background: #edf3ef; }
.tenant-workspace-nav button.active { background: #153d2d; color: #dcebe4; }
.tenant-workspace-nav button.active span { color: #fff; }

.workspace-heading {
  scroll-margin-top: 84px;
  padding: 22px 2px 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.workspace-heading h2 { font-size: 20px; }

.developer-tool-nav {
  margin: 0 0 14px;
  padding: 4px;
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.developer-tool-nav[hidden] { display: none; }
.developer-tool-nav button { min-height: 40px; padding: 8px 14px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-weight: 700; }
.developer-tool-nav button:hover { background: #edf3ef; color: var(--ink); }
.developer-tool-nav button.active { background: #fff; color: var(--green); box-shadow: 0 1px 5px rgba(33, 45, 38, .1); }
.workspace-heading > span { max-width: 680px; color: var(--muted); font-size: 13px; text-align: right; }

.tenant-section-grid { gap: 14px; }
.tenant-section-grid > .panel {
  min-width: 0;
  width: 100%;
  box-shadow: 0 8px 24px rgba(33, 45, 38, .055);
  border-color: #d9e0dc;
}
.tenant-section-grid .key-layout > *,
.tenant-section-grid .api-contract,
.tenant-section-grid .integration-code,
.tenant-section-grid .endpoint-line { min-width: 0; }
.tenant-section-grid [data-card-role="gateway"] { order: 1; }
.tenant-section-grid [data-card-role="assistant"] { order: 2; }
.tenant-section-grid [data-card-role="recommendations"] { order: 3; }
.tenant-section-grid [data-card-role="token"] { order: 4; }
.tenant-section-grid .panel-title { padding-bottom: 12px; border-bottom: 1px solid #edf0ee; }
.tenant-section-grid .panel-title h2 { font-size: 17px; }

.enterprise-verification-panel { grid-column: 1 / -1; }
.enterprise-verification-panel .kv-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.enterprise-verification-panel .kv-list > div { min-width: 0; padding: 12px; display: block; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.enterprise-verification-panel .kv-list dt { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.enterprise-verification-panel .kv-list dd { overflow-wrap: anywhere; }

.assistant-knowledge-panel { grid-column: 1 / -1; }
.assistant-knowledge-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); gap: 16px; align-items: stretch; }
.assistant-knowledge-editor { min-width: 0; display: grid; align-content: start; gap: 12px; }
.assistant-knowledge-editor .field { margin: 0; }
.assistant-knowledge-editor [data-assistant-kb] { min-height: 300px; resize: vertical; }
.assistant-knowledge-preview-shell { min-width: 0; min-height: 404px; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.assistant-knowledge-preview-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--panel-soft); }
.assistant-knowledge-preview-head b, .assistant-knowledge-preview-head span { display: block; }
.assistant-knowledge-preview-head div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.assistant-knowledge-preview { min-width: 0; max-height: 420px; padding: 18px; line-height: 1.7; overflow: auto; }
.assistant-knowledge-preview > :first-child { margin-top: 0; }
.assistant-knowledge-preview > :last-child { margin-bottom: 0; }
.assistant-knowledge-preview h1 { margin: 24px 0 12px; font-size: 21px; }
.assistant-knowledge-preview h2 { margin: 22px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); font-size: 18px; }
.assistant-knowledge-preview h3 { margin: 18px 0 8px; font-size: 15px; }
.assistant-knowledge-preview p { margin: 9px 0; }
.assistant-knowledge-preview blockquote { margin: 12px 0; padding: 9px 12px; border-left: 3px solid var(--green); background: var(--green-weak); color: var(--muted); }
.assistant-knowledge-preview ul, .assistant-knowledge-preview ol { padding-left: 22px; }
.assistant-knowledge-preview code { padding: 2px 4px; border-radius: 4px; background: #edf2ef; color: #24533d; font-family: "SFMono-Regular", Consolas, monospace; }
.assistant-knowledge-preview pre { padding: 12px; border-radius: 7px; background: #111815; color: #dbf3e6; overflow: auto; }
.assistant-knowledge-preview pre code { padding: 0; background: transparent; color: inherit; }
.assistant-knowledge-preview .markdown-table-scroll { margin: 12px 0; }
.assistant-knowledge-preview table { min-width: 520px; border-collapse: collapse; font-size: 12px; }
.assistant-knowledge-preview th, .assistant-knowledge-preview td { padding: 8px 9px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.assistant-knowledge-preview th { background: var(--panel-soft); }

.tenant-section-grid .key-panel {
  padding: 20px;
}

.tenant-section-grid .generator-card {
  border-color: #b8d1c3;
  background: #f2f8f4;
}

.token-config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: start;
}

.token-config-fields { display: grid; gap: 12px; }
.token-config-fields .field small { color: var(--muted); line-height: 1.55; }
.refresh-header-editor { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.refresh-header-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.refresh-header-head > div { display: grid; gap: 4px; }
.refresh-header-head small, .refresh-header-editor .field-help { color: var(--muted); line-height: 1.5; }
.refresh-header-list { display: grid; gap: 8px; margin-top: 12px; }
.refresh-header-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(240px, 1.5fr) auto; gap: 8px; align-items: center; }
.refresh-header-row input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.refresh-header-row-actions { display: flex; gap: 6px; }
.refresh-header-row-actions button { white-space: nowrap; }
.refresh-header-editor .field-help { margin: 10px 0 0; font-size: 12px; }

.token-config-rules {
  padding: 14px;
  border: 1px solid #c8d8cf;
  border-radius: 7px;
  background: #f4f9f6;
}

.token-config-rules ul { margin: 10px 0 0; padding-left: 20px; }
.token-config-rules p { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.token-config-rules b + ul { margin-bottom: 18px; }
.token-config-rules li { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.recommended-prompts-panel { grid-column: 1 / -1; }
.recommended-prompts-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); gap: 16px; align-items: start; }
.recommended-prompts-editor { min-width: 0; display: grid; gap: 12px; }
.recommended-prompts-list { display: grid; gap: 9px; }
.recommended-prompt-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; }
.recommended-prompt-index { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-soft); color: var(--muted); font-size: 12px; font-weight: 750; }
.recommended-prompt-input { min-width: 0; }
.recommended-prompt-input input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.recommended-prompt-input small { display: block; margin-top: 4px; color: var(--muted); text-align: right; }
.recommended-prompt-actions { display: flex; gap: 5px; }
.recommended-prompt-actions button { min-width: 38px; padding: 0 9px; }
.recommended-prompts-editor .field-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.recommended-prompts-preview { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-soft); }
.recommended-prompts-preview > div:first-child b, .recommended-prompts-preview > div:first-child span { display: block; }
.recommended-prompts-preview > div:first-child span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.recommended-prompts-preview-list { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.token-refresh-contract { margin-top: 18px; }

.code-example-head {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-example-head > div { display: grid; gap: 3px; }
.code-example-head span { color: var(--muted); font-size: 12px; }

.tenant-section-grid .upload-card,
.tenant-section-grid .employee-card {
  background: #fff;
}

.tenant-section-grid .upload-card:hover,
.tenant-section-grid .employee-card:hover {
  border-color: #a7c3b4;
  box-shadow: 0 8px 18px rgba(33, 45, 38, .06);
}

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

.member-summary > div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.member-summary span,
.member-summary strong { display: block; }
.member-summary span { color: var(--muted); font-size: 12px; }
.member-summary strong { margin-top: 5px; font-size: 20px; }

.member-workflow-panel {
  grid-column: 1 / -1;
}

.member-workflow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .85fr);
  gap: 16px;
  align-items: stretch;
}

.member-workflow-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.member-workflow-aside {
  min-width: 0;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid #cfe0d7;
  border-radius: 7px;
  background: linear-gradient(180deg, #f7fbf8 0%, #eef6f2 100%);
}

.member-workflow-aside.danger {
  border-color: #e5d5c8;
  background: linear-gradient(180deg, #fffaf5 0%, #f8f0e8 100%);
}

.member-workflow-aside b {
  display: block;
  margin-bottom: 8px;
}

.member-workflow-aside p,
.member-workflow-aside li {
  color: var(--muted);
  line-height: 1.65;
  font-size: 13px;
}

.member-workflow-aside ol {
  margin: 0;
  padding-left: 18px;
}

.member-workflow-aside li + li { margin-top: 6px; }

.member-workflow-note {
  padding: 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .78);
  color: #2d5f46;
  font-size: 13px;
  line-height: 1.6;
}

.member-workflow-aside.danger .member-workflow-note {
  color: #8a4f1f;
}

.member-invite-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1fr) minmax(150px, .7fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.enterprise-verification-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.enterprise-review-list { display: grid; gap: 10px; }

.enterprise-review-row {
  min-width: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(180px, 1.3fr) minmax(180px, 1fr) minmax(190px, 1fr) auto minmax(180px, auto);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.enterprise-review-row b,
.enterprise-review-row small { display: block; }
.enterprise-review-row small { margin-top: 5px; color: var(--muted); overflow-wrap: anywhere; }
.enterprise-review-row label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.enterprise-review-row input { min-width: 0; }
.enterprise-review-row .button-row { flex-wrap: wrap; justify-content: flex-end; }

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

.member-row {
  min-width: 0;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, .8fr) minmax(100px, .7fr) minmax(190px, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.member-row b,
.member-row small { display: block; }
.member-row small { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.member-row .button-row { justify-content: flex-end; flex-wrap: wrap; }
.member-row select { min-height: 34px; }

.ownership-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.ownership-form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(170px, .8fr) auto auto;
  gap: 8px;
  align-items: end;
}

.permission-matrix { display: grid; overflow-x: auto; }
.permission-matrix > div { min-width: 720px; display: grid; grid-template-columns: 1.1fr repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.permission-matrix > div > * { padding: 10px; }
.permission-matrix > div:first-child { background: var(--panel-soft); }

.session-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.session-pills span {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.pill-link {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
}

.chat-layout {
  height: calc(100vh - 116px);
  min-height: 660px;
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.work-rail {
  grid-row: 1 / 3;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.work-rail h2 { margin-bottom: 12px; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rail-heading h2 { margin: 0; }
.rail-list { margin-top: 12px; }
.capability-info { display: grid; gap: 3px; cursor: default; }
.capability-info small { color: var(--muted); font-size: 11px; }
.icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
}

.rail-item {
  width: 100%;
  min-height: 38px;
  margin-bottom: 8px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.rail-item.active {
  border-color: var(--green);
  background: var(--green-weak);
  color: var(--green);
  font-weight: 700;
}

.rail-metric {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.rail-metric span, .rail-metric strong { display: block; }
.rail-metric span { color: var(--muted); font-size: 13px; }
.rail-metric strong { margin-top: 8px; font-size: 24px; }

.rail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.prompt-chip,
.history-item {
  width: 100%;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.prompt-chip:hover,
.history-item.active {
  border-color: var(--green);
  background: var(--green-weak);
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  border-radius: 8px;
}
.history-row.active { background: var(--green-weak); }
.history-row .history-item { margin: 0; border: 0; background: transparent; min-width: 0; }
.history-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.history-item small {
  color: var(--muted);
  font-size: 12px;
}
.history-run { color: var(--green); font-style: normal; font-weight: 700; }
.history-run.waiting_user_input { color: #a15c00; }
.history-action {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.history-action:hover { background: #fff; color: var(--ink); }
.history-action.danger:hover { color: #b42318; }

.conversation {
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef3f0;
  padding: 18px;
}
.chat-empty-state {
  min-height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}
.chat-empty-state strong { color: var(--ink); font-size: 20px; }
.message-status {
  width: fit-content;
  margin-top: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 12px;
}
.message-status.running::before, .message-status.queued::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--green); }
.agent-progress { display: grid; gap: 7px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.agent-progress strong { font-size: 13px; }
.agent-progress span { color: var(--muted); font-size: 12px; }
.agent-progress span.completed { color: var(--green); }
.agent-progress span.failed { color: #b42318; }
.live-execution { min-width: min(620px, 100%); margin-top: 10px; display: grid; gap: 12px; }
.thinking-indicator { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; }
.thinking-indicator [data-run-elapsed] { margin-left: 5px; color: #809087; font-variant-numeric: tabular-nums; }
.thinking-indicator i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: thinking-pulse 1.15s ease-in-out infinite; }
.thinking-indicator i:nth-child(2) { animation-delay: .14s; }
.thinking-indicator i:nth-child(3) { animation-delay: .28s; }
.thinking-indicator.done i { animation: none; opacity: .35; }
.thinking-indicator.done span::before { content: "已完成 · "; color: var(--green); }
.public-reasoning { padding: 10px 12px; border-left: 3px solid var(--green); border-radius: 0 7px 7px 0; background: var(--green-weak); color: #365347; font-size: 13px; line-height: 1.55; transition: background-color .2s ease; }
.public-analysis-stream { padding: 13px 15px; border-left: 2px solid #90ad9e; background: linear-gradient(90deg, rgba(237,244,240,.86), rgba(247,250,248,.38)); transition: opacity .35s ease, transform .35s ease; }
.public-analysis-stream.completed { opacity: 0; transform: translateY(-4px); }
.public-analysis-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.public-analysis-label span { color: #315746; font-size: 12px; font-weight: 750; }
.public-analysis-label small { color: var(--muted); font-size: 10px; }
.public-analysis-text { color: #4b6258; font-family: ui-serif, "Songti SC", "STSong", Georgia, serif; font-size: 14px; font-style: italic; line-height: 1.72; white-space: pre-wrap; }
.public-analysis-text:not(:empty)::after { content: ""; display: inline-block; width: 2px; height: .95em; margin-left: 3px; vertical-align: -.08em; background: #6c9582; animation: caret-blink .8s steps(2,end) infinite; }
.public-analysis-stream.settled .public-analysis-text::after { display: none; }
.execution-timeline { display: grid; gap: 7px; }
.execution-summary { margin: 0 0 14px; padding: 10px 0 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.execution-summary > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; list-style-position: inside; }
.execution-summary-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 9px; align-items: start; margin: 9px 0 0 3px; }
.execution-summary-item b { display: block; font-size: 13px; }
.execution-summary-item small { display: block; margin-top: 2px; color: var(--muted); }
.timeline-event { display: grid; grid-template-columns: 12px minmax(0,1fr); gap: 8px; align-items: start; opacity: .82; transition: opacity .2s ease, transform .2s ease; }
.timeline-event .timeline-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #aebbb5; box-shadow: 0 0 0 3px #edf2ef; }
.timeline-event.running .timeline-dot { background: var(--green); animation: timeline-pulse 1.4s ease infinite; }
.timeline-event.completed .timeline-dot { background: var(--green); }
.timeline-event.failed .timeline-dot { background: #b42318; }
.timeline-event div { display: grid; gap: 2px; }
.timeline-event b { font-size: 12px; font-weight: 700; }
.timeline-event small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.stream-answer { min-height: 1.4em; padding-top: 12px; border-top: 1px solid var(--line); overflow-wrap: anywhere; color: var(--ink); line-height: 1.72; font-size: 15px; }
.stream-markdown-root, .stream-markdown-stable, .stream-markdown-tail { display: contents; }
.stream-answer:not(:empty)::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--green); animation: caret-blink .8s steps(2,end) infinite; }
.stream-answer.non-stream-reveal::before { content: "完整响应 · "; color: var(--muted); font-size: 11px; }
@keyframes thinking-pulse { 0%,70%,100% { transform: translateY(0); opacity:.35; } 35% { transform:translateY(-4px); opacity:1; } }
@keyframes timeline-pulse { 50% { box-shadow:0 0 0 5px rgba(31,122,78,.12); } }
@keyframes caret-blink { 50% { opacity:0; } }
@keyframes chat-notice-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes cancel-attention { 0%,100% { box-shadow: none; } 25%,70% { box-shadow: 0 0 0 4px rgba(180,83,9,.2); } }
@media (prefers-reduced-motion: reduce) {
  .thinking-indicator i, .timeline-event.running .timeline-dot, .stream-answer:not(:empty)::after, .public-analysis-text:not(:empty)::after { animation: none; }
  .timeline-event, .public-reasoning, .public-analysis-stream { transition: none; }
  .chat-notice, .composer [data-cancel-run].attention { animation: none; }
}
[data-live-action] { display: grid; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
[data-live-action] label { display: flex; gap: 8px; align-items: flex-start; }

.demo-conversation {
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin-bottom: 14px;
}

.message.user { justify-content: flex-end; }
.message.ai { justify-content: flex-start; }

.bubble {
  max-width: min(760px, 100%);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 20px rgba(33,45,38,.06);
}

.message.user .bubble {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.message.ai .bubble {
  width: min(920px, 100%);
  max-width: 100%;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bubble p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.message.user .bubble p { color: #fff; }

.assistant-markdown { min-width: 0; color: var(--ink); line-height: 1.76; overflow-wrap: anywhere; }
.assistant-markdown > :first-child { margin-top: 0; }
.assistant-markdown > :last-child { margin-bottom: 0; }
.assistant-markdown p { margin: 9px 0; color: var(--ink); }
.assistant-markdown h1 { margin: 22px 0 12px; font-size: 23px; line-height: 1.35; }
.assistant-markdown h2 { margin: 20px 0 10px; font-size: 19px; line-height: 1.4; }
.assistant-markdown h3 { margin: 18px 0 8px; font-size: 16px; line-height: 1.45; }
.assistant-markdown ul, .assistant-markdown ol { margin: 10px 0; padding-left: 24px; }
.assistant-markdown li + li { margin-top: 4px; }
.assistant-markdown blockquote { margin: 12px 0; padding: 8px 12px; border-left: 3px solid #8eaa9c; background: rgba(237,244,240,.7); color: #50675c; }
.assistant-markdown code { padding: 2px 5px; border-radius: 4px; background: #eaf0ed; color: #24533d; font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.assistant-markdown pre { max-width: 100%; margin: 12px 0; padding: 15px 17px; border-radius: 7px; background: #15191d; color: #e4f3eb; overflow-x: auto; }
.assistant-markdown pre code { display: block; padding: 0; background: transparent; color: inherit; font: 13px/1.65 "SFMono-Regular", Consolas, monospace; white-space: pre; }
.assistant-markdown .markdown-table-scroll { max-width: 100%; overflow-x: auto; }
.assistant-markdown table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13px; }
.assistant-markdown th, .assistant-markdown td { padding: 8px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.assistant-markdown th { background: var(--panel-soft); }

.mini-table,
.capability-table,
.tenant-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mini-table div,
.capability-table div,
.tenant-list div {
  display: grid;
  grid-template-columns: 1.4fr .9fr 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.capability-table div { grid-template-columns: 1.5fr 1fr .8fr .8fr; }
.tenant-list div { grid-template-columns: 1.2fr 1fr .8fr .8fr; }
.demo-table div { grid-template-columns: 1.35fr .8fr .95fr .8fr 1fr; }
.demo-table-four div { grid-template-columns: 1.25fr .6fr 1.3fr 1fr; }
.mini-table div:first-child,
.capability-table div:first-child {
  background: var(--panel-soft);
  color: var(--muted);
}
.mini-table div:last-child,
.capability-table div:last-child,
.tenant-list div:last-child { border-bottom: 0; }

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

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

.image-preview,
.media-card video,
.media-card audio {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #e6f2ed, #eef0fb);
}

.image-preview {
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 800;
}

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

.action-bubble {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.download {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--green-weak);
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.download-stack {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.embed-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

.fake-iframe {
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  background: var(--panel-soft);
}

.demo-report-frame {
  height: 260px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.bar-chart span {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: var(--green);
}

.iframe-list {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.interaction-block {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.interaction-block h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

.interaction-result {
  display: inline-block;
  margin-top: 12px;
  color: var(--yellow);
  font-size: 13px;
  font-weight: 700;
}

.edit-bubble textarea,
.field textarea,
.field input,
.field select,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
}

.edit-bubble textarea {
  min-height: 92px;
  margin-top: 12px;
  padding: 10px;
  resize: vertical;
}

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

.check-grid label {
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-soft);
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.option-note {
  margin-top: 8px;
  font-size: 13px;
}

.check-grid label:has(input:checked),
.check-grid label.checked-by-skill {
  border-color: #c8ddd1;
  background: #f7fbf8;
}

.check-grid input {
  width: 16px;
  height: 16px;
  accent-color: #1976d2;
}

.multi-select-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.multi-select-footer .interaction-result {
  margin-top: 0;
}

.option-bubble.submitted .check-grid label {
  color: var(--muted);
  background: #f4f6f5;
}

.option-bubble.submitted .check-grid label:has(input:checked) {
  color: var(--ink);
  border-color: var(--green);
  background: var(--green-weak);
}

.composer {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 72px 72px 88px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.attachment-strip {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.attachment-chip button { width: 20px; min-width: 20px; height: 20px; padding: 0; border: 0; background: transparent; color: var(--muted); }
.message-attachments,
.attachment-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: 8px; margin-top: 10px; }
.attachment-strip { margin-top: 0; }
.attachment-card { min-width: 0; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-solid, #fff); overflow: hidden; color: var(--ink); }
.attachment-card.pending { grid-column: auto; background: #fbfcfb; }
.attachment-card-main { min-width: 0; width: 100%; min-height: 72px; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px 8px 8px; border: 0; border-radius: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; touch-action: manipulation; }
.attachment-card-main:hover { background: #f3f7f5; }
.attachment-card-main:active { background: #eaf2ee; }
.attachment-card-main:focus-visible,
.attachment-card-remove:focus-visible,
.attachment-preview-lightbox button:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 72%, white); outline-offset: -3px; }
.attachment-card-visual { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: #edf4f0; color: var(--green); }
.attachment-card-visual svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.attachment-card-copy { min-width: 0; display: grid; gap: 5px; }
.attachment-card-copy b { overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.attachment-card-copy small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.attachment-card-action { color: var(--green); font-size: 12px; font-weight: 750; }
.attachment-card-remove { min-width: 52px; min-height: 44px; align-self: center; margin-right: 8px; padding: 0 8px; border: 0; border-left: 1px solid var(--line); background: transparent; color: #9a3412; cursor: pointer; }
body.attachment-preview-open { overflow: hidden; }
.attachment-preview-lightbox { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 4vh 24px; background: rgba(13, 20, 17, .72); animation: attachment-preview-fade 150ms ease-out; }
.attachment-preview-lightbox[hidden] { display: none; }
.attachment-preview-panel { width: min(1200px, 100%); height: min(90dvh, 900px); min-height: 360px; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: #f7f9f8; box-shadow: 0 24px 70px rgba(0,0,0,.35); animation: attachment-preview-enter 180ms ease-out; }
.attachment-preview-header { min-width: 0; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px 10px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.attachment-preview-header > div:first-child { min-width: 0; }
.attachment-preview-header h2 { margin: 0; overflow-wrap: anywhere; font-size: 16px; }
.attachment-preview-header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.attachment-preview-primary-actions,
.attachment-preview-toolbar { display: flex; align-items: center; gap: 8px; }
.attachment-preview-lightbox button { min-width: 56px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; }
.attachment-preview-primary-actions button:first-child { border-color: var(--green); color: var(--green); }
.attachment-preview-toolbar { padding: 8px 14px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.attachment-preview-toolbar[hidden] { display: none; }
.attachment-preview-status { min-height: 28px; margin: 0; padding: 6px 16px; color: var(--muted); background: #f3f6f4; font-size: 12px; }
.attachment-preview-stage { min-width: 0; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 18px; background: #202824; }
.attachment-preview-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; transition: transform 160ms ease-out; }
.attachment-preview-stage iframe { width: 100%; height: 100%; min-height: 420px; border: 0; background: #fff; }
.attachment-preview-stage audio { width: min(680px, 100%); }
.attachment-preview-stage video { max-width: 100%; max-height: 100%; }
.attachment-preview-fallback { max-width: 520px; padding: 28px; border-radius: 12px; background: #fff; color: var(--ink); text-align: center; }
.attachment-preview-fallback p { margin: 8px 0 0; color: var(--muted); }
@keyframes attachment-preview-fade { from { opacity: 0; } }
@keyframes attachment-preview-enter { from { opacity: 0; transform: scale(.985); } }
@media (max-width: 600px) {
  .message-attachments, .attachment-strip { grid-template-columns: minmax(0, 1fr); }
  .attachment-card-main { min-height: 72px; grid-template-columns: 48px minmax(0, 1fr) auto; }
  .attachment-card-visual { width: 48px; height: 48px; }
  .attachment-preview-lightbox { display: block; padding: 0; background: #202824; }
  .attachment-preview-panel { width: 100%; height: 100dvh; min-height: 100dvh; border: 0; border-radius: 0; }
  .attachment-preview-header { padding-top: max(10px, env(safe-area-inset-top)); }
  .attachment-preview-header h2 { max-width: 52vw; }
  .attachment-preview-primary-actions { flex: 0 0 auto; }
  .attachment-preview-lightbox button { min-height: 44px; }
  .attachment-preview-stage { padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .attachment-preview-lightbox, .attachment-preview-panel { animation: none; }
  .attachment-preview-stage img { transition: none; }
}
.composer [data-realtime-asr].recording { background: #b42318; color: #fff; }
.composer > .api-feedback { grid-column: 1 / -1; margin: 0; }

body:has(#chat.active) { overflow: hidden; background: #f7f9f8; }
body:has(#chat.active) .main { padding: 0; }
#chat.active { min-height: 100vh; }
.chat-app-shell { height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); background: #f7f9f8; overflow: hidden; }
.chat-sidebar { min-width: 0; height: 100vh; padding: 18px 14px 14px; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 14px; border-right: 1px solid #e0e6e2; background: #fbfcfb; }
.chat-sidebar-brand { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 0 6px; }
.chat-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e0e5e2; border-radius: 9px; background: #fff; }
.chat-brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.chat-sidebar-brand span, .chat-sidebar-brand strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sidebar-brand span { color: var(--muted); font-size: 11px; }
.chat-sidebar-brand strong { margin-top: 3px; font-size: 15px; }
.chat-sidebar .chat-sidebar-close, .chat-main-header .chat-menu-button { display: none; }
.chat-sidebar-backdrop { display: none; }
.chat-new-button { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid #286f50; border-radius: 9px; background: #2f7d59; color: #fff; font-weight: 750; text-align: left; }
.chat-new-button:hover { background: #276b4d; }
.chat-sidebar-section { min-width: 0; padding: 2px 5px 0; }
.chat-sidebar-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.chat-sidebar-section-head b { font-size: 12px; letter-spacing: .02em; }
.chat-sidebar-section-head span { color: var(--muted); font-size: 11px; }
.chat-capability-short-list { display: grid; gap: 3px; }
.chat-capability-short-list .capability-info { min-height: 34px; margin: 0; padding: 7px 9px; border: 0; background: transparent; }
.chat-capability-short-list .capability-info:hover { background: #f0f4f1; }
.chat-capability-short-list .capability-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.chat-capability-short-list .capability-info small { display: none; }
.chat-sidebar-more { width: 100%; margin-top: 4px; padding: 8px 9px; display: flex; justify-content: space-between; border: 0; border-radius: 7px; background: transparent; color: var(--green); font-size: 12px; text-align: left; }
.chat-sidebar-more:hover { background: #edf4f0; }
.chat-history-section { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.chat-history-scroll { min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: none; -ms-overflow-style: none; }
.chat-history-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.chat-history-scroll [data-chat-history],
.chat-history-scroll .history-row { width: 100%; min-width: 0; max-width: 100%; }
.chat-history-scroll .history-row { grid-template-columns: minmax(0, 1fr) 26px 26px; gap: 2px; margin: 1px 0; border-radius: 8px; }
.chat-history-scroll .history-row .history-item { min-width: 0; overflow: hidden; padding: 9px 10px; }
.chat-history-scroll .history-item span { display: block; font-size: 13px; }
.chat-history-scroll .history-item small { display: block; margin-top: 4px; }
.chat-history-scroll .history-action {
  display: none;
  width: 26px;
  min-width: 26px;
  max-width: 26px;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  line-height: 1;
}
.chat-history-scroll .history-row:hover .history-action,
.chat-history-scroll .history-row:focus-within .history-action {
  display: inline-grid;
  place-items: center;
}
.chat-history-scroll .history-action-delete:hover { background: #fff1ef; color: #b42318; }
@media (hover: none), (pointer: coarse) {
  .chat-history-scroll .history-action { display: inline-grid; place-items: center; }
}
.chat-history-more, .load-earlier-messages { width: 100%; min-height: 34px; margin-top: 6px; border: 0; border-radius: 7px; background: #eef3f0; color: var(--muted); font-size: 12px; }
.chat-sidebar-footer { min-width: 0; padding: 10px 7px 2px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #e5e9e6; color: var(--muted); font-size: 11px; }
.chat-sidebar-footer i { width: 7px; height: 7px; border-radius: 50%; background: #36a36f; box-shadow: 0 0 0 3px #e1f3e9; }
.chat-main { min-width: 0; height: 100vh; display: grid; grid-template-rows: 64px minmax(0, 1fr) auto; background: #f7f9f8; overflow: hidden; }
.chat-main-header { min-width: 0; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e4e9e6; background: rgba(255,255,255,.84); backdrop-filter: blur(14px); }
.chat-main-header > div { min-width: 0; }
.chat-main-header strong, .chat-main-header span { display: block; }
.chat-main-header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.chat-main-header span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.chat-run-state { display: flex; align-items: center; gap: 10px; }
.chat-run-state span { margin: 0; }
.chat-home { min-height: 0; display: grid; place-items: end center; padding: clamp(50px, 13vh, 150px) 24px 34px; overflow: auto; }
.chat-home-hero { width: min(860px, 100%); text-align: center; }
.chat-home-hero h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -.035em; }
.chat-home-hero p { max-width: 680px; margin: 14px auto 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.chat-compose-zone { width: min(860px, calc(100% - 48px)); margin: 0 auto; padding: 0 0 clamp(190px, 32vh, 360px); }
.chat-compose-zone .composer { grid-template-columns: 38px minmax(0, 1fr) 68px 74px; align-items: center; padding: 12px; border-radius: 14px; border-color: #d7dfda; box-shadow: 0 16px 44px rgba(31,52,42,.1); }
.chat-compose-zone .composer [data-attach-file] { align-self: center; }
.chat-compose-zone .composer textarea { min-height: 70px; max-height: 180px; border: 0; resize: none; outline: 0; }
.chat-home-recommendations { margin-top: 14px; }
.chat-home-recommendation-head { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; text-align: center; }
.chat-home-recommendation-head b { color: var(--ink); font-size: 15px; font-weight: 750; }
.chat-home-recommendation-head button { position: absolute; right: 0; padding: 4px 8px; border: 0; background: transparent; color: var(--green); font-size: 14px; }
.chat-home-recommendations [data-chat-recommendations] { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-height: 86px; overflow: hidden; }
.chat-home-recommendations.expanded [data-chat-recommendations] { max-height: none; }
.chat-home-recommendations .prompt-chip { width: auto; min-height: 38px; margin: 0; padding: 8px 14px; border-color: #dce4df; border-radius: 999px; background: #fff; font-size: 14px; }
.chat-main:not(.home-mode) .chat-home, .chat-main:not(.home-mode) .chat-home-recommendations { display: none; }
.chat-main.home-mode .conversation, .chat-main.home-mode .capability-center { display: none; }
.chat-main.capability-mode .chat-home, .chat-main.capability-mode .conversation, .chat-main.capability-mode .chat-compose-zone { display: none; }
.chat-main.conversation-mode .chat-home, .chat-main.conversation-mode .capability-center { display: none; }
.chat-main.conversation-mode .conversation { display: block; margin: 0; padding: 24px max(24px, calc((100% - 920px) / 2)); overflow-anchor: none; border: 0; border-radius: 0; background: #f7f9f8; }
.chat-main.conversation-mode .chat-compose-zone { width: min(920px, calc(100% - 48px)); padding-bottom: 16px; }
.chat-main.conversation-mode .composer textarea { min-height: 52px; }
.capability-center { min-height: 0; padding: 34px clamp(24px, 5vw, 72px); overflow-y: auto; }
.capability-center-head, .capability-center-list, .capability-center > .chat-history-more { width: min(920px, 100%); margin-left: auto; margin-right: auto; }
.capability-center-head h2 { font-size: 28px; }
.capability-center-head p { margin: 8px 0 0; color: var(--muted); }
.capability-center-list { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.capability-center-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 18px 20px; }
.capability-center-row + .capability-center-row { border-top: 1px solid #e9eeeb; }
.capability-center-row-main { min-width: 0; }
.capability-center-row-main b { font-size: 16px; }
.capability-center-row-main p { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.capability-center-row-meta { min-width: 118px; text-align: right; }
.capability-center-row-meta span { display: block; color: var(--green); font-size: 13px; font-weight: 700; }
.capability-center-row-meta small { display: block; margin-top: 7px; color: #849089; font-size: 12px; }
.load-earlier-messages { display: block; width: min(300px, 100%); margin: 0 auto 18px; }

.chat-notice-region {
  position: fixed;
  z-index: 120;
  top: 76px;
  left: 50%;
  width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.chat-notice-region[hidden] { display: none; }
.chat-notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 9px 10px 9px 14px;
  border: 1px solid #d7dfdb;
  border-radius: 8px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 12px 30px rgba(28,42,35,.16);
  color: var(--ink);
  pointer-events: auto;
  animation: chat-notice-in .18s ease-out;
}
.chat-notice.leaving { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }
.chat-notice-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #e9f1ed; color: #276b4d; font-size: 12px; font-weight: 800; }
.chat-notice-icon::before { content: "i"; }
.chat-notice.warning { border-color: #e5cf98; background: #fffdf7; }
.chat-notice.warning .chat-notice-icon { background: #f8e8bd; color: #76530a; }
.chat-notice.warning .chat-notice-icon::before, .chat-notice.error .chat-notice-icon::before { content: "!"; }
.chat-notice.error { border-color: #e5b8b3; background: #fffafa; }
.chat-notice.error .chat-notice-icon { background: #f7deda; color: #9b2c22; }
.chat-notice.success .chat-notice-icon::before { content: "✓"; }
.chat-notice-text { min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.chat-notice-close { width: 30px; min-width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.chat-notice-close:hover { background: #edf1ef; color: var(--ink); }
.composer [data-cancel-run].attention { animation: cancel-attention 1.8s ease; }

.composer textarea {
  min-height: 48px;
  max-height: 140px;
  padding: 12px;
  resize: vertical;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  height: 40px;
  padding: 0 10px;
  color: var(--ink);
}

.field textarea {
  min-height: 132px;
  padding: 10px;
  color: var(--ink);
  resize: vertical;
}

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

.model-settings {
  display: grid;
  gap: 10px;
}

.model-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 1.4fr auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.model-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.model-row input,
.model-row select {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.model-row .tag {
  align-self: center;
  justify-self: end;
}

.model-usage {
  margin-top: 12px;
}

.test-launch-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.platform-security-policy .config-callout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.platform-security-policy .config-callout > div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.platform-security-policy .config-callout b, .platform-security-policy .config-callout p { display: block; }
.platform-security-policy .config-callout p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.platform-security-policy > small { display: block; margin-top: 10px; color: var(--muted); }
.test-launch-guide { margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--panel-soft); }
.test-launch-guide > div { min-width: 0; padding: 14px; }
.test-launch-guide > div + div { border-left: 1px solid var(--line); }
.test-launch-guide b, .test-launch-guide span { display: block; }
.test-launch-guide span { margin-top: 6px; color: var(--muted); line-height: 1.55; font-size: 13px; }
.test-launch-form .field small { margin-top: 7px; color: var(--muted); line-height: 1.5; }
.test-security-note { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid #b7791f; background: #fff8e8; color: #76551a; font-size: 13px; line-height: 1.55; }
.python-example-head { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.python-example-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.test-iframe-shell { margin-top: 16px; min-height: 620px; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.test-iframe-shell iframe { width: 100%; min-height: 620px; border: 0; display: block; }
.markdown-preview { margin-top: 12px; padding: 14px; border: 1px solid var(--line); background: var(--panel-solid); min-height: 72px; }
.model-key-form { display: grid; grid-template-columns: 1.8fr 1fr 1.5fr .7fr .7fr auto; gap: 10px; align-items: end; }
.model-key-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.model-key-form label small { max-width: 220px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.model-key-form input, .model-key-form select { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.model-priority-guide { margin: 12px 0 16px; padding: 11px 14px; display: grid; gap: 4px; border-left: 3px solid var(--green); background: var(--green-weak); }
.model-priority-guide strong { font-size: 13px; }
.model-priority-guide span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.custom-model-fields { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; border: 1px solid #c8d8cf; border-radius: 7px; background: #f4f9f6; }
.custom-model-fields[hidden] { display: none; }
.model-integration-guide { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.model-integration-guide summary { cursor: pointer; font-weight: 700; }
.model-integration-guide h3 { margin: 18px 0 8px; }
.model-integration-guide p { color: var(--muted); line-height: 1.65; }
.model-integration-guide pre { max-height: 360px; overflow: auto; white-space: pre-wrap; }
.model-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.model-key-table, .model-usage-table { margin-top: 16px; border: 1px solid var(--line); overflow-x: auto; }
.model-key-item, .model-usage-item { display: grid; grid-template-columns: 1.5fr .8fr .5fr .6fr .8fr auto; gap: 10px; align-items: center; min-width: 760px; padding: 12px; border-bottom: 1px solid var(--line); }
.model-usage-table.detail .model-usage-item { grid-template-columns: minmax(160px, 1.1fr) minmax(130px, .9fr) minmax(90px, .6fr) minmax(105px, .7fr) minmax(95px, .65fr) minmax(120px, .75fr) minmax(160px, 1fr); min-width: 1060px; }
.model-usage-item.header { background: var(--panel-soft); color: var(--muted); font-size: 12px; font-weight: 700; }
.model-key-item:last-child, .model-usage-item:last-child { border-bottom: 0; }
.model-key-item small, .model-usage-item small { color: var(--muted); }
.model-key-item > span small { display: block; margin-top: 3px; font-size: 10px; }
.model-usage-preview-footer,
.monitor-preview-footer {
  margin-top: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e5de;
  border-radius: 7px;
  background: #f5faf7;
  color: var(--muted);
  font-size: 13px;
}

.model-usage-detail-panel,
.monitor-detail-panel {
  grid-column: 1 / -1;
}

.model-usage-detail-head,
.monitor-detail-head,
.model-usage-detail-toolbar,
.monitor-detail-toolbar,
.model-usage-pagination,
.monitor-detail-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.model-usage-detail-head,
.monitor-detail-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0ee;
}

.model-usage-filter,
.monitor-detail-filter {
  margin-top: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-soft);
}

.model-usage-filter label,
.monitor-detail-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.model-usage-filter input,
.model-usage-filter select,
.monitor-detail-filter input,
.monitor-detail-filter select {
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.model-usage-detail-summary {
  margin-top: 14px;
}

.model-usage-detail-toolbar,
.monitor-detail-toolbar {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.model-usage-pagination,
.monitor-detail-pagination {
  margin-top: 12px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}

.model-usage-pagination span,
.monitor-detail-pagination span {
  color: var(--muted);
  font-size: 13px;
}
.capability-list { display: grid; gap: 8px; }
.capability-item { display: grid; grid-template-columns: 1.5fr .7fr .7fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); }
.market-card .market-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.owned-package-list { display: grid; gap: 10px; grid-column: 1 / -1; }
.owned-package-item { display: grid; grid-template-columns: 1.5fr .7fr .7fr auto; gap: 10px; align-items: center; padding: 14px; border: 1px solid var(--line); background: #fff; }
.developer-doc-page { min-height: calc(100vh - 48px); background: #f4f7f5; }
.developer-doc-page-header { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 18px 24px; border: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 8px 24px rgba(33,45,38,.08); backdrop-filter: blur(12px); }
.developer-doc-back { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel-soft); color: var(--green); white-space: nowrap; }
.developer-doc-page-title { min-width: 0; }
.developer-doc-page-title h1 { margin-top: 3px; font-size: clamp(22px, 2.4vw, 30px); }
.developer-doc-page-title p:last-child { margin-top: 5px; color: var(--muted); font-size: 13px; }
.developer-doc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.developer-doc-layout { width: min(1320px, calc(100% - 40px)); margin: 24px auto 72px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.developer-doc-toc { position: sticky; top: 128px; max-height: calc(100vh - 152px); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.developer-doc-toc-toggle { display: none; }
.developer-doc-toc-list { max-height: calc(100vh - 154px); padding: 12px 8px; display: grid; align-content: start; gap: 2px; overflow-y: auto; }
.developer-doc-toc-link { min-width: 0; padding: 7px 9px; border-left: 2px solid transparent; border-radius: 0 5px 5px 0; color: var(--muted); font-size: 13px; line-height: 1.45; text-decoration: none; overflow-wrap: anywhere; }
.developer-doc-toc-link.level-h1 { color: var(--ink); font-weight: 750; }
.developer-doc-toc-link.level-h2 { padding-left: 18px; }
.developer-doc-toc-link.level-h3 { padding-left: 30px; font-size: 12px; }
.developer-doc-toc-link:hover { background: var(--panel-soft); color: var(--green); }
.developer-doc-toc-link.active { border-left-color: var(--green); background: var(--green-weak); color: var(--green); font-weight: 700; }
.developer-doc-reader { min-width: 0; border: 1px solid var(--line); background: #fff; box-shadow: 0 16px 44px rgba(33,45,38,.08); }
.developer-doc-page .integration-markdown-view { max-height: none; padding: clamp(24px, 5vw, 64px); border: 0; border-radius: 0; line-height: 1.78; overflow: visible; }
.developer-doc-content h1[id], .developer-doc-content h2[id], .developer-doc-content h3[id] { scroll-margin-top: 132px; }
.developer-doc-content pre { max-width: 100%; margin: 16px 0; padding: 18px 20px; border: 1px solid #26332d; border-radius: 8px; background: #15191d; color: #e4f3eb; overflow-x: auto; }
.developer-doc-content pre code { display: block; padding: 0; background: transparent; color: inherit; font: 13px/1.65 "SFMono-Regular", Consolas, monospace; white-space: pre; }
.capability-version-modal { position: fixed; inset: 0; z-index: 60; padding: 24px; background: rgba(20,26,32,.56); overflow: auto; }
.capability-version-dialog { width: min(760px, 100%); margin: 8vh auto 0; border: 1px solid var(--line); background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.capability-version-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.capability-version-content { padding: 20px; }
.monitor-filters { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap: 10px; align-items: end; }
.monitor-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.monitor-filters input { min-width: 0; height: 40px; padding: 0 10px; border: 1px solid var(--line); }
.monitor-list { max-width: 100%; margin-top: 14px; border: 1px solid var(--line); overflow-x: auto; }
.monitor-row { display: grid; grid-template-columns: 1.4fr 1fr .7fr .7fr auto; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.monitor-list.detail .monitor-row { grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(160px, auto); min-width: 900px; }
.monitor-row.header { background: var(--panel-soft); color: var(--muted); font-size: 12px; font-weight: 700; }
.monitor-row:last-child { border-bottom: 0; }
.developer-assistant-layout { min-width:0; max-width:100%; display:grid; grid-template-columns:260px minmax(0,1fr); min-height:620px; border:1px solid var(--line); background:#fff; }
.developer-assistant-history { padding:12px; border-right:1px solid var(--line); background:var(--panel-soft); overflow:auto; }
.developer-assistant-history button { width:100%; margin-bottom:6px; padding:11px; border:0; text-align:left; background:transparent; color:var(--ink); }
.developer-assistant-history button.active { background:var(--green-weak); color:var(--green); font-weight:700; }
.developer-assistant-main { min-width:0; display:grid; grid-template-rows:minmax(0,1fr) auto auto; }
.developer-assistant-messages, .developer-assistant-composer { min-width:0; max-width:100%; }
.developer-assistant-messages { min-height:420px; padding:20px; overflow:auto; }
.developer-assistant-message { max-width:88%; margin:0 0 14px; padding:14px 16px; border:1px solid var(--line); border-radius:10px; white-space:pre-wrap; overflow-wrap:anywhere; }
.developer-assistant-message.user { margin-left:auto; background:var(--green-weak); }
.developer-assistant-card { margin-top:12px; padding:12px; border:1px solid var(--line); background:var(--panel-soft); }
.developer-assistant-card pre { max-height:260px; overflow:auto; white-space:pre-wrap; }
.developer-assistant-progress { padding:10px 16px; border-top:1px solid var(--line); color:var(--muted); }
.developer-assistant-composer { padding:14px; border-top:1px solid var(--line); }
.developer-assistant-composer label { display:grid; gap:6px; }
.developer-assistant-composer textarea { width:100%; resize:vertical; }
.developer-assistant-compose-actions { margin-top:10px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.assistant-file-picker { min-width:0; max-width:100%; display:inline-flex!important; }
.assistant-file-picker input[type="file"] { width:100%; min-width:0; max-width:100%; }
@media (max-width: 760px) {
  .developer-tool-nav { width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .developer-assistant-layout { grid-template-columns:1fr; }
  .developer-assistant-history { display:flex; gap:6px; border-right:0; border-bottom:1px solid var(--line); overflow-x:auto; }
  .developer-assistant-history button { min-width:150px; margin:0; }
  .developer-assistant-messages { min-height:360px; padding:12px; }
  .developer-assistant-message { max-width:100%; }
}
.monitor-conversation-row:not(.header) { cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.monitor-conversation-row:not(.header):hover,
.monitor-conversation-row:not(.header):focus-visible { background: #f5faf7; box-shadow: inset 3px 0 0 var(--green); outline: 0; }

.conversation-workbench {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.conversation-workbench-head {
  min-height: 104px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.icon-button:hover { border-color: #aebbb4; background: var(--panel-soft); }
.workbench-back { margin-top: 2px; font-size: 20px; }
.workbench-identity { min-width: 0; }
.workbench-identity h2 { font-size: 21px; }
.workbench-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.workbench-meta span { min-width: 0; overflow-wrap: anywhere; }
.workbench-meta span + span { position: relative; }
.workbench-meta span + span::before { content: ""; position: absolute; left: -9px; top: 6px; width: 3px; height: 3px; border-radius: 50%; background: #a8b3ad; }

.status-pill,
.status-dot {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill { min-height: 30px; padding: 0 11px; font-size: 12px; }
.status-dot { gap: 5px; font-size: 11px; color: var(--muted); }
.status-dot::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #9ba7a1; }
.status-pill.status-completed, .status-pill.status-success { color: #176a48; background: #e2f4ea; }
.status-pill.status-running, .status-pill.status-queued { color: #1c608b; background: #e4f1f8; }
.status-pill.status-waiting_user_input, .status-pill.status-waiting_user_confirm { color: #8a5a11; background: #fff1d6; }
.status-pill.status-failed { color: #a12a23; background: #fde9e7; }
.status-pill.status-cancelled, .status-pill.status-canceled, .status-pill.status-idle { color: #5e6863; background: #edf0ee; }
.status-dot.status-completed::before, .status-dot.status-success::before { background: #2f9367; }
.status-dot.status-running::before, .status-dot.status-queued::before { background: #3388b8; }
.status-dot.status-waiting_user_input::before, .status-dot.status-waiting_user_confirm::before { background: #d2962f; }
.status-dot.status-failed::before { background: #cf4b43; }

.workbench-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.workbench-summary > div { display: grid; gap: 3px; padding: 14px 24px; border-right: 1px solid var(--line); }
.workbench-summary > div:last-child { border-right: 0; }
.workbench-summary span { color: var(--muted); font-size: 11px; }
.workbench-summary b { font-size: 18px; }

.workbench-tabs {
  height: 52px;
  display: flex;
  align-items: end;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.workbench-tabs button {
  height: 52px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.workbench-tabs button.active { border-bottom-color: var(--green); color: var(--ink); }
.workbench-view { min-width: 0; }
.conversation-view-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.conversation-view-head > div { display: grid; gap: 4px; }
.conversation-view-head span { color: var(--muted); font-size: 12px; }
.readonly-badge { padding: 5px 8px; border: 1px solid #cad5cf; border-radius: 4px; background: #f7f9f8; color: #56635d !important; font-weight: 700; }

.conversation-transcript { min-height: 440px; padding: 28px clamp(20px, 5vw, 76px) 50px; background: #f7f9f8; }
.transcript-message { display: grid; grid-template-columns: 34px minmax(0, 720px); gap: 11px; align-items: start; margin-bottom: 24px; scroll-margin-top: 140px; }
.transcript-message.user { grid-template-columns: minmax(0, 720px) 34px; justify-content: end; }
.transcript-message.user .transcript-speaker { grid-column: 2; }
.transcript-message.user .transcript-content { grid-column: 1; grid-row: 1; justify-self: end; }
.transcript-speaker { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #dfe9e4; color: #315e4a; font-size: 11px; font-weight: 800; }
.transcript-message.user .transcript-speaker { background: #dfe9f2; color: #285a78; }
.transcript-content { min-width: 0; width: fit-content; max-width: 100%; }
.transcript-message-meta { display: flex; align-items: center; gap: 10px; margin: 0 2px 7px; color: var(--muted); font-size: 11px; }
.transcript-message.user .transcript-message-meta { justify-content: flex-end; }
.transcript-message-meta b { color: var(--ink); font-size: 12px; }
.readonly-bubble { min-width: 220px; max-width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 6px 18px rgba(33,45,38,.05); overflow: hidden; }
.readonly-bubble + .readonly-bubble { margin-top: 8px; }
.transcript-message.user .readonly-bubble { border-color: #c9dce8; background: #edf5f9; }
.readonly-bubble > p:first-child { margin-top: 0; }
.readonly-bubble p { line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.readonly-bubble img, .readonly-bubble video, .readonly-bubble audio { max-width: 100%; }
.readonly-bubble video { display: block; width: min(620px, 100%); background: #111; }
.readonly-bubble .mini-table { max-width: 100%; overflow-x: auto; }
.readonly-bubble .mini-table > div { min-width: 480px; }
.readonly-action { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.readonly-action label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.readonly-action label:has(input[type="checkbox"]) { display: flex; align-items: center; }
.readonly-action textarea { width: 100%; min-height: 70px; resize: none; padding: 9px; border: 1px solid var(--line); background: #f3f5f4; color: #66736d; }
.readonly-action button { width: fit-content; }
.readonly-action-result { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; padding: 9px 10px; border-left: 3px solid var(--green); background: #edf7f1; font-size: 12px; }
.readonly-action-result span { min-width: 0; overflow-wrap: anywhere; color: #365746; }
.readonly-action-result small { color: var(--muted); }
.readonly-action-state { color: var(--muted); font-size: 11px; }
.readonly-embed { position: relative; pointer-events: none; }
.readonly-embed span { position: absolute; right: 8px; top: 8px; padding: 4px 7px; background: rgba(24,32,29,.78); color: #fff; font-size: 11px; }
.message-trace-link, .text-button { border: 0; background: transparent; color: var(--blue); font-weight: 700; }
.message-trace-link { margin-top: 8px; padding: 4px 2px; font-size: 12px; }
.message-trace-link:hover, .text-button:hover { text-decoration: underline; }
.transcript-message.located .readonly-bubble { animation: located-message 1.8s ease; }
@keyframes located-message { 0%, 100% { box-shadow: 0 6px 18px rgba(33,45,38,.05); } 25% { box-shadow: 0 0 0 3px rgba(47,125,89,.22), 0 8px 24px rgba(33,45,38,.08); } }

.trace-workbench { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 640px; background: #f7f9f8; }
.trace-run-list { min-width: 0; border-right: 1px solid var(--line); background: #fff; }
.trace-run-list-head { display: flex; justify-content: space-between; align-items: center; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.trace-run-list-head span { color: var(--muted); font-size: 11px; }
.trace-run-item { width: 100%; min-height: 82px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 5px 10px; align-items: start; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left; }
.trace-run-item:hover { background: var(--panel-soft); }
.trace-run-item.active { background: #edf7f1; box-shadow: inset 3px 0 0 var(--green); }
.run-index { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #c9d4ce; border-radius: 50%; color: var(--muted); font-size: 11px; }
.trace-run-item > div { min-width: 0; display: grid; gap: 5px; }
.trace-run-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.trace-run-item small { color: var(--muted); font-size: 10px; }
.trace-run-item .status-dot { grid-column: 2; }

.trace-run-detail { min-width: 0; padding: 24px clamp(18px, 3vw, 40px) 48px; }
.trace-detail-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 18px; }
.trace-detail-head > div { min-width: 0; }
.trace-detail-head h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.trace-detail-head > div > span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.trace-budget { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; border: 1px solid var(--line); background: #fff; }
.trace-budget > div { display: grid; gap: 4px; padding: 12px 14px; border-right: 1px solid var(--line); }
.trace-budget > div:last-child { border-right: 0; }
.trace-budget span, .trace-budget small { color: var(--muted); font-size: 10px; }
.trace-budget b { font-size: 14px; }
.trace-error-banner { display: grid; gap: 4px; margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid #c7463e; background: #fdeeed; color: #8f2822; }
.trace-error-banner span { font-size: 12px; overflow-wrap: anywhere; }

.trace-timeline { position: relative; display: grid; gap: 14px; }
.trace-timeline::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; width: 1px; background: #cbd5d0; }
.trace-node { position: relative; display: grid; grid-template-columns: 21px minmax(0, 1fr); gap: 12px; }
.trace-node-marker { position: relative; z-index: 1; width: 11px; height: 11px; margin: 17px 0 0 5px; border: 3px solid #fff; border-radius: 50%; background: #7d8a84; box-shadow: 0 0 0 1px #aab6b0; }
.trace-node.status-completed .trace-node-marker, .trace-node.status-success .trace-node-marker { background: #359269; }
.trace-node.status-running .trace-node-marker, .trace-node.status-queued .trace-node-marker { background: #3989b5; }
.trace-node.status-failed .trace-node-marker { background: #c7463e; }
.trace-node.status-waiting_user_input .trace-node-marker, .trace-node.status-waiting_user_confirm .trace-node-marker { background: #d0942e; }
.trace-node-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.trace-node-card > header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.trace-node-card > header > div { min-width: 0; display: grid; gap: 3px; }
.trace-kind { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.trace-node-card > p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.trace-error { color: #ad342d !important; overflow-wrap: anywhere; }
.trace-children { margin-top: 12px; border-top: 1px solid var(--line); }
.trace-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.trace-child:last-child { border-bottom: 0; padding-bottom: 0; }
.trace-child > div:first-child { display: grid; gap: 3px; }
.trace-child > div:first-child span { color: var(--muted); font-size: 10px; }
.trace-child.observation { border-left: 2px solid #6c8cad; padding-left: 10px; }
.trace-child .trace-json, .trace-child > p { grid-column: 1 / -1; }
.trace-json { margin-top: 10px; border-top: 1px solid var(--line); }
.trace-json summary { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0 4px; color: #3f4b45; cursor: pointer; font-size: 11px; font-weight: 700; }
.trace-json summary span { color: var(--muted); font-weight: 400; }
.trace-json-head { display: flex; justify-content: flex-end; margin: 4px 0; }
.trace-json-head .icon-button { width: 30px; height: 30px; font-size: 11px; }
.trace-json pre { max-height: 340px; margin: 0; padding: 12px; overflow: auto; border: 1px solid #dbe2de; background: #f4f6f5; color: #27342e; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.runtime-event-group { margin: 24px 0 0 33px; border-top: 1px solid var(--line); }
.runtime-event-group > summary { padding: 14px 0; cursor: pointer; font-weight: 700; }
.runtime-event-group > summary span { color: var(--muted); font-size: 11px; }
.runtime-event-group > div { display: grid; grid-template-columns: 1fr auto auto; gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
.runtime-event-group .trace-json, .runtime-event-group p { grid-column: 1 / -1; }
.workbench-empty, .workbench-loading { min-height: 220px; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 30px; color: var(--muted); text-align: center; }
.workbench-empty b { color: var(--ink); }

.usage-grid div,
.ops-summary div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.usage-grid span,
.usage-grid small,
.ops-summary span {
  display: block;
  color: var(--muted);
}

.usage-grid b,
.ops-summary b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.usage-grid small { margin-top: 7px; font-size: 12px; }

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

.demo-status-list span {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.demo-status-list .done {
  color: var(--green);
  background: var(--green-weak);
  border-color: #c8ddd1;
}

.demo-status-list .current {
  color: var(--yellow);
  background: #fff8e8;
  border-color: #edd9ad;
  font-weight: 700;
}

.demo-flow {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.demo-image-bubble {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: stretch;
}

.analytics-image {
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbf9, #eaf3ef);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

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

.chart-head span {
  color: var(--green);
  font-weight: 800;
}

.chart-bars {
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 8px 2px 0;
}

.chart-bars i {
  flex: 1;
  min-height: 28px;
  border-radius: 6px 6px 2px 2px;
  background: var(--green);
}

.demo-composite-bubble {
  max-width: min(900px, 100%);
}

.compact-actions {
  margin-top: 0;
}

.file-command { position: relative; display: inline-flex; align-items: center; }
.file-command input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

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

.upload-card,
.employee-card,
.market-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.upload-card strong,
.upload-card span,
.upload-card small,
.market-card strong,
.market-card span,
.market-card small {
  display: block;
}

.upload-card span,
.market-card span {
  margin-top: 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.upload-card small,
.market-card small {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.employee-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.employee-card strong,
.employee-card span {
  display: block;
}

.employee-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.dashed {
  border-style: dashed;
  background: #fff;
}

.bubble-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bubble-tokens span {
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.log-list li {
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-soft);
}

.status-on { color: var(--green); font-weight: 700; }

.ops-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.trend-board {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.line-spark {
  position: relative;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(to bottom, #fff, #f1f7f4);
  overflow: hidden;
}

.line-spark span {
  position: absolute;
  inset: 22px;
  border-bottom: 5px solid var(--green);
  border-right: 5px solid var(--green);
  transform: skewX(-18deg) rotate(-8deg);
  border-radius: 8px;
}

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

@media (max-width: 980px) {
  .trace-workbench { grid-template-columns: 240px minmax(0, 1fr); }
  .trace-budget { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-budget > div:nth-child(2) { border-right: 0; }
  .trace-budget > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .chat-layout {
    height: auto;
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .work-rail { grid-row: auto; }
  .conversation { max-height: 660px; }
  .model-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-row .tag { justify-self: start; }
  .demo-image-bubble { grid-template-columns: 1fr; }
  .demo-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-layout { grid-template-columns: 1fr; }
  .token-config-layout { grid-template-columns: 1fr; }
  .refresh-header-row { grid-template-columns: 1fr; }
  .refresh-header-row-actions { flex-wrap: wrap; }
  .assistant-knowledge-layout { grid-template-columns: 1fr; }
  .recommended-prompts-layout { grid-template-columns: 1fr; }
  .enterprise-verification-panel .kv-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-workflow-layout { grid-template-columns: 1fr; }
  .saas-host-layout { grid-template-columns: 1fr; }
  .saas-module-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); border-right: 0; border-bottom: 1px solid var(--line); }
  .saas-module-nav b { grid-column: 1 / -1; }
  .builder-modal { padding: 10px; }
  .builder-dialog { min-height: calc(100vh - 20px); }
  .source-choice, .schema-columns, .package-result { grid-template-columns: 1fr; }
  .tenant-overview { grid-template-columns: 1fr 1fr; }
  .tenant-overview > div:nth-child(2) { border-right: 0; }
  .tenant-overview > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .tenant-workspace-nav { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; }
  .model-usage-filter,
  .monitor-detail-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .member-invite-form, .ownership-form, .enterprise-verification-form, .enterprise-review-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .chat-app-shell { grid-template-columns: 1fr; }
  .chat-sidebar { position: fixed; z-index: 150; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(22,36,29,.16); }
  .chat-sidebar.open { transform: translateX(0); }
  .chat-sidebar-backdrop { position: fixed; z-index: 140; inset: 0; display: block; border: 0; background: rgba(19,31,25,.28); opacity: 0; pointer-events: none; transition: opacity .22s ease; }
  .chat-sidebar.open + .chat-sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .chat-sidebar .chat-sidebar-close, .chat-main-header .chat-menu-button { display: grid; place-items: center; }
  .chat-main-header { padding: 0 12px; }
  .chat-main-header { justify-content: flex-start; }
  .chat-main-header > div:nth-child(2) { flex: 1; }
  .chat-run-state span { display: none; }
  .chat-home { padding: 54px 16px 22px; place-items: end start; }
  .chat-home-hero h1 { font-size: 31px; }
  .chat-home-hero p { font-size: 14px; }
  .chat-compose-zone, .chat-main.conversation-mode .chat-compose-zone { width: calc(100% - 24px); }
  .chat-main.home-mode .chat-compose-zone { padding-bottom: max(18vh, env(safe-area-inset-bottom)); }
  .chat-main.conversation-mode .chat-compose-zone { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .chat-compose-zone .composer { grid-template-columns: 36px minmax(0, 1fr) 44px; gap: 7px; padding: 9px; }
  .chat-compose-zone .composer [data-realtime-asr] { display: none; }
  .chat-compose-zone .composer [data-send-chat] { min-width: 44px; padding: 0 8px; }
  .chat-home-recommendations [data-chat-recommendations] { flex-wrap: nowrap; overflow-x: auto; max-height: none; scroll-snap-type: x proximity; padding-bottom: 4px; }
  .chat-home-recommendation-head { justify-content: flex-start; text-align: left; }
  .chat-home-recommendations [data-chat-recommendations] { justify-content: flex-start; }
  .chat-home-recommendations .prompt-chip { flex: 0 0 auto; max-width: 82vw; scroll-snap-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-home-recommendation-head button { display: none; }
  .chat-main.conversation-mode .conversation { padding: 18px 12px; }
  .capability-center { padding: 24px 14px; }
  .capability-center-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .capability-center-row-meta { min-width: 0; text-align: left; }
  .recommended-prompt-row { grid-template-columns: 30px minmax(0, 1fr); align-items: start; }
  .recommended-prompt-actions { grid-column: 2; flex-wrap: wrap; }
  .preview-chat-modal { align-items: end; padding: 10px; }
  .preview-chat-dialog { max-height: calc(100vh - 20px); overflow-y: auto; }
  .preview-chat-header, .preview-chat-form { padding: 18px; }
  .preview-chat-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .preview-chat-actions button { min-width: 0; }
  .conversation-workbench { width: 100%; border-left: 0; border-right: 0; }
  .conversation-workbench-head { grid-template-columns: 36px minmax(0, 1fr); padding: 16px 14px; }
  .workbench-status { grid-column: 2; }
  .workbench-identity h2 { font-size: 17px; }
  .workbench-meta { display: grid; gap: 5px; }
  .workbench-meta span + span::before { display: none; }
  .workbench-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench-summary > div { padding: 11px 14px; }
  .workbench-summary > div:nth-child(2) { border-right: 0; }
  .workbench-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workbench-tabs { gap: 20px; padding: 0 14px; }
  .conversation-view-head { align-items: start; padding: 14px; }
  .conversation-view-head > div span { max-width: 220px; }
  .conversation-transcript { padding: 20px 12px 36px; }
  .transcript-message, .transcript-message.user { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; }
  .transcript-message.user .transcript-speaker { grid-column: 1; }
  .transcript-message.user .transcript-content { grid-column: 2; grid-row: 1; justify-self: stretch; }
  .transcript-speaker { width: 28px; height: 28px; font-size: 9px; }
  .transcript-content { width: 100%; }
  .transcript-message.user .transcript-message-meta { justify-content: flex-start; }
  .readonly-bubble { min-width: 0; padding: 12px; }
  .readonly-action-result { grid-template-columns: 1fr; }
  .readonly-bubble .mini-table { margin-left: -4px; margin-right: -4px; }
  .trace-workbench { display: block; min-height: 0; }
  .trace-run-list { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .trace-run-list-head { display: none; }
  .trace-run-item { flex: 0 0 248px; min-height: 74px; border: 1px solid var(--line); border-radius: 5px; }
  .trace-run-item.active { border-color: #8ebba4; box-shadow: inset 0 -3px 0 var(--green); }
  .trace-run-detail { padding: 18px 12px 36px; }
  .trace-detail-head { display: grid; }
  .trace-detail-head .status-pill { grid-row: 1; }
  .trace-budget { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-node { gap: 8px; }
  .trace-node-card { padding: 12px; }
  .trace-node-card > header { display: grid; }
  .trace-child { grid-template-columns: 1fr; }
  .trace-json summary { align-items: start; }
  .runtime-event-group { margin-left: 29px; }
  .runtime-event-group > div { grid-template-columns: 1fr; }
  .auth-code-row { grid-template-columns: minmax(0, 1fr) 112px; }
  .test-launch-form { grid-template-columns: 1fr; }
  .platform-security-policy .config-callout { grid-template-columns: 1fr; }
  .test-launch-guide { grid-template-columns: 1fr; }
  .test-launch-guide > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .model-key-form { grid-template-columns: 1fr; }
  .custom-model-fields, .model-guide-grid { grid-template-columns: 1fr; }
  .monitor-filters { grid-template-columns: 1fr; }
  .model-usage-filter,
  .monitor-detail-filter { grid-template-columns: 1fr; }
  .model-usage-detail-head,
  .monitor-detail-head,
  .model-usage-detail-toolbar,
  .monitor-detail-toolbar,
  .model-usage-pagination,
  .monitor-detail-pagination,
  .model-usage-preview-footer,
  .monitor-preview-footer { align-items: stretch; flex-direction: column; }
  .model-usage-detail-head button,
  .monitor-detail-head button,
  .model-usage-detail-toolbar button,
  .monitor-detail-toolbar button,
  .model-usage-pagination button,
  .monitor-detail-pagination button,
  .model-usage-preview-footer button,
  .monitor-preview-footer button { width: 100%; }
  .main { padding: 14px; }
  .page-header, .chat-topbar, .action-bubble, .trend-board { align-items: stretch; flex-direction: column; }
  .admin-grid, .ops-summary, .usage-grid, .flow-row, .media-grid, .fake-iframe, .model-row, .upload-grid, .employee-grid, .market-grid, .entry-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .upload-grid, .employee-grid,
  .upload-grid > *, .employee-grid > * { min-width: 0; max-width: 100%; }
  .employee-card { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
  .employee-card > *, .upload-card > * { min-width: 0; max-width: 100%; }
  .employee-card input[type="file"], .upload-card input[type="file"] { width: 100%; max-width: 100%; }
  .composer { grid-template-columns: 1fr; }
  .mini-table div, .capability-table div, .tenant-list div {
    grid-template-columns: 1fr;
  }
  .demo-table div,
  .demo-table-four div,
  .demo-flow {
    grid-template-columns: 1fr;
  }
  .check-grid { grid-template-columns: 1fr; }
  .download-stack { min-width: 0; }
  .wizard-steps, .wizard-workspace, .integration-code { grid-template-columns: 1fr; }
  .saas-host-header, .generator-head { align-items: stretch; flex-direction: column; }
  .saas-module-nav { grid-template-columns: 1fr 1fr; }
  .endpoint-line, .form-grid, .profile-grid, .runtime-choice, .kb-editor { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .contract-table div, .mapping-table div, .policy-list div { grid-template-columns: 1fr; }
  .builder-header, .builder-footer { align-items: stretch; flex-direction: column; }
  .code-example-head { align-items: stretch; flex-direction: column; }
  .code-example-head button { width: 100%; }
  .integration-document-head { align-items: stretch; flex-direction: column; }
  .integration-document-head .button-row { width: 100%; }
  .integration-document-head .button-row button { flex: 1 1 150px; }
  .integration-document-actions { width: 100%; justify-items: stretch; }
  .assistant-knowledge-preview-shell { min-height: 340px; }
  .assistant-knowledge-preview { max-height: 420px; }
  .enterprise-verification-panel .kv-list { grid-template-columns: 1fr; }
  .builder-body { padding: 16px; }
  .kb-editor aside { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-form, .profile-preview, .kb-workbench, .compile-summary { grid-template-columns: 1fr; }
  .kb-workbench textarea { border-right: 0; border-bottom: 1px solid var(--line); }
  .policy-editor > div { grid-template-columns: 1fr; }
  .schema-editor-columns, .examples-preview { grid-template-columns: 1fr; }
  .mapping-editor > div { grid-template-columns: 1fr; }
  .tenant-header, .workspace-heading { align-items: stretch; flex-direction: column; }
  .tenant-workspace-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: hidden; }
  .member-summary, .member-invite-form, .ownership-form, .enterprise-verification-form, .enterprise-review-row { grid-template-columns: 1fr; }
  .member-workflow-layout { grid-template-columns: 1fr; }
  .member-workflow-aside { padding: 14px; }
  .member-row { grid-template-columns: 1fr; align-items: stretch; }
  .member-row .button-row { justify-content: flex-start; }
  .permission-matrix > div { min-width: 0; grid-template-columns: 1fr; }
  .tenant-header-actions { width: 100%; flex-wrap: wrap; }
  .tenant-header-actions [data-current-member-role] { flex: 0 0 100%; }
  .tenant-header-actions button { min-width: 0; flex: 1 1 96px; }
  .tenant-overview { grid-template-columns: 1fr; }
  .tenant-overview > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .tenant-overview > div:last-child { border-bottom: 0; }
  .workspace-heading > span { text-align: left; }
  .tenant-workspace-nav { width: 100%; margin-left: 0; margin-right: 0; border-radius: 6px; }
  .tenant-section-grid { min-width: 0; width: 100%; }
  .tenant-section-grid .integration-code code { white-space: normal; overflow-wrap: anywhere; }
  .admin-dashboard[data-admin-dashboard="tenant"],
  .tenant-section-grid,
  .tenant-section-grid > .panel,
  .capability-list,
  .owned-package-list,
  .monitor-list { max-width: 100%; min-width: 0; }
  .capability-item,
  .owned-package-item,
  .monitor-row { min-width: 0; grid-template-columns: 1fr; align-items: stretch; }
  .capability-item .button-row,
  .owned-package-item .button-row,
  .monitor-row .button-row { flex-wrap: wrap; }
  .developer-doc-page { min-height: 100vh; }
  .developer-doc-page-header { position: relative; grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .developer-doc-back { justify-self: start; }
  .developer-doc-page-title { width: 100%; max-width: 100%; }
  .developer-doc-actions { width: 100%; justify-content: flex-start; }
  .developer-doc-actions button { min-width: 0; flex: 1 1 110px; }
  .developer-doc-layout { width: 100%; margin: 0; grid-template-columns: 1fr; gap: 0; }
  .developer-doc-toc { position: sticky; top: 0; z-index: 25; max-height: none; border-right: 0; border-left: 0; }
  .developer-doc-toc-toggle { width: 100%; min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border: 0; background: #fff; color: var(--ink); font-weight: 750; }
  .developer-doc-toc-list { display: none; max-height: min(58vh, 440px); padding: 8px; border-top: 1px solid var(--line); }
  .developer-doc-toc.open .developer-doc-toc-list { display: grid; }
  .developer-doc-reader { width: 100%; border-right: 0; border-left: 0; }
  .developer-doc-page .integration-markdown-view { min-width: 0; padding: 20px 16px 48px; overflow-wrap: anywhere; }
  .developer-doc-content h1[id], .developer-doc-content h2[id], .developer-doc-content h3[id] { scroll-margin-top: 64px; }
  .developer-doc-content pre { max-width: 100%; }
}
.api-feedback {
  margin-top: 10px;
  color: #147a52;
  font-size: 13px;
}

.api-feedback.error { color: #b42318; }
.tenant-api-key-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 78%, transparent);
}
.tenant-api-key-form .span-2,
.tenant-api-key-edit .span-2 { grid-column: 1 / -1; }
.tenant-api-form-note { align-self: center; color: var(--muted); font-size: 12px; }
.tenant-api-key-list, .tenant-api-request-list, .tenant-api-error-list { display: grid; gap: 12px; }
.tenant-api-doc-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-solid); }
.tenant-api-doc-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; background: #e9f7ef; color: #147a52; font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.tenant-api-doc-card h3 { margin: 0 0 7px; }
.tenant-api-doc-card p { margin: 0 0 7px; color: var(--muted); line-height: 1.6; }
.tenant-api-doc-card small { color: var(--muted); }
.tenant-api-doc-page { min-height: calc(100vh - 48px); }
.tenant-api-doc-reader { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 56px; }
.tenant-api-doc-page-header { grid-template-columns: auto minmax(0, 1fr) auto; }
.tenant-api-request-detail-filter { grid-template-columns: minmax(180px, 280px) auto; justify-content: start; }
.tenant-api-key-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-solid); }
.tenant-api-key-card > header { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.tenant-api-key-card > header div { display: grid; gap: 5px; min-width: 0; }
.tenant-api-key-card code { overflow-wrap: anywhere; color: var(--muted); }
.tenant-api-key-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0; color: var(--muted); font-size: 12px; }
.tenant-api-warning { display: block; padding: 9px 11px; margin: 10px 0; border: 1px solid #e8ba72; border-radius: 6px; background: #fff7e8; color: #8a4b08; font-size: 13px; }
.tenant-api-key-edit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tenant-api-key-edit label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; }
.tenant-api-key-edit input, .tenant-api-key-edit select, .tenant-api-key-edit textarea { width: 100%; min-width: 0; }
.tenant-api-endpoint { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.tenant-api-endpoint > span { padding: 5px 8px; border-radius: 5px; background: #e9f7ef; color: #147a52; font-weight: 700; }
.tenant-api-endpoint code { overflow-wrap: anywhere; }
.tenant-api-contract-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.tenant-api-contract-grid article { padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.tenant-api-contract-grid h3, .tenant-api-doc-block h3, .tenant-api-errors-head h3 { margin: 0 0 8px; }
.tenant-api-contract-grid p { margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tenant-api-doc-block { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tenant-api-doc-block > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.tenant-api-doc-block > div h3 { margin: 0; }
.tenant-api-doc-block pre, .tenant-api-error-item pre { margin: 0; padding: 15px; max-width: 100%; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #101923; color: #e6edf3; font-size: 12px; line-height: 1.6; }
.tenant-api-errors-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin: 22px 0 12px; }
.tenant-api-errors-head p { margin: 0; color: var(--muted); }
.tenant-api-error-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tenant-api-error-item summary { display: grid; grid-template-columns: 82px minmax(150px, .6fr) auto minmax(180px, 1fr); gap: 10px; align-items: center; padding: 12px 14px; cursor: pointer; }
.tenant-api-error-item > div { padding: 12px; border-top: 1px solid var(--line); }
.tenant-api-error-item > div button { margin-bottom: 10px; }
.tenant-api-http-status { font-weight: 700; }
.tenant-api-request-row { display: grid; grid-template-columns: 1.3fr 1fr .8fr 1fr 1fr; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.tenant-api-request-row.header { background: color-mix(in srgb, var(--panel-solid) 75%, transparent); }
.tenant-api-request-row > div { display: grid; gap: 4px; min-width: 0; }
.tenant-api-request-row code { overflow-wrap: anywhere; }
.tenant-api-request-row small { color: var(--muted); }
.tenant-api-secret-body { padding: 22px; display: grid; gap: 16px; }
.tenant-api-secret-body > code { display: block; padding: 16px; border: 1px solid #e8ba72; border-radius: 7px; background: #fff7e8; color: #5d350b; overflow-wrap: anywhere; user-select: all; }
.tenant-api-secret-body p { margin: 0; color: var(--muted); }
.tenant-api-secret-dialog { max-width: 720px; }
@media (max-width: 720px) {
  .tenant-api-key-form, .tenant-api-key-edit, .tenant-api-contract-grid { grid-template-columns: 1fr; }
  .tenant-api-doc-card { grid-template-columns: auto minmax(0, 1fr); }
  .tenant-api-doc-card > .tag { justify-self: start; }
  .tenant-api-doc-card > button { grid-column: 1 / -1; width: 100%; }
  .tenant-api-doc-reader { width: 100%; padding: 14px 12px 40px; }
  .tenant-api-doc-page-header { grid-template-columns: 1fr; align-items: stretch; }
  .tenant-api-doc-page-header > .tag { justify-self: start; }
  .tenant-api-request-detail-filter { grid-template-columns: 1fr; }
  .tenant-api-key-form .span-2, .tenant-api-key-edit .span-2 { grid-column: auto; }
  .tenant-api-endpoint { grid-template-columns: auto minmax(0, 1fr); }
  .tenant-api-endpoint button { grid-column: 1 / -1; width: 100%; }
  .tenant-api-error-item summary { grid-template-columns: 1fr auto; }
  .tenant-api-error-item summary > span:last-child { grid-column: 1 / -1; }
  .tenant-api-request-row, .tenant-api-request-row.header { grid-template-columns: 1fr; }
  .tenant-api-request-row.header { display: none; }
  .tenant-api-doc-block > div, .tenant-api-errors-head { align-items: stretch; flex-direction: column; }
  .tenant-api-doc-block > div button { width: 100%; }
}
.bubble-image { display: block; width: 100%; max-height: 420px; object-fit: contain; border: 1px solid var(--line); }
.bubble-frame { display: block; width: 100%; height: 420px; min-height: 240px; max-height: 25000px; border: 1px solid var(--line); }
.bubble-key-values { display: grid; gap: 8px; margin: 10px 0; }
.bubble-key-values > div { display: grid; grid-template-columns: minmax(100px, .4fr) 1fr; gap: 16px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.bubble-key-values dt { color: var(--muted); }
.bubble-key-values dd { margin: 0; font-weight: 650; }
.bubble-alert { padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 8px; background: color-mix(in srgb, var(--panel-solid) 94%, var(--blue) 6%); }
.bubble-alert.warning, .bubble-alert.error { border-left-color: var(--orange); }
.bubble-alert p { margin: 5px 0 0; }
.bubble-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.bubble-progress progress { width: 100%; }
.bubble-divider { border: 0; border-top: 1px solid var(--line); }
.bubble-micro-app { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
.bubble-micro-app-title { display: flex; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 700; }
.bubble-micro-app-title small, .bubble-micro-app [data-micro-app-state] { color: var(--muted); font-size: 11px; }
.bubble-micro-app [data-micro-app-state] { padding: 6px 12px; border-top: 1px solid var(--line); }
.bubble-micro-app .bubble-frame { border: 0; }
.micro-app-load-state { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.micro-app-load-state span { font-weight: 700; }
.micro-app-load-state small { flex: 1 1 auto; color: var(--danger); overflow-wrap: anywhere; }
.micro-app-load-state .text-button { min-height: 36px; margin-left: auto; }
.micro-app-load-state.ready { color: var(--green); }
.micro-app-load-state.failed { color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--panel-solid)); }
.page-state-host { max-width: 100%; min-width: 0; }
.page-state-frame-shell { position: relative; min-width: 0; overflow: hidden; }
.page-state-frame-shell.page-state-frame-lock::after { content: "页面编辑已锁定"; position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--panel-solid) 72%, transparent); color: var(--ink); font-size: 13px; font-weight: 700; text-align: center; }
.page-state-frame-lock .bubble-frame { pointer-events: none; }
.page-state-track { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; min-width: 0; padding: 10px 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--panel-solid) 96%, var(--bg) 4%); }
.page-state-status { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; color: var(--muted); transition: color 180ms ease, opacity 180ms ease; }
.page-state-status i { width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid currentColor; border-radius: 50%; }
.page-state-status span { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.page-state-status small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.page-state-status.ready { color: var(--green); }
.page-state-status.dirty { color: var(--orange); }
.page-state-status.syncing,
.page-state-status.finalizing { color: var(--blue); }
.page-state-status.syncing i,
.page-state-status.finalizing i { border-right-color: transparent; animation: callback-spin .8s linear infinite; }
.page-state-status.submitted { color: var(--green); }
.page-state-status.cancelled { color: var(--muted); }
.page-state-status.error { color: var(--danger); }
.page-state-status.error i { border-radius: 2px; transform: rotate(45deg); }
.page-state-track .text-button { min-height: 44px; flex: 0 0 auto; }
.page-state-error { padding: 10px 12px; border-top: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); color: var(--danger); background: color-mix(in srgb, var(--danger) 7%, var(--panel-solid)); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.page-state-footer { display: grid; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.page-state-footer-action { display: grid; grid-template-columns: minmax(0, auto) minmax(140px, auto); justify-content: end; gap: 8px; }
.page-state-footer button { min-height: 44px; }
.page-state-footer button:focus-visible,
.page-state-track button:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
@media (max-width: 600px) {
  .page-state-track { align-items: stretch; flex-direction: column; }
  .page-state-status { flex-wrap: wrap; }
  .page-state-status small { width: 100%; margin-left: 18px; white-space: normal; }
  .page-state-track .text-button { width: 100%; }
  .page-state-footer-action { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-state-footer button { width: 100%; white-space: normal; }
}
@media (max-width: 360px) {
  .page-state-footer-action { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .page-state-status { transition: none; }
  .page-state-status.syncing i,
  .page-state-status.finalizing i { animation: none; border-right-color: currentColor; }
}
.live-action-card { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--panel-solid) 94%, var(--blue) 6%); }
.live-action-card > label, .live-action-card fieldset { display: grid; gap: 8px; margin: 0; }
.live-action-card textarea { width: 100%; min-height: 96px; resize: vertical; }
.temporal-action,
[data-mixed-input] { min-width: 0; max-width: 100%; }
.temporal-field { min-width: 0; display: grid; gap: 7px; }
.temporal-field > label { display: block; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.45; }
.required-text { color: var(--muted); font-size: 11px; font-weight: 600; }
.temporal-control { width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: var(--panel-solid); color: var(--ink); }
.temporal-control:hover { border-color: color-mix(in srgb, var(--blue) 42%, var(--line)); }
.temporal-control:focus-visible { border-color: var(--blue); outline: 3px solid color-mix(in srgb, var(--blue) 24%, transparent); outline-offset: 2px; }
.temporal-control:disabled { cursor: not-allowed; background: var(--panel-soft); color: var(--muted); opacity: .72; }
.temporal-range { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.temporal-range-days { grid-column: 1 / -1; min-height: 1.25em; color: var(--muted); font-size: 11px; }
.temporal-helper { min-height: 1.25em; color: var(--muted); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.temporal-semantics { min-width: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 12px; border-left: 3px solid var(--blue); border-radius: 7px; background: color-mix(in srgb, var(--blue) 7%, var(--panel-solid)); color: var(--muted); font-size: 12px; }
.temporal-semantics span { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; overflow-wrap: anywhere; }
.temporal-semantics b { color: var(--ink); }
.temporal-semantics i { font-style: normal; }
.temporal-error { color: var(--danger); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; transition: opacity .18s ease; }
.temporal-field.invalid .temporal-control { border-color: var(--danger); }
.temporal-form-error { padding: 8px 10px; border-radius: 7px; background: color-mix(in srgb, var(--danger) 8%, transparent); }
.temporal-action > .button-row,
[data-mixed-input] > .button-row { justify-content: flex-end; }
.temporal-action button,
[data-mixed-input] > .button-row button { min-height: 44px; }
.temporal-readonly-value { min-width: 0; display: grid; gap: 8px; margin: 0; }
.temporal-readonly-value > div { min-width: 0; display: grid; grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr); gap: 8px 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.temporal-readonly-value dt { color: var(--muted); }
.temporal-readonly-value dd { min-width: 0; margin: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
@media (max-width: 639px) {
  .temporal-range { grid-template-columns: 1fr; }
  .temporal-semantics { display: grid; }
  .temporal-readonly-value > div { grid-template-columns: 1fr; gap: 3px; }
  .temporal-action > .button-row .primary,
  [data-mixed-input] > .button-row .primary { flex: 1 1 100%; order: 2; }
}
@media (prefers-reduced-motion: reduce) {
  .temporal-control,
  .temporal-error { transition: none; }
}
.callback-state { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px; font-size: 13px; }
.callback-state.processing { color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); }
.callback-state.processing i { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: callback-spin .8s linear infinite; }
.callback-state.success { color: var(--green); background: var(--green-weak); }
.callback-state.cancelled { color: var(--muted); background: color-mix(in srgb, var(--muted) 8%, transparent); }
.callback-state.failed { justify-content: space-between; flex-wrap: wrap; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.callback-secret-management { display: grid; gap: 8px; margin: 14px 0; padding: 14px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--blue) 6%, transparent); }
.callback-secret-management p { margin: 0; color: var(--muted); }
.submitted-value { color: var(--muted); }
@keyframes callback-spin { to { transform: rotate(360deg); } }
.mermaid-visual { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 96%, var(--blue) 4%), var(--panel-solid)); overflow: hidden; }
.mermaid-visual figcaption { margin-bottom: 14px; font-weight: 700; color: var(--text); }
.sequence-actors { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 8px; margin-bottom: 14px; }
.sequence-actors span { padding: 9px; border-radius: 8px; text-align: center; color: var(--blue); background: color-mix(in srgb, var(--blue) 9%, transparent); font-weight: 700; }
.sequence-visual ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: event; }
.sequence-visual li { display: grid; grid-template-columns: 24px minmax(90px,.8fr) 24px minmax(90px,.8fr) minmax(180px,2fr); gap: 8px; align-items: center; padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--line) 32%, transparent); counter-increment: event; }
.sequence-visual li::before { content: counter(event); color: var(--muted); font-size: 12px; }
.sequence-visual li.reply { background: color-mix(in srgb, var(--green) 7%, transparent); }
.sequence-visual li i, .state-transition i { color: var(--blue); font-style: normal; text-align: center; }
.sequence-visual li b { font-weight: 500; }
.state-visual { display: grid; gap: 8px; }
.state-transition { display: grid; grid-template-columns: minmax(140px,1fr) 30px minmax(140px,1fr) minmax(180px,1.4fr); align-items: center; gap: 8px; }
.state-transition span { padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 999px; text-align: center; font-family: ui-monospace, monospace; font-size: 12px; }
.state-transition b { font-size: 12px; color: var(--muted); }
@media (max-width: 680px) { .sequence-visual li { grid-template-columns: 1fr 20px 1fr; } .sequence-visual li::before { display:none; } .sequence-visual li b { grid-column:1/-1; } .state-transition { grid-template-columns:1fr 24px 1fr; } .state-transition b { grid-column:1/-1; } }
.platform-header-actions,
.platform-user-form,
.cleanup-search { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.platform-header-actions { align-items: center; }
.platform-user-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; margin: 18px 0; }
.platform-user-list { display: grid; border-top: 1px solid var(--line); }
.platform-user-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px 120px 80px; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.platform-user-row > div { display: grid; gap: 4px; min-width: 0; }
.platform-user-row small { color: var(--muted); }
.cleanup-search .field { min-width: min(360px, 100%); }
.cleanup-target { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 20px 0; background: var(--line); border: 1px solid var(--line); }
.cleanup-target > div { display: grid; gap: 7px; padding: 14px; background: var(--panel); }
.cleanup-target span { color: var(--muted); font-size: 12px; }
.cleanup-counts { display: grid; border-top: 1px solid var(--line); }
.cleanup-counts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cleanup-counts code { overflow-wrap: anywhere; }
.cleanup-danger { margin: 18px 0; padding: 16px; border-left: 4px solid #c43d32; background: #fff4f2; }
.cleanup-danger ul,
.cleanup-impact { margin: 10px 0 14px; padding-left: 20px; }
.cleanup-oss-note { color: var(--muted); font-size: 13px; }
button.danger { min-height: 38px; padding: 0 14px; border: 1px solid #b42318; border-radius: 8px; background: #b42318; color: #fff; }
.cleanup-complete { padding: 18px; border-left: 4px solid var(--green); background: #f0faf5; }
#platform-admin .admin-grid,
#platform-admin .admin-grid > .panel,
#platform-admin .panel-title > div,
#platform-admin .enterprise-review-list,
#platform-admin .enterprise-review-row,
#platform-admin .enterprise-review-row > * { min-width: 0; max-width: 100%; }
#platform-admin .admin-grid > .panel { width: 100%; }
#platform-admin .enterprise-review-row b,
#platform-admin .enterprise-review-row small,
#platform-admin .panel-subtitle { overflow-wrap: anywhere; }
#platform-admin .enterprise-review-row input { width: 100%; max-width: 100%; }

@media (max-width: 720px) {
  .platform-user-form,
  .platform-user-row,
  .cleanup-target { grid-template-columns: 1fr; }
  .platform-user-row { align-items: stretch; }
  .platform-user-row button { width: 100%; }
  .platform-header-actions { width: 100%; justify-content: space-between; }
  .platform-workspace-nav { grid-template-columns: 1fr; }
  #platform-admin .panel-title { align-items: flex-start; flex-direction: column; }
  #platform-admin .compact-actions { width: 100%; max-width: 100%; }
  #platform-admin .compact-actions > * { min-width: 0; max-width: 100%; }
}
