:root {
  color-scheme: light;
  --ink: #17233c;
  --muted: #647089;
  --line: #dfe4ed;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --brand: #2957d8;
  --brand-dark: #183ca5;
  --ready: #18794e;
  --ready-bg: #e6f6ee;
  --action: #9a5a00;
  --action-bg: #fff4db;
  --off: #a22b32;
  --off-bg: #fdebec;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.token-delivery-layout {
  align-items: start;
}

.token-delivery-card {
  min-width: 0;
}

.token-value {
  box-sizing: border-box;
  width: 100%;
  overflow-wrap: anywhere;
  resize: vertical;
}

.setup-steps {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.25rem;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; }
.site-header { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: white; font-size: 12px; letter-spacing: .04em; }
.page-shell { width: min(1120px, 90vw); margin: 0 auto; padding: 64px 0 80px; }
.auth-layout { min-height: 66vh; display: grid; grid-template-columns: 1.35fr .8fr; gap: 9vw; align-items: center; }
.hero-copy h1, .narrow-panel h1, .dashboard-heading h1 { margin: 10px 0 18px; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: 1.02; letter-spacing: -.055em; }
.narrow-panel h1, .dashboard-heading h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
.eyebrow { margin: 0; color: var(--brand); text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 800; }
.lead { max-width: 700px; color: var(--muted); font-size: 1.16rem; line-height: 1.65; }
.lead.small { font-size: 1rem; }
.auth-card, .narrow-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: 0 24px 70px rgba(23,35,60,.08); }
.auth-card h2 { margin: 0 0 10px; font-size: 1.45rem; }
.auth-card p { color: var(--muted); line-height: 1.55; margin-bottom: 24px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 11px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.button.primary { width: 100%; background: var(--brand); color: white; }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { width: 100%; margin-top: 10px; border-color: var(--line); background: white; }
.button.ghost { background: transparent; border-color: var(--line); }
.button.danger { color: var(--off); background: white; border-color: #ecc5c8; }
.button.compact { width: auto; min-height: 38px; padding: 0 13px; font-size: .82rem; }
.text-link { display: inline-block; margin-top: 22px; color: var(--brand); font-weight: 650; }
.notice { margin-top: 18px; padding: 14px; border-radius: 10px; font-size: .92rem; }
.notice.warning { background: var(--action-bg); color: var(--action); }
.notice.success { background: var(--ready-bg); color: var(--ready); }
.notice.error { background: var(--off-bg); color: var(--off); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 18px; }
.detail-grid dt { color: var(--muted); font-size: .8rem; margin-bottom: 5px; }
.detail-grid dd { margin: 0; overflow-wrap: anywhere; }
.narrow-panel { width: min(610px, 100%); margin: 20px auto; }
.stacked-form { display: grid; gap: 11px; margin-top: 28px; }
.stacked-form label, .tenant-selector label { font-size: .85rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid #c9d0dc; border-radius: 10px; background: white; color: var(--ink); font: inherit; }
textarea { padding-top: 11px; resize: vertical; }
.stacked-form .button { margin-top: 10px; }
.dashboard-heading { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; }
.account-chip { padding: 10px 14px; border: 1px solid var(--line); background: white; border-radius: 999px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.inline-form { margin: 0; }
.tenant-selector { display: grid; grid-template-columns: auto minmax(220px, 360px); gap: 12px; align-items: center; margin: 28px 0; }
.progress-summary { display: grid; gap: 8px; margin: 42px 0 22px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.progress-track { overflow: hidden; height: 8px; border-radius: 99px; background: #dde3ee; }
.progress-track span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.connections-section { margin: 34px 0 42px; padding: 28px; background: white; border: 1px solid var(--line); border-radius: 18px; }
.section-heading { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; }
.section-heading h2 { margin: 7px 0 8px; font-size: 1.5rem; }
.section-heading p:not(.eyebrow) { max-width: 620px; margin: 0; color: var(--muted); line-height: 1.5; }
.connect-form { display: grid; grid-template-columns: minmax(145px, 190px) auto; gap: 7px 10px; align-items: end; }
.connect-form label { grid-column: 1 / -1; font-size: .78rem; font-weight: 750; }
.connect-form select { min-height: 38px; }
.connection-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 15px; margin-top: 22px; }
.connection-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.connection-title-row { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.connection-title-row h3 { margin: 0 0 5px; font-size: 1.08rem; }
.mono { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; }
.connection-details { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 22px 0; }
.connection-details div { min-width: 0; }
.connection-details dt { color: var(--muted); font-size: .71rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.connection-details dd { overflow-wrap: anywhere; margin: 4px 0 0; font-size: .88rem; }
.next-action, .setup-note, .empty-state { display: grid; gap: 5px; padding: 14px; border-radius: 10px; background: #edf1fa; font-size: .86rem; line-height: 1.45; }
.next-action span, .setup-note span, .empty-state span { color: var(--muted); }
.connection-name-form { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 7px 9px; align-items: end; margin-top: 16px; }
.connection-name-form label { grid-column: 1 / -1; color: var(--muted); font-size: .72rem; font-weight: 750; }
.connection-name-form input { min-height: 38px; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.connection-actions > .status { align-self: center; }
.connection-actions form { margin: 0; }
.read-only-note { margin: 16px 0 0; color: var(--muted); font-size: .84rem; }
.empty-state { margin-top: 22px; }
.setup-note { margin-top: 18px; background: var(--action-bg); }
.connection-create-panel, .credential-panel { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.connection-create-panel summary, .credential-panel summary { cursor: pointer; padding: 14px 16px; font-weight: 750; }
.database-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 16px 18px; }
.database-form label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.wide-field { grid-column: 1 / -1; }
.form-note { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.credential-panel { background: white; }
.credential-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 12px 12px; }
.credential-form button { grid-column: 1 / -1; }
.binding-panel { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.binding-panel h3 { margin: 5px 0 14px; }
.binding-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.binding-form label { display: grid; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.binding-list { display: grid; gap: 8px; margin-top: 18px; }
.binding-list > div { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.binding-actions { display: flex; gap: 8px; align-items: center; }
.binding-actions form { margin: 0; }
.step-grid { display: grid; gap: 13px; }
.step-card { display: grid; grid-template-columns: 42px 1fr; gap: 18px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.step-number { display: grid; place-items: center; align-self: start; width: 36px; height: 36px; border-radius: 50%; background: #edf1fa; color: var(--brand); font-size: .85rem; font-weight: 800; }
.step-title-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.step-title-row h2 { margin: 2px 0; font-size: 1.05rem; }
.step-copy p { margin: 8px 0; color: var(--muted); line-height: 1.5; }
.status { padding: 6px 9px; border-radius: 99px; font-size: .67rem; font-weight: 850; letter-spacing: .04em; }
.status.ready, .status.connected { color: var(--ready); background: var(--ready-bg); }
.status.action_required { color: var(--action); background: var(--action-bg); }
.status.disconnected { color: var(--off); background: var(--off-bg); }
.status.disabled { color: var(--off); background: var(--off-bg); }
.next-task { color: var(--brand); font-size: .78rem; font-weight: 700; }
.correlation { color: var(--muted); font-family: ui-monospace, monospace; font-size: .78rem; }

/* Workspace navigation and compact resource pages. */
.portal-shell { width: min(1440px, 94vw); padding: 30px 0 64px; }
.portal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.portal-sidebar { position: sticky; top: 24px; padding: 18px 20px 18px 0; border-right: 1px solid var(--line); }
.workspace-name { margin: 9px 0 4px; font-size: 1.03rem; overflow-wrap: anywhere; }
.portal-nav { display: grid; gap: 6px; margin-top: 32px; }
.portal-nav a { padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: .9rem; font-weight: 650; }
.portal-nav a:hover { background: #edf1fa; color: var(--ink); }
.portal-nav a[aria-current="page"] { background: #e7edff; color: var(--brand-dark); }
.sidebar-note { margin-top: 36px; font-size: .77rem; color: var(--muted); line-height: 1.6; }
.mobile-menu { display: none; }
.header-account { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: .82rem; }
.portal-content { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 12px 0 28px; }
.page-heading h1 { margin: 9px 0 10px; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.15; letter-spacing: -.035em; overflow-wrap: anywhere; }
.page-heading p { margin-bottom: 0; line-height: 1.5; }
.page-heading > .button { flex-shrink: 0; }
.muted { color: var(--muted); line-height: 1.55; }
.small-copy { font-size: .8rem; }
.back-link { display: inline-block; font-size: .82rem; color: var(--muted); margin-bottom: 12px; text-decoration: none; }
.back-link:hover { color: var(--brand); }
.content-panel { margin-top: 20px; padding: 24px; border: 1px solid var(--line); background: white; border-radius: 14px; min-width: 0; }
.content-panel h2 { margin: 0 0 12px; font-size: 1.08rem; }
.content-panel .section-heading { align-items: center; gap: 16px; }
.content-panel .section-heading a { font-size: .85rem; color: var(--brand); flex-shrink: 0; }
.list-heading { display: flex; align-items: baseline; justify-content: space-between; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { display: grid; gap: 8px; padding: 22px; border-radius: 14px; border: 1px solid var(--line); background: white; text-decoration: none; }
.stat-card:hover { border-color: var(--brand); }
.stat-card > span, .stat-card small { color: var(--muted); font-size: .8rem; }
.stat-card strong { font-size: 2rem; line-height: 1.2; font-weight: 650; }
.getting-started { background: #edf2ff; border-color: #d5dffd; }
.getting-started .eyebrow { margin-bottom: 12px; }
.resource-list { display: grid; margin-top: 14px; }
.resource-row { display: flex; align-items: center; gap: 22px; padding: 18px 0; border-top: 1px solid var(--line); min-width: 0; }
.resource-row:first-child { border-top: 0; }
.resource-identity { display: grid; gap: 6px; min-width: 0; flex: 1; overflow-wrap: anywhere; }
.resource-identity > a { font-size: .93rem; font-weight: 650; text-decoration: none; }
.resource-identity > a:hover { color: var(--brand); text-decoration: underline; }
.resource-check { display: grid; justify-items: start; gap: 6px; }
.resource-row > .button { flex-shrink: 0; }
.direction { color: var(--muted); padding: 0 6px; }
.status { display: inline-block; white-space: nowrap; width: fit-content; }
.status.active, .status.completed, .status.success { color: var(--ready); background: var(--ready-bg); }
.status.pending, .status.paused, .status.partial, .status.queued, .status.ready_to_delete { color: var(--action); background: var(--action-bg); }
.status.failed, .status.revoked, .status.expired, .status.denied { color: var(--off); background: var(--off-bg); }
.status.cancelled, .status.not_configured { color: var(--muted); background: #edf1fa; }
.attention-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.attention-list li { display: grid; gap: 4px; font-size: .85rem; overflow-wrap: anywhere; }
.attention-list a { font-weight: 650; }
.settings-panel { margin-top: 22px; border-top: 1px solid var(--line); }
.settings-panel summary, .setup-panel summary { cursor: pointer; font-weight: 650; font-size: .9rem; padding: 12px 0; }
.setup-panel summary { padding: 0; }
.setup-panel[open] summary { margin-bottom: 16px; }
.panel-body { margin-top: 4px; padding-bottom: 12px; }
.danger-zone { border-color: #ecc5c8; }
.danger-zone h2 { color: var(--off); }
.danger-action { border-top: 1px solid #f1dbdd; }
.danger-action summary { padding: 14px 0; cursor: pointer; font-size: .85rem; color: var(--off); }
.confirmation-form { display: grid; justify-items: start; gap: 12px; padding-bottom: 18px; font-size: .86rem; }
.confirmation-form p { margin: 0; color: var(--muted); line-height: 1.5; }
.confirmation-check, .database-form .confirmation-check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.confirmation-check input { width: 18px; min-height: 18px; flex-shrink: 0; }
.database-form .form-note { margin: 0; line-height: 1.6; }
.settings-warning { padding: 16px; background: #fff8e8; border-left: 3px solid var(--action); font-size: .85rem; line-height: 1.6; }
.settings-warning ul { margin: 8px 0 0; padding-left: 20px; }
.settings-warning li + li { margin-top: 8px; }
.integration-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 20px; align-items: center; }
.route-endpoint { display: grid; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; overflow-wrap: anywhere; }
a.route-endpoint:hover { border-color: var(--brand); }
.route-arrow { font-size: 1.5rem; color: var(--muted); }
.readiness-list { list-style: none; padding: 0; margin: 16px 0; }
.readiness-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .86rem; }
.readiness-list a { text-decoration: none; }
.readiness-list a:hover { text-decoration: underline; }
.wizard-steps { display: flex; gap: 20px; list-style: none; padding: 0; margin: 0 0 24px; }
.wizard-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .82rem; }
.wizard-steps span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e6ebf4; flex-shrink: 0; }
.wizard-steps [aria-current="step"] { color: var(--brand); font-weight: 700; }
.wizard-steps [aria-current="step"] span { background: var(--brand); color: white; }
.wizard-panel { max-width: 820px; }
.wizard-panel > .database-form { padding: 12px 0 0; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; text-align: left; }
.data-table th { color: var(--muted); font-size: .73rem; font-weight: 650; }
.data-table th, .data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td[colspan] { white-space: normal; }
.data-table td a { color: var(--brand); }
.data-table td { vertical-align: top; }
.filter-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: end; }
.filter-field { display: grid; gap: 10px; min-width: 0; }
.filter-field label { font-size: .85rem; font-weight: 650; }
.filter-field input, .filter-field select { min-width: 0; }
.filter-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; grid-column: 1 / -1; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.operations-filter { grid-template-columns: minmax(180px, 320px) auto; justify-content: start; margin-bottom: 24px; }
.audit-table { table-layout: fixed; }
.audit-table th:first-child { width: 28%; }
.audit-table th:last-child { width: 22%; }
.audit-table td { white-space: normal; overflow-wrap: anywhere; }
.audit-table tbody > tr:first-child td { border-bottom: 0; }
.audit-detail-row > td { padding-top: 0; }
.audit-detail-row summary { cursor: pointer; color: var(--brand); padding: 8px 0; width: fit-content; }
.audit-details { padding: 18px; background: #f5f7fc; border-radius: 10px; margin: 8px 0; }
.audit-details > div { min-width: 0; }
.workspace-switcher { display: grid; gap: 8px; margin-top: 18px; font-size: .8rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.team-panel { margin-top: 20px; }
.team-panel summary { cursor: pointer; font-weight: 650; }
.team-panel .stacked-form { max-width: 560px; }
.team-table td { vertical-align: top; }
.team-table details { margin-bottom: 8px; min-width: 160px; }
.team-table details[open] { width: 260px; white-space: normal; }
.team-table details form { display: grid; gap: 8px; margin-top: 10px; }
.team-table details p { line-height: 1.5; }
:focus-visible { outline: 3px solid #89a6f8; outline-offset: 3px; }

@media (max-width: 1000px) {
  .portal-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .resource-row { flex-wrap: wrap; gap: 12px; }
  .resource-identity { flex-basis: 60%; }
  .resource-check { flex-basis: 100%; order: 3; }
}

@media (max-width: 760px) {
  .portal-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .portal-sidebar { position: static; padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .portal-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
  .desktop-nav { display: none; }
  .mobile-menu { display: block; margin-top: 14px; }
  .mobile-menu > summary { cursor: pointer; color: var(--brand); padding: 10px 0; font-weight: 650; }
  .sidebar-note, .header-account > span { display: none; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 16px; }
  .overview-stats { gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-card > span { font-size: .73rem; }
  .content-panel { padding: 18px; }
  .integration-route { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .route-arrow { text-align: center; transform: rotate(90deg); }
  .wizard-steps { flex-direction: column; gap: 10px; }
  .readiness-list li { flex-wrap: wrap; gap: 8px; }
  .page-shell { padding-top: 36px; }
  .auth-layout { grid-template-columns: 1fr; gap: 36px; }
  .dashboard-heading { align-items: flex-start; flex-direction: column; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .connect-form { grid-template-columns: 1fr; }
  .database-form, .credential-form, .binding-form { grid-template-columns: 1fr; }
  .wide-field, .credential-form button { grid-column: auto; }
  .connection-name-form { grid-template-columns: 1fr; row-gap: 14px; }
  .connection-grid, .connection-details { grid-template-columns: 1fr; }
  .account-chip { white-space: normal; }
  .step-title-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .filter-form, .filter-dates, .operations-filter { grid-template-columns: minmax(0, 1fr); }
  .filter-actions { margin-top: 4px; }
  .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .responsive-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .responsive-table td { padding: 6px 0; border: 0; white-space: normal; overflow-wrap: anywhere; }
  .responsive-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font: 650 .73rem system-ui, sans-serif; }
  .responsive-table td[data-label="Actions"]:not(:has(*)) { display: none; }
  .responsive-table details, .responsive-table details[open] { width: auto; min-width: 0; }
  .audit-table tbody { border-bottom: 1px solid var(--line); padding: 8px 0; }
  .audit-table tr { border: 0; padding: 0; }
  .audit-details { padding: 14px; }
}
