:root {
    --bg: #f3f8fb;
    --bg-deep: #dbefff;
    --card: rgba(255, 255, 255, 0.86);
    --card-strong: rgba(255, 255, 255, 0.92);
    --card-muted: rgba(240, 248, 255, 0.92);
    --line: rgba(34, 60, 80, 0.1);
    --text: #153047;
    --muted: #5a7488;
    --accent: #1f9bff;
    --accent-deep: #1170cf;
    --success: #1fa971;
    --danger: #d64747;
    --topbar-bg: rgba(255, 255, 255, 0.78);
    --input-bg: rgba(255, 255, 255, 0.92);
    --hover-bg: rgba(31, 155, 255, 0.12);
    --accent-soft: rgba(31, 155, 255, 0.1);
    --accent-soft-strong: rgba(31, 155, 255, 0.18);
    --quote-bg: linear-gradient(180deg, rgba(245, 251, 255, 0.98), rgba(225, 241, 255, 0.96));
    --quote-text: #153047;
    --quote-border: rgba(21, 48, 71, 0.1);
    --status-neutral: rgba(21, 48, 71, 0.08);
    --accent-card-bg: linear-gradient(160deg, rgba(31, 155, 255, 0.15), rgba(255, 255, 255, 0.92));
    --shadow: 0 24px 60px rgba(16, 84, 140, 0.15);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #071521;
    --bg-deep: #0c2435;
    --card: rgba(10, 24, 36, 0.82);
    --card-strong: rgba(12, 29, 43, 0.92);
    --card-muted: rgba(14, 34, 49, 0.92);
    --line: rgba(150, 203, 244, 0.14);
    --text: #e9f5ff;
    --muted: #8aa7ba;
    --accent: #39a8ff;
    --accent-deep: #8ed4ff;
    --success: #49d79a;
    --danger: #ff8a8a;
    --topbar-bg: rgba(8, 20, 30, 0.84);
    --input-bg: rgba(8, 20, 30, 0.92);
    --hover-bg: rgba(57, 168, 255, 0.16);
    --accent-soft: rgba(57, 168, 255, 0.14);
    --accent-soft-strong: rgba(57, 168, 255, 0.24);
    --quote-bg: linear-gradient(180deg, rgba(6, 16, 25, 0.98), rgba(10, 36, 56, 0.98));
    --quote-text: #eff8ff;
    --quote-border: rgba(255, 255, 255, 0.12);
    --status-neutral: rgba(233, 245, 255, 0.08);
    --accent-card-bg: linear-gradient(160deg, rgba(31, 155, 255, 0.18), rgba(10, 24, 36, 0.96));
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(31, 155, 255, 0.28), transparent 24%),
        radial-gradient(circle at bottom right, rgba(7, 205, 172, 0.16), transparent 20%),
        linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
button {
    font: inherit;
}

.page-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px;
}

