:root {
    --bg: #08050f;
    --bg-soft: #0e0920;
    --surface: rgba(28, 18, 56, 0.55);
    --surface-strong: rgba(38, 24, 74, 0.78);
    --stroke: rgba(154, 108, 255, 0.22);
    --stroke-strong: rgba(168, 128, 255, 0.45);
    --violet: #8b5cf6;
    --violet-bright: #a78bfa;
    --magenta: #d946ef;
    --cyan: #22d3ee;
    --green: #34d399;
    --amber: #fbbf24;
    --text: #ece7ff;
    --text-dim: #9a90bf;
    --radius: 20px;
    --safe-top: 0px;
    --safe-bottom: 0px;
    --gutter: clamp(14px, 4.5vw, 32px);
    --app-h: 100dvh;
    --card-min: 280px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: var(--app-h, 100dvh);
    min-height: var(--app-h, 100dvh);
    overscroll-behavior: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.35;
    user-select: none;
    -webkit-user-select: none;
}

.bg-grid,
.bg-glow {
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.07) 1px, transparent 1px);
    background-size: 34px 34px;
    mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 85%);
}

.bg-glow {
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
}

.bg-glow--one {
    top: -180px;
    left: -140px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.85), transparent 68%);
    animation: float 14s ease-in-out infinite;
}

.bg-glow--two {
    bottom: -220px;
    right: -160px;
    background: radial-gradient(circle, rgba(217, 70, 239, 0.55), transparent 68%);
    animation: float 18s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(28px, 36px, 0); }
}

.app {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    min-height: var(--app-h, 100dvh);
    height: var(--app-h, 100dvh);
    padding-top: var(--safe-top);
    container-type: inline-size;
    container-name: app;
}

/* ---------- topbar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px var(--gutter) 10px;
}

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

.brand__mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
    background: linear-gradient(140deg, var(--violet), var(--magenta));
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.65);
}

.brand__name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 1.6px;
}

.brand__divider {
    width: 1px;
    height: 16px;
    background: var(--stroke-strong);
}

.brand__sub {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--violet-bright);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.icon-btn.is-spinning svg {
    animation: spin 0.7s linear;
}

.icon-btn--warn {
    color: var(--amber);
}

.icon-btn--danger {
    color: #f87171;
}

.icon-btn:disabled {
    opacity: 0.38;
    pointer-events: none;
}

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

/* ---------- screens ---------- */

