:root {
    color-scheme: dark;
    --bg-color: #0b0c10;
    --text-primary: #ffffff;
    --text-secondary: #8b92a5;
    --accent: #bb86fc;
    --accent-hover: #9965f4;
    --cyan: #00d2ff;
    --danger: #ff5d73;
    --success: #4ade80;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-light: rgba(255, 255, 255, 0.09);
    --border: rgba(255, 255, 255, 0.1);
    --auth-surface: rgba(14, 17, 26, 0.72);
    --auth-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
    --font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(157, 80, 187, 0.12) 0%, rgba(157, 80, 187, 0.05) 15%, transparent 35%),
        radial-gradient(circle at bottom right, rgba(0, 210, 255, 0.09) 0%, rgba(0, 210, 255, 0.04) 15%, transparent 34%),
        var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
.auth-btn,
.support-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

#entropy-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.3;
}

.orb-1 {
    top: 0;
    left: 0;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    transform: translate(-25%, -20%);
    background: radial-gradient(circle at center, rgba(157, 80, 187, 0.8), rgba(157, 80, 187, 0.25) 48%, transparent 100%);
}

.orb-2 {
    right: 0;
    bottom: 0;
    width: 38vw;
    height: 38vw;
    max-width: 500px;
    max-height: 500px;
    transform: translate(20%, 15%);
    background: radial-gradient(circle at center, rgba(0, 210, 255, 0.7), rgba(0, 210, 255, 0.2) 52%, transparent 100%);
    opacity: 0.22;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: min(100%, 1920px);
    min-height: 78px;
    margin: 0 auto;
    padding: 20px 24px 0;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 64px;
    height: 64px;
    overflow: visible;
    transform: translateY(4px);
}

.draw-path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw-in 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.bolt-v5 {
    animation-delay: 0.4s;
}

.wifi-arc {
    opacity: 0;
}

.wifi-1 {
    animation: arc-appear 0.4s ease-out 0.7s forwards;
}

.wifi-2 {
    animation: arc-appear 0.4s ease-out 0.9s forwards;
}

.wifi-3 {
    animation: arc-appear 0.4s ease-out 1.1s forwards, arc-flicker-3 12s 2s infinite;
}

.wifi-4 {
    animation: arc-appear 0.4s ease-out 1.3s forwards, arc-flicker-4 12s 2s infinite;
}

@keyframes draw-in {
    to { stroke-dashoffset: 0; }
}

@keyframes arc-appear {
    to { opacity: 1; }
}

@keyframes arc-flicker-3 {
    0%, 58% { opacity: 1; }
    60%, 75% { opacity: 0; }
    77%, 100% { opacity: 1; }
}

@keyframes arc-flicker-4 {
    0%, 8% { opacity: 1; }
    10%, 15% { opacity: 0; }
    17%, 23% { opacity: 1; }
    25%, 43% { opacity: 0; }
    45%, 53% { opacity: 1; }
    55%, 79% { opacity: 0; }
    81%, 100% { opacity: 1; }
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-height: 44px;
}

.site-nav {
    flex-wrap: wrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.nav-link:hover {
    color: var(--text-primary);
}

.inline-form {
    margin: 0;
}

.content {
    flex: 1;
    width: 100%;
    max-width: min(100%, 1920px);
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.bottom-footer {
    position: relative;
    z-index: 1;
    padding: 24px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.875rem;
}

body.auth-page {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.016), rgba(255, 255, 255, 0) 14%, rgba(255, 255, 255, 0.012) 28%, rgba(255, 255, 255, 0) 44%, rgba(255, 255, 255, 0.015) 62%, rgba(255, 255, 255, 0) 78%, rgba(255, 255, 255, 0.012)),
        radial-gradient(circle at 50% 34%, rgba(255, 255, 255, 0.018), transparent 20%),
        radial-gradient(circle at 14% 18%, rgba(157, 80, 187, 0.11), transparent 24%),
        radial-gradient(circle at 88% 82%, rgba(0, 210, 255, 0.09), transparent 24%),
        var(--bg-color);
}

