.connections-page {
    max-width: 1180px;
    padding-bottom: 72px;
}

.mobile-back-link {
    color: #b0a6b3;
    font-size: 0.7rem;
    font-weight: 750;
    text-decoration: none;
}

.connections-header,
.section-heading,
.proof-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
}

.connections-header {
    margin-bottom: 22px;
}

.connections-header h1 {
    max-width: 690px;
    margin: 7px 0 7px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.connections-header p,
.card-heading p,
.external-copy p,
.proof-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.55;
}

.connections-header p {
    max-width: 650px;
}

.connection-state {
    display: inline-flex;
    min-height: 38px;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid #3b3040;
    border-radius: 999px;
    color: #a59ca8;
    background: rgba(19, 15, 21, 0.92);
    font-size: 0.66rem;
    font-weight: 800;
}

.connection-state i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #756c78;
}

.connection-state.connected {
    color: #75e4bd;
    border-color: rgba(56, 211, 159, 0.35);
    background: rgba(56, 211, 159, 0.09);
}

.connection-state.connected i {
    background: var(--success);
    box-shadow: 0 0 0 5px rgba(56, 211, 159, 0.1);
}

.connection-state.error {
    color: #ff9ca4;
    border-color: rgba(255, 107, 118, 0.35);
    background: rgba(255, 107, 118, 0.08);
}

.connection-state.error i {
    background: var(--danger);
}

.connection-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(21, 17, 22, 0.86);
}

.connection-overview article {
    display: grid;
    gap: 3px;
    min-height: 86px;
    align-content: center;
    padding: 16px 20px;
    border-right: 1px solid var(--border);
}

.connection-overview article:last-child {
    border-right: 0;
}

.connection-overview span,
.connection-overview small {
    color: #7d7481;
    font-size: 0.61rem;
}

.connection-overview span {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.connection-overview strong {
    font-size: 0.88rem;
}

.connection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.connection-card,
.shared-section,
.connection-proof,
.external-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(29, 22, 33, 0.98), rgba(19, 15, 21, 0.98));
    box-shadow: var(--shadow);
}

.connection-card {
    padding: 24px;
}

.card-heading,
.external-copy {
    display: flex;
    gap: 14px;
}

.card-number {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border: 1px solid #66438a;
    border-radius: 11px;
    color: #d0adf7;
    background: rgba(139, 92, 246, 0.13);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.67rem;
    font-weight: 800;
}

.card-kicker {
    display: block;
    margin: 1px 0 4px;
    color: #a97aeb;
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.13em;
}

.card-heading h2,
.external-copy h2,
.section-heading h2,
.proof-heading h2 {
    margin: 0 0 7px;
    font-size: 1.05rem;
    letter-spacing: -0.025em;
}

.connection-form {
    display: grid;
    gap: 14px;
    margin-top: 23px;
}

.form-columns {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
    gap: 12px;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field > span,
.token-result > label,
.scope-picker legend {
    color: #d8d1dc;
    font-size: 0.66rem;
    font-weight: 750;
}

.form-field input,
.form-field textarea,
.token-result textarea {
    width: 100%;
    border: 1px solid #433449;
    border-radius: 10px;
    outline: none;
    color: #f5f1f6;
    background: #110e13;
    font-size: 0.72rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-field input {
    height: 43px;
    padding: 0 12px;
}

.form-field textarea,
.token-result textarea {
    min-height: 80px;
    padding: 11px 12px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.5;
}

.form-field input:focus,
.form-field textarea:focus,
.token-result textarea:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.11);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #665e69;
}

.scope-picker {
    display: grid;
    gap: 8px;
    margin: 1px 0 0;
    padding: 0;
    border: 0;
}

.scope-picker legend {
    margin-bottom: 8px;
}

.scope-option {
    position: relative;
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid #3a2d40;
    border-radius: 11px;
    background: rgba(13, 10, 15, 0.58);
    cursor: pointer;
}

.scope-option:has(input:checked) {
    border-color: #66438a;
    background: rgba(139, 92, 246, 0.08);
}

.scope-option input {
    position: absolute;
    opacity: 0;
}