.screens {
    flex: 1;
    min-height: 0;
    padding: 10px var(--gutter) calc(28px + var(--safe-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.is-user .screens,
body.is-admin .screens {
    padding-bottom: calc(72px + var(--safe-bottom));
}

.screen {
    display: none;
    animation: fade-up 0.28s ease;
}

.screen--active {
    display: block;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* ---------- buttons ---------- */

.actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid var(--stroke-strong);
    border-radius: 15px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--text);
    background: var(--surface);
    transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn--primary {
    border-color: transparent;
    background: linear-gradient(135deg, #7c3aed, #a855f7 55%, #d946ef);
    box-shadow: 0 8px 26px rgba(124, 58, 237, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn--danger {
    border-color: transparent;
    background: rgba(239, 68, 68, 0.92);
    box-shadow: 0 8px 26px rgba(239, 68, 68, 0.35);
}

.btn--ghost {
    color: var(--violet-bright);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.btn--line {
    flex: 0 0 auto;
    background: transparent;
    box-shadow: none;
    border-color: var(--stroke-strong);
    color: var(--text);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.45;
    filter: grayscale(0.4);
    pointer-events: none;
    cursor: default;
}

.btn--sm {
    min-height: 40px;
    font-size: 14px;
    border-radius: 12px;
}

.icon-only {
    flex: 0 0 48px;
    padding: 0;
}

.btn:active,
.icon-btn:active {
    transform: scale(0.95);
}

/* ---------- chips ---------- */

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

body.is-admin .chips {
    margin-top: 4px;
}

.chip {
    position: relative;
    z-index: 0;
    flex: 0 0 auto;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(20, 13, 40, 0.55);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.14s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* мягкое неоновое свечение вокруг активного чипса */
.chip::after {
    content: "";
    position: absolute;
    inset: -10px;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(closest-side, rgba(167, 139, 250, 0.5), rgba(217, 70, 239, 0.18) 55%, transparent 78%);
    filter: blur(9px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chip:active {
    transform: scale(0.94);
}

.chip--active {
    color: #fff;
    border-color: rgba(184, 152, 255, 0.65);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(217, 70, 239, 0.24));
    box-shadow:
        0 6px 20px rgba(88, 43, 173, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}

.chip--active::after {
    opacity: 1;
}

/* ---------- section ---------- */

.section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 12px;
}

.section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.section-count {
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    font-size: 12px;
    font-weight: 700;
    color: var(--violet-bright);
    background: rgba(139, 92, 246, 0.14);
}

/* ---------- device cards ---------- */

.device-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
    gap: 12px;
}

.device {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius);
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: transform 0.14s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    animation: card-in 0.35s ease backwards;
}

.device--online { --accent: var(--green); }
.device--busy { --accent: var(--amber); }
.device--offline { --accent: #f87171; }
.device--new { --accent: #ef4444; }
.device--blocked { --accent: #f43f5e; }

.device:active {
    transform: scale(0.975);
    border-color: var(--stroke-strong);
    box-shadow: 0 0 26px rgba(139, 92, 246, 0.35);
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.device::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 15px;
    bottom: 15px;
    width: 2px;
    border-radius: 2px;
    background: var(--accent, var(--violet));
    box-shadow: 0 0 12px var(--accent, var(--violet));
}

.device__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 14px;
}

.device__title {
    flex: 1;
    min-width: 0;
}

.device__name {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.device__meta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-dim);
}

.device__block {
    display: block;
    margin-top: 5px;
    color: #fda4af;
    font-size: 12px;
    font-weight: 700;
}

.block-banner {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(244, 63, 94, 0.45);
    background: rgba(244, 63, 94, 0.16);
    color: #fda4af;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.copy-btn {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--violet-bright);
    flex: 0 0 auto;
}

.copy-btn svg {
    width: 13px;
    height: 13px;
}

.copy-btn:active {
    transform: scale(0.9);
    color: #fff;
}

.device__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-left: 14px;
}

/* ---------- плитки с данными ---------- */

.tile {
    position: relative;
    padding: 9px 11px;
    border-radius: 12px;
    border: 1px solid rgba(154, 108, 255, 0.14);
    background: rgba(12, 8, 26, 0.55);
    overflow: hidden;
}

.tile--cards {
    margin-left: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px 11px 7px;
}

.tile__cards-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tile__cards-head .tile__label {
    margin-right: auto;
}

.tile--cards .add-card-btn {
    margin-left: 0;
}

.tile__value {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.tile__label {
    font-size: 10px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ---------- кнопки загрузки ---------- */

.load-btn {
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(139, 92, 246, 0.14);
    color: var(--violet-bright);
    transition: transform 0.14s ease, background 0.2s ease, color 0.2s ease;
}

.load-btn {
    width: 34px;
    height: 34px;
}

.load-btn svg {
    width: 16px;
    height: 16px;
}

.load-btn--sm {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border-color: transparent;
    background: transparent;
    color: rgba(167, 139, 250, 0.55);
}

.load-btn--sm svg {
    width: 13px;
    height: 13px;
}

.load-btn:active {
    transform: scale(0.9);
    color: #fff;
    background: rgba(139, 92, 246, 0.32);
}

.load-btn.is-busy {
    color: var(--violet-bright);
    pointer-events: none;
}

.load-btn.is-busy svg {
    animation: spin 0.8s linear infinite;
}

/* ---------- состояние проверки ---------- */

.device.is-checking {
    --accent: var(--amber);
    opacity: 0.62;
    transform: none;
}

.device.is-checking::before {
    animation: stripe-pulse 1.2s ease-in-out infinite;
}

@keyframes stripe-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.device.is-checking .load-btn,
.device.is-checking [data-action="add-card"],
.detail.is-checking .load-btn,
.detail.is-checking [data-action="password"],
.detail.is-checking [data-action="logout"],
.detail.is-checking [data-action="delete"],
.detail.is-checking [data-action="check-login"],
.detail.is-checking [data-action="add-card"],
.detail.is-checking [data-action="ssh"],
.detail.is-checking [data-action="reboot"] {
    pointer-events: none;
    opacity: 0.38;
}

.detail.is-checking [data-action="cancel-action"]:not(:disabled) {
    pointer-events: auto;
    opacity: 1;
}

.device.is-checking .load-btn {
    color: var(--amber);
}

.is-loading {
    position: relative;
    overflow: hidden;
}

.is-loading .tile__value,
.is-loading .card-stack,
.is-loading .detail__balance-value,
.is-loading .flow__value,
.is-loading .card-row,
.is-loading .empty {
    opacity: 0.25;
}

.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(100deg, transparent 20%, rgba(196, 181, 253, 0.16) 50%, transparent 80%);
    animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* ---------- карты ---------- */

.card-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s ease;
}

.mini-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 5px 9px;
    border-radius: 8px;
    border: 1px solid var(--stroke-strong);
    background: transparent;
    color: var(--violet-bright);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.9px;
}

.card-stack__more {
    margin-left: 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
}

.card-stack__empty {
    font-size: 12px;
    color: var(--text-dim);
}

/* ---------- empty slot ---------- */

.slot-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1.5px dashed var(--stroke-strong);
    background: rgba(139, 92, 246, 0.05);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.14s ease, color 0.2s ease, background 0.2s ease;
}

.slot-add:active {
    transform: scale(0.98);
    color: var(--violet-bright);
    background: rgba(139, 92, 246, 0.12);
}

.slot-add.is-disabled {
    opacity: 0.5;
}

body:not(.is-admin) #addDeviceBtn,
body:not(.is-admin) #logsBtn,
body:not(.is-admin) #statsBtn,
body:not(.is-admin) #screenViewerLogs,
body:not(.is-admin) .admin-only {
    display: none !important;
}

body.is-admin .actions,
body.is-admin #profileTabBtn {
    display: none !important;
}

.slot-add__plus {
    font-size: 20px;
    font-weight: 700;
    color: var(--violet-bright);
}

.empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* ---------- экран девайса ---------- */

.detail {
    padding-top: 4px;
}

.detail.is-checking {
    --accent: var(--amber);
}

.detail.is-checking .tile,
.detail.is-checking .cards-full,
.detail.is-checking .flow-bar,
.detail.is-checking .flow-legend {
    opacity: 0.62;
    pointer-events: none;
}

.detail.is-checking .detail__dot {
    animation: stripe-pulse 1.2s ease-in-out infinite;
}

.detail__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
}

.detail__title-wrap {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.detail__actions {
    display: grid;
    grid-template-columns: 38px 38px 38px 38px;
    grid-template-rows: 38px 38px;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
}

.detail__actions .load-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.detail__name {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.detail__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-dim);
}

.detail__meta .copy-btn {
    margin-left: -4px;
}

.detail__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent, var(--violet));
    box-shadow: 0 0 9px var(--accent, var(--violet));
}

.spec-grid {
    display: grid;
    grid-template-columns: 1.2fr 1.4fr 0.8fr;
    gap: 8px;
    margin: 0 0 16px;
}

.spec-wrap {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 16px;
}

.spec-wrap .spec-grid {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.spec-wrap .spec-edit {
    flex: 0 0 auto;
    align-self: center;
}

.reboot-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid var(--stroke-strong);
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.reboot-btn svg {
    width: 12px;
    height: 12px;
}

.reboot-btn:disabled,
.reboot-btn[disabled] {
    opacity: 0.38;
    pointer-events: none;
}

.spec-cell {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.55);
}

.spec-cell span {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-dim);
}

.spec-cell b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.detail__balance {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 15px;
    border-radius: var(--radius);
    border-color: var(--stroke);
    background:
        linear-gradient(150deg, rgba(139, 92, 246, 0.2), rgba(217, 70, 239, 0.08)),
        var(--surface);
}

.detail__balance-value {
    font-size: 30px;
    font-weight: 800;
    text-shadow: 0 0 22px rgba(167, 139, 250, 0.5);
}

.detail__flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
    border-radius: 14px;
}