body.auth-page .glass-orbs {
    opacity: 0.8;
}

body.auth-page .orb-1 {
    top: 8%;
    left: 12%;
    width: 28vw;
    height: 28vw;
    max-width: 300px;
    max-height: 300px;
    transform: translate(-42%, -42%);
    opacity: 0.11;
}

body.auth-page .orb-2 {
    right: 10%;
    bottom: 6%;
    width: 26vw;
    height: 26vw;
    max-width: 280px;
    max-height: 280px;
    transform: translate(40%, 34%);
    opacity: 0.08;
}

body.auth-page .content {
    max-width: 100%;
    padding-top: 0;
    padding-bottom: 12px;
}

body.auth-page .logo-icon {
    width: 70px;
    height: 70px;
}

body.auth-page .logo {
    font-size: 1.36rem;
}

.auth-shell {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: auto;
    padding: clamp(36px, 8vh, 66px) 0 46px;
}

.auth-container {
    width: min(100%, 420px);
    margin: 0 auto;
    padding: 32px;
    border-radius: 18px;
    border: 1px solid var(--auth-border);
    background: linear-gradient(180deg, rgba(24, 28, 40, 0.8), var(--auth-surface));
    backdrop-filter: blur(18px) saturate(130%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 2rem;
    line-height: 1.12;
    letter-spacing: 0;
}

.auth-methods,
.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form {
    gap: 12px;
}

.auth-form-hidden,
.hidden,
[hidden] {
    display: none !important;
}

.auth-subtitle-soft {
    margin: -8px 0 20px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 14px;
}

.auth-divider {
    margin: 16px 0;
    color: var(--text-secondary);
    text-align: center;
    font-size: 0.875rem;
}

.auth-input,
input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-primary);
    outline: none;
}

.auth-input::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.auth-input:focus,
input:focus,
textarea:focus,
select:focus {
    border-color: rgba(0, 210, 255, 0.35);
    background: rgba(3, 7, 18, 0.34);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.08);
}

textarea {
    resize: vertical;
}

.auth-btn,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--text-primary);
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

.auth-btn:hover,
.button:hover {
    transform: translateY(-1px);
}

.auth-btn:disabled,
.button:disabled {
    cursor: not-allowed;
    transform: none;
    opacity: 0.72;
}

.auth-btn-primary,
.button.primary {
    background: var(--accent);
    color: #05070c;
}

.auth-btn-primary:hover,
.button.primary:hover {
    background: var(--accent-hover);
}

.auth-btn-secondary,
.button.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.08);
}

.auth-btn-secondary:hover,
.button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-logout {
    width: auto;
    min-width: 112px;
    padding-inline: 18px;
}

.auth-link-btn,
.link-button {
    align-self: center;
    margin-top: 8px;
    border: 0;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
}

.auth-link-btn:hover,
.link-button:hover {
    color: #fff;
}

.auth-link-btn.danger,
.link-button.danger,
.danger {
    color: var(--danger);
}

.auth-note {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    font-size: 0.875rem;
}

.auth-note-muted {
    margin-top: 8px;
    color: var(--text-secondary);
}

.auth-error,
.checkout-error,
.alert {
    border-radius: 12px;
    padding: 12px 14px;
    color: #ffb9c2;
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.22);
    font-size: 14px;
}

.auth-error {
    min-height: 0;
    text-align: center;
}

.auth-error:empty {
    display: none;
}

.auth-error-banner,
.checkout-error,
.alert {
    margin: 0 0 16px;
}

.alert.success {
    color: #d7ffe4;
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.1);
}

.auth-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.auth-form-footer-center {
    justify-content: center;
}

.telegram-auth-block {
    width: 100%;
    margin-bottom: 18px;
}

.telegram-login-card {
    width: 80%;
    min-height: 40px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(77, 170, 235, 0.5);
    background: #4aa8e9;
    color: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 15px;
}

.telegram-login-card strong {
    white-space: nowrap;
}

.telegram-login-card small {
    display: none;
}

