:root {
    color-scheme: dark;
    --brand: #2563eb;
    --brand-strong: #1d4ed8;
    --bg: #0b1020;
    --bg-soft: #10172a;
    --surface: rgba(17, 24, 39, 0.86);
    --surface-solid: #111827;
    --surface-muted: #172033;
    --text: #eef4ff;
    --muted: #9ca9bf;
    --border: rgba(148, 163, 184, 0.18);
    --success: #22c55e;
    --status-success: #22C55E;
    --status-connected: #3B82F6;
    --status-pending: #F59E0B;
    --status-error: #EF4444;
    --status-inactive: #9CA3AF;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 20px;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f7fb;
    --bg-soft: #eaf0ff;
    --surface: rgba(255, 255, 255, 0.92);
    --surface-solid: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 24px 70px rgba(37, 99, 235, 0.10);
}

.android-app-promo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    margin-bottom: 22px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 85% 20%, rgba(96, 165, 250, 0.28), transparent 22rem),
        linear-gradient(135deg, rgba(37, 99, 235, 0.23), rgba(14, 165, 233, 0.08)),
        var(--surface);
    box-shadow: var(--shadow);
}
.android-app-promo__icon {
    display: grid;
    place-items: center;
    width: 68px;
    height: 68px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #60a5fa);
    font-size: 30px;
    font-weight: 800;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.32);
}
.android-app-promo__copy h2 { margin: 3px 0 7px; }
.android-app-promo__copy p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.android-app-promo__button { white-space: nowrap; }

.public-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.public-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 96px;
    border-bottom: 1px solid var(--border);
}
.download-page { padding: 62px 0 28px; }
.download-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .65fr);
    align-items: center;
    gap: clamp(40px, 8vw, 100px);
    min-height: 570px;
}
.download-hero h1 {
    max-width: 760px;
    margin: 12px 0 20px;
    font-size: clamp(44px, 7vw, 76px);
    line-height: .98;
    letter-spacing: -.055em;
}
.download-hero .page-subtitle { max-width: 720px; font-size: 19px; }
.download-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 22px; }
.download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.download-primary { display: inline-flex; min-height: 56px; padding-inline: 26px; font-size: 17px; }
.download-trust { max-width: 620px; margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.download-phone {
    width: min(100%, 350px);
    min-height: 510px;
    justify-self: center;
    padding: 30px 24px;
    border: 9px solid var(--surface-solid);
    border-radius: 48px;
    background: linear-gradient(180deg, rgba(37, 99, 235, .18), transparent 55%), var(--bg-soft);
    box-shadow: 0 40px 100px rgba(0, 0, 0, .32);
}
.download-phone__top { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.download-phone__top .brand-mark { width: 38px; height: 38px; border-radius: 14px; }
.download-phone__status { display: grid; gap: 8px; margin-top: 58px; text-align: center; color: var(--muted); }
.download-phone__status strong { color: var(--text); font-size: 22px; }
.download-phone__button {
    display: grid;
    place-items: center;
    width: 190px;
    height: 190px;
    margin: 36px auto;
    border: 3px solid #60a5fa;
    border-radius: 50%;
    background: rgba(37, 99, 235, .12);
    font-weight: 800;
}
.download-phone__protocols { display: flex; justify-content: center; gap: 8px; }
.download-phone__protocols span { padding: 8px 11px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 12px; }
.download-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 36px; }
.download-card h2 { margin: 5px 0 18px; }
.download-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.download-steps li { display: flex; align-items: center; gap: 13px; }
.download-steps li > span { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 12px; color: #fff; background: var(--brand); font-weight: 800; }
.download-steps p { margin: 0; color: var(--muted); }
.download-update-preview { display: grid; gap: 6px; margin-top: 24px; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-muted); }
.download-update-preview span { color: var(--muted); line-height: 1.5; }
.download-hash { margin: 24px 0 0; padding: 18px 20px; border: 1px solid var(--border); border-radius: 16px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.download-hash strong { color: var(--text); margin-right: 8px; }
.public-footer { display: flex; justify-content: space-between; gap: 18px; padding: 30px 0 44px; color: var(--muted); font-size: 14px; }
.public-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.login-page { width: min(1050px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 54px; }
.login-header { display: flex; align-items: center; justify-content: space-between; min-height: 100px; border-bottom: 1px solid var(--border); }
.login-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(360px, 1.2fr); gap: 20px; align-items: stretch; padding-top: clamp(42px, 8vh, 88px); }
.login-card, .login-app-promo { min-height: 480px; }
.login-card { display: flex; flex-direction: column; justify-content: center; }
.login-card h1 { margin: 5px 0 8px; font-size: 38px; }
.login-form { display: grid; gap: 14px; margin-top: 25px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-form input { width: 100%; min-height: 50px; padding: 0 15px; border: 1px solid var(--border); border-radius: 14px; outline: none; color: var(--text); background: var(--surface-muted); }
.login-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.login-form .button { width: 100%; min-height: 50px; margin-top: 4px; }
.login-message { margin-top: 16px; padding: 12px 14px; border: 1px solid rgba(37, 99, 235, .25); border-radius: 13px; color: var(--text); background: rgba(37, 99, 235, .1); }
.login-message--success { border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .1); }
.login-message--error { border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .1); }
.login-app-promo { display: flex; flex-direction: column; justify-content: center; padding: clamp(30px, 5vw, 60px); border: 1px solid rgba(96, 165, 250, .34); border-radius: var(--radius); background: radial-gradient(circle at 85% 15%, rgba(96, 165, 250, .3), transparent 20rem), linear-gradient(145deg, rgba(37, 99, 235, .22), rgba(14, 165, 233, .06)), var(--surface); box-shadow: var(--shadow); }
.login-app-promo .android-app-promo__icon { margin-bottom: 20px; }
.login-app-promo h2 { max-width: 540px; margin: 5px 0 12px; font-size: clamp(30px, 4vw, 48px); line-height: 1.06; }
.login-app-promo p, .login-app-promo li { color: var(--muted); line-height: 1.55; }
.login-app-promo ul { display: grid; gap: 7px; margin: 9px 0 24px; padding-left: 20px; }
.login-app-promo .button { align-self: flex-start; }

@media (max-width: 760px) {
    .android-app-promo { grid-template-columns: auto 1fr; }
    .android-app-promo__button { grid-column: 1 / -1; width: 100%; }
    .public-page { width: min(100% - 28px, 1180px); }
    .public-header { align-items: flex-start; padding: 18px 0; }
    .public-header .header-actions { justify-content: flex-end; }
    .public-header .button.ghost { display: none; }
    .download-page { padding-top: 42px; }
    .download-hero { grid-template-columns: 1fr; min-height: 0; }
    .download-phone { width: min(100%, 330px); }
    .download-grid { grid-template-columns: 1fr; }
    .download-actions .button { width: 100%; }
    .public-footer { display: grid; }
    .login-page { width: min(100% - 28px, 1050px); }
    .login-layout { grid-template-columns: 1fr; padding-top: 30px; }
    .login-card, .login-app-promo { min-height: 0; }
    .login-app-promo .button { width: 100%; }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.28), transparent 32rem),
        radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.20), transparent 28rem),
        var(--bg);
}