.flow {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px;
    border-radius: 14px;
}

.flow__value {
    font-size: 17px;
    font-weight: 800;
}

.flow--in .flow__value {
    color: var(--green);
    text-shadow: 0 0 14px rgba(52, 211, 153, 0.35);
}

.flow--out .flow__value {
    color: #fb7185;
    text-shadow: 0 0 14px rgba(251, 113, 133, 0.3);
}

.flow-bar {
    height: 6px;
    margin-top: 12px;
    border-radius: 6px;
    background: rgba(251, 113, 133, 0.35);
    overflow: hidden;
}

.flow-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--green), #22d3ee);
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.55);
}

.flow-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 7px;
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--text-dim);
}

.load-btn--inline {
    position: static;
    margin-left: 0;
    width: 28px;
    height: 28px;
    border-color: var(--stroke);
    background: rgba(139, 92, 246, 0.12);
}

.add-card-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    padding: 0;
    border: 1px solid var(--stroke-strong);
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.add-card-btn.is-busy {
    pointer-events: none;
    opacity: 0.55;
}

/* ---------- карты в списке ---------- */

.cards-full {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.card-row {
    position: relative;
    display: block;
    width: 100%;
    padding: 12px 13px;
    text-align: left;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.55);
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transition: transform 0.14s ease, border-color 0.2s ease;
}

