:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --surface-3: #e9edf4;
    --line: #e4e8ef;
    --text: #1d2331;
    --text-2: #4b5466;
    --muted: #8a92a4;
    --primary: #3566f0;
    --primary-2: #5b8cff;
    --primary-soft: #e8efff;
    --grad: linear-gradient(90deg, #4f86ff 0%, #2f5fe0 100%);
    --hero-grad: linear-gradient(120deg, #5a8dff 0%, #3566f0 55%, #2448c2 100%);
    --pink: #e85b8a;
    --pink-soft: #fde8ef;
    --amber: #d9a224;
    --amber-soft: #fcf3dc;
    --red: #e5484d;
    --red-soft: #fde8e9;
    --green: #1f9e6e;
    --green-soft: #e1f5ec;
    --teal: #2aa7c9;
    --teal-soft: #e0f3f9;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px rgba(20, 34, 64, 0.06);
    --shadow-lg: 0 24px 60px rgba(20, 34, 64, 0.16);
    --accent-rgb: 53, 102, 240;
    --accent2-rgb: 91, 140, 255;
    --backdrop: rgba(15, 23, 42, .36);
    --radius: 28px;
    --radius-sm: 16px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #14132a;
    --surface: #1e1c3a;
    --surface-2: #28264a;
    --surface-3: #33305a;
    --line: #2c2a4e;
    --text: #eeedfb;
    --text-2: #c0bedf;
    --muted: #8d8bb3;
    --primary: #a07cff;
    --primary-2: #b99bff;
    --primary-soft: #2f2860;
    --pink-soft: #3c2240;
    --amber-soft: #3a3120;
    --red-soft: #3f1f2c;
    --green-soft: #183a33;
    --teal-soft: #173547;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}
/* Графит: нейтральный тёмно-серый с синим акцентом */
:root[data-theme="dark"] {
    --bg: #1b1d23;
    --surface: #24262d;
    --surface-2: #2c2f37;
    --surface-3: #363943;
    --line: #30333b;
    --text: #eceef3;
    --text-2: #bcc0ca;
    --muted: #868b97;
    --primary: #4d86ff;
    --primary-2: #74a0ff;
    --primary-soft: #23324f;
    --grad: linear-gradient(90deg, #5590ff 0%, #2f63e3 100%);
    --accent-rgb: 59, 108, 246;
    --accent2-rgb: 116, 160, 255;
    --pink-soft: #3a2631;
    --amber-soft: #383223;
    --red-soft: #3d2328;
    --green-soft: #1c3830;
    --teal-soft: #1b3441;
    --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
    --shadow-lg: 0 26px 60px rgba(0, 0, 0, 0.55);
    --backdrop: rgba(8, 10, 14, .55);
}


* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Layout ---------- */
.app {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 28px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px;
}

.sidebar {
    position: sticky;
    top: 28px;
    height: calc(100vh - 56px);
    max-height: 820px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 4px;
    z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 6px;
    margin-bottom: 26px;
}
.brand-text { font-weight: 800; font-size: 15px; line-height: 1.15; color: var(--text); }

.logo {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex-shrink: 0;
    display: block;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(var(--accent-rgb), .35);
}
.logo img { width: 100%; height: 100%; }

.nav-caption {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--muted);
    padding: 0 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    color: var(--muted);
    font-weight: 700;
    font-size: 15px;
    text-align: left;
    white-space: nowrap;
    transition: color .2s, background .2s;
}
.nav-item i { width: 20px; font-size: 17px; text-align: center; flex-shrink: 0; }
.nav-item:hover { color: var(--primary); background: var(--surface-2); }
.nav-item.active { color: var(--primary); background: var(--primary-soft); }
.nav-spacer { flex: 1; }
.nav-item.logout:hover { color: var(--red); background: var(--red-soft); }

.main { min-width: 0; padding-bottom: 40px; }

.bottom-nav { display: none; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 6px 0 28px;
}
.hello h1 {
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -.3px;
}
.hello p { color: var(--muted); margin-top: 6px; font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border-radius: 999px;
    padding: 6px 16px 6px 6px;
    box-shadow: var(--shadow);
}
.avatar {
    position: relative;
    overflow: hidden;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    flex-shrink: 0;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-chip .name { font-weight: 800; font-size: 14px; line-height: 1.1; }
.profile-chip .sub { font-size: 11px; color: var(--muted); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 10px 22px rgba(var(--accent-rgb), .3);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(var(--accent-rgb), .42); }
.btn-soft { background: var(--surface-2); color: var(--text-2); }
.btn-soft:hover { background: var(--surface-3); }
.btn-white { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.btn-white:hover { color: var(--primary-2); }
.btn-block { width: 100%; }

.icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface);
    color: var(--text-2);
    box-shadow: var(--shadow);
    font-size: 16px;
    transition: color .2s, transform .15s;
    position: relative;
}
.icon-btn:hover { color: var(--primary); }
.icon-btn:active { transform: scale(.94); }

.act {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 14px;
    background: var(--surface-2);
    color: var(--text-2);
    transition: all .15s;
}
.act:hover { background: var(--primary-soft); color: var(--primary); }
.act.pay:hover { background: var(--green-soft); color: var(--green); }
.act.del:hover { background: var(--red-soft); color: var(--red); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.card-title { font-size: 17px; font-weight: 800; color: var(--text); }
.card-title .fa-solid, .card-title .fas { color: var(--primary); margin-right: 8px; }

.section { margin-bottom: 28px; }

/* ---------- Search / inputs ---------- */
.search {
    position: relative;
    flex: 1;
    min-width: 240px;
}
.search input {
    width: 100%;
    height: 54px;
    border: 0;
    outline: 0;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 0 64px 0 26px;
    font: inherit;
    font-weight: 600;
    color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.search .search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--grad);
    color: #fff;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.pill-select {
    appearance: none;
    height: 54px;
    border: 0;
    outline: 0;
    border-radius: 999px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237447e6' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 20px center;
    box-shadow: var(--shadow);
    padding: 0 46px 0 22px;
    font: inherit;
    font-weight: 700;
    color: var(--text-2);
    cursor: pointer;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.field { margin-bottom: 16px; }
.field label, .label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    margin: 0 0 8px 6px;
}
.field .hint { font-size: 12px; color: var(--muted); margin: 6px 0 0 6px; }
.input, .select, .textarea {
    width: 100%;
    border: 2px solid transparent;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    border-radius: 999px;
    height: 50px;
    padding: 0 22px;
    transition: border-color .2s, background .2s;
}
.textarea { border-radius: 22px; height: auto; padding: 14px 22px; resize: vertical; min-height: 90px; }
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239796b0' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    padding-right: 44px;
    cursor: pointer;
}
.input::placeholder, .textarea::placeholder { color: var(--muted); font-weight: 500; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-2); background: var(--surface); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.stat { padding: 24px 26px; position: relative; overflow: hidden; }
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 17px;
    margin-bottom: 16px;
}
.stat-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px; line-height: 1.2; }
.stat-sub { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.c-purple { color: var(--primary); } .bg-purple { background: var(--primary-soft); color: var(--primary); }
.c-pink { color: var(--pink); } .bg-pink { background: var(--pink-soft); color: var(--pink); }
.c-amber { color: var(--amber); } .bg-amber { background: var(--amber-soft); color: var(--amber); }
.c-red { color: var(--red); } .bg-red { background: var(--red-soft); color: var(--red); }
.c-green { color: var(--green); } .bg-green { background: var(--green-soft); color: var(--green); }

/* ---------- Upcoming (stories) ---------- */
.stories {
    display: flex;
    gap: 22px;
    overflow-x: auto;
    padding: 4px 2px 6px;
    scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story {
    flex: 0 0 auto;
    width: 88px;
    text-align: center;
    cursor: pointer;
}
.story-ring {
    width: 76px;
    height: 76px;
    margin: 0 auto 8px;
    border-radius: 50%;
    padding: 3px;
    background: var(--grad);
    transition: transform .2s;
}
.story:hover .story-ring { transform: translateY(-3px); }
.story-ring.warn { background: linear-gradient(135deg, #f3c74f, #e88a3a); }
.story-ring.danger { background: linear-gradient(135deg, #ff7a8a, #e3354c); }
.story-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--surface);
    padding: 4px;
}
.story-inner img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 12px;
}
.story-name {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.story-days { font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- Month groups / hosting rows ---------- */
.month { padding: 8px 8px 12px; margin-bottom: 24px; }
.month-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 14px;
    gap: 12px;
}
.month-title { font-size: 18px; font-weight: 800; }
.month-title .badge, .month-meta .badge {
    font-size: 11px;
    font-weight: 800;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 999px;
    padding: 3px 10px;
    margin-left: 8px;
    vertical-align: middle;
}
.month-sum { text-align: right; }
.month-sum .v { font-size: 22px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.month-sum .s { font-size: 12px; font-weight: 600; color: var(--muted); }

.h-cols, .h-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.5fr) 164px 56px 168px;
    grid-template-areas: "host price date status switch actions";
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
}
.h-cols .center { text-align: center; }
.h-cols .right { text-align: right; }
.h-cols {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    padding-top: 6px;
    padding-bottom: 6px;
}
.h-row {
    border-radius: 20px;
    transition: background .2s, opacity .25s;
}
.h-row:hover { background: var(--surface-2); }
.h-row.is-off { opacity: .45; }
.h-row.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { background: var(--primary-soft); } 100% { background: transparent; } }

.h-host { grid-area: host; display: flex; align-items: center; gap: 14px; min-width: 0; }
.h-host-text { min-width: 0; flex: 1; }
.h-price { grid-area: price; }
.h-date { grid-area: date; min-width: 0; }
.h-status { grid-area: status; display: flex; justify-content: center; }
.h-switch { grid-area: switch; display: flex; justify-content: center; }
.h-actions { grid-area: actions; }
.fav {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: #fff;
    padding: 9px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(20, 34, 64, .12);
    flex-shrink: 0;
}
.h-name {
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.h-url {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    min-width: 0;
}
.h-url .chip { flex-shrink: 0; }
.h-url a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.h-url a:hover { color: var(--primary); }
.note-btn { color: var(--primary); font-size: 12px; }

.chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    border-radius: 999px;
    padding: 0 9px;
    white-space: nowrap;
}
.chip-personal { background: var(--primary-soft); color: var(--primary); }
.chip-work { background: var(--teal-soft); color: var(--teal); }
.chip-client { background: var(--pink-soft); color: var(--pink); }
.chip-test { background: var(--amber-soft); color: var(--amber); }

.h-price .v { font-weight: 800; font-size: 16px; }
.h-price .s { font-size: 12px; font-weight: 600; color: var(--muted); }
.h-price .rub { font-size: 12px; font-weight: 700; color: var(--green); }

.date-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    column-gap: 10px;
    margin-bottom: 7px;
}
.h-date .d { font-weight: 800; font-size: 14px; }
.h-date .left { font-size: 12px; font-weight: 700; white-space: nowrap; }
.h-date .meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    margin-top: 6px;
    min-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress {
    height: 7px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
}
.progress > span {
    display: block;
    height: 100%;
    border-radius: 99px;
    background: var(--grad);
}
.lvl-ok .left { color: var(--primary); }
.lvl-warn .left { color: var(--amber); }
.lvl-warn .progress > span { background: linear-gradient(90deg, #f3c74f, #e88a3a); }
.lvl-danger .left { color: var(--red); }
.lvl-danger .progress > span { background: linear-gradient(90deg, #ff7a8a, #e3354c); }

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 164px;
    height: 34px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    padding: 0 12px;
    white-space: nowrap;
}
.status-paid { background: var(--green-soft); color: var(--green); }
.status-unpaid { background: var(--red-soft); color: var(--red); }
.status-unpaid i { animation: pulse 1.4s ease-in-out infinite; }
.status-ok { background: var(--primary-soft); color: var(--primary); }
@keyframes pulse { 50% { opacity: .35; } }

.h-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.switch { position: relative; display: block; width: 42px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
    position: absolute;
    inset: 0;
    border-radius: 99px;
    background: var(--surface-3);
    transition: background .2s;
}
.switch span::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
    transition: transform .2s;
}
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(18px); }

.empty {
    text-align: center;
    padding: 56px 24px;
}
.empty .ico {
    width: 84px;
    height: 84px;
    border-radius: 28px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    font-size: 34px;
    background: var(--primary-soft);
    color: var(--primary);
}
.empty h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.empty p { color: var(--muted); font-weight: 600; margin-bottom: 22px; }

/* ---------- Analytics ---------- */
.charts { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-bottom: 20px; }
.chart-box { position: relative; height: 280px; }
.forecast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.forecast .stat-value { font-size: 26px; }
.target { margin-top: 22px; }
.target-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.target .progress { height: 10px; }

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--backdrop);
    backdrop-filter: blur(6px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 16px;
}
.modal.active { display: flex; animation: fade .2s ease; }
.modal-card {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    margin: auto;
    animation: rise .25s ease;
}
.modal-card h2 { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.2; margin-bottom: 4px; }
.modal-card .lead { color: var(--muted); font-weight: 600; margin-bottom: 22px; }
.modal-logo {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    background: #fff;
    padding: 14px;
    margin: 0 auto 20px;
    object-fit: contain;
    box-shadow: 0 8px 22px rgba(20, 34, 64, .16);
}
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.notes-text {
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--surface-2);
    border-radius: 20px;
    padding: 18px 20px;
    font-weight: 600;
    color: var(--text-2);
    max-height: 50vh;
    overflow-y: auto;
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Toast ---------- */
#toastContainer {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    min-width: 280px;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    color: var(--text);
    border-radius: 20px;
    padding: 12px 18px 12px 12px;
    box-shadow: var(--shadow-lg);
    font-weight: 700;
    font-size: 14px;
    animation: slideIn .3s ease-out;
}
.toast .t-ico {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.toast.success .t-ico { background: var(--green-soft); color: var(--green); }
.toast.error .t-ico { background: var(--red-soft); color: var(--red); }
.toast.hiding { animation: slideOut .3s ease-in forwards; }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------- Tabs (history) ---------- */
.tabs {
    display: inline-flex;
    gap: 6px;
    background: var(--surface);
    padding: 6px;
    border-radius: 999px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    max-width: 100%;
    overflow-x: auto;
}
.tab {
    height: 44px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    transition: all .2s;
}
.tab:hover { color: var(--primary); }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(var(--accent-rgb), .3); }

.list { display: flex; flex-direction: column; gap: 12px; }
.list-item {
    background: var(--surface-2);
    border-radius: 20px;
    padding: 16px 20px;
}
.log-item { display: flex; align-items: center; gap: 14px; }
.log-ico {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.log-main { flex: 1; min-width: 0; }
.log-main .t { font-weight: 700; }
.log-main .s { font-size: 12px; font-weight: 600; color: var(--muted); }
.log-time { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }

.pay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pay-head .t { font-weight: 800; }
.pay-line {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    border-top: 1px solid var(--line);
    color: var(--text-2);
}
.pay-line b { color: var(--text); }

.cal-layout { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-month { font-size: 17px; font-weight: 800; }
.cal-nav { width: 38px; height: 38px; border-radius: 50%; color: var(--primary); font-size: 14px; }
.cal-nav:hover { background: var(--primary-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 800; color: var(--muted); padding: 4px 0 8px; }
.cal-day {
    position: relative;
    aspect-ratio: 1;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-2);
    transition: background .15s;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--primary-2); color: var(--primary); }
.cal-day.selected { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(var(--accent-rgb), .3); }
.cal-marks { position: absolute; bottom: 6px; display: flex; gap: 3px; }
.cal-marks i { width: 5px; height: 5px; border-radius: 50%; }
.cal-marks .up { background: var(--primary); }
.cal-marks .paid { background: var(--green); }
.cal-day.selected .cal-marks i { background: #fff; }
.cal-legend { display: flex; gap: 16px; margin-top: 16px; font-size: 12px; font-weight: 700; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.cal-item { display: flex; align-items: center; gap: 14px; }
.cal-date {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 800;
}
.cal-date b { font-size: 17px; }
.cal-date small { font-size: 10px; margin-top: 3px; text-transform: lowercase; }
.cal-item .log-main .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-amount { font-weight: 800; white-space: nowrap; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 20px; }
.pager button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--text-2);
}
.pager button.active { background: var(--grad); color: #fff; }

/* ---------- Providers ---------- */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.prov { display: flex; flex-direction: column; gap: 16px; }
.prov-top { display: flex; align-items: center; gap: 14px; }
.prov-top .fav { width: 56px; height: 56px; border-radius: 18px; }
.prov-name { font-size: 18px; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.prov-links { display: flex; flex-direction: column; gap: 10px; }
.prov-link {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    min-width: 0;
}
.prov-link i { width: 18px; color: var(--primary); text-align: center; }
.prov-link a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prov-link a:hover { color: var(--primary); }
.prov-notes { font-size: 13px; font-weight: 600; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
.prov-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; }
.prov-actions .btn { height: 40px; font-size: 14px; }
.btn-soft.danger:hover { background: var(--red-soft); color: var(--red); }

.link-btn { color: var(--primary); font-weight: 700; font-size: 13px; margin-top: 8px; }

/* ---------- Auth pages ---------- */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}
.auth-card { width: 100%; max-width: 420px; padding: 44px 40px; }
.auth-card h1 { font-size: 34px; line-height: 1.15; font-weight: 800; color: var(--primary); margin: 18px 0 10px; }
.auth-card p { color: var(--muted); font-weight: 600; }
.auth-box {
    background: var(--surface-2);
    border-radius: 22px;
    padding: 22px;
    margin: 28px 0 8px;
    text-align: center;
}
.auth-box .label { margin: 0 0 14px; }
.tg-wrap { display: flex; justify-content: center; min-height: 44px; }
.auth-foot { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 18px; }
.code-id { font-family: ui-monospace, Consolas, monospace; font-size: 24px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--surface-3); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: spin 0.9s linear infinite;
    margin: 0 auto 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Dropdown ---------- */
.dd { position: relative; }
.dd > select { display: none; }
.dd-pill { flex: 0 0 auto; min-width: 190px; }
.dd-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    white-space: nowrap;
    transition: background-color .25s, border-color .25s, box-shadow .25s, color .25s, transform .15s;
}
.dd-label { overflow: hidden; text-overflow: ellipsis; }
.dd-pill .dd-btn {
    height: 54px;
    padding: 0 20px 0 22px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-weight: 700;
    color: var(--text-2);
}
.dd-pill .dd-btn:hover, .dd-pill.open .dd-btn { color: var(--primary); box-shadow: 0 14px 30px rgba(20, 34, 64, .16); }
.dd-field .dd-btn {
    height: 50px;
    padding: 0 20px 0 22px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 2px solid transparent;
    font-weight: 600;
    color: var(--text);
}
.dd-field.open .dd-btn, .dd-field .dd-btn:focus-visible { border-color: var(--primary-2); background: var(--surface); outline: 0; }
.dd .chev { font-size: 11px; color: var(--primary); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.dd.open .chev { transform: rotate(180deg); }

.dd-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    max-height: 290px;
    overflow-y: auto;
    z-index: 60;
    padding: 6px;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px) scale(.97);
    transform-origin: top center;
    transition: opacity .2s ease, transform .25s cubic-bezier(.2, .9, .3, 1.15), visibility .2s;
}
.dd.up .dd-menu { top: auto; bottom: calc(100% + 8px); transform: translateY(8px) scale(.97); transform-origin: bottom center; }
.dd.open .dd-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

.dd-opt {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-2);
    text-align: left;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.dd.open .dd-opt { animation: optIn .28s both; animation-delay: calc(var(--i, 0) * 22ms); }
