:root {
  color-scheme: light;
  --ink: #1f2329;
  --muted: #8f959e;
  --line: #e5e6eb;
  --paper: #ffffff;
  --canvas: #f5f6f7;
  --green: #3370ff;
  --green-soft: #eef3ff;
  --amber: #d59020;
  --amber-soft: #fff1d2;
  --red: #d14343;
  --red-soft: #fff0f0;
  --blue: #3370ff;
  --blue-soft: #eef3ff;
  --shadow: 0 1px 2px rgba(31, 35, 41, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  background: var(--canvas);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

.topbar {
  min-height: 64px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(74, 89, 75, 0.12);
  background: #fff;
}

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

h1 {
  margin-top: 1px;
  font-size: 18px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  color: #a0a5ad;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.topbar-status,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot,
.phase-badge {
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
}

.status-dot {
  background: var(--green-soft);
  color: var(--green);
}

.status-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
}

.phase-badge {
  background: #e8e8df;
  color: #50584f;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(720px, 1fr) 280px;
  gap: 12px;
  padding: 12px;
  align-items: start;
}

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

.validation-rail {
  position: sticky;
  top: 12px;
  min-height: calc(100vh - 88px);
  padding: 16px;
}

.workspace {
  display: grid;
  gap: 12px;
}

.configs-panel {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin-top: 4px;
}

.button {
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    background 120ms ease;
}

.button:hover {
  transform: none;
  filter: brightness(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  background: var(--green);
  color: white;
}

.button-dark {
  background: #1f2329;
  color: white;
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button-danger {
  border-color: #edcbc5;
  background: var(--red-soft);
  color: var(--red);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.project-grid {
  grid-template-columns: 1.2fr 1fr minmax(260px, 1.4fr) auto;
}

.connection-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.connection-picker .button {
  white-space: nowrap;
}

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

.config-choice-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.config-choice-field legend {
  margin-bottom: 7px;
  padding: 0;
  color: #4f594f;
  font-size: 12px;
  font-weight: 700;
}

.config-choice-field legend small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.compact-multi-select {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.compact-multi-select label {
  display: block;
  flex: 1 1 0;
  cursor: pointer;
}

.compact-multi-select input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.compact-multi-select span {
  display: block;
  padding: 6px 7px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.compact-multi-select input:checked + span {
  background: var(--green-soft);
  color: var(--green);
}

label {
  display: grid;
  gap: 7px;
  color: #4f594f;
  font-size: 12px;
  font-weight: 700;
}

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

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.1);
}

select[multiple] {
  min-height: 92px;
}

.project-list {
  display: grid;
  gap: 7px;
}

.project-item {
  width: 100%;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-item:hover,
.project-item.active {
  border-color: #b8c8f8;
  background: var(--blue-soft);
}

.project-item strong,
.project-item span {
  display: block;
}

.project-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  padding: 16px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.security-note {
  position: static;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ead9b5;
  border-radius: 10px;
  background: #fff8e8;
  font-size: 11px;
  line-height: 1.55;
}

.security-note p {
  margin-top: 4px;
  color: #786642;
}

.config-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.config-tab {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.config-tab.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

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

.request-plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #d5e1d7;
  border-radius: 9px;
  background: #f3f8f4;
}

.request-plan-banner div,
.request-plan-banner span,
.request-plan-banner strong {
  display: block;
}

.request-plan-banner span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.request-plan-banner strong {
  margin-top: 3px;
  color: var(--green);
  font-size: 12px;
}

.request-plan-banner p {
  color: #59645b;
  font-size: 10px;
  line-height: 1.45;
  text-align: right;
}

.capability-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
  border: 1px solid #f0d9a7;
  border-radius: 8px;
  background: #fff9eb;
  color: #795b1f;
  font-size: 10px;
}

.capability-warning strong {
  flex: 0 0 auto;
  font-size: 11px;
}

.editor-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.editor-section-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

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

.check-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #3f473f;
  font-size: 12px;
  cursor: pointer;
}

.check-card:has(input:checked) {
  border-color: #8fb39a;
  background: #edf5ef;
}

.check-card input {
  width: 15px;
  min-height: auto;
  margin: 0;
}

.field-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-toolbar input {
  width: 210px;
}

.field-groups {
  display: grid;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}

.field-group {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
}

.field-group h4 {
  margin: 0 0 10px;
  font-size: 12px;
}

.field-group .checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-selection-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
}

.field-selection-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.field-selection-card-head strong {
  color: var(--ink);
  font-size: 12px;
}

.fixed-field-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #cbd8cd;
  border-radius: 7px;
  background: #f1f7f2;
  color: #415348;
  font-size: 11px;
  font-weight: 700;
}

.fixed-field-note {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcf8;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.selected-field-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.field-pill {
  max-width: 230px;
  overflow: hidden;
  padding: 6px 9px;
  border: 1px solid #d6e2d8;
  border-radius: 7px;
  background: #f1f7f2;
  color: #415348;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-pill-more {
  border-style: dashed;
  background: transparent;
  color: var(--muted);
}

.compact-empty {
  padding: 4px 0;
}

.locked-tag {
  margin-left: auto;
  padding: 2px 4px;
  border-radius: 4px;
  background: #ecece6;
  color: #777d76;
  font-size: 9px;
}

.field-mode-tag {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 5px;
  border-radius: 5px;
  background: #e8eef8;
  color: #496281;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.field-mode-tag + .locked-tag,
.field-mode-tag + .field-mode-tag {
  margin-left: 2px;
}

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

.filter-capability-note {
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.5;
}

.filter-capability-note.verified {
  border-color: #b7dccb;
  background: #f1faf6;
  color: #27644f;
}

.filter-capability-note.pending {
  border-color: #ead7a9;
  background: #fff9e9;
  color: #765514;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 100px minmax(180px, 1.4fr) 72px;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
}

.validation-result {
  display: grid;
  gap: 9px;
}

.validation-summary {
  padding: 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.validation-summary.success {
  background: var(--green-soft);
  color: var(--green);
}

.validation-summary.error {
  background: var(--red-soft);
  color: var(--red);
}

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

.issue-list li {
  padding: 8px 9px;
  border-left: 3px solid var(--red);
  background: #fff8f6;
  font-size: 11px;
  line-height: 1.45;
}

.issue-list.warning li {
  border-left-color: var(--amber);
  background: var(--amber-soft);
  color: #695525;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.rail-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.protocol-card {
  padding: 13px;
  border-radius: 10px;
  background: #232c25;
  color: #fff;
}

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

.protocol-card span {
  color: #bfc9bf;
  font-size: 10px;
}

.protocol-card strong {
  margin-top: 5px;
  font-size: 14px;
}

.protocol-card p {
  margin-top: 8px;
  color: #bfc9bf;
  font-size: 11px;
  line-height: 1.55;
}

.request-plan-panel {
  display: grid;
  gap: 10px;
}

.request-plan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.request-plan-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.request-plan-actions .button {
  min-height: 30px;
  padding-inline: 9px;
  font-size: 10px;
}

.request-plan-heading span,
.request-plan-heading strong {
  display: block;
}

.request-plan-heading span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.request-plan-heading strong {
  margin-top: 2px;
  font-size: 14px;
}

.request-plan-result {
  display: grid;
  gap: 9px;
}

.request-plan-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.request-plan-stats div {
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfb;
}

.request-plan-stats span,
.request-plan-stats strong {
  display: block;
}

.request-plan-stats span {
  color: var(--muted);
  font-size: 9px;
}

.request-plan-stats strong {
  margin-top: 3px;
  font-size: 16px;
}

.request-plan-formula {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.request-plan-jobs {
  display: grid;
  gap: 6px;
}

.request-plan-job {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.request-plan-job summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px;
  cursor: pointer;
  list-style: none;
}

.request-plan-job summary::-webkit-details-marker {
  display: none;
}

.request-plan-job summary span,
.request-plan-job summary strong,
.request-plan-job summary small {
  display: block;
}

.request-plan-job summary strong {
  font-size: 11px;
}

.request-plan-job summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.request-plan-job summary em {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-style: normal;
}

.protocol-live {
  background: var(--green-soft);
  color: var(--green);
}

.protocol-pending {
  background: #fff2dc;
  color: #a15c00;
}

.request-plan-job dl {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 9px 9px;
}

.request-plan-job dl div {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 6px;
  font-size: 9px;
}

.request-plan-job dt {
  color: var(--muted);
}

.request-plan-job dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.request-plan-blockers,
.request-plan-invalid {
  padding: 9px;
  border-radius: 9px;
  background: #fff7eb;
  color: #7a4b00;
  font-size: 10px;
  line-height: 1.5;
}

.request-plan-blockers ul {
  margin: 5px 0 0;
  padding-left: 16px;
}

.request-plan-invalid {
  background: var(--red-soft);
  color: var(--red);
}

.request-plan-invalid p {
  margin-top: 4px;
}

.preview-validation-result {
  display: grid;
  gap: 8px;
}

.preview-validation-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.5;
}

.preview-validation-card strong,
.preview-validation-card p {
  display: block;
}

.preview-validation-card p {
  margin-top: 4px;
}

.preview-validation-card.neutral {
  background: #f7f8fa;
  color: #5b6471;
}

.preview-validation-card.pending {
  border-color: #f0d6a3;
  background: #fff7eb;
  color: #7a4b00;
}

.preview-validation-card.passed {
  border-color: #bfe0c8;
  background: var(--green-soft);
  color: var(--green);
}

.preview-validation-card.failed {
  border-color: #efc3c3;
  background: var(--red-soft);
  color: var(--red);
}

.preview-validation-card dl {
  display: grid;
  gap: 4px;
  margin: 7px 0 0;
}

.preview-validation-card dl div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 5px;
}

.preview-validation-card dt {
  opacity: 0.7;
}

.preview-validation-card dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.preview-validation-card ul {
  margin: 7px 0 0;
  padding-left: 16px;
}

.preview-validation-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.preview-validation-stats span {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 55%);
}

.protocol-guardian-panel {
  display: grid;
  gap: 9px;
}

.protocol-guardian-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.protocol-guardian-heading span,
.protocol-guardian-heading strong {
  display: block;
}

.protocol-guardian-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.protocol-guardian-heading strong {
  margin-top: 2px;
  font-size: 12px;
}

.protocol-health-result,
.trial-result {
  display: grid;
  gap: 7px;
}

.protocol-health-card,
.trial-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 10px;
  line-height: 1.5;
}

.protocol-health-card > span,
.protocol-health-card > strong,
.protocol-health-card > p,
.trial-card > strong,
.trial-card > p {
  display: block;
}

.protocol-health-card > span {
  color: var(--muted);
  font-size: 9px;
}

.protocol-health-card > strong {
  margin-top: 2px;
  font-size: 12px;
}

.protocol-health-card > p,
.trial-card > p {
  margin-top: 4px;
}

.protocol-health-card.healthy,
.trial-card.passed {
  border-color: #bfe0c8;
  background: var(--green-soft);
  color: var(--green);
}

.protocol-health-card.attention,
.trial-card.pending {
  border-color: #f0d6a3;
  background: #fff7eb;
  color: #7a4b00;
}

.protocol-health-card.blocked,
.trial-card.failed {
  border-color: #efc3c3;
  background: var(--red-soft);
  color: var(--red);
}

.protocol-health-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.protocol-health-stats span {
  padding: 2px 5px;
  border-radius: 999px;
  background: rgb(255 255 255 / 65%);
  font-size: 9px;
}

.current-protocols {
  display: grid;
  gap: 4px;
}

.protocol-row {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 10px;
}

.protocol-row strong,
.protocol-directory em {
  font-style: normal;
}

.protocol-row .healthy,
.protocol-directory .healthy {
  color: var(--green);
}

.protocol-row .attention,
.protocol-directory .attention {
  color: #a15c00;
}

.protocol-row .blocked,
.protocol-directory .blocked {
  color: var(--red);
}

.protocol-directory {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  font-size: 10px;
}

.protocol-directory > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  cursor: pointer;
  list-style: none;
}

.protocol-directory > summary::-webkit-details-marker {
  display: none;
}

.protocol-directory > summary span {
  color: var(--muted);
}

.protocol-directory > div {
  max-height: 270px;
  overflow-y: auto;
  padding: 0 8px 8px;
}

.protocol-directory section {
  padding: 7px 1px;
  border-top: 1px solid var(--line);
}

.protocol-directory section > strong {
  display: block;
  margin-bottom: 4px;
}

.protocol-directory p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0;
}