.topbar,
.hero,
.info-card,
.purchase-card,
.dashboard-card,
.auth-card,
.message {
    backdrop-filter: blur(18px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px 22px;
    background: var(--topbar-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-copy {
    display: grid;
    gap: 2px;
}

.brand-status {
    font-size: 0.82rem;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand small,
.small-note,
.footer p,
.point-card span,
.quote-panel span,
.eyebrow {
    color: var(--muted);
}

.brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #64dcff 100%);
    color: white;
    font-size: 22px;
    font-weight: 800;
}

.topnav {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
}

.topbar-actions {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 18px;
    justify-content: center;
    min-width: 0;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 0;
}

.topbar .brand {
    flex: 0 0 auto;
}

.topbar .topnav {
    margin: 0 auto;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle:hover {
    background: var(--hover-bg);
}

.menu-toggle-line {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: var(--hover-bg);
    transform: translateY(-1px);
}

.theme-toggle-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #64dcff 100%);
    color: #fff;
    font-size: 0.95rem;
}

.theme-toggle-label {
    font-weight: 700;
}

.topnav a {
    padding: 10px 12px;
    border-radius: 999px;
    white-space: nowrap;
    transition: 0.2s ease;
}

.topnav a:hover {
    background: var(--hover-bg);
    color: var(--accent-deep);
}

.messages {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.message {
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--card-strong);
    border: 1px solid var(--line);
}

.message.success {
    border-color: rgba(31, 169, 113, 0.25);
}

.message.error {
    border-color: rgba(214, 71, 71, 0.3);
}

.alert {
    padding: 15px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--card-strong);
    color: var(--text);
}

.alert-info {
    border-color: rgba(57, 168, 255, 0.24);
    background: rgba(57, 168, 255, 0.1);
}

.alert-success {
    border-color: rgba(31, 169, 113, 0.28);
    background: rgba(31, 169, 113, 0.1);
}

.alert-warning {
    border-color: rgba(255, 186, 72, 0.28);
    background: rgba(255, 186, 72, 0.12);
}

.alert-error {
    border-color: rgba(214, 71, 71, 0.3);
    background: rgba(214, 71, 71, 0.1);
}

.idle-logout-alert {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(420px, calc(100vw - 28px));
    z-index: 1200;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.username-check {
    margin-top: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.username-check-loading {
    color: var(--text-secondary, #888);
    background: var(--surface-2, rgba(255,255,255,0.05));
}

.username-check-ok {
    color: var(--success, #4caf50);
    background: color-mix(in srgb, var(--success, #4caf50) 12%, transparent);
}

.username-check-fail {
    color: var(--danger, #f44336);
    background: color-mix(in srgb, var(--danger, #f44336) 12%, transparent);
}

.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;
}

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.hero-copy,
.purchase-card,
.info-card,
.dashboard-card,
.auth-card,
.footer-shell {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 36px;
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 0;
}

.hero-copy::after {
    content: '';
    position: absolute;
    inset: auto -40px -70px auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(100, 220, 255, 0.28), transparent 62%);
    pointer-events: none;
}

.hero-copy h1,
.auth-card h1,
.dashboard-card h1 {
    margin: 12px 0 16px;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    line-height: 0.98;
}

.hero-copy p {
    max-width: 680px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    border: 1px solid var(--line);
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.hero-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hero-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--card);
    font-weight: 700;
}

.hero-secondary:hover {
    background: var(--hover-bg);
    color: var(--accent-deep);
}

.hero-inline-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: var(--muted);
}

.hero-live-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.hero-live-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--card-muted);
    border: 1px solid rgba(31, 155, 255, 0.14);
}

.hero-live-card-primary {
    background: var(--accent-card-bg);
}

.hero-live-label,
.hero-live-meta,
.hero-live-board-head span {
    color: var(--muted);
}

.hero-live-label {
    font-size: 0.88rem;
}

.hero-live-value {
    display: block;
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    line-height: 1;
}

.hero-live-meta {
    font-size: 0.88rem;
    line-height: 1.5;
}

.hero-live-board {
    display: grid;
    gap: 14px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.hero-live-board-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.hero-live-board-head strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.hero-live-updated {
    font-size: 0.84rem;
    white-space: nowrap;
}

.hero-live-stream {
    display: grid;
    gap: 10px;
}

.hero-live-stream-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(31, 155, 255, 0.12);
    background: rgba(255, 255, 255, 0.34);
    transition: transform 0.2s ease, background 0.2s ease;
}

.hero-live-stream-item.is-fresh {
    transform: translateY(-2px);
    background: rgba(31, 155, 255, 0.08);
}

.hero-live-stream-user,
.hero-live-stream-amount {
    font-weight: 700;
}

.hero-live-stream-state {
    color: var(--muted);
    text-align: right;
}

.hero-inline-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, #64dcff 100%);
    box-shadow: 0 0 0 6px var(--accent-soft);
}

.hero-points,
.stats-grid,
.info-grid,
.dashboard-grid {
    display: grid;
    gap: 16px;
}

.hero-points,
.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
}

.point-card,
.stats-grid > div {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--card-muted);
    border: 1px solid rgba(31, 155, 255, 0.14);
}

.point-card {
    position: relative;
    overflow: hidden;
}

.point-card::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #64dcff);
    opacity: 0.7;
}

.point-card strong,
.stats-grid strong {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.purchase-card,
.auth-card {
    border-radius: var(--radius-xl);
    padding: 28px;
}

.purchase-section {
    display: grid;
    gap: 18px;
    margin-bottom: 24px;
}

.purchase-card-wide {
    width: 100%;
}

.purchase-card-wide .card-head {
    display: grid;
    gap: 14px;
    margin-bottom: 22px;
}

.purchase-card-wide .card-head h2 {
    margin: 0;
    max-width: none;
    white-space: nowrap;
    font-size: clamp(2.6rem, 5vw, 4.8rem);
    line-height: 0.94;
    letter-spacing: -0.04em;
}

.purchase-card-wide .card-head p {
    margin: 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}

.order-form,
.auth-card {
    display: grid;
    gap: 16px;
}

.order-form label,
.auth-card label,
.ref-box {
    display: grid;
    gap: 8px;
}

.order-form input,
.auth-card input,
.ref-box input {
    width: 100%;
    padding: 15px 16px;
    border-radius: 16px;
    border: 1px solid rgba(32, 75, 109, 0.14);
    background: var(--input-bg);
    color: var(--text);
}

.quick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-btn,
.cta-button {
    border: none;
    cursor: pointer;
}

.quick-btn {
    padding: 11px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
}

.quick-btn:hover {
    background: var(--accent-soft-strong);
}

.inline-options {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.checkbox-row {
    display: flex !important;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-row:hover {
    border-color: rgba(57, 168, 255, 0.24);
    background: var(--hover-bg);
}

.checkbox-row input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 5px;
    border: 1px solid rgba(57, 168, 255, 0.34);
    background: transparent;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.checkbox-row input[type="checkbox"]::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.16s ease;
    margin-top: -2px;
}

.checkbox-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent), #44d8ff);
    border-color: transparent;
}

.checkbox-row input[type="checkbox"]:checked::after {
    transform: rotate(-45deg) scale(1);
}

.checkbox-row span {
    color: var(--text);
    font-weight: 600;
    font-size: 0.96rem;
}

.quote-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    background: var(--quote-bg);
    color: var(--quote-text);
    border: 1px solid var(--quote-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.quote-panel > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.quote-panel strong,
.quote-panel small {
    color: var(--quote-text);
}

.quote-panel > div:not(.quote-total) strong {
    font-size: 1.15rem;
}

.hero-trustbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.hero-trustbar div {
    display: grid;
    gap: 6px;
}

.hero-trustbar strong {
    font-size: 0.98rem;
}

.hero-trustbar span {
    color: var(--muted);
    line-height: 1.5;
}

.quote-total {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--quote-border);
}

.quote-total strong {
    font-size: 1.8rem;
}

.cta-button {
    padding: 16px 20px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--accent) 0%, #44d8ff 100%);
    color: white;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.cta-button:hover {
    transform: translateY(-1px);
}

.cta-button:disabled,
.cta-button[aria-disabled="true"] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.2);
}