body.modal-open { overflow: hidden; }

button, input, select { font: inherit; }
a { color: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), transparent 34%), rgba(8, 13, 28, 0.72);
    backdrop-filter: blur(20px);
}

[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.70); }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    font-size: 21px;
    letter-spacing: -0.04em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #60a5fa);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.32);
}

.nav { display: grid; gap: 8px; margin-top: 36px; }
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 16px;
    font-weight: 700;
}
.nav-link:hover, .nav-link.active {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
}
.nav-icon { width: 24px; text-align: center; }

.sidebar-bottom-stack {
    position: absolute;
    right: 24px;
    bottom: 24px;
    left: 24px;
    display: grid;
    gap: 20px;
}

.sidebar-card, .sidebar-support-card {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.sidebar-card strong, .sidebar-card small { display: block; }
.sidebar-card small { margin-top: 6px; color: var(--muted); }

.sidebar-support-card {
    display: grid;
    gap: 10px;
}
.sidebar-support-card strong, .sidebar-support-card small { display: block; }
.sidebar-support-card small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.sidebar-support-card__actions { display: grid; gap: 8px; margin-top: 4px; }
.sidebar-support-card__button { width: 100%; }

.mobile-topbar { display: none; }
.main-content { width: 100%; min-width: 0; }
.content-container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 34px; }


.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.04em; }
h1 { font-size: clamp(32px, 5vw, 54px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 18px; }
.page-subtitle, .muted-text, .support-card p, .status-card p { color: var(--muted); line-height: 1.55; }

.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.theme-select { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.theme-select select {
    min-height: 42px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 12px;
}

.grid { display: grid; gap: 18px; margin-bottom: 18px; }
.two-columns { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr); }
.card, .stat-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.card { padding: 24px; }
.my-connections, .connections-section { padding: 28px; }
.card-head, .section-title, .button-row, .metric-row, .invite-link-box { display: flex; gap: 14px; }
.dashboard-summary { grid-template-columns: 1fr; }
.card-head, .section-title { justify-content: space-between; align-items: flex-start; }
.hero-card { min-height: 280px; display: flex; flex-direction: column; justify-content: space-between; }
.subscription-card { width: 100%; }

.metric-row { flex-wrap: wrap; margin: 26px 0; }
.metric-row > div {
    flex: 1 1 150px;
    padding: 16px;
    border-radius: 18px;
    background: var(--surface-muted);
}
.metric-row span, .stat-card span, .info-list span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric-row strong, .stat-card strong, .info-list strong { font-size: 24px; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 16px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.button.primary { color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-strong); }
.button.secondary { color: var(--text); background: rgba(37, 99, 235, 0.14); border-color: rgba(37, 99, 235, 0.26); }
.button.ghost { color: var(--text); background: var(--surface-muted); border-color: var(--border); }
.button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: 0.68; }
.icon-button { border: 0; border-radius: 14px; background: var(--surface-muted); color: var(--text); width: 44px; height: 44px; }

.pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 800; }
.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 20px;
    padding: 0;
    color: var(--text);
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}
.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    color: currentColor;
    font-size: 15px;
    line-height: 1;
}
.status-text { line-height: 1.2; }
.info-list .status { display: inline-flex; font-size: 14px; }
.info-list .status-icon, .info-list .status-text { margin-bottom: 0; font-size: inherit; }
.info-list .status-icon { display: inline-flex; }
.info-list .status-text { display: inline; }
.status-success { color: var(--status-success); }
.status-connected { color: var(--status-connected); }
.status-pending { color: var(--status-pending); }
.status-error { color: var(--status-error); }
.status-inactive { color: var(--status-inactive); }
[data-theme="light"] .status {
    gap: 6px;
    min-height: 0;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
[data-theme="light"] .status-success {
    color: #15803D;
    background: #DCFCE7;
    border-color: #86EFAC;
}
[data-theme="light"] .status-connected {
    color: #1D4ED8;
    background: #DBEAFE;
    border-color: #93C5FD;
}
[data-theme="light"] .status-pending {
    color: #B45309;
    background: #FEF3C7;
    border-color: #FCD34D;
}
[data-theme="light"] .status-error {
    color: #B91C1C;
    background: #FEE2E2;
    border-color: #FCA5A5;
}
[data-theme="light"] .status-inactive {
    color: #4B5563;
    background: #E5E7EB;
    border-color: #D1D5DB;
}
[data-theme="light"] .status-icon { color: currentColor; }

.section-card { margin-bottom: 18px; }
.connection-title { gap: 18px; margin-bottom: 26px; }
.section-heading { max-width: 620px; }
.section-subtitle { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.instruction-badge { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); background: var(--surface-muted); font-size: 13px; font-weight: 800; white-space: nowrap; }
.platform-scroll { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 18px; }
.platform-card { display: flex; min-width: 0; min-height: 250px; height: 100%; flex-direction: column; align-items: flex-start; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(180deg, rgba(37, 99, 235, 0.10), transparent 72%), var(--surface-muted); }
.platform-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--brand), #60a5fa); font-weight: 900; box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24); }
.platform-copy { flex: 1; min-width: 0; }
.platform-card h3 { margin-bottom: 8px; }
.platform-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.platform-card small { display: block; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.platform-button { width: 100%; margin-top: 20px; white-space: nowrap; }
.instruction-modal { position: fixed; z-index: 90; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; }
.instruction-modal.open { display: flex; }
.instruction-modal__backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.66); backdrop-filter: blur(8px); }
.instruction-modal__panel { position: relative; width: min(560px, 100%); max-height: min(680px, calc(100vh - 48px)); overflow-y: auto; padding: 24px; color: var(--text); border: 1px solid var(--border); border-radius: 24px; background: var(--surface-solid); box-shadow: var(--shadow); }
.instruction-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.instruction-modal__close { flex: 0 0 auto; font-size: 24px; line-height: 1; }
.instruction-steps { display: grid; gap: 12px; margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.6; }
.instruction-steps li::marker { color: var(--brand); font-weight: 800; }
.instruction-note { margin: 0 0 16px; padding: 12px 14px; color: var(--text); background: rgba(37, 99, 235, 0.14); border: 1px solid rgba(37, 99, 235, 0.26); border-radius: 16px; font-weight: 800; }

