:root {
  --surface: #ffffff;
  --rail: #ffffff;
  --rail-hover: #f1f3f4;
  --input: #ffffff;
  --text: #1f1f1f;
  --muted: #444746;
  --subtle: #5f6368;
  --border: #d8dde3;
  --blue: #0b57d0;
  --shadow: 0 2px 7px rgba(60, 64, 67, 0.16), 0 1px 2px rgba(60, 64, 67, 0.18);
  --rail-width: 280px;
}

/* Final scheduler overrides: keep the management flow readable after legacy styles. */
.workspace-view[data-view="channel-scheduler"] .workspace-content { gap: 16px; }
.scheduler-policy-panel { gap: 16px; margin: 0; border: 1px solid #dfe6ef; border-radius: 10px; padding: 18px; background: #fff; box-shadow: 0 5px 18px rgba(35,57,88,.045); }
.scheduler-policy-head { align-items: flex-start; border: 0; padding: 0; }
.scheduler-policy-head h2 { color: #1f3150; font-size: 19px; letter-spacing: 0; }
.scheduler-policy-head > div > span { display: block; max-width: 540px; margin-top: 5px; color: #7b899e; font-size: 12px; }
.scheduler-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; border-top: 1px solid #edf1f6; padding-top: 15px; }
.scheduler-policy-readout { display: grid; align-content: center; gap: 3px; min-width: 0; border-left: 3px solid #b8c9e6; padding-left: 11px; }
.scheduler-policy-readout span, .scheduler-policy-readout small { overflow: hidden; color: #7b899e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-policy-readout strong { color: #2e4772; font-size: 15px; font-weight: 700; }
.scheduler-policy-summary { padding: 0; background: transparent; }
.scheduler-policy-actions { align-items: center; gap: 8px; border-top: 1px solid #edf1f6; padding-top: 14px; }
.scheduler-disable-check { margin-right: auto; color: #62728a; font-size: 11px; }
.scheduler-source-details { border-color: #e3e9f1; background: #fafbfd; }
.scheduler-source-details > summary { min-height: 36px; padding: 0 12px; color: #52617b; font-size: 12px; line-height: 36px; }
.scheduler-source-details .scheduler-credential-grid { border-bottom: 0; padding: 13px 12px 8px; }
.scheduler-source-details .scheduler-policy-actions { border-top: 0; padding: 0 12px 13px; }
.scheduler-channels-section { gap: 12px; }
.scheduler-channels-section > .admin-toolbar { align-items: center; min-height: 48px; margin: 0; border: 1px solid #dfe6ef; border-radius: 9px; padding: 9px 12px; background: #fff; }
.scheduler-channels-section > .workspace-note { margin: -2px 2px 0; color: #7b899e; font-size: 11px; }
.scheduler-selection-count { margin-right: auto; color: #5c6d86; font-size: 11px; white-space: nowrap; }
.scheduler-select-head, .scheduler-select-cell { width: 38px; padding-right: 3px !important; padding-left: 12px !important; text-align: center; }
.scheduler-select-cell input, .scheduler-select-head input { width: 15px; height: 15px; margin: 0; accent-color: #3155bd; vertical-align: middle; }
.scheduler-rank-cell { width: 44px; color: #8693a6; font-variant-numeric: tabular-nums; }
.scheduler-channels-section > .data-table-wrap { border: 1px solid #dfe6ef; border-radius: 9px; box-shadow: 0 4px 14px rgba(35,57,88,.035); }
.scheduler-channels-section .data-table { min-width: 980px; }
.scheduler-channels-section .data-table th { height: 42px; background: #f7f9fc; color: #6c7a90; font-size: 11px; font-weight: 700; }
.scheduler-channels-section .data-table td { min-height: 58px; color: #3f506b; font-size: 12px; }
.scheduler-runtime-metrics { margin: 0; border: 1px solid #dfe6ef; border-radius: 9px; padding: 13px 14px; background: #fff; box-shadow: none; }
.scheduler-ratio-details { border: 1px solid #dfe6ef; border-radius: 10px; background: #fff; overflow: hidden; }
.scheduler-ratio-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 15px; color: #314664; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.scheduler-ratio-details > summary::-webkit-details-marker { display: none; }
.scheduler-ratio-details > summary::after { content: '展开'; flex: 0 0 auto; color: #71809a; font-size: 11px; font-weight: 500; }
.scheduler-ratio-details[open] > summary { border-bottom: 1px solid #e9eef5; }
.scheduler-ratio-details[open] > summary::after { content: '收起'; }
.scheduler-ratio-details > summary small { overflow: hidden; margin-left: auto; color: #8794a8; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-ratio-panel-body { display: grid; gap: 12px; padding: 13px 15px 15px; }
.scheduler-ratio-panel .ratio-detector-controls, .scheduler-ratio-panel .ratio-detector-results { border: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
.scheduler-ratio-panel .ratio-detector-control-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px minmax(180px, .7fr); align-items: end; gap: 10px; }
.scheduler-ratio-scope { display: grid; align-content: center; gap: 3px; min-height: 38px; border-left: 3px solid #b8c9e6; padding-left: 11px; }
.scheduler-ratio-scope strong { color: #3a5279; font-size: 13px; }
.scheduler-ratio-scope small { color: #8794a8; font-size: 10px; }
.scheduler-ratio-panel .workspace-note { margin: 0; padding: 0; border: 0; background: transparent; }

/* Persisted channel/group ratio policies. These rules override the earlier
   collapsible one-off gate and keep the automated workflow scannable. */
.scheduler-gate {
  display: grid;
  gap: 15px;
  margin: 0;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  padding: 17px 18px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(35, 57, 88, .045);
  overflow: visible;
}
.scheduler-gate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.scheduler-gate-head p {
  margin: 0 0 4px;
  color: #5070a7;
  font-size: 11px;
  font-weight: 700;
}
.scheduler-gate-head h2 {
  margin: 0;
  color: #1f3150;
  font-size: 19px;
  line-height: 1.25;
}
.scheduler-gate-head > div > span {
  display: block;
  max-width: 620px;
  margin-top: 5px;
  color: #7b899e;
  font-size: 12px;
  line-height: 1.5;
}
.scheduler-gate-status {
  display: grid;
  flex: 0 1 310px;
  gap: 3px;
  min-width: 220px;
  border-left: 3px solid #b8c9e6;
  padding: 4px 0 4px 11px;
}
.scheduler-gate-status > span,
.scheduler-gate-status small { color: #7b899e; font-size: 11px; }
.scheduler-gate-status strong { overflow: hidden; color: #2e4772; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-gate-status.is-ok { border-left-color: #6dad88; }
.scheduler-gate-status.is-error { border-left-color: #d88670; }
.scheduler-gate-settings {
  grid-template-columns: minmax(162px, auto) minmax(150px, 190px) minmax(280px, 1fr);
  align-items: end;
  border-top: 1px solid #edf1f6;
  padding-top: 14px;
}
.scheduler-gate-settings > label:not(.scheduler-gate-switch) {
  display: grid;
  gap: 5px;
  color: #64748c;
  font-size: 11px;
  font-weight: 650;
}
.scheduler-gate-settings label small { color: #8b98aa; font-size: 10px; font-weight: 500; }
.scheduler-gate-switch {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  color: #3f5675;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.scheduler-gate-switch input { width: 16px; height: 16px; margin: 0; accent-color: #3155bd; }
.scheduler-gate-actions { display: flex; justify-content: flex-end; gap: 8px; }
.scheduler-gate-actions button { min-height: 36px; white-space: nowrap; }
.scheduler-policy-create {
  display: grid;
  gap: 11px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  padding: 12px;
  background: #fafcff;
}
.scheduler-policy-create > div:first-child { display: grid; gap: 3px; }
.scheduler-policy-create > div:first-child strong { color: #334b70; font-size: 13px; }
.scheduler-policy-create > div:first-child span { color: #7d8ca1; font-size: 11px; }
.scheduler-policy-create-fields {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(160px, 1fr) minmax(130px, .62fr) auto;
  align-items: end;
  gap: 10px;
}
.scheduler-policy-create-fields label { display: grid; gap: 5px; color: #64748c; font-size: 11px; font-weight: 650; }
.scheduler-policy-create-fields select,
.scheduler-policy-create-fields input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #d4deeb;
  border-radius: 7px;
  padding: 0 9px;
  background: #fff;
  color: #2c405d;
  font: inherit;
  font-size: 12px;
}
.scheduler-policy-create-fields button { min-height: 36px; white-space: nowrap; }
.scheduler-policy-table-wrap { border: 1px solid #dfe6ef; border-radius: 8px; box-shadow: none; }
.scheduler-policy-table { min-width: 760px; }
.scheduler-policy-table th { height: 40px; background: #f7f9fc; color: #6c7a90; font-size: 11px; }
.scheduler-policy-table td { min-height: 52px; color: #3f506b; font-size: 12px; }
.scheduler-policy-rate { display: grid; gap: 3px; min-width: 210px; }
.scheduler-policy-rate > strong { color: #344b6f; }
.scheduler-policy-rate small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.scheduler-policy-rate .scheduler-policy-ok { color: #438260; }
.scheduler-policy-rate .scheduler-policy-over { color: #b05a43; }
.scheduler-policy-rate .scheduler-policy-waiting { color: #8491a5; }
@media (max-width: 900px) {
  .scheduler-policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scheduler-ratio-panel .ratio-detector-control-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .scheduler-ratio-scope { grid-column: 1 / -1; }
  .scheduler-gate-head { align-items: stretch; flex-direction: column; }
  .scheduler-gate-status { flex-basis: auto; min-width: 0; }
  .scheduler-gate-settings { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scheduler-gate-actions { justify-content: flex-start; grid-column: 1 / -1; }
  .scheduler-policy-create-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .scheduler-policy-panel { padding: 15px; }
  .scheduler-policy-grid, .scheduler-ratio-panel .ratio-detector-control-row { grid-template-columns: 1fr; }
  .scheduler-policy-actions { align-items: stretch; flex-direction: column; }
  .scheduler-policy-actions button, .scheduler-disable-check { width: 100%; margin-right: 0; }
  .scheduler-channels-section > .admin-toolbar { align-items: stretch; flex-wrap: wrap; }
  .scheduler-selection-count { order: 2; width: 100%; }
  .scheduler-channels-section > .admin-toolbar .table-actions { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .scheduler-ratio-details > summary { align-items: flex-start; flex-wrap: wrap; min-height: 0; padding: 10px 13px; line-height: 1.45; }
  .scheduler-ratio-details > summary small { flex: 1 1 100%; margin-left: 0; }
  .scheduler-ratio-panel-body { padding: 12px 13px 14px; }
  .scheduler-gate { padding: 14px; }
  .scheduler-gate-settings, .scheduler-policy-create-fields { grid-template-columns: 1fr; }
  .scheduler-gate-actions { grid-column: auto; flex-wrap: wrap; }
  .scheduler-gate-actions button, .scheduler-policy-create-fields button { flex: 1 1 auto; width: 100%; }
}

/* Managed-channel workflow: inspection belongs beside the channel it operates on. */
.channel-probe-intro { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; border-bottom: 1px solid #dfe6ef; padding: 0 2px 16px; }
.channel-probe-intro > div:first-child { display: grid; min-width: 0; gap: 5px; }
.channel-probe-intro strong { color: #243653; font-size: 16px; }
.channel-probe-intro span { max-width: 720px; color: #687891; font-size: 12px; line-height: 1.55; }
.channel-resource-table { min-width: 1160px; }
.channel-probe-summary { display: grid; min-width: 180px; gap: 4px; color: #53657f; }
.channel-probe-summary strong { overflow: hidden; color: #314667; font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.channel-probe-summary small { overflow: hidden; color: #7a89a0; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.channel-probe-summary.is-loading strong { color: #2d5db5; }
.channel-probe-summary.is-healthy strong { color: #24724d; }
.channel-probe-summary.is-unhealthy strong { color: #a7503f; }
.sub2-channel-form { display: grid; gap: 18px; }
.native-drawer .sub2-channel-form { padding: 30px 28px 34px; }
.sub2-channel-form-head { display: grid; gap: 4px; border-bottom: 1px solid #e4eaf3; padding-bottom: 15px; }
.sub2-channel-form-head p { margin: 0; color: #5270aa; font-size: 11px; font-weight: 700; }
.sub2-channel-form-head h2 { margin: 0; color: #263957; font-size: 20px; }
.sub2-channel-form-head span, .sub2-channel-form .form-help-text { margin: 0; color: #718098; font-size: 12px; line-height: 1.6; }
.sub2-channel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sub2-channel-form-grid label { display: grid; gap: 6px; min-width: 0; color: #5c6d86; font-size: 12px; font-weight: 650; }
.sub2-channel-form-grid input { min-width: 0; min-height: 38px; border: 1px solid #d5dfeb; border-radius: 7px; padding: 0 10px; background: #fff; color: #253751; font: inherit; }
.sub2-channel-form-grid input:focus { border-color: #6180ca; outline: 3px solid rgba(79, 112, 194, .12); }
.sub2-channel-form-wide { grid-column: 1 / -1; }

.workspace-view[data-view="channel-scheduler"] .workspace-content { gap: 18px; }
.scheduler-quick-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; border-bottom: 1px solid #dfe6ef; padding: 0 2px 18px; }
.scheduler-quick-panel > div { display: grid; gap: 6px; min-width: 0; }
.scheduler-quick-panel h2 { margin: 0; color: #223653; font-size: 20px; line-height: 1.25; }
.scheduler-quick-panel p { max-width: 680px; margin: 0; color: #687891; font-size: 12px; line-height: 1.65; }
.scheduler-flow { display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
.scheduler-flow li { display: grid; min-width: 126px; gap: 4px; border-left: 1px solid #dfe6ef; padding: 1px 13px; }
.scheduler-flow li:last-child { padding-right: 0; }
.scheduler-flow strong { color: #344b6c; font-size: 12px; }
.scheduler-flow span { color: #8090a6; font-size: 10px; line-height: 1.35; }
.scheduler-gate { border: 1px solid #dde5ef; border-radius: 8px; background: #fff; overflow: hidden; }
.scheduler-gate > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 46px; padding: 0 15px; color: #405574; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.scheduler-gate > summary::-webkit-details-marker { display: none; }
.scheduler-gate > summary small { color: #7d8ba0; font-size: 11px; font-weight: 500; }
.scheduler-gate[open] > summary { border-bottom: 1px solid #e6ebf2; }
.scheduler-gate-body { display: grid; gap: 12px; padding: 14px 15px; }
.scheduler-gate-body > p { margin: 0; color: #66768e; font-size: 12px; line-height: 1.5; }
.scheduler-gate-controls { display: grid; grid-template-columns: minmax(190px, 1fr) 160px minmax(210px, auto) auto; align-items: end; gap: 10px; }
.scheduler-gate-controls > label:not(.scheduler-disable-check) { display: grid; gap: 6px; color: #64748c; font-size: 11px; font-weight: 650; }
.scheduler-gate-controls select, .scheduler-gate-controls input[type="number"] { min-width: 0; min-height: 36px; border: 1px solid #d4deeb; border-radius: 7px; padding: 0 9px; background: #fff; color: #2c405d; font: inherit; font-size: 12px; }
.scheduler-gate-controls select:focus, .scheduler-gate-controls input[type="number"]:focus { border-color: #6682c9; outline: 3px solid rgba(79, 112, 194, .12); }
.scheduler-gate-controls .scheduler-disable-check { display: flex; align-items: center; min-height: 36px; gap: 7px; margin: 0; color: #5f6f87; font-size: 12px; }
.scheduler-gate-controls .connection-primary { min-height: 36px; white-space: nowrap; }
.scheduler-channels-section { display: grid; gap: 10px; }
.scheduler-channel-toolbar { display: flex; align-items: end; gap: 12px; }
.scheduler-channel-toolbar .scheduler-filter { display: grid; flex: 0 0 180px; gap: 5px; color: #697990; font-size: 11px; font-weight: 650; }
.scheduler-channel-toolbar .scheduler-filter select { min-height: 36px; border: 1px solid #d5dfeb; border-radius: 7px; padding: 0 9px; background: #fff; color: #314664; font: inherit; font-size: 12px; }
.scheduler-channel-toolbar .scheduler-selection-count { margin-right: auto; padding-bottom: 10px; color: #728199; font-size: 12px; white-space: nowrap; }
.scheduler-channel-toolbar .table-actions { justify-content: flex-end; }
.scheduler-channels-section > .workspace-note { margin: 0; padding: 0 1px; border: 0; background: transparent; color: #74839a; font-size: 11px; }
.scheduler-channels-section > .data-table-wrap { border: 1px solid #dfe6ef; border-radius: 8px; box-shadow: none; scrollbar-gutter: stable both-edges; }
.scheduler-channel-table { min-width: 1230px; }
.scheduler-channel-table th { background: #f7f9fc; color: #6c7a90; font-size: 11px; }
.scheduler-channel-table td { color: #40516c; font-size: 12px; vertical-align: middle; }
.scheduler-channel-table td:nth-child(3) { min-width: 220px; }
.scheduler-channel-table .table-actions { flex-wrap: nowrap; }
.scheduler-priority-control { display: grid; grid-template-columns: 70px auto; align-items: center; gap: 6px; }
.scheduler-priority-control input { width: 70px; min-height: 32px; border: 1px solid #d7e0ec; border-radius: 6px; padding: 0 7px; color: #2d405d; font: inherit; font-size: 12px; }
.scheduler-priority-control button { min-height: 32px; border: 1px solid #d7e0ec; border-radius: 6px; padding: 0 9px; background: #fff; color: #50647f; font: inherit; font-size: 11px; cursor: pointer; }
.scheduler-priority-control button:hover { border-color: #9eb2d9; color: #3157a6; }

@media (max-width: 900px) {
  .channel-probe-intro, .scheduler-quick-panel { align-items: flex-start; flex-direction: column; }
  .scheduler-quick-panel { grid-template-columns: 1fr; }
  .scheduler-flow { width: 100%; }
  .scheduler-flow li { flex: 1 1 0; }
  .scheduler-gate-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .scheduler-gate-controls .scheduler-disable-check { grid-column: 1 / -1; }
  .scheduler-channel-toolbar { flex-wrap: wrap; }
  .scheduler-channel-toolbar .scheduler-selection-count { flex: 1 1 auto; margin-right: 0; }
}

@media (max-width: 600px) {
  .channel-probe-intro { gap: 12px; }
  .channel-probe-intro .table-actions, .scheduler-channel-toolbar .table-actions { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .native-drawer .sub2-channel-form { padding: 24px 20px 28px; }
  .sub2-channel-form-grid { grid-template-columns: 1fr; }
  .sub2-channel-form-wide { grid-column: auto; }
  .scheduler-flow { overflow-x: auto; padding-bottom: 3px; }
  .scheduler-flow li { min-width: 140px; }
  .scheduler-gate-controls { grid-template-columns: 1fr; }
  .scheduler-gate-controls .scheduler-disable-check { grid-column: auto; }
  .scheduler-gate-controls .connection-primary { width: 100%; }
  .scheduler-channel-toolbar { align-items: stretch; }
  .scheduler-channel-toolbar .scheduler-filter { flex-basis: 100%; }
  .scheduler-channel-toolbar .scheduler-selection-count { padding-bottom: 0; }
}

* { box-sizing: border-box; }

html, body, #root { min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: var(--surface);
  font-family: "Google Sans", "Google Sans Text", Roboto, "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--surface);
  transition: grid-template-columns 220ms cubic-bezier(.2, 0, 0, 1);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--rail);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px 16px;
  gap: 8px;
}

.icon-button, .send-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #444746;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-button:hover, .send-button:not(:disabled):hover { background: rgba(60, 64, 67, .1); }
.icon-button:active, .send-button:not(:disabled):active { transform: scale(.94); }
.icon-button:focus-visible, .nav-item:focus-visible, .conversation:focus-visible, .brand:focus-visible, .mode-button:focus-visible, .upgrade-button:focus-visible, .connection-button:focus-visible, .login-button:focus-visible, .auth-mode-toggle:focus-visible, .connection-panel button:focus-visible, .connection-panel input:focus-visible, .connection-panel select:focus-visible, .side-popover a:focus-visible, .side-popover button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.grid-icon { stroke-width: 0; fill: currentColor; }

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  border: 0;
  padding: 6px 4px;
  border-radius: 18px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
  font-weight: 500;
  white-space: nowrap;
}

.brand img { width: 28px; height: 28px; flex: 0 0 auto; }

.sidebar-scroll { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px 16px; scrollbar-width: thin; scrollbar-color: #b7c5df transparent; overscroll-behavior: contain; }

.nav-item, .conversation, .show-more {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 22px;
  padding: 0 12px;
  background: transparent;
  color: #303030;
  cursor: pointer;
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  transition: background 140ms ease, color 140ms ease, transform 160ms ease;
}

.nav-item:hover { background: rgba(68, 71, 70, .08); transform: translateX(2px); }
.nav-item.active { background: #f1f3f4; color: #202124; font-weight: 600; }
.nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.nav-item.content-open { background: #f8fafd; color: #202124; }
.nav-disclosure { margin-left: auto; width: 16px !important; height: 16px !important; color: #5f6368; transition: transform 160ms ease; }
.content-open .nav-disclosure { transform: rotate(180deg); }
.new-chat { margin-bottom: 8px; background: #f1f3f4; color: #202124; font-weight: 500; }
.new-chat:hover { background: #e6e9ed; }

.primary-nav { display: grid; gap: 4px; }
.admin-nav-section { display: grid; gap: 4px; margin: 18px 0 0; border-top: 1px solid #e7eaed; padding-top: 16px; }
.admin-nav-section[hidden] { display: none !important; }
.admin-nav-section .section-label { margin: 0 12px 4px; }
.admin-nav-section .nav-item { min-height: 38px; padding-left: 14px; }
.admin-nav-section .nav-item[data-root-required][hidden] { display: none; }
.recent-section { margin-top: 22px; }
.section-label { padding: 0 12px 8px; color: var(--subtle); font-size: 13px; font-weight: 500; }
.recent-empty { padding: 2px 12px; color: #80868b; font-size: 13px; line-height: 20px; }
.recent-empty[hidden] { display: none; }
.recent-conversation { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; text-align: left; }
.recent-conversation-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-conversation small { flex: 0 0 auto; color: #8a96aa; font-size: 10px; }

.sidebar-foot { padding: 10px 12px 18px; }

.workspace { position: relative; min-width: 0; min-height: 100dvh; overflow: hidden; }
.topbar { position: relative; z-index: 3; display: flex; align-items: center; min-height: 72px; padding: 12px 24px; gap: 12px; }
.topbar-spacer { flex: 1; }
.connection-anchor, .settings-anchor { position: relative; }
.guest-status { display: inline-flex; align-items: center; min-height: 34px; max-width: 230px; overflow: hidden; border: 1px solid #e5e8ec; border-radius: 17px; padding: 0 12px; background: #f8fafd; color: #5f6368; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.login-button { min-height: 38px; border: 1px solid #0b57d0; border-radius: 19px; padding: 0 15px; background: #0b57d0; color: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.login-button:hover { background: #0842a0; }
.connection-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; border: 1px solid #c4c7c5; border-radius: 20px; padding: 0 13px; background: #fff; color: #303030; cursor: pointer; font-size: 13px; font-weight: 500; }
.connection-button:hover { background: #f8fafd; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; }
.connection-dot[data-state="connected"] { background: #188038; }
.connection-dot[data-state="warning"], .connection-dot[data-state="pending"] { background: #f9ab00; }
.connection-dot[data-state="checking"] { background: #1a73e8; animation: pulse 1.1s ease-in-out infinite; }
.connection-dot[data-state="error"] { background: #d93025; }
.connection-panel { position: absolute; z-index: 16; top: 50px; right: 0; width: min(368px, calc(100vw - 32px)); border: 1px solid #dadce0; border-radius: 12px; padding: 18px; background: #fff; box-shadow: 0 7px 20px rgba(60, 64, 67, .24); }
.connection-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.connection-panel-head h2 { margin: 0; color: #202124; font-size: 17px; font-weight: 600; }
.connection-panel-head p { margin: 5px 0 0; color: #5f6368; font-size: 12px; line-height: 1.45; }
.connection-state { flex: 0 0 auto; border-radius: 12px; padding: 4px 8px; background: #f1f3f4; color: #5f6368; font-size: 11px; line-height: 1.2; }
.connection-state[data-state="connected"] { background: #e6f4ea; color: #137333; }
.connection-state[data-state="warning"], .connection-state[data-state="pending"] { background: #fef7e0; color: #8a5b00; }
.connection-state[data-state="checking"] { background: #e8f0fe; color: #1967d2; }
.connection-state[data-state="error"] { background: #fce8e6; color: #b3261e; }
.connection-field { display: grid; gap: 6px; margin: 12px 0; color: #3c4043; font-size: 12px; font-weight: 500; }
.connection-field input, .connection-field select { width: 100%; min-height: 40px; border: 1px solid #c4c7c5; border-radius: 6px; padding: 0 10px; background: #fff; color: #202124; font-size: 13px; }
.connection-field input:focus, .connection-field select:focus { border-color: var(--blue); outline: 0; }
.connection-field-help { margin: -5px 0 12px; color: #6b7280; font-size: 11px; line-height: 1.45; }
.permission-toggle { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 10px; margin: 16px 0 4px; color: #202124; cursor: pointer; }
.permission-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.permission-switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #9aa0a6; transition: background 140ms ease; }
.permission-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.28); transition: transform 140ms ease; }
.permission-toggle input:checked + .permission-switch { background: var(--blue); }
.permission-toggle input:checked + .permission-switch::after { transform: translateX(16px); }
.permission-toggle b, .permission-toggle small { display: block; }
.permission-toggle b { font-size: 13px; font-weight: 600; }
.permission-toggle small { margin-top: 3px; color: var(--subtle); font-size: 11px; line-height: 1.35; }
.connection-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.connection-primary, .connection-secondary { min-height: 36px; border-radius: 18px; padding: 0 14px; cursor: pointer; font-size: 13px; font-weight: 500; }
.connection-primary { border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.connection-primary:hover { background: #0842a0; }
.connection-secondary { border: 1px solid #c4c7c5; background: #fff; color: #0b57d0; }
.connection-secondary:hover { background: #f4f8fe; }
.admin-link { display: inline-block; margin-top: 16px; border: 0; padding: 0; background: transparent; color: #0b57d0; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; }
.admin-link:hover { text-decoration: underline; }
.connection-note { margin: 10px 0 0; color: #5f6368; font-size: 11px; line-height: 1.45; }
.side-popover { display: grid; gap: 0; margin: 0 12px 4px 24px; border-left: 1px solid #d8dde3; padding: 3px 0 5px 12px; background: transparent; }
.side-popover[hidden] { display: none; }
.side-popover:not([hidden]) { animation: popover-reveal 180ms ease-out both; transform-origin: top center; }
.side-popover-group { display: grid; gap: 2px; padding: 4px 0 6px; }
.side-popover-group + .side-popover-group { margin-top: 4px; border-top: 1px solid #e8ebef; padding-top: 9px; }
.side-popover-label { padding: 0 12px 3px; color: #80868b; font-size: 10px; font-weight: 600; letter-spacing: .05em; line-height: 16px; }
.side-popover-group[aria-label="公开内容"] button { padding-left: 39px; }
.side-popover a, .side-popover button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; border: 0; border-radius: 18px; padding: 0 12px; background: transparent; color: #3c4043; cursor: pointer; font-size: 13px; text-align: left; text-decoration: none; }
.side-popover a svg, .side-popover button svg { width: 17px; height: 17px; flex: 0 0 auto; color: #5f6368; stroke-width: 1.7; }
.side-popover a:hover, .side-popover button:hover { background: #f1f3f4; color: #202124; }
.side-popover a.view-active, .side-popover button.view-active { background: #e8f0fe; color: #174ea6; font-weight: 600; }
.inline-login { margin-top: 10px; border: 1px solid #0b57d0; border-radius: 18px; padding: 7px 12px; background: #0b57d0; color: #fff; cursor: pointer; font: inherit; font-size: 13px; }
.upgrade-button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; border: 1px solid #747775; border-radius: 20px; padding: 0 16px; background: transparent; color: #0b57d0; cursor: pointer; font-size: 14px; font-weight: 500; }
.upgrade-button svg { width: 17px; height: 17px; }
.upgrade-button:hover { background: #f4f8fe; }
.tiny-sparkle { font-size: 17px; line-height: 1; color: #4c8df6; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #9c27b0; color: white; cursor: pointer; font-size: 15px; font-weight: 500; text-transform: lowercase; }
.avatar[hidden] { display: none !important; }
.mobile-menu { display: none; }

.main-stage { position: absolute; inset: 72px 0 0; display: flex; min-height: 0; flex-direction: column; background: radial-gradient(ellipse 72% 78% at 52% 58%, #dcefff 0%, #edf7ff 52%, #ffffff 100%); }
.main-stage.viewing { z-index: 4; overflow: auto; background: #fff; }
.main-stage.viewing:has(.logs-page) { background: #f3f6fb; }
.main-stage.viewing { scrollbar-color: #b7c5df transparent; scrollbar-width: thin; }
.main-stage.viewing::-webkit-scrollbar, .sidebar-scroll::-webkit-scrollbar, .data-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.main-stage.viewing::-webkit-scrollbar-thumb, .sidebar-scroll::-webkit-scrollbar-thumb, .data-table-wrap::-webkit-scrollbar-thumb { border-radius: 8px; background: #b7c5df; }
.main-stage.viewing::-webkit-scrollbar-track, .sidebar-scroll::-webkit-scrollbar-track, .data-table-wrap::-webkit-scrollbar-track { background: transparent; }
.main-stage.viewing .zero-state, .main-stage.viewing .chat-history, .main-stage.viewing .composer-wrap { display: none; }
.workspace-view { width: min(1040px, calc(100% - 64px)); margin: 0 auto; padding: 44px 0 72px; }
.workspace-view[data-view="logs"], .workspace-view[data-view="admin-logs"] { width: min(1180px, calc(100% - 72px)); padding-top: 34px; }
.workspace-view[data-view="logs"] .workspace-view-head, .workspace-view[data-view="admin-logs"] .workspace-view-head { border-bottom: 0; padding-bottom: 6px; }
.workspace-view[data-view="logs"] .workspace-content, .workspace-view[data-view="admin-logs"] .workspace-content { padding-top: 16px; }
.workspace-view[hidden] { display: none; }
.workspace-view:not([hidden]) { animation: workspace-reveal 220ms ease-out both; }
.workspace-view.view-switching .workspace-view-head { animation: workspace-content-reveal 220ms ease-out both; }
.workspace-view.view-switching .workspace-content > :not(.native-drawer-backdrop) { animation: workspace-content-reveal 220ms ease-out both; }
.workspace-view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid #e4e7eb; padding-bottom: 24px; }
.workspace-eyebrow { margin: 18px 0 6px; color: var(--subtle); font-size: 13px; }
.workspace-view-head h1 { margin: 0; color: #202124; font-size: 30px; font-weight: 500; line-height: 1.25; }
.workspace-view-head > div > p:last-child { margin: 8px 0 0; color: var(--subtle); font-size: 14px; }
.back-to-chat { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 600; }
.back-to-chat:hover { text-decoration: underline; }
.workspace-refresh { flex: 0 0 auto; }
.workspace-content { min-height: 240px; padding-top: 28px; }
.workspace-loading, .workspace-empty { display: grid; place-items: center; gap: 10px; min-height: 240px; color: var(--subtle); font-size: 14px; text-align: center; }
.workspace-empty strong { color: #202124; font-size: 17px; font-weight: 600; }
.workspace-empty span { max-width: 440px; line-height: 1.5; }
.workspace-error strong { color: #b3261e; }
.loading-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: pulse 1.1s ease-in-out infinite; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-width: 0; border: 1px solid #e0e3e7; border-radius: 8px; padding: 18px; background: #fff; box-shadow: 0 1px 2px rgba(60,64,67,.06); }
.metric-card span, .metric-card small { display: block; color: var(--subtle); font-size: 13px; }
.metric-card strong { display: block; margin: 10px 0 4px; overflow-wrap: anywhere; color: #202124; font-size: 26px; font-weight: 500; }
.metric-card small { font-size: 11px; }
.workspace-note { margin-top: 18px; color: var(--subtle); font-size: 12px; }
.admin-options-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; border: 1px solid #dfe3e8; border-radius: 8px; padding: 16px 18px; background: #f8fafd; }
.admin-options-toolbar strong { color: #202124; font-size: 15px; font-weight: 600; }
.admin-options-toolbar p { max-width: 680px; margin: 6px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.admin-options-list { display: grid; gap: 18px; }
.admin-options-section { border-top: 1px solid #e0e3e7; padding-top: 18px; }
.admin-options-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.admin-options-section-head h2 { margin: 0; color: #202124; font-size: 17px; font-weight: 600; }
.admin-options-section-head p { margin: 4px 0 0; color: var(--subtle); font-size: 12px; }
.admin-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.admin-option-field { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.6fr) auto; align-items: center; gap: 10px; min-width: 0; border: 1px solid #e0e3e7; border-radius: 7px; padding: 10px; background: #fff; }
.admin-option-label { display: grid; gap: 3px; min-width: 0; }
.admin-option-label b { overflow-wrap: anywhere; color: #303134; font-size: 12px; font-weight: 600; }
.admin-option-label small { color: var(--subtle); font-size: 10px; }
.admin-option-field input:not([type="checkbox"]), .admin-option-field textarea { width: 100%; min-width: 0; border: 1px solid #c4c7c5; border-radius: 5px; padding: 8px 9px; background: #fff; color: #202124; font: inherit; font-size: 12px; }
.admin-option-field textarea { min-height: 60px; resize: vertical; line-height: 1.45; }
.admin-option-field input:not([type="checkbox"]):focus, .admin-option-field textarea:focus { border-color: var(--blue); outline: 2px solid rgba(11,87,208,.14); }
.admin-option-toggle { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; min-height: 32px; color: #3c4043; cursor: pointer; font-size: 12px; }
.admin-option-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.admin-option-toggle .permission-switch { flex: 0 0 auto; }
.admin-option-toggle input:checked + .permission-switch { background: var(--blue); }
.admin-option-toggle input:checked + .permission-switch::after { transform: translateX(16px); }
.admin-option-save { min-height: 30px; border: 1px solid #c4c7c5; border-radius: 15px; padding: 0 10px; background: #fff; color: var(--blue); cursor: pointer; font-size: 11px; font-weight: 600; }
.admin-option-save:hover { background: #f4f8fe; }
.admin-option-save:disabled { cursor: wait; opacity: .55; }
.native-settings-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); align-items: start; gap: 32px; }
.native-settings-nav { position: sticky; top: 20px; min-width: 0; border-right: 1px solid #e0e3e7; padding: 2px 18px 24px 0; }
.native-settings-nav-head { display: grid; gap: 2px; padding: 0 12px 14px; }
.native-settings-nav-head strong { color: #202124; font-size: 15px; font-weight: 600; }
.native-settings-nav-head span { color: var(--subtle); font-size: 12px; }
.native-settings-nav-group { display: grid; gap: 3px; margin: 0 0 15px; }
.native-settings-nav-group > p { margin: 0; padding: 0 12px 5px; color: #5f6368; font-size: 11px; font-weight: 600; }
.native-settings-nav-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 32px; border: 0; border-radius: 6px; padding: 6px 10px 6px 12px; background: transparent; color: #3c4043; cursor: pointer; font: inherit; font-size: 12px; text-align: left; }
.native-settings-nav-item:hover { background: #f1f3f4; color: #202124; }
.native-settings-nav-item.active { background: #e8f0fe; color: #174ea6; font-weight: 600; }
.native-settings-nav-item small { flex: 0 0 auto; min-width: 18px; color: #80868b; font-size: 10px; text-align: right; }
.native-settings-nav-item.active small { color: #174ea6; }
.native-settings-panel { min-width: 0; }
.native-settings-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e0e3e7; padding-bottom: 20px; }
.native-settings-panel-head p { margin: 0 0 6px; color: var(--subtle); font-size: 12px; }
.native-settings-panel-head h2 { margin: 0; color: #202124; font-size: 24px; font-weight: 500; line-height: 1.25; }
.native-settings-panel-head span { display: block; margin-top: 8px; color: var(--subtle); font-size: 12px; line-height: 1.45; }
.native-settings-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; border-bottom: 1px solid #e0e3e7; color: var(--subtle); font-size: 12px; }
.native-settings-actions .connection-primary:disabled { cursor: not-allowed; opacity: .52; }
.native-settings-search { display: flex; align-items: end; gap: 8px; border-bottom: 1px solid #e0e3e7; padding: 14px 0; }
.native-settings-search label { display: grid; flex: 1 1 auto; gap: 6px; color: #64738b; font-size: 11px; font-weight: 650; }
.native-settings-search input { width: 100%; min-height: 36px; border: 1px solid #d4ddea; border-radius: 7px; padding: 0 10px; color: #24324e; font: inherit; font-size: 12px; }
.native-settings-search input:focus { border-color: #8ca5e9; outline: 3px solid rgba(65, 105, 225, .1); }
.native-settings-search > button { min-height: 36px; white-space: nowrap; }
.native-settings-search-clear { border: 0; border-radius: 7px; padding: 0 10px; background: transparent; color: #52617b; cursor: pointer; font: inherit; font-size: 12px; }
.native-settings-search-clear:hover { background: #edf2ff; color: #3155bd; }
.native-options-list { min-width: 0; }
.native-option-row { display: grid; grid-template-columns: minmax(176px, .8fr) minmax(240px, 1.2fr); align-items: center; gap: 22px; border-bottom: 1px solid #edf0f2; padding: 16px 0; transition: background 120ms ease; }
.native-option-row.is-dirty { margin: 0 -12px; border-radius: 6px; padding-right: 12px; padding-left: 12px; background: #f4f8fe; }
.native-option-copy { display: grid; gap: 4px; min-width: 0; }
.native-option-copy strong { overflow-wrap: anywhere; color: #202124; font-size: 13px; font-weight: 600; }
.native-option-copy small { overflow-wrap: anywhere; color: #80868b; font-size: 11px; }
.native-option-control { min-width: 0; }
.native-option-control > input:not([type="checkbox"]), .native-option-control > textarea { width: 100%; min-width: 0; border: 1px solid #c4c7c5; border-radius: 6px; padding: 8px 10px; background: #fff; color: #202124; font: inherit; font-size: 13px; }
.native-option-control > textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
.native-option-control > input:not([type="checkbox"]):focus, .native-option-control > textarea:focus { border-color: var(--blue); outline: 2px solid rgba(11,87,208,.14); }
.native-option-control > input:disabled, .native-option-control > textarea:disabled { border-color: #e0e3e7; background: #f8fafd; color: #80868b; cursor: not-allowed; }
.native-option-control .admin-option-toggle { min-height: 38px; }
.native-settings-empty { padding: 48px 0; color: var(--subtle); font-size: 13px; text-align: center; }
.native-special-section, .native-oauth-form { display: grid; gap: 18px; padding: 20px 0; }
.native-special-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.native-special-head strong { display: block; color: #202124; font-size: 14px; font-weight: 600; }
.native-special-head p { margin: 5px 0 0; color: var(--subtle); font-size: 12px; line-height: 1.5; }
.native-callback-url { display: block; overflow-x: auto; border: 1px solid #d8dde3; border-radius: 6px; padding: 11px 12px; background: #f8fafd; color: #3c4043; font-size: 12px; white-space: nowrap; }
.native-special-toolbar, .native-special-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.native-special-toolbar { color: var(--subtle); font-size: 12px; }
.native-special-actions { justify-content: flex-end; flex-wrap: wrap; }
.native-oauth-provider-list { display: grid; border-top: 1px solid #edf0f2; }
.native-oauth-provider { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #edf0f2; padding: 15px 0; }
.native-oauth-provider strong, .native-oauth-provider small { display: block; }
.native-oauth-provider strong { color: #202124; font-size: 13px; font-weight: 600; }
.native-oauth-provider small { margin-top: 4px; color: var(--subtle); font-size: 11px; }
.native-danger { color: #b3261e; }
.native-oauth-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.native-oauth-form label { display: grid; gap: 7px; color: #3c4043; font-size: 12px; }
.native-oauth-form input, .native-oauth-form textarea, .native-oauth-form select { width: 100%; min-width: 0; border: 1px solid #d8dde3; border-radius: 5px; padding: 9px 10px; background: #fff; color: #202124; font: inherit; font-size: 13px; line-height: 1.35; }
.native-oauth-form textarea { resize: vertical; }
.native-oauth-form input:focus, .native-oauth-form textarea:focus, .native-oauth-form select:focus { outline: 2px solid #a8c7fa; outline-offset: 1px; border-color: #8ab4f8; }
.native-oauth-form .native-oauth-full { grid-column: 1 / -1; }
.native-oauth-form .native-oauth-switch { display: flex; align-items: center; gap: 9px; min-height: 38px; }
.native-oauth-switch input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.native-oauth-switch input:checked + .permission-switch { background: #1a73e8; }
.native-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.native-status-grid > div { display: grid; gap: 6px; border: 1px solid #e0e3e7; border-radius: 6px; padding: 15px; }
.native-status-grid span { color: var(--subtle); font-size: 12px; }
.native-status-grid strong { color: #202124; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.data-table-wrap { overflow: auto; border: 1px solid #e0e3e7; border-radius: 8px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 13px; }
.data-table th, .data-table td { padding: 13px 16px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: top; }
.data-table th { background: #f8fafd; color: var(--subtle); font-size: 12px; font-weight: 600; }
.data-table tr:last-child td { border-bottom: 0; }
.status-chip { display: inline-flex; border-radius: 12px; padding: 3px 8px; background: #e6f4ea; color: #137333; font-size: 11px; }
.profile-grid { max-width: 680px; border-top: 1px solid #e0e3e7; }
.profile-row { display: flex; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid #e0e3e7; }
.profile-row span { color: var(--subtle); font-size: 13px; }
.profile-row strong { max-width: 65%; overflow-wrap: anywhere; color: #202124; font-size: 14px; font-weight: 500; text-align: right; }
.workspace-inline-form, .profile-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 18px; }
.workspace-inline-form label, .profile-form label { display: grid; gap: 6px; color: var(--subtle); font-size: 12px; font-weight: 600; }
.workspace-inline-form label:first-child { flex: 1 1 180px; }
.workspace-inline-form label:nth-child(2) { flex: 0 1 120px; }
.workspace-inline-form input, .profile-form input { min-height: 38px; border: 1px solid #c4c7c5; border-radius: 6px; padding: 0 10px; background: #fff; color: #202124; font-size: 13px; }
.workspace-inline-form input:focus, .profile-form input:focus { border-color: var(--blue); outline: 2px solid rgba(11,87,208,.14); }
.workspace-inline-form .inline-check { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; white-space: nowrap; }
.workspace-inline-form .inline-check input { min-height: auto; width: 16px; }
.token-form { margin-bottom: 24px; border-bottom: 1px solid #e0e3e7; padding-bottom: 22px; }
.token-form-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.token-form-head strong { color: #202124; font-size: 15px; font-weight: 600; }
.token-form-head small { color: var(--subtle); font-size: 12px; }
.token-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.token-form-grid label { display: grid; gap: 6px; min-width: 0; color: var(--subtle); font-size: 12px; font-weight: 600; }
.token-form-grid label > input, .token-form-grid label > textarea { width: 100%; min-height: 38px; border: 1px solid #c4c7c5; border-radius: 6px; padding: 8px 10px; background: #fff; color: #202124; font-size: 13px; }
.token-form-grid label > textarea { resize: vertical; line-height: 1.45; }
.token-form-grid label > input:focus, .token-form-grid label > textarea:focus { border-color: var(--blue); outline: 2px solid rgba(11,87,208,.14); }
.token-form-grid label > input:disabled { background: #f1f3f4; color: #9aa0a6; }
.token-form-wide { grid-column: 1 / -1; }
.token-form-grid .inline-check { display: flex; grid-template-columns: none; align-items: center; gap: 7px; min-height: 38px; white-space: nowrap; }
.token-form-grid .inline-check input { width: 16px; height: 16px; margin: 0; }
.token-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.token-key-mask { display: block; overflow-wrap: anywhere; color: #3c4043; font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.token-name { display: block; margin-top: 5px; color: #202124; font-size: 12px; font-weight: 600; }
.table-secondary { display: block; margin-top: 5px; color: var(--subtle); font-size: 11px; }
.status-chip.is-muted { background: #f1f3f4; color: #5f6368; }
.status-chip.is-warning { background: #fef7e0; color: #8a5b00; }
.status-chip.is-danger { background: #fce8e6; color: #b3261e; }
.profile-form { display: grid; max-width: 680px; align-items: stretch; }
.profile-form label { grid-template-columns: 90px minmax(0, 1fr); align-items: center; }
.profile-form .profile-grid { margin-top: 8px; }
.profile-form > button { justify-self: start; margin-top: 6px; }
.profile-summary { display: grid; gap: 14px; max-width: 680px; }
.profile-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.profile-summary-grid > div { display: grid; gap: 5px; min-width: 0; border: 1px solid #e0e7f2; border-radius: 8px; padding: 12px; background: #fbfcff; }
.profile-summary-grid span { color: #71809a; font-size: 11px; }
.profile-summary-grid strong { overflow-wrap: anywhere; color: #263754; font-size: 13px; font-weight: 600; }
.native-drawer .profile-form { max-width: none; margin: 0; padding: 28px; }
.native-drawer .profile-form label { grid-template-columns: 1fr; gap: 7px; }
.native-drawer .profile-form .profile-grid { margin-top: 8px; }
.native-drawer .profile-form .profile-grid + button { margin-top: 8px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.table-actions button { border: 0; border-radius: 14px; padding: 5px 8px; background: #f1f3f4; color: #174ea6; cursor: pointer; font-size: 11px; }
.table-actions button:hover { background: #e8f0fe; }
.table-actions button:disabled { color: #9aa0a6; cursor: wait; }

/* API key management follows the gateway's token lifecycle without exposing full keys in the list. */
.token-page { display: grid; gap: 18px; }
.token-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.token-page-head > div { min-width: 0; }
.token-page-head p, .token-editor-head p { margin: 0 0 5px; color: #687791; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.token-page-head h2, .token-editor-head h2 { margin: 0; color: #1a2948; font-size: 23px; font-weight: 650; line-height: 1.25; }
.token-page-head span, .token-editor-head span { display: block; max-width: 650px; margin-top: 8px; color: #71809a; font-size: 13px; line-height: 1.55; }
.token-page-head .connection-primary { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }
.token-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.token-summary-grid > div { display: grid; gap: 4px; min-width: 0; border: 1px solid #e0e7f2; border-radius: 8px; padding: 14px; background: #fff; }
.token-summary-grid span, .token-summary-grid small { color: #71809a; font-size: 11px; }
.token-summary-grid strong { overflow-wrap: anywhere; color: #1a2948; font-size: 22px; font-weight: 650; }
.token-secret-reveal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .85fr) auto; align-items: center; gap: 16px; border: 1px solid #a9c4ec; border-radius: 8px; padding: 16px 18px; background: #f4f8ff; }
.token-secret-reveal > div:first-child { display: grid; gap: 4px; min-width: 0; }
.token-secret-reveal p { margin: 0; color: #3155bd; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.token-secret-reveal strong { color: #1a2948; font-size: 14px; }
.token-secret-reveal span { color: #52617b; font-size: 12px; line-height: 1.45; }
.token-secret-reveal code { overflow: hidden; border: 1px solid #cad8f7; border-radius: 6px; padding: 10px 11px; background: #fff; color: #263d77; font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.token-secret-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.token-secret-actions button { min-height: 34px; white-space: nowrap; }
.token-editor { border: 1px solid #d5e0f2; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px rgba(42, 63, 107, .06); }
.token-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e6ecf5; padding: 18px 20px 16px; }
.token-editor-close { flex: 0 0 auto; min-height: 32px; border: 0; padding: 0 3px; background: transparent; color: #52617b; cursor: pointer; font: inherit; font-size: 12px; }
.token-editor-close:hover { color: #3155bd; text-decoration: underline; }
.token-editor form { display: grid; gap: 18px; padding: 18px 20px 20px; }
.token-editor-section { display: grid; gap: 14px; }
.token-editor-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.token-editor-section-head strong { color: #263754; font-size: 13px; font-weight: 700; }
.token-editor-section-head span { color: #71809a; font-size: 11px; }
.token-editor .token-form-grid { gap: 13px 16px; }
.token-editor .token-form-grid label { color: #52617b; }
.token-editor .token-form-grid label > input, .token-editor .token-form-grid label > textarea { border-color: #d4ddea; color: #24324e; }
.token-editor .token-form-grid label > input:focus, .token-editor .token-form-grid label > textarea:focus { border-color: #8ca5e9; outline: 3px solid rgba(65, 105, 225, .10); }
.token-editor .token-group-select { width: 100%; min-width: 0; min-height: 38px; border: 1px solid #d4ddea; border-radius: 7px; padding: 0 34px 0 10px; background: #fff; color: #24324e; cursor: pointer; font: inherit; font-size: 13px; }
.token-editor .token-group-select:focus { border-color: #8ca5e9; outline: 3px solid rgba(65, 105, 225, .10); }

/* Shared right-side editor for resource creation and management. */
body.native-drawer-open { overflow: hidden; }
.native-drawer-backdrop { position: fixed; z-index: 48; inset: 0; display: flex; justify-content: flex-end; background: rgba(20, 31, 55, .34); backdrop-filter: blur(4px); animation: drawer-backdrop-in 160ms ease-out both; }
.native-drawer { position: relative; display: block; width: min(560px, 100vw); height: 100%; max-height: 100dvh; min-width: 0; background: #fff; box-shadow: -18px 0 44px rgba(25, 40, 74, .20); animation: drawer-enter-right 220ms cubic-bezier(.2, 0, 0, 1) both; }
.native-drawer-body { width: 100%; height: 100%; min-width: 0; box-sizing: border-box; overflow: auto; overscroll-behavior: contain; }
.native-drawer-close { position: absolute; z-index: 3; top: 14px; right: 14px; width: 34px; height: 34px; margin: 0; border: 1px solid #d7e0ef; border-radius: 50%; padding: 0; background: rgba(255, 255, 255, .94); color: #3a4a67; cursor: pointer; font: 500 24px/28px Arial, sans-serif; transition: background 140ms ease, color 140ms ease, transform 140ms ease; }
.native-drawer-close:hover { background: #eef4ff; color: #174ea6; transform: rotate(90deg); }
.native-drawer .token-editor { min-height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.native-drawer .token-editor-head { padding-right: 64px; }
.native-drawer .admin-resource-form { min-height: 100%; margin: 0; border: 0; border-radius: 0; padding: 28px 28px 32px; background: #fff; }
.native-drawer .admin-form-head { padding-right: 48px; }
.channel-form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.channel-form-head > div { display: grid; gap: 4px; min-width: 0; }
.channel-form-fetch { flex: 0 0 auto; min-height: 34px; white-space: nowrap; }
.token-form-grid-lifecycle .inline-check { align-self: end; }
.token-advanced { border-top: 1px solid #e6ecf5; border-bottom: 1px solid #e6ecf5; }
.token-advanced > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; color: #263754; cursor: pointer; font-size: 13px; font-weight: 700; }
.token-advanced > summary span { color: #71809a; font-size: 11px; font-weight: 400; }
.token-advanced-content { padding: 2px 0 18px; }
.token-model-picker { position: relative; min-width: 0; }
.token-model-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 38px; border: 1px solid #d4ddea; border-radius: 7px; padding: 0 10px; background: #fff; color: #24324e; cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.token-model-trigger:hover { border-color: #9db3de; background: #fbfdff; }
.token-model-trigger:focus-visible { border-color: #6180ca; outline: 3px solid rgba(79, 112, 194, .12); }
.token-model-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-model-trigger svg { width: 16px; height: 16px; flex: 0 0 auto; }
.token-model-menu { position: absolute; z-index: 12; top: calc(100% + 6px); right: 0; left: 0; display: grid; gap: 8px; border: 1px solid #cfdced; border-radius: 8px; padding: 9px; background: #fff; box-shadow: 0 14px 30px rgba(37, 57, 91, .17); }
.token-model-menu[hidden] { display: none; }
.token-model-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.token-model-search input, .token-model-custom input { width: 100%; min-width: 0; min-height: 32px; border: 1px solid #d4ddea; border-radius: 6px; padding: 0 9px; background: #fff; color: #24324e; font: inherit; font-size: 12px; }
.token-model-search input:focus, .token-model-custom input:focus { border-color: #8ca5e9; outline: 2px solid rgba(65, 105, 225, .1); }
.token-model-search > div { display: flex; gap: 5px; }
.token-model-search button, .token-model-custom button { min-height: 32px; border: 0; border-radius: 5px; padding: 0 8px; background: #eef3ff; color: #3155bd; cursor: pointer; font: 600 11px/1 inherit; white-space: nowrap; }
.token-model-search button:hover, .token-model-custom button:hover { background: #dce7ff; }
.token-model-options { display: grid; max-height: 196px; overflow: auto; border-top: 1px solid #edf1f7; border-bottom: 1px solid #edf1f7; padding: 4px 0; overscroll-behavior: contain; }
.token-editor .token-model-options label { display: flex; align-items: center; gap: 8px; min-height: 32px; border: 0; border-radius: 5px; padding: 0 7px; color: #3d5273; cursor: pointer; font-size: 12px; font-weight: 550; }
.token-editor .token-model-options label:hover { background: #eef4ff; }
.token-editor .token-model-options input { width: 15px; min-width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: #3155bd; }
.token-editor .token-model-options span { overflow-wrap: anywhere; }
.token-model-empty { margin: 0; padding: 9px 7px; color: #71809a; font-size: 12px; line-height: 1.45; }
.token-model-custom { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.token-editor .token-form-grid label > small { color: #71809a; font-size: 11px; font-weight: 400; line-height: 1.45; }
.token-filter-bar { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr) minmax(120px, .65fr) auto; align-items: end; gap: 10px; border-bottom: 1px solid #e5ebf4; padding: 0 0 18px; }
.token-filter-bar label { display: grid; gap: 6px; min-width: 0; color: #64738b; font-size: 11px; font-weight: 650; }
.token-filter-bar input, .token-filter-bar select { width: 100%; min-width: 0; min-height: 36px; border: 1px solid #d4ddea; border-radius: 7px; padding: 0 10px; background: #fff; color: #24324e; font: inherit; font-size: 12px; }
.token-filter-bar input:focus, .token-filter-bar select:focus { border-color: #8ca5e9; outline: 3px solid rgba(65, 105, 225, .1); }
.token-filter-actions { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.token-filter-actions button { min-height: 36px; border: 0; border-radius: 7px; padding: 0 11px; background: transparent; color: #52617b; cursor: pointer; font: inherit; font-size: 12px; }
.token-filter-actions button:hover { color: #3155bd; background: #edf2ff; }
.token-table-wrap { border-color: #e0e7f2; }
.token-table { min-width: 980px; }
.token-table th { background: #f8faff; }
.token-table td { vertical-align: middle; }
.token-row-inactive { background: #fbfcfe; }
.token-table .token-name { margin: 0; color: #263754; font-size: 13px; }
.token-table .token-key-mask { max-width: 205px; margin-top: 5px; overflow: hidden; color: #52617b; text-overflow: ellipsis; white-space: nowrap; }
.token-group-chip { display: inline-flex; max-width: 112px; overflow: hidden; border: 1px solid #dce5f2; border-radius: 999px; padding: 3px 8px; background: #f8faff; color: #52617b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.token-quota { display: grid; gap: 4px; min-width: 142px; }
.token-quota strong { color: #263754; font-size: 12px; font-weight: 650; }
.token-quota span, .token-lifecycle small { color: #71809a; font-size: 11px; }
.token-quota i { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 4px; background: #e8edf5; }
.token-quota i b { display: block; height: 100%; border-radius: inherit; background: #5d7ce3; }
.token-lifecycle { display: grid; gap: 4px; min-width: 148px; }
.token-lifecycle strong { color: #52617b; font-size: 12px; font-weight: 600; }
.token-table-actions { justify-content: flex-end; min-width: 150px; }
.token-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #71809a; font-size: 12px; }
.token-pagination > div { display: flex; gap: 8px; }
.token-pagination button { min-height: 32px; border: 1px solid #d4ddea; border-radius: 7px; padding: 0 10px; background: #fff; color: #52617b; cursor: pointer; font: inherit; font-size: 12px; }
.token-pagination button:hover:not(:disabled) { border-color: #a8bae8; background: #edf2ff; color: #3155bd; }
.token-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.token-empty { min-height: 220px; border: 1px dashed #cdd9eb; border-radius: 8px; background: #fbfcff; }
.generated-image { max-width: min(620px, 100%); margin: 0 0 14px; }
.generated-image img { display: block; width: 100%; max-height: 620px; border-radius: 10px; object-fit: contain; background: #f8fafd; }
.generated-image figcaption { margin-top: 6px; color: var(--subtle); font-size: 12px; }
.research-result { overflow: auto; margin: 0; border-radius: 8px; padding: 12px; background: #f8fafd; color: #3c4043; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.zero-state { position: absolute; inset: 0; display: grid; place-items: start center; align-content: start; gap: 12px; padding: 180px 24px 0; pointer-events: none; transition: opacity 220ms ease, transform 220ms ease; }
.zero-state h1 { width: min(850px, 100%); max-width: calc(100vw - 48px); margin: 0; overflow-wrap: anywhere; word-break: break-word; color: #303030; font-size: clamp(34px, 2.75vw, 40px); font-weight: 400; line-height: 1.22; text-align: center; }
.zero-state-note { max-width: min(600px, calc(100vw - 48px)); margin: 0; color: #5f6368; font-size: 13px; line-height: 1.5; text-align: center; }

.chat-history { display: none; width: min(850px, calc(100% - 48px)); margin: 0 auto; padding: 20px 0 152px; overflow: auto; scrollbar-width: thin; }
.chat-message { display: grid; gap: 12px; margin: 0 0 28px; animation: reveal 200ms ease-out; }
.chat-message.user { justify-items: end; }
.chat-message.user p { max-width: min(560px, 100%); margin: 0; border-radius: 20px 20px 4px 20px; padding: 12px 16px; background: #f1f3f4; color: #202124; font-size: 16px; line-height: 1.5; }
.chat-message.assistant { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
.assistant-mark { width: 26px; height: 26px; margin-top: 2px; }
.assistant-copy { color: #2f3033; font-size: 16px; line-height: 1.65; }
.assistant-copy p { margin: 0 0 12px; }
.assistant-copy .title { color: #1f1f1f; font-size: 20px; font-weight: 600; }
.chat-message.is-loading .assistant-copy { color: #5f6368; }
.chat-message.is-editing > .assistant-copy, .chat-message.user.is-editing p { outline: 2px solid rgba(65, 105, 225, .26); outline-offset: 2px; }
.status-copy { color: #5f6368; }
.error-copy { color: #b3261e; }
.hint-copy { color: #5f6368; font-size: 14px; }

.composer-wrap { position: absolute; z-index: 2; top: 50%; left: 50%; width: 100%; max-width: min(660px, calc(100% - 48px)); min-width: 0; transform: translate(-50%, -68px); padding: 0; }
.composer { position: relative; min-width: 0; min-height: 64px; padding: 10px 16px; border: 1px solid transparent; border-radius: 32px; background: var(--input); box-shadow: 0 1px 2px rgba(60, 64, 67, .08); transition: box-shadow 140ms ease, border 140ms ease, background 140ms ease; }
.composer:focus-within { border-color: #c4c7c5; background: #fff; box-shadow: 0 1px 3px rgba(60,64,67,.2); }
#prompt-input { display: block; width: 100%; min-height: 28px; max-height: 168px; resize: none; overflow: auto; border: 0; outline: 0; background: transparent; color: #1f1f1f; padding: 6px 150px 4px 50px; font-size: 17px; line-height: 28px; }
#prompt-input::placeholder { color: #5f6368; opacity: 1; }
.composer-tools { position: absolute; right: 10px; bottom: 12px; left: 10px; display: flex; min-width: 0; align-items: center; gap: 4px; pointer-events: none; }
.composer-tools > * { pointer-events: auto; }
.composer-button { width: 38px; height: 38px; }
.composer-tools .mode-popover-anchor { margin-left: auto; }
.mode-button { display: inline-flex; align-items: center; min-height: 38px; gap: 4px; border: 0; border-radius: 19px; padding: 0 9px 0 12px; background: transparent; color: #303030; cursor: pointer; font-size: 14px; font-weight: 500; }
.mode-button:hover { background: rgba(60,64,67,.1); }
.mode-button svg { width: 18px; height: 18px; }
.composer-tools > :last-child { margin-left: 0; }
.send-button { width: 38px; height: 38px; color: #0b57d0; }
.icon-button[hidden], .send-button[hidden] { display: none !important; }
.send-button:disabled { color: #9aa0a6; cursor: default; }
.send-button svg { transform: translateX(1px); }
.disclaimer { display: none; margin: 10px 0 0; color: #5f6368; font-size: 12px; line-height: 16px; text-align: center; }

.popover { position: absolute; z-index: 10; min-width: 240px; overflow: hidden; border: 1px solid #dadce0; border-radius: 16px; background: #fff; box-shadow: var(--shadow); padding: 8px; }
.tool-popover { bottom: 46px; left: 0; }
.mode-popover { right: 0; bottom: 46px; width: 280px; }
.popover button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; border: 0; border-radius: 10px; padding: 8px 12px; background: transparent; color: #303030; cursor: pointer; text-align: left; font-size: 14px; }
.popover button:hover { background: #f1f3f4; }
.tool-popover svg { width: 20px; height: 20px; color: #5f6368; }
.mode-popover button { justify-content: space-between; }
.mode-popover button > span { display: grid; gap: 2px; }
.mode-popover b { font-size: 14px; font-weight: 500; }
.mode-popover small { color: #5f6368; font-size: 12px; }
.mode-popover em { border-radius: 10px; padding: 2px 7px; background: #d3e3fd; color: #041e49; font-size: 11px; font-style: normal; }
.mode-popover button:disabled { color: #9aa0a6; cursor: not-allowed; }
.mode-popover button:disabled:hover { background: transparent; }
.selection-check { color: #0b57d0; font-style: normal; font-weight: 700; }
.mode-popover hr { margin: 7px 4px; border: 0; border-top: 1px solid #e3e6e8; }

.login-dialog-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(32, 33, 36, .42); }
.login-dialog-backdrop[hidden] { display: none; }
.login-dialog-card { width: min(400px, 100%); border: 1px solid #dadce0; border-radius: 12px; padding: 24px; background: #fff; box-shadow: 0 12px 32px rgba(60, 64, 67, .32); animation: dialog-enter 220ms ease-out both; }
.login-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.login-dialog-card h2 { margin: 0; color: #202124; font-size: 20px; font-weight: 600; line-height: 1.3; }
.auth-mode-toggle { flex: 0 0 auto; border: 0; border-radius: 16px; padding: 6px 8px; background: transparent; color: #0b57d0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; transition: background 140ms ease, transform 140ms ease; }
.auth-mode-toggle:hover { background: #f4f8fe; transform: translateY(-1px); }
.auth-mode-toggle:disabled { color: #9aa0a6; cursor: default; transform: none; }
.auth-mode-toggle[hidden] { display: none; }
.login-dialog-card p { margin: 10px 0 0; color: #5f6368; font-size: 14px; line-height: 1.55; }
.login-field { display: grid; gap: 6px; margin-top: 16px; color: #3c4043; font-size: 12px; font-weight: 600; }
.login-field[hidden] { display: none; }
.login-field input { width: 100%; min-height: 42px; border: 1px solid #c4c7c5; border-radius: 6px; padding: 0 11px; background: #fff; color: #202124; font-size: 14px; }
.login-field input:focus { border-color: var(--blue); outline: 2px solid rgba(11,87,208,.16); }
.remember-login { display: grid; grid-template-columns: 16px minmax(0, 1fr); column-gap: 8px; align-items: center; margin-top: 14px; color: #3c4043; font-size: 13px; font-weight: 600; cursor: pointer; }
.remember-login[hidden] { display: none; }
.remember-login input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.remember-login small { grid-column: 2; margin-top: 2px; color: #6b7280; font-size: 11px; font-weight: 400; line-height: 1.4; }
.auth-verification-fields { display: grid; gap: 0; }
.auth-verification-fields[hidden], .auth-challenge[hidden] { display: none; }
.verification-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.verification-code-row .login-field { min-width: 0; }
.email-code-button { min-height: 42px; border: 1px solid #c7d7f5; border-radius: 6px; padding: 0 12px; background: #f4f8fe; color: #0b57d0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background 140ms ease, border-color 140ms ease; }
.email-code-button:hover:not(:disabled) { border-color: #8ab4f8; background: #e8f0fe; }
.email-code-button:disabled { color: #7c8aa1; cursor: not-allowed; }
.auth-challenge { display: grid; gap: 7px; margin-top: 16px; border: 1px solid #e0e3e7; border-radius: 8px; padding: 12px; background: #f8fafd; }
.auth-challenge-label { color: #3c4043; font-size: 12px; font-weight: 600; }
#auth-turnstile-widget { min-height: 65px; overflow: hidden; }
.auth-challenge small { color: #5f6368; font-size: 12px; line-height: 1.4; }
.login-error { margin: 12px 0 0 !important; color: #b3261e !important; font-size: 13px !important; }
.login-error[hidden] { display: none; }
.login-notice { margin: 12px 0 0 !important; color: #137333 !important; font-size: 13px !important; }
.login-notice[hidden] { display: none; }
.login-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.user-settings-backdrop, .purchase-dialog-backdrop { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(32, 33, 36, .42); }
.user-settings-backdrop[hidden], .purchase-dialog-backdrop[hidden] { display: none; }
.user-settings-card, .purchase-dialog-card { width: min(476px, 100%); border: 1px solid #dadce0; border-radius: 12px; padding: 24px; background: #fff; box-shadow: 0 12px 32px rgba(60,64,67,.32); animation: dialog-enter 220ms ease-out both; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.dialog-head h2 { margin: 3px 0 0; color: #202124; font-size: 20px; font-weight: 600; line-height: 1.3; }
.dialog-eyebrow { margin: 0; color: var(--subtle); font-size: 12px; }
.permission-card, .help-card { margin-top: 20px; border: 1px solid #e0e3e7; border-radius: 8px; padding: 16px; background: #fff; }
.permission-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.permission-card-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e8f0fe; color: #174ea6; }
.permission-card-icon svg { width: 18px; height: 18px; }
.permission-card strong, .help-card strong { color: #202124; font-size: 14px; font-weight: 600; }
.permission-card p, .help-card p, .purchase-copy, .purchase-note { margin: 6px 0 0; color: var(--subtle); font-size: 13px; line-height: 1.5; }
.permission-card[data-state="granted"] { border-color: #b7dfc0; background: #f5fbf6; }
.permission-card[data-state="restricted"] { border-color: #f3d7a6; background: #fffaf0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.plan-option { display: grid; gap: 6px; min-height: 132px; border: 1px solid #d8dde3; border-radius: 8px; padding: 14px; background: #fff; color: #202124; cursor: pointer; text-align: left; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.plan-option:hover { border-color: #8ab4f8; background: #f8fafd; box-shadow: 0 4px 12px rgba(60, 64, 67, .12); transform: translateY(-2px); }
.plan-option.selected { border: 2px solid #0b57d0; padding: 13px; background: #f4f8fe; }
.plan-option span { color: #0b57d0; font-size: 12px; font-weight: 600; }
.plan-option strong { font-size: 15px; font-weight: 600; line-height: 1.35; }
.plan-option small { color: var(--subtle); font-size: 12px; }
.toast { position: fixed; z-index: 30; bottom: 28px; left: 50%; transform: translate(-50%, 20px); max-width: calc(100% - 40px); border-radius: 8px; padding: 10px 14px; background: #303030; color: #fff; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.admin-toolbar > div:first-child { display: grid; gap: 4px; min-width: 0; }
.admin-toolbar strong { color: #202124; font-size: 16px; font-weight: 600; }
.admin-toolbar span { color: #5f6368; font-size: 13px; line-height: 1.45; }
.admin-resource-form { margin: 0 0 18px; border: 1px solid #e0e3e7; border-radius: 8px; padding: 18px; background: #f8fafd; }
.admin-form-head { display: grid; gap: 4px; margin-bottom: 16px; }
.admin-form-head strong { color: #202124; font-size: 15px; font-weight: 600; }
.admin-form-head span { color: #5f6368; font-size: 12px; line-height: 1.45; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-form-grid label { display: grid; min-width: 0; gap: 7px; color: #3c4043; font-size: 12px; font-weight: 600; }
.admin-form-grid input, .admin-form-grid select, .admin-form-grid textarea { box-sizing: border-box; width: 100%; min-height: 40px; border: 1px solid #cfd4da; border-radius: 6px; padding: 8px 10px; background: #fff; color: #202124; font: inherit; font-size: 14px; font-weight: 400; outline: none; }
.admin-form-grid textarea { min-height: 80px; resize: vertical; }
.admin-form-grid input:focus, .admin-form-grid select:focus, .admin-form-grid textarea:focus { border-color: #0b57d0; box-shadow: 0 0 0 2px rgba(11, 87, 208, .14); }
.admin-form-wide { grid-column: 1 / -1; }
.admin-form-grid .inline-check { display: inline-flex; align-items: center; min-height: 40px; gap: 8px; font-weight: 500; }
.admin-form-grid .inline-check input { width: 16px; min-height: 16px; height: 16px; margin: 0; accent-color: #0b57d0; }
.admin-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.form-help-text { margin: 0; color: #71809a; font-size: 12px; font-weight: 400; line-height: 1.55; }
.admin-resource-table { min-width: 910px; }
.admin-resource-table th { white-space: nowrap; }
.admin-resource-table td { vertical-align: top; }
.table-subtle { display: block; margin-top: 3px; color: #5f6368; font-size: 12px; line-height: 1.35; word-break: break-all; }
.session-ip { display: inline-block; padding: 4px 7px; border: 1px solid #dbe3ef; border-radius: 5px; background: #f7f9fc; color: #304563; font: 600 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.table-empty { padding: 28px 14px !important; color: #5f6368; text-align: center; }
.table-danger { color: #b3261e !important; }
.status-chip.muted { border-color: #d8dce0; background: #f1f3f4; color: #5f6368; }
.model-pricing-page { display: grid; gap: 14px; min-width: 0; }
.model-pricing-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; min-width: 0; border-bottom: 1px solid #e6ebf2; padding: 4px 0 16px; }
.model-pricing-header > div:first-child { display: grid; gap: 5px; min-width: 0; }
.model-pricing-header h2 { margin: 0; color: #1f304d; font-size: 20px; font-weight: 720; line-height: 1.3; }
.model-pricing-header p { max-width: 700px; margin: 0; color: #697991; font-size: 12px; line-height: 1.55; }
.model-pricing-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.model-pricing-summary > div { display: grid; gap: 5px; min-width: 0; border: 1px solid #e0e7f0; border-radius: 8px; padding: 12px 14px; background: #fff; }
.model-pricing-summary span { color: #71819a; font-size: 11px; }
.model-pricing-summary strong { color: #263b5d; font-size: 20px; font-weight: 700; line-height: 1.1; }
.model-pricing-table { min-width: 900px; }
.model-pricing-table td { vertical-align: middle; }
.model-pricing-mode { display: inline-flex; align-items: center; min-height: 24px; border: 1px solid #d7e1ee; border-radius: 6px; padding: 0 8px; background: #f7f9fc; color: #50647f; font-size: 11px; font-weight: 650; white-space: nowrap; }
.model-pricing-price-cell { min-width: 265px; }
.model-pricing-price-cell strong { display: block; color: #253b60; font-size: 13px; font-weight: 700; }
.model-pricing-price-cell small { display: block; margin-top: 4px; color: #76869e; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.model-pricing-ratio { color: #5573af; font: 600 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.native-drawer .model-pricing-editor, .native-drawer .model-pricing-sync { min-height: 100%; margin: 0; border: 0; border-radius: 0; padding: 30px 28px 34px; background: #fff; }
.native-drawer .model-pricing-editor .admin-form-head, .native-drawer .model-pricing-sync .admin-form-head { padding-right: 42px; }
.model-pricing-channel-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 18px 0 0; border: 1px solid #dfe7f1; border-radius: 8px; padding: 12px; background: #fbfcfe; }
.model-pricing-channel-list legend { padding: 0 5px; color: #50637e; font-size: 12px; font-weight: 700; }
.model-pricing-channel { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; border: 1px solid #e1e8f1; border-radius: 7px; padding: 9px; background: #fff; cursor: pointer; }
.model-pricing-channel input { width: 15px; height: 15px; margin: 0; accent-color: #3155bd; }
.model-pricing-channel span { display: grid; min-width: 0; gap: 3px; }
.model-pricing-channel strong, .model-pricing-channel small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-pricing-channel strong { color: #2f415f; font-size: 12px; }
.model-pricing-channel small { color: #8190a6; font-size: 10px; }
.model-pricing-sync-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.model-pricing-error { margin: 12px 0 0; border-left: 3px solid #b3261e; padding: 8px 10px; background: #fff7f6; color: #9d2720; font-size: 12px; line-height: 1.45; }
.model-pricing-empty-note { margin: 0; color: #7888a0; font-size: 12px; line-height: 1.5; }
.model-pricing-sync-tests { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.model-pricing-sync-tests span { border-radius: 6px; padding: 5px 7px; font-size: 11px; line-height: 1.35; }
.model-pricing-sync-tests .is-success { background: #f1fbf4; color: #21733c; }
.model-pricing-sync-tests .is-error { background: #fff5f3; color: #aa3028; }
.model-pricing-difference-list { display: grid; gap: 10px; margin-top: 18px; }
.model-pricing-difference-list > header { display: grid; gap: 3px; }
.model-pricing-difference-list > header strong { color: #314563; font-size: 13px; }
.model-pricing-difference-list > header span { color: #7788a0; font-size: 11px; line-height: 1.45; }
.native-drawer:has(.model-pricing-sync) { width: min(1180px, 100vw); }
.model-pricing-sync-table { min-width: 960px; table-layout: fixed; }
.model-pricing-sync-table th { vertical-align: bottom; }
.model-pricing-sync-table th:first-child { width: 22%; }
.model-pricing-sync-table th:nth-child(2) { width: 27%; }
.model-pricing-sync-table th:not(:first-child):not(:nth-child(2)) { min-width: 260px; }
.model-pricing-sync-source-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.model-pricing-sync-source-head strong { overflow: hidden; color: #354a6b; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.model-pricing-sync-source-head button { flex: 0 0 auto; min-height: 26px; border: 1px solid #cbd8ec; border-radius: 6px; padding: 0 7px; background: #fff; color: #3155bd; cursor: pointer; font: inherit; font-size: 10px; font-weight: 650; }
.model-pricing-sync-source-head button:hover { border-color: #829ed8; background: #edf3ff; }
.model-pricing-sync-model { min-width: 170px; background: #fff; vertical-align: middle !important; }
.model-pricing-sync-model strong { display: block; overflow-wrap: anywhere; color: #263b5d; font-size: 13px; font-weight: 700; }
.model-pricing-sync-model small { display: block; margin-top: 5px; color: #8795aa; font-size: 10px; }
.model-pricing-sync-current, .model-pricing-sync-source-cell { padding-top: 8px !important; padding-bottom: 8px !important; }
.model-pricing-sync-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 31px; gap: 7px; border-bottom: 1px solid #edf1f6; padding: 5px 0; }
.model-pricing-sync-field:first-child { padding-top: 0; }
.model-pricing-sync-field:last-child { border-bottom: 0; padding-bottom: 0; }
.model-pricing-sync-field b { overflow: hidden; min-width: 0; color: #324767; font: 600 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.model-pricing-sync-source-cell .model-pricing-sync-field { grid-template-columns: auto 16px minmax(0, 1fr); }
.model-pricing-sync-source-cell .model-pricing-sync-field input { width: 15px; height: 15px; margin: 0; accent-color: #3155bd; cursor: pointer; }
.model-pricing-sync-source-cell .model-pricing-sync-field:has(input:checked) { margin: 0 -7px; border-radius: 6px; padding-right: 7px; padding-left: 7px; background: #edf3ff; }
.model-pricing-sync-source-cell .model-pricing-sync-field.is-low-confidence { border-left: 2px dashed #dfab60; padding-left: 5px; }
.model-pricing-sync-field small { grid-column: 2 / -1; color: #aa7422; font-size: 9px; }
.model-pricing-sync-source-cell .model-pricing-sync-field small { grid-column: 3; }
.model-pricing-sync-placeholder { color: #a4afbe; font-size: 12px; }
.model-pricing-field-tag { display: inline-flex; align-items: center; min-height: 20px; border-radius: 10px; padding: 0 7px; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; }
.model-pricing-field-tag.is-model { background: #dff7f4; color: #147c73; }
.model-pricing-field-tag.is-completion { background: #fae6fb; color: #9b3c9f; }
.model-pricing-field-tag.is-cache { background: #eee9ff; color: #6451bb; }
.model-pricing-field-tag.is-price { background: #fff0d9; color: #9a6515; }
.model-pricing-field-tag.is-billing { background: #e8efff; color: #4266b7; }
.model-pricing-field-tag.is-other { background: #eef2f6; color: #66758b; }
@media (max-width: 760px) {
  .model-pricing-header { align-items: stretch; flex-direction: column; }
  .model-pricing-header > .table-actions { width: 100%; }
  .model-pricing-header > .table-actions > button { flex: 1 1 0; }
  .model-pricing-summary { grid-template-columns: 1fr; }
  .native-drawer .model-pricing-editor, .native-drawer .model-pricing-sync { padding: 24px 20px 28px; }
  .model-pricing-channel-list { grid-template-columns: 1fr; }
  .model-pricing-sync-actions > button { flex: 1 1 auto; }
}
.scheduler-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.scheduler-overview article { display: grid; gap: 6px; min-width: 0; border: 1px solid #e0e3e7; border-radius: 8px; padding: 13px 14px; background: #fff; }
.scheduler-overview span { color: #5f6368; font-size: 12px; }
.scheduler-overview strong { overflow: hidden; color: #202124; font-size: 18px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-runtime-metrics { display: grid; gap: 12px; margin: 0 0 16px; border: 1px solid #d9e4f2; border-radius: 8px; padding: 14px; background: #fbfdff; }
.scheduler-runtime-metrics > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scheduler-runtime-metrics > header > div { display: grid; gap: 3px; }
.scheduler-runtime-metrics > header strong { color: #243754; font-size: 13px; font-weight: 650; }
.scheduler-runtime-metrics > header span, .scheduler-runtime-grid small, .scheduler-runtime-unavailable { color: #71809a; font-size: 11px; line-height: 1.45; }
.scheduler-runtime-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.scheduler-runtime-grid article { display: grid; gap: 5px; min-width: 0; border-left: 3px solid #a9c2e8; padding: 3px 0 3px 10px; }
.scheduler-runtime-grid article:nth-child(2) { border-left-color: #78b9a0; }
.scheduler-runtime-grid article:nth-child(3) { border-left-color: #dea76b; }
.scheduler-runtime-grid span { color: #596b87; font-size: 11px; }
.scheduler-runtime-grid strong { overflow: hidden; color: #263a59; font-size: 19px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-runtime-unavailable { margin: 0; }
.scheduler-filter { display: inline-flex; align-items: center; gap: 8px; color: #3c4043; font-size: 13px; font-weight: 600; }
.scheduler-filter select { min-height: 38px; max-width: 180px; border: 1px solid #cfd4da; border-radius: 6px; padding: 0 28px 0 10px; background: #fff; color: #202124; font: inherit; font-size: 13px; }
.scheduler-priority { width: 82px; min-height: 34px; border: 1px solid #cfd4da; border-radius: 6px; padding: 5px 7px; background: #fff; color: #202124; font: inherit; }
.scheduler-policy-panel { display: grid; gap: 15px; margin-bottom: 18px; border: 1px solid #d8e2f2; border-radius: 12px; padding: 20px; background: linear-gradient(145deg, #f8fbff, #fff); box-shadow: 0 8px 24px rgba(42, 63, 107, .06); }
.scheduler-policy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.scheduler-policy-head h2 { margin: 0; color: #1a2948; font-size: 20px; }
.scheduler-policy-head span, .scheduler-policy-note { color: #71809a; font-size: 11px; line-height: 1.5; }
.scheduler-policy-kicker { margin: 0 0 5px; color: #5572b8; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.scheduler-mode-select, .scheduler-policy-grid label, .scheduler-credential-grid label { display: grid; gap: 6px; color: #52617b; font-size: 11px; font-weight: 650; }
.scheduler-mode-select { min-width: 190px; }
.scheduler-policy-grid, .scheduler-credential-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.scheduler-credential-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scheduler-policy-panel input, .scheduler-policy-panel select { min-width: 0; min-height: 36px; border: 1px solid #d3ddeb; border-radius: 7px; padding: 0 10px; background: #fff; color: #22314c; font: inherit; font-size: 12px; }
.scheduler-policy-panel input:focus, .scheduler-policy-panel select:focus { border-color: #6a86d8; outline: 3px solid rgba(75, 112, 211, .12); }
.scheduler-policy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.scheduler-policy-actions button { min-height: 36px; }
.scheduler-disable-check { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; color: #52617b; font-size: 12px; }
.scheduler-disable-check input { width: 16px; height: 16px; min-height: 0; accent-color: #3155bd; }
.scheduler-channel-picker { min-width: 0; margin: 0; border: 1px solid #e0e7f2; border-radius: 8px; padding: 12px; background: #fbfcff; }
.scheduler-channel-picker legend { padding: 0 5px; color: #52617b; font-size: 11px; font-weight: 700; }
.scheduler-channel-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; max-height: 190px; overflow: auto; padding: 3px; scrollbar-width: thin; }
.scheduler-channel-check { display: grid; grid-template-columns: 17px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; border: 1px solid #e2e8f1; border-radius: 7px; padding: 8px 9px; background: #fff; cursor: pointer; }
.scheduler-channel-check input { width: 15px; height: 15px; margin: 0; accent-color: #3155bd; }
.scheduler-channel-check span { display: grid; min-width: 0; gap: 3px; }
.scheduler-channel-check strong, .scheduler-channel-check small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-channel-check strong { color: #2d3d5d; font-size: 12px; }
.scheduler-channel-check small { color: #8190a6; font-size: 10px; }
.scheduler-group-cell { min-width: 135px; }
.scheduler-group-cell > strong, .scheduler-group-cell > small { display: block; }
.scheduler-group-rate { color: #5572b8; }
.model-market-page { display: grid; grid-template-columns: 276px minmax(0, 1fr); align-items: start; gap: 16px; min-width: 0; }
.model-market-filters { position: sticky; top: 12px; display: grid; gap: 18px; min-width: 0; border-right: 1px solid #e3e8f0; padding: 4px 16px 22px 0; }
.model-market-filters > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.model-market-filters > header strong { color: #1f304d; font-size: 17px; font-weight: 700; }
.model-market-filters > header button { min-height: 30px; border: 1px solid #dfe6ef; border-radius: 8px; padding: 0 10px; background: #fff; color: #566984; cursor: pointer; font: inherit; font-size: 11px; }
.model-market-filters > header button:hover { border-color: #aebfda; background: #f4f7fb; color: #3155bd; }
.model-market-filters section { display: grid; gap: 9px; border-top: 1px solid #e8edf3; padding-top: 16px; }
.model-market-filters h3 { margin: 0; color: #2f405e; font-size: 13px; font-weight: 700; }
.model-filter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.model-filter-option { display: flex; align-items: center; justify-content: space-between; min-width: 0; min-height: 32px; gap: 6px; border: 1px solid #e4e9f0; border-radius: 8px; padding: 0 8px; background: #fff; color: #42536d; cursor: pointer; font: inherit; font-size: 11px; text-align: left; }
.model-filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-filter-option b { flex: 0 0 auto; border-radius: 999px; padding: 1px 5px; background: #f0f3f8; color: #697a92; font-size: 10px; font-weight: 700; }
.model-filter-option:hover { border-color: #b8c9e6; background: #f7f9fe; }
.model-filter-option.active { border-color: #cbd6f6; background: #edf2ff; color: #3155bd; font-weight: 700; }
.model-filter-option.active b { background: #dce6ff; color: #3155bd; }
.model-market-main { display: grid; min-width: 0; gap: 14px; }
.model-market-banner { display: grid; min-height: 104px; align-items: center; border-radius: 12px; padding: 18px 22px; background: #1e5bd2; color: #fff; box-shadow: 0 8px 20px rgba(31, 86, 192, .16); }
.model-market-banner > div { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: start; gap: 6px 10px; }
.model-market-banner h2 { margin: 0; color: #fff; font-size: 20px; font-weight: 720; }
.model-market-banner span { border: 1px solid rgba(255,255,255,.52); border-radius: 999px; padding: 2px 7px; color: #fff; font-size: 11px; font-weight: 650; }
.model-market-banner p { grid-column: 1 / -1; margin: 0; color: rgba(255,255,255,.88); font-size: 12px; line-height: 1.55; }
.model-market-toolbar { display: flex; align-items: center; gap: 12px; min-width: 0; border-bottom: 1px solid #e8edf4; padding-bottom: 12px; color: #72819a; font-size: 11px; }
.model-market-toolbar label { display: flex; align-items: center; min-width: 0; flex: 1 1 auto; gap: 8px; border: 1px solid #e1e7f0; border-radius: 9px; padding: 0 11px; background: #f8fafc; }
.model-market-toolbar svg { width: 16px; height: 16px; flex: 0 0 auto; color: #7e8ea4; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.model-market-toolbar input { min-width: 0; width: 100%; height: 36px; border: 0; outline: 0; background: transparent; color: #233653; font: inherit; font-size: 12px; }
.model-market-toolbar input::placeholder { color: #91a0b5; }
.model-market-toolbar > span { flex: 0 0 auto; white-space: nowrap; }
.model-market-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.model-market-card { display: grid; min-width: 0; gap: 12px; min-height: 208px; border: 1px solid #e1e7ee; border-radius: 12px; padding: 15px; background: #fff; box-shadow: 0 2px 8px rgba(31, 51, 87, .035); }
.model-market-card:hover { border-color: #b8c9e5; box-shadow: 0 7px 18px rgba(38, 71, 125, .08); transform: translateY(-1px); transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.model-market-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.model-market-title { display: flex; min-width: 0; align-items: center; gap: 10px; }
.model-market-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border: 1px solid #dbe4f2; border-radius: 9px; background: #f5f8fc; color: #2d5499; font-size: 13px; font-weight: 800; }
.model-market-icon.is-anthropic { border-color: #ead8ca; background: #fff7f1; color: #a5532d; }
.model-market-icon.is-google { border-color: #d2e2fa; background: #f4f8ff; color: #2473d5; }
.model-market-icon.is-openai { border-color: #dbe3e0; background: #f5f8f7; color: #315a4d; }
.model-market-icon.is-minimax { border-color: #f5d7d7; background: #fff6f6; color: #c13f4b; }
.model-market-icon.is-xai { border-color: #d8dded; background: #f5f7fc; color: #3d4c73; }
.model-market-icon.is-deepseek { border-color: #d7defd; background: #f5f7ff; color: #3558d3; }
.model-market-icon.is-qwen { border-color: #d4e8e2; background: #f4fbf8; color: #1d806a; }
.model-market-title > div { display: grid; min-width: 0; gap: 3px; }
.model-market-title h3 { overflow: hidden; margin: 0; color: #273a59; font-size: 16px; font-weight: 720; text-overflow: ellipsis; white-space: nowrap; }
.model-market-title span { overflow: hidden; color: #8090a7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-market-copy { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #71839c; cursor: pointer; }
.model-market-copy:hover { border-color: #b8c9e5; background: #f4f7fd; color: #3155bd; }
.model-market-copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.model-market-prices { display: grid; gap: 8px; color: #3c5073; font-size: 11px; line-height: 1.4; }
.model-market-prices section { display: grid; gap: 3px; min-width: 0; }
.model-market-prices strong { color: #526987; font-size: 10px; font-weight: 700; line-height: 1.25; }
.model-market-prices span { color: #2c4266; overflow-wrap: anywhere; }
.model-market-prices small { color: #7d8ca3; font-size: 10px; line-height: 1.35; overflow-wrap: anywhere; }
.model-market-card > p { overflow: hidden; margin: 0; color: #7787a0; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.model-market-card footer { display: flex; align-self: end; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.model-market-card footer > div { display: flex; justify-content: flex-end; min-width: 0; gap: 4px; overflow: hidden; }
.model-market-billing, .model-market-tag { flex: 0 0 auto; border-radius: 999px; padding: 3px 7px; font-size: 10px; font-weight: 650; line-height: 1; }
.model-market-billing { background: #f2ecff; color: #6544b8; }
.model-market-tag { border: 1px solid #e1e7ef; background: #f8fafc; color: #64758c; }
.model-market-empty { grid-column: 1 / -1; min-height: 170px; place-content: center; border: 1px dashed #cbd7e6; border-radius: 10px; color: #7b8ba3; font-size: 13px; text-align: center; }
@media (max-width: 1100px) { .model-market-page { grid-template-columns: 226px minmax(0, 1fr); } .model-filter-list { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .model-market-page { grid-template-columns: 1fr; } .model-market-filters { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; border-right: 0; border-bottom: 1px solid #e3e8f0; padding: 0 0 14px; } .model-market-filters > header { grid-column: 1 / -1; } .model-filter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .model-market-filters { grid-template-columns: 1fr; } .model-market-filters > header { grid-column: auto; } .model-filter-list, .model-market-grid { grid-template-columns: 1fr; } .model-market-banner { min-height: 92px; padding: 16px; } .model-market-toolbar { align-items: stretch; flex-direction: column; } .model-market-toolbar > span { text-align: right; } .model-market-card { min-height: 0; } }
.scheduler-policy-summary { display: grid; gap: 8px; border-radius: 8px; padding: 11px 13px; background: #f4f7fb; color: #52617b; font-size: 12px; }
.scheduler-policy-allowed, .scheduler-policy-blocked { border-radius: 6px; padding: 8px 10px; font-size: 12px; }
.scheduler-policy-allowed { background: #f1fbf4; color: #347348; }
.scheduler-policy-blocked { background: #fff4ef; color: #aa4c2c; }
.scheduler-probe-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #d9e3ef; border-radius: 8px; padding: 10px 12px; font-size: 12px; }
.scheduler-probe-result.is-pass { border-color: #b9d9c2; background: #f5fbf6; color: #347348; }
.scheduler-probe-result.is-fail { border-color: #efc1b1; background: #fff7f3; color: #aa4c2c; }
.scheduler-probe-empty { color: #71809a; background: #fbfcff; }
@media (max-width: 900px) { .scheduler-policy-grid, .scheduler-credential-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .scheduler-policy-head { flex-direction: column; } .scheduler-mode-select { width: 100%; } }
@media (max-width: 600px) { .scheduler-policy-panel { padding: 16px; } .scheduler-policy-grid, .scheduler-credential-grid, .scheduler-runtime-grid { grid-template-columns: 1fr; } .scheduler-policy-actions { align-items: stretch; flex-direction: column; } .scheduler-policy-actions button, .scheduler-disable-check { width: 100%; margin-right: 0; } .scheduler-probe-result { align-items: flex-start; flex-direction: column; } .scheduler-runtime-metrics > header { align-items: stretch; flex-direction: column; } .scheduler-runtime-metrics > header .connection-secondary { width: 100%; } }

/* Visual group pricing editor. It serializes to the platform's native JSON options on save. */
.group-pricing-editor { display: grid; gap: 16px; }
.group-pricing-editor-head, .group-pricing-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.group-pricing-editor-head { border-bottom: 1px solid #e4e7eb; padding-bottom: 16px; }
.group-pricing-editor-head > div, .group-pricing-section-head > div { display: grid; gap: 4px; min-width: 0; }
.group-pricing-editor-head strong { color: #202124; font-size: 16px; font-weight: 650; }
.group-pricing-editor-head span, .group-pricing-section-head span { color: #5f6368; font-size: 12px; line-height: 1.45; }
.group-pricing-editor > form { display: grid; gap: 18px; }
.group-pricing-section { display: grid; gap: 11px; border: 1px solid #e0e7f2; border-radius: 8px; padding: 14px; background: #fbfcff; }
.group-pricing-section-head strong { color: #263754; font-size: 14px; font-weight: 650; }
.group-pricing-section-head .connection-secondary { flex: 0 0 auto; min-height: 32px; white-space: nowrap; }
.group-pricing-grid-head { display: grid; grid-template-columns: 1.1fr .82fr .82fr 1.25fr 1.15fr 28px; gap: 8px; padding: 0 2px; color: #71809a; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.group-pricing-rows, .group-pricing-override-rows { display: grid; gap: 8px; }
.group-pricing-row { display: grid; grid-template-columns: 1.1fr .82fr .82fr 1.25fr 1.15fr 28px; gap: 8px; align-items: end; border: 1px solid #e2e8f3; border-radius: 7px; padding: 10px; background: #fff; }
.group-pricing-row label, .group-pricing-override-row label, .group-pricing-auto label, .group-pricing-advanced label { display: grid; min-width: 0; gap: 6px; color: #52617b; font-size: 11px; font-weight: 600; }
.group-pricing-row label > input, .group-pricing-override-row label > input, .group-pricing-auto input[type="number"], .group-pricing-advanced textarea { box-sizing: border-box; width: 100%; min-height: 34px; border: 1px solid #d4ddea; border-radius: 6px; padding: 7px 8px; background: #fff; color: #24324e; font: inherit; font-size: 12px; outline: 0; }
.group-pricing-row label > input:focus, .group-pricing-override-row label > input:focus, .group-pricing-auto input[type="number"]:focus, .group-pricing-advanced textarea:focus { border-color: #8ca5e9; box-shadow: 0 0 0 3px rgba(65, 105, 225, .10); }
.group-pricing-row .group-pricing-check { display: flex; flex-wrap: wrap; align-items: center; min-height: 34px; gap: 8px; color: #40506e; font-size: 11px; font-weight: 600; }
.group-pricing-check input, .group-pricing-switch input { width: 16px; height: 16px; margin: 0; accent-color: #3155bd; }
.group-pricing-remove { width: 28px; height: 28px; border: 0; border-radius: 50%; padding: 0; background: transparent; color: #65738c; cursor: pointer; font: 500 21px/24px Arial, sans-serif; }
.group-pricing-remove:hover { background: #fce8e6; color: #b3261e; }
.group-pricing-override-head, .group-pricing-override-row { display: grid; grid-template-columns: 1fr 1fr .85fr 28px; gap: 8px; align-items: end; }
.group-pricing-override-head { padding: 0 2px; color: #71809a; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.group-pricing-override-row { border: 1px solid #e2e8f3; border-radius: 7px; padding: 10px; background: #fff; }
.group-pricing-empty { margin: 0; border: 1px dashed #d5deec; border-radius: 7px; padding: 13px; color: #71809a; font-size: 12px; line-height: 1.45; text-align: center; }
.group-pricing-auto { grid-template-columns: minmax(0, 1fr) 160px; align-items: end; }
.group-pricing-auto > div { display: grid; gap: 4px; }
.group-pricing-auto > div strong { color: #263754; font-size: 14px; font-weight: 650; }
.group-pricing-auto > div span { color: #71809a; font-size: 12px; line-height: 1.4; }
.group-pricing-switch { grid-column: 1 / -1; display: inline-flex !important; align-items: center; gap: 8px; color: #40506e !important; font-size: 12px !important; }
.group-pricing-advanced { border: 1px solid #e0e7f2; border-radius: 8px; padding: 0 14px 14px; background: #fff; }
.group-pricing-advanced > summary { min-height: 42px; color: #40506e; cursor: pointer; font-size: 12px; font-weight: 650; line-height: 42px; }
.group-pricing-advanced textarea { min-height: 112px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; line-height: 1.45; }

.app-shell.is-collapsed { --rail-width: 80px; }
.is-collapsed .sidebar-head { justify-content: center; padding: 12px 0; }
.is-collapsed .sidebar-toggle { position: static; opacity: 1; pointer-events: auto; }
.is-collapsed .brand { display: none; }
.is-collapsed .nav-item span, .is-collapsed .nav-disclosure, .is-collapsed .recent-section, .is-collapsed .side-popover { display: none; }
.is-collapsed .sidebar-scroll, .is-collapsed .sidebar-foot { padding-right: 14px; padding-left: 14px; }
.is-collapsed .nav-item { justify-content: center; padding: 0; border-radius: 50%; }
.is-collapsed .nav-item:hover { transform: scale(1.04); }
.is-collapsed .new-chat { margin-bottom: 8px; }

.chatting .zero-state { transform: translateY(-16px); opacity: 0; pointer-events: none; }
.chatting .chat-history { display: block; }
.chatting .composer-wrap { top: auto; bottom: 22px; transform: translateX(-50%); }

@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes popover-reveal { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes content-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes workspace-reveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes workspace-content-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes page-transition-fade { from { opacity: 0; } to { opacity: 1; } }
.main-stage.page-transition .zero-state, .main-stage.page-transition .composer-wrap { animation: page-transition-fade 220ms ease-out both; }
@keyframes drawer-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-enter-right { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }

@media (max-width: 840px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-shell.mobile-sidebar-open::after { content: ""; position: fixed; z-index: 19; inset: 0; background: rgba(32, 33, 36, .22); }
  .sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-102%); box-shadow: 4px 0 16px rgba(60, 64, 67, .22); transition: transform 220ms cubic-bezier(.2,0,0,1); }
  .app-shell.mobile-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-head { min-height: 68px; }
  .mobile-menu { display: grid; }
  .topbar { min-height: 64px; padding: 12px 16px; }
  .topbar-spacer { display: none; }
  .guest-status { display: inline-flex; max-width: 170px; min-width: 0; flex: 1 1 auto; }
  .mobile-menu, .login-button, .avatar { flex: 0 0 auto; }
  .login-button { position: static; min-height: 36px; padding: 0 13px; margin-left: auto; }
  .main-stage { inset: 64px 0 0; }
  .workspace-view { width: min(100% - 32px, 720px); padding-top: 28px; }
  .native-settings-layout { grid-template-columns: 184px minmax(0, 1fr); gap: 22px; }
  .native-settings-nav { padding-right: 12px; }
  .native-option-row { grid-template-columns: minmax(140px, .8fr) minmax(0, 1.2fr); gap: 16px; }
  .zero-state { padding: 180px 22px 0; place-items: start center; }
  .zero-state h1 { font-size: 34px; }
  .composer-wrap { top: 50%; right: 12px; left: 12px; width: auto; max-width: none; transform: translateY(-68px); }
  .composer { min-height: 64px; border-radius: 25px; }
  .chat-history { width: calc(100% - 32px); padding-bottom: 146px; }
  .upgrade-button { min-height: 36px; padding: 0 12px; }
  .settings-anchor[hidden] { display: none !important; }
  .avatar { display: grid; }
  .connection-panel { position: fixed; top: 60px; right: 16px; }
  .chatting .composer-wrap { top: auto; bottom: 16px; transform: none; }
}

@media (max-width: 600px) {
  .topbar { gap: 6px; }
  .guest-status { display: none; }
  .login-button, .avatar { position: fixed; z-index: 5; top: 14px; right: 16px; margin: 0; }
  .upgrade-button { position: fixed; z-index: 5; top: 14px; right: 82px; min-height: 36px; padding: 0 11px; }
  .connection-button { width: 40px; padding: 0; justify-content: center; }
  .connection-button span:last-child { display: none; }
  .composer-wrap { position: fixed; }
  .workspace-view { width: calc(100% - 32px); padding-top: 20px; }
  .workspace-view-head h1 { font-size: 25px; }
  .workspace-view-head { gap: 12px; }
  .metric-grid { grid-template-columns: 1fr; }
  .token-form-grid { grid-template-columns: 1fr; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .admin-toolbar > .table-actions, .admin-toolbar > button { align-self: stretch; }
  .admin-toolbar > .table-actions { display: flex; width: 100%; }
  .admin-toolbar > .table-actions > button { flex: 1 1 auto; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-form-wide { grid-column: auto; }
  .admin-form-actions { justify-content: stretch; }
  .admin-form-actions button { flex: 1 1 auto; }
  .scheduler-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scheduler-channel-checks { grid-template-columns: 1fr; max-height: 220px; }
  .scheduler-filter { width: 100%; justify-content: space-between; }
  .admin-options-toolbar { flex-direction: column; }
  .admin-options-grid { grid-template-columns: 1fr; }
  .admin-option-field { grid-template-columns: minmax(110px, 1fr) minmax(0, 1.5fr) auto; }
  .native-settings-layout { display: block; }
  .native-settings-nav { position: static; display: flex; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #e0e3e7; padding: 0 0 14px; }
  .native-settings-nav-head { display: none; }
  .native-settings-nav-group { display: contents; margin: 0; }
  .native-settings-nav-group > p { display: none; }
  .native-settings-nav-item { flex: 0 0 auto; width: auto; min-height: 32px; padding: 6px 10px; border: 1px solid #d8dde3; background: #fff; white-space: nowrap; }
  .native-settings-nav-item.active { border-color: #8ab4f8; }
  .native-settings-nav-item small { display: none; }
  .native-settings-panel { padding-top: 20px; }
  .native-settings-panel-head h2 { font-size: 22px; }
  .native-settings-panel-head { gap: 10px; }
  .native-settings-panel-head .connection-secondary { flex: 0 0 auto; }
  .native-settings-search { align-items: stretch; flex-wrap: wrap; }
  .native-settings-search label { flex-basis: 100%; }
  .native-settings-search > button { flex: 1 1 0; }
  .native-settings-actions { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .native-option-row { grid-template-columns: 1fr; gap: 10px; padding: 14px 0; }
  .native-option-row.is-dirty { margin: 0 -8px; padding-right: 8px; padding-left: 8px; }
  .native-oauth-form-grid, .native-status-grid { grid-template-columns: 1fr; }
  .native-special-head, .native-special-toolbar, .native-oauth-provider { align-items: flex-start; flex-direction: column; }
  .native-special-actions { justify-content: flex-start; }
  .token-form-wide { grid-column: auto; }
  .profile-row { align-items: flex-start; flex-direction: column; gap: 7px; }
  .profile-row strong { max-width: 100%; text-align: left; }
  .user-settings-card, .purchase-dialog-card { padding: 20px; }
  .plan-grid { grid-template-columns: 1fr; }
  .zero-state h1 { width: min(330px, calc(100vw - 44px)); max-width: 330px; font-size: 28px; line-height: 1.3; }
  .zero-state-note { max-width: 300px; font-size: 12px; }
}

/* Channel scheduler: a single workflow with restrained panels and a canonical table selection. */
.workspace-view[data-view="channel-scheduler"] .workspace-content {
  gap: 16px;
}
.scheduler-policy-panel {
  gap: 16px;
  margin: 0;
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(35, 57, 88, .045);
}
.scheduler-policy-head {
  align-items: flex-start;
  border: 0;
  padding: 0;
}
.scheduler-policy-kicker {
  margin: 0 0 4px;
  color: #6680b3;
  font-size: 10px;
  letter-spacing: .08em;
}
.scheduler-policy-head h2 {
  color: #1f3150;
  font-size: 19px;
  letter-spacing: 0;
}
.scheduler-policy-head > div > span {
  display: block;
  max-width: 540px;
  margin-top: 5px;
  color: #7b899e;
  font-size: 12px;
}
.scheduler-mode-select {
  min-width: 180px;
}
.scheduler-mode-select > span,
.scheduler-policy-grid label > span,
.scheduler-credential-grid label > span,
.scheduler-ratio-scope span {
  color: #71809a;
  font-size: 11px;
  font-weight: 650;
}
.scheduler-policy-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  border-top: 1px solid #edf1f6;
  padding-top: 15px;
}
.scheduler-policy-grid label,
.scheduler-credential-grid label {
  gap: 6px;
}
.scheduler-policy-panel input,
.scheduler-policy-panel select {
  min-height: 38px;
  border-color: #d5deea;
  border-radius: 7px;
  color: #263a59;
  font-size: 12px;
}
.scheduler-policy-readout {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  border-left: 3px solid #b8c9e6;
  padding-left: 11px;
}
.scheduler-policy-readout span,
.scheduler-policy-readout small {
  overflow: hidden;
  color: #7b899e;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scheduler-policy-readout strong {
  color: #2e4772;
  font-size: 15px;
  font-weight: 700;
}
.scheduler-policy-summary {
  padding: 0;
  background: transparent;
}
.scheduler-policy-allowed,
.scheduler-policy-blocked {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 12px;
}
.scheduler-policy-allowed {
  border-color: #cce7d5;
  background: #f5fbf7;
  color: #347348;
}
.scheduler-policy-blocked {
  border-color: #f0d0c3;
  background: #fff8f5;
  color: #a24f35;
}
.scheduler-policy-actions {
  align-items: center;
  gap: 8px;
  border-top: 1px solid #edf1f6;
  padding-top: 14px;
}
.scheduler-policy-actions button {
  min-height: 36px;
}
.scheduler-disable-check {
  margin-right: auto;
  color: #62728a;
  font-size: 11px;
}
.scheduler-source-details {
  border-color: #e3e9f1;
  background: #fafbfd;
}
.scheduler-source-details > summary {
  min-height: 36px;
  padding: 0 12px;
  color: #52617b;
  font-size: 12px;
  line-height: 36px;
}
.scheduler-source-details[open] > summary {
  border-bottom-color: #e7edf5;
}
.scheduler-source-details .scheduler-credential-grid {
  border-bottom: 0;
  padding: 13px 12px 8px;
}
.scheduler-source-details .scheduler-policy-actions {
  border-top: 0;
  padding: 0 12px 13px;
}
.scheduler-source-details .scheduler-policy-note {
  margin: 0;
}
.scheduler-channels-section {
  gap: 12px;
}
.scheduler-channels-section > .admin-toolbar {
  align-items: center;
  min-height: 48px;
  margin: 0;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
}
.scheduler-channels-section > .workspace-note {
  margin: -2px 2px 0;
  color: #7b899e;
  font-size: 11px;
}
.scheduler-selection-count {
  margin-right: auto;
  color: #5c6d86;
  font-size: 11px;
  white-space: nowrap;
}
.scheduler-select-head,
.scheduler-select-cell {
  width: 38px;
  padding-right: 3px !important;
  padding-left: 12px !important;
  text-align: center;
}
.scheduler-select-cell input,
.scheduler-select-head input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #3155bd;
  vertical-align: middle;
}
.scheduler-rank-cell {
  width: 44px;
  color: #8693a6;
  font-variant-numeric: tabular-nums;
}
.scheduler-channels-section > .data-table-wrap {
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(35, 57, 88, .035);
}
.scheduler-channels-section .data-table {
  min-width: 980px;
}
.scheduler-channels-section .data-table th {
  height: 42px;
  background: #f7f9fc;
  color: #6c7a90;
  font-size: 11px;
  font-weight: 700;
}
.scheduler-channels-section .data-table td {
  min-height: 58px;
  color: #3f506b;
  font-size: 12px;
}
.scheduler-channels-section .data-table tbody tr:hover {
  background: #fbfcff;
}
.scheduler-channels-section .table-actions {
  white-space: nowrap;
}
.scheduler-runtime-metrics {
  margin: 0;
  border: 1px solid #dfe6ef;
  border-radius: 9px;
  padding: 13px 14px;
  background: #fff;
  box-shadow: none;
}
.scheduler-runtime-metrics > header {
  padding-bottom: 1px;
}
.scheduler-runtime-metrics > header strong {
  color: #344967;
  font-size: 12px;
}
.scheduler-runtime-grid strong {
  color: #253b5c;
  font-size: 18px;
}
.scheduler-ratio-details {
  border: 1px solid #dfe6ef;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.scheduler-ratio-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 15px;
  color: #314664;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}
.scheduler-ratio-details > summary::-webkit-details-marker {
  display: none;
}
.scheduler-ratio-details > summary::after {
  content: '展开';
  flex: 0 0 auto;
  color: #71809a;
  font-size: 11px;
  font-weight: 500;
}
.scheduler-ratio-details[open] > summary {
  border-bottom: 1px solid #e9eef5;
}
.scheduler-ratio-details[open] > summary::after {
  content: '收起';
}
.scheduler-ratio-details > summary small {
  overflow: hidden;
  margin-left: auto;
  color: #8794a8;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scheduler-ratio-panel-body {
  display: grid;
  gap: 12px;
  padding: 13px 15px 15px;
}
.scheduler-ratio-panel .ratio-detector-controls,
.scheduler-ratio-panel .ratio-detector-results {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}
.scheduler-ratio-panel .ratio-detector-control-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(180px, .7fr);
  align-items: end;
  gap: 10px;
}
.scheduler-ratio-panel .ratio-detector-control-row label {
  flex: none;
}
.scheduler-ratio-scope {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 38px;
  border-left: 3px solid #b8c9e6;
  padding-left: 11px;
}
.scheduler-ratio-scope strong {
  color: #3a5279;
  font-size: 13px;
}
.scheduler-ratio-scope small {
  color: #8794a8;
  font-size: 10px;
}
.scheduler-ratio-panel .workspace-note {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.scheduler-ratio-panel .ratio-detector-results:empty {
  display: none;
}

@media (max-width: 900px) {
  .scheduler-policy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scheduler-ratio-panel .ratio-detector-control-row {
    grid-template-columns: minmax(0, 1fr) 140px;
  }
  .scheduler-ratio-scope {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .scheduler-policy-panel {
    padding: 15px;
  }
  .scheduler-policy-head {
    gap: 12px;
  }
  .scheduler-policy-head h2 {
    font-size: 18px;
  }
  .scheduler-policy-grid,
  .scheduler-ratio-panel .ratio-detector-control-row {
    grid-template-columns: 1fr;
  }
  .scheduler-policy-readout,
  .scheduler-ratio-scope {
    grid-column: auto;
  }
  .scheduler-policy-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .scheduler-policy-actions button,
  .scheduler-disable-check {
    width: 100%;
    margin-right: 0;
  }
  .scheduler-channels-section > .admin-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .scheduler-selection-count {
    order: 2;
    width: 100%;
  }
  .scheduler-channels-section > .admin-toolbar .table-actions {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .scheduler-ratio-details > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 10px 13px;
    line-height: 1.45;
  }
  .scheduler-ratio-details > summary small {
    flex: 1 1 100%;
    margin-left: 0;
  }
  .scheduler-ratio-panel-body {
    padding: 12px 13px 14px;
  }
}

@media (max-width: 460px) {
  .composer { padding-left: 14px; padding-right: 14px; }
  .mode-button { padding-left: 9px; }
  .mode-button span { max-width: 52px; overflow: hidden; text-overflow: ellipsis; }
  .mode-popover { right: -42px; }
  .zero-state h1 { font-size: 32px; line-height: 1.27; }
  .verification-code-row { grid-template-columns: 1fr; gap: 8px; }
  .email-code-button { width: 100%; }
}

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

/* Product polish: a quieter shell with a clearer conversation focus. */
:root {
  --surface: #fbfcff;
  --rail: #f7f9fd;
  --rail-hover: #edf2ff;
  --input: #ffffff;
  --text: #17223b;
  --muted: #4d5b74;
  --subtle: #71809a;
  --border: #e1e7f0;
  --blue: #4169e1;
  --blue-deep: #2f4eb5;
  --violet: #7258d9;
  --shadow: 0 14px 36px rgba(42, 63, 107, .12), 0 2px 6px rgba(42, 63, 107, .06);
  --rail-width: 272px;
}

body { background: #f6f8fc; }

.app-shell { background: #f6f8fc; }

.sidebar {
  border-right: 1px solid #e7ebf3;
  background: var(--rail);
  box-shadow: 5px 0 24px rgba(42, 63, 107, .06);
}

.sidebar-head { min-height: 78px; padding: 16px 18px; gap: 10px; }

.sidebar-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid #e0e7f2;
  background: #fff;
  color: #5c6a83;
  box-shadow: 0 2px 8px rgba(42, 63, 107, .06);
}

.sidebar-toggle:hover { border-color: #c8d5f2; background: #eef3ff; color: var(--blue-deep); }

.brand { gap: 10px; padding: 6px 5px; color: #1b2946; font-size: 20px; font-weight: 650; }
.brand img { width: 30px; height: 30px; filter: drop-shadow(0 3px 8px rgba(65, 105, 225, .22)); }

.sidebar-scroll { padding: 10px 14px 18px; }

.nav-item {
  gap: 13px;
  min-height: 42px;
  border-radius: 12px;
  color: #4b5870;
  font-size: 13px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-item:hover { background: var(--rail-hover); color: var(--blue-deep); transform: translateX(2px); }
.nav-item.active { background: #e9efff; color: var(--blue-deep); font-weight: 650; box-shadow: inset 3px 0 0 var(--blue); }
.nav-item svg { color: #687791; }
.nav-item.active svg { color: var(--blue); }
.new-chat { margin-bottom: 10px; border: 1px solid #dce5f5; background: #fff; color: #2f4b88; box-shadow: 0 4px 12px rgba(42, 63, 107, .06); }
.new-chat:hover { border-color: #c9d6f4; background: #f0f4ff; }

.admin-nav-section { margin-top: 20px; border-top-color: #e1e7f0; }
.section-label { color: #8a96aa; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }

.side-popover { margin-left: 22px; border-left-color: #cbd7f3; }
.side-popover-group + .side-popover-group { border-top-color: #e1e7f0; }
.side-popover-label { color: #8a96aa; font-size: 10px; }
.side-popover a, .side-popover button { min-height: 34px; border-radius: 10px; color: #61708a; font-size: 12px; }
.side-popover a:hover, .side-popover button:hover { background: #edf2ff; color: var(--blue-deep); }
.side-popover a.view-active, .side-popover button.view-active { background: #e7eeff; color: var(--blue-deep); }

.sidebar-foot { padding: 10px 14px 20px; }

.workspace { background: #f8faff; }
.topbar {
  min-height: 78px;
  border-bottom: 1px solid rgba(225, 231, 240, .86);
  padding: 14px 28px;
  background: rgba(251, 252, 255, .86);
  backdrop-filter: blur(16px);
}

.guest-status { flex: 0 0 auto; min-height: 34px; max-width: none; overflow: visible; border-color: #dfe6f1; border-radius: 11px; padding: 0 11px; background: #fff; color: #687791; box-shadow: 0 2px 8px rgba(42, 63, 107, .04); font-variant-numeric: tabular-nums; }
.upgrade-button { min-height: 38px; border-color: #f0cbd3; border-radius: 11px; padding: 0 13px; background: #fff8f9; color: #b44f63; font-size: 13px; font-weight: 650; }
.upgrade-button:hover { border-color: #e5a9b7; background: #fff0f3; }
.login-button { min-height: 38px; border: 1px solid var(--blue); border-radius: 11px; padding: 0 16px; background: var(--blue); box-shadow: 0 5px 14px rgba(65, 105, 225, .22); }
.login-button:hover { border-color: var(--blue-deep); background: var(--blue-deep); box-shadow: 0 7px 18px rgba(65, 105, 225, .28); }
.avatar { background: #5d62c9; box-shadow: 0 5px 14px rgba(93, 98, 201, .22); }

.main-stage {
  inset: 78px 0 0;
  background: radial-gradient(circle at 72% 28%, rgba(111, 137, 236, .12), transparent 30%), linear-gradient(180deg, #f6f8ff 0%, #f9fbff 56%, #ffffff 100%);
}

.main-stage.viewing { background: #fff; }
.zero-state { padding-top: 174px; gap: 14px; animation: content-reveal 420ms ease-out both; }
.zero-state[hidden] { display: none !important; }
.zero-state h1 { color: #1a2948; font-size: 42px; font-weight: 560; line-height: 1.18; }
.zero-state-note { color: #71809a; font-size: 13px; }

.composer-wrap { max-width: 720px; transform: translate(-50%, -62px); }
.composer {
  min-height: 72px;
  border: 1px solid #dce5f2;
  border-radius: 22px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 36px rgba(42, 63, 107, .12), 0 2px 7px rgba(42, 63, 107, .06);
}

.composer:focus-within { border-color: #9fb4ed; background: #fff; box-shadow: 0 18px 42px rgba(65, 105, 225, .16), 0 0 0 4px rgba(65, 105, 225, .08); }
#prompt-input { color: #1b2946; font-size: 16px; }
#prompt-input::placeholder { color: #8a96aa; }
.composer-button { color: #6b7890; }
.composer-button:hover { background: #edf2ff; color: var(--blue-deep); }
.mode-button { min-height: 34px; border: 1px solid #e4e9f2; border-radius: 10px; padding: 0 9px 0 11px; background: #f7f9fd; color: #52617b; font-size: 12px; }
.mode-button:hover { border-color: #cbd7f3; background: #edf2ff; color: var(--blue-deep); }
.send-button { width: 38px; height: 38px; color: #98a4b8; }
.send-button:not(:disabled) { background: var(--blue); color: #fff; box-shadow: 0 5px 12px rgba(65, 105, 225, .24); }
.send-button:not(:disabled):hover { background: var(--blue-deep); }
.stop-button { width: 38px; height: 38px; border: 1px solid #e4b5bf; background: #fff5f6; color: #b44f63; }
.stop-button:hover { border-color: #d88b9a; background: #ffecef; }
.disclaimer { color: #8a96aa; }

.chat-history { box-sizing: border-box; width: 100%; margin: 0; padding: 20px max(32px, calc((100% - 880px) / 2)) 152px; }
.chat-message.user p { background: #e9efff; color: #263d77; }
.assistant-copy { color: #34425c; }

.message-actions { grid-column: 2 / -1; min-width: 0; display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 6px; margin-top: 8px; overflow-x: auto; opacity: .72; scrollbar-width: thin; }
.message-actions button { flex: 0 0 auto; min-height: 26px; border: 1px solid #d9e1ef; border-radius: 8px; padding: 0 8px; background: #fff; color: #687791; cursor: pointer; font-size: 11px; white-space: nowrap; }
.message-actions button:hover { border-color: #b9c8ec; background: #f0f4ff; color: var(--blue-deep); }
.chat-message.user .user-message-actions { grid-column: auto; justify-self: end; margin-top: -5px; }
.chat-message.is-streaming .assistant-copy { min-height: 24px; }
.chat-message.is-streaming .status-copy { display: inline-block; min-width: 154px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.status-page { display: grid; gap: 18px; padding: 24px; border: 1px solid #dfe7e4; border-radius: 12px; background-color: #fcfffd; background-image: linear-gradient(rgba(41, 87, 69, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(41, 87, 69, .045) 1px, transparent 1px); background-size: 24px 24px; }
.status-page.is-refreshing { opacity: .76; transition: opacity 140ms ease; }
.status-page.is-refreshing .status-toolbar, .status-page.is-refreshing .status-service-card { pointer-events: none; }
.status-page-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid #dce7e1; }
.status-page-intro > div:first-child { min-width: 0; }
.status-page-kicker, .status-service-kicker { display: block; color: #4b7662; font-size: 11px; font-weight: 700; letter-spacing: 0; }
.status-page-intro h2 { margin: 7px 0 8px; color: #1c342a; font-size: 28px; font-weight: 650; line-height: 1.2; }
.status-page-intro p { max-width: 680px; margin: 0; color: #62756b; font-size: 13px; line-height: 1.65; }
.status-overall { display: grid; grid-template-columns: 9px minmax(0, 1fr); align-items: center; gap: 3px 9px; min-width: 176px; border: 1px solid #d8e7df; border-radius: 8px; padding: 12px 14px; background: #fff; }
.status-overall > i, .status-pill i { width: 8px; height: 8px; border-radius: 50%; background: #97a6a0; }
.status-overall > i { grid-row: 1 / span 2; }
.status-overall strong { color: #294437; font-size: 13px; font-weight: 700; }
.status-overall span { color: #75867e; font-size: 11px; white-space: nowrap; }
.status-overall.operational { border-color: #b9dac6; background: #fbfffc; }
.status-overall.operational > i, .status-pill.operational i { background: #218352; box-shadow: 0 0 0 4px rgba(33, 131, 82, .11); }
.status-overall.degraded { border-color: #f1d9a8; background: #fffdf7; }
.status-overall.degraded > i, .status-pill.degraded i { background: #bf7d13; box-shadow: 0 0 0 4px rgba(191, 125, 19, .1); }
.status-overall.down { border-color: #efc5c1; background: #fffafa; }
.status-overall.down > i, .status-pill.down i { background: #bf4039; box-shadow: 0 0 0 4px rgba(191, 64, 57, .1); }
.status-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid #dce7e1; border-radius: 8px; background: #fff; overflow: hidden; }
.status-summary > div { display: grid; gap: 5px; min-width: 0; padding: 15px 18px; border-right: 1px solid #e7eeea; }
.status-summary > div:last-child { border-right: 0; }
.status-summary span { color: #718279; font-size: 12px; }
.status-summary strong { color: #234235; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.status-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.status-toolbar select, .status-search input { min-height: 36px; border: 1px solid #cfded7; border-radius: 7px; padding: 0 10px; background: #fff; color: #344a3e; font: inherit; font-size: 12px; }
.status-toolbar select:focus, .status-search input:focus { border-color: #6ca989; outline: 3px solid rgba(58, 133, 94, .13); }
.status-search { flex: 1 1 220px; min-width: 180px; }
.status-search input { box-sizing: border-box; width: 100%; }
.status-auto-refresh { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 5px; color: #53695d; cursor: pointer; font-size: 12px; white-space: nowrap; }
.status-auto-refresh input { width: 15px; height: 15px; margin: 0; accent-color: #2d8758; }
.status-toolbar .connection-secondary { margin-left: auto; min-height: 36px; border-color: #c7dbcf; color: #2f6950; }
.status-toolbar .connection-secondary:hover { border-color: #8bb99e; background: #f3fbf6; }
.status-service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.status-service-card { display: grid; gap: 16px; min-width: 0; border: 1px solid #d6e3dc; border-top: 3px solid #99aaa1; border-radius: 8px; padding: 17px; background: #fff; box-shadow: 0 4px 14px rgba(42, 77, 58, .045); }
.status-service-card.operational { border-top-color: #2f9662; }
.status-service-card.degraded { border-top-color: #d4942f; }
.status-service-card.down { border-top-color: #ca574f; }
.status-service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.status-service-head > div { min-width: 0; }
.status-service-head h3 { margin: 6px 0 4px; overflow-wrap: anywhere; color: #213b2f; font-size: 15px; font-weight: 700; line-height: 1.35; }
.status-service-head p { margin: 0; overflow: hidden; color: #6e8077; font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; border: 1px solid #d8e4de; border-radius: 20px; padding: 5px 8px; background: #fbfdfc; color: #5d7266; font-size: 11px; font-weight: 650; white-space: nowrap; }
.status-pill i { width: 6px; height: 6px; box-shadow: none; }
.status-pill.down { border-color: #f0ceca; color: #aa3e37; background: #fff8f7; }
.status-pill.degraded { border-color: #f1dcaf; color: #9a6616; background: #fffdf5; }
.status-pill.operational { border-color: #c8e3d2; color: #247045; background: #f8fdf9; }
.status-service-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.status-service-metrics > div { display: grid; gap: 5px; min-width: 0; }
.status-service-metrics span, .status-history-head, .status-service-foot { color: #788a81; font-size: 10px; }
.status-service-metrics strong { overflow: hidden; color: #294438; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.status-history-head { display: flex; align-items: center; justify-content: space-between; padding-top: 2px; }
.status-history-head span { color: #5f7268; font-weight: 650; }
.status-history { display: grid; grid-template-columns: repeat(60, minmax(0, 1fr)); gap: 2px; height: 20px; }
.status-history-bar { min-width: 0; border-radius: 2px; background: #d7e0dc; }
.status-history-bar.operational { background: #55ad79; }
.status-history-bar.degraded { background: #e5ae4d; }
.status-history-bar.down { background: #d66861; }
.status-service-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px solid #ecf1ee; line-height: 1.4; }
.status-service-foot span { min-width: 0; overflow-wrap: anywhere; }
.status-admin-controls { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 2px; }
.status-admin-controls button { min-height: 30px; padding: 0 9px; font-size: 11px; }
.status-toolbar #status-test-all { min-height: 36px; white-space: nowrap; }
.status-empty { display: grid; grid-column: 1 / -1; place-items: center; gap: 5px; min-height: 180px; border: 1px dashed #bfd2c7; border-radius: 8px; background: rgba(255, 255, 255, .72); color: #73837b; font-size: 12px; text-align: center; }
.status-empty strong { color: #395444; font-size: 14px; }
.status-footnote { margin: 0; color: #74847c; font-size: 11px; line-height: 1.55; }

.public-page, .wallet-page { display: grid; gap: 20px; }
.public-page-intro, .wallet-section { border: 1px solid #e0e7f2; border-radius: 14px; padding: 22px; background: #fff; box-shadow: 0 8px 24px rgba(42, 63, 107, .05); }
.public-page-intro h2, .wallet-section h2 { margin: 8px 0 6px; color: #1a2948; font-size: 22px; font-weight: 620; }
.public-page-intro p, .wallet-section-head p { margin: 0; color: #71809a; font-size: 13px; line-height: 1.6; }
.public-mark { color: #4169e1; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.public-copy { min-height: 200px; border: 1px solid #e0e7f2; border-radius: 14px; padding: 24px; background: #fbfcff; color: #34425c; font-size: 14px; line-height: 1.85; }
.public-copy strong { display: block; margin-bottom: 10px; color: #1a2948; font-size: 16px; }
.public-copy h3 { margin: 22px 0 7px; color: #1a2948; font-size: 15px; font-weight: 650; }
.public-copy h3:first-child { margin-top: 0; }
.public-empty, .wallet-muted { padding: 24px; color: #8a96aa; font-size: 13px; text-align: center; }
.status-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.wallet-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.status-grid > div, .wallet-summary > div { display: grid; gap: 7px; min-width: 0; border: 1px solid #e0e7f2; border-radius: 12px; padding: 16px; background: #fff; }
.status-grid span, .wallet-summary span, .wallet-summary small { color: #71809a; font-size: 12px; }
.status-grid strong, .wallet-summary strong { overflow-wrap: anywhere; color: #1a2948; font-size: 19px; font-weight: 620; }
.wallet-columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 16px; }
.wallet-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.wallet-section-head h2 { margin-top: 0; }
.wallet-topup-form { display: grid; gap: 12px; }
.wallet-topup-form label { display: grid; gap: 6px; color: #52617b; font-size: 12px; font-weight: 600; }
.wallet-topup-form input { min-height: 40px; border: 1px solid #d4ddea; border-radius: 8px; padding: 0 11px; color: #1a2948; font: inherit; }
.wallet-topup-form input:focus { border-color: #8ca5e9; outline: 0; box-shadow: 0 0 0 3px rgba(65,105,225,.1); }
.wallet-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet-method { min-height: 34px; border: 1px solid #d4ddea; border-radius: 9px; padding: 0 11px; background: #fff; color: #4169e1; cursor: pointer; font-size: 12px; }
.wallet-method:hover { border-color: #9fb4ed; background: #f0f4ff; }
.wallet-redemption-input { margin-top: 2px; }
.wallet-plans { display: grid; gap: 9px; }
.wallet-plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; border: 1px solid #e0e7f2; border-radius: 10px; padding: 12px; background: #fbfcff; }
.wallet-plan strong { color: #1a2948; font-size: 13px; }
.wallet-plan span { color: #71809a; font-size: 11px; }
.wallet-plan b { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #b44f63; font-size: 14px; }


.popover { border-color: #e0e7f2; border-radius: 12px; box-shadow: var(--shadow); }
.popover button:hover { background: #edf2ff; color: var(--blue-deep); }
.connection-panel { border-color: #e0e7f2; border-radius: 14px; box-shadow: var(--shadow); }
.connection-panel { max-height: calc(100dvh - 84px); overflow-y: auto; scrollbar-width: thin; }
.connection-primary { border-color: var(--blue); background: var(--blue); }
.connection-primary:hover { border-color: var(--blue-deep); background: var(--blue-deep); }
.connection-secondary { border-color: #d4ddea; background: #fff; color: var(--blue-deep); }
.connection-secondary:hover { border-color: #b9c8ec; background: #f0f4ff; }

.login-dialog-backdrop, .user-settings-backdrop, .purchase-dialog-backdrop { background: rgba(20, 31, 55, .42); backdrop-filter: blur(12px); }
.login-dialog-card, .user-settings-card, .purchase-dialog-card { border-color: #e0e7f2; border-radius: 16px; box-shadow: 0 24px 70px rgba(25, 40, 74, .22); }
.login-dialog-card h2, .dialog-head h2 { color: #1a2948; }
.login-field input:focus { border-color: #8ca5e9; box-shadow: 0 0 0 3px rgba(65, 105, 225, .12); outline: 0; }
.toast { border: 1px solid rgba(255,255,255,.1); border-radius: 11px; background: #1e2d4d; box-shadow: 0 10px 28px rgba(25, 40, 74, .2); }

.app-shell.is-collapsed .sidebar-toggle { border-color: #cbd7f3; background: #edf2ff; color: var(--blue-deep); }

@media (max-width: 840px) {
  .topbar { min-height: 68px; padding: 12px 18px; }
  .main-stage { inset: 68px 0 0; }
  .zero-state { padding-top: 148px; }
  .zero-state h1 { font-size: 34px; }
  .composer-wrap { max-width: calc(100% - 32px); transform: translateY(-62px); }
  .wallet-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .app-shell, .workspace, .main-stage { width: 100%; max-width: 100vw; }
  .topbar { width: 100%; max-width: 100vw; min-height: 108px; overflow: hidden; padding-bottom: 52px; }
  .guest-status { display: inline-flex; position: absolute; right: 14px; bottom: 10px; left: 14px; justify-content: center; max-width: none; min-width: 0; overflow: visible; padding-top: 4px; padding-bottom: 4px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .main-stage { inset: 108px 0 0; }
  .sidebar-head { min-height: 68px; padding: 14px 16px; }
  .topbar { padding: 10px 14px; }
  .zero-state { padding-top: 126px; }
  .zero-state h1 { width: min(330px, calc(100vw - 44px)); max-width: 330px; font-size: 30px; line-height: 1.25; }
  .composer-wrap { right: auto; left: 12px; width: calc(100% - 24px) !important; max-width: none; }
  .composer { min-height: 64px; border-radius: 20px; padding: 10px 12px; }
  #prompt-input { padding-left: 46px; padding-right: 130px; font-size: 16px; }
  .upgrade-button { right: 72px !important; width: 64px; justify-content: center; border-radius: 10px; }
  .login-button, .avatar { right: 14px !important; }
  .status-grid, .wallet-summary, .wallet-columns { grid-template-columns: 1fr; }
  .public-page-intro, .wallet-section { padding: 17px; border-radius: 12px; }
  .workspace-view { width: min(100% - 28px, 1040px); padding-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .zero-state { animation: none; }
}

/* Keep the welcome copy and composer separated on short laptop/browser viewports. */
@media (max-height: 620px) {
  .zero-state { padding-top: 78px; }
  .zero-state h1 { max-width: min(760px, calc(100vw - 48px)); font-size: clamp(28px, 4vw, 38px); }
  .composer-wrap { top: auto; bottom: 18px; transform: translateX(-50%); }
  .login-dialog-backdrop, .user-settings-backdrop, .purchase-dialog-backdrop { align-items: flex-start; overflow-y: auto; padding: 12px; }
  .login-dialog-card, .user-settings-card, .purchase-dialog-card { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 600px) and (max-height: 620px) {
  .zero-state { padding-top: 64px; }
  .zero-state h1 { max-width: calc(100vw - 40px); font-size: 28px; }
  .composer-wrap { right: auto; bottom: 12px; left: 12px; width: calc(100% - 24px) !important; transform: none; }
}

/* Compact dialogs keep their primary actions in the first short viewport. */
@media (max-height: 420px) {
  .login-dialog-card, .user-settings-card, .purchase-dialog-card { padding: 16px; }
  .login-dialog-card h2, .dialog-head h2 { font-size: 18px; }
  .login-dialog-card p { margin-top: 6px; font-size: 12px; line-height: 1.4; }
  .login-field { gap: 4px; margin-top: 10px; }
  .login-field input, .email-code-button { min-height: 36px; }
  .remember-login { margin-top: 8px; }
  .login-dialog-actions, .dialog-actions { margin-top: 12px; }
}

@media (min-width: 601px) and (max-width: 840px) and (max-height: 620px) {
  .composer-wrap { right: 12px; bottom: 18px; left: 12px; width: auto; transform: none; }
}

/* Keep narrow-screen controls aligned when the prompt or mode label is long. */
.composer-wrap { max-width: min(720px, calc(100% - 32px)); }
.upgrade-button { min-width: 74px; white-space: nowrap; }

@media (max-width: 600px) {
  .composer-wrap { max-width: none; }
  .upgrade-button { right: 78px !important; width: auto !important; min-width: 74px; white-space: nowrap; }
}

@media (max-width: 460px) {
  .composer-wrap { top: 50%; bottom: auto; }
  .composer { min-height: 104px; padding: 10px 14px 52px; border-radius: 20px; }
  #prompt-input { min-height: 34px; padding: 6px 8px 4px 46px; font-size: 16px; line-height: 24px; }
  .composer-tools { right: 10px; bottom: 8px; left: 10px; }
  .chat-history { padding-bottom: 180px; }
}

@media (max-width: 460px) and (max-height: 620px) {
  .composer-wrap { top: auto; bottom: 12px; }
}

/* Align the single-row textarea with the composer controls. */
@media (min-width: 461px) {
  #prompt-input { position: relative; top: 8px; }
}

/* Give the group-pricing editor one clear type hierarchy. */
.group-pricing-editor,
.group-pricing-editor input,
.group-pricing-editor textarea,
.group-pricing-editor button {
  font-family: inherit;
  letter-spacing: 0;
}
.group-pricing-editor-head strong { font-size: 18px; line-height: 1.3; }
.group-pricing-editor-head span,
.group-pricing-section-head span { font-size: 13px; line-height: 1.45; }
.group-pricing-section-head strong { font-size: 16px; line-height: 1.3; }
.group-pricing-grid-head,
.group-pricing-override-head { font-size: 11px; font-weight: 600; line-height: 1.3; }
.group-pricing-row,
.group-pricing-override-row { align-items: center; min-height: 58px; padding: 10px 12px; }
.group-pricing-row label:not(.group-pricing-check),
.group-pricing-override-row label { gap: 0; }
.group-pricing-row label:not(.group-pricing-check) > span,
.group-pricing-override-row label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.group-pricing-row label > input,
.group-pricing-override-row label > input,
.group-pricing-auto input[type="number"] {
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
}
.group-pricing-row .group-pricing-check { min-height: 34px; gap: 7px; font-size: 12px; font-weight: 500; line-height: 1.3; }
.group-pricing-row .group-pricing-check input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
}
.group-pricing-switch input { flex: 0 0 auto; }
.group-pricing-advanced textarea { font-family: inherit; font-size: 13px; font-weight: 400; line-height: 1.5; }

/* The two usage flags occupy the shared "使用方式" area instead of creating
   an implicit extra grid row. */
.group-pricing-grid-head,
.group-pricing-row {
  grid-template-columns: 1.1fr .82fr .82fr 1.25fr minmax(84px, .75fr) minmax(84px, .75fr) 28px;
}
.group-pricing-grid-head span:nth-child(5) { grid-column: 5 / span 2; text-align: center; }
.group-pricing-grid-head span:nth-child(6) { grid-column: 7; }

@media (max-width: 900px) {
  .group-pricing-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-pricing-row label:not(.group-pricing-check) > span,
  .group-pricing-override-row label > span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .group-pricing-row label:not(.group-pricing-check),
  .group-pricing-override-row label { gap: 6px; }
}

/* DeskZai account, wallet, monitoring, and operations surfaces. */
.account-page, .dashboard-page, .logs-page, .admin-ops-page { display: grid; gap: 18px; }
.logs-page { gap: 16px; }
.account-section, .dashboard-chart { border: 1px solid #e0e7f2; border-radius: 12px; padding: 20px; background: #fff; box-shadow: 0 6px 18px rgba(42, 63, 107, .045); }
.account-section h2, .dashboard-chart h2 { margin: 0; color: #1a2948; font-size: 17px; font-weight: 650; }
.account-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.account-section-head p, .account-section-head small { margin: 5px 0 0; color: #71809a; font-size: 12px; line-height: 1.55; }
.account-security-grid, .ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.security-action-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 74px; }
.security-action-row > div:first-child { display: grid; gap: 5px; color: #24324e; font-size: 13px; }
.security-action-row small { color: #71809a; font-size: 11px; line-height: 1.45; }
.security-action-stack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.twofa-setup { display: grid; gap: 10px; border: 1px solid #cad8f7; border-radius: 10px; padding: 14px; background: #f7f9ff; color: #2c3d63; font-size: 12px; }
.twofa-setup h2 { margin: 0; color: #1a2948; font-size: 18px; font-weight: 650; }
.twofa-setup code, .backup-codes code { display: block; overflow-wrap: anywhere; border: 1px solid #dbe4f4; border-radius: 7px; padding: 9px; background: #fff; color: #263d77; line-height: 1.5; }
.twofa-setup small { overflow-wrap: anywhere; color: #71809a; line-height: 1.45; }
.twofa-setup label { display: grid; gap: 6px; font-weight: 600; }
.twofa-setup input, .account-reset-form input { min-height: 38px; border: 1px solid #d4ddea; border-radius: 8px; padding: 0 10px; font: inherit; }
.backup-codes { display: grid; gap: 7px; border-top: 1px solid #dbe4f4; padding-top: 10px; }
.affiliate-card { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; }
.affiliate-card label { display: grid; gap: 6px; min-width: 0; color: #71809a; font-size: 12px; }
.affiliate-card code { overflow: hidden; border: 1px solid #dce5f2; border-radius: 8px; padding: 10px; color: #2f4eb5; text-overflow: ellipsis; white-space: nowrap; }
.wallet-quick-amounts, .wallet-creem-products, .wallet-plan-actions, .channel-bulk-actions, .ops-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wallet-quick-amounts button, .wallet-plan-actions button, .channel-bulk-actions button, .pagination-actions button { min-height: 30px; border: 1px solid #d4ddea; border-radius: 8px; padding: 0 9px; background: #fff; color: #52617b; cursor: pointer; font-size: 11px; }
.wallet-quick-amounts button:hover, .wallet-plan-actions button:hover, .channel-bulk-actions button:hover, .pagination-actions button:hover { border-color: #a8bae8; background: #edf2ff; color: #2f4eb5; }
.wallet-quote { min-height: 20px; margin: 0; color: #52617b; font-size: 12px; }
.wallet-redemption { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.wallet-redemption input { min-width: 0; }
.wallet-plan { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.wallet-plan small { grid-column: 1; color: #8a96aa; font-size: 11px; }
.wallet-plan-actions { grid-column: 1 / -1; margin-top: 6px; }
.wallet-plan-actions button { color: #4169e1; }
.pagination-actions { display: flex; align-items: center; gap: 8px; color: #71809a; font-size: 12px; white-space: nowrap; }
.pagination-actions button:disabled { cursor: not-allowed; opacity: .45; }
.logs-filter-bar { display: flex; align-items: end; gap: 14px; border: 1px solid #dce5f1; border-radius: 8px; padding: 15px 16px; background: #f8faff; box-shadow: 0 1px 2px rgba(32, 55, 94, .04); }
.logs-filter-grid { display: grid; flex: 1 1 auto; grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); gap: 11px 12px; min-width: 0; }
.logs-filter-bar label { display: grid; gap: 5px; min-width: 0; color: #66758e; font-size: 11px; font-weight: 650; line-height: 1; }
.logs-filter-bar input, .logs-filter-bar select { min-width: 0; min-height: 36px; border: 1px solid #d3ddeb; border-radius: 6px; padding: 0 10px; outline: 0; background: #fff; color: #22314c; font: inherit; font-size: 12px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.logs-filter-bar input:focus, .logs-filter-bar select:focus { border-color: #6a86d8; box-shadow: 0 0 0 3px rgba(75, 112, 211, .12); }
.logs-filter-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 36px; }
.logs-filter-actions button { min-height: 36px; white-space: nowrap; }
.logs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.logs-stat-card { position: relative; display: flex; min-height: 94px; flex-direction: column; justify-content: space-between; overflow: hidden; border: 1px solid #dce5f1; border-radius: 8px; padding: 16px 17px 14px; background: #fff; box-shadow: 0 2px 8px rgba(36, 59, 105, .045); }
.logs-stat-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: #4295dd; content: ''; }
.logs-stat-card.rpm::before { background: #e26d78; }
.logs-stat-card.tpm::before { background: #78869e; }
.logs-stat-card div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.logs-stat-card span { color: #66758e; font-size: 12px; font-weight: 650; }
.logs-stat-card strong { color: #1c2d4b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.logs-stat-card small { color: #8a97aa; font-size: 11px; }
.log-summary-bar, .dashboard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #52617b; font-size: 13px; }
.log-summary-title { display: inline-flex; flex: 0 0 auto; align-items: baseline; gap: 8px; color: #4f5f7a; white-space: nowrap; }
.log-summary-title strong { font-size: 15px; font-weight: 700; }
.log-stat-badges { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; min-width: 0; }
.log-stat-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; border: 1px solid #dfe6f0; border-radius: 6px; padding: 0 10px; background: #fff; color: #6e7c94; font-size: 11px; white-space: nowrap; box-shadow: 0 1px 1px rgba(31, 51, 87, .025); }
.log-stat-badge strong { color: #1d2c48; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.log-stat-accent { display: inline-block; width: 3px; height: 14px; border-radius: 2px; background: #4295dd; }
.log-stat-accent.rpm { background: #e26d78; }
.log-stat-accent.tpm { background: #78869e; }
.log-summary-bar strong { color: #1a2948; }
.log-summary-bar .pagination-actions { flex: 0 0 auto; }
.log-summary-bar .pagination-actions button { min-height: 30px; border: 1px solid #d7e0eb; border-radius: 6px; padding: 0 9px; background: #fff; color: #405271; cursor: pointer; font: inherit; font-size: 12px; transition: border-color 150ms ease, background 150ms ease; }
.log-summary-bar .pagination-actions button:not(:disabled):hover { border-color: #aec0dd; background: #f1f5fc; }
.logs-table-wrap { border-color: #dce5f1; border-radius: 8px; box-shadow: 0 2px 8px rgba(36, 59, 105, .045); scrollbar-gutter: stable; }
.logs-table { min-width: 820px; color: #273650; }
.logs-table th, .logs-table td { padding: 14px 15px; border-color: #e8edf4; }
.logs-table th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; color: #62728c; font-size: 11px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.logs-table tbody tr { transition: background-color 150ms ease; }
.logs-table tbody tr:hover { background: #f8faff; }
.logs-table td { color: #4b5b75; font-size: 12px; line-height: 1.35; white-space: nowrap; }
.logs-table td:nth-child(2) { min-width: 170px; white-space: normal; }
.logs-table td:nth-child(2) strong { display: block; color: #263957; font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.logs-table .table-subtle { margin-top: 3px; color: #7d8ba1; font-size: 11px; }
.logs-table .token-values { display: block; color: #273650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.logs-table .status-chip { border-radius: 5px; padding: 4px 7px; font-size: 11px; font-weight: 600; }
.logs-table .request-id { max-width: 190px; color: #667996; font-size: 11px; }
.request-id { display: inline-block; max-width: 160px; overflow: hidden; color: #63718b; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
.dashboard-toolbar { border: 1px solid #e0e7f2; border-radius: 12px; padding: 14px 16px; background: #fff; }
.dashboard-toolbar > div:first-child { display: grid; gap: 4px; }
.dashboard-toolbar span { color: #71809a; font-size: 12px; }
.range-tabs { display: flex; border: 1px solid #dce5f2; border-radius: 8px; padding: 3px; background: #f8faff; }
.range-tabs button { min-width: 46px; min-height: 28px; border: 0; border-radius: 6px; background: transparent; color: #687791; cursor: pointer; font-size: 11px; }
.range-tabs button.active { background: #fff; color: #3155bd; box-shadow: 0 1px 4px rgba(42, 63, 107, .12); }
.usage-bars { display: flex; align-items: end; min-height: 190px; gap: 8px; padding-top: 20px; }
.usage-bar { display: grid; flex: 1; align-items: end; gap: 7px; min-width: 16px; height: 166px; }
.usage-bar i { display: block; min-height: 5px; border-radius: 5px 5px 2px 2px; background: #6d83df; box-shadow: 0 -4px 10px rgba(65, 105, 225, .14); }
.usage-bar span { overflow: hidden; color: #8a96aa; font-size: 10px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ops-actions { align-items: center; }
.ops-actions button { min-height: 34px; }
.ops-result { min-height: 58px; max-height: 220px; overflow: auto; margin: 14px 0 0; border: 1px solid #e0e7f2; border-radius: 8px; padding: 10px; background: #f8faff; color: #52617b; font: 11px/1.5 Consolas, monospace; white-space: pre-wrap; }
.ratio-detector-page { display: grid; gap: 16px; }
.ratio-detector-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border: 1px solid #d8e2f2; border-radius: 12px; padding: 20px; background: #f7faff; }
.ratio-detector-intro > div:first-child { min-width: 0; }
.ratio-detector-kicker { margin: 0 0 6px; color: #5572b8; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.ratio-detector-intro h2 { margin: 0; color: #1a2948; font-size: 22px; font-weight: 700; }
.ratio-detector-intro p:not(.ratio-detector-kicker) { max-width: 760px; margin: 8px 0 0; color: #66758e; font-size: 13px; line-height: 1.6; }
.ratio-detector-intro code { color: #3854a3; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.ratio-detector-badge { display: grid; flex: 0 0 auto; gap: 4px; border-left: 3px solid #5e7cda; padding: 8px 0 8px 13px; }
.ratio-detector-badge strong { color: #2f4eb5; font-size: 13px; }
.ratio-detector-badge span { color: #7a88a0; font-size: 11px; white-space: nowrap; }
.ratio-detector-controls, .ratio-detector-results { display: grid; gap: 14px; border: 1px solid #e0e7f2; border-radius: 12px; padding: 18px 20px; background: #fff; box-shadow: 0 6px 18px rgba(42, 63, 107, .04); }
.ratio-detector-control-row { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.ratio-detector-control-row label { display: grid; flex: 0 1 250px; gap: 6px; color: #66758e; font-size: 11px; font-weight: 650; }
.ratio-detector-control-row label:nth-child(2) { flex-basis: 150px; }
.ratio-detector-control-row select, .ratio-detector-control-row input { min-width: 0; min-height: 36px; border: 1px solid #d3ddeb; border-radius: 7px; padding: 0 10px; background: #fff; color: #22314c; font: inherit; font-size: 12px; }
.ratio-detector-control-row select:focus, .ratio-detector-control-row input:focus { border-color: #6a86d8; outline: 3px solid rgba(75, 112, 211, .12); }
.ratio-detector-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ratio-detector-actions button { min-height: 36px; white-space: nowrap; }
.ratio-detector-channel-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; max-height: 286px; overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.ratio-detector-channel { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 58px; border: 1px solid #e1e7f1; border-radius: 8px; padding: 9px 11px; background: #fbfcff; cursor: pointer; transition: border-color 140ms ease, background 140ms ease; }
.ratio-detector-channel:hover { border-color: #a9bce8; background: #f6f8ff; }
.ratio-detector-channel input { width: 16px; height: 16px; margin: 0; accent-color: #3155bd; }
.ratio-detector-channel > span { display: grid; min-width: 0; gap: 4px; }
.ratio-detector-channel strong { overflow: hidden; color: #2d3d5d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ratio-detector-channel small { overflow: hidden; color: #8190a6; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.ratio-detector-channel em { font-style: normal; white-space: nowrap; }
.ratio-detector-empty, .ratio-detector-ok { border: 1px dashed #ccd8eb; border-radius: 8px; padding: 18px; background: #fbfcff; color: #71809a; font-size: 12px; line-height: 1.55; text-align: center; }
.ratio-detector-ok { border-color: #b9d9c2; background: #f5fbf6; color: #3b6b48; }
.ratio-detector-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ratio-detector-result-head > div { display: grid; gap: 4px; }
.ratio-detector-result-head strong { color: #1a2948; font-size: 16px; }
.ratio-detector-result-head span { color: #71809a; font-size: 11px; }
.ratio-detector-subheading { margin: 2px 0 0; color: #31415f; font-size: 14px; }
.ratio-detector-table-wrap { max-height: 420px; overflow: auto; border-color: #dce5f1; border-radius: 8px; }
.ratio-detector-table, .ratio-detector-test-table { min-width: 720px; }
.ratio-detector-table th, .ratio-detector-test-table th { position: sticky; top: 0; z-index: 1; background: #f4f7fb; }
.ratio-detector-table td, .ratio-detector-test-table td { color: #4c5c76; font-size: 12px; vertical-align: top; }
.ratio-detector-table td:first-child strong { color: #283a5c; overflow-wrap: anywhere; }
.ratio-upstream-values { display: grid; gap: 6px; min-width: 270px; }
.ratio-upstream-value { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(70px, auto) auto; align-items: center; gap: 8px; border-bottom: 1px solid #edf1f6; padding-bottom: 5px; }
.ratio-upstream-value:last-child { border-bottom: 0; padding-bottom: 0; }
.ratio-upstream-value span { overflow: hidden; color: #6b7a92; text-overflow: ellipsis; white-space: nowrap; }
.ratio-upstream-value strong { color: #273c68; font: 600 12px ui-monospace, SFMono-Regular, Consolas, monospace; text-align: right; }
.ratio-upstream-value em { color: #b35a26; font-size: 10px; font-style: normal; white-space: nowrap; }
.ratio-upstream-value code { max-width: 180px; overflow: hidden; color: #52617b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ratio-same { color: #4f8a5e; font-size: 11px; }
.account-reset-form { display: grid; gap: 13px; max-width: 520px; border: 1px solid #e0e7f2; border-radius: 12px; padding: 20px; background: #fff; }
.account-reset-form label { display: grid; gap: 6px; color: #52617b; font-size: 12px; font-weight: 600; }
.account-reset-result { margin: 0; overflow-wrap: anywhere; border: 1px solid #bed3af; border-radius: 8px; padding: 11px; background: #f3faee; color: #345925; font-size: 13px; }

@media (max-width: 900px) {
  .account-security-grid, .ops-grid { grid-template-columns: 1fr; }
  .status-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-page-intro { flex-direction: column; }
  .status-overall { width: min(100%, 260px); }
  .ratio-detector-intro { flex-direction: column; }
  .ratio-detector-badge { border-top: 1px solid #e0e7f2; border-left: 0; padding: 10px 0 0; }
  .ratio-detector-badge span { white-space: normal; }
  .ratio-detector-actions { margin-left: 0; }
  .workspace-view[data-view="logs"], .workspace-view[data-view="admin-logs"] { width: min(100% - 32px, 720px); }
  .logs-filter-bar { align-items: stretch; flex-direction: column; }
  .logs-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .token-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .token-filter-actions { grid-column: 1 / -1; }
  .token-secret-reveal { grid-template-columns: 1fr; }
  .token-secret-actions { justify-content: flex-start; }
  .group-pricing-grid-head, .group-pricing-override-head { display: none; }
  .group-pricing-row { position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: 46px; }
  .group-pricing-row .group-pricing-check { min-height: 34px; }
  .group-pricing-row .group-pricing-remove { position: absolute; top: 9px; right: 9px; }
  .group-pricing-override-row { position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: 46px; }
  .group-pricing-override-row label:nth-child(3) { grid-column: 1 / 2; }
  .group-pricing-override-row .group-pricing-remove { position: absolute; top: 9px; right: 9px; }
}

@media (max-width: 600px) {
  .ratio-detector-controls, .ratio-detector-results, .ratio-detector-intro { padding: 16px; }
  .status-page { gap: 14px; padding: 15px; border-radius: 10px; background-size: 20px 20px; }
  .status-page-intro h2 { font-size: 23px; }
  .status-summary { grid-template-columns: 1fr; }
  .status-summary > div { border-right: 0; border-bottom: 1px solid #e7eeea; }
  .status-summary > div:last-child { border-bottom: 0; }
  .status-service-grid { grid-template-columns: 1fr; }
  .status-toolbar { align-items: stretch; }
  .status-toolbar select, .status-toolbar .connection-secondary, .status-toolbar .connection-primary, .status-search, .status-auto-refresh { width: 100%; margin-left: 0; }
  .status-toolbar .connection-secondary { justify-content: center; }
  .ratio-detector-control-row { display: grid; grid-template-columns: 1fr 112px; align-items: end; }
  .ratio-detector-control-row label, .ratio-detector-control-row label:nth-child(2) { flex-basis: auto; }
  .ratio-detector-control-row label:first-child { grid-column: 1 / -1; }
  .ratio-detector-actions { grid-column: 1 / -1; }
  .ratio-detector-actions button { flex: 1 1 auto; }
  .native-drawer { width: 100vw; }
  .workspace-view[data-view="logs"], .workspace-view[data-view="admin-logs"] { width: calc(100% - 32px); padding-top: 26px; }
  .native-drawer-close { top: 10px; right: 10px; }
  .native-drawer .admin-resource-form { padding: 24px 20px 28px; }
  .native-drawer .token-editor-head { padding: 20px 58px 16px 18px; }
  .native-drawer .token-editor form { padding: 16px 18px 22px; }
  .channel-form-head { align-items: stretch; flex-direction: column; }
  .channel-form-fetch { width: 100%; }
  .group-pricing-editor-head, .group-pricing-section-head { align-items: stretch; flex-direction: column; }
  .group-pricing-editor-head > .connection-primary, .group-pricing-section-head > .connection-secondary { width: 100%; }
  .group-pricing-auto { grid-template-columns: 1fr; }
  .account-section, .dashboard-chart { padding: 15px; }
  .profile-summary-grid { grid-template-columns: 1fr; }
  .native-drawer .profile-form { padding: 24px 20px 28px; }
  .security-action-row, .account-section-head, .dashboard-toolbar, .log-summary-bar { align-items: stretch; flex-direction: column; }
  .logs-stats { grid-template-columns: 1fr; }
  .security-action-stack { grid-template-columns: 1fr; }
  .logs-filter-grid { grid-template-columns: 1fr; }
  .logs-filter-actions { width: 100%; }
  .logs-filter-actions > * { flex: 1 1 0; }
  .affiliate-card { grid-template-columns: 1fr; }
  .wallet-redemption { grid-template-columns: 1fr; }
  .wallet-plan { grid-template-columns: 1fr; }
  .wallet-plan b { grid-column: 1; grid-row: auto; }
  .usage-bars { gap: 5px; }
  .usage-bar span { font-size: 8px; }
  .token-page-head, .token-editor-head, .token-editor-section-head, .token-pagination { align-items: stretch; flex-direction: column; }
  .token-page-head .connection-primary { width: 100%; }
  .token-summary-grid, .token-filter-bar { grid-template-columns: 1fr; }
  .token-filter-actions { grid-column: auto; }
  .token-filter-actions > * { flex: 1 1 auto; }
  .token-editor-head { padding: 16px; }
  .token-editor form { padding: 16px; }
  .token-editor-section-head { gap: 4px; }
  .token-advanced > summary { align-items: flex-start; flex-direction: column; justify-content: center; padding: 9px 0; }
  .token-secret-reveal { padding: 15px; }
  .token-secret-reveal code { width: 100%; }
  .token-secret-actions button { flex: 1 1 auto; }
  .token-pagination > div { width: 100%; }
  .token-pagination button { flex: 1 1 0; }
}
.workspace-view[data-view="channel-scheduler"], .workspace-view[data-view="ratio-detector"] { width: min(1220px, calc(100% - 48px)); }
.workspace-view[data-view="channel-scheduler"] .workspace-content, .workspace-view[data-view="ratio-detector"] .workspace-content { display: grid; gap: 14px; padding-top: 20px; }
.workspace-view[data-view="channel-scheduler"] .workspace-view-head, .workspace-view[data-view="ratio-detector"] .workspace-view-head { padding-bottom: 16px; }
.workspace-view[data-view="channel-scheduler"] .workspace-view-head h1, .workspace-view[data-view="ratio-detector"] .workspace-view-head h1 { font-size: 26px; }
.scheduler-policy-panel { gap: 13px; border-color: #dbe5f3; border-radius: 10px; padding: 17px 18px; background: #f8fbff; box-shadow: none; }
.scheduler-policy-head { align-items: center; border-bottom: 1px solid #e5edf7; padding-bottom: 13px; }
.scheduler-policy-head h2 { font-size: 18px; }
.scheduler-policy-head > div > span { display: block; margin-top: 4px; }
.scheduler-credential-grid { border-bottom: 1px solid #e8eef6; padding-bottom: 13px; }
.scheduler-source-details { border: 1px solid #e2e9f3; border-radius: 8px; background: rgba(255,255,255,.58); }
.scheduler-source-details > summary { min-height: 34px; padding: 0 11px; color: #52617b; cursor: pointer; font-size: 12px; font-weight: 650; line-height: 34px; }
.scheduler-source-details[open] > summary { border-bottom: 1px solid #e8eef6; }
.scheduler-source-details .scheduler-credential-grid { padding: 11px 11px 12px; border-bottom: 0; }
.scheduler-source-details .scheduler-policy-actions { padding: 0 11px 12px; }
.scheduler-policy-grid { grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; }
.scheduler-channel-picker { padding: 10px; background: rgba(255,255,255,.72); }
.scheduler-channel-checks { max-height: 146px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.scheduler-channel-check { min-height: 46px; padding: 6px 8px; }
.scheduler-policy-summary { gap: 6px; padding: 9px 11px; background: #eef4ff; }
.scheduler-policy-actions { gap: 8px; }
.scheduler-policy-actions button { min-height: 34px; }
.scheduler-channels-section { display: grid; gap: 11px; }
.scheduler-channels-section > .workspace-note { margin: 0; border: 0; padding: 0 2px; background: transparent; color: #7a88a0; font-size: 11px; }
.scheduler-channels-section > .admin-toolbar { margin: 0; border: 1px solid #e2e9f3; border-radius: 9px; padding: 10px 12px; background: #fff; }
.scheduler-channels-section > .data-table-wrap { border-color: #dfe7f1; border-radius: 9px; box-shadow: 0 2px 8px rgba(39,60,99,.04); }
.scheduler-channels-section .scheduler-overview { margin: 0; }
.scheduler-runtime-metrics { margin: 0; border-color: #e2e9f3; border-radius: 9px; padding: 12px 14px; background: #fff; box-shadow: none; }
.scheduler-runtime-grid { gap: 8px; }
.scheduler-runtime-grid article { padding-top: 1px; padding-bottom: 1px; }
.scheduler-ratio-panel { gap: 11px; }
.scheduler-ratio-panel .ratio-detector-intro { align-items: center; border-radius: 9px; padding: 13px 15px; background: #f8fbff; }
.scheduler-ratio-panel .ratio-detector-intro h2 { font-size: 18px; }
.scheduler-ratio-panel .ratio-detector-intro p:not(.ratio-detector-kicker) { margin-top: 5px; font-size: 12px; line-height: 1.5; }
.scheduler-ratio-panel .ratio-detector-controls, .scheduler-ratio-panel .ratio-detector-results { gap: 11px; border-radius: 9px; padding: 13px 15px; box-shadow: none; }
.scheduler-ratio-panel .ratio-detector-channel-list { max-height: 190px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.scheduler-ratio-panel .ratio-detector-channel { min-height: 50px; padding: 7px 9px; }
.scheduler-ratio-panel .ratio-detector-table-wrap { max-height: 300px; }

@media (max-width: 900px) {
  .workspace-view[data-view="channel-scheduler"], .workspace-view[data-view="ratio-detector"] { width: min(100% - 32px, 820px); }
  .scheduler-policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .topbar { min-height: 58px; padding: 10px 12px; gap: 6px; }
  .topbar-spacer { min-width: 0; }
  .guest-status { display: none !important; }
  .mobile-menu { display: grid; flex: 0 0 34px; width: 34px; height: 34px; }
  .upgrade-button, .login-button, .avatar { position: static; }
  .upgrade-button { width: 36px; min-height: 34px; justify-content: center; padding: 0; }
  .upgrade-button span { display: none; }
  .login-button { min-height: 34px; padding: 0 10px; }
  .avatar { width: 34px; height: 34px; }
  .composer-wrap { right: auto; left: 12px; width: calc(100vw - 24px) !important; max-width: none; box-sizing: border-box; }
  .zero-state { width: 100%; box-sizing: border-box; justify-items: center; padding: 160px 20px 0; }
  .zero-state h1 { width: 100%; max-width: 330px; overflow-wrap: anywhere; word-break: break-all; font-size: 24px; line-height: 1.32; text-align: center; }
  .zero-state-note { width: 100%; max-width: 300px; padding: 0; }
  .composer-wrap { transform: translateY(-28px); }
  .composer { width: 100%; box-sizing: border-box; overflow: hidden; }
  #prompt-input { padding-right: 160px; padding-left: 42px; font-size: 15px; }
  .composer-tools { right: 6px; bottom: 10px; left: 6px; gap: 0; }
  .composer-button, .send-button { width: 34px; height: 34px; }
  .mode-button { max-width: 100px; min-height: 34px; padding-right: 5px; padding-left: 7px; font-size: 12px; }
  .mode-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .workspace-view[data-view="channel-scheduler"], .workspace-view[data-view="ratio-detector"] { width: calc(100% - 24px); padding-top: 22px; }
  .scheduler-policy-panel { padding: 14px; }
  .scheduler-policy-grid { grid-template-columns: 1fr; }
  .scheduler-policy-head { align-items: stretch; }
  .scheduler-runtime-metrics { padding: 11px 12px; }
  .scheduler-ratio-panel .ratio-detector-intro, .scheduler-ratio-panel .ratio-detector-controls, .scheduler-ratio-panel .ratio-detector-results { padding: 13px; }
}

/* Scheduler layout must win over the historical dashboard rules above. */
.workspace-view[data-view="channel-scheduler"] .workspace-content { gap: 16px; }
.scheduler-policy-panel { gap: 16px; margin: 0; border: 1px solid #dfe6ef; border-radius: 10px; padding: 18px; background: #fff; box-shadow: 0 5px 18px rgba(35,57,88,.045); }
.scheduler-policy-head { align-items: flex-start; border: 0; padding: 0; }
.scheduler-policy-head h2 { color: #1f3150; font-size: 19px; letter-spacing: 0; }
.scheduler-policy-head > div > span { display: block; max-width: 540px; margin-top: 5px; color: #7b899e; font-size: 12px; }
.scheduler-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; border-top: 1px solid #edf1f6; padding-top: 15px; }
.scheduler-policy-readout { display: grid; align-content: center; gap: 3px; min-width: 0; border-left: 3px solid #b8c9e6; padding-left: 11px; }
.scheduler-policy-readout span, .scheduler-policy-readout small { overflow: hidden; color: #7b899e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-policy-readout strong { color: #2e4772; font-size: 15px; font-weight: 700; }
.scheduler-policy-summary { padding: 0; background: transparent; }
.scheduler-policy-actions { align-items: center; gap: 8px; border-top: 1px solid #edf1f6; padding-top: 14px; }
.scheduler-disable-check { margin-right: auto; color: #62728a; font-size: 11px; }
.scheduler-source-details { border-color: #e3e9f1; background: #fafbfd; }
.scheduler-source-details > summary { min-height: 36px; padding: 0 12px; color: #52617b; font-size: 12px; line-height: 36px; }
.scheduler-source-details .scheduler-credential-grid { border-bottom: 0; padding: 13px 12px 8px; }
.scheduler-source-details .scheduler-policy-actions { border-top: 0; padding: 0 12px 13px; }
.scheduler-channels-section { gap: 12px; }
.scheduler-channels-section > .admin-toolbar { align-items: center; min-height: 48px; margin: 0; border: 1px solid #dfe6ef; border-radius: 9px; padding: 9px 12px; background: #fff; }
.scheduler-channels-section > .workspace-note { margin: -2px 2px 0; color: #7b899e; font-size: 11px; }
.scheduler-selection-count { margin-right: auto; color: #5c6d86; font-size: 11px; white-space: nowrap; }
.scheduler-select-head, .scheduler-select-cell { width: 38px; padding-right: 3px !important; padding-left: 12px !important; text-align: center; }
.scheduler-select-cell input, .scheduler-select-head input { width: 15px; height: 15px; margin: 0; accent-color: #3155bd; vertical-align: middle; }
.scheduler-rank-cell { width: 44px; color: #8693a6; font-variant-numeric: tabular-nums; }
.scheduler-channels-section > .data-table-wrap { border: 1px solid #dfe6ef; border-radius: 9px; box-shadow: 0 4px 14px rgba(35,57,88,.035); }
.scheduler-channels-section .data-table { min-width: 980px; }
.scheduler-channels-section .data-table th { height: 42px; background: #f7f9fc; color: #6c7a90; font-size: 11px; font-weight: 700; }
.scheduler-channels-section .data-table td { min-height: 58px; color: #3f506b; font-size: 12px; }
.scheduler-runtime-metrics { margin: 0; border: 1px solid #dfe6ef; border-radius: 9px; padding: 13px 14px; background: #fff; box-shadow: none; }
.scheduler-ratio-details { border: 1px solid #dfe6ef; border-radius: 10px; background: #fff; overflow: hidden; }
.scheduler-ratio-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 15px; color: #314664; cursor: pointer; font-size: 13px; font-weight: 700; list-style: none; }
.scheduler-ratio-details > summary::-webkit-details-marker { display: none; }
.scheduler-ratio-details > summary::after { content: '展开'; flex: 0 0 auto; color: #71809a; font-size: 11px; font-weight: 500; }
.scheduler-ratio-details[open] > summary { border-bottom: 1px solid #e9eef5; }
.scheduler-ratio-details[open] > summary::after { content: '收起'; }
.scheduler-ratio-details > summary small { overflow: hidden; margin-left: auto; color: #8794a8; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-ratio-panel-body { display: grid; gap: 12px; padding: 13px 15px 15px; }
.scheduler-ratio-panel .ratio-detector-controls, .scheduler-ratio-panel .ratio-detector-results { border: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; }
.scheduler-ratio-panel .ratio-detector-control-row { display: grid; grid-template-columns: minmax(220px, 1fr) 150px minmax(180px, .7fr); align-items: end; gap: 10px; }
.scheduler-ratio-scope { display: grid; align-content: center; gap: 3px; min-height: 38px; border-left: 3px solid #b8c9e6; padding-left: 11px; }
.scheduler-ratio-scope strong { color: #3a5279; font-size: 13px; }
.scheduler-ratio-scope small { color: #8794a8; font-size: 10px; }
.scheduler-ratio-panel .workspace-note { margin: 0; padding: 0; border: 0; background: transparent; }
@media (max-width: 900px) {
  .scheduler-policy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scheduler-ratio-panel .ratio-detector-control-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .scheduler-ratio-scope { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .scheduler-policy-panel { padding: 15px; }
  .scheduler-policy-grid, .scheduler-ratio-panel .ratio-detector-control-row { grid-template-columns: 1fr; }
  .scheduler-policy-actions { align-items: stretch; flex-direction: column; }
  .scheduler-policy-actions button, .scheduler-disable-check { width: 100%; margin-right: 0; }
  .scheduler-channels-section > .admin-toolbar { align-items: stretch; flex-wrap: wrap; }
  .scheduler-selection-count { order: 2; width: 100%; }
  .scheduler-channels-section > .admin-toolbar .table-actions { order: 3; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .scheduler-ratio-details > summary { align-items: flex-start; flex-wrap: wrap; min-height: 0; padding: 10px 13px; line-height: 1.45; }
  .scheduler-ratio-details > summary small { flex: 1 1 100%; margin-left: 0; }
  .scheduler-ratio-panel-body { padding: 12px 13px 14px; }
}

/* One concise control surface: policy status and runtime health stay together. */
.scheduler-gate .scheduler-summary-strip {
  display: grid;
  grid-template-columns: minmax(230px, .8fr) minmax(0, 2.2fr);
  gap: 14px;
  border-top: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
  padding: 13px 0;
}
.scheduler-gate .scheduler-gate-status {
  align-content: center;
  min-width: 0;
  border-left: 3px solid #b8c9e6;
  padding: 5px 0 5px 11px;
}
.scheduler-gate .scheduler-runtime-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.scheduler-gate .scheduler-runtime-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.scheduler-gate .scheduler-runtime-grid article {
  gap: 3px;
  padding: 2px 0 2px 9px;
}
.scheduler-gate .scheduler-runtime-grid strong { font-size: 17px; }
.scheduler-gate .scheduler-runtime-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scheduler-metrics-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 78px;
}
.scheduler-metrics-meta small { color: #7b899e; font-size: 10px; white-space: nowrap; }
.scheduler-metrics-meta .connection-secondary { min-height: 30px; padding: 0 10px; font-size: 11px; }
.scheduler-gate .scheduler-gate-settings { border-top: 0; padding-top: 0; }
.scheduler-gate .scheduler-policy-create { margin-top: 1px; }
@media (max-width: 900px) {
  .scheduler-gate .scheduler-summary-strip { grid-template-columns: 1fr; gap: 10px; }
  .scheduler-gate .scheduler-runtime-summary { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (max-width: 600px) {
  .scheduler-gate .scheduler-summary-strip { padding: 11px 0; }
  .scheduler-gate .scheduler-runtime-summary { align-items: start; grid-template-columns: 1fr; gap: 8px; }
  .scheduler-gate .scheduler-runtime-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scheduler-gate .scheduler-runtime-grid strong { font-size: 15px; }
  .scheduler-metrics-meta { display: flex; align-items: center; justify-content: space-between; }
  .workspace-view[data-view="channel-scheduler"] .workspace-content,
  .scheduler-gate,
  .scheduler-gate .scheduler-summary-strip,
  .scheduler-gate .scheduler-runtime-summary,
  .scheduler-gate .scheduler-runtime-grid,
  .scheduler-gate .scheduler-policy-create { min-width: 0; width: 100%; }
  .scheduler-gate .scheduler-policy-create-fields { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .scheduler-gate .scheduler-policy-create-fields > *,
  .scheduler-gate .scheduler-policy-create-fields input,
  .scheduler-gate .scheduler-policy-create-fields select { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
}

/* NewAPI-compatible channel editor, kept native to the DeskZai drawer. */
.native-drawer .channel-editor { display: grid; gap: 18px; padding-top: 30px; }
.channel-editor .channel-form-head { margin: 0; border-bottom: 1px solid #e4eaf3; padding-bottom: 15px; }
.channel-editor .channel-form-head p { margin: 0; color: #5270aa; font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.channel-editor .channel-form-head strong { color: #263957; font-size: 20px; }
.channel-editor .admin-form-grid { gap: 12px; }
.channel-editor .admin-form-grid label { gap: 6px; color: #5c6d86; font-size: 11px; font-weight: 650; }
.channel-editor .admin-form-grid label small { color: #8491a5; font-size: 10px; font-weight: 500; line-height: 1.4; }
.channel-editor .admin-form-grid input,
.channel-editor .admin-form-grid select,
.channel-editor .admin-form-grid textarea { min-height: 38px; border-color: #d5dfeb; border-radius: 7px; color: #253751; font-size: 12px; }
.channel-editor .admin-form-grid textarea { min-height: 72px; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.channel-add-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; margin: 0; border: 1px solid #e1e8f2; border-radius: 8px; padding: 11px; background: #f9fbfe; }
.channel-add-modes legend { padding: 0 4px; color: #526b91; font-size: 11px; font-weight: 700; }
.channel-add-modes label { display: flex; align-items: flex-start; min-width: 0; gap: 8px; border: 1px solid #dce5f0; border-radius: 7px; padding: 8px; background: #fff; color: #344a6b; cursor: pointer; }
.channel-add-modes label:has(input:checked) { border-color: #80a0de; background: #f4f7ff; box-shadow: 0 0 0 2px rgba(79,112,194,.1); }
.channel-add-modes input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: #3155bd; }
.channel-add-modes span { display: grid; min-width: 0; gap: 2px; }
.channel-add-modes b { color: #314664; font-size: 11px; }
.channel-add-modes small { color: #8290a5; font-size: 10px; line-height: 1.35; }
.channel-form-section { display: grid; gap: 12px; min-width: 0; border-top: 1px solid #e7edf5; padding-top: 16px; }
.channel-form-section > header { display: grid; gap: 3px; }
.channel-form-section > header strong { color: #314664; font-size: 13px; }
.channel-form-section > header span { color: #8290a5; font-size: 11px; }
.channel-editor .inline-check { align-self: end; color: #51647f; font-size: 12px; }
.channel-editor .channel-mode-option[hidden] { display: none; }
.channel-editor .channel-type-settings[hidden], .channel-editor [data-channel-type-only][hidden], .channel-editor [data-channel-model-fetchable][hidden] { display: none; }
.channel-editor .channel-type-settings { background: #fbfcff; }
.channel-group-picker { position: relative; min-width: 0; }
.channel-group-trigger { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 38px; border: 1px solid #d5dfeb; border-radius: 7px; padding: 0 10px; background: #fff; color: #253751; cursor: pointer; font: inherit; text-align: left; }
.channel-group-trigger:hover { border-color: #9db3de; background: #fbfdff; }
.channel-group-trigger:focus-visible { border-color: #6180ca; outline: 3px solid rgba(79, 112, 194, .12); }
.channel-group-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-group-trigger svg { width: 16px; height: 16px; flex: 0 0 auto; }
.channel-group-menu { position: absolute; z-index: 8; top: calc(100% + 6px); right: 0; left: 0; display: grid; max-height: 210px; overflow: auto; border: 1px solid #cfdced; border-radius: 8px; padding: 5px; background: #fff; box-shadow: 0 12px 28px rgba(37, 57, 91, .16); }
.channel-group-menu[hidden] { display: none; }
.channel-editor .channel-group-menu label { display: flex; align-items: center; gap: 8px; min-height: 34px; border: 0; border-radius: 5px; padding: 0 7px; color: #3d5273; cursor: pointer; font-size: 12px; font-weight: 550; }
.channel-editor .channel-group-menu label:hover { background: #eef4ff; }
.channel-editor .channel-group-menu input { width: 15px; min-width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: #3155bd; }
.channel-editor .channel-group-menu span { overflow-wrap: anywhere; }

/* The model picker must yield width before it can push microphone/send controls off a narrow viewport. */
@media (max-width: 600px) {
  .composer-tools .mode-popover-anchor { min-width: 0; flex: 0 1 108px; }
  .composer-tools .mode-button { width: 100%; min-width: 0; max-width: 100%; }
  .composer-tools .mode-button span { min-width: 0; max-width: none; flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .composer-tools .mode-popover-anchor { flex-basis: 84px; }
  .composer-tools .mode-button svg { width: 16px; height: 16px; }
}

/* Dedicated web-chat pricing setup, kept separate from native API billing. */
.web-chat-settings-page { display: grid; gap: 16px; min-width: 0; }
.web-chat-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 2px 2px 0; }
.web-chat-settings-head > div:first-child { display: grid; gap: 5px; min-width: 0; }
.web-chat-settings-head h2, .web-chat-model-table h3 { margin: 0; color: #1b2b47; font-size: 18px; font-weight: 680; }
.web-chat-settings-head p, .web-chat-model-table p { max-width: 720px; margin: 0; color: #6b7c96; font-size: 12px; line-height: 1.6; }
.web-chat-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid #dfe7f2; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px rgba(43, 64, 103, .045); }
.web-chat-summary-grid article { display: grid; min-width: 0; gap: 5px; padding: 15px 16px; border-right: 1px solid #e7edf5; }
.web-chat-summary-grid article:last-child { border-right: 0; }
.web-chat-summary-grid span, .web-chat-summary-grid small { overflow-wrap: anywhere; color: #71819b; font-size: 11px; line-height: 1.4; }
.web-chat-summary-grid strong { overflow-wrap: anywhere; color: #243a5e; font-size: 19px; font-weight: 680; }
.web-chat-summary-grid strong.is-ready { color: #2e7a61; }
.web-chat-summary-grid strong.is-warning { color: #aa6a2c; }
.web-chat-settings-note { display: flex; align-items: flex-start; gap: 10px; border-left: 3px solid #6084c9; padding: 10px 13px; background: #f7f9fd; color: #5d6d86; font-size: 12px; line-height: 1.55; }
.web-chat-settings-note strong { flex: 0 0 auto; color: #365580; }
.web-chat-model-table { display: grid; gap: 13px; min-width: 0; border: 1px solid #e0e7f2; border-radius: 10px; padding: 17px; background: #fff; box-shadow: 0 4px 14px rgba(42, 63, 107, .04); }
.web-chat-model-table > header { display: grid; gap: 4px; }
.native-drawer .web-chat-model-form { padding-top: 30px; }

/* NewAPI-style usage overview: summary metrics and an account-balance rail. */
.newapi-dashboard-page { gap: 14px; }
.dashboard-summary-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .72fr); overflow: hidden; border: 1px solid #dce5f2; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(42, 63, 107, .045); }
.dashboard-summary-main { display: grid; gap: 15px; min-width: 0; padding: 18px; }
.dashboard-summary-heading { display: grid; gap: 4px; }
.dashboard-summary-heading h2 { margin: 0; color: #1a2948; font-size: 17px; font-weight: 680; }
.dashboard-summary-heading p { margin: 0; color: #71809a; font-size: 12px; line-height: 1.5; }
.dashboard-summary-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dashboard-summary-cards article { display: grid; min-width: 0; gap: 5px; border: 1px solid #e6edf6; border-radius: 8px; padding: 12px; background: #fafdff; }
.dashboard-summary-cards span, .dashboard-summary-cards small { overflow: hidden; color: #71809a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-summary-cards strong { overflow: hidden; color: #243a5e; font-size: 17px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-credit-rail { display: grid; align-content: space-between; min-width: 0; gap: 14px; border-left: 1px solid #e2e9f3; padding: 18px; background: linear-gradient(135deg, #f1f8f9 0%, #f4f6fc 58%, #eef5fb 100%); }
.dashboard-credit-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #4d607d; font-size: 12px; font-weight: 650; }
.dashboard-health { display: inline-flex; align-items: center; gap: 5px; color: #2d7b60; font-size: 11px; font-weight: 600; }
.dashboard-health::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ''; }
.dashboard-health.warning { color: #a96b2c; }
.dashboard-health.critical { color: #b04b55; }
.dashboard-credit-rail > strong { overflow: hidden; color: #1d3658; font-size: 24px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-credit-detail { display: grid; gap: 7px; color: #62748d; font-size: 11px; line-height: 1.45; }
.dashboard-credit-detail span:first-child { display: flex; justify-content: space-between; gap: 12px; }
.dashboard-credit-detail b { overflow: hidden; color: #3e5678; font-weight: 650; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-credit-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #60728d; font-size: 11px; }
.dashboard-credit-actions .connection-primary { flex: 0 0 auto; }
.dashboard-balance-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #dce5f2; border-radius: 10px; padding: 17px 18px; background: #fff; box-shadow: 0 4px 14px rgba(42, 63, 107, .045); }
.dashboard-balance-panel > div { display: grid; min-width: 0; gap: 4px; }
.dashboard-balance-panel span, .dashboard-balance-panel small { overflow-wrap: anywhere; color: #71809a; font-size: 11px; }
.dashboard-balance-panel strong { overflow-wrap: anywhere; color: #203555; font-size: 22px; font-weight: 680; }
.dashboard-balance-meta { margin-left: auto; padding-left: 18px; border-left: 1px solid #e4eaf3; }
.dashboard-balance-meta strong { font-size: 16px; }
.dashboard-stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid #e0e7f2; border-radius: 10px; background: #fff; box-shadow: 0 3px 12px rgba(42, 63, 107, .04); }
.dashboard-stat-strip article { display: grid; min-width: 0; gap: 4px; padding: 14px 15px; border-right: 1px solid #e7edf5; }
.dashboard-stat-strip article:last-child { border-right: 0; }
.dashboard-stat-strip span, .dashboard-stat-strip small { overflow: hidden; color: #73829a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-stat-strip strong { overflow: hidden; color: #213655; font-size: 18px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-content-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 14px; min-width: 0; }
.dashboard-models { display: grid; min-width: 0; gap: 12px; border: 1px solid #e0e7f2; border-radius: 12px; padding: 20px; background: #fff; box-shadow: 0 6px 18px rgba(42, 63, 107, .045); }
.dashboard-models .account-section-head { margin-bottom: 0; }
.dashboard-models h2 { margin: 0; color: #1a2948; font-size: 17px; font-weight: 650; }
.dashboard-models .connection-secondary { flex: 0 0 auto; }
@media (max-width: 1020px) {
  .web-chat-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .web-chat-summary-grid article:nth-child(2) { border-right: 0; }
  .web-chat-summary-grid article:nth-child(n+3) { border-top: 1px solid #e7edf5; }
  .dashboard-summary-shell { grid-template-columns: 1fr; }
  .dashboard-credit-rail { border-top: 1px solid #e2e9f3; border-left: 0; }
  .dashboard-content-grid { grid-template-columns: 1fr; }
  .dashboard-stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-stat-strip article:nth-child(3) { border-right: 0; }
  .dashboard-stat-strip article:nth-child(n+4) { border-top: 1px solid #e7edf5; }
}
@media (max-width: 680px) {
  .web-chat-settings-head, .dashboard-balance-panel { align-items: stretch; flex-direction: column; }
  .web-chat-settings-head .table-actions { width: 100%; }
  .web-chat-settings-head .table-actions button { flex: 1 1 auto; }
  .dashboard-balance-meta { margin-left: 0; border-top: 1px solid #e4eaf3; border-left: 0; padding-top: 13px; padding-left: 0; }
  .dashboard-balance-panel .connection-primary { width: 100%; }
  .dashboard-summary-main, .dashboard-credit-rail { padding: 15px; }
  .dashboard-summary-cards { grid-template-columns: 1fr; }
  .dashboard-summary-cards article { min-height: 64px; }
  .dashboard-credit-actions { align-items: stretch; flex-direction: column; }
  .dashboard-credit-actions .connection-primary { width: 100%; }
  .dashboard-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-stat-strip article:nth-child(3) { border-right: 1px solid #e7edf5; }
  .dashboard-stat-strip article:nth-child(2), .dashboard-stat-strip article:last-child { border-right: 0; }
  .dashboard-stat-strip article:nth-child(n+3) { border-top: 1px solid #e7edf5; }
  .web-chat-model-table, .dashboard-models { padding: 15px; }
}
.channel-form-advanced { border: 1px solid #dfe7f1; border-radius: 8px; background: #fbfcff; }
.channel-form-advanced > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 12px; color: #3d5273; cursor: pointer; font-size: 12px; font-weight: 700; list-style: none; }
.channel-form-advanced > summary::-webkit-details-marker { display: none; }
.channel-form-advanced > summary span { overflow: hidden; color: #8090a6; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.channel-form-advanced > summary::after { content: '展开'; color: #71809a; font-size: 10px; font-weight: 500; }
.channel-form-advanced[open] > summary { border-bottom: 1px solid #e5ebf4; }
.channel-form-advanced[open] > summary::after { content: '收起'; }
.channel-form-advanced-body { padding: 13px 12px 14px; }
.channel-editor .admin-form-actions { margin-top: 0; border-top: 1px solid #e7edf5; padding-top: 16px; }
@media (max-width: 600px) {
  .native-drawer .channel-editor { gap: 15px; padding-top: 26px; }
  .channel-add-modes, .channel-editor .admin-form-grid { grid-template-columns: 1fr; }
  .channel-add-modes label { align-items: center; }
  .channel-form-advanced > summary { align-items: flex-start; flex-wrap: wrap; padding: 10px 12px; line-height: 1.4; }
  .channel-form-advanced > summary span { flex: 1 1 100%; white-space: normal; }
  .channel-editor .admin-form-actions { flex-direction: column-reverse; }
  .channel-editor .admin-form-actions button { width: 100%; }
}