.telegram-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.telegram-avatar svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: currentColor;
}

.dashboard-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px;
}

.db-header,
.page-header,
.panel-head,
.sub-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.db-header-main {
    min-width: 0;
}

.db-header-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 240px;
}

.dashboard-title,
.page-header h1 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.6rem);
    line-height: 1.05;
    letter-spacing: 0;
}

.dashboard-subtitle,
.page-header p,
.muted,
.setup-help,
.invite-note,
.tile p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.balance-badge {
    width: fit-content;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 210, 255, 0.1);
    color: var(--cyan);
    border: 1px solid rgba(0, 210, 255, 0.3);
    font-size: 13px;
    font-weight: 600;
}

.account-summary-card,
.dashboard-panel,
.panel,
.hero-panel,
.tile {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
}

.dashboard-panel,
.panel,
.hero-panel,
.tile {
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
}

.panel-title,
.panel h2,
.form-panel h2 {
    margin: 0 0 20px;
    font-size: 1.35rem;
}

.account-summary-card {
    width: 100%;
    max-width: 320px;
    padding: 12px 14px;
    display: grid;
    gap: 10px;
}

.account-summary-row,
.sub-info-row,
.summary-row,
.waiting-detail-row,
.metric-row,
.metric-list > div,
.table-row,
.check-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.account-summary-label,
.sub-info-label,
.summary-row span,
.waiting-detail-row span,
.metric-row span,
.metric-list span {
    color: var(--text-secondary);
}

.account-summary-email {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: right;
}

.sub-card,
.sub-card-no,
.summary-card,
.waiting-card-details {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(6, 10, 18, 0.46);
}

.sub-card,
.sub-card-no {
    margin-bottom: 18px;
}

.sub-card-header {
    align-items: center;
    margin-bottom: 18px;
}

.sub-card-header h2,
.sub-card-header h3,
.sub-card-no h3 {
    margin: 0;
}

.sub-card-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--cyan);
    color: #04111f;
    font-size: 12px;
    font-weight: 700;
}

.sub-info-grid,
.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0;
}

.sub-info-box,
.metric-grid > div {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.sub-info-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

.sub-meta-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid-single {
    grid-template-columns: 1fr;
}

.stat-box {
    padding: 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.stat-value {
    margin-bottom: 4px;
    font-size: 24px;
    font-weight: 800;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.dashboard-cta-row,
.step-actions,
.waiting-actions,
.setup-footer-actions,
.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.dashboard-cta-link,
.checkout-action-link {
    width: auto;
    min-width: 180px;
}

.checkout-actions {
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.checkout-actions .checkout-action-primary {
    min-width: 210px;
    margin-left: auto;
}

.constructor-page .dashboard-panel {
    margin-bottom: 20px;
}

.constructor-section {
    margin-bottom: 28px;
}

.constructor-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.constructor-label strong,
.constructor-label span {
    color: var(--text-primary);
    font-weight: 700;
}

.constructor-slider {
    position: relative;
}

.slider-track {
    --slider-progress: 0%;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--slider-progress), rgba(255, 255, 255, 0.1) var(--slider-progress), rgba(255, 255, 255, 0.1) 100%);
    outline: none;
    cursor: pointer;
}

.slider-track::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

.slider-track::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    margin-top: -8px;
    border-radius: 50%;
    appearance: none;
    background: var(--accent);
    cursor: grab;
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.5);
}

.slider-track::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
}

.slider-track::-moz-range-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--accent);
}

.slider-track::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    cursor: grab;
    box-shadow: 0 0 10px rgba(187, 134, 252, 0.5);
}

.slider-labels {
    position: relative;
    height: 18px;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 12px;
    pointer-events: none;
}

.slider-labels span {
    position: absolute;
    left: var(--label-position, 0%);
    transform: translateX(-50%);
    white-space: nowrap;
}

.slider-labels span:first-child {
    left: 0;
    transform: none;
}

.slider-labels span:last-child {
    left: 100%;
    transform: translateX(-100%);
}