.card-row:active {
    transform: scale(0.98);
    border-color: var(--stroke-strong);
}

.card-row.is-open {
    transform: none;
    border-color: var(--stroke-strong);
    background: rgba(20, 13, 40, 0.85);
}

.card-row__preview {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.card-row__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.card-row.is-open .card-row__preview {
    display: none !important;
}

.card-row__dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 4px;
    flex: 0 0 auto;
}

.card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

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

.card-dot--beeline {
    background: #facc15;
    color: #facc15;
}

.card-dot--yapay {
    background: #ef4444;
    color: #ef4444;
}

.card-dot--mts {
    background: #a855f7;
    color: #a855f7;
}

.card-flags {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.card-switch {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.85);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 650;
}

.card-switch__track {
    position: relative;
    width: 36px;
    height: 20px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: rgba(167, 139, 250, 0.42);
    border: 1px solid rgba(167, 139, 250, 0.55);
    transition: background 0.18s ease, border-color 0.18s ease;
}

.card-switch__track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ece7ff;
    transition: transform 0.18s ease, background 0.18s ease;
}

.card-switch.is-on .card-switch__track {
    border-color: transparent;
}

.card-switch[data-flag="beeline"].is-on .card-switch__track {
    background: #facc15;
}

.card-switch[data-flag="yapay"].is-on .card-switch__track {
    background: #ef4444;
}

.card-switch[data-flag="mts"].is-on .card-switch__track {
    background: #a855f7;
}

.card-switch.is-on .card-switch__track::after {
    transform: translateX(16px);
    background: #1a1028;
}

.card-row__num,
.card-row__date,
.card-row__cvv {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.6px;
    line-height: 1.25;
}

.card-row__date,
.card-row__cvv {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
}

.card-row__expand {
    display: none !important;
    flex-direction: column;
    gap: 8px;
}

.card-row.is-open .card-row__expand {
    display: flex !important;
}

.card-copy-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.card-copy-row .card-copy span {
    flex: 0 0 auto;
}

.card-copy {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.85);
    color: var(--text);
    font-family: inherit;
    text-align: left;
}

.card-copy span {
    flex: 0 0 58px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-dim);
}