.trial-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.trial-actions .button {
  min-width: 0;
  padding-right: 7px;
  padding-left: 7px;
  font-size: 10px;
}

.trial-card dl {
  display: grid;
  gap: 3px;
  margin: 7px 0 0;
}

.trial-card dl div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 5px;
}

.trial-card dt {
  opacity: 0.72;
}

.trial-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.download-output-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.download-output-link {
  display: grid;
  width: 100%;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid rgba(51, 88, 62, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.download-output-link:hover {
  border-color: rgba(51, 88, 62, 0.45);
  background: #fff;
}

.download-output-link span,
.download-output-link strong,
.download-output-link small {
  overflow-wrap: anywhere;
}

.download-output-link span,
.download-output-link small {
  font-size: 9px;
}

.download-output-link strong {
  font-size: 10px;
}

.download-output-link small {
  opacity: 0.72;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #ff3258, #ff5a76);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(255, 50, 88, 0.2);
}

.sidebar {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.nav-panel,
.project-nav {
  padding: 14px 12px;
}

.project-nav {
  border-top: 1px solid var(--line);
}

.nav-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 10px;
  color: #646a73;
  font-size: 12px;
  font-weight: 700;
}

.nav-title small {
  color: #a2a7af;
  font-size: 10px;
  font-weight: 500;
}

.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 11px;
}

.capability-tree {
  display: grid;
  gap: 3px;
}

.tree-section-toggle,
.tree-item {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.tree-section-toggle {
  display: grid;
  grid-template-columns: 20px 1fr 18px;
  align-items: center;
  min-height: 36px;
  padding: 7px 7px;
  border-radius: 6px;
  color: #373c43;
}

.tree-section-toggle:hover {
  background: #f5f6f7;
}

.tree-section-icon {
  width: 14px;
  height: 14px;
  border: 2px solid #7a828d;
  border-radius: 4px;
  box-shadow: inset 0 -4px 0 #eef0f3;
}

.tree-section-icon.gray {
  border-style: dashed;
}

.tree-chevron {
  color: #8f959e;
  text-align: center;
  transition: transform 140ms ease;
}

.tree-section.open .tree-chevron {
  transform: rotate(180deg);
}

.tree-items {
  display: grid;
  gap: 2px;
  margin: 1px 0 7px;
}

.tree-items[hidden] {
  display: none;
}

.tree-item {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px 7px 29px;
  border-radius: 6px;
  color: #51565d;
  font-size: 12px;
}

.tree-item:hover {
  background: #f5f6f7;
}

.tree-item.active {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
}

.tree-item.pending {
  color: #8f959e;
}

.tree-item em {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f1f2f4;
  color: #a0a5ad;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.tree-secondary {
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dashed var(--line);
}

.project-panel {
  overflow: hidden;
}

.project-panel > summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}

.project-panel > summary::-webkit-details-marker {
  display: none;
}

.project-panel > summary div,
.project-panel > summary span,
.project-panel > summary strong {
  display: block;
}

.project-panel > summary strong {
  margin-top: 2px;
  font-size: 13px;
}

.summary-kicker,
.summary-hint {
  color: #a0a5ad;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.project-panel[open] .summary-hint {
  color: var(--blue);
}

.project-panel-body {
  padding: 0 16px 16px;
  border-top: 1px solid #f0f1f2;
}

.project-grid {
  padding-top: 14px;
  align-items: end;
}

.project-save {
  min-height: 38px;
}

.config-heading {
  margin-bottom: 10px;
}

.native-report-shell {
  overflow: hidden;
  margin: 0 -18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.native-report-caption {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 18px 8px;
}

.native-report-caption > strong {
  font-size: 15px;
}

.scene-selector {
  width: auto;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 12px;
}

.native-report-tabs {
  display: flex;
  gap: 28px;
  min-height: 44px;
  align-items: end;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.native-report-tabs button {
  position: relative;
  height: 44px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #4e535a;
  cursor: pointer;
  font-size: 13px;
}

.native-report-tabs button.active {
  color: var(--blue);
  font-weight: 600;
}

.native-report-tabs button.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--blue);
}

.native-report-tabs button:disabled {
  cursor: not-allowed;
  color: #c1c5cb;
}

.native-report-tabs em {
  margin-left: 4px;
  font-size: 8px;
  font-style: normal;
}

.native-toolbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 18px;
  background: #fff;
}