.slider-ruler {
    position: relative;
    height: 12px;
    margin-top: 12px;
}

.slider-ruler::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.slider-ruler span {
    position: absolute;
    left: var(--tick-position, 0%);
    top: 0;
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.22);
    transform: translateX(-50%);
}

.month-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.month-input-label,
.month-input-suffix,
.promo-hint {
    color: var(--text-secondary);
    font-size: 13px;
}

.month-input {
    width: 72px;
    min-height: 38px;
    padding: 8px 10px;
    text-align: center;
    font-size: 14px;
}

.promo-row {
    display: flex;
    gap: 8px;
}

.promo-input {
    flex: 1;
    text-transform: uppercase;
}

.promo-apply-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 12px 20px;
}

.promo-hint {
    margin-top: 8px;
}

.price-display {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.quote-state {
    margin-bottom: 8px;
    color: var(--cyan);
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.price-row strong {
    color: var(--text-primary);
    font-size: 16px;
}

.price-row-total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.price-total,
.total-price,
.total strong {
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.5rem !important;
    font-weight: 800;
}

.price-discount strong {
    color: var(--success);
}

.payment-method-title {
    margin-bottom: 12px;
    font-size: 16px;
}

.payment-option {
    display: block;
    cursor: pointer;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 210, 255, 0.26);
}

.pay-icon {
    flex: 0 0 auto;
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
}

.pay-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.option-title {
    font-weight: 700;
}

.option-desc {
    color: var(--text-secondary);
    font-size: 13px;
}

.pay-check {
    color: var(--cyan);
    font-size: 20px;
    font-weight: 800;
}

.summary-card {
    margin-bottom: 20px;
}

.summary-details {
    display: grid;
    gap: 12px;
}

.summary-row,
.waiting-detail-row,
.metric-row,
.metric-list > div,
.table-row,
.check-row {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-row:last-child,
.waiting-detail-row:last-child,
.metric-row:last-child,
.metric-list > div:last-child,
.table-row:last-child,
.check-row:last-child {
    border-bottom: 0;
}

.summary-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.waiting-card-details,
.checkout-payment-card {
    margin-top: 20px;
}

.copy-box,
.setup-copy-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.copy-input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-primary);
    font-size: 13px;
    text-overflow: ellipsis;
}

.btn-copy {
    width: auto;
    min-width: 118px;
    padding: 10px 16px;
    font-size: 14px;
    white-space: nowrap;
}

.qr-wrapper {
    display: inline-block;
    padding: 16px;
    border-radius: 12px;
    background: #fff;
}

.qr,
.invite-qr-image {
    display: block;
    width: 200px;
    height: 200px;
}

.activation-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.device-counter {
    color: var(--text-secondary);
    font-size: 14px;
}

.device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.device-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

.history-card-link {
    color: inherit;
    text-decoration: none;
}

.device-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.device-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--cyan);
    font-size: 12px;
    font-weight: 800;
}

.device-info {
    flex: 1;
    min-width: 0;
}