.card-copy b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}

.card-copy svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--violet-bright);
}

/* ---------- sheet ---------- */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(4, 2, 10, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sheet-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 21;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    max-height: 82vh;
    padding: 10px var(--gutter) calc(24px + var(--safe-bottom));
    border-radius: 26px 26px 0 0;
    border-top: 1px solid var(--stroke-strong);
    background: linear-gradient(180deg, rgba(30, 18, 60, 0.98), rgba(10, 6, 22, 0.99));
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.6);
    transform: translateY(110%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}

.sheet.is-open {
    transform: none;
}

.sheet--full {
    top: 0;
    max-width: none;
    max-height: none;
    height: 100%;
    height: var(--app-h, 100dvh);
    border-radius: 0;
    border-top: none;
    padding-top: calc(16px + var(--safe-top));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sheet--full .sheet__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.sheet--full .sheet__grabber {
    display: none;
}

.sheet--full .form {
    flex: 1;
    min-height: 0;
}

.sheet--full .sheet__actions {
    margin-top: auto;
}

.sheet--full .ssh-form .sheet__actions {
    margin-top: 0;
}

.sheet--full .rent-sheet {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sheet--full .rent-sheet .form {
    flex: 0 0 auto;
}

.rent-sheet .sheet__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.rent-sheet .sheet__sub {
    margin: 0;
}

.rent-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.rent-inline {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.rent-inline .field__input {
    flex: 1;
    min-height: 44px;
}

.rent-inline .btn {
    flex: 0 0 auto;
    min-height: 44px;
    min-width: auto;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 650;
}

.sheet--full .rent-sheet .sheet__actions {
    margin-top: 10px;
}

.btn--danger.btn--line {
    background: transparent;
    box-shadow: none;
    border-color: rgba(248, 113, 113, 0.4);
    color: #f87171;
}

.user-pick {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 140px;
    gap: 8px;
}

.user-pick__search {
    position: relative;
    display: block;
}

.user-pick__search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    transform: translateY(-50%);
    pointer-events: none;
}

.user-pick__search .field__input {
    padding-left: 40px;
    -webkit-appearance: none;
    appearance: none;
}

.user-pick__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(16, 10, 32, 0.45);
}

.user-pick__empty {
    padding: 18px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

.user-pick__row {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 8px 12px;
    text-align: left;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    font-family: inherit;
}

.user-pick__row + .user-pick__row {
    border-top: 1px solid var(--stroke);
}

.user-pick__row.is-selected {
    background: rgba(139, 92, 246, 0.16);
}

.user-pick__ava {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, hsl(var(--ava-h, 262), 72%, 46%), hsl(calc(var(--ava-h, 262) + 32), 78%, 58%));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.user-pick__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.user-pick__meta b {
    font-size: 15px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pick__meta i {
    font-style: normal;
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-pick__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex: 0 0 auto;
}

.user-pick__right b {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.user-pick__role {
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.user-pick__row.is-selected .user-pick__role {
    color: var(--violet-bright);
}

.sheet__grabber {
    width: 42px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 4px;
    background: var(--stroke-strong);
}

.sheet__title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.sheet__sub {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.sheet__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.sheet__cell {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.6);
}

.sheet__cell b {
    display: block;
    font-size: 16px;
    font-weight: 700;
}

.sheet__cell span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-dim);
}

.sheet__cards {
    margin-bottom: 16px;
    padding-left: 0;
}

.sheet__actions {
    display: flex;
    gap: 10px;
}

.sheet__actions--stack {
    flex-direction: column;
}

/* ---------- form ---------- */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.field__label {
    padding-left: 2px;
    font-size: 12px;
    color: var(--text-dim);
}

.field__input {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.6);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field__input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.field__input:focus {
    border-color: var(--violet-bright);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.18);
}

.field__phone {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.field__prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.6);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.field__input--phone {
    flex: 1 1 auto;
    letter-spacing: 1.5px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field__input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: 0;
}

.field__input--area {
    min-height: 112px;
    height: 112px;
    padding: 12px 16px;
    resize: vertical;
    line-height: 1.4;
    user-select: text;
    -webkit-user-select: text;
}

.sheet__top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.sheet__title-wrap {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

.sheet__top .sheet__title {
    margin: 0 0 4px;
}

.sheet__top .sheet__sub {
    margin: 0;
}

.ssh-form {
    flex: 1;
    min-height: 0;
}

.ssh-out {
    flex: 1;
    min-height: 180px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(8, 5, 18, 0.92);
    color: #d6ccff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
}

.form .sheet__actions {
    margin-top: 6px;
}

/* ---------- экран без входа ---------- */

.login-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 36px 20px 40px;
    text-align: center;
}

.login-state__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 20px;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.login-state__icon svg {
    width: 32px;
    height: 32px;
}

.login-state__icon--ok {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.12);
}

.login-state__sub {
    margin: 0;
    font-size: 13px;
    color: var(--text-dim);
}

.icon-btn.is-loading svg {
    animation: spin 0.8s linear infinite;
}

.login-state__title {
    margin: 0;
    max-width: 260px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.login-state__btn {
    flex: 0 0 auto;
    min-width: 180px;
}

/* ---------- прогресс входа в ЛК ---------- */

.login-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 0 6px;
}

.login-progress__spinner {
    display: flex;
    color: var(--violet-bright);
}

.login-progress__spinner svg {
    width: 34px;
    height: 34px;
    animation: spin 0.8s linear infinite;
}

/* ---------- ввод кода (6 цифр) ---------- */

.code-input {
    position: relative;
    margin-top: 8px;
}

.code-input__field {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    font-size: 16px; /* >=16px, чтобы iOS не зумил */
    text-align: center;
    letter-spacing: 2em;
    outline: none;
    z-index: 2;
}

.code-input__cells {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.code-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    border-radius: 14px;
    border: 1.5px solid var(--stroke);
    background: rgba(12, 8, 26, 0.6);
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.code-cell--filled {
    border-color: var(--violet-bright);
    background: rgba(139, 92, 246, 0.12);
}

.code-cell--active {
    border-color: var(--violet-bright);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28);
}

.code-input.is-complete .code-cell {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.14);
    box-shadow: none;
}