.native-toolbar-left,
.native-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.native-toolbar-right {
  justify-content: flex-end;
}

.native-control,
.native-time-select {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid #eef0f2;
  border-radius: 4px;
  background: #f7f8fa;
  color: #4e535a;
  cursor: pointer;
  font-size: 12px;
}

.native-control:hover {
  border-color: #cfd8ee;
  background: #f2f5fb;
}

.native-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #555b63;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.native-check input {
  width: 15px;
  min-height: auto;
  margin: 0;
}

.native-date-range {
  display: grid;
  grid-template-columns: 128px 18px 128px;
  align-items: center;
  min-height: 34px;
  border-radius: 4px;
  background: #f7f8fa;
}

.native-date-range input {
  min-height: 34px;
  padding: 6px 8px;
  border-color: transparent;
  border-radius: 4px;
  background: transparent;
  font-size: 11px;
}

.native-date-range span {
  color: #a0a5ad;
  font-size: 11px;
  text-align: center;
}

.native-drawer {
  padding: 16px 18px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.drawer-heading strong {
  font-size: 13px;
}

.drawer-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.drawer-heading > span {
  color: var(--blue);
  font-size: 11px;
}

.object-mode {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.object-mode label {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-weight: 500;
}

.object-mode label:has(input:checked) {
  border-color: #9eb6f4;
  background: var(--blue-soft);
  color: var(--blue);
}

.object-mode input {
  width: 14px;
  min-height: auto;
  margin: 0;
}

.object-id-field textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  line-height: 1.5;
}

.object-id-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.1);
}

