/* ── AN-1020 install wizard ────────────────────────────────────────────
 *
 * Implements the Claude Design handoff `claudeDesigns/onboarding-flow-updates`
 * (S0 Welcome, S3 Goals v2, S4 Field Mapping, S5 First Chart).
 *
 * Token mapping (handoff --vz-* → repo tokens; values identical unless noted):
 *   green-500 #5de380 → --color-primary-500     green-700 #2f7240 → --color-primary-600
 *   green-100 #dff9e6 → --color-primary-200     grey-300  #e8e8e8 → --color-neutral-200
 *   grey-400  #dcdcdc → --color-neutral-300 (#D9D9D9, nearest)
 *   grey-500  #d0d0d0 → --color-neutral-400     grey-600  #a6a6a6 → --color-neutral-500
 *   grey-700  #686868 → --color-neutral-600     grey-800  #3e3e3e → --color-neutral-700
 *   grey-200  #f3f3f3 → --color-neutral-100 (#F6F6F6, nearest)
 *   fdfdfd           → --color-neutral-50       gold-700 → --color-warning-700
 *   blue-600         → --color-info-500
 * Only #22252b (the handoff's dark chrome / heading ink), the LinkedIn brand
 * blue and the two shadows have no repo token — scoped locals below.
 */

:root {
    /* The `font:` shorthand needs a real family — `inherit` is invalid there and
       silently drops the whole declaration (which is how every heading in this
       file first shipped at the browser default size). */
    --inst-font: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --inst-ink: #22252b; /* handoff dark chrome + heading ink — no repo token */
    --inst-on-brand: #1c2226; /* text on the green CTA */
    --inst-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
    --inst-rail-width: 312px;
}

body.inst-body {
    margin: 0;
    font-family: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-neutral-700);
    background: var(--color-neutral-100);
}