.form-errors {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(214, 71, 71, 0.08);
    border: 1px solid rgba(214, 71, 71, 0.18);
    color: #982d2d;
}

.info-grid,
.dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card,
.dashboard-card {
    padding: 26px;
    border-radius: var(--radius-xl);
}

.info-card.accent {
    background: var(--accent-card-bg);
}

.info-card {
    display: grid;
    gap: 16px;
}

.info-card h3 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.1;
}

.info-lead {
    margin: 0;
    color: var(--text);
    line-height: 1.7;
}

.info-list,
.info-steps,
.discount-ladder {
    margin: 0;
    padding: 0;
}

.info-list,
.info-steps {
    display: grid;
    gap: 12px;
    list-style: none;
}

.info-list li,
.info-steps li {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--card-strong);
    border: 1px solid var(--line);
}

.info-steps {
    counter-reset: info-step;
}

.info-steps li {
    position: relative;
    padding-left: 58px;
}

.info-steps li::before {
    counter-increment: info-step;
    content: counter(info-step);
    position: absolute;
    top: 15px;
    left: 16px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, #64dcff 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
}

.info-list li {
    grid-template-columns: 1fr;
}

.info-list li::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-top: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 6px var(--accent-soft);
}

.info-list li {
    position: relative;
    padding-left: 32px;
}