.object-id-field textarea:disabled {
  background: #f2f3f5;
  color: #b7bbc1;
}

.object-id-field small {
  color: var(--muted);
  font-weight: 400;
}

.config-meta-grid {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(190px, 1.25fr) minmax(150px, 1fr) 100px;
  gap: 12px;
  margin-top: 16px;
}

.disclosure-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.disclosure-section > summary::-webkit-details-marker {
  display: none;
}

.disclosure-section > summary h3 {
  font-size: 14px;
}

.disclosure-section > summary p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.disclosure-section > summary > span {
  color: var(--muted);
  transition: transform 140ms ease;
}

.disclosure-section[open] > summary > span {
  transform: rotate(180deg);
}

.disclosure-body {
  margin-top: 12px;
}

.coverage-card {
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid #dbe4fb;
  border-radius: 8px;
  background: #f5f8ff;
}

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

.coverage-card span {
  color: #7c8490;
  font-size: 10px;
}

.coverage-card strong {
  margin-top: 4px;
  color: #315db7;
  font-size: 13px;
}

.coverage-card p {
  margin-top: 7px;
  color: #68758c;
  font-size: 10px;
  line-height: 1.55;
}

.modal-open {
  overflow: hidden;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(20, 25, 21, 0.44);
  cursor: default;
}