.inst-shell {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── app chrome (static during setup) ─────────────────────────────────── */

/* AN-1020 navbar unification: S3/S4/S5 now render the real app navbar
 * (public/views/partials/navbar.pug, shared with homeDashboard.pug) instead
 * of the dummy .inst-topbar mockup this used to style. .navbar/.dropdown/
 * .autocomplete-items/etc. all come from Bootstrap + antApp.css (already
 * loaded on both pages) — the only thing this page still needs to set is
 * that the navbar doesn't stretch or shrink inside .inst-shell's flex column.
 */
.inst-shell > nav.navbar {
    flex: none;
    /* Mirrors the two Bootstrap overrides antStyle.css applies on the
       dashboard (.navbar padding, .bg-dark background) without loading that
       whole legacy stylesheet here for two declarations. */
    align-content: center;
    padding-left: 10px;
    padding-bottom: 2px;
    padding-top: 2px;
    background-color: var(--color-neutral-800, #2A2A2A) !important;
}

/* ── rail + canvas ────────────────────────────────────────────────────── */

.inst-main {
    flex: 1;
    display: flex;
    min-height: 0;
}

.inst-rail {
    width: var(--inst-rail-width);
    flex: none;
    background: var(--color-neutral-50);
    border-right: 1px solid var(--color-neutral-200);
    display: flex;
    flex-direction: column;
    padding: 28px var(--space-24) 20px;
}

.inst-rail-title {
    font: 700 11px/1 var(--inst-font);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-neutral-500);
    margin-bottom: var(--space-16);
}

.inst-steps {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.inst-step {
    display: flex;
    gap: var(--space-12);
    align-items: center;
    padding: 9px 0;
}

.inst-step-marker {
    width: 24px;
    height: 24px;
    flex: none;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--color-neutral-300);
    color: var(--color-neutral-500);
    font: 600 12px/1 var(--inst-font);
}

.inst-step-label {
    font: 400 14px/1.3 var(--inst-font);
    color: var(--color-neutral-500);
}

.inst-step.is-done .inst-step-marker {
    background: var(--color-primary-500);
    border-color: var(--color-primary-500);
    color: var(--inst-on-brand);
}

.inst-step.is-done .inst-step-label {
    font-weight: 500;
    color: var(--color-neutral-600);
}

.inst-step.is-active .inst-step-marker {
    background: var(--inst-ink);
    border-color: var(--inst-ink);
    color: #fff;
    font-weight: 700;
}

.inst-step.is-active .inst-step-label {
    font-weight: 700;
    color: var(--inst-ink);
}

.inst-rail-spacer {
    flex: 1;
}

/* scan-progress card — indeterminate bar + stage label (spec T6: no %) */
.inst-scan-card {
    background: rgba(93, 227, 128, 0.12);
    border: 1px solid rgba(93, 227, 128, 0.3);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.inst-scan-card[hidden] {
    display: none;
}

.inst-scan-head {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    margin-bottom: 10px;
    font: 700 13px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-scan-head .bi {
    color: var(--color-primary-600);
    font-size: 16px;
}

.inst-scan-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(93, 227, 128, 0.25);
    overflow: hidden;
    margin-bottom: var(--space-8);
}

.inst-scan-bar-fill {
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: var(--color-primary-500);
    animation: inst-indeterminate 1.6s ease-in-out infinite;
}

@keyframes inst-indeterminate {
    0% {
        margin-left: -40%;
    }
    100% {
        margin-left: 100%;
    }
}

.inst-scan-stage {
    font: 400 12px/17px var(--inst-font);
    color: var(--color-neutral-600);
    margin: 0;
}

.inst-scan-card.is-done .inst-scan-bar {
    display: none;
}

@keyframes inst-spin {
    to {
        transform: rotate(360deg);
    }
}

.inst-spin {
    animation: inst-spin 1.1s linear infinite;
    display: inline-block;
}

/* ── canvas ───────────────────────────────────────────────────────────── */

.inst-canvas {
    flex: 1;
    overflow: auto;
}

.inst-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px var(--space-32) 56px;
    display: flex;
    flex-direction: column;
}

.inst-page--narrow {
    max-width: 600px;
}

.inst-page--wide {
    max-width: 760px;
}

.inst-h2 {
    margin: 0;
    font: 600 28px/34px var(--inst-font);
    color: var(--inst-ink);
    letter-spacing: -0.01em;
}

.inst-sub {
    margin: 6px 0 22px;
    font: 400 15px/23px var(--inst-font);
    color: var(--color-neutral-600);
}

.inst-inline-error {
    margin-top: var(--space-12);
    background: rgba(245, 93, 123, 0.1);
    border: 1px solid rgba(245, 93, 123, 0.3);
    border-radius: var(--radius-md);
    padding: 10px var(--space-12);
    font: 400 13px/19px var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-inline-error[hidden] {
    display: none;
}

/* ── buttons ──────────────────────────────────────────────────────────── */

.inst-btn-primary {
    background: var(--color-primary-500);
    border: 2px solid var(--color-primary-500);
    color: var(--inst-on-brand);
    border-radius: var(--radius-md);
    padding: 13px 26px;
    font: 600 15px/1 var(--inst-font);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-8);
    transition: background 0.15s, border-color 0.15s;
}

.inst-btn-primary:hover:not(:disabled) {
    background: #3fc764;
    border-color: #3fc764;
}

.inst-btn-primary:disabled {
    background: var(--color-primary-200);
    border-color: var(--color-primary-200);
    color: #8fbf9e;
    cursor: default;
}

.inst-btn-ghost {
    background: transparent;
    border: none;
    color: var(--color-neutral-600);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font: 600 14px/1 var(--inst-font);
    cursor: pointer;
    transition: background 0.15s;
}

.inst-btn-ghost:hover {
    background: var(--color-neutral-100);
}

.inst-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: var(--space-24);
}

.inst-actions-note {
    font: 400 13px/1 var(--inst-font);
    color: var(--color-neutral-500);
}

/* ── S3: goal cards ──────────────────────────────────────────────────── */

.inst-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inst-card {
    background: var(--color-neutral-50);
    border: 1.5px solid var(--color-neutral-400);
    border-radius: var(--radius-lg);
    box-shadow: var(--inst-shadow-sm);
    overflow: hidden;
    transition: border-color 0.15s;
}

.inst-card:hover,
.inst-card.is-selected {
    border-color: var(--color-primary-500);
}

.inst-card-row {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
}

.inst-check {
    width: 24px;
    height: 24px;
    flex: none;
    border-radius: 999px;
    border: 1.5px solid #c4c4c4;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--inst-on-brand);
}