.device-name {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-status {
    color: var(--text-secondary);
    font-size: 12px;
}

.device-status-pill {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.device-status-active {
    color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.device-status-pending {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.device-status-revoked {
    color: #ff8f8f;
    background: rgba(255, 93, 115, 0.12);
    border: 1px solid rgba(255, 93, 115, 0.3);
}

.device-card-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.device-card-btn {
    width: auto;
    min-width: 0;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 12px;
}

.device-create-form {
    max-width: 420px;
}

.section-grid,
.dashboard-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.span-2 {
    grid-column: span 2;
}

.tile {
    display: block;
    min-height: 180px;
    color: inherit;
    text-decoration: none;
}

.tile strong {
    display: block;
    margin-top: 8px;
    font-size: 20px;
}

.tile-kicker {
    color: var(--cyan);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.hero-band {
    min-height: 520px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    gap: 40px;
    align-items: center;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.95;
}

.hero-copy p {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--text-secondary);
    font-size: 20px;
}

.home-hero {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.narrow {
    max-width: 540px;
    margin-inline: auto;
}

#support-widget {
    position: fixed;
    right: max(24px, calc((100vw - 1920px) / 2 + 24px));
    bottom: max(24px, calc((100vh - 1080px) / 2 + 24px));
    z-index: 100;
}

.support-btn {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: white;
    font-size: 24px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.support-btn:hover {
    transform: scale(1.05);
    background-color: rgba(0, 210, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.6);
}

.support-btn-icon {
    line-height: 1;
    font-weight: 800;
}

.support-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-unread-hidden {
    display: none;
}

.support-chat-window {
    display: none;
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 320px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(14, 17, 26, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.support-widget-open .support-chat-window {
    display: flex;
    animation: slide-up 0.3s ease;
}

.support-widget-open .support-btn {
    background-color: var(--accent);
}

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

.support-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border);
}

.support-chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-support-btn {
    border: 0;
    background: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.close-support-btn:hover {
    color: #fff;
}

.support-chat-body {
    min-height: 200px;
    max-height: 300px;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.support-msg-system,
.support-msg-support,
.support-msg-user {
    max-width: 85%;
    padding: 10px;
    word-wrap: break-word;
}

.support-msg-system {
    max-width: 100%;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    text-align: center;
}

.support-msg-support {
    align-self: flex-start;
    border-radius: 12px 12px 12px 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.support-msg-user {
    align-self: flex-end;
    border-radius: 12px 12px 0 12px;
    background: var(--accent);
    color: #000;
}

.support-msg-accent {
    color: var(--accent);
}

.support-msg-error {
    color: #ff8f8f;
}

.support-chat-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}

.support-chat-footer textarea {
    resize: none;
}

.support-send-btn {
    padding: 8px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    cursor: pointer;
}

.support-send-btn:hover {
    background: var(--accent-hover);
}

.support-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (min-width: 768px) {
    .logo-icon {
        width: 77px;
        height: 77px;
    }

    .logo {
        font-size: 1.5rem;
    }

    body.auth-page .auth-container {
        width: min(100%, 432px);
        padding: 34px;
    }
}

@media (max-width: 900px) {
    .hero-band,
    .section-grid,
    .dashboard-grid,
    .form-grid,
    .activation-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .metric-grid,
    .stats-grid,
    .sub-info-grid {
        grid-template-columns: 1fr;
    }

    .db-header-side {
        width: 100%;
        align-items: stretch;
    }

    .account-summary-card {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .top-nav {
        padding: 14px 16px 0;
        align-items: flex-start;
    }

    .site-nav {
        gap: 8px;
        font-size: 13px;
    }

    .nav-link {
        display: none;
    }

    .nav-link-auth {
        display: inline;
    }

    .content {
        padding: 16px;
    }

    .dashboard-container {
        padding: 16px 0;
    }

    .dashboard-panel,
    .panel,
    .hero-panel,
    .tile {
        padding: 20px;
    }

    .auth-shell {
        min-height: calc(100vh - 196px);
        padding-top: 28px;
    }

    .auth-container {
        width: min(100%, 392px);
        padding: 24px 20px;
    }

    .month-input-row,
    .promo-row,
    .copy-box,
    .setup-copy-box,
    .checkout-actions,
    .summary-total-box,
    .summary-row,
    .waiting-detail-row,
    .check-row {
        flex-direction: column;
        align-items: stretch;
    }

    .promo-apply-btn,
    .dashboard-cta-link,
    .checkout-action-link,
    .checkout-actions .checkout-action-primary,
    .btn-copy {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .device-card {
        flex-wrap: wrap;
    }

    .device-card-actions {
        width: 100%;
        justify-content: space-between;
    }

    #support-widget {
        right: 16px;
        bottom: 16px;
    }

    .support-chat-window {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 88px;
        width: auto;
        max-height: min(72vh, 520px);
    }

    .support-chat-body {
        max-height: 42vh;
    }

    .telegram-login-card {
        width: 86%;
        gap: 8px;
        font-size: 14px;
    }

    .telegram-avatar {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }
}