.scope-check {
    display: grid;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    place-items: center;
    border: 1px solid #534559;
    border-radius: 7px;
    color: transparent;
    background: #171219;
    font-size: 0.68rem;
}

.scope-option input:checked + .scope-check {
    color: white;
    border-color: var(--primary);
    background: var(--primary);
}

.scope-option strong,
.scope-option small {
    display: block;
}

.scope-option strong {
    margin-bottom: 3px;
    font-size: 0.7rem;
}

.scope-option small {
    color: #8d838f;
    font-size: 0.61rem;
    line-height: 1.35;
}

.full-button {
    width: 100%;
    justify-content: center;
    margin-top: 1px;
}

.security-note,
.external-note {
    margin: -3px 0 0;
    color: #786f7b;
    font-size: 0.59rem;
    line-height: 1.45;
    text-align: center;
}

.security-note span {
    color: #b17cea;
}

.external-guidance {
    margin-top: 12px;
}

.external-guidance strong {
    color: #c8b4d3;
}

.token-result {
    display: grid;
    gap: 10px;
    margin-top: 17px;
    padding: 15px;
    border: 1px solid rgba(56, 211, 159, 0.3);
    border-radius: 13px;
    background: rgba(56, 211, 159, 0.055);
}

.token-result[hidden] {
    display: none;
}

.result-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-title strong,
.result-title small {
    display: block;
}

.result-title strong {
    font-size: 0.72rem;
}

.result-title small {
    margin-top: 2px;
    color: #86ae9f;
    font-size: 0.59rem;
}

.success-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    color: #071a13;
    background: var(--success);
    font-size: 0.7rem;
    font-weight: 900;
}

.token-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.secondary-action {
    min-height: 37px;
    padding: 0 12px;
    border: 1px solid #563e62;
    border-radius: 9px;
    color: #d8cce0;
    background: #1b151e;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 750;
}

.secondary-action:hover {
    color: white;
    border-color: #8357a4;
    background: #281c30;
}

.compact-button {
    min-height: 37px;
    margin-left: auto;
    padding: 0 13px;
}

.inline-result {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 15px;
    padding: 11px 12px;
    border: 1px solid #352b39;
    border-radius: 10px;
    color: #948a97;
    background: rgba(12, 10, 14, 0.55);
}

.inline-result > span {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border-radius: 50%;
    color: #c9b0e8;
    background: rgba(139, 92, 246, 0.16);
    font-size: 0.62rem;
    font-weight: 850;
}

.inline-result p {
    margin: 1px 0 0;
    font-size: 0.64rem;
    line-height: 1.45;
}

.inline-result.success {
    color: #80cbb0;
    border-color: rgba(56, 211, 159, 0.3);
    background: rgba(56, 211, 159, 0.06);
}

.inline-result.success > span {
    color: #071a13;
    background: var(--success);
}

.inline-result.error {
    color: #e59ba2;
    border-color: rgba(255, 107, 118, 0.3);
    background: rgba(255, 107, 118, 0.06);
}

.inline-result.error > span {
    color: white;
    background: var(--danger);
}

.shared-section,
.connection-proof,
.external-card {
    margin-top: 16px;
    padding: 24px;
}

.section-heading {
    align-items: center;
    margin-bottom: 18px;
}

.section-heading h2,
.proof-heading h2 {
    margin-top: 5px;
    margin-bottom: 0;
}

.limited-badge,
.proof-status {
    padding: 7px 10px;
    border: 1px solid #523d5d;
    border-radius: 999px;
    color: #bfa7cb;
    background: #1c151f;
    font-size: 0.59rem;
    font-weight: 800;
}

.shared-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.share-card {
    display: flex;
    gap: 15px;
    padding: 18px;
    border: 1px solid #3e3044;
    border-radius: 14px;
    background: #120f14;
}

.share-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    color: #d6b2ff;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.28), rgba(109, 40, 217, 0.11));
    font-size: 1rem;
}

.method-label {
    display: inline-flex;
    padding: 4px 6px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.54rem;
    font-weight: 900;
}