.inst-check .bi {
    font-size: 14px;
    display: none;
}

.inst-card.is-selected .inst-check {
    border-color: var(--color-primary-500);
    background: var(--color-primary-500);
}

.inst-card.is-selected .inst-check .bi {
    display: block;
}

.inst-card-icon {
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.inst-card-icon--build {
    background: rgba(8, 169, 204, 0.12);
    color: var(--color-info-500);
}

.inst-card-icon--linkedin {
    background: rgba(10, 102, 194, 0.12);
    color: #0a66c2; /* LinkedIn brand blue — no repo token */
}

.inst-card-icon--analyze {
    background: rgba(246, 174, 45, 0.14);
    color: #c98a12;
}

.inst-card-text {
    flex: 1;
    min-width: 0;
}

.inst-card-text h3 {
    margin: 0 0 3px;
    font: 700 16px/1.3 var(--inst-font);
    color: var(--inst-ink);
}

.inst-card-text p {
    margin: 0;
    font: 400 13px/19px var(--inst-font);
    color: var(--color-neutral-600);
}

/* Preview tile. The handoff leaves these as image slots ("Org chart
   screenshot"), so this is a token-styled placeholder until real screenshots
   are supplied. */
.inst-card-preview {
    position: relative;
    width: 190px;
    height: 112px;
    flex: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-neutral-200);
    background: var(--color-neutral-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-neutral-400);
    font-size: 26px;
}

/* The screenshot covers the icon rather than replacing it, so the icon stays
   available as the fallback when img.onerror removes this element. */
.inst-card-preview-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 980px) {
    .inst-card-preview {
        display: none;
    }
}

/* nested extension promo */
.inst-ext {
    border-top: 1px solid rgba(93, 227, 128, 0.3);
    background: rgba(93, 227, 128, 0.12);
    animation: inst-slide 0.28s ease-out;
}

.inst-ext[hidden],
.inst-ext-pane[hidden] {
    display: none;
}

