:root {
    --hub-bg: #f5f6f7;
    --hub-surface: #fff;
    --hub-subtle: #f0f2f5;
    --hub-border: #dadde1;
    --hub-border-strong: #cbced2;
    --hub-text: #1c2b33;
    --hub-muted: #65717b;
    --hub-blue: #0866ff;
    --hub-blue-dark: #0756d8;
    --hub-blue-soft: #e7f1ff;
    --hub-radius: 8px;
    --hub-nav-height: 56px;
    --hub-page-gutter: 26px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; }
body.hub-body { min-height: 100vh; margin: 0; color: var(--hub-text); background: var(--hub-bg); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--hub-blue-dark); }

.hub-header { position: sticky; top: 0; z-index: 1030; height: var(--hub-nav-height); padding: 0; border-bottom: 1px solid var(--hub-border); background: #fff; }
.hub-navbar, .hub-navbar-shell { min-height: var(--hub-nav-height); padding: 0; }
.hub-navbar { width: 100%; }
.hub-navbar-shell { padding-inline: 16px; }
.hub-brand { display: flex; align-items: center; gap: 9px; margin-right: 18px; padding: 0; color: var(--hub-text); text-decoration: none; }
.hub-brand:hover { color: var(--hub-text); }
.hub-brand-mark, .auth-brand span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: #fff; background: var(--hub-blue); font-weight: 700; }
.hub-brand-title { font-size: .96rem; font-weight: 700; letter-spacing: -.02em; }
.hub-nav-list { align-items: center; gap: 6px; height: var(--hub-nav-height); }
.hub-nav-link { display: flex; align-items: center; height: 36px; padding: 0 10px !important; border-radius: 4px; border: 0; white-space: nowrap; color: #595c61; font-size: .88rem; font-weight: 500; }
.hub-nav-link:hover, .hub-nav-link:focus-visible { color: var(--hub-text); background: #f0f2f5; }
.hub-navbar .hub-nav-link.active { color: #0866c6; background: #e1edf8; }
.hub-navbar .hub-nav-link.active:hover { background: #f0f2f5; }
.hub-navbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.workspace-button { display: flex; min-width: 185px; height: 42px; align-items: center; gap: 9px; padding: 5px 11px 5px 6px; border: 1px solid var(--hub-border); border-radius: 7px; color: var(--hub-text); background: #fff; text-align: left; text-decoration: none; }
.workspace-button:hover { border-color: var(--hub-border-strong); background: var(--hub-subtle); color: var(--hub-text); }
.workspace-icon { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 6px; color: #223c60; background: var(--hub-blue-soft); font-size: .76rem; font-weight: 700; }
.workspace-copy { display: flex; min-width: 0; flex: 1; flex-direction: column; line-height: 1.1; }
.workspace-copy small { overflow: hidden; color: var(--hub-muted); font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy strong { overflow: hidden; margin-top: 2px; font-size: .78rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.workspace-button-empty { align-items: center; justify-content: center; color: var(--hub-blue-dark); font-size: .8rem; font-weight: 600; }
.hub-user-nav { flex-direction: row; }
.hub-user-button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; }
.hub-user-button.dropdown-toggle::after { display: none; }
.hub-user-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #3d4045; background: #ebecee; font-size: .9rem; font-weight: 700; }
.hub-auth-link { color: var(--hub-text); font-size: .85rem; }
.hub-dropdown-menu { padding: 6px; border: 1px solid var(--hub-border); border-radius: 8px; box-shadow: 0 10px 30px rgba(18,22,27, .1); }
.hub-dropdown-menu .dropdown-item { padding: 7px 9px; border-radius: 5px; font-size: .82rem; }
.hub-dropdown-menu .dropdown-item:hover, .hub-dropdown-menu .dropdown-item:focus { background: var(--hub-subtle); color: var(--hub-text); }

.hub-main-shell { width: 100%; max-width: none; margin: 0; padding: 28px var(--hub-page-gutter) 48px; }
.flush-route .hub-main-shell, .auth-route .hub-main-shell { max-width: none; padding: 0; }
.hub-flash-shell { width: 100%; max-width: none; margin: 18px 0 0; padding: 0 var(--hub-page-gutter); }
.hub-flash-shell + .hub-main-shell:not(:first-child) { padding-top: 18px; }
.hub-flash-shell .alert { margin: 0; padding: 14px 46px 14px 14px; border-radius: 7px; font-size: .82rem; }
.hub-flash-shell .alert + .alert { margin-top: 8px; }
.hub-flash-shell .btn-close { top: 50%; transform: translateY(-50%); padding: 14px; }
/* Flush-route views (platform console) render _FlashMessages inside their own
   content, below the page heading - it must flow in place there, not float
   fixed over the header. */
.platform-admin-content .hub-flash-shell { margin: 0 0 18px; padding: 0; }
.portal-eyebrow { margin: 0 0 6px; color: var(--hub-blue-dark); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; font-size: 1.75rem; font-weight: 650; letter-spacing: -.04em; }
.page-heading p:not(.portal-eyebrow) { margin: 7px 0 0; color: var(--hub-muted); }
.page-actions { display: flex; gap: 8px; }
.page-alert { margin-bottom: 16px; }

.btn { border-radius: 6px; font-size: .83rem; font-weight: 600; }

.btn-primary {
    --bs-btn-bg: var(--hub-blue);
    --bs-btn-border-color: var(--hub-blue);
    --bs-btn-hover-bg: var(--hub-blue-dark);
    --bs-btn-hover-border-color: var(--hub-blue-dark);
    --bs-btn-active-bg: #0645b5;
    --bs-btn-active-border-color: #0645b5;
    --bs-btn-disabled-bg: var(--hub-blue);
    --bs-btn-disabled-border-color: var(--hub-blue);
    --bs-btn-focus-shadow-rgb: 8, 102, 255;
    border-color: var(--hub-blue);
    background: var(--hub-blue);
}
.btn-primary:hover, .btn-primary:focus { border-color: var(--hub-blue-dark); background: var(--hub-blue-dark); }
.btn-outline-secondary { border-color: var(--hub-border-strong); color: #44474b; }
.btn-outline-secondary:hover { border-color: #aaadb2; color: var(--hub-text); background: var(--hub-subtle); }
.form-label { margin-bottom: 6px; color: #34373a; font-size: .77rem; font-weight: 600; }
.form-label span { color: #909397; font-weight: 400; }
.form-control, .form-select { min-height: 40px; border-color: var(--hub-border-strong); border-radius: 6px; font-size: .86rem; }
.form-control:focus, .form-select:focus { border-color: var(--hub-blue); box-shadow: 0 0 0 3px rgba(22,69,134, .1); }
.form-text, .field-note { color: var(--hub-muted); font-size: .73rem; }
.code-input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.65; }

.data-panel { overflow: hidden; border: 1px solid var(--hub-border); border-radius: 8px; background: #fff; }
.data-panel-header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--hub-border); }
.data-panel-header > div { display: flex; align-items: baseline; gap: 10px; }
.data-panel-header h2 { margin: 0; font-size: .95rem; font-weight: 650; }
.data-panel-header span, .data-panel-header p { margin: 0; color: var(--hub-muted); font-size: .75rem; }
.app-table { --bs-table-bg: #fff; }
.app-table thead th { padding: 11px 16px; border-bottom: 1px solid var(--hub-border); color: #75787d; background: #fafafb; font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.app-table tbody td { padding: 14px 16px; border-bottom-color: #edeef0; color: #484b50; font-size: .8rem; vertical-align: middle; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr.template-row { cursor: pointer; }
.app-table tbody tr.template-row:hover td { background: #f8f9fa; }
.app-table td strong { display: block; color: var(--hub-text); font-size: .85rem; font-weight: 600; }
.app-table td small { display: block; margin-top: 2px; color: var(--hub-muted); font-size: .69rem; text-transform: lowercase; }
.table-empty { padding: 50px 20px !important; color: var(--hub-muted) !important; text-align: center; }
.table-action { padding: 5px 8px; border: 0; color: var(--hub-blue-dark); background: transparent; font-size: .75rem; font-weight: 600; }
.table-action:hover { text-decoration: underline; }
.status-badge { display: inline-flex; padding: 3px 7px; border: 1px solid #dcdee1; border-radius: 999px; color: #595c61; background: #f5f5f6; font-size: .69rem; font-weight: 600; }
.status-approved { border-color: #c9d6e8; color: #173866; background: #edf2f8; }
.status-rejected, .status-disabled { border-color: #f0d0d0; color: #8b3535; background: #fff3f3; }
.status-pendingapproval { border-color: #eadbb2; color: #785b13; background: #fff9e9; }
.hub-dialog { border: 0; border-radius: 10px; box-shadow: 0 24px 70px rgba(20,24,30, .2); }
.hub-dialog .modal-header, .hub-dialog .modal-footer { border-color: var(--hub-border); padding: 16px 20px; }
.hub-dialog .modal-body { padding: 20px; }
.hub-confirmation-dialog .modal-footer { display: flex; gap: 10px; }
.hub-confirmation-dialog .modal-footer .btn { display: inline-flex; flex: 1; align-items: center; justify-content: center; margin: 0; }
.hub-confirmation-dialog #hubConfirmationMessage { font-size: .87rem; line-height: 1.6; }
.hub-dialog .modal-title { font-size: 1.1rem; font-weight: 650; }
/* When a form wraps modal-body + modal-footer it intercepts the flex column
   that modal-dialog-scrollable relies on, so the body never gets a height
   constraint and long content clips instead of scrolling. Join the form and
   its body to the flex layout so the body can shrink and scroll. */
.modal-dialog-scrollable form { display: flex; min-height: 0; flex: 1 1 auto; flex-direction: column; }
.modal-dialog-scrollable form .modal-body { min-height: 0; }

/* Settings and administration */
/* Identity supplies floating-label forms; keep them consistent with portal fields. */
.account-settings .form-floating { display: flex; flex-direction: column; }
.account-settings .form-floating > .form-control,
.account-settings .form-floating > .form-select { height: 40px; min-height: 40px; padding: .375rem .75rem; line-height: 1.5; }
.account-settings .form-floating > .form-select { padding-right: 2.25rem; }
.account-settings .form-floating > .form-control::placeholder { color: var(--bs-secondary-color); opacity: 1; }
.account-settings .form-floating > .form-control:focus,
.account-settings .form-floating > .form-control:not(:placeholder-shown),
.account-settings .form-floating > .form-control:-webkit-autofill { padding: .375rem .75rem; }
.account-settings .form-floating > :is(.form-control, .form-select) ~ label { position: static; order: -1; height: auto; margin-bottom: 6px; padding: 0; border: 0; color: #34373a; font-size: .77rem; font-weight: 600; white-space: normal; pointer-events: auto; transform: none; transition: none; }
.account-settings .form-floating > :is(.form-control, .form-select) ~ label::after { display: none; }
.account-settings .input-group { align-items: flex-end; }
.account-settings .input-group-text { min-height: 40px; }

/* Dedicated account cards avoid coupling email verification to floating input groups. */
.account-page { width: 100%; max-width: 880px; }
.account-page .page-heading p:not(.portal-eyebrow) { font-size: .86rem; line-height: 1.6; }
.account-card-title { margin: 0; font-size: .96rem; font-weight: 650; }
.account-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.account-field-heading .form-label { margin: 0; }
.account-card-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.account-card-heading > div { flex: 1; min-width: 0; }
.account-card-heading p, .account-card-description { margin: 6px 0 18px; color: var(--hub-muted); font-size: .83rem; line-height: 1.6; }
.account-card-heading p { margin-bottom: 0; }
.account-feature-icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 10px; color: var(--hub-blue-dark); background: var(--hub-blue-soft); font-size: 1.05rem; }
.account-feature-icon.is-danger { color: #a7333e; background: #fceef0; }
.account-steps { display: grid; gap: 16px; margin: 0 0 24px; padding-left: 24px; }
.account-steps li { padding-left: 5px; font-size: .83rem; }
.account-steps li::marker { color: var(--hub-blue-dark); font-weight: 650; }
.account-steps strong, .account-steps span { display: block; }
.account-steps span { margin-top: 4px; color: var(--hub-muted); line-height: 1.6; }
.account-card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-info-note { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--hub-border); border-radius: 8px; color: var(--hub-muted); font-size: .8rem; }
.account-info-note i { margin-top: 4px; }
.account-info-note p { margin: 0; line-height: 1.6; }
.account-info-note strong { color: var(--hub-text); }
.account-danger-card { border-color: #ebcdd1 !important; }
.account-danger-note { padding: 14px; margin-bottom: 20px; border-radius: 6px; color: #90303a; background: #fff5f6; font-size: .83rem; line-height: 1.6; }
.organization-switch { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 9px 14px; background: var(--hub-surface); white-space: nowrap; }
.row-icon-action { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--hub-border); border-radius: 6px; color: #595c61; background: var(--hub-surface); text-decoration: none; font-size: .9rem; vertical-align: middle; }
.row-icon-action:hover { border-color: var(--hub-border-strong); color: var(--hub-blue-dark); background: var(--hub-blue-soft); }
.row-icon-action:focus-visible { outline: 2px solid var(--hub-blue); outline-offset: 2px; }
.member-dialog-email { margin-bottom: 20px; font-size: .9rem; font-weight: 600; }
@media (max-width: 575.98px) {
    .account-card-heading { flex-wrap: wrap; }
    .account-card-heading > .settings-status { margin-left: 56px; }
    .account-card-actions { flex-direction: column; align-items: stretch; }
    .settings-heading .organization-switch { align-self: flex-start; }
}
.settings-page { width: 100%; max-width: none; margin: 0; }
.settings-page > .hub-flash-shell { margin: 0 0 18px; padding: 0; }
.settings-heading { align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--hub-border); }
.settings-heading .heading-meta { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.settings-grid { --bs-gutter-x: 20px; --bs-gutter-y: 20px; }
.settings-card { overflow: hidden; border: 1px solid var(--hub-border); border-radius: 8px; box-shadow: none; }
.settings-card > .card-header { min-height: 50px; padding: 13px 16px; border-bottom: 1px solid var(--hub-border); background: #fafafb; color: var(--hub-text); font-size: .84rem; font-weight: 650; }
.settings-card > .card-body { padding: 18px; }
.settings-card > .card-footer { padding: 14px 16px; border-top: 1px solid var(--hub-border); background: #fafafb; }
.settings-card p.text-muted { color: var(--hub-muted) !important; line-height: 1.55; }
.settings-card .table { --bs-table-bg: transparent; }
.settings-card .table thead th { padding: 9px 13px; color: #7d8084; background: #fafafb; font-size: .63rem; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; }
.settings-card .table tbody td { padding: 11px 13px; border-bottom-color: #edeef0; font-size: .76rem; }
.settings-card dl { font-size: .78rem; }
.settings-card dt { color: var(--hub-muted); font-weight: 500; }
.settings-card code, .one-time-secret code { color: #2e3846; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .73rem; }
.settings-section-note { margin: 0; color: var(--hub-muted); font-size: .73rem; }
.settings-empty { padding: 30px 18px !important; color: var(--hub-muted); text-align: center; font-size: .78rem; }
.settings-status { display: inline-flex; padding: 3px 7px; border-radius: 999px; color: #173866; background: var(--hub-blue-soft); font-size: .68rem; font-weight: 600; }
.settings-status.is-muted { color: #686b70; background: #eff0f1; }
.settings-status.is-warning { color: #775914; background: #fff4d9; }
.setup-empty { padding: 28px 20px; border: 1px dashed var(--hub-border-strong); border-radius: 8px; background: #fbfbfc; text-align: center; }
.setup-empty-title { margin: 0; color: var(--hub-text); font-size: .85rem; font-weight: 650; }
.one-time-secret { padding: 13px 15px; border: 1px solid #eadcad; border-radius: 7px; color: #574716; background: #fffaf0; font-size: .78rem; }
.one-time-secret strong { display: block; margin-bottom: 5px; }
.organization-table tbody tr:hover td { background: #f8f9fa; }
.organization-name { color: var(--hub-text); font-weight: 600; }
.connection-summary { display: grid; gap: 0; }
.connection-summary-row { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid #edeef0; font-size: .78rem; }
.connection-summary-row:last-child { border-bottom: 0; }
.connection-summary-row span:first-child { color: var(--hub-muted); }
.connection-summary-row strong { font-weight: 600; text-align: right; }
.platform-admin-layout { display: grid; min-height: calc(100vh - var(--hub-nav-height)); grid-template-columns: 220px minmax(0, 1fr); gap: 0; }
.platform-sidebar { position: sticky; top: var(--hub-nav-height); display: flex; height: calc(100vh - var(--hub-nav-height)); flex-direction: column; overflow: hidden; border: 0; border-right: 1px solid var(--hub-border); border-radius: 0; background: #fafafb; }
.platform-sidebar-heading { display: flex; flex-direction: column; padding: 18px 16px; border-bottom: 1px solid var(--hub-border); }
.platform-sidebar-heading span { color: var(--hub-blue-dark); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.platform-sidebar-heading strong { margin-top: 3px; font-size: .9rem; }
.platform-sidebar nav { display: flex; flex-direction: column; gap: 3px; padding: 9px; }
.platform-nav-label { margin: 14px 10px 4px; color: #96999d; font-size: .61rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.platform-nav-label:first-child { margin-top: 4px; }
.platform-nav-link { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 6px; color: #56595e; font-size: .77rem; font-weight: 550; text-decoration: none; }
.platform-nav-icon { width: 17px; flex: 0 0 17px; font-size: 15px; line-height: 1; text-align: center; }
.platform-nav-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.platform-nav-link:hover { color: var(--hub-text); background: #f0f1f2; }
.platform-nav-link.active { color: #15345f; background: var(--hub-blue-soft); }
.platform-sidebar-footer { margin-top: auto; padding: 9px; border-top: 1px solid var(--hub-border); }
.platform-admin-content { min-width: 0; padding: 28px var(--hub-page-gutter) 48px; }
.platform-toolbar { display: grid; max-width: 600px; grid-template-columns: minmax(240px, 1fr) auto; gap: 8px; margin: 0 0 16px; }
.platform-toolbar-wide { max-width: 820px; grid-template-columns: minmax(240px, 1fr) minmax(190px, 260px) auto; }
.platform-inline-form { padding: 14px 16px; border-bottom: 1px solid var(--hub-border); background: #fcfcfd; }
.member-organization-list { display: grid; gap: 7px; }
.member-organization-item { display: flex; align-items: center; gap: 9px; }
.member-organization-item > a { min-width: 130px; color: var(--hub-text); font-weight: 600; text-decoration: none; }
.member-organization-item > a:hover { color: var(--hub-blue); }
.member-organization-item form { margin-left: auto; }
.platform-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.platform-summary-grid > div { display: flex; min-height: 72px; flex-direction: column; justify-content: center; padding: 12px 15px; border: 1px solid var(--hub-border); border-radius: 7px; background: #fff; }
.platform-summary-grid span { color: var(--hub-muted); font-size: .68rem; }
.platform-summary-grid strong { margin-top: 4px; font-size: 1rem; font-weight: 650; }
.access-chip-list { display: flex; flex-wrap: wrap; gap: 4px; }
.access-chip-list form { display: inline; }
.access-chip { padding: 3px 6px; border: 1px solid #cfd7e3; border-radius: 999px; color: #1b3963; background: #eff3f8; font-size: .66rem; }
.access-chip span { margin-left: 3px; opacity: .7; }
.table-action-danger { color: #9c3434; }

@media (max-width: 991px) {
    .platform-admin-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 0; }
    .platform-sidebar { position: static; height: auto; }
    .platform-sidebar-heading { display: none; }
    .platform-sidebar nav { flex-direction: row; overflow-x: auto; }
    .platform-nav-label { display: none; }
    .platform-nav-link { flex: 0 0 auto; }
    .platform-sidebar-footer { display: none; }
    .platform-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .platform-admin-content { padding-top: 28px; }
}

@media (max-width: 767px) {
    .settings-heading { align-items: stretch; }
    .settings-heading .page-actions { width: 100%; }
    .settings-heading .page-actions .btn { flex: 1; }
    .platform-toolbar, .platform-toolbar-wide { max-width: none; grid-template-columns: 1fr; }
    .platform-summary-grid { grid-template-columns: 1fr 1fr; }
    .platform-admin-content { padding: 28px var(--hub-page-gutter) 36px; }
}

/* Developer console */
.api-console { display: grid; grid-template-columns: 230px minmax(360px, 1fr) minmax(370px, 430px); height: calc(100vh - var(--hub-nav-height)); min-height: 560px; margin: 0; overflow: hidden; background: #fff; }
.api-endpoints { min-height: 0; overflow-y: auto; border-right: 1px solid var(--hub-border); background: #fafafb; }
.api-sidebar-heading { padding: 24px 18px 18px; border-bottom: 1px solid var(--hub-border); }
.api-sidebar-heading h1 { margin: 0; font-size: 1.3rem; letter-spacing: -.03em; }
.api-sidebar-heading > span { display: block; overflow: hidden; margin-top: 5px; color: var(--hub-muted); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.api-endpoints nav { padding: 12px 9px; }
.api-nav-group { margin: 16px 9px 6px; color: #929599; font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.api-endpoint { display: grid; width: 100%; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 7px; padding: 8px 9px; border: 0; border-radius: 6px; color: #525559; background: transparent; text-align: left; }
.api-endpoint > span:last-child { overflow: hidden; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.api-endpoint:hover { background: #f0f1f2; }
.api-endpoint.active { color: var(--hub-text); background: #e9ebee; }
.method { display: inline-flex; width: fit-content; align-items: center; justify-content: center; padding: 3px 5px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .62rem; font-weight: 600; }
.method-post { color: #835613; background: #fff2d8; }
.method-get { color: #173763; background: #dde6f3; }
.method-put { color: #235c88; background: #e4f0fa; }
.method-ws { color: #4b45a8; background: #e9e7f9; }
.api-reference { min-width: 0; min-height: 0; padding: 34px clamp(24px, 4vw, 58px); overflow: auto; }
.api-reference-header { padding-bottom: 28px; border-bottom: 1px solid var(--hub-border); }
.api-reference-header h2 { margin: 12px 0 8px; font-size: 1.65rem; letter-spacing: -.04em; }
.api-reference-header p { max-width: 660px; color: var(--hub-muted); }
.api-reference-header > code { display: block; margin-top: 18px; padding: 10px 12px; border: 1px solid var(--hub-border); border-radius: 6px; color: #2f3237; background: #f7f7f8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.contract-section { padding: 26px 0 4px; }
.contract-section h3, .api-response h3 { margin: 0 0 8px; font-size: .9rem; font-weight: 650; }
.contract-section p { color: var(--hub-muted); font-size: .8rem; }
.api-fields { margin-top: 14px; color: var(--hub-text); font-size: .78rem; }
.api-fields th { color: #929599; font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.api-fields th, .api-fields td { padding: 6px 10px 6px 0; border-color: var(--hub-border); vertical-align: top; }
.api-example-label { margin: 16px 0 0; color: #929599; font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.api-example-label + .contract-code { margin-top: 7px; }
.api-example-picker { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.api-example-picker .api-example-label { margin: 0; }
.api-example-picker .form-select { width: auto; min-width: 190px; }
.contract-code, .response-code { max-height: 340px; overflow: auto; margin: 14px 0 0; padding: 14px; border: 1px solid #dfe1e3; border-radius: 6px; color: #2d3239; background: #f7f7f8; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; line-height: 1.65; white-space: pre-wrap; }
.api-try-panel { min-width: 0; min-height: 0; padding: 20px; border-left: 1px solid var(--hub-border); background: #fcfcfd; overflow: auto; }
.api-try-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.api-try-header > div { display: flex; flex-direction: column; }
.api-try-header span, .api-try-header strong { font-size: .72rem; }
.api-try-header strong { margin-top: 2px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 500; }
.api-alert { padding: 9px 11px; font-size: .76rem; }
.api-try-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--hub-border); }
.api-response { padding-top: 20px; }
.api-response > div { display: flex; align-items: center; justify-content: space-between; }
.api-response > div h3 { margin: 0; }
#responseStatus { color: var(--hub-muted); font-size: .68rem; }
#responseStatus.is-success { color: var(--hub-blue-dark); }
#responseStatus.is-error { color: #a23c3c; }
.response-code { min-height: 150px; max-height: 330px; color: #d9dde2; border-color: #282d35; background: #151a20; }

/* Authentication */
.auth-layout { display: grid; min-height: 100vh; grid-template-columns: minmax(420px, 1.12fr) minmax(420px, .88fr); background: #fff; }
.auth-brand-panel { position: relative; min-height: 100vh; overflow: hidden; border-right: 1px solid var(--hub-border); background: #f5f7fb; }
.auth-brand-panel::after { content: ""; position: absolute; inset: 0; background: rgba(248,249,250,.65); }
.auth-brand-copy { position: relative; z-index: 1; display: flex; height: 100%; max-width: 620px; min-height: 100vh; flex-direction: column; justify-content: space-between; padding: 48px clamp(36px, 6vw, 86px); }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--hub-text); font-size: .95rem; font-weight: 700; text-decoration: none; }
.auth-brand-copy h1 { max-width: 500px; margin: 10px 0 18px; font-size: clamp(2.5rem, 4vw, 4.3rem); font-weight: 600; letter-spacing: -.065em; line-height: .98; }
.auth-brand-copy p:not(.portal-eyebrow) { max-width: 430px; color: #585b60; font-size: 1rem; line-height: 1.65; }
.auth-brand-copy > small { color: #6d7074; font-size: .72rem; }
.auth-form-panel { display: grid; padding: 48px; place-items: center; background: #fff; }
.auth-form-wrap { width: min(100%, 390px); }
.auth-form-wrap h2 { margin: 0; font-size: 1.65rem; font-weight: 650; letter-spacing: -.04em; }
.auth-form-intro { margin: 8px 0 30px; color: var(--hub-muted); }
.auth-submit { margin-top: 4px; }
.auth-validation.validation-summary-valid { display: none; }
.auth-validation ul { margin: 0; padding: 0; list-style: none; }
.auth-validation li + li { margin-top: 6px; }
.auth-register { color: var(--hub-muted); font-size: .8rem; }
.auth-register a { font-weight: 600; }

/* Error pages */
.error-page { display: grid; min-height: 100vh; place-items: center; text-align: center; }
.error-page .error-code { margin: 0; color: var(--hub-border-strong); font-size: clamp(4.5rem, 12vw, 7.5rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.error-page h1 { margin: 6px 0 10px; font-size: 1.6rem; font-weight: 650; letter-spacing: -.04em; }
.error-page p:not(.error-code) { max-width: 420px; margin: 0 auto 26px; color: var(--hub-muted); }

@media (max-width: 1100px) {
    .api-console { grid-template-columns: 205px minmax(340px, 1fr); }
    .api-try-panel { grid-column: 1 / -1; border-top: 1px solid var(--hub-border); border-left: 0; }
}
@media (max-width: 991px) {
    .hub-navbar-shell { padding-inline: 10px; }
    .navbar-collapse { position: absolute; top: var(--hub-nav-height); right: 0; left: 0; padding: 10px; border-bottom: 1px solid var(--hub-border); background: #fff; }
    .hub-nav-list { height: auto; }
    .hub-nav-link { height: 42px; border: 0; }
    .hub-navbar-actions { width: 100%; align-items: center; flex-direction: row; gap: 8px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hub-border); }
    .hub-workspace-switcher { min-width: 0; flex: 1; }
    .workspace-button { width: 100%; min-width: 0; }
    .hub-auth-shell { flex: 0 0 auto; margin: 0; }
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
}
@media (max-width: 720px) {
    :root { --hub-page-gutter: 14px; }
    .hub-main-shell { padding: 20px var(--hub-page-gutter) 36px; }
    .hub-flash-shell { margin-top: 12px; padding-inline: var(--hub-page-gutter); }
    .hub-flash-shell + .hub-main-shell:not(:first-child) { padding-top: 14px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-actions { flex-wrap: wrap; }
    .api-console { display: block; height: auto; min-height: calc(100vh - var(--hub-nav-height)); margin: 0; overflow: visible; }
    .api-endpoints { border-right: 0; border-bottom: 1px solid var(--hub-border); }
    .api-reference, .api-try-panel { padding: 22px 16px; }
    .auth-form-panel { padding: 32px 22px; }
}

.console-row-actions { display: inline-flex; gap: 6px; white-space: nowrap; }
.row-icon-action-danger { color: #a7333e; }
.row-icon-action-danger:hover { color: #90303a; border-color: #ebcdd1; background: #fff5f6; }

/* App directory follows the same compact, neutral shell as the developer portal. */
.apps-page { max-width: 1500px; margin: 0 auto; }
.apps-heading { align-items: center; margin-bottom: 26px; }
.apps-heading h1 { font-size: 1.6rem; letter-spacing: -.02em; }
.apps-heading-actions { display: flex; align-items: center; gap: 16px; }
.apps-search { display: flex; align-items: center; gap: 10px; width: 376px; padding: 0 12px; height: 40px; background: #fff; border: 1px solid #ccd0d5; border-radius: 4px; color: #65717b; }
.apps-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: .86rem; }
.apps-search:focus-within { outline: 2px solid #0866ff; outline-offset: 2px; }
.apps-directory { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; gap: 16px; }
.apps-filter-panel, .apps-results-panel { border: 1px solid #dadde1; border-radius: 8px; background: #fff; box-shadow: 0 1px 3px rgba(28,43,51,.06); }
.apps-filter-panel { padding: 16px 8px; }
.apps-filter-panel h2 { margin: 0 8px 10px; font-size: .95rem; font-weight: 650; }
.apps-filter-panel label { display: flex; gap: 10px; align-items: center; padding: 11px 9px; margin: 0; font-size: .87rem; border-radius: 4px; cursor: pointer; }
.apps-filter-panel label:hover { background: #f0f2f5; }
.apps-filter-panel label:has(input:checked) { background: #e7f1ff; }
.apps-filter-panel input { width: 19px; height: 19px; accent-color: #0866ff; }
.apps-filter-panel p { margin: 18px 9px 0; font-size: .8rem; line-height: 1.6; color: var(--hub-muted); }
.apps-results-panel { padding: 18px 16px; }
.apps-results-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.apps-results-heading h2 { margin: 0; font-size: 1.12rem; font-weight: 650; }
.apps-results-heading span { color: var(--hub-muted); font-size: .8rem; }
.apps-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.workspace-card { display: flex; position: relative; min-width: 0; flex-direction: column; border: 1px solid #dadde1; border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.workspace-card:hover { border-color: #a9b4be; box-shadow: 0 2px 8px rgba(28,43,51,.08); }
.workspace-card[hidden], .apps-empty[hidden] { display: none; }
.workspace-card-main { display: flex; align-items: start; gap: 12px; min-height: 154px; padding: 16px; }
.workspace-card-main > div { min-width: 0; }
.app-card-icon { display: grid; place-items: center; flex: 0 0 54px; height: 54px; border-radius: 8px; background: #e7f1ff; color: #0866c6; font-size: 1.6rem; font-weight: 700; }
.workspace-card h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.workspace-card p { margin: 0 0 4px; font-size: .76rem; color: #46545e; }
.app-card-id { overflow-wrap: anywhere; }
.app-current-badge { margin: 0 16px 12px; align-self: start; color: #0866c6; background: #e7f1ff; border-radius: 4px; padding: 3px 7px; font-size: .7rem; }
.workspace-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 14px; margin-top: auto; border-top: 1px solid #edf0f2; font-size: .8rem; }
.workspace-card-footer small { color: #65717b; }
.workspace-card-footer a { color: #46545e; padding: 4px; }
.app-open-button { display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-top: 1px solid #edf0f2; padding: 12px 16px; border-radius: 0 0 8px 8px; background: #fff; color: #0866c6; font-size: .8rem; font-weight: 600; }
.app-open-button:hover { background: #f0f2f5; }
.app-open-button:disabled { color: #8a939b; cursor: not-allowed; }
.apps-empty { text-align: center; padding: 60px 20px; color: #65717b; }
.apps-empty > i { margin-bottom: 18px; font-size: 2rem; }
.apps-empty h3 { color: #1c2b33; font-size: 1.2rem; }
.app-team-panel { margin: 24px 0; }
.team-add-form { display: grid; grid-template-columns: minmax(180px, 1fr) 150px auto; gap: 12px; align-items: end; padding: 16px; border-bottom: 1px solid var(--hub-border); }
.team-add-form .form-text { grid-column: 1 / -1; margin: 0; }
.team-role-form { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.member-app-item { display: flex; gap: 8px; align-items: center; margin: 5px 0; }
@media (max-width: 1100px) { .apps-directory { grid-template-columns: 220px minmax(0,1fr); } }
@media (max-width: 767px) {
    .apps-heading { align-items: stretch; flex-direction: column; gap: 16px; }
    .apps-heading-actions { width: 100%; flex-wrap: wrap; }
    .apps-search { width: 100%; }
    .apps-directory { grid-template-columns: 1fr; }
    .apps-filter-panel { display: flex; flex-wrap: wrap; align-items: center; }
    .apps-filter-panel h2 { width: 100%; }
    .apps-filter-panel p { display: none; }
    .apps-card-grid { grid-template-columns: 1fr; }
    .team-add-form { grid-template-columns: 1fr; }
}

/* Blue branding also applies to Bootstrap components with their own default palette. */
.hub-body { --bs-primary-rgb: 8, 102, 255; --bs-link-color: #0756d8; --bs-link-hover-color: #0645b5; }
.btn-outline-primary { --bs-btn-color: var(--hub-blue); --bs-btn-border-color: var(--hub-blue); --bs-btn-hover-bg: var(--hub-blue); --bs-btn-hover-border-color: var(--hub-blue); --bs-btn-active-bg: var(--hub-blue-dark); --bs-btn-active-border-color: var(--hub-blue-dark); }
.form-check-input:checked { background-color: var(--hub-blue); border-color: var(--hub-blue); }
.form-check-input:focus { border-color: var(--hub-blue); box-shadow: 0 0 0 .25rem rgba(8,102,255,.18); }
.alert-success { --bs-alert-color: #164e99; --bs-alert-bg: #e7f1ff; --bs-alert-border-color: #c7ddff; --bs-alert-link-color: #0756d8; }
.text-success { color: var(--hub-blue-dark) !important; }

.public-page-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; font-size: .75rem; }
.auth-legal-links { margin-top: 28px; color: var(--hub-muted); }
.auth-legal-links a { color: inherit; text-decoration: none; }
.auth-legal-links a:hover { color: var(--hub-blue); text-decoration: underline; }
