:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #59677d;
  --line: #d5deea;
  --paper: #f8fafc;
  --white: #ffffff;
  --blue: #0868f7;
  --blue-dark: #0055d8;
  --blue-soft: #eef5ff;
  --green: #078a61;
  --green-soft: #e6f5ef;
  --amber: #e87508;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); min-height: 100vh; }
a { color: inherit; }
.site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 2.25rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; white-space: nowrap; }
.noma-symbol { display: block; width: 34px; height: 30px; object-fit: contain; }
.brand-divider { width: 1px; height: 32px; margin: 0 3px; background: var(--line); }
.product-name { font-size: 1.08rem; font-weight: 500; color: #273349; }
main { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
footer { width: min(1280px, calc(100% - 48px)); margin: 3rem auto 2rem; text-align: center; color: #697588; font-size: .9rem; }

.signin-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 56px 0 28px; }
.signin-card { width: min(650px, 100%); padding: 44px 44px 34px; text-align: center; background: var(--white); border: 1px solid #ccd6e3; border-radius: 14px; box-shadow: 0 14px 34px rgba(29, 48, 77, .09); }
.security-mark { height: 76px; display: grid; place-items: center; margin-bottom: 18px; }
.security-mark img { display: block; width: 76px; height: 76px; object-fit: contain; }
.signin-card h1 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -.035em; }
.signin-lead { margin: 0 0 34px; color: var(--muted); font-size: 1.15rem; }
.button { appearance: none; border: 1px solid transparent; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 17px; gap: 12px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--blue); color: white; box-shadow: 0 3px 8px rgba(8,104,247,.2); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: #075fdc; background: var(--white); border-color: #8eb9f5; }
.button.secondary:hover { background: var(--blue-soft); }
.button.compact { min-height: 34px; padding: 0 13px; font-size: .82rem; }
.signin-button { width: 100%; min-height: 60px; font-size: 1.15rem; }
.lock-icon { position: relative; width: 19px; height: 17px; border: 2px solid currentColor; border-radius: 3px; }
.lock-icon::before { content: ""; position: absolute; width: 11px; height: 10px; left: 2px; top: -10px; border: 2px solid currentColor; border-bottom: 0; border-radius: 8px 8px 0 0; }
.secure-access { display: flex; justify-content: center; align-items: center; gap: 10px; border-top: 1px solid var(--line); margin-top: 29px; padding-top: 27px; color: #657286; }
.mini-shield { display: grid; place-items: center; width: 20px; height: 23px; border: 2px solid #8591a2; border-radius: 5px 5px 8px 8px; font-size: .7rem; font-weight: 800; }

.user-menu { display: flex; align-items: center; gap: 10px; color: #46536a; font-size: .9rem; }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--blue); font-weight: 800; text-transform: uppercase; }
.text-button { margin-left: 5px; padding: 7px 9px; background: none; border: 0; border-left: 1px solid var(--line); font: inherit; color: var(--muted); cursor: pointer; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 2.5rem 0 1.4rem; }
.page-heading h1 { margin: 0 0 .35rem; font-size: 2rem; letter-spacing: -.03em; }
.page-heading p { margin: 0; color: var(--muted); }
.gateway-card, .panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.gateway-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; padding: 18px 20px; }
.gateway-card p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.gateway-url { max-width: 52%; display: flex; align-items: center; gap: 8px; }
.gateway-card code { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 8px 11px; background: var(--paper); border-radius: 6px; color: var(--muted); white-space: nowrap; }
.copy-url, .reconnect-action { appearance: none; border: 0; padding: 5px 6px; background: transparent; color: var(--blue); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.copy-url:hover, .reconnect-action:hover { text-decoration: underline; }
.status-gate { min-height: 180px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }
.status-spinner { width: 18px; height: 18px; border: 2px solid #c7d4e5; border-top-color: var(--blue); border-radius: 50%; animation: status-spin .8s linear infinite; }
#connections-page[data-auth-state="checking"] .connection-section { display: none; }
#connections-page[data-auth-state="ready"] .status-gate { display: none; }
@keyframes status-spin { to { transform: rotate(360deg); } }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.status-dot.connected { background: var(--green); }
.panel { margin-bottom: 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: center; gap: 12px; }
.panel-heading h2 { margin: 0; font-size: 1.22rem; }
.panel-title .status-dot { margin-right: 0; }
.available-icon { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid #75839a; border-radius: 50%; color: #66758d; font-size: 1rem; line-height: 1; }
.section-count { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 999px; color: #465670; background: #eef2f7; font-size: .76rem; font-weight: 750; }
.table-heading { display: grid; grid-template-columns: minmax(0, 1fr) 300px 150px; gap: 20px; padding: 10px 20px; border-bottom: 1px solid var(--line); color: #334158; font-size: .78rem; }
.server-grid { display: grid; }
.server-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) 300px 150px; align-items: center; gap: 16px; min-height: 104px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.server-card:last-child { border-bottom: 0; }
.server-card h3, .server-card p { margin: 0; }
.server-card h3 { font-size: .96rem; }
.server-card p { margin-top: 5px; color: var(--muted); font-size: .82rem; }
.server-description { max-width: 570px; line-height: 1.4; }
.server-identity { min-width: 0; }
.management-label { position: relative; display: inline-flex; }
.management-badge { display: inline-flex; margin-top: 6px; padding: 3px 7px; border: 1px solid; border-radius: 999px; font-size: .66rem; font-weight: 750; line-height: 1; }
.management-badge.managed { color: #075fdc; border-color: #bad3f7; background: #f1f7ff; }
.management-badge.proxied { color: #6841c6; border-color: #d6c7f4; background: #f7f3ff; }
.management-badge:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.management-tooltip { position: absolute; z-index: 8; left: 0; bottom: calc(100% + 8px); width: max-content; max-width: 260px; padding: 7px 9px; border-radius: 6px; background: #172033; color: white; box-shadow: 0 5px 16px rgba(9, 19, 35, .2); font-size: .72rem; font-weight: 500; line-height: 1.35; opacity: 0; pointer-events: none; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.management-tooltip::after { content: ""; position: absolute; top: 100%; left: 16px; border: 5px solid transparent; border-top-color: #172033; }
.management-label:hover .management-tooltip, .management-label:focus-within .management-tooltip { opacity: 1; transform: translateY(0); }
.provider-icon { width: 40px; height: 40px; border: 1px solid #d8e1ec; border-radius: 8px; display: grid; place-items: center; overflow: hidden; background: white; font-weight: 800; }
.provider-icon img { display: block; width: 30px; height: 30px; object-fit: contain; }
.provider-icon img.noma-provider-mark { width: 28px; height: 24px; }
.provider-icon.internal-icon { color: #142238; background: linear-gradient(145deg, #edf6ff, #cce2ff); }
.provider-icon.pylon { background: #fbf8ff; }
.badge { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 6px 9px; border-radius: 999px; }
.badge.ready { background: var(--green-soft); color: var(--green); }
.badge.warning { background: #fff0da; color: #a75d07; }
.connection-state { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.connection-state i { width: 8px; height: 8px; border-radius: 50%; background: #aab5c5; }
.connection-state.connected { color: var(--green); }
.connection-state.connected i { background: var(--green); }
.connection-state.warning { color: var(--amber); }
.connection-state.warning i { background: var(--amber); }
.provider[data-status="connected"] .provider-status { color: var(--green); }
.provider[data-status="reauth_required"] .provider-status { color: var(--amber); }
.server-card > form { display: flex; align-items: center; gap: 3px; }
.server-card > form.provider-actions { flex-direction: column; align-items: flex-start; gap: 2px; }
.provider-actions .reconnect-action { margin-left: 17px; padding: 2px 0; font-size: .72rem; font-weight: 650; }
.provider-status.connected { color: var(--green); }
.provider-status.connected i { background: var(--green); }
.provider-status.warning { color: var(--amber); }
.provider-status.warning i { background: var(--amber); }
.section-empty { margin: 0; padding: 28px 20px; color: var(--muted); text-align: center; }
.capability-trigger { width: fit-content; min-width: 0; min-height: 40px; display: grid; grid-template-columns: 22px auto 1px 22px auto 14px; align-items: center; gap: 9px; padding: 0 12px; border: 1px solid #ccd8e7; border-radius: 7px; background: white; color: #30415d; font: inherit; font-size: .82rem; cursor: pointer; text-align: left; }
.capability-trigger:hover { border-color: #85aee9; background: #f9fbff; }
.capability-trigger:disabled { opacity: .55; cursor: default; }
.capability-trigger i { height: 22px; width: 1px; background: #d5deea; }
.capability-trigger b { font-size: 1.5rem; line-height: 1; font-weight: 400; color: #101828; }
.capability-icon { width: 17px; height: 17px; opacity: .9; }
.server-card > form { justify-self: start; }

body.modal-open { overflow: hidden; }
.capability-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 32px; background: rgba(21, 32, 49, .64); }
.capability-backdrop[hidden] { display: none; }
.capability-modal { width: min(1080px, 100%); height: min(816px, calc(100vh - 64px)); display: grid; grid-template-rows: auto minmax(0, 1fr); background: white; border: 1px solid #c8d2df; border-radius: 8px; overflow: hidden; box-shadow: 0 24px 70px rgba(9, 19, 35, .28); }
.capability-header { min-height: 124px; display: grid; grid-template-columns: minmax(320px, 1fr) 270px 38px; align-items: start; gap: 16px; padding: 22px 18px 16px 26px; border-bottom: 1px solid var(--line); }
.capability-header h2 { margin: 2px 0 14px; font-size: 1.24rem; }
.capability-tabs { display: flex; gap: 10px; }
.capability-tabs button { min-width: 104px; height: 35px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 12px; border: 1px solid #cbd7e6; border-radius: 6px; color: #334158; background: white; font: inherit; cursor: pointer; }
.capability-tabs button.active { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); color: #075fe4; font-weight: 700; }
.capability-tabs span { padding: 2px 7px; border-radius: 5px; background: #f0f5fb; font-size: .75rem; }
.capability-search { height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid #ccd8e7; border-radius: 6px; color: #34425a; }
.capability-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.modal-close { width: 36px; height: 36px; border: 1px solid #d3dce8; border-radius: 6px; background: white; font-size: 1.65rem; line-height: 1; cursor: pointer; }
.capability-body { min-height: 0; display: grid; grid-template-columns: 352px minmax(0, 1fr); }
.capability-list { overflow: auto; padding: 14px 12px; border-right: 1px solid var(--line); }
.capability-list section { margin-bottom: 16px; }
.capability-list h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 12px 9px; font-size: .93rem; }
.capability-list h3 span { padding: 2px 7px; border: 1px solid #d5deea; border-radius: 5px; color: #4e5d73; font-size: .72rem; font-weight: 500; }
.capability-item { width: 100%; min-height: 69px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid #d3dce8; border-bottom-width: 0; background: white; color: #172033; text-align: left; cursor: pointer; }
.capability-item:first-of-type { border-radius: 6px 6px 0 0; }
.capability-item:last-child { border-bottom-width: 1px; border-radius: 0 0 6px 6px; }
.capability-item.active { position: relative; background: #edf5ff; color: #0561ed; }
.capability-item.active::before { content: ""; position: absolute; left: -2px; top: -1px; bottom: -1px; width: 4px; border-radius: 3px 0 0 3px; background: var(--blue); }
.capability-item i { display: grid; place-items: center; font-style: normal; }
.capability-item i img { width: 23px; height: 23px; }
.capability-item strong, .capability-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.capability-item strong { font-size: .89rem; }
.capability-item small { margin-top: 3px; color: #53627a; font-size: .8rem; font-weight: 400; }
.empty-state, .empty-detail { padding: 28px; color: var(--muted); text-align: center; }
.capability-detail { position: relative; min-width: 0; overflow: auto; padding: 24px 28px 84px; }
.detail-heading h2 { margin: 0 0 12px; font-size: 1.45rem; }
.detail-heading > p, .detail-heading > code { display: block; margin: 0 0 8px; color: #53627a; background: none; font-family: inherit; }
.detail-badges { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.detail-badges span { padding: 7px 12px; border: 1px solid #bdd5ff; border-radius: 5px; color: #0661e8; background: #f2f7ff; font-size: .79rem; }
.detail-badges span:nth-child(2) { color: #5421d5; border-color: #d8cafa; background: #f6f2ff; }
.detail-badges span:nth-child(3) { color: #087c50; border-color: #bee8d4; background: #effbf5; }
.detail-tabs { display: flex; gap: 42px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.detail-tabs button { appearance: none; padding: 0 6px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: #334158; font: inherit; font-size: .82rem; cursor: pointer; white-space: nowrap; }
.detail-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.detail-content h3 { margin: 22px 0 10px; font-size: 1rem; }
.detail-content p { color: #4f5e75; }
.detail-content dl, .detail-content ul { margin: 0; padding: 0; border: 1px solid #d2dce9; border-radius: 6px; overflow: hidden; }
.detail-content dl div { display: grid; grid-template-columns: 34% 1fr; min-height: 50px; align-items: center; border-bottom: 1px solid #d2dce9; }
.detail-content dl div:last-child { border-bottom: 0; }
.detail-content dt, .detail-content dd { margin: 0; padding: 12px 16px; font-size: .82rem; }
.detail-content dt { font-weight: 700; }
.detail-content ul { list-style: none; }
.detail-content li { padding: 8px 16px; border-bottom: 1px solid #d2dce9; color: #405069; }
.detail-content li:last-child { border-bottom: 0; }
.detail-content li::before { content: "•"; color: var(--blue); margin-right: 14px; }
.detail-content pre { max-height: 300px; overflow: auto; margin: 0; padding: 16px; border: 1px solid #d2dce9; border-radius: 6px; background: #f7f9fc; color: #24334b; font-size: .78rem; line-height: 1.55; white-space: pre-wrap; }
.content-prompt { padding: 44px 20px; border: 1px dashed #c6d3e3; border-radius: 7px; text-align: center; }
.content-prompt h3 { margin-top: 0; }
.content-prompt p { margin-bottom: 20px; color: var(--muted); }
.optional { padding: 4px 8px; margin-right: 14px; border: 1px solid #cbd7e6; border-radius: 5px; color: #465670; }
.capability-detail footer { position: absolute; left: 28px; right: 28px; bottom: 22px; display: flex; justify-content: flex-end; gap: 12px; }
.notice { border-radius: 8px; padding: 13px 16px; margin-bottom: 14px; }
.notice.success { background: var(--green-soft); color: var(--green); }
.notice.approval { display: flex; align-items: center; justify-content: space-between; gap: 20px; background: var(--blue-soft); color: #214d80; border: 1px solid #cfe0fa; }
.notice.approval p { margin: 4px 0 0; color: #527092; }
.reauth-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 54px 0 24px; }
.reauth-card { width: min(760px, 100%); padding: 44px; background: var(--white); border: 1px solid #ccd6e3; border-radius: 14px; box-shadow: 0 14px 34px rgba(29, 48, 77, .09); }
.reauth-card > .eyebrow { margin: 0 0 14px; color: #166f56; font-size: .74rem; font-weight: 800; letter-spacing: .16em; }
.reauth-card > h1 { margin: 0 0 14px; font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.03; letter-spacing: -.045em; }
.reauth-lead { max-width: 620px; margin: 0 0 28px; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.reauth-primary { min-width: 220px; }
.reauth-note { margin: 18px 0 0; color: var(--muted); font-size: .84rem; }
.reauth-back { display: block; width: fit-content; margin-top: 26px; color: var(--muted); font-size: .88rem; }
.reauth-list { display: grid; gap: 12px; }
.reauth-provider { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.reauth-provider-copy h2 { margin: 0 0 5px; font-size: 1.05rem; }
.reauth-provider-copy p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.4; }
.reauth-provider form { margin: 0; }
.reauth-success-mark { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 50%; color: white; background: var(--green); font-size: 1.8rem; font-weight: 800; }
.hero { padding: 8rem 0; max-width: 760px; }
.hero h1 { margin: 0 0 1rem; font-size: clamp(2.6rem, 6vw, 4.7rem); letter-spacing: -.055em; line-height: 1; }
.lead { color: var(--muted); font-size: 1.15rem; line-height: 1.6; }

@media (max-width: 720px) {
  .site-header { height: 68px; padding: 0 18px; }
  .brand { gap: 9px; }
  .brand-divider, .user-menu > span:not(.user-avatar) { display: none; }
  .noma-symbol { width: 30px; height: 26px; }
  .product-name { font-size: .84rem; }
  main, footer { width: min(100% - 28px, 1280px); }
  .signin-shell { min-height: calc(100vh - 130px); padding: 28px 0 12px; }
  .signin-card { padding: 34px 22px 26px; }
  .reauth-card { padding: 34px 22px; }
  .reauth-provider { grid-template-columns: 42px 1fr; }
  .reauth-provider form { grid-column: 2; }
  .reauth-provider .button { width: 100%; }
  .signin-button { font-size: 1rem; }
  .page-heading, .gateway-card, .notice.approval { align-items: stretch; flex-direction: column; }
  .page-heading { padding-top: 1.8rem; }
  .gateway-url { max-width: 100%; }
  .table-heading { display: none; }
  .server-card { grid-template-columns: 42px 1fr; padding: 15px; }
  .server-card form, .server-card .badge, .server-card .connection-state, .capability-trigger { grid-column: 2; justify-self: start; }
  .capability-trigger { width: min(100%, 286px); }
  .capability-backdrop { padding: 10px; }
  .capability-modal { height: calc(100vh - 20px); }
  .capability-header { grid-template-columns: 1fr 38px; padding: 18px; }
  .capability-search { grid-column: 1 / -1; grid-row: 2; }
  .modal-close { grid-column: 2; grid-row: 1; }
  .capability-body { grid-template-columns: 1fr; }
  .capability-list { max-height: 37vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .capability-detail { padding: 20px 18px 84px; }
  .detail-tabs { gap: 18px; overflow-x: auto; }
}