.dd-opt:hover, .dd-opt:focus-visible { background: var(--surface-2); color: var(--primary); outline: 0; }
.dd-opt.selected { background: var(--primary-soft); color: var(--primary); }
.dd-opt .fa-check { font-size: 12px; opacity: 0; transform: scale(.5); transition: opacity .2s, transform .2s; }
.dd-opt.selected .fa-check { opacity: 1; transform: none; }
@keyframes optIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Motion ---------- */
.card, .sidebar, .profile-chip, .bottom-nav, .tabs, .list-item, .modal-card, .toast,
.search input, .input, .select, .textarea, .chip, .status, .h-row, .month-head, .fav {
    transition-property: background-color, color, border-color, box-shadow, opacity, transform;
    transition-duration: .3s;
    transition-timing-function: ease;
}
.btn { transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s, background-color .25s, color .25s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.act, .icon-btn, .cal-nav, .cal-day, .pager button, .story-ring {
    transition: background-color .2s, color .2s, box-shadow .25s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.act:hover, .icon-btn:hover { transform: translateY(-2px); }
.act:active, .icon-btn:active, .cal-day:active { transform: scale(.92); transition-duration: .08s; }
.stat:hover, .prov:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(20, 34, 64, .13); }
.switch span, .switch span::after { transition: background .3s ease, transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.search input:focus { box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow); }

.modal { transition: none; }
.modal.active { animation: fade .25s ease; }
.modal.active .modal-card { animation: rise .32s cubic-bezier(.2, .9, .3, 1.1); }
.modal.closing { animation: fadeOut .18s ease forwards; }
.modal.closing .modal-card { animation: sink .18s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sink { to { opacity: 0; transform: translateY(12px) scale(.98); } }

#content-payments:not(.hidden), #content-calendar:not(.hidden), #content-logs:not(.hidden) { animation: rise .3s ease; }
.tab { transition: background-color .25s, color .25s, box-shadow .25s; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1360px) {
    .h-cols { display: none; }
    .h-row {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.4fr) auto;
        grid-template-areas: "host price date switch" "status status actions actions";
        row-gap: 14px;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        padding: 18px 20px;
    }
    .h-row:last-child { border-bottom: 0; }
    .h-status, .h-switch { justify-content: flex-start; }
    .status { width: auto; }
}

@media (max-width: 1199px) {
    .app { grid-template-columns: 88px minmax(0, 1fr); gap: 24px; padding: 24px; }
    .sidebar { top: 24px; height: calc(100vh - 48px); padding: 20px 12px; align-items: center; }
    .brand { padding: 0; margin-bottom: 22px; }
    .brand-text, .nav-caption, .nav-item span { display: none; }
    .nav-item { justify-content: center; padding: 0; width: 56px; height: 52px; }
    .nav-item i { font-size: 18px; }
    .charts { grid-template-columns: 1fr; }
    .cal-layout { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
    .stat { padding: 22px; }
    .stat-value { font-size: 23px; }
    .toolbar .search { flex-basis: 100%; }
    .toolbar .pill-select, .toolbar .dd-pill, .toolbar .btn { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 960px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .cal-layout { grid-template-columns: 1fr; }
    .cal-layout > .card:first-child { max-width: 440px; width: 100%; justify-self: center; }
}

@media (max-width: 767px) {
    body { font-size: 14px; }
    .app { grid-template-columns: minmax(0, 1fr); padding: 16px 16px 110px; gap: 0; }
    .sidebar { display: none; }
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 16px;
        height: 66px;
        background: var(--surface);
        border-radius: 999px;
        box-shadow: var(--shadow-lg);
        z-index: 40;
    }
    .bottom-nav a, .bottom-nav button {
        width: 48px;
        height: 48px;
        display: grid;
        place-items: center;
        font-size: 19px;
        color: var(--muted);
        border-radius: 50%;
    }
    .bottom-nav .active { color: #fff; background: var(--grad); box-shadow: 0 8px 18px rgba(var(--accent-rgb), .35); }

    .topbar { flex-direction: column-reverse; gap: 16px; margin: 0 0 20px; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .hello h1 { font-size: 28px; }

    .card { padding: 20px; border-radius: 24px; }
    .stats { gap: 12px; }
    .stat { padding: 18px; }
    .stat-icon { width: 38px; height: 38px; margin-bottom: 12px; border-radius: 12px; }
    .stat-value { font-size: 20px; }

    .toolbar { gap: 10px; }
    .toolbar .search { flex-basis: 100%; min-width: 0; }
    .toolbar .search input { height: 50px; }
    .toolbar .search .search-btn { width: 40px; height: 40px; }
    .toolbar .pill-select, .toolbar .dd-pill, .toolbar .btn { flex: 1 1 calc(50% - 5px); min-width: 0; height: 48px; }
    .toolbar .dd-pill .dd-btn { height: 48px; padding: 0 16px 0 18px; }
    .toolbar .pill-select { padding: 0 38px 0 18px; background-position: right 16px center; }

    .month { padding: 4px; }
    .month-head { padding: 16px 14px 6px; align-items: flex-start; }
    .month-title { font-size: 16px; }
    .month-title .badge { display: inline-block; margin: 4px 0 0; }
    .month-sum .v { font-size: 18px; }
    .month-sum .s { white-space: nowrap; font-size: 11px; }

    .h-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        grid-template-areas: "host host switch" "price date date" "status actions actions";
        padding: 16px 14px;
        gap: 14px 12px;
    }
    .h-switch { justify-content: flex-end; }
    .fav { width: 42px; height: 42px; border-radius: 14px; padding: 8px; }
    .h-price .v { font-size: 15px; }
    .status { font-size: 11px; height: 32px; padding: 0 12px; }
    .h-actions { gap: 6px; }
    .act { width: 34px; height: 34px; }

    .forecast { grid-template-columns: 1fr; gap: 14px; }
    .chart-box { height: 240px; }

    .modal { padding: 0; }
    .modal-card { max-width: none; min-height: 100%; border-radius: 0; padding: 26px 20px; }
    .grid-2 { grid-template-columns: 1fr 1fr; gap: 10px; }

    .cal-day { border-radius: 12px; }
    .log-item { flex-wrap: wrap; }
    .log-time { width: 100%; padding-left: 56px; }

    #toastContainer { left: 16px; right: 16px; top: 16px; }
    .toast { min-width: 0; max-width: none; }
    .auth-card { padding: 36px 24px; }
}

/* ---------- Confirm dialog ---------- */
.confirm-modal { align-items: center; }
.confirm-card { max-width: 400px; text-align: center; padding: 34px 30px 28px; }
.confirm-card h2 { color: var(--text); font-size: 22px; }
.confirm-card .lead { margin-bottom: 4px; }
.confirm-ico {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    font-size: 26px;
    background: var(--primary-soft);
    color: var(--primary);
}
.confirm-ico.danger { background: var(--red-soft); color: var(--red); }
.confirm-modal.active .confirm-ico { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) .08s both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.btn-danger { background: linear-gradient(90deg, #ff6b7d 0%, #e3354c 100%); color: #fff; box-shadow: 0 10px 22px rgba(227, 53, 76, .3); }
.btn-danger:hover { box-shadow: 0 14px 28px rgba(227, 53, 76, .42); }

.auth-error {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 13px;
    font-weight: 700;
    animation: rise .3s ease;
}

@media (max-width: 767px) {
    .modal.confirm-modal { padding: 16px; }
    .confirm-card { min-height: 0; border-radius: 28px; padding: 30px 22px 22px; }
}
/* ---------- Page heading chips ---------- */
.hello h1 { font-size: 30px; color: var(--text); }
.hello-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hchip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: rise .35s ease both;
}
.hchip:nth-child(2) { animation-delay: .05s; }
.hchip:nth-child(3) { animation-delay: .1s; }
.hchip-red { background: var(--red-soft); color: var(--red); box-shadow: none; }
.hchip-green { background: var(--green-soft); color: var(--green); box-shadow: none; }

/* ---------- Month group ---------- */
.month-group { margin-bottom: 28px; }
.month-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "ico title sum" "ico meta sum";
    align-items: center;
    column-gap: 14px;
    row-gap: 4px;
    padding: 16px 24px 16px 16px;
    margin-bottom: 12px;
    border-radius: 24px;
}
.month-bar .month-title { grid-area: title; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.month-meta { grid-area: meta; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.month-meta .badge { margin: 0; }
.month-bar .month-sum { grid-area: sum; }
.month-ico {
    grid-area: ico;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #fff;
    font-size: 17px;
    box-shadow: 0 8px 18px rgba(var(--accent-rgb), .3);
}
.month-count { font-size: 12px; font-weight: 700; color: var(--muted); }
.month-group .month { margin-bottom: 0; padding-top: 12px; }

/* ---------- Overflow guard ---------- */
.app { overflow-x: clip; }
.dd-menu { max-width: calc(100vw - 32px); }
.dd.right .dd-menu { left: auto; right: 0; }
.dd-opt span { overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 767px) {
    .hello h1 { font-size: 26px; }
    .hchip { height: 32px; font-size: 12px; }
    .month-bar { padding: 12px 16px 12px 12px; border-radius: 20px; column-gap: 12px; }
    .month-ico { width: 40px; height: 40px; border-radius: 13px; font-size: 15px; }
    .month-group { margin-bottom: 22px; }
}

@media (max-width: 480px) {
    .month-bar { grid-template-areas: "ico title sum" "ico meta meta"; }
    .month-bar .month-sum .s { display: none; }
    .month-meta .badge { font-size: 10px; padding: 3px 8px; }

    .h-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto;
        grid-template-areas:
            "host host switch"
            "price date date"
            "status date date"
            "actions actions actions";
        row-gap: 10px;
    }
    .h-status { align-self: start; }
    .status { font-size: 11px; height: 28px; padding: 0 10px; gap: 5px; max-width: 100%; }
    .h-actions { gap: 6px; justify-content: stretch; margin-top: 4px; }
    .h-actions .act { flex: 1; width: auto; height: 38px; }

    .toolbar .dd-pill .dd-btn, .toolbar .btn { padding: 0 12px 0 14px; gap: 6px; font-size: 13px; }
    .hello-chips { gap: 6px; }
}
/* ---------- Pay dialog ---------- */
.pay-input { height: 64px; text-align: center; font-size: 28px; font-weight: 800; margin-top: 8px; }
.pay-input::-webkit-outer-spin-button, .pay-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-input { -moz-appearance: textfield; }
.pay-quick { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.pay-quick .chip { height: 32px; padding: 0 16px; font-size: 13px; cursor: pointer; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), background-color .2s; }
.pay-quick .chip:hover { transform: translateY(-2px); }
.pay-quick .chip:active { transform: scale(.92); }
/* ---------- Admins ---------- */
.admins-layout { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.admin-item { display: flex; align-items: center; gap: 14px; transition: opacity .3s, transform .3s; }
.admin-avatar { width: 44px; height: 44px; font-size: 16px; }
.admin-item .log-main .t { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.admin-hint {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    line-height: 1.5;
}
.admin-hint i { color: var(--primary); margin-top: 2px; }

@media (max-width: 960px) {
    .admins-layout { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
    .bottom-nav a, .bottom-nav button { width: 42px; height: 42px; font-size: 17px; }
}
/* ---------- Group badges ---------- */
.gbadge {
    --c: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    color: #fff;
    background: var(--c);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 55%, rgba(0, 0, 0, .06));
    box-shadow: 0 3px 10px -2px var(--c), inset 0 1px 0 rgba(255, 255, 255, .28);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
    transition: background-color .3s, color .3s, box-shadow .3s;
}
.gbadge i { font-size: 10px; }
.gbadge-pop { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }

.admins-side { display: flex; flex-direction: column; gap: 20px; }
.admin-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-controls .dd { width: 190px; }

.dd-sm .dd-btn { height: 38px; padding: 0 14px 0 16px; font-size: 13px; font-weight: 700; }
.dd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dd-label, .dd-opt span { display: inline-flex; align-items: center; min-width: 0; }

.group-list { display: flex; flex-direction: column; gap: 6px; margin: -6px 0 18px; }
.group-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 14px; transition: background-color .2s; }
.group-row:hover { background: var(--surface-2); }
.group-row .gbadge { max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.group-members { flex: 1; font-size: 12px; font-weight: 700; color: var(--muted); }
.group-form { border-top: 1px solid var(--line); padding-top: 18px; }
.group-list:empty + .group-form, .card-head + .group-form { border-top: 0; padding-top: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
    position: relative;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
    transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.active { transform: scale(1.1); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-2); }
.swatch-custom { display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.group-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 16px;
    background: var(--surface-2);
    font-size: 12px;
    font-weight: 700;
}
.group-preview .gbadge { max-width: 70%; overflow: hidden; text-overflow: ellipsis; }
.group-actions { display: flex; gap: 10px; }
.group-actions .btn { flex: 1; }

@media (max-width: 767px) {
    .admin-item { flex-wrap: wrap; }
    .admin-item .log-main { flex: 1 1 calc(100% - 60px); }
    .admin-controls { width: 100%; padding-left: 58px; }
    .admin-controls .dd { flex: 1; width: auto; }
}
/* ---------- Badge alignment / profile ---------- */
.admin-item .log-main .t { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; line-height: 1.2; }
.badge-slot { display: inline-flex; align-items: center; }
.badge-slot:empty { display: none; }
.admin-name { font-weight: 800; }
.admin-item .log-main .s { margin-top: 4px; }
.list-item .dd-sm .dd-btn { background: var(--surface); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }
.list-item .dd-sm.open .dd-btn { border-color: var(--primary-2); }
.act-spacer { width: 36px; flex-shrink: 0; }

.profile-chip { padding: 6px 18px 6px 6px; gap: 12px; }
.profile-chip .avatar { width: 44px; height: 44px; font-size: 17px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-soft); }
.profile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.profile-chip .name { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1; white-space: nowrap; }
.profile-chip .sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1; }
.profile-chip .sub i { color: var(--amber); font-size: 11px; }
.gbadge-sm { height: 18px; padding: 0 7px; border-radius: 6px; font-size: 10px; gap: 4px; }
.gbadge-sm i { font-size: 9px; }

@media (max-width: 767px) {
    .act-spacer { display: none; }
    .profile-chip { padding-right: 14px; }
}
/* ---------- Permissions ---------- */
.group-modal { max-width: 520px; }
.perm-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 6px 10px; }
.perm-quick { display: flex; gap: 6px; }
.perm-quick button {
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    background: var(--surface-2);
    color: var(--text-2);
    transition: background-color .2s, color .2s;
}
.perm-quick button:hover { background: var(--primary-soft); color: var(--primary); }
.perm-section { background: var(--surface-2); border-radius: 20px; padding: 6px 6px 6px; margin-bottom: 10px; }
.perm-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; padding: 10px 12px 6px; color: var(--text); }
.perm-title i { color: var(--primary); width: 16px; text-align: center; }
.perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: background-color .15s;
}
.perm-row:hover { background: var(--surface); }
.perm-row .switch { flex-shrink: 0; }

.switch.is-locked { cursor: not-allowed; opacity: .55; }
/* ---------- Access denied on login ---------- */
.denied { animation: rise .35s ease; }
.denied-ico {
    width: 64px;
    height: 64px;
    margin: 22px 0 0;
    border-radius: 20px;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: var(--amber-soft);
    color: var(--amber);
    animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) .1s both;
}
.auth-card h1.denied-title { font-size: 28px; margin: 16px 0 10px; color: var(--text); }
.denied-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 4px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: 13px;
    font-weight: 800;
}
.auth-card p.denied-hint { font-size: 13px; margin-top: 14px; }
.denied-id {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 14px;
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--surface-2);
    border: 2px dashed var(--surface-3);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-align: left;
    transition: border-color .2s, background-color .2s;
}
.denied-id small { display: block; font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.denied-id i { font-size: 16px; color: var(--muted); transition: color .2s; }
.denied-id:hover { border-color: var(--primary-2); }
.denied-id.copied { border-color: var(--green); background: var(--green-soft); }
.denied-id.copied i { color: var(--green); }

/* ---------- Users (access requests) ---------- */
.admins-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.section-lead { font-size: 13px; font-weight: 600; color: var(--muted); margin: -10px 0 16px; }
.count-pill {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 6px;
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 12px;
    vertical-align: 2px;
}
.attempts { font-size: 11px; font-weight: 800; color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 3px 8px; }
.avatar-muted { background: var(--surface-3); color: var(--text-2); }

.nav-count {
    margin-left: auto;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    animation: pop .4s cubic-bezier(.3, 1.6, .5, 1);
}
@media (max-width: 1199px) {
    .nav-item { position: relative; }
    .nav-item .nav-count { position: absolute; top: 6px; right: 4px; margin: 0; min-width: 18px; height: 18px; font-size: 10px; }
}
.bottom-nav a { position: relative; }
.bottom-nav .nav-count { position: absolute; top: 2px; right: 2px; margin: 0; min-width: 18px; height: 18px; font-size: 10px; }
/* ---------- Default group ---------- */
.act.star:hover { background: var(--amber-soft); color: var(--amber); }
.act.star.on { background: var(--amber-soft); color: var(--amber); }
.act.star.on i { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.default-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 10.5px;
    font-weight: 800;
}
/* ---------- Group row / swatches fix ---------- */
.group-row { align-items: center; padding: 10px 8px 10px 12px; }
.group-info { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.group-info .gbadge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.group-row .group-members { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; white-space: nowrap; }
.group-row .default-tag { margin-left: 0; display: inline-flex; align-items: center; gap: 4px; }
.group-row .default-tag i { font-size: 9px; }
.group-row .act { flex-shrink: 0; }

.swatches { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.swatch { width: 100%; height: auto; aspect-ratio: 1; max-height: 44px; border-radius: 12px; }
/* ---------- Payment history in edit modal ---------- */
.pay-history { background: var(--surface-2); border-radius: 18px; padding: 6px; max-height: 220px; overflow-y: auto; }
.pay-history-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pay-history-row + .pay-history-row { border-top: 1px solid var(--line); }
.pay-history-row i { color: var(--green); margin-right: 8px; }
.pay-history-row b { color: var(--text); white-space: nowrap; }
.pay-history-empty { padding: 12px; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
/* ---------- Currency switch ---------- */
.cur-switch {
    --i: 0;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 40px);
    height: 46px;
    padding: 4px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
}
.cur-switch button {
    position: relative;
    z-index: 1;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: var(--muted);
    transition: color .25s;
}
.cur-switch button:hover { color: var(--primary); }
.cur-switch button.active { color: #fff; }
.cur-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 40px;
    height: 38px;
    border-radius: 999px;
    background: var(--grad);
    box-shadow: 0 6px 14px rgba(var(--accent-rgb), .35);
    transform: translateX(calc(var(--i) * 40px));
    transition: transform .35s cubic-bezier(.3, 1.3, .5, 1);
}
.cur-flip { animation: curFlip .4s ease; display: inline-block; }
@keyframes curFlip { 0% { opacity: .2; transform: translateY(-4px); } 100% { opacity: 1; transform: none; } }

@media (max-width: 480px) {
    .cur-switch { grid-template-columns: repeat(3, 34px); height: 42px; }
    .cur-switch button { font-size: 14px; }
    .cur-thumb { width: 34px; height: 34px; transform: translateX(calc(var(--i) * 34px)); }
}
/* ---------- Custom Telegram login button ---------- */
.tg-btn {
    width: 100%;
    max-width: 300px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 22px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(90deg, #37aee2 0%, #1e96c8 100%);
    box-shadow: 0 10px 22px rgba(30, 150, 200, .32);
    transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), box-shadow .25s, background .3s, color .3s, opacity .3s;
}
.tg-btn-ico { display: grid; place-items: center; width: 24px; font-size: 22px; }
.tg-btn.is-ready:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(30, 150, 200, .42); }
.tg-btn.is-ready:active { transform: scale(.97); transition-duration: .08s; }
.tg-btn.is-ready { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.tg-btn.is-checking { background: var(--surface-3); color: var(--text-2); box-shadow: none; cursor: progress; font-size: 14px; }
.tg-btn.is-checking .tg-btn-ico { font-size: 16px; }
.tg-btn.is-blocked { background: var(--surface-3); color: var(--muted); box-shadow: none; cursor: not-allowed; opacity: .85; }
.tg-btn.is-blocked .tg-btn-ico { font-size: 18px; }

.tg-blocked {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--amber-soft);
    color: var(--text-2);
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    animation: rise .3s ease;
}
.tg-blocked > i { color: var(--amber); font-size: 18px; margin-top: 2px; }
.tg-blocked b { display: block; color: var(--text); margin-bottom: 2px; }
.tg-blocked .link-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
/* ---------- Heading chips fit ---------- */
.hchip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hchip-nearest { max-width: 320px; }
.hello { min-width: 0; }
@media (max-width: 767px) {
    .hchip-nearest { max-width: 100%; }
}
/* ---------- Sidebar as stacked blocks ---------- */
.mobile-only { display: none !important; }
.sidebar {
    background: none;
    box-shadow: none;
    padding: 0;
    gap: 16px;
    max-height: none;
    height: calc(100vh - 56px);
    overflow: visible;
}
.side-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 16px;
    transition: background-color .3s, box-shadow .3s;
}
.side-head .brand { margin-bottom: 0; }
.side-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 18px;
    background: var(--surface-2);
    min-width: 0;
}
.side-profile .avatar { width: 44px; height: 44px; font-size: 17px; box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 5px var(--primary-soft); }
.side-profile .profile-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.side-profile .name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 800; font-size: 14px; line-height: 1.1; }
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.side-profile .sub { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1; }
.side-profile .sub i { color: var(--amber); font-size: 11px; }

.side-tools { padding: 14px 16px; }
.side-tools-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 2px 10px; }
.side-tools-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-tools .cur-switch, .side-tools .icon-btn { box-shadow: none; background: var(--surface-2); }
.notif-btn.is-on { color: var(--primary); }

.side-nav { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 0; }

@media (max-width: 1199px) {
    .sidebar { padding: 0; align-items: stretch; gap: 12px; }
    .side-card { padding: 14px 10px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; }
    .side-head .brand { margin-bottom: 0; }
    .side-profile { margin-top: 12px; padding: 4px; background: none; justify-content: center; }
    .side-profile .profile-text { display: none; }
    .side-tools-label { display: none; }
    .side-tools-row { flex-direction: column; gap: 8px; }
    .side-tools .cur-switch { grid-template-columns: 40px; grid-template-rows: repeat(3, 38px); height: auto; }
    .side-tools .cur-thumb { transform: translateY(calc(var(--i) * 38px)); }
    .side-nav { align-items: center; }
}