@keyframes inst-slide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.inst-ext-pane {
    padding: 22px var(--space-24) var(--space-24);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.inst-ext h3 {
    margin: 0;
    font: 700 18px/24px var(--inst-font);
    color: var(--inst-ink);
}

.inst-ext p {
    margin: 0;
    font: 400 13px/19px var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-ext-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 2px;
}

.inst-ext-note {
    font: 400 12px/1 var(--inst-font);
    color: var(--color-neutral-500);
}

.inst-ext-steps {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.inst-ext-step {
    display: flex;
    gap: var(--space-12);
    align-items: flex-start;
    font: 400 14px/22px var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-ext-step > span:first-child {
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 999px;
    background: #fff;
    border: 1.5px solid var(--color-primary-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 12px/1 var(--inst-font);
    color: var(--color-primary-600);
}

.inst-ext-listen {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 500 13px/19px var(--inst-font);
    color: var(--color-neutral-600);
}

@keyframes inst-listen {
    0%,
    100% {
        opacity: 0.25;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.inst-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--color-primary-500);
    display: inline-block;
    animation: inst-listen 1.4s ease-in-out infinite;
}

.inst-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.inst-dot:nth-child(3) {
    animation-delay: 0.4s;
}

.inst-ext-foot {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 2px;
}

.inst-ext-foot a {
    font: 400 13px/1 var(--inst-font);
    color: var(--color-neutral-500);
    text-decoration: none;
    cursor: pointer;
}

.inst-ext-foot a:hover {
    text-decoration: underline;
}

.inst-ext-foot .inst-spacer {
    flex: 1;
}

/* ── S4: field-mapping rows ──────────────────────────────────────────── */

.inst-field-row {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--inst-shadow-sm);
    padding: 18px 20px;
}

.inst-field-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inst-field-icon {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    background: rgba(8, 169, 204, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: var(--color-info-500);
}

.inst-field-label {
    flex: 1 1 130px;
    min-width: 0;
}

.inst-field-label > div:first-child {
    font: 700 15px/1.3 var(--inst-font);
    color: var(--inst-ink);
}

.inst-field-label > div:last-child {
    font: 400 12px/1.4 var(--inst-font);
    color: var(--color-neutral-500);
}

.inst-field-arrow {
    color: var(--color-neutral-400);
    font-size: 16px;
    flex: none;
}

.inst-field-pill {
    width: 88px;
    flex: none;
    display: flex;
    justify-content: flex-end;
}

.inst-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 4px 10px;
    font: 500 12px/1.4 var(--inst-font);
}

.inst-pill[hidden] {
    display: none;
}

.inst-pill--changed {
    background: var(--color-neutral-100);
    border: 1px solid var(--color-neutral-200);
    color: var(--color-neutral-600);
}

.inst-field-select {
    /* Give the CRM-field column roughly twice the label column so long custom
       field names ("Position (long custom field name)") are not truncated. */
    flex: 2 1 260px;
    min-width: 220px;
}

.inst-field-select > div:first-child {
    font: 400 11px/1.4 var(--inst-font);
    color: var(--color-neutral-500);
    margin-bottom: var(--space-4);
}

.inst-select-wrap {
    position: relative;
}

.inst-select-wrap select {
    width: 100%;
    appearance: none;
    background: #fff;
    border: 1px solid var(--color-neutral-400);
    border-radius: var(--radius-md);
    padding: 9px 34px 9px var(--space-12);
    font: 500 14px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.inst-select-wrap select:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(93, 227, 128, 0.35);
    outline: none;
}

.inst-select-wrap .bi-chevron-down {
    position: absolute;
    right: var(--space-12);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-neutral-500);
    font-size: 12px;
    pointer-events: none;
}

.inst-field-static {
    flex: 1;
    min-width: 0;
    font: 500 14px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-hint {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    margin-top: 14px;
    color: var(--color-neutral-500);
    font: 400 13px/19px var(--inst-font);
}

.inst-hint .bi {
    margin-top: 2px;
    font-size: 13px;
}

/* ── S5: account picker ──────────────────────────────────────────────── */

.inst-search-wrap {
    position: relative;
}

/* S5 search = the navbar's autocomplete component. Everything visual — the
   .autocomplete-items dropdown, its rows, the matched-substring highlight and
   the dark-mode variants — comes from antApp.css, which install.pug loads. Only
   the input chrome is restyled: #autocomplete is drawn for the dark navbar,
   where a borderless white pill reads fine, and this canvas is light. */
/* Deliberately NOT a flex row: autocomplete.js sets
   `searchEle.parentElement.style.display = 'block'` inline every time it opens
   the panel, and an inline style beats any rule here — the icon would drop onto
   its own line. Absolute-positioning it over a padded full-width input is
   immune to that. */
.inst-page #autocomplete {
    border: 1px solid var(--color-neutral-400);
    border-radius: var(--radius-md);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.inst-page #autocomplete:focus-within {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(93, 227, 128, 0.35);
}

.inst-page #autocomplete > .bi-search {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
    color: var(--color-neutral-500);
    font-size: 16px;
    pointer-events: none;
}

.inst-page #autocomplete > input {
    width: 100%;
    border: none;
    outline: none;
    padding: 13px var(--space-12) 13px 40px;
    font: 400 15px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
    background: transparent;
}

.inst-page #autocomplete > input:focus {
    border: none;
    box-shadow: none;
}

.inst-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.inst-section-head h3 {
    margin: 0;
    font: 700 13px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-section-head span {
    flex: 1;
    height: 1px;
    background: var(--color-neutral-200);
}

.inst-criteria {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex-wrap: wrap;
    margin-top: 10px;
    font: 400 12px/1.4 var(--inst-font);
    color: var(--color-neutral-500);
}

.inst-criteria-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--color-neutral-200);
    border-radius: 999px;
    padding: 4px 11px;
    font: 500 12px/1.4 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-criteria-chip .bi {
    font-size: 12px;
    color: var(--color-neutral-500);
}

.inst-accounts {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    margin-top: 6px;
}

.inst-account {
    background: var(--color-neutral-50);
    border: 1.5px solid var(--color-neutral-400);
    border-radius: var(--radius-lg);
    box-shadow: var(--inst-shadow-sm);
    padding: var(--space-16) 18px;
    cursor: pointer;
    transition: border-color 0.15s;
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
    width: 100%;
    text-align: left;
}

.inst-account:hover {
    border-color: var(--color-primary-500);
}

.inst-account:hover .inst-account-chev {
    color: var(--inst-ink);
}