/* ---------- toast ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(32px + var(--safe-bottom));
    z-index: 30;
    max-width: 82vw;
    padding: 11px 18px;
    border-radius: 14px;
    border: 1px solid var(--stroke-strong);
    background: rgba(30, 18, 60, 0.95);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 0 26px rgba(139, 92, 246, 0.45);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ---------- адаптив ---------- */

/* узкие телефоны */
@media (max-width: 359px) {
    .brand__name { font-size: 15px; }
    .brand__sub { display: none; }
    .brand__divider { display: none; }
    .actions { gap: 8px; }
    .btn { min-height: 44px; padding: 0 12px; font-size: 13px; }
    .btn svg { width: 16px; height: 16px; }
    .icon-only { flex-basis: 40px; padding: 0; }
    .tile__value { font-size: 14px; }
    .detail__actions {
        grid-template-columns: 38px 38px 38px;
        grid-template-rows: 38px 38px 38px;
    }
}

/* планшеты и развёрнутый Telegram */
@media (min-width: 560px) {
    .actions { max-width: 640px; }
    .slot-add { padding: 26px; }
    .tile__value { font-size: 16px; }
    .cards-full { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
}

@media (min-width: 900px) {
    .brand__name { font-size: 19px; }
    .device { padding: 17px; }
    .detail {
        display: grid;
        grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
        column-gap: 22px;
        align-items: start;
    }
    .detail__top,
    .detail__balance,
    .detail__flow,
    .flow-bar,
    .flow-legend {
        grid-column: 1;
    }
    .detail .section-head,
    .detail .cards-full {
        grid-column: 2;
    }
    .detail .section-head {
        grid-row: 2;
        margin-top: 0;
    }
    .detail .cards-full {
        grid-row: 3 / span 8;
    }
    .cards-full { grid-template-columns: 1fr; }
}

/* низкие экраны в горизонтальной ориентации */
@media (max-height: 520px) {
    .sheet { max-height: 92vh; }
    .topbar { padding-top: 8px; }
}

@container app (min-width: 560px) {
    .device-list {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
    }
}

/* ---------- просмотр экрана устройства ---------- */

.screen-viewer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    flex-direction: column;
    background: rgba(6, 4, 14, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: calc(var(--safe-top, 12px) + 8px) 14px calc(var(--safe-bottom, 12px) + 14px);
}

.screen-viewer.is-open {
    display: flex;
}

.screen-viewer[hidden] {
    display: none !important;
}

.screen-viewer__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.screen-viewer__title {
    flex: 1;
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.screen-viewer__tools {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.screen-viewer__btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--violet-bright);
}

.screen-viewer__btn svg {
    width: 20px;
    height: 20px;
}

.screen-viewer__btn.is-on {
    color: var(--green);
    border-color: rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.screen-viewer__btn.is-loading svg {
    animation: spin 0.8s linear infinite;
}

.screen-viewer__btn:disabled {
    opacity: 0.38;
    pointer-events: none;
}

.screen-viewer__stage {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid var(--stroke);
    background: #000;
    overflow: hidden;
}

.screen-viewer__img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    margin: 0 auto;
}

.screen-viewer__img[hidden] {
    display: none !important;
}

.screen-viewer__status {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 14px;
    text-align: center;
    padding: 24px;
    pointer-events: none;
}

.screen-viewer__status[hidden] {
    display: none !important;
}

.log-viewer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    flex-direction: column;
    background: rgba(6, 4, 14, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: calc(var(--safe-top, 12px) + 8px) 14px calc(var(--safe-bottom, 12px) + 14px);
}

.log-viewer.is-open {
    display: flex;
}

.log-viewer[hidden] {
    display: none !important;
}

.log-viewer__bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.log-viewer__title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.log-viewer__body {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(8, 5, 18, 0.92);
    color: #d6ccff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
}

.tabbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: none;
    justify-content: center;
    padding: 0 28px calc(10px + var(--safe-bottom));
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

body.is-user .tabbar,
body.is-admin .tabbar {
    display: flex;
}

.tabbar--hidden {
    opacity: 0;
    transform: translateY(28px);
    pointer-events: none;
}

.tabbar__glass {
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: stretch;
    gap: 0;
    width: min(248px, calc(100% - 48px));
    padding: 3px;
    border-radius: 999px;
    background: rgba(12, 8, 24, 0.92);
    border: 1px solid var(--stroke);
}

.tabbar__blob {
    display: none;
}

.tabbar__btn {
    position: relative;
    appearance: none;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 42px;
    padding: 6px 10px 5px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.tabbar__btn svg {
    width: 18px;
    height: 18px;
}

.tabbar__btn.is-active {
    color: var(--text);
}

.settings-group {
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(16, 10, 32, 0.45);
}

.settings-group + .settings-group {
    margin-top: 16px;
}

.settings-group__label {
    margin: 0;
    padding: 10px 14px 0;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-dim);
}

body:not(.is-admin) .settings-group__label {
    display: none;
}

.settings-group .profile-row {
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: 52px;
}

.settings-group .profile-row + .profile-row {
    margin-top: 0;
    border-top: 1px solid var(--stroke);
}

.profile-head {
    margin: 8px 0 16px;
}

.profile-head__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 18px;
    padding: 22px 16px 16px;
    border-radius: 20px;
    border: 1px solid var(--stroke);
    background: rgba(16, 10, 32, 0.55);
    text-align: center;
}