@media (max-width: 767px) {
    .mobile-only { display: flex !important; }
    .tools-inline { align-items: center; gap: 10px; }
    .topbar-right { flex-wrap: wrap; gap: 10px; }
}
/* ---------- Hero header ---------- */
.hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    align-items: center;
    padding: 28px 30px;
    border-radius: var(--radius);
    background: var(--hero-grad);
    box-shadow: 0 18px 40px rgba(var(--accent-rgb), .3);
    color: #fff;
}
.hero-orb { position: absolute; border-radius: 50%; z-index: -1; pointer-events: none; }
.hero-orb-1 { width: 260px; height: 260px; right: -60px; top: -120px; background: radial-gradient(circle, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%); }
.hero-orb-2 { width: 200px; height: 200px; left: 38%; bottom: -130px; background: radial-gradient(circle, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%); }
.hero .hello h1 { color: #fff; }
.hero .hello p { color: rgba(255, 255, 255, .78); }
.hero .hchip { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; backdrop-filter: blur(6px); }
.hero .hchip i { color: #fff !important; opacity: .9; }
.hero .hchip-red { background: #fff; color: var(--red); }
.hero .hchip-red i { color: var(--red) !important; }
.hero .hchip-green { background: rgba(34, 176, 125, .9); }
.hero .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 10px 22px rgba(30, 10, 90, .25); }

.hero-stat {
    min-width: 260px;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.hero-stat-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; opacity: .85; }
.hero-stat-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 4px 0 10px; line-height: 1.1; }
.hero-progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.hero-progress span { display: block; height: 100%; border-radius: 99px; background: #fff; transition: width .6s cubic-bezier(.3, 1, .4, 1); }
.hero-stat-sub { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 12px; font-weight: 700; opacity: .9; white-space: nowrap; }
.hero-stat-sub i { margin-right: 5px; opacity: .8; }

/* ---------- Unified sidebar card ---------- */
.side-switch { margin-top: 14px; }
.cur-wide { width: 100%; grid-template-columns: repeat(3, 1fr); box-shadow: none; background: var(--surface-2); }
.cur-wide .cur-thumb { width: calc((100% - 8px) / 3); transform: translateX(calc(var(--i) * 100%)); }
.side-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 10px; }
.ctrl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 58px;
    border-radius: 16px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 10.5px;
    font-weight: 800;
    transition: background-color .2s, color .2s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.ctrl-btn i { font-size: 16px; }
.ctrl-btn span { white-space: nowrap; }
.ctrl-btn:hover { background: var(--primary-soft); color: var(--primary); transform: translateY(-2px); }
.ctrl-btn:active { transform: scale(.95); transition-duration: .08s; }
.ctrl-btn.danger { background: var(--red-soft); color: var(--red); }
.ctrl-btn.danger:hover { background: var(--red); color: #fff; }
.ctrl-btn.notif-btn.is-on { color: var(--primary); }
.side-nav { flex: 1; }

@media (max-width: 1199px) {
    .side-switch { width: 100%; }
    .cur-wide { grid-template-columns: 1fr; grid-template-rows: repeat(3, 36px); height: auto; }
    .cur-wide .cur-thumb { width: calc(100% - 8px); height: 36px; transform: translateY(calc(var(--i) * 36px)); }
    .side-actions { grid-auto-flow: row; grid-auto-columns: auto; width: 100%; }
    .ctrl-btn { height: 46px; }
    .ctrl-btn span { display: none; }
    .hero-stat { min-width: 220px; }
}

@media (max-width: 960px) {
    .hero { flex-direction: column; align-items: stretch; }
    .hero .topbar-right { width: 100%; }
    .hero-stat { flex: 1; }
}

@media (max-width: 767px) {
    .hero { padding: 20px 18px; border-radius: 24px; flex-direction: column; gap: 16px; }
    .hero-orb-1 { width: 200px; height: 200px; }
    .hero .topbar-right { order: -1; justify-content: space-between; }
    .hero .tools-inline .cur-switch, .hero .tools-inline .icon-btn { background: rgba(255, 255, 255, .16); box-shadow: none; }
    .hero .tools-inline .cur-switch button:not(.active), .hero .tools-inline .icon-btn { color: #fff; }
    .hero .tools-inline .cur-thumb { background: #fff; }
    .hero .tools-inline .cur-switch button.active { color: var(--primary); }
    .hero .profile-chip { background: rgba(255, 255, 255, .16); box-shadow: none; color: #fff; }
    .hero .profile-chip .sub { color: rgba(255, 255, 255, .8); }
    .hero-stat { order: 5; width: 100%; min-width: 0; }
    .hero-stat-value { font-size: 24px; }
}
/* ---------- Sidebar head: polished ---------- */
.side-head { padding: 18px 16px 16px; }
.side-head .brand { gap: 12px; padding: 0 2px; }
.side-head .logo { width: 44px; height: 44px; border-radius: 14px; }
.brand-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.brand-text b { font-size: 15px; font-weight: 800; color: var(--text); }
.brand-text small { font-size: 11px; font-weight: 700; color: var(--muted); }

.sp {
    position: relative;
    margin-top: 16px;
    padding-bottom: 14px;
    border-radius: 22px;
    background: var(--surface-2);
    overflow: hidden;
    text-align: center;
}
.sp-cover {
    position: relative;
    height: 62px;
    overflow: hidden;
    background: var(--hero-grad);
}
.sp-cover span { position: absolute; border-radius: 50%; pointer-events: none; }
.sp-cover span:nth-child(1) { width: 130px; height: 130px; right: -34px; top: -70px; background: radial-gradient(circle, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 70%); }
.sp-cover span:nth-child(2) { width: 110px; height: 110px; left: -24px; bottom: -74px; background: radial-gradient(circle, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 70%); }
.sp-avatar { position: relative; display: flex; justify-content: center; margin-top: -34px; }
.sp-avatar .avatar {
    width: 66px;
    height: 66px;
    font-size: 24px;
    box-shadow: 0 0 0 4px var(--surface-2), 0 0 0 6px rgba(var(--accent2-rgb), .55), 0 12px 24px rgba(var(--accent-rgb), .35);
    transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
}
.sp:hover .sp-avatar .avatar { transform: scale(1.05) rotate(-3deg); }
.sp-body { padding: 0 12px; }
.sp-name { margin-top: 10px; font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-badge { display: flex; justify-content: center; margin-top: 6px; min-height: 22px; }
.sp-greet { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sp-greet i { color: var(--amber); }

.side-switch { margin-top: 14px; }
.cur-wide { height: 52px; padding: 4px; }
.cur-wide .cur-thumb { height: 44px; top: 4px; border-radius: 16px; }
.cur-wide, .cur-wide button { border-radius: 18px; }
.cur-wide button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1; }
.cur-wide button b { font-size: 15px; font-weight: 800; }
.cur-wide button small { font-size: 9.5px; font-weight: 800; letter-spacing: .6px; opacity: .65; }

.side-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.round-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 15px;
    transition: background-color .2s, color .2s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.round-btn:hover { background: var(--primary-soft); color: var(--primary); transform: translateY(-2px); }
.round-btn:active { transform: scale(.92); transition-duration: .08s; }
.round-btn.is-on { color: var(--primary); background: var(--primary-soft); }

.theme-switch {
    position: relative;
    flex-shrink: 0;
    width: 72px;
    height: 42px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 999px;
    background: var(--surface-2);
}
.ts-knob {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--grad);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), .45);
    transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.ts-sun, .ts-moon { position: relative; z-index: 1; font-size: 13px; transition: color .3s, transform .45s; }
.ts-sun { color: #fff; }
.ts-moon { color: var(--muted); }
:root[data-theme="dark"] .ts-knob { transform: translateX(30px); }
:root[data-theme="dark"] .ts-sun { color: var(--muted); transform: rotate(-90deg); }
:root[data-theme="dark"] .ts-moon { color: #fff; transform: rotate(-20deg); }

.logout-pill {
    margin-left: auto;
    height: 42px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red);
    font-size: 13px;
    font-weight: 800;
    transition: background-color .2s, color .2s, box-shadow .25s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.logout-pill i { transition: transform .25s; }
.logout-pill:hover { background: linear-gradient(90deg, #ff6b7d, #e3354c); color: #fff; box-shadow: 0 8px 18px rgba(227, 53, 76, .35); }
.logout-pill:hover i { transform: translateX(3px); }
.logout-pill:active { transform: scale(.95); }

@media (max-width: 1199px) {
    .side-head { padding: 14px 10px; }
    .sp { margin-top: 12px; padding: 0; background: none; overflow: visible; }
    .sp-cover, .sp-body { display: none; }
    .sp-avatar { margin-top: 0; }
    .sp-avatar .avatar { width: 48px; height: 48px; font-size: 18px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px rgba(var(--accent2-rgb), .55); }
    .cur-wide { height: auto; grid-template-rows: repeat(3, 38px); }
    .cur-wide .cur-thumb { height: 38px; }
    .cur-wide button small { display: none; }
    .side-actions { flex-direction: column; gap: 8px; }
    .theme-switch { width: 42px; height: 72px; padding: 13px 0; flex-direction: column; }
    :root[data-theme="dark"] .ts-knob { transform: translateY(30px); }
    .logout-pill { margin-left: 0; width: 42px; padding: 0; justify-content: center; }
    .logout-pill span { display: none; }
}
@media (max-width: 1199px) {
    .cur-wide .cur-thumb { transform: translateY(calc(var(--i) * 38px)); }
}

/* ---------- Side actions fit ---------- */
.side-actions { gap: 8px; }
.theme-switch { width: 64px; padding: 0 11px; }
:root[data-theme="dark"] .ts-knob { transform: translateX(22px); }
.logout-pill { flex: 1; min-width: 0; margin-left: 0; justify-content: center; padding: 0 10px; gap: 6px; }
.logout-pill span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1199px) {
    .theme-switch { width: 42px; height: 64px; padding: 11px 0; }
    :root[data-theme="dark"] .ts-knob { transform: translateY(22px); }
    .logout-pill { flex: none; width: 42px; padding: 0; }
}
/* ---------- Profile caption / wide theme switch / logout row ---------- */
.side-caption { padding: 0 4px; }
.side-head .sp { margin-top: 10px; }

.theme-switch.theme-wide {
    flex: 1;
    width: auto;
    height: 42px;
    padding: 4px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    border-radius: 999px;
}
.theme-wide .ts-knob {
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: 34px;
    border-radius: 999px;
}
:root[data-theme="dark"] .theme-wide .ts-knob { transform: translateX(100%); }
.theme-wide .ts-opt {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    transform: none !important;
    transition: color .3s;
}
.theme-wide .ts-opt i { font-size: 12px; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.theme-wide .ts-sun { color: #fff; }
.theme-wide .ts-moon { color: var(--muted); }
:root[data-theme="dark"] .theme-wide .ts-sun { color: var(--muted); }
:root[data-theme="dark"] .theme-wide .ts-moon { color: #fff; }
:root[data-theme="dark"] .theme-wide .ts-sun i { transform: rotate(-90deg); }
:root[data-theme="dark"] .theme-wide .ts-moon i { transform: rotate(-20deg); }

.logout-pill.logout-wide { display: flex; width: 100%; flex: none; margin-top: 8px; height: 44px; }

@media (max-width: 1199px) {
    .side-caption { display: none; }
    .side-head .sp { margin-top: 0; }
    .theme-switch.theme-wide { flex: none; width: 42px; height: 72px; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .theme-wide .ts-knob { width: 34px; height: calc(50% - 4px); }
    :root[data-theme="dark"] .theme-wide .ts-knob { transform: translateY(100%); }
    .theme-wide .ts-opt span { display: none; }
    .logout-pill.logout-wide { width: 42px; height: 42px; padding: 0; }
}
/* ---------- Hero glow fix ---------- */
.hero {
    box-shadow: 0 14px 28px -14px rgba(var(--accent-rgb), .65);
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, 0) 45%),
        var(--hero-grad);
}
.hero-orb-1 { width: 220px; height: 220px; right: -70px; top: -110px; background: radial-gradient(circle, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 70%); }
.hero-orb-2 { display: none; }
:root[data-theme="dark"] .hero { box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .7); }
.pay-preview { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pay-preview b { color: var(--text); }
.pay-preview span:last-child b { color: var(--green); }
.pay-preview i { font-size: 11px; color: var(--primary); }
/* ---------- Undo payment ---------- */
.toast { position: relative; overflow: hidden; }
.toast > span { flex: 1; min-width: 0; }
.toast-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    transition: background-color .2s, color .2s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.toast-action:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }
.toast-action i { font-size: 11px; }
.toast-timer {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--primary-2);
    transform-origin: left;
    animation: toastTimer linear forwards;
}
@keyframes toastTimer { to { transform: scaleX(0); } }

.pay-history-right { display: inline-flex; align-items: center; gap: 10px; }
.undo-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--amber-soft);
    color: var(--amber);
    font-size: 11.5px;
    font-weight: 800;
    transition: background-color .2s, color .2s;
}
.undo-btn i { font-size: 10px; margin: 0 !important; color: inherit !important; }
.undo-btn:hover { background: var(--amber); color: #fff; }
/* ---------- Undo button in hosting row ---------- */
@media (min-width: 1361px) {
    .h-cols, .h-row { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.5fr) 164px 56px 212px; }
}
.act.undo { color: var(--amber); }
.act.undo:hover { background: var(--amber-soft); color: var(--amber); }
.pay-line .pay-history-right { gap: 10px; }
/* ---------- Mobile polish: hero + charts ---------- */
.charts { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.charts > *, .chart-box { min-width: 0; }
.hero-stat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

@media (max-width: 960px) {
    .charts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
    .hero { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
    .hero .topbar-right { display: contents; }
    .hero .topbar-right > * { order: 2; }
    .hero .profile-chip { order: 1; flex: 1 1 0; min-width: 0; }
    .hero .tools-inline { order: 2; flex: none; }
    .hero .hello { order: 3; flex: 1 1 100%; }
    .hero .hero-stat { order: 4; flex: 1 1 100%; width: 100%; min-width: 0; }
    .hero .profile-chip .profile-text { min-width: 0; }
    .hero .profile-chip .name { flex-wrap: wrap; row-gap: 4px; }
    .hero .tools-inline .icon-btn { width: 46px; height: 46px; }

    .cur-switch.cur-mini { display: grid !important; grid-template-columns: repeat(3, 30px); height: 34px; padding: 3px; background: rgba(255, 255, 255, .16); box-shadow: none; }
    .cur-mini button { font-size: 13px; color: #fff; }
    .cur-mini button.active { color: var(--primary); }
    .cur-mini .cur-thumb { top: 3px; left: 3px; width: 30px; height: 28px; background: #fff; box-shadow: none; transform: translateX(calc(var(--i) * 30px)); }

    .hero-stat-sub { flex-wrap: wrap; row-gap: 6px; }
    .card { padding: 22px 18px; }
    .chart-box { height: 230px; }
}
/* ---------- Uptime monitor ---------- */
.fav-wrap { position: relative; flex-shrink: 0; }
.mon-dot {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--surface);
    background: var(--muted);
    cursor: help;
}
.mon-up { background: var(--green); }
.mon-down { background: var(--red); }
.mon-pending { background: var(--amber); }
.mon-dot.mon-up::after, .mon-dot.mon-down::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: monPulse 2.4s ease-out infinite;
}
.mon-dot.mon-up::after { color: var(--green); }
.mon-dot.mon-down::after { color: var(--red); animation-duration: 1.2s; }
@keyframes monPulse { 0% { transform: scale(.8); opacity: .8; } 100% { transform: scale(2); opacity: 0; } }
.chip-down { background: var(--red-soft); color: var(--red); display: inline-flex; align-items: center; gap: 4px; }

.monitor-field { display: flex; gap: 8px; }
.monitor-field .input { flex: 1; min-width: 0; }
.monitor-field .btn { flex-shrink: 0; width: 50px; padding: 0; justify-content: center; }
.mon-hint { display: flex; align-items: center; gap: 6px; font-weight: 700; background: none !important; }
.mon-hint::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.mon-hint.mon-up { color: var(--green); }
.mon-hint.mon-down { color: var(--red); }
.mon-hint.mon-pending { color: var(--amber); }

/* ---------- Provider usage ---------- */
.prov-usage { margin-top: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2); }
.prov-usage i.fas { color: var(--primary); margin-right: 6px; }
.prov-usage.is-empty { color: var(--muted); }
.prov-usage.is-empty i.fas { color: var(--muted); }
.prov-usage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prov-usage-head b { color: var(--text); font-size: 15px; white-space: nowrap; }
.prov-usage-head small { font-size: 11px; color: var(--muted); margin-left: 2px; }
.prov-hostings { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prov-hosting {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background-color .2s, color .2s;
}
.prov-hosting:hover { background: var(--primary-soft); color: var(--primary); }
.prov-hosting.is-off { opacity: .5; }
.mon-dot-inline { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
/* ---------- Mobile row polish ---------- */
.act { display: inline-grid; place-items: center; line-height: 1; }
.act i { font-size: 14px; width: 1em; text-align: center; }
@media (max-width: 480px) {
    .h-status { align-self: center; justify-self: stretch; }
    .h-status .status { width: 100%; max-width: none; height: 30px; border-radius: 999px; justify-content: center; }
    .h-actions .act { height: 40px; border-radius: 14px; }
    .h-actions .act i { font-size: 15px; }
}
/* ---------- Mobile: hosting as stacked card ---------- */
@media (max-width: 767px) {
    .card.month { padding: 10px; background: transparent; box-shadow: none; }
    .h-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "host switch" "price price" "date date" "status status" "actions actions";
        gap: 12px;
        padding: 16px;
        margin-bottom: 12px;
        border: 0;
        border-radius: 22px;
        background: var(--surface);
        box-shadow: var(--shadow);
    }
    .h-row:last-child { margin-bottom: 0; }
    .h-row:hover { background: var(--surface); }
    .h-row.is-off { opacity: .6; }

    .h-price {
        display: flex;
        align-items: baseline;
        flex-wrap: wrap;
        gap: 4px 10px;
        padding-top: 12px;
        border-top: 1px dashed var(--line);
    }
    .h-price .v { font-size: 18px; }

    .h-date .date-line { justify-content: space-between; }
    .h-date .meta:empty { display: none; }

    .h-status { justify-content: stretch; }
    .h-status .status { width: 100% !important; max-width: none !important; height: 34px; border-radius: 999px; justify-content: center; font-size: 12px; }

    .h-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin: 0; justify-content: stretch; }
    .h-actions .act { width: auto; height: 42px; border-radius: 14px; }
}
/* ---------- Provider accounts ---------- */
.acc { display: flex; flex-direction: column; gap: 16px; }
.acc-top { display: flex; align-items: center; gap: 14px; }
.acc-title { flex: 1; min-width: 0; }
.acc-name { font-size: 17px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.acc-balance { padding: 16px 18px; border-radius: 20px; background: var(--grad); color: #fff; box-shadow: 0 12px 26px -10px rgba(var(--accent-rgb), .55); }
.acc-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; opacity: .85; }
.acc-value { font-size: 30px; font-weight: 800; letter-spacing: -.5px; margin-top: 4px; line-height: 1.1; }
.acc-debt { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .2); font-size: 12px; font-weight: 800; }
.acc-danger .acc-balance { background: linear-gradient(120deg, #ff6b7d, #e3354c); box-shadow: 0 12px 26px -10px rgba(227, 53, 76, .55); }
.acc-warn .acc-balance { background: linear-gradient(120deg, #f7b955, #f08c2e); box-shadow: 0 12px 26px -10px rgba(240, 140, 46, .55); }
.acc-forecast .date-line { margin-bottom: 8px; }
.acc-forecast .meta { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.acc-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; background: var(--red-soft); color: var(--red); font-size: 13px; font-weight: 700; }
.acc-checked { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.acc .prov-actions { margin-top: auto; display: flex; gap: 8px; }
.acc .prov-actions .btn-primary { flex: 1; }
.acc .prov-actions .btn-soft { flex: none; width: 48px; padding: 0; justify-content: center; }
.acc .prov-usage { margin-top: 0; }
.acc-meta { display: flex; align-items: center; gap: 6px; }
.acc-meta i { color: var(--primary); }
/* ---------- Account form: provider picker / key upload ---------- */
.prov-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.prov-pick-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 2px solid transparent;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-2);
    transition: border-color .2s, background-color .2s, transform .2s cubic-bezier(.3, 1.4, .5, 1);
}
.prov-pick-item img { width: 40px; height: 40px; border-radius: 12px; background: #fff; padding: 4px; }
.prov-pick-item > i { position: absolute; top: 10px; right: 10px; font-size: 11px; opacity: 0; color: var(--primary); transition: opacity .2s; }
.prov-pick-item:hover { transform: translateY(-2px); }
.prov-pick-item.active { border-color: var(--primary-2); background: var(--primary-soft); color: var(--primary); }
.prov-pick-item.active > i { opacity: 1; }
.key-area { font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.4; }
.file-btn { position: relative; margin-top: 10px; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.hint.steps { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.hint.steps a { color: var(--primary); font-weight: 700; }
/* ---------- Recurring charges ---------- */
.acc-next { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; font-weight: 700; }
.acc-next b { color: var(--text); }
.burn-src { color: var(--muted); font-weight: 600; }
.charges { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.charges-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; color: var(--text-2); margin-bottom: 6px; }
.charges-head i { color: var(--primary); margin-right: 6px; }
.charges-head .link-btn { margin: 0; font-size: 12px; }
.charge-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.charge-row:first-of-type { border-top: 0; }
.charge-main { flex: 1; min-width: 0; }
.charge-name { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charge-sub { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.charge-auto { padding: 1px 7px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 10px; font-weight: 800; }
.charge-row b { font-size: 14px; white-space: nowrap; }
.charge-row .act { width: 30px; height: 30px; }
.charge-row .act i { font-size: 12px; }
.charge-empty { font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.45; padding: 4px 0 2px; }
.charge-form { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.charge-form .input { height: 40px; font-size: 13px; padding: 0 14px; background: var(--surface); }
.charge-form-row { display: flex; align-items: center; gap: 6px; }
.charge-num { position: relative; flex: 1; min-width: 0; }
.charge-num span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; color: var(--muted); pointer-events: none; }
.charge-num .input { width: 100%; padding-right: 46px; }
.charge-form-row .act { width: 36px; height: 36px; flex-shrink: 0; }
/* ---------- Yandex export settings ---------- */
.export-box { margin: 4px 0 18px; padding: 16px; border-radius: 20px; background: var(--surface-2); }
.export-box .input { background: var(--surface); }
.export-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); }
.export-title i { color: var(--primary); }
.export-title .muted { font-size: 12px; font-weight: 700; }
.export-box .hint.steps { margin-bottom: 14px; }
.h-price .s i { color: var(--primary); font-size: 10px; margin-right: 2px; }
.acc-warn-box { background: var(--amber-soft); color: var(--amber); }
.acc-warn-box span { color: var(--text-2); }

.acc-live { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; opacity: .85; }

.veesp-unpaid { background: var(--red-soft); }
.veesp-unpaid .charges-head i { color: var(--red); }
.charge-row b small { font-size: 11px; font-weight: 700; margin-left: 2px; }

/* ---------- Admins: redesign ---------- */
.adm-tabs { margin-bottom: 20px; }
.tab-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; margin-left: 6px; border-radius: 999px;
    background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 800; }
.tab.active .tab-count { background: rgba(255, 255, 255, .22); color: #fff; }
.tab-count.hot, .tab.active .tab-count.hot { background: var(--red); color: #fff; }
button.hchip { border: 0; cursor: pointer; font-family: inherit; }

.modal-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 14px;
    background: var(--primary-soft); color: var(--primary); font-size: 22px; }

.adm-note { display: flex; gap: 12px; padding: 16px 18px; margin-bottom: 18px; border-radius: 20px; background: var(--primary-soft);
    color: var(--text-2); font-size: 13px; font-weight: 600; line-height: 1.55; }
.adm-note i { color: var(--primary); margin-top: 3px; }
.adm-note b { color: var(--text); }

.adm-panel { padding: 22px; }
.adm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.adm-toolbar .search { flex: 1 1 280px; min-width: 0; }
.adm-toolbar .search input { background: var(--surface-2); box-shadow: none; }
.adm-toolbar .dd-pill { min-width: 200px; }
.adm-toolbar .dd-pill .dd-btn { background: var(--surface-2); box-shadow: none; }
.adm-toolbar > .btn { height: 54px; padding: 0 22px; }

.adm-head, .adm-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .75fr) 44px; gap: 18px; align-items: center; }
.adm-req-row { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
.adm-head { padding: 0 18px 10px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.adm-list { display: flex; flex-direction: column; gap: 8px; }
.adm-row { padding: 14px 18px; border-radius: 20px; background: var(--surface-2); transition: box-shadow .2s, opacity .3s, transform .3s; }
.adm-row:hover { box-shadow: inset 0 0 0 1px var(--line); }
.adm-row.is-owner { background: linear-gradient(90deg, rgba(232, 181, 58, .13), var(--surface-2) 55%); }
.adm-row.is-leaving { opacity: 0; transform: translateX(14px); }

.adm-who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.adm-avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--grad); color: #fff; font-weight: 800; font-size: 17px;
    box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 5px var(--ring, transparent); }
.adm-avatar.muted { background: var(--surface-3); color: var(--text-2); }
.adm-who-text { min-width: 0; }
.adm-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 15px; font-weight: 800; color: var(--text); }
.adm-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.adm-you { padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 10.5px; font-weight: 800; }
.adm-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.adm-meta a { color: var(--primary); font-weight: 700; }
.adm-id { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 8px; background: var(--surface);
    color: var(--text-2); font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; font-weight: 700; transition: color .2s; }
.adm-id:hover { color: var(--primary); }
.adm-id i { font-size: 9px; opacity: .6; }

.adm-cell { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.adm-cell-label { display: none; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.adm-cell .dd { width: 100%; }
.adm-cell .dd-sm .dd-btn { background: var(--surface); box-shadow: none; }
.adm-access { display: inline-flex; align-items: center; gap: 6px; padding-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.adm-access i { font-size: 10px; }
.adm-access.full { color: var(--green); }
.adm-seen { font-size: 13px; font-weight: 700; color: var(--text-2); }
.adm-seen .never { color: var(--muted); font-weight: 600; }
.adm-actions, .adm-req-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.adm-req-actions .btn { height: 40px; padding: 0 16px; font-size: 13px; white-space: nowrap; }
.adm-lock { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); opacity: .6; }
.adm-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 0; color: var(--muted); font-weight: 700; text-align: center; }
.adm-empty i { font-size: 28px; color: var(--primary); opacity: .6; margin-bottom: 6px; }
.adm-empty small { font-weight: 600; font-size: 12px; }

/* группы */
.adm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.adm-gcard { --gc: var(--primary); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.adm-gcard::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gc); }
.adm-gcard::after { content: ''; position: absolute; top: -70px; right: -70px; width: 180px; height: 180px; border-radius: 50%;
    background: var(--gc); opacity: .1; filter: blur(14px); pointer-events: none; }
.adm-gcard > * { position: relative; z-index: 1; }
.adm-gcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.adm-gcard-top .gbadge, .adm-preview .gbadge { height: 28px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.adm-default-tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: -6px; padding: 4px 10px;
    border-radius: 999px; background: var(--amber-soft); color: var(--amber); font-size: 11.5px; font-weight: 800; }
.adm-default-tag i { font-size: 10px; }
.adm-gmembers { display: flex; align-items: center; gap: 12px; min-height: 34px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.adm-stack { display: flex; }
.adm-stack .adm-avatar { width: 32px; height: 32px; font-size: 12px; margin-left: -9px; box-shadow: 0 0 0 3px var(--surface); }
.adm-stack .adm-avatar:first-child { margin-left: 0; }
.adm-stack-more { width: 32px; height: 32px; margin-left: -9px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; box-shadow: 0 0 0 3px var(--surface); }
.adm-perm-sum { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); }
.adm-perm-line { display: grid; grid-template-columns: 18px minmax(0, 1fr) 64px 34px; align-items: center; gap: 9px;
    font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.adm-perm-line i { color: var(--gc); text-align: center; font-size: 12px; }
.adm-perm-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-perm-line.off { opacity: .5; }
.adm-meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.adm-meter span { display: block; height: 100%; border-radius: 99px; background: var(--gc); transition: width .4s; }
.adm-perm-line b { text-align: right; font-size: 12px; color: var(--text); }
.adm-gcard-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.adm-gcard-actions .btn { flex: 1; height: 44px; }
.adm-gcard-actions .act { width: 44px; height: 44px; border-radius: 14px; }
.adm-gnew { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 300px; width: 100%;
    border: 2px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--text-2);
    font-family: inherit; font-size: 15px; font-weight: 800; cursor: pointer; transition: border-color .2s, color .2s, background-color .2s; }
.adm-gnew i { width: 56px; height: 56px; margin-bottom: 6px; border-radius: 18px; display: grid; place-items: center;
    background: var(--primary-soft); color: var(--primary); font-size: 20px; transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.adm-gnew small { font-size: 12px; font-weight: 600; color: var(--muted); }
.adm-gnew:hover { border-color: var(--primary-2); color: var(--primary); background: var(--primary-soft); }
.adm-gnew:hover i { transform: rotate(90deg); }

/* окно группы */
.adm-preview { margin-bottom: 18px; }
.perm-section-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 6px; }
.perm-section-head .perm-title { flex: 1; padding: 0; }
.perm-count { font-size: 12px; font-weight: 800; color: var(--muted); }

@media (max-width: 1100px) {
    .adm-head { display: none; }
    .adm-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "who who act" "group seen seen"; row-gap: 14px; }
    .adm-req-row { grid-template-areas: "who who who" "group act act"; }
    .adm-who { grid-area: who; }
    .adm-group-cell { grid-area: group; }
    .adm-seen { grid-area: seen; }
    .adm-actions, .adm-req-actions { grid-area: act; }
    .adm-cell-label { display: block; }
}
@media (max-width: 600px) {
    .adm-panel { padding: 16px; }
    .adm-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "group group" "seen seen"; padding: 14px; }
    .adm-req-row { grid-template-areas: "who who" "group group" "act act"; }
    .adm-req-actions .btn { flex: 1; }
    .adm-toolbar .dd-pill { flex: 1 1 100%; }
    .adm-toolbar > .btn { flex: 1 1 100%; height: 48px; }
    .adm-groups { grid-template-columns: 1fr; }
    .adm-gnew { min-height: 160px; }
}
.adm-gnew { border-color: rgba(var(--accent-rgb), .28); }

/* ---------- Admins: несколько групп, теги, старшинство ---------- */
.gpick .dd-btn { height: auto; min-height: 40px; padding: 6px 14px 6px 10px; }
.gpick-label { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-width: 0; }
.gpick-empty { padding-left: 4px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.gpick-main .gbadge { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px currentColor; }
.gpick .dd-menu { min-width: 240px; }
.gpick-opt > span { display: inline-flex; align-items: center; gap: 8px; }
.gpick-opt .dd-dot { margin-right: 0; }
.gpick-box { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px;
    border: 2px solid var(--surface-3); transition: background-color .15s, border-color .15s; }
.gpick-box .fa-check { font-size: 9px; color: #fff; }
.gpick-opt.selected .gpick-box { background: var(--primary); border-color: var(--primary); }
.gpick-opt > .fa-check { display: none; }
.gpick-rank { font-size: 11px; font-weight: 800; color: var(--muted); }
.gpick-clear { color: var(--red); border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; margin-top: 4px; }
.gpick-clear i { margin-right: 6px; }
.gpick-none { padding: 12px; font-size: 12px; font-weight: 600; color: var(--muted); }

.adm-tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 8px;
    background: var(--primary-soft); color: var(--primary); font-family: inherit; font-size: 11.5px; font-weight: 700;
    cursor: pointer; max-width: 220px; transition: background-color .2s; }
.adm-tag i { font-size: 9px; }
.adm-tag.empty { background: transparent; color: var(--muted); border: 1px dashed var(--surface-3); }
.adm-tag-pen { opacity: 0; margin-left: 2px; transition: opacity .2s; }
.adm-tag:hover .adm-tag-pen, .adm-tag.empty .adm-tag-pen { opacity: .8; }
.adm-tag-input { height: 26px; width: 200px; max-width: 100%; padding: 0 10px; border-radius: 8px; border: 2px solid var(--primary-2);
    background: var(--surface); color: var(--text); font-family: inherit; font-size: 12px; font-weight: 700; outline: none; }

.adm-gcard-top { gap: 6px; }
.adm-gcard-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.adm-gcard-title .gbadge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.adm-rank { flex-shrink: 0; height: 24px; padding: 0 8px; display: grid; place-items: center; border-radius: 8px;
    background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 800; }
.adm-order { display: flex; gap: 4px; }
.adm-order .act { width: 30px; height: 30px; border-radius: 10px; }
.adm-order .act i { font-size: 11px; }
.adm-order .act:disabled { opacity: .3; cursor: default; transform: none; }

/* ---------- Admins: роли, уровни, политики ---------- */
.lvl-chip { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 8px;
    background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; }
.adm-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.adm-role { display: inline-flex; align-items: center; gap: 5px; }
.adm-role small { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--amber); }
.adm-role small i { font-size: 9px; }
.adm-role.expired { opacity: .45; text-decoration: line-through; }
.adm-role.expired small { color: var(--red); }
.adm-noroles { font-size: 12.5px; font-weight: 700; color: var(--red); }
.adm-role-edit { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; border: 0; cursor: pointer;
    background: var(--surface-2); color: var(--muted); font-size: 11px; transition: background-color .15s, color .15s; }
.adm-role-edit:hover { background: var(--primary-soft); color: var(--primary); }
.adm-tag.readonly { cursor: default; }
.adm-sys { color: var(--muted); font-size: 12px; }
.adm-role-desc { margin: -6px 0 0; font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.45; }
.adm-pol-count { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 12px; font-weight: 700; color: var(--amber); }
.adm-allperms { display: flex; align-items: center; gap: 10px; padding: 16px; border-radius: 18px; background: var(--green-soft);
    color: var(--green); font-size: 13.5px; font-weight: 800; }
.adm-readonly { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--muted); }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.input-sm { height: 38px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { width: 38px; height: 38px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-2); font-size: 14px; transition: background-color .15s, color .15s, transform .15s; }
.icon-pick button:hover { color: var(--primary); }
.icon-pick button.active { background: var(--primary); color: #fff; transform: scale(1.06); }

.perm-master { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; margin-bottom: 10px;
    border-radius: 20px; background: var(--surface-2); cursor: pointer; }
.perm-master b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 800; color: var(--text); }
.perm-master b i { color: var(--primary); }
.perm-master small { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.perm-master.on { background: var(--green-soft); }
.perm-master.on b i { color: var(--green); }
.perm-master.is-locked { cursor: not-allowed; }
.perm-master code, .adm-note code, .perm-wild { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px;
    padding: 1px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.perm-section.dim { opacity: .55; }
.perm-row.locked { cursor: not-allowed; }
.perm-row.locked > span:first-child { color: var(--muted); }
.perm-lock { margin-left: 7px; font-size: 10px; color: var(--muted); }

.rpick-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.rpick { border-radius: 16px; background: var(--surface-2); transition: background-color .15s, box-shadow .15s; }
.rpick.on { background: var(--primary-soft); }
.rpick.locked { opacity: .55; }
.rpick-main { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; min-width: 0; }
.rpick.locked .rpick-main { cursor: not-allowed; }
.gpick-box-wrap { position: relative; display: inline-flex; }
.gpick-box-wrap input { position: absolute; opacity: 0; width: 0; height: 0; }
.gpick-box-wrap input:checked + .gpick-box { background: var(--primary); border-color: var(--primary); }
.gpick-box-wrap input:focus-visible + .gpick-box { box-shadow: 0 0 0 3px var(--primary-soft); }
.rpick-desc { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.rpick-lock { color: var(--muted); font-size: 11px; }
.rpick-exp { display: flex; align-items: center; gap: 10px; padding: 0 14px 12px 42px; font-size: 12.5px; font-weight: 700; }
.rpick-exp > i { color: var(--amber); }
.rpick-exp .input { width: auto; max-width: 220px; background: var(--surface); }
.rpick-exp .link-btn { margin: 0; background: none; border: 0; cursor: pointer; font-family: inherit; }
.rpick-preview { padding: 14px; border-radius: 20px; border: 1px solid var(--line); }
.rpick-preview-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; font-weight: 800; }
.rpick-preview-head .muted { font-weight: 700; font-size: 12px; }

.pol-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.pol-card { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; transition: opacity .2s; }
.pol-card.off { opacity: .6; }
.pol-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 17px; }
.pol-ico.deny { background: var(--red-soft); color: var(--red); }
.pol-ico.allow_only { background: var(--amber-soft); color: var(--amber); }
.pol-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pol-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pol-title b { font-size: 15px; font-weight: 800; color: var(--text); }
.pol-effect-tag { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pol-effect-tag.deny { background: var(--red-soft); color: var(--red); }
.pol-effect-tag.allow_only { background: var(--amber-soft); color: var(--amber); }
.pol-effect-tag.muted { background: var(--surface-2); color: var(--muted); }
.pol-scope { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.pol-everyone { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.pol-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 10px; background: var(--surface-2);
    font-size: 12px; font-weight: 700; color: var(--text-2); }
.pol-chip i { color: var(--primary); font-size: 11px; }
.pol-side { display: flex; align-items: center; gap: 8px; }
.pol-new { min-height: 120px; }

.seg.pol-effect { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.pol-effect button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 2px solid transparent;
    background: var(--surface-2); color: var(--text-2); cursor: pointer; text-align: left; font-family: inherit; transition: border-color .15s, background-color .15s; }
.pol-effect button i { font-size: 16px; }
.pol-effect button b { display: block; font-size: 13.5px; font-weight: 800; color: var(--text); }
.pol-effect button small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.pol-effect button.active.deny { border-color: var(--red); background: var(--red-soft); }
.pol-effect button.active.deny i { color: var(--red); }
.pol-effect button.active.allow { border-color: var(--amber); background: var(--amber-soft); }
.pol-effect button.active.allow i { color: var(--amber); }
.pol-actions, .pol-days { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-actions button, .pol-days button { padding: 7px 12px; border-radius: 10px; border: 0; cursor: pointer; font-family: inherit;
    background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 700; transition: background-color .15s, color .15s; }
.pol-days button { min-width: 42px; }
.pol-actions button.active, .pol-days button.active { background: var(--primary); color: #fff; }
.pol-conds { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.pol-cond { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.pol-cond .input { background: var(--surface); }
.pol-cond-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 800; color: var(--text); }
.pol-cond-head > span { display: inline-flex; align-items: center; gap: 8px; }
.pol-cond-head > span > i { color: var(--primary); }
label.pol-cond-head { cursor: pointer; }
.pol-time { display: flex; align-items: center; gap: 10px; }
.pol-time .input { width: 120px; }
.pol-active { display: flex; align-items: center; justify-content: space-between; gap: 10px; align-self: start; margin-top: 26px;
    padding: 10px 14px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.pol-active .label { margin: 0; }

.log-src { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.log-src span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.log-src i { font-size: 10px; }

@media (max-width: 640px) {
    .form-grid-2, .seg.pol-effect { grid-template-columns: 1fr; }
    .pol-active { margin-top: 0; }
    .pol-card { flex-wrap: wrap; padding: 16px; }
    .pol-side { width: 100%; justify-content: flex-end; }
    .rpick-exp { padding-left: 14px; flex-wrap: wrap; }
    .rpick-desc { display: none; }
}
.adm-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs .tab { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
    .adm-tabs .tab { padding: 0 14px; }
    .adm-tabs .tab-count { margin-left: 4px; }
}


/* ---------- Шапка с профилем + компактное меню слева ---------- */
.topnav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(20, 34, 64, .05); }
.topnav-inner { max-width: 1480px; margin: 0 auto; height: 68px; padding: 0 28px; display: flex; align-items: center; gap: 16px; }
.tn-brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.tn-brand .logo { width: 38px; height: 38px; border-radius: 12px; box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3); }
.tn-brand-text { font-size: 16px; font-weight: 800; color: var(--text); white-space: nowrap; letter-spacing: -.2px; }
.tn-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tn-right .round-btn { width: 40px; height: 40px; }
.tn-right .theme-switch { height: 40px; width: 70px; padding: 0 12px; flex-direction: row; }
.tn-right .theme-switch .ts-knob { width: 32px; height: 32px; transform: none; }
:root[data-theme="dark"] .tn-right .theme-switch .ts-knob { transform: translateX(30px); }

.cur-switch.cur-top { box-shadow: none; background: var(--surface-2); height: 40px; grid-template-columns: repeat(3, 38px); }
.cur-top .cur-thumb { width: 38px; height: 32px; transform: translateX(calc(var(--i) * 38px)); }
.cur-top button { font-size: 14px; }

.tn-profile { position: relative; }
.tn-profile-btn { display: flex; align-items: center; gap: 10px; height: 46px; padding: 3px 12px 3px 3px; border-radius: 999px;
    background: var(--surface-2); cursor: pointer; transition: background-color .2s; }
.tn-profile-btn:hover, .tn-profile.open .tn-profile-btn { background: var(--primary-soft); }
.tn-profile-btn .avatar { width: 40px; height: 40px; font-size: 15px; }
.tn-profile-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; text-align: left; }
.tn-profile-text b { font-size: 13.5px; font-weight: 800; color: var(--text); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-profile-text .gbadge { font-size: 10px; }
.tn-chev { font-size: 10px; color: var(--muted); transition: transform .25s; }
.tn-profile.open .tn-chev { transform: rotate(180deg); }
.tn-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 270px; padding: 8px; border-radius: 20px; background: var(--surface);
    box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top right;
    transition: opacity .18s, transform .22s cubic-bezier(.3, 1.3, .5, 1), visibility .18s; }
.tn-profile.open .tn-menu { opacity: 1; visibility: visible; transform: none; }
.tn-menu-head { display: flex; align-items: center; gap: 12px; padding: 10px; }
.tn-menu-head b { display: block; font-size: 14.5px; font-weight: 800; color: var(--text); }
.tn-menu-head small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tn-menu-roles { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 0 10px 10px; }
.tn-menu-level { font-size: 11px; font-weight: 700; color: var(--muted); }
.tn-menu-item { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700;
    color: var(--text-2); border-top: 1px solid var(--line); transition: background-color .15s, color .15s; }
.tn-menu-item.danger { color: var(--red); }
.tn-menu-item.danger:hover { background: var(--red-soft); }

.app.app-top { max-width: 1480px; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; padding-top: 24px; }
.app-top .sidebar { top: 92px; height: auto; max-height: none; }
.app-top .side-nav { flex: none; padding: 10px; gap: 2px; }
.app-top .nav-item { height: 44px; font-size: 14px; border-radius: 14px; gap: 12px; padding: 0 14px; }
.app-top .nav-item i { font-size: 15px; }

@media (max-width: 1199px) {
    .app.app-top { grid-template-columns: 72px minmax(0, 1fr); }
    .app-top .side-nav { padding: 8px; align-items: center; }
    .app-top .nav-item { width: 48px; height: 46px; padding: 0; justify-content: center; }
    .tn-profile-text { display: none; }
    .tn-profile-btn { padding-right: 10px; }
}
@media (max-width: 767px) {
    .topnav { display: none; }
    .app.app-top { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
}

/* ---------- Тёмная обложка + меню на всю высоту ---------- */
:root[data-theme="dark"] .hero {
    background:
        radial-gradient(70% 160% at 0% 0%, rgba(var(--accent2-rgb), .26) 0%, rgba(var(--accent2-rgb), 0) 60%),
        radial-gradient(50% 140% at 100% 100%, rgba(var(--accent-rgb), .22) 0%, rgba(var(--accent-rgb), 0) 65%),
        var(--surface);
    box-shadow: inset 0 0 0 1px rgba(var(--accent2-rgb), .16), 0 14px 30px -16px rgba(0, 0, 0, .7);
}
:root[data-theme="dark"] .hero-orb-1 { background: radial-gradient(circle, rgba(var(--accent2-rgb), .18), rgba(var(--accent2-rgb), 0) 70%); }
:root[data-theme="dark"] .hero .hchip { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .hero .hchip i { color: var(--primary) !important; opacity: 1; }
:root[data-theme="dark"] .hero .hchip-green { background: rgba(34, 176, 125, .18); color: #4fd9a4; }
:root[data-theme="dark"] .hero .hchip-green i { color: #4fd9a4 !important; }
:root[data-theme="dark"] .hero .hchip-red { background: rgba(227, 53, 76, .18); color: #ff7d8f; }
:root[data-theme="dark"] .hero .hchip-red i { color: #ff7d8f !important; }
:root[data-theme="dark"] .hero .hello p { color: var(--muted); }
:root[data-theme="dark"] .hero-stat { background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .hero-stat-label i { color: var(--primary); }
:root[data-theme="dark"] .hero-progress { background: rgba(255, 255, 255, .08); }
:root[data-theme="dark"] .hero-progress span { background: var(--grad); }
:root[data-theme="dark"] .hero .btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -8px rgba(var(--accent-rgb), .6); }

.app-top .sidebar { align-self: start; top: 92px; height: calc(100vh - 116px); }
.app-top .side-nav { flex: 1; overflow-y: auto; scrollbar-width: none; }
@media (max-width: 767px) { .app-top .sidebar { height: auto; } }

/* ---------- Меню: карточка в полэкрана ---------- */
.app-top .sidebar { align-self: start; top: 92px; height: auto; }
.app-top .side-nav {
    flex: none; display: flex; flex-direction: column; gap: 0; padding: 14px 12px 12px;
    min-height: min(560px, calc(100vh - 116px)); overflow: hidden; position: relative; isolation: isolate;
}
.app-top .side-nav::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 120px; z-index: -1; pointer-events: none;
    background: radial-gradient(120% 100% at 0% 0%, rgba(var(--accent2-rgb), .16), rgba(var(--accent2-rgb), 0) 70%);
}
.sn-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; margin-bottom: 8px; border-bottom: 1px dashed var(--line); }
.sn-head-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--grad); color: #fff; font-size: 15px; box-shadow: 0 8px 18px -6px rgba(var(--accent-rgb), .6); }
.sn-head-text { display: flex; flex-direction: column; gap: 3px; line-height: 1; min-width: 0; }
.sn-head-text b { font-size: 15px; font-weight: 800; color: var(--text); }
.sn-head-text small { font-size: 11px; font-weight: 700; color: var(--muted); }
.sn-list { display: flex; flex-direction: column; gap: 4px; }

.app-top .nav-item { position: relative; height: 48px; padding: 0 10px; gap: 12px; border-radius: 16px; font-size: 14px; color: var(--text-2); }
.app-top .nav-item .nav-ico {
    width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
    color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
    transition: background-color .2s, color .2s, transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s;
}
.app-top .nav-item .nav-ico i { width: auto; font-size: 14px; }
.app-top .nav-item:hover { background: var(--surface-2); color: var(--text); }
.app-top .nav-item:hover .nav-ico { transform: scale(1.08) rotate(-4deg); }
.app-top .nav-item.active { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--text); }
.app-top .nav-item.active .nav-ico { background: var(--c); color: #fff; box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--c) 70%, transparent); }
.app-top .nav-item.active::before {
    content: ""; position: absolute; left: -12px; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c);
}
.app-top .nav-item .nav-count { margin-left: auto; }

.sn-list { padding-bottom: 6px; }

@media (max-width: 1199px) {
    .app-top .side-nav { padding: 10px 8px; align-items: stretch; }
    .sn-head { justify-content: center; padding: 2px 0 10px; }
    .sn-head-text, .app-top .nav-item .nav-label { display: none; }
    .app-top .nav-item .nav-ico { display: grid; }
    .app-top .nav-item { width: auto; height: 48px; padding: 0; justify-content: center; }
    .app-top .nav-item.active::before { left: -8px; }
}
@media (max-width: 767px) { .app-top .side-nav { min-height: 0; } }


@media (max-width: 767px) { .prov-grid { grid-template-columns: minmax(0, 1fr); } }


/* ---------- Мониторинг: настройки, история ---------- */
button.mon-dot { padding: 0; cursor: pointer; transition: transform .2s; }
button.mon-dot:hover { transform: scale(1.25); }
button.chip { border: 0; cursor: pointer; font-family: inherit; }
.chip-upt { background: var(--green-soft); color: var(--green); gap: 4px; }
.chip-upt.is-warn { background: var(--amber-soft); color: var(--amber); }
.chip-upt:hover, button.chip-down:hover { filter: brightness(1.08); }

.mon-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.mon-notify {
    grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; border-radius: 16px; background: var(--surface-2); cursor: pointer;
    font-size: 13.5px; font-weight: 700; color: var(--text-2);
}
.mon-notify > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.mon-notify > span:first-child i { color: var(--primary); width: 16px; text-align: center; }

.modal-card.modal-upt { max-width: 760px; }
.upt { display: flex; flex-direction: column; gap: 18px; }
.upt-state { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2);
    font-size: 13px; font-weight: 700; color: var(--text-2); background-image: none !important; }
.upt-state .mon-dot { position: relative; inset: auto; flex-shrink: 0; border-color: var(--surface-2); cursor: default; }
.upt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.upt-tile { padding: 14px; border-radius: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.upt-tile small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.upt-tile b { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -.3px; }
.upt-tile em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.upt-tile.upt-good b { color: var(--green); }
.upt-tile.upt-warn b { color: var(--amber); }
.upt-tile.upt-bad b { color: var(--red); }
.upt-section { display: flex; flex-direction: column; gap: 10px; }
.upt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.upt-head span { font-size: 15px; font-weight: 800; color: var(--text); }
.upt-head small { font-size: 12px; font-weight: 700; color: var(--muted); }
.upt-bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; height: 38px; }
.upt-bar { border-radius: 5px; background: var(--surface-3); transition: transform .15s; cursor: help; }
.upt-bar:hover { transform: scaleY(1.12); }
.upt-bar.upt-good { background: var(--green); }
.upt-bar.upt-warn { background: var(--amber); }
.upt-bar.upt-bad { background: var(--red); }
.upt-chart { height: 200px; }
.upt-incidents { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.upt-inc { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.upt-inc > i { color: var(--green); font-size: 16px; width: 20px; text-align: center; }
.upt-inc.is-open > i { color: var(--red); }
.upt-inc > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upt-inc b { font-size: 13px; font-weight: 800; color: var(--text); }
.upt-inc small { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upt-inc > span { font-size: 12.5px; font-weight: 800; color: var(--red); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }

@media (max-width: 767px) {
    .upt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .upt-bars { height: 30px; gap: 2px; }
    .mon-settings { grid-template-columns: 1fr; }
}

/* ---------- Отчёты ---------- */
.hero-year .dd-pill, .hero-year .dropdown > button { min-width: 140px; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.delta.up { color: var(--red); }
.delta.down { color: var(--green); }
.rep-chart { height: 340px; }
.rep-legend-note { font-size: 12px; font-weight: 700; }
.rep-charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rep-split { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 20px; align-items: center; }
.rep-donut { height: 240px; }
.rep-list { display: flex; flex-direction: column; gap: 10px; }
.rep-row { display: flex; align-items: center; gap: 12px; }
.rep-rank { width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary); font-size: 12px; font-weight: 800; }
.rep-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rep-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.rep-row-top b { font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-row-top span { font-weight: 800; color: var(--text-2); white-space: nowrap; }
.rep-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rep-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s cubic-bezier(.3, 1, .4, 1); }
.rep-share { width: 52px; text-align: right; font-size: 12.5px; font-weight: 800; color: var(--muted); flex-shrink: 0; }

.budget .card-title i { color: var(--primary); margin-right: 6px; }
.budget-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.budget-nums div { display: flex; flex-direction: column; gap: 3px; }
.budget-nums small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.budget-nums b { font-size: 20px; font-weight: 800; color: var(--text); }
.budget-bar { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.budget-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .6s cubic-bezier(.3, 1, .4, 1); }
.budget-expected { background: repeating-linear-gradient(-45deg, var(--primary-soft) 0 6px, transparent 6px 12px); box-shadow: inset 0 0 0 1px var(--primary-2); }
.budget-actual { background: var(--grad); }
.budget-warn .budget-actual { background: linear-gradient(90deg, #ffc163, #f59e0b); }
.budget-bad .budget-actual { background: linear-gradient(90deg, #ff6b7d, #e3354c); }
.budget-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--green); }
.budget-warn .budget-note { color: var(--amber); }
.budget-bad .budget-note { color: var(--red); }
.budget-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.budget-form .input { width: 200px; }
.budget-empty { font-size: 13.5px; font-weight: 600; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }

@media (max-width: 1199px) {
    .rep-charts { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .rep-split { grid-template-columns: 1fr; }
    .rep-chart { height: 280px; }
    .budget-nums { grid-template-columns: 1fr; }
    .budget-nums b { font-size: 18px; }
}

.card.budget { margin-bottom: 24px; }

.field .mon-notify { display: flex; margin: 0; height: 50px; padding: 0 16px; font-size: 14px; }

/* ---------- Покрытие продлений кредитом (Veesp, Aeza) ---------- */
.acc-uncovered { color: var(--red); background: var(--red-soft); }
.acc-uncovered i { color: var(--red); }
.acc-uncovered small { font-weight: 700; opacity: .85; }
.cov-ok { color: var(--green); white-space: nowrap; }
.cov-bad { color: var(--red); white-space: nowrap; }
.cov-ok i, .cov-bad i { margin: 0 2px 0 0; font-size: 10px; }

/* ---------- Ближайшие продления нескольких услуг ---------- */
.svc-next { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: help; }
.svc-line { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.svc-line b { color: var(--text); font-weight: 800; }
.svc-line.is-later { opacity: .75; }
.svc-when { flex-shrink: 0; }
.svc-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.svc-line i { font-size: 10px; flex-shrink: 0; }

/* ---------- Выбор темы ---------- */
.theme-pick button i { font-size: 13px; }

/* ---------- Elqen: надпись-логотип ---------- */
.tn-brand-text, .brand-mark { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.tn-brand-text b, .brand-mark b {
    font-size: 20px; font-weight: 900; letter-spacing: -.5px;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tn-brand-text small, .brand-mark small {
    font-size: 9.5px; font-weight: 800; letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted); padding-left: 1px;
}
.auth-head { display: flex; align-items: center; gap: 14px; }
.brand-mark b { font-size: 26px; }
.brand-mark small { font-size: 10.5px; }

/* ---------- Кошельки платёжек ---------- */
.card.wallets { margin-bottom: 24px; }
.wallets .card-title i { color: var(--primary); margin-right: 6px; }
.wallets-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.wallets-nums div { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 18px; background: var(--surface-2); min-width: 0; }
.wallets-nums small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.wallets-nums b { font-size: 20px; font-weight: 800; color: var(--text); }
.wallets-nums em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.wallets-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.wallets-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.wallets-verdict { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: 13.5px; font-weight: 700; color: var(--green); line-height: 1.45; }
.wallets-verdict i { margin-top: 3px; }
.wallets-verdict b { color: var(--text); }
.wallets-warn .wallets-verdict { color: var(--amber); }
.wallets-bad .wallets-verdict { color: var(--red); }
.wallets-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-top: 14px; }
.wallets-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; min-width: 0; }
.wallets-row .d { font-weight: 800; color: var(--muted); flex-shrink: 0; }
.wallets-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text-2); }
.wallets-row b { font-weight: 800; color: var(--text); white-space: nowrap; }
.wallets-row i { color: var(--green); font-size: 12px; }
.wallets-row.is-bad i, .wallets-row.is-bad b { color: var(--red); }
.wallets-grid { margin-bottom: 24px; }
@media (max-width: 1199px) { .wallets-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .wallets-list { grid-template-columns: 1fr; } .wallets-nums b { font-size: 17px; } }

/* ---------- Зашифрованные заметки ---------- */
.notes-hidden { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 26px 16px;
    border: 2px dashed var(--line); border-radius: 18px; background: var(--surface-2); color: var(--primary);
    font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; transition: background .2s, border-color .2s; }
.notes-hidden:hover { border-color: var(--primary-2); background: var(--primary-soft); }
.notes-loading { display: flex; align-items: center; gap: 8px; min-height: 80px; color: var(--muted); font-weight: 700; }
.field .hint .fa-lock { font-size: 10px; margin-right: 3px; }

/* ---------- Активные входы ---------- */
button.tn-menu-item { width: 100%; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.modal-card.modal-sessions { max-width: 560px; }
.sess-list { display: flex; flex-direction: column; gap: 8px; }
.sess { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.sess.is-current { box-shadow: inset 0 0 0 2px var(--primary-soft); }
.sess-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary); font-size: 16px; }
.sess-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sess-main b { font-size: 14px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sess-main small { font-size: 12px; font-weight: 600; color: var(--muted); }
.sess .act.danger { color: var(--red); }

/* ---------- Импорт серверов ---------- */
.card.import-banner { width: 100%; display: flex; align-items: center; gap: 16px; margin-bottom: 24px; border: 0; cursor: pointer;
    text-align: left; font-family: inherit; box-shadow: inset 0 0 0 2px var(--primary-soft), var(--shadow); transition: transform .2s; }
.card.import-banner:hover { transform: translateY(-2px); }
.import-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; background: var(--grad); color: #fff; font-size: 18px; }
.import-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.import-text b { font-size: 15px; font-weight: 800; color: var(--text); }
.import-text small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.modal-card.modal-import { max-width: 640px; }
.imp-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; margin-bottom: 16px; }
.imp-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); cursor: pointer;
    box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .15s; }
.imp-row.is-on { box-shadow: inset 0 0 0 2px var(--primary-2); }
.imp-row input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.imp-check { width: 24px; height: 24px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; background: var(--surface-3); color: transparent; font-size: 12px; }
.imp-row.is-on .imp-check { background: var(--grad); color: #fff; }
.imp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.imp-main small { font-size: 12px; font-weight: 600; color: var(--muted); }
.imp-inside { color: var(--amber) !important; display: flex; gap: 6px; align-items: baseline; }
.input.imp-name { height: 38px; padding: 0 12px; font-weight: 800; }
.imp-price { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; color: var(--text); white-space: nowrap; }
.imp-price small { font-size: 11px; color: var(--muted); }
@media (max-width: 767px) { .card.import-banner .btn { display: none; } }

/* ---------- Кошельки: понятная сводка ---------- */
.wallets-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.wallets-hero-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wallets-hero-main small { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.wallets-hero-main b { font-size: 34px; font-weight: 900; letter-spacing: -.8px; color: var(--green); line-height: 1.1; }
.wallets-warn .wallets-hero-main b { color: var(--amber); }
.wallets-bad .wallets-hero-main b { color: var(--red); }
.wallets-hero-main span { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.wallets-hero-pct { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.wallets-hero-pct small { font-size: 12px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.wallets-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.wallets-ring span { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface);
    font-size: 16px; font-weight: 900; color: var(--text); }
.wallets .wallets-verdict { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); }
.wallets-bad .wallets-verdict { background: var(--red-soft); }
.wallets-verdict span { color: var(--text-2); }
.wallets-sub { margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.wallets .wallets-list { margin-top: 0; }
.wallets-note { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.wallets-note i { color: var(--primary); }
@media (max-width: 767px) {
    .wallets-hero { flex-direction: column; align-items: flex-start; }
    .wallets-hero-main b { font-size: 28px; }
}

/* ---------- Кошелёк: учитывать в расчёте ---------- */
.wallet-include { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px;
    border-radius: 16px; background: var(--surface-2); cursor: pointer; }
.wallet-include > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wallet-include b { font-size: 13.5px; font-weight: 800; color: var(--text); }
.wallet-include small { font-size: 12px; font-weight: 600; color: var(--muted); }
.acc-wallet.is-excluded .acc-balance { filter: grayscale(.7); opacity: .65; }

/* ---------- Подвал: во всю ширину и прижат к низу, как шапка ---------- */
#root { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
#root > .app { flex: 1 0 auto; width: 100%; }
.app-footer { background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 -1px 0 var(--line); }
.app-footer-inner { max-width: 1480px; margin: 0 auto; min-height: 72px; padding: 14px 28px; display: flex; align-items: center;
    justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.af-brand { display: flex; align-items: center; gap: 12px; }
.af-brand img { width: 34px; height: 34px; border-radius: 11px; box-shadow: 0 6px 16px rgba(var(--accent-rgb), .3); }
.af-brand span { display: flex; flex-direction: column; gap: 2px; line-height: 1.1; }
.af-brand b { font-size: 18px; font-weight: 900; letter-spacing: -.5px;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.af-brand small { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.af-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.af-links a { font-size: 13px; font-weight: 700; color: var(--text-2); text-decoration: none; transition: color .2s; }
.af-links a:hover, .af-links a.active { color: var(--primary); }
.af-copy { font-size: 12.5px; font-weight: 700; color: var(--muted); }
@media (max-width: 767px) {
    .app { padding-bottom: 24px; }
    .app-footer-inner { flex-direction: column; align-items: flex-start; padding: 20px 16px 106px; }
    .af-links { gap: 6px 14px; }
}
.auth-slogan { margin: -6px 0 4px !important; font-size: 14px !important; font-weight: 800 !important; letter-spacing: .3px;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent !important; }


/* ---------- Мобильное меню: 4 раздела + «Ещё» ---------- */
.more-sheet { display: none; }
@media (max-width: 767px) {
    .bottom-nav { justify-content: space-between; padding: 0 10px; }
    .bottom-nav a, .bottom-nav button { width: auto; min-width: 56px; height: 52px; padding: 0 6px; border-radius: 18px;
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 18px;
        border: 0; background: none; font-family: inherit; cursor: pointer; position: relative; }
    .bn-label { font-size: 10px; font-weight: 800; line-height: 1; }
    .bottom-nav .bn-more { width: 54px; min-width: 54px; height: 54px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 20px; }
    .bottom-nav .bn-more.active { background: var(--grad); color: #fff; }
    .bn-dot { position: absolute; top: 8px; right: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--red);
        box-shadow: 0 0 0 2px var(--surface-2); }

    .more-sheet { display: block; position: fixed; inset: 0; z-index: 39; background: var(--backdrop); backdrop-filter: blur(4px);
        opacity: 0; pointer-events: none; transition: opacity .2s; }
    .more-sheet.open { opacity: 1; pointer-events: auto; }
    .more-card { position: absolute; left: 16px; right: 16px; bottom: 96px; padding: 16px; border-radius: 28px;
        background: var(--surface); box-shadow: var(--shadow-lg); transform: translateY(16px); transition: transform .25s cubic-bezier(.2, .9, .3, 1.1); }
    .more-sheet.open .more-card { transform: none; }
    .more-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 18px;
        border: 0; background: none; font-family: inherit; cursor: pointer; text-decoration: none;
        font-size: 11.5px; font-weight: 800; color: var(--text-2); text-align: center; }
    .more-item.active { background: var(--surface-2); color: var(--text); }
    .more-ico { position: relative; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 18px;
        color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
    .more-ico .nav-count { position: absolute; top: -4px; right: -6px; }
    .more-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 10px 6px 0;
        border-top: 1px solid var(--line); }
    .more-label { font-size: 13px; font-weight: 800; color: var(--text-2); }
    .more-logout { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; height: 46px; border-radius: 16px;
        background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 800; text-decoration: none; }
}

/* ---------- Закрытие окон и кнопки внизу ---------- */
.modal-card { position: relative; }
.modal-x { position: absolute; top: 18px; right: 18px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0;
    display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-size: 16px; cursor: pointer;
    transition: background .2s, color .2s; }
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-card > h2 { padding-right: 46px; }
.confirm-modal .modal-x { display: none; }
.modal-actions > * { min-width: 0; }
.modal-actions .btn { white-space: normal; text-align: center; line-height: 1.2; }
@media (max-width: 767px) {
    .modal-sessions .modal-actions { grid-template-columns: 1fr; }
    .modal-x { top: 20px; right: 16px; }
}

/* ---------- Провайдеры: вкладки и поиск ---------- */
.prov-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.prov-toolbar .tabs { margin: 0; }
.tab i { margin-right: 6px; }
.tab-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; margin-left: 8px; border-radius: 99px;
    background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; }
.tab.active .tab-count { background: rgba(255, 255, 255, .25); color: #fff; }
.prov-search { flex: 0 1 340px; }
@media (max-width: 767px) { .prov-search { flex-basis: 100%; } .prov-toolbar .tabs { width: 100%; } .prov-toolbar .tab { flex: 1; } }

.imp-error { margin-bottom: 10px; }
.imp-auto { align-items: center; text-align: center; color: var(--primary); font-size: 14px; }
.imp-auto small { line-height: 1.2; margin-top: 2px; }
.imp-reload { margin-bottom: 4px; }

/* ---------- Серверы облачного аккаунта ---------- */
.cloud-servers { margin-top: 12px; }
.cloud-servers .charge-name { display: flex; align-items: center; gap: 8px; }
.srv-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.srv-dot.is-on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.srv-link { display: inline-flex; align-items: center; gap: 5px; max-width: 45%; padding: 3px 9px; border-radius: 99px;
    background: var(--primary-soft); color: var(--primary); font-size: 11px; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv-link.is-free { background: var(--surface-3); color: var(--muted); }

/* ---------- История доступа ---------- */
.card.acc-hist { margin-top: 24px; }
.acc-hist .card-title i { color: var(--primary); margin-right: 6px; }
.acc-hist-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.acc-hist-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.hf { height: 36px; padding: 0 14px; border-radius: 99px; border: 0; background: var(--surface-2); color: var(--text-2);
    font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.hf b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); font-size: 11px; display: grid; place-items: center; }
.hf.active { background: var(--grad); color: #fff; }
.hf.active b { background: rgba(255, 255, 255, .25); }
.acc-hist-search { flex: 0 1 280px; }
.acc-hist-search input { height: 42px; }
.acc-hist-list { display: flex; flex-direction: column; gap: 8px; }
.ah-row { --t: var(--primary); --ts: var(--primary-soft); display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--surface-2); }
.tone-green { --t: var(--green); --ts: var(--green-soft); }
.tone-red { --t: var(--red); --ts: var(--red-soft); }
.tone-amber { --t: var(--amber); --ts: var(--amber-soft); }
.ah-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; background: var(--ts); color: var(--t); font-size: 16px; }
.ah-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ah-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ah-top b { font-size: 14px; font-weight: 800; color: var(--text); }
.ah-event { font-size: 13px; font-weight: 700; color: var(--t); }
.ah-state { padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; background: var(--ts); color: var(--t); }
.ah-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.ah-sub i { font-size: 10px; }
.ah-details { color: var(--text-2); }
.ah-when { text-align: right; font-size: 12.5px; font-weight: 800; color: var(--text-2); white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.ah-when small { font-size: 11px; font-weight: 600; color: var(--muted); }
@media (max-width: 767px) {
    .acc-hist-search { flex-basis: 100%; }
    .ah-row { flex-wrap: wrap; }
    .ah-when { flex-direction: row; gap: 8px; width: 100%; padding-left: 54px; text-align: left; }
}

.tube-confirm { padding: 14px; border-radius: 18px; background: var(--primary-soft); }
.tube-confirm label i { color: var(--primary); margin-right: 4px; }

/* ---------- Аккаунты: вкладки по провайдерам ---------- */
.acc-toolbar { flex-wrap: wrap; align-items: center; }
.acc-toolbar .acc-tabs { flex: 1 1 100%; max-width: 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 1 0 auto; padding: 0 16px 0 10px; }
.acc-tabs .tab:first-child { padding-left: 16px; }
.acc-tabs .tab i { margin-right: 0; }
.acc-tabs .tab-count { margin-left: 0; }
.tab-logo { display: inline-block; width: 26px; height: 26px; padding: 3px; border-radius: 9px; background: #fff; object-fit: contain;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12); flex-shrink: 0; }
.acc-toolbar .prov-search { flex: 1 0 260px; }
.acc-tab-sum { margin: -8px 0 18px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.acc-tab-sum b { color: var(--text); }

/* ---------- Услуги: учитывать / не учитывать ---------- */
.svc-row { align-items: center; gap: 12px; }
.svc-check { position: relative; flex-shrink: 0; cursor: pointer; }
.svc-check input { position: absolute; opacity: 0; pointer-events: none; }
.svc-check span { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px;
    background: var(--grad); color: #fff; transition: background .2s; }
.svc-check input:not(:checked) + span { background: var(--surface-3); color: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.svc-check input:disabled + span { opacity: .5; cursor: default; }
.svc-row.is-ignored .charge-main, .svc-row.is-ignored > b { opacity: .45; }
.svc-row.is-ignored .charge-name { text-decoration: line-through; }
.acc-uncovered.is-later { color: var(--amber); background: var(--amber-soft); }
.acc-uncovered.is-later i { color: var(--amber); }

/* ---------- Боковое меню: группы ---------- */
.sn-group { display: flex; flex-direction: column; gap: inherit; }
.sn-group + .sn-group { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sn-group-title { padding: 2px 12px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); opacity: .8; }
@media (max-width: 1199px) { .sn-group-title { display: none; } .sn-group + .sn-group { margin-top: 6px; padding-top: 8px; } }

/* ---------- Строка обновления под заголовком ---------- */
.refresh-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.rb-item { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.rb-item i { font-size: 11px; color: var(--primary-2); }
.rb-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border: 0; border-radius: 99px; cursor: pointer;
    background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 800; transition: background .2s, color .2s; }
.rb-btn:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary); }
.rb-btn:disabled { opacity: .7; cursor: default; }
@media (max-width: 767px) { .refresh-bar { gap: 6px 12px; font-size: 11.5px; } .rb-item:nth-child(n+2):not(.rb-btn) { display: none; } }
.rb-timer { display: inline-flex; align-items: center; gap: 5px; min-width: 42px; padding: 1px 7px; border-radius: 7px; background: var(--surface-2);
    color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 800; }
.rb-timer.is-now { color: var(--primary); }
.rb-timer i { font-size: 10px; color: var(--primary); }

/* ---------- Строка обновления: цветные плашки ---------- */
.refresh-bar { gap: 8px; }
.rb-item { --rb: var(--primary); height: 32px; padding: 0 6px 0 12px; border-radius: 99px; gap: 7px;
    color: var(--text-2); background: color-mix(in srgb, var(--rb) 9%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rb) 38%, transparent); }
.rb-item i { color: var(--rb); font-size: 12px; }
.rb-monitor { --rb: var(--green); }
.rb-balance { --rb: var(--primary); }
.rb-page { --rb: #a77bff; }
.rb-item .rb-timer { background: color-mix(in srgb, var(--rb) 18%, transparent); color: var(--rb); padding: 3px 8px; border-radius: 99px; }
.rb-item .rb-timer.is-now { color: var(--rb); }
.rb-item .rb-timer i { color: inherit; }
.rb-btn { height: 32px; box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 767px) { .rb-item { height: 30px; padding: 0 5px 0 10px; } }

/* ---------- Кошельки: нужно / есть / не хватает ---------- */
.wallets-need { margin-bottom: 16px; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); }
.wn-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.wn-row > div { display: flex; flex-direction: column; gap: 4px; }
.wn-row small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.wn-row b { font-size: 24px; font-weight: 900; color: var(--text); }
.wn-row b.c-ok { color: var(--green); }
.wn-row b.c-bad { color: var(--red); }
.wn-bar { position: relative; height: 22px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.wn-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--grad); }
.wn-bar em { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 900; color: var(--text); }
@media (max-width: 767px) { .wn-row b { font-size: 18px; } }

/* ---------- Выпадающий список: логотип и счётчик ---------- */
.dd-img { width: 22px; height: 22px; padding: 2px; border-radius: 7px; background: #fff; object-fit: contain; flex-shrink: 0; }
.dd-ico { color: var(--primary); width: 22px; text-align: center; flex-shrink: 0; }
.dd-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.dd-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center;
    background: var(--surface-3); color: var(--text-2); font-size: 11px; font-weight: 800; flex-shrink: 0; }
.dd-label:has(.dd-text), .dd-opt span:has(.dd-text) { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dd-opt span.dd-text { display: block; }
.acc-toolbar { flex-wrap: nowrap; }
.acc-toolbar .acc-provider-dd { flex: 0 0 280px; }
.acc-toolbar .prov-search { flex: 1 1 auto; }
@media (max-width: 767px) { .acc-toolbar { flex-wrap: wrap; } .acc-toolbar .acc-provider-dd { flex-basis: 100%; } }

/* ---------- Аккуратная прокрутка по всему сайту ---------- */
/* scrollbar-width/color только для Firefox: в Chrome они отключают ::-webkit-scrollbar и дают системную полосу со стрелками */
@supports not selector(::-webkit-scrollbar) {
    * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 45%, transparent) transparent; }
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 35%, transparent); border-radius: 99px;
    border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--primary) 65%, transparent); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
/* Меню списков: выше, чтобы 10–12 пунктов помещались без прокрутки; полоса внутри скруглённых углов */
.dd-menu { max-height: min(460px, 60vh); }
.dd-menu::-webkit-scrollbar { width: 6px; }
.dd-menu::-webkit-scrollbar-thumb { border-width: 0; }
.dd-menu::-webkit-scrollbar-track { margin: 14px 0; }

/* ---------- Оффлайн-режим ---------- */
.offline-banner { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 10px 14px; border-radius: 14px;
  background: var(--amber-soft); color: var(--text, inherit); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); font-size: 13.5px; line-height: 1.4; }
.offline-banner > i { color: var(--amber); font-size: 16px; flex: none; }
.offline-banner > span { flex: 1; min-width: 0; }
.offline-retry { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent);
  background: transparent; color: var(--amber); font: inherit; font-weight: 600; cursor: pointer; }
.offline-retry:hover { background: color-mix(in srgb, var(--amber) 14%, transparent); }
@media (max-width: 560px) { .offline-banner { flex-wrap: wrap; } .offline-retry { margin-left: 26px; } }

/* ---------- Запас хода (таймлайн оплат) ---------- */
.runway { margin-bottom: 22px; padding: 24px 26px; }
.rw-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.rw-kicker { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.rw-kicker i { color: var(--primary); }
.rw-title h2 { margin: 6px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.rw-accent { color: var(--primary); }
.rw-title p { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: var(--text-2); }
.rw-scale { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; flex: none; }
.rw-scale button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.rw-scale button.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.rw-grid { display: flex; flex-direction: column; gap: 2px; }
.rw-row { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: center; min-height: 46px; padding: 4px 8px;
  border-radius: 12px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; width: 100%; }
button.rw-row { cursor: pointer; transition: background .15s; }
button.rw-row:hover { background: var(--surface-2); }
.rw-ticks { min-height: 22px; }
.rw-tick-line { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); }
.rw-tick-line .is-today { color: var(--primary); }
.rw-name { display: flex; flex-direction: column; min-width: 0; }
.rw-name b, .rw-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rw-name b { font-size: 14px; font-weight: 700; }
.rw-name small { font-size: 12px; font-weight: 600; color: var(--muted); }
.rw-track { position: relative; height: 24px; border-radius: 8px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 20%), var(--surface-2); }
.rw-bar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; transition: width .35s ease; }
.rw-ok { background: color-mix(in srgb, var(--green) 24%, transparent); box-shadow: inset -3px 0 0 var(--green); }
.rw-warn { background: color-mix(in srgb, var(--amber) 26%, transparent); box-shadow: inset -3px 0 0 var(--amber); }
.rw-danger { background: color-mix(in srgb, var(--red) 26%, transparent); box-shadow: inset -3px 0 0 var(--red); }
.rw-wallet { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--primary) 34%, transparent) 0 6px, color-mix(in srgb, var(--primary) 14%, transparent) 6px 12px); }
.rw-label { position: absolute; top: 50%; transform: translateY(-50%); font-size: 11.5px; font-weight: 800; white-space: nowrap; pointer-events: none; }
.rw-t-ok { color: var(--green); } .rw-t-warn { color: var(--amber); } .rw-t-danger { color: var(--red); } .rw-t-wallet { color: var(--primary); }
.rw-wallets { margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); border-radius: 0; }
.rw-more { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px 12px; border-radius: 10px; }
.rw-more:hover { background: var(--primary-soft); }

/* ---------- Хостинги: список + карточка ---------- */
.hs { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 22px; }
/* contain: size — высоту ряда задаёт карточка справа, а список подстраивается под неё и листается внутри */
.hs-list { padding: 8px 8px 10px; contain: size; overflow-y: auto; scrollbar-width: none; }
.hs-list::-webkit-scrollbar { display: none; }
.hs-side { padding: 24px; min-height: calc(100vh - 108px); scroll-margin-top: 88px; }
.hs-month + .hs-month { margin-top: 8px; }
.hs-month-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 10px;
  background: var(--surface); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hs-month-head .badge { margin-left: 8px; }
.hs-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 10px; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.hs-item:hover { background: var(--surface-2); }
.hs-item.is-selected { background: var(--primary-soft); }
.hs-item.is-off { opacity: .5; }
.hs-item.flash { animation: flash 1.4s ease; }
.fav.fav-sm { width: 32px; height: 32px; border-radius: 9px; padding: 5px; }
.hs-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hs-item-text b, .hs-item-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-item-text b { font-size: 13px; font-weight: 700; }
.hs-item-text small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.hs-when { flex: none; font-size: 12px; font-weight: 800; }
.hs-flag { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--red-soft); color: var(--red); }
.hs-inline { display: none; }

.hd { display: flex; flex-direction: column; gap: 18px; }
.hd.is-off .hd-next, .hd.is-off .hd-facts { opacity: .6; }
.hd-head { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.fav.hd-fav { width: 60px; height: 60px; border-radius: 18px; padding: 11px; }
.hd-title { flex: 1; min-width: 0; }
.hd-title h2 { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; overflow-wrap: anywhere; }
.hd-title > a { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--muted); }
.hd-title > a i { font-size: 10px; }
.hd-title > a:hover { color: var(--primary); }
.hd-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.hd-st { gap: 5px; background: var(--surface-2); color: var(--text-2); }
.hd-st.st-ok { background: var(--green-soft); color: var(--green); }
.hd-st.st-bad { background: var(--red-soft); color: var(--red); }
.hd-st.st-info { background: var(--primary-soft); color: var(--primary); }
.hd-price { flex: none; text-align: right; }
.hd-price b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; }
.hd-price small { font-size: 12px; font-weight: 700; color: var(--muted); }

.hd-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 16px; align-items: center; padding: 18px 20px; border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); }
.hd-next.lvl-warn { background: color-mix(in srgb, var(--amber) 10%, var(--surface-2)); border-color: color-mix(in srgb, var(--amber) 28%, transparent); }
.hd-next.lvl-danger { background: color-mix(in srgb, var(--red) 10%, var(--surface-2)); border-color: color-mix(in srgb, var(--red) 28%, transparent); }
.hd-next-main { display: flex; flex-direction: column; min-width: 0; }
.hd-next-main small { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.hd-next-main b { font-size: 22px; font-weight: 800; margin-top: 4px; }
.hd-next-main .left { font-size: 13px; font-weight: 700; margin-top: 2px; }
.hd-next-act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.hd-next .progress { grid-column: 1 / -1; height: 6px; }

.hd-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hd-facts > div { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hd-facts small { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.hd-facts b { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-facts em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hd-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.hd-sec { background: var(--surface-2); border-radius: 18px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hd-sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; }
.hd-sec-head i { color: var(--primary); margin-right: 8px; }
.hd-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--primary); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; padding: 0; }
.hd-link i { margin: 0; font-size: 10px; }
.hd-upt-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hd-upt-nums small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.hd-upt-nums b { font-size: 15px; font-weight: 800; }
.hd-upt-nums .upt-good b { color: var(--green); } .hd-upt-nums .upt-warn b { color: var(--amber); } .hd-upt-nums .upt-bad b { color: var(--red); }
.hd-upt-bars { height: 30px; }
.hd-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 13px; font-weight: 600; min-width: 0; }
.hd-line > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hd-line b { flex: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; }
.hd-when { color: var(--muted); font-weight: 700; margin-right: 10px; }
.hd-empty { font-size: 13px; font-weight: 600; color: var(--muted); }

.hd-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.hd-foot-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hd-del:hover { background: var(--red-soft); color: var(--red); }
.hd-toggle { display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 700; color: var(--text-2); }

@media (max-width: 1199px) {
  .hd-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hs { grid-template-columns: minmax(0, 1fr); }
  .hs-list { max-height: none; overflow: visible; position: static; contain: none; }
  .hs-month-head { position: static; }
  .hs-side { display: none; }
  .hs-inline { display: block; padding: 10px 6px 18px; }
}
@media (max-width: 767px) {
  .runway { padding: 18px 16px; }
  .rw-title h2 { font-size: 20px; }
  .rw-row { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 4px; }
  .rw-tick-line span:nth-child(2), .rw-tick-line span:nth-child(4) { visibility: hidden; }
}
@media (max-width: 560px) {
  .hd-head { flex-wrap: wrap; }
  .hd-price { text-align: left; width: 100%; }
  .hd-next { grid-template-columns: minmax(0, 1fr); }
  .hd-next-act { justify-content: flex-start; }
  .hd-facts { grid-template-columns: minmax(0, 1fr); }
  .fav.hd-fav { width: 48px; height: 48px; border-radius: 15px; padding: 9px; }
  .hd-title h2 { font-size: 20px; }
}

/* Список и карточка хостингов листаются без видимой полосы */
.hs-month-head { background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); margin-bottom: 6px; letter-spacing: .9px; }
.hs-month-head > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hs-month-head .badge { margin-left: 0; }
.hs-month + .hs-month { margin-top: 14px; }

/* ---------- Ноды ---------- */
.nc { margin-bottom: 18px; }
.nc-row { display: grid; grid-template-columns: 20px 160px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 13.5px; }
.nc-row:first-of-type { border-top: 0; }
.nc-row b { font-weight: 700; }
.nc-row span { color: var(--text-2); font-weight: 600; overflow-wrap: anywhere; }
.nc-row.is-ok i { color: var(--green); }
.nc-row.is-bad i, .nc-row.is-bad span { color: var(--red); }
.nl .card-head { display: flex; align-items: center; gap: 10px; }
.nl-row { display: grid; grid-template-columns: 10px 28px minmax(0, 1fr) 70px 100px 70px 110px; gap: 12px; align-items: center; padding: 11px 6px; border-top: 1px solid var(--line); }
.nl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.nl-ok { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.nl-bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.nl-wait { background: var(--amber); }
.nl-flag { font-size: 20px; line-height: 1; }
.nl-main { min-width: 0; display: flex; flex-direction: column; }
.nl-main b, .nl-main small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nl-main b { font-size: 14px; font-weight: 700; }
.nl-main small { font-size: 12px; font-weight: 600; color: var(--muted); }
.nl-num small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.nl-num b { font-size: 13.5px; font-weight: 700; }
.nl-st { justify-self: end; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); }
.nl-st-ok { background: var(--green-soft); color: var(--green); }
.nl-st-bad { background: var(--red-soft); color: var(--red); }
.nl-st-wait { background: var(--amber-soft); color: var(--amber); }
@media (max-width: 767px) {
  .nc-row { grid-template-columns: 20px minmax(0, 1fr); }
  .nc-row span { grid-column: 2; }
  .nl-row { grid-template-columns: 10px 28px minmax(0, 1fr) auto; }
  .nl-num { display: none; }
}

/* ---------- Установка нод ---------- */
.ni { margin-bottom: 18px; }
.ni .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ni-item { padding: 14px 6px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ni-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.ni-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.ni-step { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.ni-step.is-done { color: var(--green); background: var(--green-soft); }
.ni-step.is-running { color: var(--amber); background: var(--amber-soft); }
.ni-step.is-failed { color: var(--red); background: var(--red-soft); }
.ni-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ni-btns { display: flex; gap: 8px; }
.ni-log { margin: 0; padding: 12px 14px; max-height: 260px; overflow: auto; border-radius: 12px; background: var(--surface-2);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ni-card { width: min(720px, calc(100vw - 32px)); }
.ni-sub { margin: 18px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.ni-grid-3 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ni-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; align-self: end; }
.ni-check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.ni-check span { display: flex; flex-direction: column; }
.ni-check b { font-size: 14px; }
.ni-check small { font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 560px) {
  .ni-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .ni-head { grid-template-columns: 28px minmax(0, 1fr); }
  .ni-head .nl-st { grid-column: 1 / -1; justify-self: start; }
}

/* ---------- Прогресс установки ноды ---------- */
.np { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.np-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; }
.np-top b { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-top span { font-weight: 800; font-variant-numeric: tabular-nums; }
.np-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--line) 70%, transparent); overflow: hidden; }
.np-bar span { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .6s ease; }
.np-wait .np-bar span { background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #fff)); background-size: 200% 100%; animation: np-flow 1.6s linear infinite; }
.np-bad .np-bar span { background: var(--red); }
.np-bad .np-top b { color: var(--red); }
.np-test .np-bar span { background: var(--amber); }
.np-ok .np-bar span { background: var(--green); }
.np-ok .np-top b, .np-test .np-top b { color: var(--text); }
@keyframes np-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
.ns { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 14px; }
.ns li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.ns li i { width: 16px; text-align: center; font-size: 12px; }
.ns li.is-done { color: var(--text-2); }
.ns li.is-done i { color: var(--green); }
.ns li.is-running { color: var(--text); font-weight: 700; }
.ns li.is-running i { color: var(--primary); }
.ns li.is-failed { color: var(--red); font-weight: 700; }
.ns li.is-pending i { font-size: 7px; opacity: .6; }
.ni-card .np { margin: 4px 0 12px; }
.ni-card .ni-log { margin-top: 12px; }
.ni-card .modal-actions { flex-wrap: wrap; }
.ni-card .modal-actions .ni-btns { margin-left: auto; }
.ni-links { display: flex; gap: 16px; }
.nl-st-test { background: var(--amber-soft); color: var(--amber); }

/* ---------- Подсказка свободных доменов ---------- */
.dh-wrap { grid-column: 1 / -1; }
.dh { display: flex; flex-direction: column; gap: 8px; margin-top: -4px; }
.dh-state { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.dh-state.is-ok { color: var(--green); }
.dh-state.is-bad { color: var(--red); }
.dh-free { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dh-free .chip { cursor: pointer; border: 0; font: inherit; font-weight: 700; background: var(--green-soft); color: var(--green); }
.dh-list { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.dh-list summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.dh-rows { display: flex; flex-direction: column; margin: 8px 0; max-height: 220px; overflow: auto; }
.dh-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; padding: 5px 0;
  border-top: 1px solid var(--line); font-size: 12.5px; }
.dh-row b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-row span, .dh-row em { color: var(--muted); font-style: normal; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-row.is-hit b { color: var(--red); }

/* Поле домена: неизменяемые «dl.» и корневой домен по краям */
.affix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.affix:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.affix > span { display: flex; align-items: center; padding: 0 14px; font-size: 13.5px; font-weight: 700; color: var(--text-2); white-space: nowrap;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface)); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.affix > span:first-child { border-right: 1px solid var(--line); }
.affix > span:last-child { border-left: 1px solid var(--line); }
.affix .input { flex: 1; min-width: 60px; border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 0 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; }
.affix .input:focus { box-shadow: none; outline: none; }

/* Поиск страны */
.cp { position: relative; }
.cp-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--muted); pointer-events: none; }
.cp .input { padding-left: 38px; }
.cp-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; overflow-y: auto; padding: 6px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45); }
.cp-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.cp-menu button.is-active { background: var(--surface-2); }
.cp-menu button.is-picked { color: var(--primary); }
.cp-menu em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.cp-flag { width: 22px; text-align: center; }
.cp-empty { padding: 10px; font-size: 13px; color: var(--muted); }

/* Переключатель Hysteria2 */
.ni-toggle { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.ni-sub + .ni-toggle { margin: 0 0 16px; }
.ni-toggle-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary); }
.ni-toggle-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ni-toggle-text b { font-size: 14px; font-weight: 700; }
.ni-toggle-text small { font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* Занятые поддомены сеткой */
.dh { margin-top: 8px; }
.dh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 10px 0 8px; max-height: 240px; overflow-y: auto; }
.dh-tile { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.dh-tile b { font-size: 13.5px; font-weight: 800; }
.dh-tile small, .dh-tile em { font-size: 11.5px; font-weight: 600; color: var(--muted); font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-tile em { color: var(--text-2); }
.dh-tile.is-hit { box-shadow: inset 0 0 0 1px var(--red); }
.dh-tile.is-hit b { color: var(--red); }
.dh-list { background: transparent; }
.dh-list[open] summary { margin-bottom: 2px; }

/* Место нового хоста в списке */
.hp { display: flex; flex-direction: column; gap: 8px; }
.hp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.hp-btns { display: flex; gap: 14px; }
.hp-list { position: relative; max-height: 250px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.hp-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 7px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.hp-row i { font-size: 11px; color: var(--muted); text-align: center; }
.hp-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-row span { font-size: 12px; font-weight: 600; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
button.hp-row:hover { background: var(--surface-2); }
.hp-row.is-off { opacity: .5; }
.hp-row.is-new { cursor: default; background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 45%, transparent); }
.hp-row.is-new i, .hp-row.is-new b { color: var(--primary); font-weight: 800; }
.hp-list { user-select: none; }

/* Ключи Reality */
.nl-row { grid-template-columns: 10px 28px minmax(0, 1fr) 70px 100px 70px 110px 32px; }
.nl-item + .nl-item .nl-row, .nl-item:first-of-type .nl-row { border-top: 1px solid var(--line); }
.nl-key { width: 32px; height: 32px; border: 0; border-radius: 10px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--muted); }
.nl-key:hover, .nl-key.is-open { background: var(--primary-soft); color: var(--primary); }
.nl-item > .nk { margin: 0 6px 14px 50px; }
.nk { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.nk-head { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nk-head b { color: var(--text); }
.nk-ib { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.nk-ib.is-off { opacity: .55; }
.nk-tag { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nk-tag b { font-size: 13.5px; font-weight: 800; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.nk-tag span { font-size: 12px; font-weight: 600; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.kv small { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.kv code { font: 12.5px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); overflow-wrap: anywhere;
  padding: 6px 10px; border-radius: 9px; background: var(--surface); }
.kv code.is-hidden { color: var(--muted); letter-spacing: 1px; }
.kv-btns { display: flex; gap: 4px; }
.kv-btns button { width: 30px; height: 30px; border: 0; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--muted); }
.kv-btns button:hover:not(:disabled) { color: var(--primary); }
.kv-btns button:disabled { opacity: .4; cursor: default; }
.ni-item .nk { margin-top: 2px; }
@media (max-width: 767px) {
  .nl-row { grid-template-columns: 10px 28px minmax(0, 1fr) auto 32px; }
  .nl-item > .nk { margin-left: 6px; }
  .kv { grid-template-columns: minmax(0, 1fr) auto; }
  .kv small { grid-column: 1 / -1; }
}

/* Окно удаления ноды */
.nd-card { width: min(480px, calc(100vw - 32px)); }
.nd-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 6px; text-align: left; }
.nd-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.nd-item input { width: 18px; height: 18px; flex: none; accent-color: var(--red); }
.nd-item span { display: flex; flex-direction: column; min-width: 0; }
.nd-item b { font-size: 14px; font-weight: 700; }
.nd-item small { font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-item.is-locked { cursor: default; opacity: .75; }
.ni-removed { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--red); }

/* Хостинг ноды */
.nh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 6px 12px 50px; margin-top: -4px; }
.nh-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 5px 12px; border: 0; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.nh-chip b { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-chip span { font-weight: 600; white-space: nowrap; }
.nh-chip i { color: var(--muted); }
.nh-chip.lvl-warn span { color: var(--amber); }
.nh-chip.lvl-danger span { color: var(--red); }
.nh-chip:hover b { color: var(--primary); }
.nh-guess { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px dashed color-mix(in srgb, var(--primary) 55%, transparent);
  border-radius: 999px; background: transparent; color: var(--primary); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.nh-guess:hover { background: var(--primary-soft); }
.nh-none { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nh-pick { margin-left: auto; min-width: 190px; }
@media (max-width: 767px) { .nh { padding-left: 6px; } .nh-pick { margin-left: 0; width: 100%; } }
.nh-pick .dd-menu { left: auto; right: 0; min-width: 280px; }
.theme-btn i { animation: theme-spin .4s ease; }
.theme-btn:hover i { color: var(--primary); }
@keyframes theme-spin { from { transform: rotate(-90deg) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .theme-btn i { animation: none; } }

/* Короткая страница: футер остаётся внизу экрана, а не посередине */
@media (min-width: 768px) { .app.app-top { align-content: start; } }

.c-ok { color: var(--green); }
.c-bad { color: var(--red); }
.c-warn { color: var(--amber); }
.tone-primary { --t: var(--primary); --ts: var(--primary-soft); }
.tone-muted { --t: var(--muted); --ts: var(--surface-3); }
.nl-st-off { background: var(--surface-2); color: var(--muted); }

/* ---------- Кнопки в строке ноды: тест и ключи ---------- */
.nl-row { grid-template-columns: 10px 28px minmax(0, 1fr) 70px 100px 70px 110px auto; }
.nl-acts { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 767px) { .nl-row { grid-template-columns: 10px 28px minmax(0, 1fr) auto auto; } }

/* ---------- Тесты нод ---------- */
.tt { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.tt-nodes { position: sticky; top: 92px; padding: 18px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 112px); }
.tt-nodes .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.tt-search { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid transparent; cursor: text; transition: border-color .15s, box-shadow .15s; }
.tt-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.tt-search i { font-size: 13px; color: var(--muted); }
.tt-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; }
.tt-search input::placeholder { color: var(--muted); }
.tt-list { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: none; }
.tt-list::-webkit-scrollbar { display: none; }
.tt-node { display: grid; grid-template-columns: 10px 24px minmax(0, 1fr) 10px; gap: 10px; align-items: center; width: 100%; padding: 10px 12px;
  border: 0; border-radius: 14px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.tt-node:hover { background: var(--surface-2); }
.tt-node.is-active { background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.tt-node .nl-flag { font-size: 18px; }
.tt-node-main { display: flex; flex-direction: column; min-width: 0; }
.tt-node-main b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-node-main small { display: flex; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; }
.tt-node-go { font-size: 10px; color: var(--muted); opacity: 0; transition: opacity .15s; }
.tt-node:hover .tt-node-go, .tt-node.is-active .tt-node-go { opacity: 1; }
.tt-node.is-active .tt-node-go { color: var(--primary); }
.tt-last { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 700; }
.tt-last::before { content: '·'; color: var(--muted); }
.tt-last.is-ok { color: var(--green); }
.tt-last.is-warn { color: var(--amber); }
.tt-last.is-bad { color: var(--red); }
.tt-last.is-run { color: var(--primary); }
.tt-nodes-hint { margin: 4px 2px 0; font-size: 11.5px; }
.tt-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.tt-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.tt-head-flag { font-size: 34px; line-height: 1; }
.tt-head-main { flex: 1; min-width: 0; }
.tt-head-main h2 { margin: 0; font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-head-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tt-head-sub span { display: inline-flex; align-items: center; gap: 6px; }
.tt-head-sub i { font-size: 10.5px; }

.tt-start { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.tt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tt-mode { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 2px solid transparent; background: var(--surface-2);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.tt-mode > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--muted); font-size: 15px;
  transition: background .15s, color .15s; }
.tt-mode b { display: block; font-size: 14.5px; font-weight: 800; }
.tt-mode small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-mode:hover { border-color: var(--line); }
.tt-mode.is-active { border-color: var(--primary); background: var(--primary-soft); }
.tt-mode.is-active > i { background: var(--primary); color: #fff; }
.tt-bullets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 18px; }
.tt-bullets li { display: flex; gap: 10px; align-items: baseline; font-size: 13px; font-weight: 600; color: var(--text-2); }
.tt-bullets i { width: 16px; flex: none; text-align: center; font-size: 12px; color: var(--primary); }
.tt-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.tt-actions .hint { margin: 0; }
.tt-multi { display: flex; flex-direction: column; gap: 12px; }
.tt-multi .ni-sub { margin: 6px 0 -4px; }
.tt-multi .hint a { color: var(--primary); font-weight: 700; }
.tt-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-presets .hf { height: 32px; font-size: 12.5px; }
.tt-eta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.tt-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.tt-test { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 14px;
  border-radius: 14px; background: var(--surface-2); cursor: pointer; transition: box-shadow .15s, background .15s; }
.tt-test input { position: absolute; opacity: 0; pointer-events: none; }
.tt-test-box { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); color: transparent; font-size: 11px; transition: background .15s; }
.tt-test:hover { box-shadow: inset 0 0 0 1px var(--line); }
.tt-test.is-on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent); }
.tt-test.is-on .tt-test-box { background: var(--primary); box-shadow: none; color: #fff; }
.tt-test input:focus-visible + .tt-test-box { outline: 2px solid var(--primary); outline-offset: 2px; }
.tt-test-text { display: flex; flex-direction: column; min-width: 0; }
.tt-test-text b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.tt-test-text small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-test-eta { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tt-heavy { padding: 1px 7px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-style: normal; font-size: 10.5px; font-weight: 800; }
.tt-warn { display: flex; gap: 10px; align-items: baseline; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft);
  color: var(--amber); font-size: 12.5px; font-weight: 700; }
.tt-ssh { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; }
.tt-ssh .field { margin: 0; }

.tt-run { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.tt-run-wait { min-height: 120px; display: grid; place-items: center; }
.tt-run-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tt-run-title { flex: 1; min-width: 0; }
.tt-run-title h3 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.tt-run-title h3 i { color: var(--primary); font-size: 14px; }
.tt-run-title small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-ctl { display: flex; gap: 8px; }
.tt-error { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red);
  font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

/* Быстрая проверка */
.tq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tq-card { --t: var(--muted); --ts: var(--surface-3); display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 16px;
  border-radius: 16px; background: var(--surface-2); box-shadow: inset 3px 0 0 var(--t); }
.tq-card.is-ok { --t: var(--green); --ts: var(--green-soft); }
.tq-card.is-warn { --t: var(--amber); --ts: var(--amber-soft); }
.tq-card.is-bad { --t: var(--red); --ts: var(--red-soft); }
.tq-card.is-wait { --t: var(--line); }
.tq-card.is-wide { grid-column: 1 / -1; }
.tq-head { display: flex; align-items: center; gap: 10px; }
.tq-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--t); font-size: 13px; }
.tq-card.is-wait .tq-ico, .tq-card.is-na .tq-ico { color: var(--muted); }
.tq-head b { flex: 1; font-size: 14px; font-weight: 800; }
.tq-tone { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--ts); color: var(--t);
  font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.tq-tone.is-wait { background: var(--surface); color: var(--muted); }
.tq-body { display: flex; flex-direction: column; gap: 5px; }
.tq-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px; font-size: 12.5px; }
.tq-row > span { color: var(--muted); font-weight: 600; }
.tq-row > b { font-weight: 700; overflow-wrap: anywhere; }
.tq-msg { margin: 2px 0 0; font-size: 12px; font-weight: 600; color: var(--red); overflow-wrap: anywhere; }
.tq-note { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--t); }
.tq-ports { display: flex; flex-direction: column; gap: 5px; }
.tq-port { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; font-size: 12.5px; }
.tq-port i { font-size: 12px; }
.tq-port.is-ok i { color: var(--green); }
.tq-port.is-bad i, .tq-port.is-bad b { color: var(--red); }
.tq-port span { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-port code { font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); }
.tq-port b { min-width: 64px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tq-reach { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.tq-point { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px;
  background: var(--surface); font-size: 12.5px; }
.tq-point-flag { font-size: 16px; line-height: 1; }
.tq-point-city { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tq-point b { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tq-point.is-ok b { color: var(--green); }
.tq-point.is-bad b { color: var(--red); }
.tq-point.is-na b { color: var(--muted); font-weight: 600; }
.tq-point.is-bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 35%, transparent); }
.tq-link { align-self: flex-start; }

/* Мультитест */
.tm-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tm-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); }
.tm-facts small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.tm-facts b { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-list { display: flex; flex-direction: column; gap: 8px; }
.tm-test { border-radius: 16px; background: var(--surface-2); overflow: hidden; transition: opacity .2s; }
.tm-test.is-pending { opacity: .62; }
.tm-test.is-running { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); }
.tm-head { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center; width: 100%; padding: 12px 16px;
  border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tm-state { font-size: 14px; color: var(--muted); text-align: center; }
.tm-test.is-done .tm-state { color: var(--green); }
.tm-test.is-running .tm-state { color: var(--primary); }
.tm-test.is-failed .tm-state, .tm-test.is-timeout .tm-state { color: var(--red); }
.tm-test.is-skipped .tm-state { color: var(--amber); }
.tm-test.is-pending .tm-state { font-size: 7px; }
.tm-title { display: flex; flex-direction: column; min-width: 0; }
.tm-title b { font-size: 14px; font-weight: 700; }
.tm-title small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tm-top { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tm-chev { font-size: 11px; color: var(--muted); }
.tm-body { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.tm-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-metric { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 10px; background: var(--surface);
  font-size: 12.5px; font-weight: 800; color: var(--text); white-space: nowrap; }
.tm-metric small { font-size: 11px; font-weight: 700; color: var(--muted); }
.tm-metric.is-ok { color: var(--green); }
.tm-metric.is-bad { color: var(--red); }
.tm-metric.is-warn { color: var(--amber); }
.tm-metric.is-pri { color: var(--primary); }
.tm-head .tm-metric { padding: 3px 8px; font-size: 12px; }
.tm-services { display: flex; flex-direction: column; gap: 8px; }
.tm-sep { margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.tm-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.tm-svc { --t: var(--muted); display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0;
  padding: 6px 10px; border-radius: 10px; background: var(--surface); font-size: 12.5px; }
.tm-svc.is-ok { --t: var(--green); }
.tm-svc.is-warn { --t: var(--amber); }
.tm-svc.is-bad { --t: var(--red); }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--t); }
.tm-svc b { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-svc span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; color: var(--t); }
.tm-bars { display: flex; flex-direction: column; gap: 6px; }
.tm-bar { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 12.5px; }
.tm-bar-name { font-weight: 600; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-bar-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tm-bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.tm-bar b { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm-prep summary { margin-bottom: 8px; cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-2); }

/* Вывод терминала: всегда тёмный, чтобы цвета ANSI читались в обеих темах */
.term-wrap { position: relative; }
.term { margin: 0; min-height: 80px; max-height: 420px; padding: 14px 16px; overflow: auto; border-radius: 14px; background: #0e1015; color: #d6d9e0;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
  scrollbar-width: thin; scrollbar-color: #3a3f4b transparent; }
.term-empty { color: #7b8190; }
.term-cursor { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; background: #93b4ff; animation: term-blink 1s steps(1) infinite; }
@keyframes term-blink { 50% { opacity: 0; } }
.term-copy { position: absolute; top: 8px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 9px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .08); color: #b9bfcc; cursor: pointer; opacity: 0; transition: opacity .15s; }
.term-wrap:hover .term-copy { opacity: 1; }
.term-copy:hover { background: rgba(255, 255, 255, .16); color: #fff; }

/* История тестов */
.tt-hist { padding: 18px 20px; }
.tt-hist .card-head { display: flex; align-items: center; gap: 10px; }
.tt-hrow { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding: 3px 0; }
.tt-hmain { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; width: 100%; padding: 8px 6px;
  border: 0; border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.tt-hmain:hover { background: var(--surface-2); }
.tt-hrow.is-active .tt-hmain { background: var(--primary-soft); }
.tt-hico { --t: var(--muted); --ts: var(--surface-2); width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ts); color: var(--t); font-size: 13px; }
.tt-hico.is-ok { --t: var(--green); --ts: var(--green-soft); }
.tt-hico.is-warn { --t: var(--amber); --ts: var(--amber-soft); }
.tt-hico.is-bad { --t: var(--red); --ts: var(--red-soft); }
.tt-htext { display: flex; flex-direction: column; min-width: 0; }
.tt-htext b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-htext small { font-size: 12px; font-weight: 600; color: var(--muted); }
.tt-sum { display: flex; gap: 6px; }
.tt-sum span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 800; }
.tt-sum i { font-size: 9.5px; }
.tt-sum .is-ok { background: var(--green-soft); color: var(--green); }
.tt-sum .is-warn { background: var(--amber-soft); color: var(--amber); }
.tt-sum .is-bad { background: var(--red-soft); color: var(--red); }
.tt-sum .is-na { background: var(--surface-2); color: var(--muted); }

@media (max-width: 1100px) {
  .tt { grid-template-columns: 250px minmax(0, 1fr); }
  .tq-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .tt { grid-template-columns: minmax(0, 1fr); }
  .tt-nodes { position: static; max-height: none; }
  .tt-list { max-height: 250px; }
}
@media (max-width: 560px) {
  .tt-modes { grid-template-columns: minmax(0, 1fr); }
  .tt-ssh { grid-template-columns: 100px minmax(0, 1fr); }
  .tt-ssh .field:last-child { grid-column: 1 / -1; }
  .tt-eta { margin-left: 0; width: 100%; }
  .tt-hmain { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .tt-hmain .tt-sum { display: none; }
  .tm-head { grid-template-columns: 18px minmax(0, 1fr) 14px; }
  .tm-head .tm-top { display: none; }
  .tq-row { grid-template-columns: 100px minmax(0, 1fr); }
  .tm-bar { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) auto; }
  .tt-head { padding: 16px; }
  .tt-head-flag { font-size: 28px; }
  .tt-run { padding: 16px; }
}

/* ---------- Админы: сроки, приглашения, страны нод ---------- */
.adm-term { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber);
  font-size: 11px; font-weight: 800; white-space: nowrap; }
.adm-term i { font-size: 9.5px; }
.adm-term.is-over { background: var(--red-soft); color: var(--red); }
.adm-scope-line { color: var(--text-2); }
.act.is-term { color: var(--amber); }
.adm-scope-tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: -6px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 800; }
.adm-scope-tag i { font-size: 10px; color: var(--gc); }
@media (min-width: 1101px) { .adm-head, .adm-row:not(.adm-req-row) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, .75fr) 84px; } }
.role-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.role-preset { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--surface-2);
  color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s, color .15s; }
.role-preset i { font-size: 12px; color: var(--primary); }
.role-preset:hover { background: var(--primary-soft); color: var(--primary); }
.role-scope { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; padding: 16px; border-radius: 18px; background: var(--surface-2); }
.role-scope-head { display: flex; align-items: center; gap: 12px; }
.role-scope-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary); }
.role-scope-head b { display: block; font-size: 14px; font-weight: 800; }
.role-scope-head small { font-size: 12px; font-weight: 600; color: var(--muted); }
.role-scope-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface); }
.role-scope-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.role-scope-seg button.active { background: var(--grad); color: #fff; }
.role-scope-seg button:disabled { opacity: .45; cursor: not-allowed; }
.role-countries { display: flex; flex-wrap: wrap; gap: 6px; }
.role-cc { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.role-cc span { font-size: 15px; line-height: 1; }
.role-cc.is-on { background: var(--primary); color: #fff; }
.exp-modal { width: min(460px, calc(100vw - 32px)); }
.exp-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.exp-date { display: flex; gap: 8px; margin-top: 10px; }
.exp-date .input { flex: 1; min-width: 0; }
.inv-modal { width: min(520px, calc(100vw - 32px)); }
.inv-link { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--surface-2); }
.inv-link code { flex: 1; min-width: 0; font: 12.5px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--text); overflow-wrap: anywhere; }
.inv-card { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding: 16px; border-radius: 20px; border: 1px dashed var(--line); }
.inv-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.inv-head b { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; }
.inv-head b i { color: var(--primary); }
.inv-head .muted { font-size: 12.5px; font-weight: 700; }
.inv-head .hd-link { margin-left: auto; }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 36px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.inv-row.is-expired, .inv-row.is-revoked { opacity: .6; }
.inv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inv-main b { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-main small { font-size: 12px; font-weight: 600; color: var(--muted); }
.inv-main .inv-used { display: inline-flex; align-items: center; gap: 6px; color: var(--green); }
.inv-uses { font-size: 12.5px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .inv-row { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .inv-uses { display: none; }
  .exp-quick { grid-template-columns: 1fr; }
}

/* Приглашение на странице входа */
.invite-box { display: flex; align-items: center; gap: 14px; margin: 16px 0 8px; padding: 14px 16px; border-radius: 18px; background: var(--primary-soft); text-align: left; }
.invite-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; background: var(--primary); color: #fff; font-size: 17px; }
.invite-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.invite-text b { font-size: 15px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.invite-text span { font-size: 12.5px; font-weight: 700; color: var(--primary); }

/* ---------- Журнал действий ---------- */
.lg .card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lg-total { font-size: 12.5px; font-weight: 700; }
.lg-export { margin-left: auto; }
.lg-sections { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.lg-sections .hf { height: 34px; display: inline-flex; align-items: center; gap: 7px; }
.lg-sections .hf i { font-size: 11px; }
.lg-bar { display: grid; grid-template-columns: minmax(0, 1fr) 220px 180px; gap: 10px; margin-bottom: 16px; }
.lg-search input { background: var(--surface-2); box-shadow: none; }
.lg-list { display: flex; flex-direction: column; gap: 18px; transition: opacity .2s; }
.lg-list.is-loading { opacity: .6; }
.lg-day { display: flex; flex-direction: column; gap: 6px; }
.lg-day-title { padding: 0 4px 2px; font-size: 11.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.lg-row { border-radius: 16px; background: var(--surface-2); }
.lg-row.is-denied { background: color-mix(in srgb, var(--red) 7%, var(--surface-2)); }
.lg-main { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 12px; gap: 14px; align-items: center; width: 100%; padding: 10px 14px;
  border: 0; border-radius: inherit; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lg-main:disabled { cursor: default; }
.lg-main .log-ico { width: 38px; height: 38px; border-radius: 12px; }
.lg-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lg-text b { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.lg-text small { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lg-who { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-weight: 700; }
.lg-who i { font-size: 9.5px; }
.lg-time { font-size: 12.5px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lg-chev { font-size: 10px; color: var(--muted); }
.lg-src { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 14px 12px 66px; font-size: 12px; font-weight: 600; color: var(--muted); }
.lg-src span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.lg-src i { font-size: 10px; }
.lg-src .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.lg-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; font-size: 13px; font-weight: 700; color: var(--text-2); }
@media (max-width: 760px) {
  .lg-bar { grid-template-columns: 1fr 1fr; }
  .lg-search { grid-column: 1 / -1; }
  .lg-main { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .lg-chev { display: none; }
  .lg-src { padding-left: 14px; }
}

/* Тестирование: слева ноды, справа запуск той же высоты, история снизу на всю ширину */
.tt { grid-template-columns: 300px minmax(0, 1fr); align-items: stretch; }
.tt-nodes { position: static; max-height: none; }
.tt-list { flex: 1; }
.tt-nodes-hint { flex: none; }
.tt-bottom { grid-column: 1 / -1; min-width: 0; }
.tt-start { flex: 1; }
.tt-quick, .tt-multi { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.tt-quick .tt-actions { margin-top: auto; padding-top: 4px; }
.tt-bullets { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tt-bullets li { align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2);
  font-size: 13px; line-height: 1.35; color: var(--text-2); }
.tt-bullets li i { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft);
  color: var(--primary); font-size: 14px; }
@media (max-width: 860px) {
  .tt { grid-template-columns: minmax(0, 1fr); }
  .tt-nodes { min-height: 0; }
  .tt-list { max-height: 260px; }
}

/* Результаты мультитеста: плитки, таблица скоростей, список статусов */
.tm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tm-stat { --t: var(--text); display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.tm-stat small { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.tm-stat b { font-size: 18px; font-weight: 800; color: var(--t); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tm-stat.is-ok { --t: var(--green); }
.tm-stat.is-bad { --t: var(--red); }
.tm-stat.is-warn { --t: var(--amber); }
.tm-stat.is-pri { --t: var(--primary); }

.sp { border-radius: 14px; background: var(--surface); overflow: hidden; }
.sp-head, .sp-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.4fr) 72px; gap: 16px; align-items: center; padding: 10px 16px; }
.sp-head { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.sp-head span { display: inline-flex; align-items: center; gap: 6px; }
.sp-head span:last-child, .sp-ping { text-align: right; justify-content: flex-end; }
.sp-head .fa-arrow-down { color: var(--green); }
.sp-head .fa-arrow-up { color: var(--primary); }
.sp-row + .sp-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.sp-name { font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-cell { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; }
.sp-cell em { font-style: normal; font-size: 13px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.sp-track span { display: block; height: 100%; border-radius: inherit; }
.sp-down .sp-track span { background: var(--green); }
.sp-up .sp-track span { background: var(--primary); }
.sp-ping { font-size: 13px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sp-ping.is-ok { color: var(--green); }
.sp-ping.is-warn { color: var(--amber); }
.sp-ping.is-bad { color: var(--red); }

.sl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 18px; padding: 4px 16px; border-radius: 14px; background: var(--surface); }
.sl-row { --t: var(--muted); --ts: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0;
  padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.sl-row.is-ok { --t: var(--green); --ts: var(--green-soft); }
.sl-row.is-warn { --t: var(--amber); --ts: var(--amber-soft); }
.sl-row.is-bad { --t: var(--red); --ts: var(--red-soft); }
.sl-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-val { flex: none; max-width: 55%; padding: 3px 10px; border-radius: 99px; background: var(--ts); color: var(--t); font-size: 12px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-live { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tm-live i { color: var(--primary); }
.tm-live span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.tm-raw { align-self: flex-start; }
@media (max-width: 700px) {
  .sp-head { display: none; }
  .sp-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .sp-name { grid-column: 1; }
  .sp-ping { grid-column: 2; grid-row: 1; }
  .sp-cell { grid-column: 1 / -1; grid-template-columns: 16px minmax(0, 1fr) 96px; }
  .sp-down::before { content: '↓'; color: var(--green); font-weight: 800; }
  .sp-up::before { content: '↑'; color: var(--primary); font-weight: 800; }
}

/* Закрытое выпадающее меню не занимает места: иначе меню у нижнего края удлиняет страницу и под футером пустота */
.dd:not(.open) .dd-menu { max-height: 0 !important; padding-top: 0; padding-bottom: 0; border-width: 0;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s, max-height 0s linear .18s, padding 0s linear .18s; }

/* Таблица скоростей и список статусов: ровные пропорции и разделители */
.sp-head, .sp-row { grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr) 64px; column-gap: 28px; padding: 11px 18px; }
.sp-name { text-align: left; justify-self: start; max-width: 100%; }
.sp-cell { grid-template-columns: minmax(0, 1fr) 84px; gap: 12px; }
.sp-cell em { text-align: right; }
.sp-row + .sp-row { border-top: 1px solid var(--line); }
.sl { gap: 6px 8px; padding: 0; background: transparent; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sl-row { padding: 9px 10px 9px 14px; border: 0; border-radius: 12px; background: var(--surface); }
@media (max-width: 700px) {
  .sp-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
  .sp-cell { grid-template-columns: 16px minmax(0, 1fr) 84px; }
}

/* Плитки сервисов: одинаковой высоты, точка статуса, значение цветом справа */
.tm-chips { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.tm-svc { height: 40px; padding: 0 14px; border-radius: 12px; gap: 10px; font-size: 13px; }
.tm-svc b { font-weight: 700; color: var(--text); }
.tm-svc span { max-width: 110px; font-size: 12.5px; }

/* Список сервисов: две колонки, ровные разделители только между строками */
.sl2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; padding: 4px 18px; border-radius: 14px; background: var(--surface); }
.sl2-col { display: flex; flex-direction: column; min-width: 0; }
.sl2-row { --t: var(--muted); --ts: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; min-width: 0; }
.sl2-row + .sl2-row { border-top: 1px solid var(--line); }
.sl2-row.is-ok { --t: var(--green); --ts: var(--green-soft); }
.sl2-row.is-warn { --t: var(--amber); --ts: var(--amber-soft); }
.sl2-row.is-bad { --t: var(--red); --ts: var(--red-soft); }
.sl2-name { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl2-val { flex: none; max-width: 55%; min-width: 44px; text-align: center; padding: 3px 10px; border-radius: 99px; background: var(--ts); color: var(--t);
  font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) {
  .sl2 { grid-template-columns: 1fr; }
  .sl2-col + .sl2-col { border-top: 1px solid var(--line); }
}

/* Действия с сервером ноды */
.srv-card { width: min(760px, calc(100vw - 32px)); }
.srv-ssh { display: grid; grid-template-columns: 110px 130px minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.srv-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.srv-act { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-radius: 16px; background: var(--surface-2);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s, box-shadow .15s; }
.srv-act:hover:not(:disabled) { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); }
.srv-act:disabled { opacity: .55; cursor: default; }
.srv-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--primary); font-size: 14px; }
.srv-act b { display: block; font-size: 14px; font-weight: 800; }
.srv-act small { font-size: 12px; font-weight: 600; color: var(--muted); }
.srv-act.is-danger .srv-ico { color: var(--red); }
.srv-act.is-danger:hover:not(:disabled) { background: var(--red-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }
.srv-out { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.srv-out-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.srv-out-head b { font-weight: 800; }
.srv-out-head span { font-weight: 600; color: var(--muted); }
.srv-out.is-running .srv-out-head i { color: var(--primary); }
.srv-out.is-done .srv-out-head i { color: var(--green); }
.srv-out.is-failed .srv-out-head i, .srv-out.is-failed .srv-out-head span { color: var(--red); }
.srv-out .term { max-height: 340px; }
@media (max-width: 600px) {
  .srv-ssh { grid-template-columns: 1fr 1fr; }
  .srv-ssh .input:last-child { grid-column: 1 / -1; }
  .srv-actions { grid-template-columns: 1fr; }
}

/* ================================================================
   Концепция Xyrex: сланцевый тёмный фон, бирюзовый акцент, сетка,
   светящиеся кнопки, тонкие рамки. Бренд и логотип — elqen.
   ================================================================ */
@font-face {
  font-family: 'Twemoji Country Flags';
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E007F;
  src: url('/static/fonts/TwemojiCountryFlags.woff2') format('woff2');
  font-display: swap;
}

:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f1f5f7;
  --surface-3: #e6ecf0;
  --line: #e2e8ee;
  --text: #0f172a;
  --text-2: #3c4a5e;
  --muted: #7a889b;
  --primary: #0d9488;
  --primary-2: #14b8a6;
  --primary-soft: #e0f5f2;
  --grad: linear-gradient(180deg, #19c3b1 0%, #0d9488 100%);
  --hero-grad: linear-gradient(120deg, #2dd4bf 0%, #14b8a6 45%, #0f766e 100%);
  --accent-rgb: 20, 184, 166;
  --accent2-rgb: 45, 212, 191;
  --font-display: 'Twemoji Country Flags', 'Outfit', 'Manrope', system-ui, sans-serif;
  --border-soft: rgba(15, 23, 42, .07);
}

:root[data-theme="dark"] {
  --bg: #0a0f1a;
  --surface: #0f172a;
  --surface-2: #162034;
  --surface-3: #1e293b;
  --line: #1c2740;
  --text: #f1f5f9;
  --text-2: #c3cddb;
  --muted: #7c8aa1;
  --primary: #2dd4bf;
  --primary-2: #5eead4;
  --primary-soft: rgba(45, 212, 191, .12);
  --grad: linear-gradient(180deg, #2fd0bd 0%, #0f9e8f 100%);
  --hero-grad: linear-gradient(120deg, #14b8a6 0%, #0f766e 100%);
  --accent-rgb: 20, 184, 166;
  --accent2-rgb: 45, 212, 191;
  --pink-soft: rgba(232, 91, 138, .14);
  --amber-soft: rgba(217, 162, 36, .14);
  --red-soft: rgba(229, 72, 77, .14);
  --green-soft: rgba(31, 158, 110, .16);
  --teal-soft: rgba(42, 167, 201, .14);
  --shadow: 0 16px 40px -20px rgba(0, 0, 0, .7);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .75);
  --backdrop: rgba(5, 8, 15, .66);
  --border-soft: rgba(148, 163, 184, .09);
}

body {
  font-family: 'Twemoji Country Flags', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
h1, h2, h3, .hello h1, .card-title, .tn-brand-text b, .af-brand b, .brand-mark b, .modal-card h2 {
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
code, .mono, pre, .term, .kv code, .affix > span {
  font-family: 'Twemoji Country Flags', ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Фон: сетка, гаснущая к краям, и бирюзовое свечение сверху */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 138, 161, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 138, 161, .08) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 55% at 50% 0%, #000 25%, transparent 75%);
}
body::after {
  content: '';
  position: fixed;
  left: 50%;
  top: -260px;
  width: 1100px;
  height: 520px;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .14), rgba(var(--accent-rgb), 0));
}
:root:not([data-theme="dark"]) body::after {
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .10), rgba(var(--accent-rgb), 0));
}

/* Карточки: тонкая рамка вместо тяжёлой тени */
.card, .side-card, .modal-card, .adm-gcard {
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow);
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .side-card,
:root[data-theme="dark"] .modal-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .018), rgba(255, 255, 255, 0) 40%), var(--surface);
}

/* Главная кнопка светится, как в Xyrex */
.btn-primary {
  color: #04211e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 55%),
    rgb(var(--accent-rgb));
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow:
    0 0 0 4px rgba(var(--accent-rgb), .14),
    0 12px 34px -10px rgba(var(--accent-rgb), .7),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 6px rgba(var(--accent-rgb), .18),
    0 16px 44px -10px rgba(var(--accent-rgb), .85),
    inset 0 1px 0 rgba(255, 255, 255, .35);
}
:root:not([data-theme="dark"]) .btn-primary {
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%), #0d9488;
}
.btn-primary:disabled { box-shadow: none; transform: none; }

/* Активные вкладки, фильтры и пункты меню — бирюзой */
.tab.active, .hf.active, .role-scope-seg button.active {
  background: var(--grad);
  color: #04211e;
  box-shadow: 0 8px 22px -8px rgba(var(--accent-rgb), .6);
}
:root:not([data-theme="dark"]) .tab.active,
:root:not([data-theme="dark"]) .hf.active,
:root:not([data-theme="dark"]) .role-scope-seg button.active { color: #fff; }
.nav-item.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .22); }

/* Шапка и подвал: стекло на сланцевом фоне */
:root[data-theme="dark"] .topnav {
  background: rgba(10, 15, 26, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
:root[data-theme="dark"] .app-footer { background: rgba(10, 15, 26, .72); }

/* Обложка страницы: заголовок бирюзовым градиентом */
:root[data-theme="dark"] .hero {
  background:
    radial-gradient(60% 160% at 0% 0%, rgba(var(--accent2-rgb), .20) 0%, rgba(var(--accent2-rgb), 0) 60%),
    radial-gradient(45% 140% at 100% 100%, rgba(var(--accent-rgb), .14) 0%, rgba(var(--accent-rgb), 0) 65%),
    var(--surface);
  box-shadow: inset 0 0 0 1px rgba(var(--accent2-rgb), .16), 0 18px 40px -22px rgba(0, 0, 0, .8);
}
:root[data-theme="dark"] .hero .hello h1 {
  background: linear-gradient(100deg, #99f6e4 0%, #2dd4bf 50%, #14b8a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Поля ввода: тонкая рамка и бирюзовый фокус */
.input:focus, .search input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18); }
:root[data-theme="dark"] .input { box-shadow: inset 0 0 0 1px var(--border-soft); }

/* Полосы прогресса — бирюзовые */
.np-bar span, .tm-bar-track span, .sp-up .sp-track span { background: var(--primary); }

::selection { background: rgba(var(--accent-rgb), .35); }

/* ---------- Xyrex, шаг 2: бирюзово-тёмный фон, сетка везде, плавающая шапка, бирюзовые рамки ---------- */
:root[data-theme="dark"] {
  --bg: #091312;
  --surface: #0d1b1a;
  --surface-2: #122523;
  --surface-3: #18302d;
  --line: #1b3431;
  --text: #ecfaf7;
  --text-2: #bcd4cf;
  --muted: #7b9892;
  --primary-soft: rgba(45, 212, 191, .12);
  --border-soft: rgba(45, 212, 191, .14);
  --backdrop: rgba(3, 10, 9, .7);
}
:root {
  --border-soft: rgba(13, 148, 136, .16);
}

/* Сетка на всю страницу: ярче сверху, но не исчезает внизу */
body::before {
  background-image:
    linear-gradient(rgba(45, 212, 191, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, .055) 1px, transparent 1px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .35) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .55) 60%, rgba(0, 0, 0, .35) 100%);
}
:root:not([data-theme="dark"]) body::before {
  background-image:
    linear-gradient(rgba(13, 148, 136, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, .07) 1px, transparent 1px);
}
:root[data-theme="dark"] body::after {
  width: 1300px;
  height: 640px;
  background: radial-gradient(closest-side, rgba(20, 184, 166, .16), rgba(20, 184, 166, 0));
}

/* Карточки: полупрозрачные с бирюзовым отливом и бирюзовой рамкой */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .side-card,
:root[data-theme="dark"] .modal-card,
:root[data-theme="dark"] .adm-gcard {
  background: linear-gradient(180deg, rgba(45, 212, 191, .035), rgba(45, 212, 191, 0) 45%), rgba(13, 27, 26, .86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card, .side-card, .modal-card, .adm-gcard {
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow);
}
.hchip, .tn-profile-btn, .cur-switch.cur-top, .round-btn {
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

/* Шапка: плавающая скруглённая плашка с рамкой, как у Xyrex */
.topnav,
:root[data-theme="dark"] .topnav {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 14px 28px 0;
}
.topnav-inner {
  max-width: 1424px;
  height: 64px;
  padding: 0 14px 0 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--border-soft), 0 14px 34px -18px rgba(0, 0, 0, .55);
}
:root[data-theme="dark"] .topnav-inner { background: rgba(11, 24, 23, .78); }
.app-top .sidebar { top: 104px; }
.tn-brand .logo { box-shadow: 0 6px 18px rgba(var(--accent-rgb), .35); }

/* Иконки меню — все в бирюзовой гамме */
.nav-item, .more-item { --c: var(--primary) !important; }
.app-top .nav-item.active .nav-ico { color: #04211e; }
:root:not([data-theme="dark"]) .app-top .nav-item.active .nav-ico { color: #fff; }

/* Подвал в тон шапке */
:root[data-theme="dark"] .app-footer { background: rgba(9, 19, 18, .78); box-shadow: 0 -1px 0 var(--border-soft); }

/* Место под полосу прокрутки всегда занято: окно блокирует прокрутку — страница не прыгает вбок */
html { scrollbar-gutter: stable; }

/* Подвал — такая же плавающая плашка, как шапка */
.app-footer,
:root[data-theme="dark"] .app-footer {
  background: transparent;
  box-shadow: none;
  padding: 0 28px 14px;
}
.app-footer-inner {
  max-width: 1424px;
  min-height: 64px;
  padding: 12px 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--border-soft), 0 -14px 34px -18px rgba(0, 0, 0, .55);
}
:root[data-theme="dark"] .app-footer-inner { background: rgba(11, 24, 23, .78); }
@media (max-width: 767px) {
  .app-footer { padding: 0 16px 92px; }
  .app-footer-inner { padding: 18px 16px; }
}

/* Переходы между страницами: только проявление на месте, без сдвига; прокрутка — сразу, без «проезда» по экрану */
html { scroll-behavior: auto; }
@media (min-width: 768px) { .app.app-top { min-height: calc(100vh - 78px); min-height: calc(100dvh - 78px); } }
@media (max-width: 767px) { .app.app-top { min-height: 100vh; min-height: 100dvh; } }
@keyframes page-in { from { opacity: 0; } }
.page { animation: page-in .18s ease backwards; }
@media (prefers-reduced-motion: reduce) { .page { animation: none; } }

/* Большие карточки не подпрыгивают при наведении — мышь по сетке не дёргает весь экран */
.stat:hover, .prov:hover, .card.import-banner:hover, .ni-kind-card:hover, .acc-cur-tile:hover, .prov-pick-item:hover { transform: none; }

/* ---------- Кошельки: оплаты по месяцам ---------- */
.wp { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.wp-month { min-width: 0; padding: 14px 16px 8px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border-soft); }
.wp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.wp-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--text); }
.wp-title em { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.wp-sum { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; }
.wp-state { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap; }
.wp-state.is-ok { background: var(--green-soft); color: var(--green); }
.wp-state.is-bad { background: var(--red-soft); color: var(--red); }
.wp-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 96px 96px 16px; gap: 10px; align-items: center;
  min-height: 38px; font-size: 13px; }
.wp-row + .wp-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.wp-cols { min-height: 30px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.wp-row > :nth-child(3), .wp-row > :nth-child(4) { text-align: right; }
.wp-row .d { font-weight: 800; color: var(--muted); }
.wp-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--text-2); }
.wp-row b { font-weight: 800; color: var(--text); white-space: nowrap; }
.wp-row .l { font-weight: 700; color: var(--muted); white-space: nowrap; }
.wp-row > i { font-size: 12px; color: var(--green); }
.wp-row.is-bad b, .wp-row.is-bad > i { color: var(--red); }
.wp-burn .d i { color: var(--primary); font-size: 12px; }
.wp-burn .n { color: var(--muted); }
@media (max-width: 560px) {
  .wp { grid-template-columns: minmax(0, 1fr); }
  .wp-row { grid-template-columns: 40px minmax(0, 1fr) auto 16px; }
  .wp-row > :nth-child(4) { display: none; }
  .wp-head { flex-wrap: wrap; }
}

/* Месяцы друг под другом — таблице хватает ширины */
.wp { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.wp-month { padding: 12px 18px 6px; }
.wp-head { gap: 12px; }
.wp-title { white-space: nowrap; font-size: 15px; gap: 10px; }
.wp-title em { padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.wp-row { grid-template-columns: 64px minmax(0, 1fr) 130px 130px 18px; gap: 14px; min-height: 40px; }
.wp-row > i { justify-self: end; }
@media (max-width: 560px) {
  .wp-month { padding: 12px 14px 6px; }
  .wp-row { grid-template-columns: 44px minmax(0, 1fr) auto 16px; gap: 10px; }
  .wp-title { white-space: normal; }
}
.wp-burn .n { color: var(--text-2); }
.wp-burn .n small { font-size: inherit; font-weight: 600; color: var(--muted); }
.wp-row { grid-template-columns: 64px minmax(0, 1fr) 120px 170px 18px; }
.wp-row .l em { font-style: normal; font-weight: 800; color: var(--red); }
@media (max-width: 560px) {
  .wp-row { grid-template-columns: 44px minmax(0, 1fr) auto 16px; }
}

/* Открытый выпадающий список не прячется под соседней карточкой (у карточек свой слой из-за backdrop-filter) */
.card:has(.dd.open), .side-card:has(.dd.open), .adm-gcard:has(.dd.open), .adm-row:has(.dd.open) { position: relative; z-index: 30; }
.wp-note { display: flex; align-items: center; gap: 8px; padding: 12px 4px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.wp-note i { color: var(--green); font-size: 12px; }
.wp-table .wp-note { padding: 12px 0 2px; border-top: 1px solid var(--line); }
.card + .charts { margin-top: 20px; }

/* Окно установки ноды: действия — отдельным рядом на всю ширину, над «Лог» / «Закрыть» */
.modal-actions > .ni-btns { grid-column: 1 / -1; order: -1; display: flex; flex-wrap: wrap; gap: 8px; }
.modal-actions > .ni-btns:not(:has(.btn)) { display: none; }
.modal-actions > .ni-btns .btn { flex: 1 1 auto; height: 46px; white-space: nowrap; }
.modal-actions > .ni-btns .hd-del { flex: 0 0 46px; padding: 0; }

/* Установка нод на телефоне: ссылки и кнопки в два ряда, ничего не вылезает за карточку */
@media (max-width: 600px) {
  .card.ni > .card-head .card-title { white-space: nowrap; }
  .card.ni > .card-head .btn { height: 42px; padding: 0 16px; font-size: 14px; }
  .ni-foot { flex-wrap: wrap; }
  .ni-foot .ni-btns { flex: 1 1 100%; flex-wrap: wrap; }
  .ni-foot .ni-btns .btn { flex: 1 1 auto; }
  .ni-foot .ni-btns .hd-del { flex: 0 0 36px; padding: 0; }
}

/* Заменить сервер: выбор хоста */
.rh-card { width: min(560px, calc(100vw - 32px)); }
.rh-search { margin: 4px 0 10px; }
.rh-list { max-height: min(46vh, 380px); overflow-y: auto; padding-right: 2px; }
.rh-item input { accent-color: var(--primary); }
.rh-item.is-picked { box-shadow: inset 0 0 0 1.5px var(--primary); }
.rh-enable { margin-top: 10px; text-align: left; }

/* Тесты: строка «идёт тест» рядом с кнопкой запуска (вариант B — без фона и рамки) */
.tt-running { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.tt-running-main { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 2px 4px; min-width: 0;
    background: none; border: 0; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: left; }
.tt-running-main:focus-visible, .tt-running-x:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 10px; }
.tt-running-dot { position: relative; width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--primary); }
.tt-running-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--primary);
    animation: tt-ping 1.4s ease-out infinite; }
@keyframes tt-ping { from { transform: scale(.8); opacity: .8; } to { transform: scale(2.4); opacity: 0; } }
.tt-running-what { font-weight: 800; color: var(--primary); white-space: nowrap; }
.tt-running-sep { color: var(--muted); }
.tt-running-step { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 340px; }
.tt-running-pct { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-running-line { position: absolute; left: 20px; right: 0; bottom: 6px; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.tt-running-line span { display: block; height: 100%; background: var(--primary); transition: width .6s cubic-bezier(.3, 1, .4, 1); }
.tt-running-main:hover .tt-running-step { color: var(--text); }
.tt-running-x { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: none;
    color: var(--muted); font-size: 13px; cursor: pointer; transition: background-color .2s, color .2s; }
.tt-running-x:hover { background: var(--red-soft); color: var(--red); }
.tt-running-x:disabled { opacity: .4; cursor: default; background: none; color: var(--muted); }
.tt-running.is-stopping .tt-running-dot, .tt-running.is-stopping .tt-running-dot::after { background: var(--amber); }
.tt-running.is-stopping .tt-running-line span { background: var(--amber); }
.tt-run-anchor { scroll-margin-top: 110px; }
@media (max-width: 600px) {
  .tt-running { flex: 1 1 100%; }
  .tt-running-main { flex: 1; }
  .tt-running-step { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tt-running-dot::after { animation: none; }
  .tt-running-line span { transition: none; }
}

/* Аккаунты: плитки «Рубли / Валюта» — итог и фильтр сразу */
.acc-cur { --fx-rgb: 56, 102, 201; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: -6px 0 22px; }
:root[data-theme="dark"] .acc-cur { --fx-rgb: 143, 181, 255; }
.acc-cur-tile { --c-rgb: var(--accent-rgb); position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px;
    align-items: center; min-width: 0; padding: 16px 18px 17px; border: 0; border-radius: 22px; background: var(--surface); color: var(--text);
    text-align: left; cursor: pointer; font-family: inherit; box-shadow: var(--shadow), inset 0 0 0 1px var(--border-soft);
    transition: box-shadow .2s, transform .2s; }
.acc-cur-tile.is-fx { --c-rgb: var(--fx-rgb); }
.acc-cur-tile:hover { transform: translateY(-1px); }
.acc-cur-tile.on { box-shadow: var(--shadow), inset 0 0 0 2px rgb(var(--c-rgb)); }
.acc-cur-tile:focus-visible { outline: 2px solid rgb(var(--c-rgb)); outline-offset: 3px; }
.acc-cur-badge { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
    font-family: var(--font-display); font-size: 19px; font-weight: 800; color: rgb(var(--c-rgb)); background: rgba(var(--c-rgb), .13); }
.acc-cur-tile.is-fx .acc-cur-badge { font-size: 15px; }
.acc-cur-name { font-size: 15px; font-weight: 800; white-space: nowrap; }
.acc-cur-name small { margin-left: 7px; font-size: 12px; font-weight: 700; color: var(--muted); }
.acc-cur-state { padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.acc-cur-state.bad { color: var(--red); background: var(--red-soft); }
.acc-cur-state.ok { color: var(--green); background: var(--green-soft); }
.acc-cur-nums { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 12.5px; font-weight: 600; color: var(--muted); min-width: 0; }
.acc-cur-nums b { margin-right: 5px; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.acc-cur-bar { grid-column: 1 / -1; height: 4px; margin-top: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.acc-cur-bar span { display: block; height: 100%; border-radius: 99px; background: rgb(var(--c-rgb)); transition: width .5s cubic-bezier(.3, 1, .4, 1); }
@media (max-width: 767px) {
  .acc-cur { grid-template-columns: 1fr; gap: 10px; margin-top: -4px; }
  .acc-cur-tile { padding: 14px 16px 15px; }
}

/* Скорость: город без ответа и замер до запасного сервера */
.sp-name { display: flex; flex-direction: column; min-width: 0; }
.sp-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-name small { font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row.has-note .sp-name small { color: var(--amber); }
.sp-row.is-failed { opacity: .75; }
.sp-row.is-failed .sp-name small { color: var(--red); }
.sp-row.is-failed .sp-track { background: repeating-linear-gradient(-45deg, var(--surface-3) 0 4px, transparent 4px 8px); }

/* Тесты: сохранённый пароль */
.tt-saved { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--green); }
.tt-saved .link-btn { font-size: 11.5px; color: var(--muted); text-decoration: underline; }
.tt-remember { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.tt-remember input { width: 16px; height: 16px; accent-color: var(--primary); }

/* Тесты: сравнение нод */
.tt-cmp-btn { margin-left: auto; height: 30px; padding: 0 12px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.tt-cmp-hint { margin: 0 2px; font-size: 12px; }
.tt-pick { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 9px; color: transparent; transition: background .15s, border-color .15s; }
.tt-pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tt-node.is-pick { grid-template-columns: 16px 24px minmax(0, 1fr) 10px; }

/* Тесты: сравнение нод — шапка с нодами и разделы-карточки */
.tc { display: flex; flex-direction: column; gap: 14px; }
.tc .tt-warn { margin: 0; }
.tc-scroll { overflow-x: auto; margin: -6px; padding: 6px; }
.tc-inner { display: flex; flex-direction: column; gap: 14px; min-width: calc(170px + var(--cols) * 200px); }
.tc-row { display: grid; grid-template-columns: 170px repeat(var(--cols), minmax(0, 1fr)); gap: 10px; align-items: stretch; }

.tc-head { padding: 12px; }
.tc-head-label { display: flex; flex-direction: column; justify-content: center; gap: 3px; padding-left: 6px; }
.tc-head-label b { font-family: var(--font-display); font-size: 17px; }
.tc-head-label small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tc-node { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; }
.tc-node.is-lead { border-color: rgba(var(--accent-rgb), .45); background: linear-gradient(135deg, var(--primary-soft), var(--surface-2)); }
.tc-flag { font-size: 24px; line-height: 1; }
.tc-node-main { display: flex; flex-direction: column; min-width: 0; }
.tc-node-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-node-main small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-score { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--surface-3); font-size: 13px; font-weight: 800; color: var(--text-2); }
.tc-score i { font-size: 10px; color: var(--amber, #e0a82e); }
.tc-node.is-lead .tc-score { background: var(--grad); color: #fff; }
.tc-node.is-lead .tc-score i { color: #fff; }

.tc-sec { padding: 6px 12px 12px; scroll-margin-top: 180px; }
.tc-sec-head { padding: 8px 0 10px; align-items: center; }
.tc-sec-title { display: flex; align-items: center; gap: 10px; padding-left: 6px; min-width: 0; }
.tc-colname { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 12px; font-size: 12px; font-weight: 700;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-colname span { font-size: 15px; }
.tc-sec-head b { font-size: 14.5px; }
.tc-sec-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.tc-sec .tc-row { padding: 4px 0; }
.tc-sec .tc-row + .tc-row { border-top: 1px dashed var(--border-soft); }
.tc-label { display: flex; align-items: center; padding: 6px 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tc-cell { display: flex; flex-direction: column; justify-content: center; gap: 5px; min-width: 0; padding: 8px 12px; border-radius: 11px; }
.tc-val { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; font-weight: 700; color: var(--text); }
.tc-val > span:first-child { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.tc-none { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.tc-note { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tc-win { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px;
  background: var(--green-soft); color: var(--green); }
.tc-cell.is-best { background: var(--green-soft); }
.tc-cell.is-best .tc-val { color: var(--green); }
.tc-cell.tc-bad .tc-val { color: var(--red); }
.tc-cell.tc-warn .tc-val { color: var(--amber, #e0a82e); }
.tc-bar { display: block; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.tc-bar span { display: block; height: 100%; border-radius: inherit; background: var(--muted); opacity: .55; }
.tc-cell.is-best .tc-bar span { background: var(--green); opacity: 1; }

.tc-same { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; padding: 10px 6px 2px; border-top: 1px solid var(--border-soft); }
.tc-same-title { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.tc-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); }
.tc-chip small { font-size: 11px; font-weight: 500; color: var(--muted); }

.tc-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px; text-align: center; }
.tc-empty i { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; background: var(--primary-soft); color: var(--primary); }
.tc-empty b { font-size: 16px; }
.tc-empty span { font-size: 13px; color: var(--muted); }

.tt-cmp-btn { margin-left: auto; height: 30px; padding: 0 12px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.tt-cmp-hint { margin: 0 2px; font-size: 12px; }
.tt-pick { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line); display: grid; place-items: center;
  font-size: 9px; color: transparent; transition: background .15s, border-color .15s; }
.tt-pick.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tt-node.is-pick { grid-template-columns: 16px 24px minmax(0, 1fr) 10px; }

@media (max-width: 760px) {
  .tc-row { grid-template-columns: 110px repeat(var(--cols), minmax(0, 1fr)); }
  .tc-inner { min-width: calc(110px + var(--cols) * 170px); }
}

/* Аккаунт без API (бывший раздел «Провайдеры») */
.prov-logo-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;
  background: var(--primary-soft); color: var(--primary); font-size: 16px; }
.prov-pick-item .prov-logo-ico { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.modal-logo.prov-logo-ico { width: 56px; height: 56px; font-size: 22px; }
.acc-manual-tag { margin-left: auto; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted);
  font-size: 11px; font-weight: 700; white-space: nowrap; }
.acc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-links a { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.acc-links a:hover { background: var(--surface-3); color: var(--text); }
.acc-links a i { color: var(--primary); font-size: 12px; }
.acc-notes { display: flex; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--text-2); }
.acc-notes i { margin-top: 3px; color: var(--amber, #e0a82e); font-size: 12px; }
.acc-notes p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.acc-manual .prov-actions .is-disabled { opacity: .6; pointer-events: none; }

/* Режим стримера: чувствительный текст размыт (для скриншотов) */
html.streamer .priv { filter: blur(6px); transition: filter .15s; }
html.streamer input.priv, html.streamer textarea.priv { filter: blur(5px); }
html.streamer .priv .priv { filter: none; }
.streamer-btn.is-on { background: var(--grad); color: #fff; }

/* Удаление установки: общее с другой установкой и «только карточку» */
.nd-shared { display: flex; gap: 8px; margin: -4px 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--amber-soft);
  color: var(--text-2); font-size: 12.5px; line-height: 1.4; text-align: left; }
.nd-shared i { margin-top: 3px; color: var(--amber, #e0a82e); }
.nd-item.is-shared small { color: var(--amber, #e0a82e); }
.nd-only-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%;
  margin-top: 10px; padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line); background: transparent;
  color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.nd-only-card:hover { background: var(--surface-2); border-color: var(--primary); }
.nd-only-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft);
  color: var(--primary); font-size: 14px; }
.nd-only-card b { display: block; font-size: 14px; }
.nd-only-card small { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.35; white-space: normal; }
.nd-only-go { color: var(--muted); font-size: 12px; }

/* ---------- Каскад: выбор вида установки, маршрут вход → выход ---------- */
.ni-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 6px; }
.ni-kind-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  padding: 20px 18px 16px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  cursor: pointer; overflow: hidden; transition: transform var(--t, .2s), border-color var(--t, .2s), box-shadow var(--t, .2s); font: inherit; }
.ni-kind-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 10px 30px rgba(var(--accent-rgb), .18); }
.ni-kind-card b { font-size: 17px; }
.ni-kind-card small { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.45; }
.ni-kind-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 18px;
  background: var(--primary-soft); color: var(--primary); }
.ni-kind-card.is-cascade .ni-kind-ico { background: var(--teal-soft); color: var(--teal); }
.ni-kind-card.is-cascade:hover { border-color: var(--teal); }
.ni-kind-flow { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; color: var(--muted); font-size: 13px; width: 100%; }
.ni-kind-flow em { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--line), var(--primary), var(--line));
  background-size: 200% 100%; animation: cs-flow 2.4s linear infinite; }
.ni-kind-card.is-cascade .ni-kind-flow em { background-image: linear-gradient(90deg, var(--line), var(--teal), var(--line)); }
@keyframes cs-flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.cs-route { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; padding: 14px 16px; border-radius: 18px;
  border: 1px solid var(--line); background: radial-gradient(120% 140% at 50% 0%, rgba(var(--accent-rgb), .10), transparent 60%), var(--surface-2); }
.cs-hop { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; flex: none; color: var(--muted); }
.cs-hop > i, .cs-hop > span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 15px;
  background: var(--surface); border: 1px solid var(--line); }
.cs-hop small { font-size: 11px; font-weight: 800; max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-hop.is-in > span { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft), 0 0 18px rgba(var(--accent-rgb), .35); font-size: 18px; }
.cs-hop.is-out > span { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); font-size: 18px; }
.cs-hop.is-in small, .cs-hop.is-out small { color: var(--text); }
.cs-route em { flex: 1; min-width: 14px; height: 2px; margin-bottom: 18px; border-radius: 2px; background: var(--line); }
.cs-route em.is-tunnel { height: 4px; background: linear-gradient(90deg, var(--primary), var(--teal), var(--primary)); background-size: 200% 100%;
  animation: cs-flow 2s linear infinite; box-shadow: 0 0 12px rgba(var(--accent-rgb), .35); }

.cs-part { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 6px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.cs-part b { font-size: 16px; }
.cs-part small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cs-badge { width: 24px; height: 24px; border-radius: 8px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; align-self: center; }
.cs-badge.is-in { background: var(--primary-soft); color: var(--primary); }
.cs-badge.is-out { background: var(--teal-soft); color: var(--teal); }
.cs-seg { display: inline-flex; gap: 4px; padding: 4px; margin: 6px 0 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.cs-seg button { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 10px; background: none;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.cs-seg button.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.ni-kind { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  font-weight: 800; vertical-align: middle; }
.ni-kind-in { background: var(--primary-soft); color: var(--primary); }
.ni-kind-out { background: var(--teal-soft); color: var(--teal); }
.ni-route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ni-route b { color: var(--text); }
.ni-route .fa-arrow-right-long { color: var(--teal); }

@media (max-width: 640px) {
  .ni-kinds { grid-template-columns: minmax(0, 1fr); }
  .cs-route { gap: 4px; padding: 12px 10px; }
  .cs-hop small { max-width: 56px; }
}
.ni-toggle-exit { margin: 4px 0 14px; }

/* Каскад одной карточкой */
.cs-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cs-card-head .nl-main { flex: 1; min-width: 0; }
.cs-card-head .nl-st { margin-left: auto; flex: none; }
.cs-card-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; font-size: 16px;
  background: linear-gradient(135deg, var(--primary-soft), var(--teal-soft)); color: var(--teal); }
.cs-card-path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cs-card-path span { opacity: .7; }
.cs-card-path span.is-up { opacity: 1; color: var(--text); }
.cs-card-path i { color: var(--teal); }
.cs-legs { display: flex; flex-direction: column; }
.cs-leg { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.cs-leg-in { border-left: 3px solid var(--primary); }
.cs-leg-out { border-left: 3px solid var(--teal); }
.cs-leg .ni-head { margin-bottom: 10px; }
.cs-leg-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; vertical-align: middle; }
.cs-leg-tag-in { background: var(--primary-soft); color: var(--primary); }
.cs-leg-tag-out { background: var(--teal-soft); color: var(--teal); }
.cs-link { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.cs-link::before, .cs-link::after { content: ''; flex: 1; height: 2px; border-radius: 2px; }
.cs-link::before { background: linear-gradient(90deg, transparent, var(--primary)); }
.cs-link::after { background: linear-gradient(90deg, var(--teal), transparent); }
.cs-link span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.cs-link i { color: var(--teal); }
@media (max-width: 640px) {
  .cs-leg { padding: 12px; }
  .cs-link span { white-space: normal; text-align: center; }
}

/* Выводы из кошельков */
.ww { padding: 14px; border-radius: 18px; background: var(--surface-2); }
.ww-totals { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 10px; }
.ww-totals div { display: flex; flex-direction: column; gap: 2px; }
.ww-totals small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.ww-totals b { font-size: 20px; font-weight: 800; }
.ww-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ww-row .d { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.ww-row .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-row small { color: var(--muted); font-weight: 700; }
.ww-more { margin-top: 6px; }
.ww .hint { margin: 10px 0 0; }
@media (max-width: 640px) { .ww-row { grid-template-columns: minmax(0, 1fr) auto; } .ww-row .d { grid-column: 1 / -1; } }
.ww-hand em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.ww-edit { display: flex; align-items: center; gap: 14px; margin-left: auto; align-self: center; }
.ww-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ww-form .input { width: 160px; }
.ww-form .hint { margin: 0; }
.ww-row.is-spend b { color: var(--muted); }

/* Трейсроут */
.tt-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-start, .tr-probe-form { display: flex; flex-direction: column; gap: 14px; }
.tr-probe-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 110px minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; }
.tr-probe-grid .field, .tr-probe-form .hint { margin: 0; }
.tr-path { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface-2); flex-wrap: wrap; }
.tr-end { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tr-end > i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary); color: #fff;
  box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 55%, transparent); }
.tr-end > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tr-end small { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tr-end b { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-end em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.tr-flag { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface); font-size: 22px; }
.tr-line { flex: 1; min-width: 60px; height: 2px; position: relative; border-radius: 2px; overflow: hidden;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--primary) 45%, transparent) 0 8px, transparent 8px 14px); }
.tr-line i { position: absolute; top: 0; left: -30%; width: 30%; height: 100%; background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: tr-run 1.8s linear infinite; }
@keyframes tr-run { to { left: 100%; } }
.tr-probe-acts { display: flex; gap: 14px; margin-left: 6px; }
.tr-mode-hint { margin: 0 0 0 6px; }

.tr-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.tr-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tr-stats small { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.tr-stats b { font-size: 16px; font-weight: 800; }
.tr-nets { flex: 1 1 100%; }
.tr-nets b { font-size: 13.5px; color: var(--text-2); }

.tr-map { position: relative; border-radius: 18px; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, color-mix(in srgb, var(--primary) 9%, var(--surface-2)), var(--surface-2)); }
.tr-map-wait { height: 300px; display: grid; place-items: center; }
.tr-map-note { position: absolute; left: 14px; bottom: 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.trm { display: block; width: 100%; height: auto; }
.trm-dot { fill: color-mix(in srgb, var(--muted) 22%, transparent); }
.trm-land path { fill: color-mix(in srgb, var(--text) 7%, transparent); stroke: color-mix(in srgb, var(--text) 16%, transparent); stroke-width: .6; }
.trm-arc, .trm-arc-glow { fill: none; stroke: var(--primary); stroke-linecap: round; }
.trm-arc-glow { stroke-width: 6; opacity: .35; }
.trm-arc { stroke-width: 2.4; stroke-dasharray: 6 7; animation: trm-flow 1.2s linear infinite; }
@keyframes trm-flow { to { stroke-dashoffset: -13; } }
.trm-pt { cursor: default; }
.trm-core { fill: var(--surface); stroke: var(--primary); stroke-width: 3; transition: r .15s; }
.trm-pt.is-start .trm-core, .trm-pt.is-end .trm-core { fill: var(--primary); stroke: #fff; stroke-width: 2.5; }
.trm-pt.is-on .trm-core { fill: var(--primary); r: 10; }
.trm-pulse { fill: var(--primary); opacity: .25; transform-origin: center; animation: trm-pulse 2s ease-out infinite; }
@keyframes trm-pulse { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.8); opacity: 0; } }
.trm-label { font-size: 15px; font-weight: 800; fill: var(--text); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; }
.trm-hops { font-size: 12px; font-weight: 700; fill: var(--muted); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; }

.tr-hops { display: flex; flex-direction: column; }
.tr-hop { display: grid; grid-template-columns: 30px minmax(0, 1.3fr) minmax(0, 1.4fr) 52px minmax(120px, 1fr); gap: 12px; align-items: center;
  padding: 8px 10px; border-radius: 12px; font-size: 13px; transition: background .12s; }
.tr-hop + .tr-hop { border-top: 1px solid var(--line); }
.tr-hop.is-on { background: var(--primary-soft); }
.tr-hop.is-net { box-shadow: inset 3px 0 0 var(--primary); }
.tr-hop.is-silent { color: var(--muted); }
.tr-geo-bad { color: var(--text-2); }
.tr-geo-bad s { color: var(--muted); font-weight: 600; }
.tr-geo-ptr { margin-left: 6px; font-size: 10px; color: var(--primary); }
.tr-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-size: 12px; font-weight: 800; }
.tr-ip, .tr-where > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tr-ip b, .tr-where b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-ip small, .tr-where small { font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-where { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-where > span:first-child { font-size: 17px; }
.tr-loss { font-weight: 700; color: var(--muted); text-align: right; }
.tr-loss.is-warn { color: var(--amber); }
.tr-loss.is-bad { color: var(--red); }
.tr-ms { display: flex; align-items: center; gap: 10px; }
.tr-ms b { min-width: 64px; text-align: right; font-weight: 800; }
.tr-bar { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.tr-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 50%, transparent), var(--primary)); }
@media (max-width: 900px) {
  .tt-modes { grid-template-columns: minmax(0, 1fr); }
  .tr-probe-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-hop { grid-template-columns: 30px minmax(0, 1fr) 70px; }
  .tr-where, .tr-loss { display: none; }
  .tr-ms .tr-bar { display: none; }
}

/* Загрузка: три точки вместо кружка, появляются с задержкой — быстрые ответы не мелькают */
.dots { display: inline-flex; align-items: center; gap: 9px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--primary);
  box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 60%, transparent); animation: dots-wave 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .16s; }
.dots i:nth-child(3) { animation-delay: .32s; }
@keyframes dots-wave { 0%, 80%, 100% { transform: translateY(0) scale(.6); opacity: .35; } 40% { transform: translateY(-7px) scale(1); opacity: 1; } }
.loader { display: grid; place-items: center; min-height: 55vh; animation: loader-in .3s ease .18s both; }
.loader.is-compact { min-height: 140px; }
@keyframes loader-in { from { opacity: 0; } }
.boot .dots, .tt-run-wait .dots, .tr-map-wait .dots { animation: loader-in .3s ease .18s both; }
@media (prefers-reduced-motion: reduce) { .dots i { animation-duration: 2.4s; } }
.tt-main { transition: opacity .2s; }
.tt-main.is-switching { opacity: .5; pointer-events: none; }
/* Карточка нод тянется по высоте правой части, но список и подсказка стоят на месте — при переключении ничего не ездит */
.tt-list { flex: 0 1 auto; }

/* ---------- Аккаунты: строки с раскрытием ---------- */
.acc-rows { display: flex; flex-direction: column; gap: 10px; }
.card.acc-row { padding: 0; gap: 0; overflow: hidden; transition: box-shadow .2s; }
.card.acc-row.is-open { box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.acc-row-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 150px 120px 150px 18px; align-items: center; gap: 16px;
  width: 100%; padding: 12px 20px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.acc-row-head:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.acc-row-head .fav { width: 40px; height: 40px; padding: 7px; border-radius: 12px; }
.acc-row-title, .acc-row-state, .acc-row-bal, .acc-row-mon { display: flex; flex-direction: column; min-width: 0; }
.acc-row-title b { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-row-title small, .acc-row-state small, .acc-row-bal small, .acc-row-mon small {
  font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-row-err { color: var(--red); font-size: 15px; }
.acc-row-err.fa-cloud-bolt { color: var(--amber); }
.acc-row-state b { font-size: 13px; font-weight: 800; white-space: nowrap; }
.acc-row-state.lvl-ok b { color: var(--primary); }
.acc-row-state.lvl-warn b { color: var(--amber); }
.acc-row-state.lvl-danger b { color: var(--red); }
.acc-row-state.lvl-muted b { color: var(--text-2); }
.acc-row-mon { font-size: 13px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-row-bal { align-items: flex-end; text-align: right; }
.acc-row-bal b { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-row-chev { color: var(--muted); font-size: 12px; transition: transform .2s; }
.acc-row.is-open .acc-row-chev { transform: rotate(180deg); color: var(--primary); }
.acc-row-body { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 16px 20px; padding: 4px 20px 18px;
  border-top: 1px solid var(--border-soft); padding-top: 18px; }
.acc-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.acc-col > .charges:first-child, .acc-col > .prov-usage:first-child { margin-top: 0; }
.acc-row-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.acc-row .acc-row-foot .prov-actions { margin-top: 0; }
.acc-row .acc-row-foot .prov-actions .btn-primary { flex: none; min-width: 180px; }
@media (max-width: 1100px) {
  .acc-row-head { grid-template-columns: 40px minmax(0, 1fr) auto 130px 130px 18px; }
  .acc-row-mon { display: none; }
}
@media (max-width: 860px) { .acc-row-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .acc-row-head { grid-template-columns: 36px minmax(0, 1fr) auto auto 14px; gap: 10px; padding: 12px 14px; }
  .acc-row-head .fav { width: 36px; height: 36px; padding: 6px; }
  .acc-row-state { display: none; }
  .acc-row-body { padding: 14px; }
  .acc-row .acc-row-foot .prov-actions { width: 100%; }
  .acc-row .acc-row-foot .prov-actions .btn-primary { flex: 1; min-width: 0; }
}