.button.danger { color: #fff; background: #ef4444; border-color: rgba(239, 68, 68, 0.28); }
.button.danger:hover { background: #dc2626; }

.my-connections, .connections-section { overflow: hidden; }
.connection-toolbar { display: flex; justify-content: flex-start; margin: 0 0 28px; }
.connection-form { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(240px, 1.4fr) auto; gap: 14px; align-items: end; margin-top: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-muted); }
.connection-form label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 800; }
.connection-form input, .connection-form select { min-height: 46px; width: 100%; color: var(--text); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; }
.connection-form input::placeholder { color: var(--muted); }

.connection-protocol-field[hidden] { display: none !important; }
.connection-protocol-badge { display: inline-flex; align-items: center; width: fit-content; min-height: 28px; margin-bottom: 12px; padding: 0 10px; color: var(--brand); background: rgba(37, 99, 235, 0.14); border: 1px solid rgba(37, 99, 235, 0.24); border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: 0.01em; }

.connections-grid, .profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 18px; margin-top: 14px; }
.profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.connection-profile, .profile-card { display: flex; min-width: 0; min-height: 360px; height: 100%; flex-direction: column; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(180deg, rgba(37, 99, 235, 0.12), transparent 70%), var(--surface-muted); }
.connection-profile__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.connection-device-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 17px; color: #fff; background: linear-gradient(135deg, var(--brand), #60a5fa); font-weight: 900; box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24); }
.connection-profile__copy { flex: 1; min-width: 0; }
.connection-profile__copy h3 { overflow-wrap: anywhere; margin-bottom: 8px; }
.connection-profile__copy p { margin: 0; color: var(--muted); font-weight: 800; }
.connection-profile__actions { display: grid; gap: 12px; margin-top: 24px; }
.connection-profile__actions .button, .connection-profile__actions form { width: 100%; }
.connection-profile__actions .button { min-height: 44px; padding-inline: 12px; font-size: 14px; }
.connections-empty, .os-section .empty-state { margin-top: 12px; }
.connections-empty { padding: 20px; border: 1px dashed var(--border); border-radius: 18px; background: var(--surface-muted); }
.connections-empty strong { display: block; margin-bottom: 8px; }
.connections-empty p { margin: 0; color: var(--muted); line-height: 1.55; }
.connection-modal { position: fixed; z-index: 92; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; }
.connection-modal.open { display: flex; }
.connection-modal__backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.66); backdrop-filter: blur(8px); }
.connection-modal__panel { position: relative; width: min(460px, 100%); max-height: min(640px, calc(100vh - 48px)); overflow-y: auto; padding: 24px; color: var(--text); border: 1px solid var(--border); border-radius: 24px; background: var(--surface-solid); box-shadow: var(--shadow); }
.connection-qr-frame { display: grid; place-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 20px; background: #fff; }
.connection-qr-frame svg, .connection-qr-frame img { width: min(260px, 100%); height: auto; display: block; }
.connection-modal__hint { margin: 16px 0 0; color: var(--muted); line-height: 1.55; }
#profile-create-modal {
    display: none;
}
#profile-create-modal.open {
    display: flex;
}
.profile-create-modal .connection-modal__panel { width: min(560px, 100%); }
.modal-form { grid-template-columns: 1fr; margin-top: 0; }
.modal-form .button { width: 100%; }

@media (max-width: 1280px) and (min-width: 1081px) {
    .connections-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    .connections-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .connection-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .connection-form .button { grid-column: 1 / -1; }
    .modal-form { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
    .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .profile-grid {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 4px;
        padding-bottom: 10px;
    }
    .profile-card { scroll-snap-align: start; scroll-snap-stop: always; }
}

@media (max-width: 760px) {
    .connection-form { grid-template-columns: 1fr; }
    .connections-grid { display: flex; overflow-x: auto; gap: 18px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
    .connection-profile { min-width: min(300px, 84vw); scroll-snap-align: start; }
    .connection-modal { padding: 16px; align-items: flex-end; }
    .connection-modal__panel { max-height: calc(100vh - 32px); padding: 20px; border-radius: 22px; }
}

@media (max-width: 767px) and (min-width: 480px) {
    .profile-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
}

@media (max-width: 479px) {
    .profile-grid { grid-template-columns: minmax(280px, 1fr); }
}

.sponsor-promo-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 20px;
}
.sponsor-promo-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(37, 99, 235, 0.26);
    font-size: 24px;
    line-height: 1;
}
.sponsor-promo-copy { min-width: 0; max-width: 920px; }
.sponsor-promo-head { margin-bottom: 12px; }
.sponsor-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.sponsor-title-row h2 { margin: 0; }
.sponsor-price { flex: 0 0 auto; min-height: 28px; margin-bottom: 0; padding: 0 10px; color: var(--brand); background: rgba(37, 99, 235, 0.14); border: 1px solid rgba(37, 99, 235, 0.26); font-size: 12px; }
.sponsor-benefits { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--text); line-height: 1.35; }
.sponsor-benefits li {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 46px;
    height: 100%;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
}
.sponsor-benefits li span:first-child {
    display: grid;
    flex: 0 0 22px;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 10px;
    color: var(--brand);
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(37, 99, 235, 0.26);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}
.sponsor-benefits li span:last-child { min-width: 0; }
.sponsor-benefits--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(46px, 1fr); }
.sponsor-action { align-self: end; justify-self: end; }
.sponsor-button { width: auto; white-space: nowrap; }