.method-label.get {
    color: #6ce1b7;
    background: rgba(56, 211, 159, 0.1);
}

.method-label.post {
    color: #d1b0ff;
    background: rgba(139, 92, 246, 0.15);
}

.share-content h3 {
    margin: 9px 0 5px;
    font-size: 0.86rem;
}

.share-content p {
    margin: 0 0 11px;
    color: #958b98;
    font-size: 0.65rem;
    line-height: 1.48;
}

.share-content code {
    display: block;
    margin-bottom: 8px;
    color: #cbb5dd;
    font-size: 0.64rem;
}

.share-content small {
    color: #756d78;
    font-size: 0.58rem;
    line-height: 1.4;
}

.share-content small strong {
    color: #d0c5d3;
}

.connection-proof {
    border-color: #533768;
    background:
        radial-gradient(circle at 95% 0, rgba(139, 92, 246, 0.18), transparent 21rem),
        linear-gradient(145deg, #1c1520, #120e15);
}

.proof-heading {
    align-items: center;
}

.proof-heading p {
    margin-top: 6px;
}

.proof-status.success {
    color: #6fe0b7;
    border-color: rgba(56, 211, 159, 0.35);
    background: rgba(56, 211, 159, 0.08);
}

.proof-status.error {
    color: #ff939c;
    border-color: rgba(255, 107, 118, 0.35);
    background: rgba(255, 107, 118, 0.08);
}

.proof-checks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-top: 20px;
}

.proof-check {
    display: flex;
    min-height: 67px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #3d3042;
    border-radius: 11px;
    background: rgba(10, 8, 11, 0.52);
}

.proof-check i {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    border-radius: 50%;
    color: #827887;
    background: #29222c;
    font-style: normal;
    font-size: 0.6rem;
    font-weight: 850;
}

.proof-check strong,
.proof-check small {
    display: block;
}

.proof-check strong {
    font-size: 0.64rem;
}

.proof-check small {
    margin-top: 3px;
    color: #817784;
    font-size: 0.56rem;
}

.proof-check.success {
    border-color: rgba(56, 211, 159, 0.3);
}

.proof-check.success i {
    color: #071a13;
    background: var(--success);
}

.proof-check.denied {
    opacity: 0.7;
}

.proof-check.denied i,
.proof-check.error i {
    color: white;
    background: var(--danger);
}

.proof-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 15px 0 0;
}

.proof-details[hidden] {
    display: none;
}

.proof-details div {
    padding: 10px 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
}

.proof-details dt {
    margin-bottom: 3px;
    color: #766d79;
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
}

.proof-details dd {
    margin: 0;
    color: #c7bdca;
    font-size: 0.65rem;
}

.external-card {
    background: #121014;
}

.external-copy {
    max-width: 720px;
}

.external-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 11px;
    align-items: end;
    margin-top: 20px;
}

.external-button {
    height: 43px;
    white-space: nowrap;
}

.external-note {
    margin-top: 11px;
    text-align: left;
}

button:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 980px) {
    .connection-grid,
    .shared-grid {
        grid-template-columns: 1fr;
    }

    .proof-checks {
        grid-template-columns: repeat(2, 1fr);
    }

    .external-form {
        grid-template-columns: 1fr 1fr;
    }

    .external-button {
        width: max-content;
    }
}

@media (max-width: 650px) {
    .connections-header,
    .section-heading,
    .proof-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .connections-header h1 {
        font-size: 2.3rem;
    }

    .connection-overview {
        grid-template-columns: 1fr;
    }

    .connection-overview article {
        min-height: 70px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .connection-overview article:last-child {
        border-bottom: 0;
    }

    .connection-card,
    .shared-section,
    .connection-proof,
    .external-card {
        padding: 17px;
    }

    .form-columns,
    .external-form,
    .proof-details {
        grid-template-columns: 1fr;
    }

    .share-card {
        flex-direction: column;
    }

    .proof-checks {
        grid-template-columns: 1fr;
    }

    .compact-button,
    .external-button {
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .token-actions > button {
        flex: 1 1 100%;
    }
}
