body { margin: 0; background: var(--soft); }
.connection-journey { max-width: 520px; margin: 32px auto; padding: 16px; }
.journey-back { display: inline-block; margin-top: 18px; color: inherit; font-size: 13px; }
/* Cards and isolated setup pages stay light; the outer Settings labels inherit the shell. */
:root, :host { display: block; color-scheme: light only; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --ink: light-dark(#182334,#eef1f6); --muted: light-dark(#586779,#adb9cb); --line: light-dark(#e4e8ef,#354155); --paper: light-dark(#fff,#19212f); --soft: light-dark(#f8fafc,#222d3f); color: var(--ink); }
/* No card surface behind catalog headings/loading/errors: use the page's text color.
   Nested provider components keep their own light palette and white surfaces. */
:host(lab-connections:not([connector])) { color: inherit; }
.connection-group > .scope { color: inherit; }
* { box-sizing: border-box; }
.provider-mark svg { width: 26px; height: 26px; fill: currentColor; }
.connector-directory { max-width: 760px; margin: 32px auto; padding: 24px; }
.directory-brand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; font-weight: 650; }
.brand-section { color: var(--muted); font-weight: 400; }
.site-badge { padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; font: 11px ui-monospace, monospace; color: var(--muted); overflow-wrap: anywhere; }
.directory-intro { margin: 48px 0 28px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; }
.directory-intro h1 { font-size: clamp(27px, 5vw, 36px); letter-spacing: -.04em; line-height: 1.15; margin: 12px 0; }
.directory-intro > p:last-child { max-width: 560px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.connector-list li { padding: 0; border: 0; margin-bottom: 12px; }
.connector-card { display: flex; align-items: center; gap: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); text-decoration: none; box-shadow: 0 3px 12px #18233405; }
.connector-card:hover { border-color: #827aff; }
.connector-card:focus-visible, .directory-manage a:focus-visible { outline: 3px solid #7a70ff; outline-offset: 4px; }
.connector-summary { display: grid; gap: 7px; flex: 1; min-width: 0; }
.connector-card .connector-summary strong { font: 600 16px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.connector-summary > span { color: var(--muted); font-size: 13px; line-height: 1.6; }
.connector-continue { font-size: 12px; font-weight: 600; white-space: nowrap; }
.connector-continue > span { margin-left: 8px; }
.directory-note { margin-top: 28px; padding: 18px 20px; border-left: 2px solid var(--line); }
.directory-note strong { font-size: 13px; }
.directory-note p, .directory-manage { color: var(--muted); font-size: 12px; line-height: 1.7; }
.directory-note p { margin: 6px 0 0; }
.directory-manage { margin-top: 30px; }
.directory-manage a { color: var(--ink); text-underline-offset: 3px; }
@media(max-width:520px) { .connector-directory { margin: 12px auto; padding: 20px; } .directory-intro { margin-top: 34px; } .connector-card { padding: 18px; gap: 14px; flex-wrap: wrap; } .connector-continue { margin-left: 58px; } }

.connection { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; box-shadow: 0 2px 6px #18233404; }
.connection-head { display: flex; gap: 14px; align-items: center; padding: 24px 24px 0; }
.provider-mark { display: grid; place-items: center; flex: 0 0 44px; height: 44px; background: light-dark(#ffebe5,#523028); color: light-dark(#b83b20,#ffb39d); border-radius: 12px; font-size: 34px; font-weight: 700; }
.provider-title { min-width: 0; flex: 1; }
h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mode { border-radius: 5px; background: light-dark(#eee8ff,#393055); color: light-dark(#67459a,#d8c1ff); font: 11px ui-monospace, monospace; padding: 3px 6px; }
.provider-title p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.state { align-self: flex-start; border-radius: 20px; padding: 5px 9px; background: var(--soft); color: var(--muted); white-space: nowrap; font-size: 11px; }
.state[data-connected="true"] { background: light-dark(#e0f5ec,#183f35); color: light-dark(#136744,#8be0bc); }
.connection-body { padding: 20px 24px 24px; }
.account-line { margin: 0; font: 12px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
.scope { margin: 5px 0 18px; color: var(--muted); font-size: 12px; }
.consent-details { margin: 0 0 20px; font-size: 13px; line-height: 1.65; }
.consent-details p { margin: 0 0 12px; }
.consent-details a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.consent-details strong { overflow-wrap: anywhere; }
.consent-next { padding: 12px; background: var(--soft); border-radius: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button { min-height: 36px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
button:hover { background: var(--soft); }
button.primary { background: #635bff; color: white; border-color: #635bff; }
button.primary:hover { background: #5146dc; }
button:focus-visible { outline: 3px solid #7a70ff; outline-offset: 3px; }
button:disabled { opacity: .5; cursor: wait; }
[hidden] { display: none !important; }
.feedback { color: light-dark(#a12d30,#ffb1b3); font-size: 13px; line-height: 1.5; margin: 16px 0 0; }
h4 { margin: 0 0 12px; font-size: 12px; }
ul { list-style: none; margin: 0; padding: 0; }
li { padding: 10px 0; border-top: 1px solid var(--line); }
li:first-child { border: 0; }
li strong { font: 12px ui-monospace,monospace; overflow-wrap: anywhere; }
li p { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.disconnect-confirm { padding: 16px; margin-top: 16px; background: var(--soft); border-radius: 8px; font-size: 13px; }
.disconnect-confirm p { margin-top: 0; }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; background: var(--soft); border-top: 1px solid var(--line); padding: 13px 24px; font-size: 11px; color: var(--muted); }
.privacy-dot { width: 5px; height: 5px; border-radius: 50%; background: #25a777; }
@media(max-width:520px) { .connection-head { padding: 18px 18px 0; gap: 10px; flex-wrap: wrap; } .state { margin-left: 54px; } .connection-body { padding: 16px 18px 18px; } footer { padding: 12px 18px; } }

.service-connection { margin-top: 16px; }
.configuration, .assignments { margin-top: 20px; }
.configuration label { display: block; margin: 12px 0; font-size: 12px; }
.configuration input { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; }
.configuration input:focus-visible { outline: 3px solid #7a70ff; outline-offset: 3px; }
.token-help ol { margin: 0 0 12px; padding-left: 20px; }
.token-help li { padding: 0; border: 0; }
.token-help li + li { margin-top: 8px; }
.token-help a:focus-visible { outline: 3px solid #7a70ff; outline-offset: 3px; }
.product-options { margin: 18px 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.product-options legend { padding: 0 4px; font-size: 12px; font-weight: 600; }
.product-options label { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.product-options input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: #635bff; }
.assignments li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; overflow-wrap: anywhere; }
.assignments li span { flex: 1; min-width: 140px; }
.ask-admin, .inactive { font-size: 12px; line-height: 1.6; color: var(--muted); }

.connection-group + .connection-group { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.connection-group h2 { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.connection-group > lab-connections, .connection-group > lab-service-connection { display: block; margin-top: 14px; }

/* Existing-account controls share the same surface and focus treatment as Add. */
.account-list > li { padding: 20px 0; }
.account-list > li > .configuration { margin-top: 0; }
.account-name { font-size: 14px; overflow-wrap: anywhere; }
.account-configuration { overflow-wrap: anywhere; }
.rotation { margin: 16px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.rotation summary { padding: 10px 14px; font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 7px; }
.rotation summary:hover { background: var(--soft); }
.rotation summary:focus-visible { outline: 3px solid #7a70ff; outline-offset: 3px; }
.rotation[open] summary { border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; }
.rotation form { padding: 0 14px 14px; }