.indicator-dialog {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(37, 48, 39, 0.14);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(20, 28, 22, 0.24);
}

.connection-dialog {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid rgba(37, 48, 39, 0.14);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(20, 28, 22, 0.24);
}

.connection-dialog > header,
.connection-dialog > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.connection-dialog > header {
  border-bottom: 1px solid var(--line);
}

.connection-dialog > header h3 {
  margin-top: 4px;
  font-size: 16px;
}

.connection-dialog > footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.connection-dialog-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.connection-security-banner {
  padding: 11px 12px;
  border: 1px solid #cbd8f7;
  border-radius: 9px;
  background: var(--blue-soft);
  color: #315db7;
}

.connection-security-banner strong,
.connection-security-banner p {
  display: block;
}

.connection-security-banner strong {
  font-size: 12px;
}

.connection-security-banner p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.55;
}

.connection-dialog textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  color: var(--ink);
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 10px;
  line-height: 1.5;
}

.connection-dialog textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(51, 112, 255, 0.1);
}

.connection-modal-error {
  min-height: 18px;
  color: var(--red);
  font-size: 10px;
}

#field-modal-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.indicator-dialog-header,
.indicator-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: #fff;
}

.indicator-dialog-header {
  border-bottom: 1px solid var(--line);
}

.indicator-dialog-header h3 {
  font-size: 17px;
}

