
.mcp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.9fr);
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--border);
  border-top: 4px solid #895a3c;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.mcp-hero h1 {
  margin: 6px 0 12px;
  font-size: 38px;
  color: var(--ink);
}

.mcp-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.mcp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid #e5ddd3;
  background: #faf8f5;
}

.mcp-metrics article {
  min-width: 0;
  padding: 18px 14px;
  text-align: center;
}

.mcp-metrics article + article { border-left: 1px solid #e5ddd3; }
.mcp-metrics span,
.mcp-metrics strong { display: block; }

.mcp-metrics span {
  color: #895a3c;
  font-size: 30px;
  font-weight: 800;
}

.mcp-metrics strong {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.mcp-directory-panel {
  margin-top: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.mcp-directory-heading,
.mcp-server-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.mcp-directory-heading h3,
.mcp-server-head h4 { margin: 4px 0 0; }

.mcp-directory-actions,
.mcp-server-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mcp-security-note {
  margin: 18px 0;
  padding: 12px 14px;
  border-left: 3px solid #895a3c;
  background: #faf8f5;
  color: var(--muted);
  line-height: 1.6;
}

.mcp-search-box {
  width: min(520px, 100%);
  margin-top: 18px;
}

.mcp-filter-bar {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.mcp-filter-bar .mcp-search-box { width: auto; margin-top: 0; }
.mcp-filter-bar label,
.mcp-audit-controls label,
.mcp-tool-test-modal label { display: grid; gap: 7px; }
.mcp-filter-bar label > span,
.mcp-audit-controls label > span,
.mcp-tool-test-modal label > span { color: var(--muted); font-size: 12px; font-weight: 750; }

.mcp-server-list { display: grid; gap: 14px; }

.mcp-server-group {
  overflow: hidden;
  border: 1px solid #e5ddd3;
  background: #fff;
}

.mcp-server-group + .mcp-server-group {
  margin-top: 0;
}

.mcp-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  list-style: none;
}

.mcp-group-heading::-webkit-details-marker { display: none; }

.mcp-group-heading h4 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.mcp-group-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.mcp-group-heading > span {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid #e5ddd3;
  background: #faf8f5;
  color: #895a3c;
  font-size: 12px;
  font-weight: 800;
}

details.mcp-server-group > .mcp-group-heading {
  cursor: pointer;
}

details.mcp-server-group > .mcp-group-heading:hover {
  background: #faf8f5;
}

details.mcp-server-group[open] > .mcp-group-heading {
  border-bottom: 1px solid #e5ddd3;
  background: #faf8f5;
}

details.mcp-server-group > .mcp-group-heading::before {
  content: "+";
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  order: 3;
  border: 1px solid #e5ddd3;
  color: #895a3c;
  font-size: 20px;
  font-weight: 700;
}

details.mcp-server-group[open] > .mcp-group-heading::before { content: "−"; }
.mcp-server-group-list {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #ffffff;
}

.mcp-server-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-left: 4px solid #d9d0c6;
  background: #ffffff;
}

.mcp-server-card.connected { border-left-color: #16836f; }
.mcp-server-card.failed { border-left-color: #c34b4b; }
.mcp-server-card.unchecked { border-left-color: #d39627; }
.mcp-server-head > div:first-child { min-width: 0; }

.mcp-server-head h4 {
  color: var(--ink);
  font-size: 21px;
}

.mcp-server-head p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.mcp-status-badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #e5ddd3;
  background: #faf8f5;
  color: #796b5f;
  font-size: 11px;
  font-weight: 800;
}

.mcp-status-badge.connected { border-color: #a9ddcf; background: #eef9f5; color: #116b59; }
.mcp-status-badge.failed { border-color: #efb9b9; background: #fff3f3; color: #a43a3a; }
.mcp-status-badge.unchecked { border-color: #ead19e; background: #fff9ec; color: #8d6417; }

.mcp-server-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5ddd3;
}

.mcp-server-meta span,
.mcp-server-meta b { display: block; min-width: 0; }

.mcp-server-meta span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
}

.mcp-server-meta b {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 11px;
}

.mcp-endpoint-meta code {
  display: block;
  color: #895a3c;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mcp-endpoint-meta .text-action,
.mcp-source-link {
  display: inline-block;
  margin-top: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #895a3c;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.mcp-source-link { display: block; }
.mcp-endpoint-meta .text-action:hover,
.mcp-source-link:hover { text-decoration: underline; }

.mcp-server-meta .warning,
.mcp-server-error { color: #a43a3a; }

.mcp-server-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #efb9b9;
  background: #fff3f3;
}

.mcp-tool-catalog {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5ddd3;
}

.mcp-tool-catalog summary { cursor: pointer; color: #895a3c; font-weight: 800; }

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

.mcp-tool-list article {
  padding: 12px;
  border: 1px solid #e5ddd3;
  background: #faf8f5;
}

.mcp-tool-list strong,
.mcp-tool-list code { display: block; }
.mcp-tool-list code { margin-top: 4px; color: #895a3c; }
.mcp-tool-list p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.mcp-tool-heading { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mcp-risk { display: inline-block; padding: 3px 7px; border: 1px solid #ddd4ca; font-size: 11px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.mcp-risk.low { color: #116b59; border-color: #a9ddcf; background: #eef9f5; }
.mcp-risk.medium { color: #8d6417; border-color: #ead19e; background: #fff9ec; }
.mcp-risk.high { color: #a43a3a; border-color: #efb9b9; background: #fff3f3; }
.mcp-tool-policy { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5ddd3; }
.mcp-tool-policy label { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.mcp-tool-policy select { min-width: 0; padding: 7px; }

.mcp-preflight-result { padding: 12px 14px; border: 1px solid #e5ddd3; background: #faf8f5; }
.mcp-preflight-result ul { margin: 8px 0 0; padding-left: 20px; }
.mcp-preflight-result li.block { color: #a43a3a; }
.mcp-preflight-result li.warning { color: #8d6417; }
.mcp-preflight-result li.pass { color: #116b59; }

.mcp-audit-panel { margin-top: 18px; padding: 20px 24px; border: 1px solid var(--border); background: #fff; }
.mcp-audit-panel > summary { cursor: pointer; color: var(--ink); font-size: 19px; font-weight: 800; }
.mcp-audit-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 18px 0; }
.mcp-audit-list { display: grid; gap: 8px; }
.mcp-audit-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid #e5ddd3; }
.mcp-audit-item div { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mcp-audit-item code { color: #895a3c; }
.mcp-audit-item span { color: var(--muted); font-size: 12px; }
.mcp-audit-item.completed > b { color: #116b59; }
.mcp-audit-item.failed > b, .mcp-audit-item p { color: #a43a3a; }
.mcp-audit-item p { grid-column: 1 / -1; margin: 0; }
.mcp-audit-pagination { display: flex; justify-content: flex-end; gap: 12px; align-items: center; margin-top: 14px; }
.mcp-tool-test-modal { width: min(760px, calc(100vw - 32px)); }
.mcp-tool-test-result { min-height: 100px; max-height: 280px; overflow: auto; padding: 12px; background: #241f1b; color: #f7f2ec; white-space: pre-wrap; }

.mcp-server-modal {
  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.mcp-server-form,
.mcp-server-form > label { display: grid; gap: 10px; }
.mcp-server-form { gap: 16px; }

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

.mcp-form-grid label { display: grid; gap: 8px; }
.mcp-enabled-field { align-content: center; margin-top: 23px; }

@media (max-width: 1050px) {
  .mcp-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .mcp-filter-bar, .mcp-tool-policy { grid-template-columns: 1fr; }
  .mcp-audit-item { grid-template-columns: 1fr; }
}

.line-admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  background: #895a3c;
  color: white;
  border: 1px solid #895a3c;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.line-admin-hero .eyebrow {
  color: #796b5f;
}

.line-admin-hero h1 {
  margin-bottom: 10px;
  font-size: 34px;
}

.line-admin-hero p:last-child {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.65;
}

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

.line-admin-metrics article {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
}

.line-admin-metrics span {
  font-size: 27px;
  font-weight: 700;
}

.line-admin-metrics strong {
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
}

.line-admin-panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.line-admin-heading,
.line-group-header,
.line-group-reference,
.line-policy-switches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.line-admin-heading h3,
.line-group-header h4 {
  margin: 0;
}

.line-service-notice {
  margin: 18px 0;
  padding: 11px 13px;
  border: 1px solid #e5ddd3;
  border-left: 4px solid #895a3c;
  border-radius: 6px;
  background: #faf8f5;
  color: #352f29;
  font-size: 13px;
}

.line-service-notice.unavailable {
  background: #fff7ed;
  border-color: #fed7aa;
  border-left-color: #f59e0b;
  color: #9a3412;
}

.line-admin-list {
  display: grid;
  gap: 14px;
}

.line-group-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid #d9d0c6;
  border-radius: 7px;
  background: #faf8f5;
}

.line-group-card.approved {
  border-left-color: #895a3c;
  background: white;
}

.line-group-status {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #f5eee6;
  color: #796b5f;
  font-size: 11px;
  font-weight: 700;
}

.line-group-card.approved .line-group-status {
  background: #f5eee6;
  color: #352f29;
}

.line-group-meta,
.line-group-reference {
  color: var(--muted);
  font-size: 12px;
}

.line-group-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 18px;
}

.line-group-reference {
  justify-content: flex-start;
  flex-wrap: wrap;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.line-policy-switches {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.line-policy-switches label {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #faf8f5;
  border: 1px solid #e5ddd3;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.line-policy-switches input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #895a3c;
}

.line-policy-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) minmax(150px, 0.5fr) minmax(170px, 0.55fr) auto;
  gap: 12px;
  align-items: end;
}

.line-policy-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.line-policy-grid button {
  white-space: nowrap;
}

.line-policy-hint {
  color: var(--muted);
}

.account-summary-band {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(430px, 0.65fr);
  gap: 28px;
  align-items: center;
  padding: 30px;
  background: var(--navy);
  color: white;
  border: 1px solid #895a3c;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.account-summary-band .eyebrow {
  color: #796b5f;
}

.account-summary-band h1 {
  margin-bottom: 10px;
  font-size: 34px;
  line-height: 1.16;
}

.account-summary-band p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.65;
}

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

.account-metrics article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
}

.account-metrics span {
  font-size: 30px;
  font-weight: 700;
}

.account-metrics strong {
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.account-create-panel,
.account-list-panel {
  margin-top: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.compact-heading h3 {
  margin-bottom: 16px;
}

.account-create-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr) 170px auto;
  gap: 12px;
  align-items: end;
}

.account-create-form label {
  display: grid;
  gap: 8px;
}

.account-create-form button {
  white-space: nowrap;
}

.account-create-panel .error-text {
  margin-top: 10px;
}

.account-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.account-table-head,
.account-row {
  min-width: 1080px;
  display: grid;
  grid-template-columns: minmax(230px, 1.1fr) 165px 130px minmax(245px, 1.2fr) 290px;
  gap: 16px;
  align-items: center;
}

.account-table-head {
  min-height: 44px;
  padding: 0 16px;
  background: #faf8f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.account-row {
  min-height: 94px;
  padding: 14px 16px;
  background: white;
  border-top: 1px solid var(--line);
  border-left: 4px solid var(--teal);
}

.account-row.inactive {
  background: #faf8f5;
  border-left-color: #d9d0c6;
}

.account-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  background: #f5eee6;
  color: var(--teal-dark);
  border: 1px solid #e5ddd3;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.account-identity strong,
.account-identity small,
.account-activity strong,
.account-activity small {
  display: block;
  overflow-wrap: anywhere;
}

.account-identity small,
.account-activity small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.current-account-label {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  color: var(--teal-dark);
  background: #faf8f5;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.account-role-field select {
  height: 38px;
}

.account-status-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-status-control input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.account-status-control span {
  color: var(--ink);
}

.account-activity strong {
  font-size: 12px;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.account-actions button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.llm-call-prompt b,
.llm-call-response b {
  display: block;
  margin-bottom: 3px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
}

.llm-usage-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.llm-usage-grid.inline {
  margin-bottom: 12px;
}

.llm-usage-grid span {
  padding: 7px 9px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
}

.llm-usage-grid b {
  margin-right: 5px;
  color: var(--ink);
}

.model-source-panel h3 {
  margin-bottom: 8px;
}

.model-source-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.provider-summary {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.provider-summary span {
  padding: 8px 10px;
  background: #faf8f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(53, 47, 41, 0.48);
}

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

.modal-panel.compact {
  width: min(480px, 100%);
}

.modal-panel.custom-model-modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
}

.custom-model-form,
.custom-model-fields {
  display: grid;
  gap: 14px;
}

.custom-model-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.custom-model-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.custom-model-form .checkbox-field {
  display: flex;
  align-items: center;
  align-self: end;
  min-height: 48px;
}

.custom-model-form .checkbox-field input {
  width: 18px;
  height: 18px;
}

.custom-badge {
  padding: 4px 8px;
  background: #f5eee6;
  border: 1px solid #d9d0c6;
  border-radius: 999px;
  color: #352f29;
  font-size: 11px;
  font-weight: 800;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  margin-bottom: 0;
  font-size: 24px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #faf8f5;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.modal-copy {
  margin: 12px 0 18px;
  color: var(--muted);
  font-weight: 700;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 150px;
}

.toast-host {
  position: fixed;
  right: 22px;
  top: 22px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 14px 16px;
  background: #352f29;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}