.sponsor-offer {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 28px;
    padding: 34px;
    overflow: hidden;
    background: radial-gradient(circle at 15% 10%, rgba(37, 99, 235, 0.22), transparent 38%), var(--surface);
}
.sponsor-offer__copy { align-self: center; max-width: 760px; }
.sponsor-offer__badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--brand);
    background: rgba(37, 99, 235, 0.14);
    border: 1px solid rgba(37, 99, 235, 0.26);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sponsor-offer h2 { margin: 18px 0 12px; font-size: clamp(28px, 4vw, 44px); }
.sponsor-offer__copy > p { margin: 0; max-width: 680px; color: var(--muted); line-height: 1.65; }
.sponsor-offer__highlights { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; padding: 0; list-style: none; }
.sponsor-offer__highlights li {
    display: flex;
    align-items: baseline;
    gap: 7px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-muted);
    font-weight: 700;
}
.sponsor-offer__highlights span { color: var(--brand); font-size: 22px; font-weight: 900; }
.sponsor-offer__checkout {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 26px;
    border: 1px solid rgba(37, 99, 235, 0.30);
    border-radius: 22px;
    background: var(--surface-muted);
}
.sponsor-offer__checkout > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.sponsor-offer__checkout > strong { margin: 8px 0; font-size: 38px; }
.sponsor-offer__checkout > small { margin-bottom: 24px; color: var(--muted); line-height: 1.5; }
.sponsor-offer__checkout form, .sponsor-offer__checkout .button { width: 100%; }
.sponsor-comparison { margin-top: 48px; }
.sponsor-comparison__heading { margin-bottom: 22px; }
.sponsor-comparison__heading h2 { margin: 6px 0 8px; }
.sponsor-table { overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); }
.sponsor-table__row {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 0.95fr) minmax(180px, 0.95fr);
    border-top: 1px solid var(--border);
}
.sponsor-table__row:first-child { border-top: 0; }
.sponsor-table__row > div {
    display: flex;
    min-width: 0;
    min-height: 84px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 18px 22px;
    border-left: 1px solid var(--border);
}
.sponsor-table__row > div:first-child { border-left: 0; }
.sponsor-table__row small { color: var(--muted); line-height: 1.4; }
.sponsor-table__header > div {
    min-height: 54px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.sponsor-table__featured { background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.14)); }
.sponsor-table__featured strong { color: var(--text); }
.comparison-check {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--brand);
    font-size: 13px;
    font-weight: 900;
}
.sponsor-table__row > .sponsor-table__featured { flex-direction: row; align-items: center; justify-content: flex-start; }
.comparison-value { color: var(--text); font-weight: 700; }
.comparison-muted { color: var(--muted); }

.action-list { display: grid; gap: 12px; margin-top: 18px; }
.action-button { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 58px; width: 100%; padding: 0 16px; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 18px; text-align: left; }
.action-button span { font-weight: 800; }
.action-button small { color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.stat-card { padding: 22px; }
.stat-card strong { font-size: 36px; }
.invite-link-box { flex-wrap: wrap; }
.invite-link-box input { flex: 1 1 360px; min-height: 48px; padding: 0 16px; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { padding: 15px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { color: var(--muted); font-size: 13px; }

.info-list, .toggle-list { display: grid; gap: 12px; margin-top: 18px; }
.info-list > div, .toggle-row { padding: 15px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-muted); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; font-weight: 800; }
.toggle-row input { width: 20px; height: 20px; accent-color: var(--brand); }
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.empty-state { max-width: 720px; }

.menu-backdrop { display: none; }

@media (max-width: 1080px) {
    .app-shell { grid-template-columns: 92px minmax(0, 1fr); }
    .sidebar { padding: 18px; }
    .brand-text, .nav-link span:last-child, .sidebar-bottom-stack { display: none; }
    .nav-link { justify-content: center; }
    .two-columns { grid-template-columns: 1fr; }
    .platform-scroll { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .app-shell { display: block; }
    .mobile-topbar { position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--bg); }
    .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(320px, 86vw); overflow-y: auto; transform: translateX(-102%); transition: transform 180ms ease; }
    .sidebar.open { transform: translateX(0); }
    .brand-text, .nav-link span:last-child { display: block; }
    .sidebar-bottom-stack { display: grid; }
    .sidebar-support-card { display: grid; }
    .nav-link { justify-content: flex-start; }
    .menu-backdrop.open { display: block; position: fixed; z-index: 40; inset: 0; background: rgba(0, 0, 0, 0.46); }
    .content-container { width: 100%; max-width: none; padding: 16px; }
    .page-header { display: grid; }
    .header-actions { width: 100%; }
    .connection-title { display: grid; margin-bottom: 22px; }
    .instruction-badge { justify-self: start; white-space: normal; }
    .platform-scroll { display: flex; overflow-x: auto; gap: 16px; padding-bottom: 8px; scroll-snap-type: x mandatory; }
    .platform-card { min-width: min(280px, 82vw); scroll-snap-align: start; }
    .sponsor-promo-card { grid-template-columns: 1fr; }
    .sponsor-promo-icon { width: 46px; height: 46px; border-radius: 16px; }
    .sponsor-benefits--compact { grid-template-columns: 1fr; }
    .sponsor-action { width: 100%; justify-self: stretch; }
    .sponsor-button { width: 100%; }
    .sponsor-offer { grid-template-columns: 1fr; padding: 22px; }
    .sponsor-table { border-radius: 20px; }
    .sponsor-table__header { display: none; }
    .sponsor-table__row { grid-template-columns: 1fr; padding: 14px 16px; }
    .sponsor-table__row > div { min-height: 0; padding: 12px 4px; border: 0; }
    .sponsor-table__row > div:nth-child(2)::before,
    .sponsor-table__row > div:nth-child(3)::before {
        display: block;
        margin-bottom: 2px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    .sponsor-table__row > div:nth-child(2)::before { content: "Обычный аккаунт"; }
    .sponsor-table__row > div:nth-child(3)::before { content: "Спонсор"; }
    .sponsor-table__row > .sponsor-table__featured { align-items: center; padding: 12px; border-radius: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .card { padding: 20px; }
}
.connection-profile.ready {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.14), transparent 72%),
        var(--surface-muted);
}
.connection-profile.pending {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.10), transparent 72%),
        var(--surface-muted);
}
.connection-profile__copy small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.connection-profile.pending .connection-device-icon {
    background: linear-gradient(135deg, #64748b, var(--brand));
}
[data-theme="light"] .connection-profile,
[data-theme="light"] .platform-card {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 72%),
        var(--surface-muted);
}