.indicator-dialog-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #596159;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.icon-button:hover {
  background: #f0f2ed;
}

.indicator-dialog-body {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 0;
}

.indicator-menu {
  overflow-y: auto;
  padding: 10px;
  border-right: 1px solid var(--line);
  background: #f6f7f3;
}

.indicator-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #465047;
  text-align: left;
  cursor: pointer;
}

.indicator-menu-item + .indicator-menu-item {
  margin-top: 3px;
}

.indicator-menu-item:hover {
  background: #ecefe9;
}

.indicator-menu-item.active {
  border-color: #bfd2c3;
  background: #e8f2ea;
  color: var(--green);
}

.indicator-menu-item span,
.indicator-menu-item strong,
.indicator-menu-item small {
  display: block;
  min-width: 0;
}

.indicator-menu-item strong {
  font-size: 12px;
}

.indicator-menu-item small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.indicator-menu-item em {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 3px 5px;
  border-radius: 999px;
  background: rgba(61, 83, 67, 0.08);
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.indicator-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.indicator-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.indicator-content-header h4 {
  margin: 0;
  font-size: 14px;
}

.indicator-content-header p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.indicator-category-tools,
.indicator-category-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.indicator-category-actions {
  flex: 0 0 auto;
}

.indicator-content-header .indicator-category-tools input {
  width: min(280px, 34vw);
}

.indicator-subgroups {
  overflow-y: auto;
  padding: 16px 18px 24px;
}

.indicator-subgroup + .indicator-subgroup {
  margin-top: 22px;
}

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

.indicator-subgroup-title h5 {
  margin: 0;
  color: #3e483f;
  font-size: 12px;
}

.indicator-subgroup-title > div > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.variant-multi-select {
  display: flex;
  align-items: center;
  gap: 5px;
}

.variant-multi-select > span {
  margin-right: 2px;
  color: var(--muted);
  font-size: 9px;
}

.variant-multi-select label {
  display: block;
  cursor: pointer;
}

.variant-multi-select input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
  pointer-events: none;
}

.variant-multi-select em {
  display: block;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.variant-multi-select input:checked + em {
  border-color: #a7c1ad;
  background: var(--green-soft);
  color: var(--green);
}

.indicator-checkbox-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.indicator-dialog-footer {
  border-top: 1px solid var(--line);
}

.indicator-selection-status {
  color: var(--muted);
  font-size: 12px;
}

.indicator-selection-status strong {
  color: var(--green);
}

.request-count-note {
  color: #506358;
}

.text-button {
  margin-left: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
}

.text-button:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 380px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #1f2921;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 200px minmax(650px, 1fr) 250px;
  }

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

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

@media (max-width: 840px) {
  .modal-shell {
    padding: 12px;
  }

  .indicator-dialog {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }

  .indicator-dialog-body {
    grid-template-columns: 190px minmax(0, 1fr);
  }
}