.inst-account.is-best {
    border-color: var(--color-primary-500);
}

.inst-account-head {
    display: flex;
    align-items: center;
    gap: 14px;
}

.inst-account-rank {
    width: 26px;
    flex: none;
    text-align: center;
    font: 700 15px/1 var(--inst-font);
    color: var(--color-neutral-400);
}

.inst-account-initial {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 10px;
    background: #eef1f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 17px/1 var(--inst-font);
    color: var(--color-neutral-600);
}

.inst-account-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.inst-account-name h3 {
    margin: 0;
    font: 700 17px/1.3 var(--inst-font);
    color: var(--inst-ink);
}

.inst-badge-best {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-primary-500);
    color: var(--inst-on-brand);
    border-radius: 999px;
    padding: 2px 9px;
    font: 700 11px/1.4 var(--inst-font);
    flex: none;
}

.inst-badge-best .bi {
    font-size: 10px;
}

/* Rung-5 company-chart cards (D15/D34): neutral counterpart to the brand
   "Best pick" badge — an existing team chart, not a CRM prospect. */
.inst-badge-team {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-neutral-100);
    color: var(--color-neutral-700);
    border: 1px solid var(--color-neutral-200);
    border-radius: 999px;
    padding: 2px 9px;
    font: 700 11px/1.4 var(--inst-font);
    flex: none;
}

.inst-badge-team .bi {
    font-size: 10px;
}

.inst-account-chev {
    color: var(--color-neutral-300);
    font-size: 18px;
    flex: none;
    transition: color 0.15s;
}

.inst-account-metrics {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    flex-wrap: wrap;
    padding-left: 40px;
}

.inst-metric {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-neutral-100);
    border-radius: 999px;
    padding: 4px 11px;
    font: 500 13px/1.4 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-metric .bi {
    font-size: 13px;
    color: var(--color-neutral-500);
}

.inst-empty-state {
    font: 400 13px/1.5 var(--inst-font);
    color: var(--color-neutral-500);
    text-align: center;
    padding: var(--space-24) 0;
}

.inst-demo-escape {
    display: inline-block;
    margin-top: var(--space-8);
    font-size: 13px;
    color: var(--color-info-500);
}

.inst-loading-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    padding: var(--space-16) 0;
}

.inst-loading-label {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font: 400 13px/1.4 var(--inst-font);
    color: var(--color-neutral-600);
    margin: 0;
}

.inst-tou-note {
    margin: 0;
    font: 400 12px/18px var(--inst-font);
    color: var(--color-neutral-500);
    text-align: center;
}

.inst-tou-note a {
    color: var(--color-neutral-600);
    text-decoration: underline;
}

/* ── responsive ───────────────────────────────────────────────────────── */

@media (max-width: 860px) {
    .inst-rail {
        display: none;
    }
    .inst-page {
        padding: var(--space-32) 20px 48px;
    }
    .inst-field-inner {
        flex-wrap: wrap;
    }
}

