:root {
  color-scheme: light dark;
  --canvas: #dfe4ea;
  --canvas-glow: rgba(255, 255, 255, 0.95);
  --canvas-gradient: #e7ebf0;
  --window: rgba(248, 250, 252, 0.9);
  --ink: #17202d;
  --muted: #647184;
  --line: rgba(23, 32, 45, 0.12);
  --signal: #315fdb;
  --signal-dark: #2447aa;
  --window-border: rgba(23, 32, 45, 0.16);
  --window-shadow: rgba(37, 47, 61, 0.2);
  --window-shadow-soft: rgba(37, 47, 61, 0.12);
  --surface: rgba(255, 255, 255, 0.5);
  --surface-hover: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --subtle: #e7eaee;
  --subtle-strong: #e4e8ed;
  --subtle-ink: #526173;
  --label: #334052;
  --success-ink: #17643c;
  --success-bg: #dcefe4;
  --warning-ink: #7a4d09;
  --warning-bg: #fff0cc;
  --warning-bg-soft: #fff5dc;
  --warning-ink-soft: #68552d;
  --danger-ink: #8e2823;
  --danger-bg: #f7dedb;
  --tooltip: #273142;
  --on-signal: white;
  --catalog-suggestion-bg: #edf2ff;
  --tab-count-bg: #e3e7ed;
  --traffic-close: #ff5f57;
  --traffic-minimize: #febc2e;
  --traffic-zoom: #28c840;
  --signal-outline: rgba(49,95,219,.3);
  --accent-wash: linear-gradient(135deg, rgba(49,95,219,.12), rgba(255,255,255,.5) 58%);
  --accent-line: rgba(49,95,219,.24);
  --accent-line-button: rgba(49,95,219,.22);
  --accent-soft: rgba(49,95,219,.1);
  --accent-divider: rgba(49,95,219,.17);
  --control-line: rgba(23,32,45,.2);
  --tooltip-shadow: rgba(23,32,45,.24);
  --subtle-status: #e7eaee;
  --subtle-soft: rgba(230,233,237,.55);
  --dot-neutral: #aeb6c1;
  --dot-status-neutral: #8b96a5;
  --dot-healthy: #28a862;
  --dot-warning: #d39723;
  --dot-danger: #c4433b;
  --disclosure: #667386;
  --switch-off: #b6bec8;
  --switch-off-hover: #a7b0bc;
  --switch-knob: #fff;
  --switch-line: var(--window-border);
  --radius-card: 12px;
  --radius-control: 8px;
  --radius-pill: 999px;
  --cloud-tint: linear-gradient(rgba(238, 243, 255, 0.95), rgba(229, 236, 255, 0.95));
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, var(--canvas-glow), transparent 35%),
    linear-gradient(145deg, var(--canvas-gradient), var(--canvas));
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.window {
  min-width: 0;
  width: min(980px, 100%);
  min-height: min(680px, calc(100vh - 64px));
  /* clip, not hidden: hidden would make the window a scroll container and break the sticky header. */
  overflow: clip;
  border: 1px solid var(--window-border);
  border-radius: 18px;
  background: var(--window);
  box-shadow: 0 32px 80px var(--window-shadow), 0 2px 8px var(--window-shadow-soft);
  backdrop-filter: blur(24px) saturate(130%);
}

.window-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--window);
  backdrop-filter: blur(24px) saturate(130%);
}

.surface-cloud .window-head { background: var(--cloud-tint); }

.development-ribbon {
  overflow: hidden;
  margin: 0;
  padding: 5px 18px;
  color: var(--warning-ink);
  background: repeating-linear-gradient(135deg, var(--warning-bg) 0 10px, var(--warning-bg-soft) 10px 20px);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-bar { display: flex; align-items: center; gap: 10px; padding: 7px 18px; border-bottom: 1px solid var(--line); color: var(--warning-ink); background: var(--warning-bg); font-size: 13px; }
.locked-bar svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.locked-bar p { flex: 1; min-width: 0; margin: 0; }
.locked-bar .button { flex: none; padding: 5px 14px; font-size: 12px; }

.titlebar {
  height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.title-leading { min-width: 0; display: flex; align-items: center; gap: 24px; }
.traffic-lights { flex: 0 0 auto; display: flex; gap: 8px; }
.traffic-lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--traffic-close); }
.traffic-lights i:nth-child(2) { background: var(--traffic-minimize); }
.traffic-lights i:nth-child(3) { background: var(--traffic-zoom); }
.breadcrumbs { min-width: 0; overflow: hidden; font-size: 12px; }
.breadcrumbs ol { min-width: 0; display: flex; align-items: center; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { flex: 0 0 auto; min-width: 0; display: flex; align-items: center; color: var(--muted); white-space: nowrap; }
.breadcrumbs li + li::before { content: "›"; flex: 0 0 auto; margin: 0 8px; color: var(--dot-status-neutral); font-size: 9px; font-weight: 750; line-height: 1; }
.breadcrumbs li:last-child { flex: 1 1 auto; overflow: hidden; color: var(--ink); font-weight: 400; }
.breadcrumbs li:last-child span { overflow: hidden; text-overflow: ellipsis; }
.breadcrumbs a { color: inherit; font-weight: 650; text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); }
.surface-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px; color: var(--label); background: var(--subtle-strong); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.surface-chip:hover { background: var(--subtle); }
.surface-cloud .surface-chip { color: var(--on-signal); background: var(--signal); }
.surface-cloud .surface-chip:hover { background: var(--signal-dark); }
.surface-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.breadcrumbs .breadcrumb-root a { font-weight: 700; }
.surface-jump { margin-right: 6px; padding: 4px 9px; border: 1px solid var(--signal-outline); border-radius: 7px; color: var(--signal); font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.surface-jump:hover { background: var(--accent-soft); }
.title-actions { justify-self: end; display: flex; align-items: center; gap: 2px; }
.title-actions form { display: contents; }
.title-action, button.title-action { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 9px; color: var(--muted); background: transparent; text-decoration: none; }
.title-action:hover, button.title-action:hover { color: var(--ink); background: var(--surface); }
.title-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

.empty-state {
  width: min(620px, calc(100% - 48px));
  min-height: 590px;
  margin: auto;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.vault-lock svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.glyph { display: grid; place-items: center; color: var(--on-signal); }

.mark {
  width: 66px;
  height: 66px;
  margin-bottom: 24px;
  border-radius: 17px;
  background: var(--signal);
  box-shadow: inset 0 1px rgba(255,255,255,.28), 0 12px 30px rgba(49,95,219,.28);
  font: 650 34px/1 "SF Pro Rounded", -apple-system, sans-serif;
}

h1 { max-width: 560px; margin: 0; font-size: clamp(34px, 6vw, 54px); line-height: 1.02; letter-spacing: -.045em; }
.empty-state > p { max-width: 520px; margin: 22px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.55; }
button, .button { border: 0; border-radius: 9px; padding: 11px 17px; color: var(--on-signal); background: var(--signal); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--signal-dark); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--signal-outline); outline-offset: 2px; }
small { margin-top: 12px; color: var(--muted); }