/* Device-specific setup guide */
.connect-now-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; margin-bottom: 24px; padding: 28px; color: #fff; border: 1px solid rgba(96,165,250,.3); border-radius: 26px; background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #60a5fa); box-shadow: 0 22px 50px rgba(37,99,235,.24); }
.connect-now-card__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(255,255,255,.16); font-size: 34px; }
.connect-now-card h2 { margin: 3px 0 8px; font-size: clamp(24px, 3vw, 34px); }
.connect-now-card p { margin: 0; color: rgba(255,255,255,.82); line-height: 1.55; }
.connect-now-card .eyebrow { color: #dbeafe; }
.connect-now-card__button { color: #1d4ed8 !important; background: #fff !important; white-space: nowrap; }
.advanced-connections { margin-top: 24px; }
.advanced-connections > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); cursor: pointer; list-style: none; }
.advanced-connections > summary::-webkit-details-marker { display: none; }
.advanced-connections > summary > span:first-child { display: grid; gap: 4px; }
.advanced-connections > summary small, .advanced-connections > summary > span:last-child { color: var(--muted); }
.advanced-connections[open] > summary { margin-bottom: 14px; }
.easy-connect { padding: 28px; }
.easy-connect__heading, .easy-flow__header { display: flex; align-items: flex-start; gap: 16px; }
.easy-connect__heading h2, .easy-flow__header h2 { margin: 3px 0 7px; font-size: clamp(25px, 4vw, 36px); }
.easy-connect__heading p:last-child, .easy-flow__header p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.easy-connect__badge { display: grid; place-items: center; flex: 0 0 46px; height: 46px; color: #fff; border-radius: 15px; background: var(--brand); font-size: 20px; font-weight: 900; }
.easy-device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 26px; }
.easy-device-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; min-height: 112px; padding: 18px; color: var(--text); text-align: left; border: 2px solid var(--border); border-radius: 22px; background: var(--surface-muted); cursor: pointer; transition: .18s ease; }
.easy-device-card:hover { transform: translateY(-2px); border-color: rgba(37,99,235,.55); }
.easy-device-card.active { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37,99,235,.12); }
.easy-device-card > span:nth-child(2) { display: grid; gap: 4px; }
.easy-device-card strong { font-size: 20px; }
.easy-device-card small { color: var(--muted); line-height: 1.35; }
.easy-device-card > b { color: var(--brand); font-size: 13px; }
.easy-device-card.active > b { color: var(--status-success); }
.easy-device-card__icon { display: grid; place-items: center; width: 54px; height: 54px; color: #fff; border-radius: 17px; background: #22c55e; font-size: 24px; font-weight: 900; }
.easy-device-card__icon.apple { background: #111827; }
.easy-flow { display: none; margin-top: 26px; }
.easy-flow.active { display: block; }
.easy-flow__header { padding: 6px 4px 20px; }
.easy-action-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; padding: 28px; border: 1px solid var(--border); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-soft); }
.easy-action-card__visual { display: flex; align-items: center; gap: 14px; }
.easy-action-card__visual > div { display: grid; gap: 4px; }
.easy-action-card__visual strong { font-size: 24px; }
.easy-action-card__visual small { color: var(--muted); }
.easy-onlyus-logo { display: grid; place-items: center; width: 62px; height: 62px; color: #fff; border-radius: 19px; background: var(--brand); font-size: 28px; font-weight: 900; }
.easy-primary-action { min-height: 52px; padding-inline: 24px; font-size: 16px; }
.easy-mini-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 0; padding: 0; list-style: none; }
.easy-mini-steps li { display: flex; align-items: center; gap: 9px; padding: 13px; border-radius: 14px; background: var(--surface-muted); color: var(--muted); }
.easy-mini-steps span, .easy-finish > span { display: grid; place-items: center; flex: 0 0 28px; height: 28px; color: #fff; border-radius: 9px; background: var(--brand); font-weight: 900; }
.easy-result { grid-column: 1 / -1; display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 !important; padding: 14px; color: var(--status-success) !important; border-radius: 14px; background: rgba(34,197,94,.1); }
.easy-result span { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; border-radius: 50%; background: #22c55e; }
.easy-ios-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.easy-action-card.compact { position: relative; display: flex; align-items: stretch; flex-direction: column; min-height: 315px; }
.easy-action-card.compact h3 { margin: 0 0 7px; font-size: 23px; }
.easy-action-card.compact p { margin: 0; color: var(--muted); line-height: 1.5; }
.easy-action-number { display: grid; place-items: center; width: 38px; height: 38px; color: var(--brand); border-radius: 12px; background: rgba(37,99,235,.12); font-weight: 900; }
.easy-action-card.compact .easy-primary-action { width: 100%; margin-top: auto; }
.easy-store-note { color: var(--muted); line-height: 1.45; }
.easy-store-note a { color: var(--brand); font-weight: 700; }
.easy-ready-profile { display: grid; gap: 10px; margin-top: auto; }
.easy-ready-profile > span { display: grid; gap: 3px; color: var(--status-success); }
.easy-ready-profile small { color: var(--muted); }
.easy-ready-profile .button { width: 100%; }
.easy-warning { margin-top: auto !important; padding: 14px; border-radius: 14px; background: rgba(245,158,11,.1); }
.easy-finish { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 20px; border: 1px solid rgba(34,197,94,.25); border-radius: 20px; background: rgba(34,197,94,.08); }
.easy-finish > span { background: #22c55e; }
.easy-finish > div { display: grid; flex: 1; gap: 5px; }
.easy-finish p { margin: 0; color: var(--muted); }
.easy-finish > b { color: var(--status-success); }
.easy-help { display: flex; align-items: center; gap: 16px; margin-top: 26px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-muted); }
.easy-help span { flex: 1; color: var(--muted); }
.guide-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(420px, .8fr); gap: 28px; align-items: center; padding: 28px; margin-bottom: 24px; }
.guide-hero h2, .guide-intro h2 { margin: 4px 0 10px; }
.guide-hero p:last-child, .guide-intro p:last-child { margin: 0; color: var(--muted); line-height: 1.55; }
.guide-device-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.guide-device-button { display: flex; align-items: center; gap: 12px; min-height: 88px; padding: 14px; color: var(--text); text-align: left; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-muted); cursor: pointer; transition: .18s ease; }
.guide-device-button:hover { transform: translateY(-2px); border-color: rgba(37, 99, 235, .55); }
.guide-device-button.active { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--brand), #3b82f6); box-shadow: 0 16px 34px rgba(37, 99, 235, .24); }
.guide-device-button span:last-child { display: grid; gap: 3px; }
.guide-device-button small { color: var(--muted); }
.guide-device-button.active small { color: rgba(255,255,255,.78); }
.guide-device-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 14px; color: #fff; background: #111827; font-size: 20px; font-weight: 900; }
.guide-device-button.active .guide-device-icon { color: var(--brand); background: #fff; }
.guide-panel { display: none; }
.guide-panel.active { display: block; }
.guide-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 4px; }
.guide-intro > div { max-width: 720px; }
.guide-intro > .button { flex: 0 0 auto; }
.guide-availability-note { margin-top: 12px !important; font-size: 13px; }
.guide-availability-note a { color: var(--brand); font-weight: 800; }
.guide-steps-grid { display: grid; gap: 18px; counter-reset: steps; }
.guide-step { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(220px, 300px); gap: 22px; align-items: center; min-height: 300px; padding: 24px; overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-soft); }
.guide-step-number { align-self: start; display: grid; place-items: center; width: 42px; height: 42px; color: #fff; border-radius: 14px; background: var(--brand); font-weight: 900; }
.guide-step h3 { margin: 0 0 10px; font-size: 22px; }
.guide-step p { margin: 0; color: var(--muted); line-height: 1.6; }
.guide-tip { margin-top: 14px !important; padding: 12px 14px; color: var(--text) !important; border: 1px solid rgba(37,99,235,.28); border-radius: 14px; background: rgba(37,99,235,.1); }
.guide-key-form { margin-top: 18px; }
.guide-existing-keys { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.guide-key-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.guide-key-row > span { flex: 1 1 160px; font-weight: 700; }
.phone-shot { justify-self: end; display: flex; flex-direction: column; justify-content: center; width: min(100%, 250px); min-height: 250px; padding: 18px; color: #101827; border: 7px solid #111827; border-radius: 32px; background: #f3f6fb; box-shadow: 0 18px 45px rgba(2,6,23,.22); }
.phone-shot::before { content: ""; align-self: center; width: 72px; height: 6px; margin: -8px 0 18px; border-radius: 8px; background: #111827; }
.phone-shot-bar { padding-bottom: 12px; color: #2563eb; font-size: 20px; font-weight: 900; }
.phone-shot-card, .phone-shot-system, .phone-shot-key { display: grid; gap: 9px; padding: 16px; border: 1px solid #d8dfeb; border-radius: 18px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.phone-shot small { color: #64748b; }
.mini-app-icon, .mini-amnezia-icon { display: grid; place-items: center; width: 44px; height: 44px; color: #fff; border-radius: 14px; background: #2563eb; font-weight: 900; }
.mini-amnezia-icon { border-radius: 50%; background: #111827; }
.phone-shot-button, .phone-shot-pill { display: inline-flex; justify-content: center; padding: 9px 12px; color: #fff; border-radius: 12px; background: #2563eb; font-size: 12px; font-weight: 800; }
.phone-shot-pill { padding: 7px 10px; }
.phone-shot-row { display: flex; justify-content: flex-end; gap: 16px; margin-top: 18px; font-size: 12px; }
.phone-shot-row .accent { color: #2563eb; }
.mini-onlyus-head { display: flex; align-items: center; gap: 10px; margin-bottom: 30px; font-size: 22px; }
.mini-onlyus-head span { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; border-radius: 12px; background: #2563eb; }
.phone-shot-onlyus > strong { font-size: 20px; }
.mini-connect { display: grid; place-items: center; width: 130px; height: 130px; margin: 18px auto; color: #fff; border-radius: 50%; background: #2563eb; font-weight: 800; }
.phone-shot-app { display: flex; align-items: center; gap: 10px; }
.phone-shot-app > div { display: grid; flex: 1; gap: 3px; }
.phone-shot-key { text-align: center; }
.phone-shot-key > span { display: grid; place-items: center; width: 48px; height: 48px; margin: auto; color: #fff; border-radius: 50%; background: #22c55e; font-size: 24px; }
.phone-shot-key b { color: #2563eb; }
.phone-shot-amnezia { gap: 12px; background: #101827; color: #fff; }
.phone-shot-amnezia::before { background: #fff; }
.amnezia-option { padding: 13px; border: 1px solid #334155; border-radius: 14px; background: #1e293b; font-size: 12px; }
.phone-shot-amnezia.connected { align-items: center; text-align: center; }
.phone-shot-amnezia.connected small { color: #94a3b8; }
.amnezia-power { display: grid; place-items: center; width: 112px; height: 112px; margin: 24px 0; border: 8px solid #22c55e; border-radius: 50%; color: #22c55e; font-size: 40px; }
.guide-qr-modal { position: fixed; z-index: 110; inset: 0; display: grid; place-items: center; padding: 20px; }
.guide-qr-modal[hidden] { display: none; }
.guide-qr-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2,6,23,.72); backdrop-filter: blur(7px); }
.guide-qr-dialog { position: relative; width: min(420px, 100%); padding: 26px; text-align: center; border: 1px solid var(--border); border-radius: 24px; background: var(--surface-solid); box-shadow: var(--shadow); }
.guide-qr-dialog .icon-button { position: absolute; top: 14px; right: 14px; }
.guide-qr-dialog img { display: block; width: min(280px, 100%); margin: 20px auto; border-radius: 16px; background: #fff; }

@media (max-width: 900px) {
    .connect-now-card { grid-template-columns: auto 1fr; }
    .connect-now-card__button { grid-column: 1 / -1; width: 100%; }
    .easy-ios-actions { grid-template-columns: 1fr; }
    .guide-hero { grid-template-columns: 1fr; }
    .guide-step { grid-template-columns: 44px minmax(0, 1fr); }
    .guide-step .phone-shot { grid-column: 2; justify-self: start; }
}
@media (max-width: 620px) {
    .connect-now-card { grid-template-columns: 1fr; padding: 22px; }
    .connect-now-card__icon { display: none; }
    .easy-connect { padding: 20px; }
    .easy-device-grid { grid-template-columns: 1fr; }
    .easy-device-card { grid-template-columns: auto minmax(0, 1fr); }
    .easy-device-card > b { grid-column: 2; }
    .easy-action-card { grid-template-columns: 1fr; padding: 20px; }
    .easy-primary-action { width: 100%; }
    .easy-mini-steps { grid-column: 1; grid-template-columns: 1fr; }
    .easy-result { grid-column: 1; }
    .easy-finish { align-items: flex-start; }
    .easy-finish > b { display: none; }
    .easy-help { align-items: stretch; flex-direction: column; }
    .guide-hero { padding: 20px; }
    .guide-device-picker { grid-template-columns: 1fr; }
    .guide-intro { align-items: stretch; flex-direction: column; }
    .guide-step { grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 18px; }
    .guide-step-number { width: 36px; height: 36px; }
    .guide-step .phone-shot { grid-column: 1 / -1; justify-self: center; }
    .guide-key-row { align-items: stretch; flex-direction: column; }
    .guide-key-row > * { width: 100%; }
}
[data-theme="light"] .connection-profile.ready {
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.10), transparent 72%),
        var(--surface-muted);
}
.connection-device-groups, .os-sections {
    display: grid;
    gap: 28px;
}
.connection-device-group, .os-section {
    display: grid;
    min-width: 0;
}
.connection-device-group + .connection-device-group,
.os-section + .os-section {
    border-top: 1px solid var(--border);
}
.connection-device-group__head, .os-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.os-section-header .eyebrow {
    margin-bottom: 10px;
}

.connection-profile__actions form {
    margin: 0;
}
.connection-profile__actions form .button {
    width: 100%;
}

@media (max-width: 760px) {
    .connection-device-group__head {
        display: grid;
    }
    .connection-toolbar .button {
        width: 100%;
    }
    .my-connections, .connections-section {
        padding: 28px;
    }
}
/* Hard overrides for profile modal and OS profile sections. */
.os-sections {
    display: flex !important;
    flex-direction: column !important;
    gap: 32px !important;
}

.os-section {
    padding-top: 24px !important;
    border-top: 1px solid var(--border) !important;
}

.os-section:first-child {
    padding-top: 0 !important;
    border-top: 0 !important;
}

.os-section-header {
    margin-bottom: 18px !important;
}

@media (min-width: 1024px) {
    .profile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.empty-state {
    margin-top: 14px !important;
    padding: 18px !important;
}
.invites-create-card .section-title { align-items: center; }
.invite-create-form { margin: 0; }
.invites-share-card .section-title { margin-bottom: 18px; }
.invite-link-box input { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.muted-note { margin: 0; color: var(--muted); }
.benefit-list { display: grid; gap: 10px; margin: 18px 0 24px; padding: 0; list-style: none; color: var(--text); }
.benefit-list li { position: relative; padding-left: 28px; }
.benefit-list li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.invite-user { display: block; font-weight: 800; }
.invite-row-link { display: block; max-width: 520px; margin-top: 6px; color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }

@media (max-width: 760px) {
    .invites-create-card .section-title { display: grid; }
    .invite-create-form, .invite-create-form .button, .invites-empty-state form, .invites-empty-state .button, .invites-user-state .button { width: 100%; }
    .invite-link-box { display: grid; grid-template-columns: 1fr; }
    .invite-link-box input, .invite-link-box .button { width: 100%; }
    .invites-table-wrap { overflow-x: visible; }
    .invites-table { min-width: 0; }
    .invites-table thead { display: none; }
    .invites-table tr { display: grid; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); }
    .invites-table td { display: grid; gap: 4px; padding: 0; border-bottom: 0; }
    .invites-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
    .invite-row-link { max-width: 100%; }
}

@media (max-width: 430px) {
    .stats-grid.invites-stats { gap: 12px; }
    .stats-grid.invites-stats .stat-card { padding: 18px; }
    .stats-grid.invites-stats .stat-card strong { font-size: 30px; }
}.referral-qr-details { margin-top: 16px; }
.referral-qr-details summary { width: fit-content; cursor: pointer; list-style: none; }
.referral-qr-details summary::-webkit-details-marker { display: none; }
.referral-qr-frame { width: fit-content; margin-top: 14px; }

.invites-table form { margin: 0; }
.profile-page {
    display: grid;
    gap: 18px;
}
.profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 22px;
    min-width: 0;
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 8px);
    background:
        radial-gradient(circle at 18% 20%, rgba(96, 165, 250, 0.24), transparent 28rem),
        linear-gradient(135deg, rgba(37, 99, 235, 0.20), rgba(14, 165, 233, 0.06) 46%, rgba(15, 23, 42, 0.16)),
        var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.profile-hero__identity {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}
.profile-avatar {
    display: grid;
    place-items: center;
    width: clamp(72px, 10vw, 96px);
    height: clamp(72px, 10vw, 96px);
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #38bdf8);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.34);
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 900;
    letter-spacing: -0.06em;
}
.profile-hero__copy { min-width: 0; }
.profile-hero__copy h2 {
    overflow-wrap: anywhere;
    font-size: clamp(30px, 5vw, 48px);
}
.profile-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.profile-badge, .profile-inline-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: rgba(148, 163, 184, 0.12);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}
.profile-badge--role { background: rgba(37, 99, 235, 0.18); border-color: rgba(37, 99, 235, 0.28); }
.profile-badge--connected { color: var(--status-success); background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.24); }
.profile-badge--muted, .profile-inline-status { color: var(--muted); }
.profile-hero__balance {
    display: grid;
    align-content: center;
    gap: 8px;
    min-width: min(260px, 100%);
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(14px);
}
.profile-hero__balance span, .profile-hero__balance small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}
.profile-hero__balance strong {
    font-size: clamp(38px, 6vw, 58px);
    line-height: 1;
    letter-spacing: -0.06em;
}
.profile-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.profile-action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon body" "icon aside";
    align-items: center;
    gap: 12px 14px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.08), transparent 82%), var(--surface);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
    cursor: pointer;
}
.profile-action-card:focus-within {
    outline: 2px solid rgba(96, 165, 250, 0.55);
    outline-offset: 3px;
}
.profile-action-card__icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    color: var(--brand);
    background: rgba(37, 99, 235, 0.14);
    font-weight: 900;
}
.profile-action-card__body { grid-area: body; min-width: 0; }
.profile-action-card__body h3 { margin-bottom: 5px; }
.profile-action-card__body p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.profile-action-card__aside {
    grid-area: aside;
    display: flex;
    justify-content: flex-start;
    min-width: 0;
}
.profile-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}
.profile-settings-card { min-width: 0; margin-bottom: 0; }
.profile-stack {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}
.profile-setting-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    background: rgba(148, 163, 184, 0.08);
}
.profile-setting-row--contact {
    grid-template-columns: minmax(0, 0.85fr) minmax(220px, 1fr);
    align-items: start;
}
.profile-setting-row--compact .button, .profile-action-form .button { min-height: 40px; padding-inline: 14px; }
.profile-setting-row--quiet { grid-template-columns: minmax(0, 1fr); }
.profile-setting-row strong { font-size: 17px; }
.profile-setting-row .muted-text {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
}
.profile-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    width: 100%;
}
.profile-field input {
    min-height: 46px;
    width: 100%;
    padding: 0 14px;
    color: var(--text);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.profile-field input:disabled {
    cursor: not-allowed;
    opacity: 0.86;
}
.profile-field small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}
.profile-settings-form { margin: 18px 0 0; }
.profile-setting-row--actions .button { min-height: 42px; padding-inline: 16px; }
.profile-action-form { margin: 0; }
.profile-flash {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    font-weight: 800;
    line-height: 1.45;
}
.profile-flash--success {
    color: var(--status-success);
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(34, 197, 94, 0.10);
}
.profile-flash--error {
    color: var(--status-error);
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.10);
}
.profile-modal {
    position: fixed;
    z-index: 93;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.profile-modal.open { display: flex; }
.profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 7, 18, 0.70);
    backdrop-filter: blur(10px);
}
.profile-modal__panel {
    position: relative;
    width: min(520px, 100%);
    max-height: min(680px, calc(100vh - 48px));
    overflow-y: auto;
    padding: 24px;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 26px;
    background:
        radial-gradient(circle at 16% 0%, rgba(37, 99, 235, 0.18), transparent 18rem),
        var(--surface-solid);
    box-shadow: var(--shadow);
}
.profile-modal__description {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.55;
}
.profile-modal__status {
    margin-bottom: 14px;
}
.profile-modal-form {
    display: grid;
    gap: 16px;
}
.profile-modal-form--secondary {
    margin-top: 12px;
}
.profile-modal-form .profile-field span {
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}
.profile-modal .profile-action-form .button,
.profile-modal > .profile-modal__panel > .button {
    width: 100%;
}
.profile-vk-error {
    margin: 18px 0 0;
}
.profile-vk-code {
    margin: 18px 0 0;
    padding: 16px;
    color: var(--text);
    background: var(--surface-muted);
    border: 1px dashed var(--border);
    border-radius: 16px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    overflow-wrap: anywhere;
}
.profile-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.profile-modal-actions .button { flex: 1 1 180px; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .profile-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-action-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "icon body aside";
    }
}

@media (max-width: 900px) {
    .profile-hero { flex-direction: column; }
    .profile-hero__balance { min-width: 0; }
    .profile-setting-row, .profile-setting-row--contact { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .profile-hero__identity { align-items: flex-start; }
    .profile-action-card {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "icon body" "aside aside";
    }
    .profile-actions { grid-template-columns: 1fr; }
    .profile-action-card__aside, .profile-action-card__aside .button, .profile-action-form, .profile-action-form .button { width: 100%; }
    .profile-modal-actions { display: grid; }
}
.profile-action-card--link {
    color: inherit;
    text-decoration: none;
}
.profile-action-card--link:hover {
    transform: translateY(-1px);
}
.profile-danger-zone {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
    gap: 18px;
    align-items: stretch;
    margin-top: 22px;
    padding: 20px;
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(239, 68, 68, 0.10), transparent 58%),
        var(--surface);
}
.profile-danger-zone h2 {
    margin: 0 0 8px;
}
.profile-danger-zone p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}
.profile-action-card--danger {
    border-color: rgba(239, 68, 68, 0.26);
    background:
        radial-gradient(circle at 10% 0%, rgba(239, 68, 68, 0.16), transparent 15rem),
        var(--surface-muted);
}
.profile-action-card--danger .profile-action-card__icon,
.profile-modal__panel--danger .profile-action-card__icon {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
}
.profile-modal__panel--danger {
    border-color: rgba(239, 68, 68, 0.26);
    background:
        radial-gradient(circle at 16% 0%, rgba(239, 68, 68, 0.16), transparent 18rem),
        var(--surface-solid);
}
.profile-danger-list {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.45;
}
.profile-danger-list li::marker {
    color: #ef4444;
}

@media (max-width: 760px) {
    .profile-danger-zone {
        grid-template-columns: minmax(0, 1fr);
    }
}