.info-list li::before {
    position: absolute;
    left: 14px;
    top: 0;
}

.info-list li,
.info-steps li span {
    color: var(--muted);
    line-height: 1.6;
}

.info-list li span {
    color: var(--muted);
    line-height: 1.6;
}

.info-list li strong {
    display: block;
    margin-bottom: 2px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.info-list li,
.info-steps li strong,
.discount-tier strong {
    color: var(--text);
}

.discount-ladder {
    display: grid;
    gap: 10px;
}

.discount-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--card-strong);
}

.discount-tier span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 800;
}

.dashboard-grid {
    grid-template-columns: 1.1fr 1fr;
}

.hero-card {
    grid-column: 1 / -1;
}

.cabinet-hero {
    display: grid;
    gap: 20px;
}

.cabinet-hero-head {
    display: grid;
    gap: 10px;
}

.cabinet-hero-user {
    width: fit-content;
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card-muted);
    color: var(--text);
    font-weight: 700;
    line-height: 1.2;
}

.cabinet-hero-lead {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.7;
}

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

.cabinet-kpi {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--card-strong);
}

.cabinet-kpi span {
    color: var(--muted);
    line-height: 1.5;
}

.cabinet-kpi strong {
    font-size: 1.4rem;
    line-height: 1.1;
}

.ref-box-hero {
    gap: 10px;
}

.ref-box-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.ref-copy-btn {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    font-weight: 700;
    padding: 0 16px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ref-copy-btn:hover {
    background: var(--accent-soft-strong);
    transform: translateY(-1px);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.status {
    display: inline-flex;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.9rem;
    background: var(--status-neutral);
}

.status-completed {
    background: rgba(31, 169, 113, 0.16);
    color: var(--success);
}

.status-failed,
.status-cancelled {
    background: rgba(214, 71, 71, 0.15);
    color: var(--danger);
}

.status-processing,
.status-queued {
    background: rgba(31, 155, 255, 0.14);
    color: var(--accent-deep);
}

.footer {
    margin-top: 24px;
    color: var(--text);
}

.footer-shell {
    position: relative;
    overflow: hidden;
    overflow: clip;
    isolation: isolate;
    display: grid;
    gap: 22px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--topbar-bg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.footer-grid,
.footer-side-grid,
.footer-column,
.footer-brand-panel,
.footer-subrow,
.footer-payments-row {
    display: grid;
    gap: 14px;
}

.footer-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.9fr);
    gap: 28px;
    align-items: start;
}

.footer-side-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.footer-brand-panel {
    gap: 18px;
}

.footer-brand-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.footer-brand-mark {
    flex: 0 0 auto;
}

.footer-brand-copy {
    display: grid;
    gap: 10px;
}

.footer-brand-copy strong {
    display: block;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.08;
}

.footer-brand-copy p {
    margin: 0;
    line-height: 1.6;
    color: var(--muted);
}

.footer-trustline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-trustline span {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--card-muted);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer h3 {
    margin: 0;
    font-size: 0.92rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-column a,
.footer-muted {
    width: fit-content;
    color: var(--text);
    line-height: 1.5;
}

.footer-link-strong {
    font-weight: 700;
}

.footer-column a:hover {
    color: var(--accent-deep);
}

.footer-muted {
    color: var(--muted);
}

.footer-caption {
    color: var(--text);
    font-size: 0.9rem;
}

.footer-subrow {
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.footer-payments-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
}

.footer-payments-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-bottom a {
    color: var(--muted);
}

.payment-grid {
    display: contents;
}

.payment-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card-strong);
}