.profile-hero[hidden] {
    display: none;
}

.profile-hero__ava {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.18);
    border: 1px solid var(--stroke);
}

.profile-hero__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-hero__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.profile-hero__use,
.profile-hero__id {
    margin: 0;
    font-style: normal;
    font-size: 13px;
    color: var(--text-dim);
}

.profile-hero__id {
    margin-top: 2px;
}

.profile-hero__balance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--stroke);
    text-align: left;
}

.profile-hero__balance span {
    font-size: 13px;
    color: var(--text-dim);
}

.profile-hero__balance b {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.profile-row {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 10px 12px;
    text-align: left;
    border-radius: 16px;
    border: 1px solid var(--stroke);
    background: rgba(16, 10, 32, 0.45);
    color: var(--text);
    font-family: inherit;
}

.profile-row + .profile-row {
    margin-top: 8px;
}

.profile-row__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 10px;
    color: var(--violet-bright);
    background: rgba(139, 92, 246, 0.12);
}

.profile-row__icon svg {
    width: 18px;
    height: 18px;
}

.profile-row__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.profile-row__text b {
    font-size: 15px;
    font-weight: 650;
}

.profile-row__text i {
    font-style: normal;
    font-size: 12px;
    color: var(--text-dim);
}

.profile-row__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.profile-row__dot[hidden] {
    display: none;
}