/* ── dark mode ────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    body.inst-body {
        color: var(--color-neutral-200);
        background: var(--color-neutral-800);
    }
    .inst-rail {
        background: var(--color-neutral-800);
        border-right-color: var(--color-neutral-700);
    }
    .inst-step.is-active .inst-step-marker {
        background: var(--color-neutral-50);
        border-color: var(--color-neutral-50);
        color: var(--inst-ink);
    }
    .inst-step.is-active .inst-step-label,
    .inst-h2,
    .inst-card-text h3,
    .inst-ext h3,
    .inst-account-name h3,
    .inst-field-label > div:first-child {
        color: var(--color-neutral-50);
    }
    .inst-card,
    .inst-field-row,
    .inst-account,
    .inst-page #autocomplete,
    .inst-select-wrap select,
    .inst-criteria-chip {
        background: var(--color-neutral-700);
        border-color: var(--color-neutral-600);
    }
    .inst-card-text p,
    .inst-sub,
    .inst-ext p,
    .inst-metric,
    .inst-page #autocomplete > input,
    .inst-select-wrap select,
    .inst-criteria-chip {
        color: var(--color-neutral-200);
    }
    .inst-check {
        background: var(--color-neutral-800);
        border-color: var(--color-neutral-600);
    }
    .inst-card-preview,
    .inst-metric,
    .inst-pill--changed {
        background: var(--color-neutral-800);
        border-color: var(--color-neutral-600);
    }
    .inst-btn-ghost {
        background: var(--color-neutral-700);
        color: var(--color-neutral-200);
        border-color: var(--color-neutral-600);
    }
    .inst-btn-ghost:hover {
        background: var(--color-neutral-600);
    }
    .inst-account-initial {
        background: var(--color-neutral-600);
        color: var(--color-neutral-100);
    }
    .inst-badge-team {
        background: var(--color-neutral-800);
        border-color: var(--color-neutral-600);
        color: var(--color-neutral-200);
    }
    /* S1 connect card + S3 waiting pane: the numbered-step labels are
       neutral-700 in light mode — identical to the dark card background,
       i.e. invisible without this override. */
    .inst-ext-step {
        color: var(--color-neutral-200);
    }
    .inst-ext-step > span:first-child {
        background: var(--color-neutral-800);
    }
    .inst-ext-note {
        color: var(--color-neutral-300);
    }
    /* S5: "Suggested accounts" heading is neutral-700 → dark-on-dark. */
    .inst-section-head h3 {
        color: var(--color-neutral-200);
    }
    .inst-section-head span {
        background: var(--color-neutral-600);
    }
    /* S1's ToU footnote — neutral-500 is too dim on the dark canvas. */
    .inst-tou-note {
        color: var(--color-neutral-400);
    }
    .inst-tou-note a {
        color: var(--color-neutral-300);
    }
    /* Scan widget (rail) + S5 loading row: heading/stage were neutral-700/600
       — invisible or dim on the dark translucent-green card. */
    .inst-scan-head {
        color: var(--color-neutral-100);
    }
    .inst-scan-stage,
    .inst-loading-label {
        color: var(--color-neutral-300);
    }
}

/* ── S2: secure your account ─────────────────────────────────────────── */

.inst-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.inst-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inst-label {
    font: 600 13px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
}

.inst-input {
    width: 100%;
    background: #fff;
    border: 1px solid var(--color-neutral-400);
    border-radius: var(--radius-md);
    padding: 11px var(--space-12);
    font: 400 15px/1.3 var(--inst-font);
    color: var(--color-neutral-700);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.inst-input:focus {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(93, 227, 128, 0.35);
    outline: none;
}

.inst-input[readonly] {
    background: var(--color-neutral-100);
    color: var(--color-neutral-600);
    cursor: default;
}

.inst-field-hint {
    margin: 0;
    font: 400 12px/18px var(--inst-font);
    color: var(--color-neutral-500);
}

.inst-field-hint[hidden] {
    display: none;
}

.inst-strength {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 2px;
}

.inst-strength-bar {
    height: 4px;
    border-radius: 999px;
    background: var(--color-neutral-200);
    overflow: hidden;
}

.inst-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--color-neutral-400);
    transition: width 0.2s ease-out, background 0.2s;
}

.inst-strength-fill[data-score='1'] {
    background: var(--color-error-500, #f55d7b);
}

.inst-strength-fill[data-score='2'] {
    background: var(--color-warning-500);
}

.inst-strength-fill[data-score='3'],
.inst-strength-fill[data-score='4'] {
    background: var(--color-primary-500);
}

.inst-strength-label {
    font: 400 12px/18px var(--inst-font);
    color: var(--color-neutral-500);
}

@media (prefers-color-scheme: dark) {
    .inst-input {
        background: var(--color-neutral-700);
        border-color: var(--color-neutral-600);
        color: var(--color-neutral-200);
    }
    .inst-input[readonly] {
        background: var(--color-neutral-800);
        color: var(--color-neutral-400);
    }
    .inst-label {
        color: var(--color-neutral-200);
    }
}

/* ── S1: connecting (page behind the CRM popup) ───────────────────────── */

.inst-connect-card {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--inst-shadow-sm);
    padding: var(--space-24);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.inst-connect-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 600 14px/1.4 var(--inst-font);
    color: var(--color-neutral-700);
}

@media (prefers-color-scheme: dark) {
    .inst-connect-card {
        background: var(--color-neutral-700);
        border-color: var(--color-neutral-600);
    }
    .inst-connect-status {
        color: var(--color-neutral-200);
    }
}