.payment-badge img {
    width: 100%;
    max-width: 154px;
    max-height: 36px;
    height: 100%;
    object-fit: contain;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.auth-card {
    width: min(100%, 520px);
}

@media (max-width: 920px) {
    .hero,
    .info-grid,
    .dashboard-grid,
    .hero-points,
    .stats-grid,
    .hero-trustbar {
        grid-template-columns: 1fr;
    }

    .hero-live-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-side-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topbar {
        align-items: flex-start;
        gap: 16px;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
    }

    .topnav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        border-radius: 22px;
    }

    .topnav a {
        min-height: 42px;
    }

    .theme-toggle {
        min-width: 124px;
    }

    .cabinet-kpis {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 16px;
    }

    .hero-actions,
    .hero-inline-note,
    .hero-live-board-head,
    .ref-box-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-secondary,
    .hero-primary {
        width: 100%;
    }

    .hero-copy,
    .purchase-card,
    .info-card,
    .dashboard-card,
    .auth-card {
        padding: 20px;
    }

    .hero-live-grid {
        grid-template-columns: 1fr;
    }

    .hero-live-stream-item {
        grid-template-columns: 1fr;
    }

    .hero-live-stream-state {
        text-align: left;
    }

    .footer-shell {
        padding: 20px;
    }

    .footer-payments-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .hero-copy h1,
    .auth-card h1,
    .dashboard-card h1 {
        font-size: 2.2rem;
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
        padding: 14px;
        border-radius: 18px;
    }

    .brand {
        min-width: 0;
        gap: 10px;
        align-items: flex-start;
    }

    .brand-copy,
    .topnav,
    .theme-toggle,
    .menu-toggle {
        font-family: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", "Fira Code", monospace;
    }

    .brand-copy {
        position: static;
        padding-left: 0;
    }

    .brand strong {
        font-size: 0.92rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .brand-status {
        font-size: 0.72rem;
        letter-spacing: 0.12em;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        font-size: 17px;
    }

    .topbar-actions {
        display: contents;
    }

    .topbar-controls {
        display: contents;
    }

    .menu-toggle {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: start;
    }

    .topbar[data-menu-open="true"] .menu-toggle {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-self: stretch;
        justify-content: center;
        border-radius: 12px;
    }

    .theme-toggle {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        padding: 10px 12px;
        border-radius: 12px;
        justify-content: center;
    }

    .topbar[data-menu-open="true"] .theme-toggle {
        grid-row: 3;
    }

    .theme-toggle-label {
        font-size: 0.78rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .topnav {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        width: 100%;
        margin-top: 0;
        padding: 10px;
        border-radius: 14px;
        border-style: dashed;
        transform-origin: top;
        transition: opacity 0.18s ease, transform 0.18s ease, max-height 0.18s ease, padding 0.18s ease, margin 0.18s ease;
    }

    .topnav[data-open="false"] {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        padding-top: 0;
        padding-bottom: 0;
        margin-top: 0;
        border-width: 0;
        transform: translateY(-6px);
    }

    .topnav[data-open="true"] {
        max-height: 320px;
        opacity: 1;
        transform: translateY(0);
    }

    .topbar[data-menu-open="true"] .topnav {
        grid-row: 4;
    }

    .theme-toggle,
    .menu-toggle {
        flex: 0 0 auto;
    }

    .topnav a {
        min-height: 46px;
        padding: 12px 13px;
        border-radius: 10px;
        border: 1px solid var(--line);
        background: var(--card);
        font-size: 0.82rem;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .topnav a::before {
        content: '> ';
        color: var(--accent-deep);
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle[aria-expanded="true"] .menu-toggle-line:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .footer-brand-row {
        align-items: center;
    }

    .footer-actions,
    .payment-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-side-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-payments-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