.profile-row__chevron {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--text-dim);
}

.userbot-card {
    padding: 18px 16px 20px;
    border-radius: 18px;
    border: 1px solid var(--stroke);
    background: rgba(12, 8, 26, 0.55);
}

.userbot-card .form {
    margin-top: 4px;
}

.userbot-card .form > button[type="submit"] {
    align-self: center;
    flex: 0 0 auto;
    min-width: 168px;
    width: auto;
}

.userbot-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 8px 8px 16px;
}

.userbot-status__name {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.userbot-status__meta {
    margin: 0;
    color: var(--text-dim);
    font-size: 14px;
}

.userbot-hint {
    margin: 0 0 12px;
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.4;
}

#watchBody .userbot-card + .userbot-card,
#workersBody .userbot-card + .userbot-card,
#userbotBody .userbot-card + .userbot-card {
    margin-top: 12px;
}

.lk-sessions .field__label {
    display: block;
    margin-bottom: 4px;
}

.lk-session {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 0;
}

.lk-session + .lk-session {
    border-top: 1px solid var(--stroke);
}

.lk-session__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.lk-session__meta b {
    font-size: 14px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lk-session__meta i {
    font-style: normal;
    font-size: 12px;
    color: var(--text-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lk-session__status {
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 650;
    color: var(--text-dim);
    white-space: nowrap;
}

.lk-session__status.is-on {
    color: #6ee7b7;
}

.lk-session__status.is-warn {
    color: var(--amber);
}

.lk-session .btn {
    flex: 0 0 auto;
    min-height: 36px;
    min-width: auto;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 650;
}

.watch-toggle {
    width: 100%;
}

.watch-add {
    display: flex;
    gap: 8px;
}

.watch-add .field__input {
    flex: 1 1 auto;
}

.watch-add .btn {
    flex: 0 0 48px;
    width: 48px;
    min-width: 48px;
    padding: 0;
}

.watch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 6px 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--stroke-strong);
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
}

.watch-chip button {
    appearance: none;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    font-size: 16px;
    line-height: 1;
}

.worker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 4px 8px 12px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
}

.worker-row + .worker-row {
    margin-top: 8px;
}

.worker-row b {
    flex: 1;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}

.worker-row .icon-btn {
    flex: 0 0 auto;
}

.watch-dialogs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(52vh, 420px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.watch-dialog {
    appearance: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 8px 12px;
    text-align: left;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: transparent;
    color: var(--text);
    font-family: inherit;
}

.watch-dialog.is-on {
    border-color: var(--stroke-strong);
    color: var(--violet-bright);
}

.watch-dialog__mark {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border-radius: 6px;
    border: 1px solid var(--stroke-strong);
    background: transparent;
}

.watch-dialog.is-on .watch-dialog__mark {
    background: var(--violet);
    border-color: transparent;
}

.watch-dialog__text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.watch-dialog__text b {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.watch-dialog__text i {
    font-style: normal;
    font-size: 12px;
    color: var(--text-dim);
}