.dashboard, .form-panel, .detail-panel, .catalog-panel { padding: 58px clamp(24px, 7vw, 76px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 32px; }
.section-heading h1, .detail-header h1 { font-size: clamp(32px, 5vw, 44px); }
.heading-actions, .empty-actions { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.secondary-link, .provider-docs { color: var(--signal-dark); font-weight: 650; text-decoration: none; }
.secondary-link:hover, .provider-docs:hover { color: var(--ink); }
.heading-description { margin: 8px 0 0; color: var(--muted); }
.gateway-panel { overflow: hidden; margin-bottom: 54px; border: 1px solid var(--accent-line); border-radius: 16px; background: var(--accent-wash); box-shadow: 0 16px 40px rgba(49,95,219,.09); }
.gateway-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 24px; }
.gateway-mark { width: 52px; height: 52px; border-radius: 15px; background: var(--signal); box-shadow: 0 8px 22px rgba(49,95,219,.25); font-size: 23px; font-weight: 750; }
.gateway-summary small { display: block; margin: 0; color: var(--signal-dark); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.gateway-summary h1 { margin: 2px 0 0; font-size: 28px; }
.gateway-summary p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.gateway-runtime { display: inline-flex; gap: 6px; margin-top: 10px; color: var(--signal-dark); font-size: 12px; font-weight: 650; text-decoration: none; }
.gateway-runtime span { color: var(--muted); font-weight: 500; }
.gateway-runtime:hover { color: var(--ink); }
.gateway-route { display: grid; grid-template-columns: repeat(7, auto); align-items: baseline; gap: 8px; color: var(--muted); }
.gateway-route strong { color: var(--ink); font-size: 22px; }
.gateway-route small { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.gateway-route code { padding: 6px 8px; border-radius: 7px; color: var(--signal-dark); background: var(--surface-strong); font-weight: 700; }
.gateway-compatibility { display: flex; align-items: center; gap: 9px; padding: 11px 24px; border-top: 1px solid var(--accent-divider); color: var(--muted); font-size: 12px; }
.gateway-compatibility > span { padding: 3px 6px; border-radius: 5px; color: var(--on-signal); background: var(--signal); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.gateway-compatibility > div { display: grid; gap: 2px; }
.gateway-compatibility strong { color: var(--ink); }
.gateway-compatibility small { margin: 0; }
.gateway-setup { border-top: 1px solid var(--accent-divider); }
.gateway-setup > summary { padding: 14px 24px; color: var(--signal-dark); font-size: 13px; font-weight: 700; cursor: pointer; }
.gateway-client-grid { padding: 4px 24px 20px; }
.gateway-setup > .token-note { margin: 0; padding: 0 24px 20px; }
.connector-list-heading { margin-bottom: 20px; }
.server-list { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.server-row { display: grid; grid-template-columns: 1fr auto; align-items: stretch; min-height: 76px; border-bottom: 1px solid var(--line); }
.server-row:last-child { border-bottom: 0; }
.server-link { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; min-width: 0; padding: 12px 18px; color: var(--ink); text-decoration: none; }
.server-link:hover { background: var(--surface-hover); }
.server-link > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.server-link small { overflow: hidden; margin: 4px 0 0; text-overflow: ellipsis; white-space: nowrap; }
.connector-exposure { display: flex; width: max-content; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle); }
.connector-exposure.list { align-self: center; margin: 12px 18px; }
.exposure-option { min-height: 30px; padding: 6px 9px; border-radius: 7px; color: var(--muted); background: transparent; box-shadow: none; font-size: 11px; white-space: nowrap; }
.exposure-option:hover { color: var(--ink); background: var(--surface-hover); }
.exposure-option.selected { color: var(--on-signal); background: var(--signal); }
.exposure-option.selected:hover { background: var(--signal-dark); }
.exposure-option[value="disabled"].selected { background: #647184; }
.exposure-option[value="disabled"].selected:hover { background: #526173; }
.server-icon { position: relative; width: 42px; height: 42px; border-radius: 11px; background: var(--connector-color, #53657e); font-weight: 700; }
.server-icon.large { width: 58px; height: 58px; border-radius: 15px; font-size: 24px; }
.auth-badge { padding: 5px 9px; border-radius: 999px; color: var(--subtle-ink); background: var(--subtle-strong); font-size: 12px; font-weight: 650; }
.connector-status { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 999px; color: var(--subtle-ink); background: var(--subtle-strong); font-size: 12px; font-weight: 650; white-space: nowrap; }
.connector-status i, .credential-status i { display: inline-grid; place-items: center; width: 1em; height: 1em; border-radius: 50%; color: currentColor; background: transparent; font-style: normal; font-size: 11px; font-weight: 800; }
.connector-status.healthy { color: var(--success-ink); background: var(--success-bg); }
.connector-status.reconnect_needed { color: var(--warning-ink); background: var(--warning-bg); }
.connector-status.problem { color: var(--danger-ink); background: var(--danger-bg); }
.form-panel { max-width: 820px; margin: auto; }
.form-panel form { display: grid; gap: 22px; }
.form-panel [data-transport-fields] { display: grid; gap: 22px; }
.auth-panel { width: min(520px, 100%); padding-top: 76px; }
.auth-panel .heading-description { margin-bottom: 30px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 18px; }
label { display: grid; gap: 7px; color: var(--label); font-size: 13px; font-weight: 650; }
label small { margin: 0; font-weight: 400; }
input, select, textarea { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--control-line); border-radius: 8px; color: var(--ink); background: var(--surface-strong); font: inherit; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.check input, .radio-card input { width: 17px; min-height: auto; }
fieldset { display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; color: var(--label); font-size: 13px; font-weight: 650; }
.radio-card { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.radio-card input { margin-top: 3px; }
.radio-card span { display: grid; gap: 4px; font-family: inherit; }
.radio-card small { margin: 0; font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 18px; padding-top: 8px; }
.form-actions a { color: var(--muted); text-decoration: none; }
.recovery-kit h1 { max-width: none; font-size: clamp(32px, 5vw, 44px); }
.recovery-kit p { color: var(--muted); line-height: 1.5; }
.recovery-kit code { display: block; margin: 24px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-strong); font: 13px/1.5 "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.recovery-kit .form-actions { justify-content: flex-start; gap: 10px; }
.recovery-kit .form-actions button { padding: 10px 16px; border: 1px solid transparent; font-size: 14px; }
.recovery-kit .form-actions button.secondary { border-color: var(--accent-line-button); }
.recovery-kit .form-actions a { margin-left: auto; }
.message { padding: 12px 14px; border-radius: 9px; }
.message.info { color: var(--subtle-ink); background: var(--subtle-status); }
.message.success { color: var(--success-ink); background: var(--success-bg); }
.message.warning { color: var(--warning-ink); background: var(--warning-bg); }
.message.danger { color: var(--danger-ink); background: var(--danger-bg); }
.form-error, .form-notice { margin: -12px 0 20px; }
.discovery-status { padding: 11px 13px; font-size: 12px; line-height: 1.45; }
.page-status { margin: 0 0 26px; font-size: 13px; line-height: 1.5; }
.discovery-status[data-state="available"] { color: var(--success-ink); background: var(--success-bg); }
.discovery-status[data-state="unavailable"] { color: var(--warning-ink); background: var(--warning-bg); }
.catalog-panel { max-width: 900px; margin: auto; }
.catalog-nav { display: flex; align-items: center; justify-content: flex-end; margin-bottom: 52px; }
.catalog-nav .secondary-link { white-space: nowrap; }
.catalog-heading h1 { font-size: clamp(32px, 5vw, 44px); }
.catalog-heading p { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.catalog-search { margin: 30px 0 18px; }
.catalog-search input { padding-left: 36px; background: var(--surface-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23647184' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 4 4'/%3E%3C/svg%3E") no-repeat 12px center; }
.catalog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.catalog-card { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 14px; padding: 17px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; }
.catalog-card:hover { border-color: var(--accent-line); background: var(--surface-hover); }
.catalog-mark { position: relative; width: 43px; height: 43px; border-radius: 11px; background: var(--connector-color); font-size: 12px; font-weight: 750; letter-spacing: .03em; }
.catalog-mark.large { width: 58px; height: 58px; border-radius: 15px; font-size: 15px; }
.connector-logo { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); padding: 3px; border-radius: 6px; background: rgba(255,255,255,.96); object-fit: contain; }
.large > .connector-logo { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); padding: 5px; border-radius: 8px; }
.catalog-copy { min-width: 0; }
.catalog-copy > span { display: flex; align-items: center; gap: 8px; }
.catalog-copy small { display: block; margin: 3px 0 0; }
.catalog-copy p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.catalog-status { padding: 3px 6px; border-radius: 999px; color: var(--warning-ink); background: var(--warning-bg); font-size: 10px; font-weight: 700; }
.catalog-empty { margin: 32px 0; color: var(--muted); text-align: center; }
.connector-intro { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 18px; margin-bottom: 30px; }
.connector-intro h1 { margin-top: 4px; font-size: clamp(32px, 5vw, 44px); }
.connector-intro p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.eyebrow.accent { color: var(--signal-dark); font-size: 10px; font-weight: 800; }
.catalog-note { margin: -10px 0 22px; color: var(--warning-ink-soft); background: var(--warning-bg-soft); }
.managed-fields { display: grid; grid-template-columns: 2fr 1fr; border: 1px solid var(--line); border-radius: 10px; background: var(--subtle-soft); }
.managed-fields > div { display: grid; gap: 6px; min-width: 0; padding: 13px; }
.managed-fields > div + div { border-left: 1px solid var(--line); }
.managed-fields small { margin: 0; }
.managed-fields code { overflow: hidden; color: var(--subtle-ink); text-overflow: ellipsis; white-space: nowrap; }
.provider-docs { justify-self: start; font-size: 13px; }
.catalog-options > small { margin: 0 0 2px; }
.catalog-options > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.catalog-option-card { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.catalog-option-card label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.catalog-option-card label > span { min-width: 0; }
.catalog-option-card strong, .catalog-option-card small { display: block; }
.catalog-option-card small { margin: 2px 0 0; font-size: 10px; font-weight: 500; }
.catalog-options input { width: 16px; min-height: auto; }
.catalog-option-help { position: relative; display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(23,32,45,.18); border-radius: 50%; color: var(--muted); font-size: 11px; font-weight: 750; cursor: help; }
.catalog-option-help:focus-visible { outline: 3px solid var(--signal-outline); outline-offset: 2px; }
.tooltip { position: absolute; z-index: 20; padding: 9px 11px; border-radius: 8px; color: var(--on-signal); background: var(--tooltip); box-shadow: 0 8px 24px var(--tooltip-shadow); font-size: 12px; font-weight: 500; line-height: 1.4; opacity: 0; visibility: hidden; transition: opacity 120ms ease, transform 120ms ease, visibility 120ms; pointer-events: none; }
.catalog-option-help [role="tooltip"] { right: -8px; bottom: calc(100% + 8px); width: 250px; transform: translateY(4px); }
.catalog-option-help:hover [role="tooltip"], .catalog-option-help:focus [role="tooltip"] { opacity: 1; visibility: visible; transform: translateY(0); }
.catalog-check { align-items: start; gap: 9px; }
.catalog-check input { margin-top: 2px; }
.catalog-check small { display: block; margin-top: 4px; }
.catalog-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--catalog-suggestion-bg); }
.catalog-suggestion p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.catalog-suggestion .button { flex: 0 0 auto; }
.detail-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; }
.detail-header h1, .detail-header p { margin: 0; }
.detail-header p { margin-top: 5px; color: var(--muted); }
.tabs { display: flex; gap: 26px; margin: 40px 0 26px; border-bottom: 1px solid var(--line); }
.tabs a, .tabs span { padding: 0 2px 11px; color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs .active { margin-bottom: -1px; color: var(--ink); border-bottom: 2px solid var(--signal); font-weight: 650; }
.tabs b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tab-count-bg); font-size: 10px; }
.exposure-setting { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.exposure-setting p { max-width: 540px; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.facts > div { display: grid; gap: 6px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts > div:nth-child(even) { border-right: 0; }
.facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.facts small { margin: 0; }
.credential-status { display: flex; align-items: center; gap: 7px; overflow-wrap: anywhere; }
.credential-status i { flex: 0 0 auto; }
.notice { margin-top: 22px; padding: 16px 18px; border-left: 3px solid var(--dot-warning); border-radius: 5px 10px 10px 5px; background: var(--warning-bg-soft); }
.notice p { margin: 5px 0 0; color: var(--warning-ink-soft); line-height: 1.5; }
.connection-error { margin: 22px 0; }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
.copy-field small { grid-column: 1 / -1; }
.copy-field code { overflow: hidden; padding: 8px; border: 1px solid var(--line); border-radius: 7px; text-overflow: ellipsis; white-space: nowrap; }
.submit-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.connect-form { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.connect-form small { margin: 0; }
.redirect-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.redirect-choice label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.connector-actions { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
/* Unconnected connectors lead with these actions, above the exposure card. */
.connector-actions:has(~ .exposure-setting) { margin-bottom: 22px; }
.diagnostic-report { margin: 22px 0; padding: 14px 16px; border-radius: 10px; }
.diagnostic-report ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.detail-section { margin-top: 54px; }
.tab-page { margin-top: 8px; }
.section-anchor { scroll-margin-top: 24px; }
.detail-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.detail-section-heading h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.detail-section-heading > span { color: var(--muted); font-size: 13px; }
.server-metadata { display: grid; grid-template-columns: 2fr 1fr 1fr; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.server-metadata > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; padding: 14px 16px; border-right: 1px solid var(--line); }
.server-metadata > div:nth-child(3) { border-right: 0; }
.server-metadata small { flex-basis: 100%; margin: 0; }
.server-metadata code { color: var(--muted); font-size: 11px; }
.protocol-era { padding: 3px 6px; border-radius: 5px; color: var(--signal-dark); background: var(--accent-soft); font-size: 10px; font-weight: 700; white-space: nowrap; }
.server-website { color: var(--signal-dark); font-size: 12px; text-decoration: none; }
.server-description { grid-column: 1 / -1; padding: 14px 16px; border-top: 1px solid var(--line); }
.server-description small { display: block; margin: 0; }
.server-description p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.server-instructions { grid-column: 1 / -1; padding: 14px 16px; border-top: 1px solid var(--line); }
.server-instructions summary { cursor: pointer; color: var(--label); font-size: 13px; font-weight: 650; }
.server-instructions p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.tool-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 14px; }
.tool-filter input { min-width: 0; padding-left: 34px; background: var(--surface-strong) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23647184' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 4 4'/%3E%3C/svg%3E") no-repeat 11px center; }
.tool-sort { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tool-sort select { width: auto; min-width: 92px; }
.tool-filter-empty { margin: 28px 0; color: var(--muted); text-align: center; }
.discovered-items { margin-top: 30px; }
.tool-groups { display: grid; gap: 14px; }
.tool-policy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tool-policy-actions form { margin: 0; }
.tool-group { position: relative; overflow: visible; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tool-group > details > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 13px; padding: 15px 76px 15px 18px; cursor: pointer; list-style: none; font-size: 15px; font-weight: 650; }
.tool-group > details > summary::-webkit-details-marker { display: none; }
.tool-group > details > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid var(--disclosure); border-bottom: 1.5px solid var(--disclosure); transform: rotate(-45deg); transition: transform 140ms ease; }
.tool-group > details[open] > summary::before { transform: rotate(45deg); }
.tool-group > details > summary b { min-width: 28px; padding: 4px 8px; border-radius: 8px; color: var(--subtle-ink); background: var(--subtle-status); font-size: 12px; text-align: center; }
.tool-visibility-tag { margin: 0; padding: 4px 8px; border-radius: 8px; color: #2456c6; background: #e5edff; font: 650 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
.category-policy { display: block; position: absolute; top: 13px; right: 18px; }
.tool-group .tool-list { overflow: visible; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.tool-group .tool-row:last-child { border-radius: 0 0 11px 11px; }
.tool-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tool-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.tool-row:has(.tool-reference:hover, .tool-reference:focus) { position: relative; z-index: 21; }
.tool-row:last-child { border-bottom: 0; }
.tool-row.forbidden { background: var(--subtle-soft); }
.tool-row.forbidden > div { opacity: .6; }
.tool-copy { min-width: 0; }
.tool-policy { align-self: start; margin-top: 10px; }
.tool-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 9px; }
.tool-row strong, .tool-row code { display: inline-block; }
.tool-row code { color: var(--muted); font-size: 12px; }
.tool-usage { display: inline-block; margin: 0; padding: 3px 7px; border-radius: 999px; color: var(--subtle-ink); background: var(--subtle-status); font-size: 11px; font-weight: 650; }
.tool-reference { position: relative; display: inline-block; padding: 3px 7px; border-radius: 999px; color: var(--warning-ink); background: var(--warning-bg); font-size: 11px; font-weight: 700; cursor: help; }
.tool-reference[hidden] { display: none; }
.tool-reference:focus-visible { outline: 3px solid var(--signal-outline); outline-offset: 2px; }
.tool-reference-tooltip { top: calc(100% + 8px); left: 50%; width: max-content; max-width: min(300px, calc(100vw - 48px)); white-space: normal; transform: translate(-50%, -4px); }
.tool-reference:hover .tool-reference-tooltip, .tool-reference:focus .tool-reference-tooltip { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.tool-description { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.tool-description summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tool-description[open] summary { overflow: visible; white-space: normal; }
.tool-description summary::marker { color: var(--dot-status-neutral); }
.tool-shapes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; color: var(--ink); }
.schema-shape { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.schema-shape h4 { margin: 0 0 10px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.schema-fields { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.schema-fields .schema-fields { margin: 8px 0 0 5px; padding-left: 12px; border-left: 1px solid var(--line); }
.schema-field { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 7px; min-width: 0; }
.schema-field code { color: var(--ink); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.schema-field small { flex-basis: 100%; color: var(--muted); font-size: 11px; line-height: 1.4; }
.schema-type, .schema-required { padding: 2px 5px; border-radius: 5px; font-size: 10px; line-height: 1.3; }
.schema-type { color: var(--subtle-ink); background: var(--subtle-strong); }
.schema-required { color: var(--danger-ink); background: var(--danger-bg); }
.schema-empty { margin: 0; color: var(--muted); font-size: 12px; }
.policy-switch { width: 42px; height: 24px; padding: 2px; border: 1px solid var(--switch-line); border-radius: 999px; background: var(--switch-off); box-shadow: inset 0 1px 2px rgba(23,32,45,.15); }
.policy-switch:hover { background: var(--switch-off-hover); }
.policy-switch span { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--switch-knob); box-shadow: 0 1px 3px rgba(23,32,45,.3); transition: transform 140ms ease; }
.policy-switch.allowed { background: var(--dot-healthy); }
.policy-switch.allowed:hover { background: #20894f; }
.policy-switch.allowed span { transform: translateX(18px); }
.policy-switch.mixed { background: var(--dot-warning); }
.policy-switch.mixed:hover { background: #b47d18; }
.policy-switch.mixed span { transform: translateX(9px); }
.policy-switch:disabled { opacity: .55; cursor: wait; }
button.secondary { padding: 7px 11px; color: var(--signal-dark); border: 1px solid var(--accent-line-button); background: var(--surface-strong); font-size: 12px; }
button.secondary:hover { background: var(--surface-hover); }
.muted-copy { color: var(--muted); }
.client-form { display: flex; align-items: end; gap: 10px; margin: 14px 0; }
.client-form label { flex: 1; }
.client-setup-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 10px; }
.harness-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.harness-card > header, .harness-card-trigger { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; width: 100%; min-height: 70px; padding: 12px 15px; text-align: left; }
.harness-card-trigger { border-radius: 0; color: var(--ink); background: transparent; font-weight: inherit; }
.harness-card-trigger::after { width: 7px; height: 7px; margin-right: 4px; border-top: 1.5px solid var(--muted); border-right: 1.5px solid var(--muted); content: ""; transform: rotate(45deg); }
.harness-card-trigger:hover { background: rgba(49,95,219,.04); }
.harness-card strong, .harness-card h3 { margin: 0; font-size: 15px; }
.harness-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.harness-card.unavailable { background: rgba(230,233,237,.28); }
.harness-dialog { width: min(620px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 40px)); padding: 0; overflow: hidden; border: 1px solid rgba(48,58,74,.3); border-radius: 14px; color: var(--ink); background: var(--window); box-shadow: 0 28px 80px rgba(13,22,38,.36); }
.harness-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.harness-dialog::backdrop { background: rgba(20,29,44,.48); backdrop-filter: blur(2px); }
.harness-dialog-titlebar { display: grid; grid-template-columns: repeat(3, 12px) 1fr 48px; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-bottom: 1px solid rgba(53,65,82,.16); background: linear-gradient(var(--surface-strong), var(--subtle)); }
.harness-dialog-titlebar strong { grid-column: 4; justify-self: center; font-size: 12px; font-weight: 650; }
.harness-dialog-titlebar form { display: contents; }
.window-control { width: 12px; height: 12px; padding: 0; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; }
.window-control.close { background: var(--traffic-close); }
.window-control.close:hover { background: #e74840; }
.window-control.minimize { background: var(--traffic-minimize); }
.window-control.zoom { background: var(--traffic-zoom); }
.harness-dialog-body { min-height: 0; padding: 20px; overflow-y: auto; }
.harness-dialog-body > p { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.harness-dialog-body pre { max-height: min(360px, 50vh); overflow-y: auto; }
.harness-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 14px; padding: 11px 12px; border: 1px solid rgba(53,65,82,.14); border-radius: 8px; background: rgba(255,255,255,.65); }
.harness-token-row small { display: block; margin: 0 0 4px; font-size: 10px; font-weight: 650; }
.harness-token-row code { display: block; overflow-wrap: anywhere; color: #3d4b60; font: 11px/1.35 "SFMono-Regular", Consolas, monospace; }
.harness-dialog-body footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.harness-dialog-body footer > div { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.harness-dialog-body footer small { margin: 0; }
.harness-dialog-actions { flex: none; }
.custom-client-grid { margin-top: 14px; }
.universal-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); gap: 18px 24px; margin-top: 14px; padding: 20px; border: 1px solid var(--accent-line); border-radius: 13px; background: var(--accent-wash); }
.universal-setup header { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 16px; }
.universal-setup h3 { margin: 4px 0 0; font-size: 18px; }
.universal-setup p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.universal-setup pre { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; }
.universal-setup footer { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.universal-setup footer small { margin: 0; }
.gateway-universal-setup { margin: -6px 24px 20px; }
pre { overflow-x: auto; margin: 0; padding: 13px; border-radius: 8px; color: #dbe5f3; background: var(--tooltip); font: 12px/1.55 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.token-note { color: var(--muted); font-size: 12px; }
.client-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot-neutral); box-shadow: 0 0 0 4px rgba(174,182,193,.16); }
.client-dot.available { background: var(--signal); box-shadow: 0 0 0 4px rgba(49,95,219,.14); }
.client-dot.active { background: var(--dot-healthy); box-shadow: 0 0 0 4px rgba(40,168,98,.14); }
.server-settings-form { display: grid; gap: 22px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 46px; padding-top: 30px; border-top: 1px solid rgba(180,46,40,.2); }
.danger-zone h2 { margin: 0; font-size: 18px; }
.danger-zone p { max-width: 520px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
button.danger { white-space: nowrap; background: #b83a34; }
button.danger:hover { background: #922c28; }
.readonly-value { min-height: 42px; display: flex; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--subtle-ink); background: var(--subtle-soft); }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.setting-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 20px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row p { margin: 7px 0; color: var(--muted); line-height: 1.5; }
.setting-row small { overflow-wrap: anywhere; }
.setting-row strong { font-size: 15px; }
.setting-control { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.setting-row.stacked { grid-template-columns: 1fr; gap: 16px; }
.setting-row.stacked > div > p { margin-bottom: 0; }
.inline-form { display: grid; gap: 16px; }
.inline-form.row { grid-template-columns: minmax(0, 320px) auto; align-items: end; justify-content: start; }
.inline-form .form-actions { justify-content: flex-start; flex-direction: row; padding-top: 0; }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
.choice-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
.sync-conflicts { grid-column: 1 / -1; }
.settings-panel { max-width: 960px; }
.settings-panel > .message { margin-bottom: 28px; }
.settings-group + .settings-group { margin-top: 40px; }
.settings-group > header { margin-bottom: 14px; }
.settings-group h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.settings-group > header p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel-card { margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.panel-card h2 { margin: 0 0 8px; font-size: 20px; }
.panel-card > p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel-card ul { padding-left: 20px; }
.accent-card { display: grid; grid-template-columns: 1fr minmax(260px, .8fr); gap: 28px; padding: 24px; border: 1px solid var(--accent-line); border-radius: 15px; background: var(--accent-wash); }
.accent-card h2 { margin: 4px 0 8px; font-size: 24px; letter-spacing: -.025em; }
.accent-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
/* OAuth popup. Sized for the 600x700 window app.js opens; a browser that ignores those
   features and opens a full tab still shows the same centered panel. */
.oauth-popup { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.oauth-popup-card { display: grid; grid-template-rows: auto 1fr; width: min(552px, 100%); max-height: min(620px, calc(100vh - 40px)); overflow: hidden; border: 1px solid var(--window-border); border-radius: 16px; background: var(--window); box-shadow: 0 32px 80px var(--window-shadow), 0 2px 8px var(--window-shadow-soft); }
.oauth-popup-body { display: grid; align-content: center; justify-items: center; gap: 15px; padding: 40px 32px; text-align: center; }
.oauth-popup-body h1 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.oauth-popup-body p { margin: 0; max-width: 38ch; color: var(--muted); font-size: 13px; line-height: 1.5; }
.oauth-popup-body .button { margin-top: 3px; }

.oauth-spinner { display: flex; gap: 6px; margin-top: 4px; }
.oauth-spinner span { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); opacity: .3; }
@media (prefers-reduced-motion: no-preference) {
  .oauth-spinner span { animation: oauth-pulse 1.05s ease-in-out infinite; }
  .oauth-spinner span:nth-child(2) { animation-delay: .14s; }
  .oauth-spinner span:nth-child(3) { animation-delay: .28s; }
}
@keyframes oauth-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.oauth-dialog { width: min(440px, calc(100vw - 32px)); }
.oauth-dialog .harness-dialog-body { display: grid; gap: 18px; }
/* The body grid already spaces the footer, so drop the stacked margin. */
.oauth-dialog .harness-dialog-body footer { justify-content: flex-end; margin-top: 0; }
.oauth-dialog .harness-dialog-actions { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; }
.oauth-dialog .harness-dialog-actions button { width: 100%; padding: 11px 17px; font-size: inherit; }
.oauth-dialog .harness-dialog-actions button:not(.secondary) { border: 1px solid transparent; }
.oauth-dialog-status { display: grid; justify-items: start; gap: 11px; }
.oauth-dialog-status p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.oauth-dialog .oauth-guidance { margin: 0; }
.oauth-callback { position: relative; display: inline-block; }
.oauth-callback > button { padding: 0; border: 0; border-radius: 2px; color: inherit; background: transparent; font: inherit; cursor: copy; }
.oauth-callback > button:hover { color: inherit; background: transparent; }
.oauth-callback [role="tooltip"] { bottom: calc(100% + 8px); left: 50%; width: max-content; transform: translate(-50%, 4px); }
.oauth-callback:hover [role="tooltip"], .oauth-callback:focus-within [role="tooltip"] { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
/* The body grid owns the spacing, so the shared paragraph margin would double it. */
.oauth-dialog .harness-dialog-body > p { margin: 0; }


.vault-locked { padding: 24px; }
.unlock-panel { width: min(430px, 100%); padding: 42px; border: 1px solid var(--window-border); border-radius: 18px; background: var(--window); box-shadow: 0 32px 80px var(--window-shadow); backdrop-filter: blur(24px) saturate(130%); }
.unlock-panel .mark { width: 54px; height: 54px; margin-bottom: 28px; border-radius: 14px; font-size: 28px; }
.unlock-panel h1 { font-size: 36px; }
.unlock-panel > p:not(.form-error) { margin: 14px 0 28px; color: var(--muted); line-height: 1.5; }
.unlock-panel .form-error { margin: 0 0 22px; }
.unlock-panel form { display: grid; gap: 18px; }
.unlock-panel button { margin-top: 4px; }

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #121923;
    --canvas-glow: rgba(83, 111, 153, 0.2);
    --canvas-gradient: #202b3a;
    --window: rgba(27, 36, 48, 0.92);
    --ink: #edf3fb;
    --muted: #aebccd;
    --line: rgba(223, 234, 247, 0.16);
    --signal: #8bb0ff;
    --signal-dark: #abc6ff;
    --window-border: rgba(223, 234, 247, 0.2);
    --window-shadow: rgba(0, 0, 0, 0.46);
    --window-shadow-soft: rgba(0, 0, 0, 0.32);
    --surface: rgba(39, 51, 67, 0.72);
    --surface-hover: rgba(53, 68, 88, 0.9);
    --surface-strong: rgba(34, 45, 60, 0.96);
    --subtle: #344258;
    --subtle-strong: #3a495f;
    --subtle-ink: #d5e0ed;
    --label: #dbe5f1;
    --success-ink: #a9e9c1;
    --success-bg: #174b34;
    --warning-ink: #ffd98a;
    --warning-bg: #594315;
    --warning-bg-soft: #4c3a17;
    --warning-ink-soft: #ffe0a1;
    --danger-ink: #ffb7b2;
    --danger-bg: #5b2729;
    --tooltip: #111923;
    --on-signal: #101927;
    --catalog-suggestion-bg: #263957;
    --tab-count-bg: #3a495f;
    --traffic-close: #ff5f57;
    --traffic-minimize: #febc2e;
    --traffic-zoom: #28c840;
    --signal-outline: rgba(49,95,219,.3);
    --accent-wash: linear-gradient(135deg, rgba(79,126,245,.17), var(--surface));
    --accent-line: rgba(49,95,219,.24);
    --accent-line-button: rgba(120,164,255,.4);
    --accent-soft: rgba(49,95,219,.1);
    --accent-divider: rgba(49,95,219,.17);
    --control-line: var(--line);
    --tooltip-shadow: rgba(23,32,45,.24);
    --subtle-status: var(--subtle-strong);
    --subtle-soft: #344258;
    --dot-neutral: #aeb6c1;
    --dot-status-neutral: #8b96a5;
    --dot-healthy: #28a862;
    --dot-warning: #d39723;
    --dot-danger: #c4433b;
    --disclosure: #667386;
    --switch-off: #64758b;
    --switch-off-hover: #73859c;
    --switch-knob: #f7faff;
    --switch-line: var(--line);
    --radius-card: 12px;
    --radius-control: 8px;
    --radius-pill: 999px;
    --cloud-tint: linear-gradient(rgba(37, 53, 86, 0.95), rgba(31, 45, 75, 0.95));
  }
}

@media (max-width: 620px) {
  body { padding: 0; }
  .window { min-height: 100vh; border: 0; border-radius: 0; }
  .titlebar { grid-template-columns: 1fr auto; }
  .title-leading { gap: 18px; }
  .dashboard, .form-panel, .detail-panel, .catalog-panel { padding: 34px 22px; }
  .section-heading { align-items: start; flex-direction: column; }
  .catalog-nav { margin-bottom: 38px; }
  .field-grid, .field-grid.three, .choice-grid, .inline-form.row, .facts, .catalog-grid, .managed-fields { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; }
  .setting-control { justify-content: flex-start; }
  .managed-fields > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .catalog-options > div { grid-template-columns: 1fr 1fr; }
  .catalog-suggestion { align-items: start; flex-direction: column; }
  .server-metadata { grid-template-columns: 1fr; }
  .server-metadata > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .server-metadata > div:nth-child(3) { border-bottom: 0; }
  .client-setup-grid { grid-template-columns: 1fr; }
  .facts > div { border-right: 0; }
  .facts > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .auth-badge { display: none; }
  .gateway-summary { grid-template-columns: auto 1fr; }
  .gateway-route { grid-column: 1 / -1; justify-content: start; }
  .gateway-compatibility { align-items: flex-start; flex-wrap: wrap; padding-inline: 16px; }
  .gateway-client-grid { padding-inline: 16px; }
  .gateway-universal-setup { margin-inline: 16px; }
  .gateway-setup > summary { padding-inline: 16px; }
  .gateway-setup > .token-note { padding-inline: 16px; }
  .server-row { grid-template-columns: 1fr; }
  .server-link { grid-template-columns: auto 1fr auto; }
  .server-link .server-icon { grid-row: 1 / span 2; }
  .server-link > span:nth-child(2) { grid-column: 2; grid-row: 1; }
  .server-link .connector-status { grid-column: 2; grid-row: 2; }
  .server-link > b { grid-column: 3; grid-row: 1 / span 2; }
  .connector-exposure.list { justify-self: stretch; width: auto; margin: 10px 18px 14px; }
  .connector-exposure.list .exposure-option { flex: 1; }
  .exposure-setting { align-items: start; flex-direction: column; }
  .exposure-setting .connector-exposure { width: 100%; }
  .exposure-setting .exposure-option { flex: 1; }
  .detail-header { grid-template-columns: auto 1fr; }
  .detail-header .connector-status { grid-column: 2; justify-self: start; }
  .tabs { gap: 18px; overflow-x: auto; }
  .connect-form { align-items: start; flex-direction: column; }
  .tool-visibility-tag { display: none; }
  .tool-row { align-items: start; }
  .tool-shapes { grid-template-columns: 1fr; }
  .harness-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
  .harness-dialog-body { padding: 16px; }
  .harness-dialog-body footer { align-items: flex-start; flex-direction: column; }
  .universal-setup { grid-template-columns: 1fr; }
  .universal-setup header { grid-template-columns: 1fr; }
  .universal-setup pre { grid-column: 1; grid-row: auto; }
  .auth-panel { padding-top: 42px; }
  .accent-card { grid-template-columns: 1fr; }
  .setting-row { grid-template-columns: 1fr; }
  .setting-row > div:last-child { justify-items: start; }
  .danger-zone { align-items: start; flex-direction: column; }
}

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

@media (max-width: 420px) {
  .breadcrumbs li:not(.breadcrumb-root):not(:nth-last-child(-n+2)) { display: none; }
}

@media print {
  body { padding: 0; background: white; color: black; }
  .window { border: 0; box-shadow: none; }
  .window-head, .recovery-kit .form-actions { display: none; }
  .recovery-kit { padding: 0; }
  .recovery-kit code { color: black; background: white; border: 1px solid black; }
}

.other-agent-setup { margin-top: 14px; }
.other-agent-setup > summary, .agent-recipe > summary, .agent-installation > summary { cursor: pointer; color: var(--label); font-size: 13px; }
.other-agent-setup > .client-setup-grid { margin-top: 10px; }
.agent-installation, .agent-recipe { margin: 18px 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-control); }
.agent-installation > p { color: var(--muted); font-size: 12px; }
.agent-installation .copy-field + .copy-field { margin-top: 12px; }
.agent-recipe pre { margin-top: 12px; }
.agent-access-form { display: grid; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.agent-access-form .token-note { margin: 0; }
.agent-access-form button { justify-self: start; }
.agent-computer-filter { width: min(260px, 100%); }
[data-agent-access] { min-width: 0; }
.agent-access-matrix-scroll { max-width: 100%; overflow-x: auto; }
.agent-access-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.agent-access-matrix caption { padding: 0 0 14px; color: var(--muted); text-align: left; }
.agent-access-matrix th, .agent-access-matrix td { min-width: 130px; padding: 12px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.agent-access-matrix a { color: var(--signal-dark); }
.agent-access-matrix ul { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.agent-access-matrix small { display: block; margin-top: 4px; }
.window:has(#agent-access) { min-width: 0; }
#agent-access .setting-row { grid-template-columns: minmax(0, 1fr); }
.window:has(.agent-setup-preview) { min-width: 0; }
.agent-setup-preview dt { color: var(--muted); font-size: 12px; }
.agent-setup-preview dd { margin: 4px 0 14px; overflow-wrap: anywhere; }
.agent-export { margin-top: 18px; }
.agent-export > summary { color: var(--label); cursor: pointer; font-size: 13px; }
.agent-export form { display: grid; gap: 12px; }
.agent-export button { justify-self: start; }
[data-configuration-sync] { min-width: 0; grid-template-columns: minmax(0, 1fr); }
[data-configuration-sync] details { min-width: 0; overflow-wrap: anywhere; }
[data-configuration-sync] summary { color: var(--label); cursor: pointer; font-size: 13px; }
[data-configuration-sync] dt { color: var(--muted); font-size: 12px; }
[data-configuration-sync] dd { margin: 4px 0 14px; overflow-wrap: anywhere; }
[data-configuration-sync] .check { align-items: start; }
[data-configuration-sync] .check input { flex: none; }
.configuration-conflict table { width: 100%; table-layout: fixed; }
.configuration-conflict th, .configuration-conflict td { overflow-wrap: anywhere; vertical-align: top; }
.window:has([data-configuration-review]), .window:has(.tool-policy) { min-width: 0; }
.window:has([data-configuration-review]) .detail-header > div, .window:has(.tool-policy) .detail-header > div { min-width: 0; overflow-wrap: anywhere; }
.window:has([data-configuration-review]) .server-settings-form, [data-catalog-version-fields] { min-width: 0; }
[data-policy-error] { overflow-wrap: anywhere; }

.detail-header > div, .facts > div { min-width: 0; }
.detail-header h1, .detail-header p, .facts code { overflow-wrap: anywhere; }
.execution-summary, .connection-checked, .configuration-status { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
#clients.detail-section { margin-top: 24px; }
#clients .detail-section-heading { flex-wrap: wrap; align-items: baseline; gap: 10px 20px; }
.connection-details, .authentication-details { margin-top: 24px; }
.connection-details > summary, .authentication-details > summary { color: var(--label); font-size: 13px; font-weight: 650; cursor: pointer; }
.connection-details > .facts, .authentication-details > form { margin-top: 14px; }
.connection-details > summary:focus-visible, .authentication-details > summary:focus-visible, .other-agent-setup > summary:focus-visible, .agent-installation > summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--signal-outline); outline-offset: 2px; }
.legacy-forwarding form { margin-top: 14px; }
@media (max-width: 420px) {
  .titlebar { height: auto; min-height: 54px; grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 10px; }
  .title-leading { gap: 12px; }
  .title-actions { justify-self: stretch; justify-content: flex-end; }
}
