/* OPLOT panel — monochrome dark, framed layout (HOSTIVA style). */
:root {
    --page: #000;
    --frame: #0a0a0a;
    --card: #0d0d0d;
    --card-hi: #141414;
    --hover: #171717;
    --active: #1c1c1c;
    --line: #1f1f1f;
    --line-hi: #2a2a2a;
    --text: #fafafa;
    --muted: #a3a3a3;
    --faint: #6b6b6b;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
    --radius: 16px;
    --display: "Unbounded", "Manrope", system-ui, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font-family: "Manrope", system-ui, sans-serif; font-weight: 500; font-size: 14.5px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Boot / login ───────────────────────────────────────────────────── */
.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-hi); border-top-color: var(--text); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card { width: min(420px, 100%); background: var(--frame); border: 1px solid var(--line); border-radius: 24px; padding: 40px 32px; text-align: center; }
.mark { width: 44px; height: 44px; border-radius: 12px; background: #fff; color: #000; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 15px; flex: none; overflow: hidden; }
.mark img { width: 100%; height: 100%; object-fit: cover; }
.login-card .mark { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; margin: 0 auto 20px; }
.login-card h1 { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0 0 10px; }
.login-card p { color: var(--muted); line-height: 1.55; margin: 0 0 26px; }
.login-error { margin-top: 16px; color: var(--red); font-size: 13.5px; }

/* ── Buttons & pills ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line-hi); background: transparent; border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 13.5px; transition: background 0.15s, border-color 0.15s, transform 0.1s; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--hover); border-color: #333; }
.btn:active { transform: scale(0.98); }
.btn.white { background: #fff; color: #000; border-color: #fff; }
.btn.white:hover { background: #e5e5e5; }
.btn.red { border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.btn.red:hover { background: rgba(239, 68, 68, 0.12); }
.btn.green { border-color: rgba(34, 197, 94, 0.45); color: #86efac; }
.btn.green:hover { background: rgba(34, 197, 94, 0.1); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; padding: 13px 22px; font-size: 14.5px; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
kbd { font-family: "Manrope", sans-serif; font-size: 11px; color: var(--faint); border: 1px solid var(--line-hi); border-radius: 6px; padding: 2px 6px; }

/* ── Frame layout ───────────────────────────────────────────────────── */
body:has(.frame) { padding: 16px; }
.frame { display: grid; grid-template-columns: 250px 1fr; max-width: 1640px; min-height: calc(100vh - 32px); margin: 0 auto; background: var(--frame); border: 1px solid var(--line); border-radius: 24px; overflow: clip; } /* clip, not hidden: keeps the sticky top bar working */
.frame.collapsed { grid-template-columns: 72px 1fr; }

.side { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; max-height: calc(100vh - 34px); position: sticky; top: 16px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; }
.brand b { display: block; font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.brand small { display: flex; align-items: center; gap: 4px; color: var(--green); font-weight: 700; font-size: 12px; margin-top: 3px; }
.brand small svg.i { width: 13px; height: 13px; }
.guild-switch { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.guild-switch img, .guild-switch .gi { width: 26px; height: 26px; border-radius: 8px; flex: none; }
.gi { display: grid; place-items: center; background: var(--active); font-weight: 800; font-size: 12px; }
.guild-switch select { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; font-weight: 700; font-size: 13px; }
.guild-switch select option { background: var(--card); }
.nav-label { margin: 16px 10px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.nav { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; text-align: left; text-decoration: none; }
.nav:hover { background: var(--hover); color: var(--text); }
.nav.active { background: var(--active); color: var(--text); }
.nav .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.nav .dot.on { background: var(--green); }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 14px 4px; width: calc(100% - 8px); }
.side .spacer { flex: 1; min-height: 10px; }
.frame.collapsed .side .brand > div:last-child, .frame.collapsed .nav-label, .frame.collapsed .nav span.t, .frame.collapsed .nav .dot, .frame.collapsed .guild-switch select { display: none; }
.frame.collapsed .nav { justify-content: center; }
.frame.collapsed .guild-switch { justify-content: center; padding: 7px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(10, 10, 10, 0.85); backdrop-filter: blur(10px); z-index: 10; }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; min-width: 0; }
.crumbs span { color: var(--muted); }
.crumbs b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .grow { flex: 1; }
.search-btn { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 8px 10px 8px 14px; border: 1px solid var(--line-hi); border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.search-btn:hover { border-color: #333; color: var(--text); }
.search-btn kbd { margin-left: auto; }
.content { padding: 28px clamp(16px, 3vw, 34px) 120px; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.01em; }
.page-head h1 svg.i { width: 30px; height: 30px; stroke-width: 1.7; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 15px; max-width: 760px; line-height: 1.5; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

/* ── Cards ──────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 800; }
.card h3 small { margin-left: auto; color: var(--faint); font-weight: 600; font-size: 12.5px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wide { grid-column: 1 / -1; }
.stack { display: grid; gap: 16px; }

.hero { display: grid; gap: 0; padding: 0; }
.hero-row { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.hero-row + .hero-row { border-top: 1px solid var(--line); }
.hero-row > div:not(.circle) { flex: 1 1 200px; min-width: 0; }
.hero-row b { display: block; font-family: var(--display); font-weight: 700; font-size: 15px; }
.hero-row span.sub { display: block; color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.hero-row .btn { margin-left: auto; }
.circle { width: 38px; height: 38px; border-radius: 50%; background: var(--active); display: grid; place-items: center; flex: none; color: var(--text); }
.circle.red { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.circle.green { background: rgba(34, 197, 94, 0.14); color: #86efac; }

.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.stat .circle { margin-bottom: 16px; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.stat span { display: block; color: var(--muted); margin-top: 10px; font-weight: 600; }
.stat.line b { font-size: 26px; margin-top: 10px; }
.stat.line span { margin-top: 0; }
.g { color: var(--green); } .r { color: var(--red); } .a { color: var(--amber); }
.stats-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.alert { display: flex; align-items: center; gap: 12px; border-radius: var(--radius); padding: 14px 18px; border: 1px solid; font-weight: 600; }
.alert.amber { background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.35); }
.alert.red { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4); }
.alert .btn { margin-left: auto; }

/* Lists */
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); min-width: 0; }
.list-row:first-child { border-top: 0; }
.list-row .t { min-width: 0; flex: 1; }
.list-row .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .t p { margin: 3px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.list-row time { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.ava { width: 34px; height: 34px; border-radius: 50%; background: var(--active); flex: none; object-fit: cover; }
.ava.lg { width: 72px; height: 72px; }
.place { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 12px; background: var(--active); flex: none; }
.place.p1 { background: #fff; color: #000; }
.empty { color: var(--faint); padding: 10px 0; }

/* ── Fields ─────────────────────────────────────────────────────────── */
.field { padding: 14px 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; padding-top: 0; }
.field:last-child { padding-bottom: 0; }
.field .label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 9px; }
.field.changed .label::after { content: " • изменено"; color: var(--amber); }
.field .err { color: #fca5a5; font-size: 12.5px; margin-top: 7px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 600; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-hi); transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #737373; transition: transform 0.2s, background 0.2s; }
.switch input:checked + i { background: #fff; }
.switch input:checked + i::after { transform: translateX(18px); background: #000; }
.switch input:focus-visible + i { outline: 2px solid #fff; outline-offset: 2px; }

.input { width: 100%; background: transparent; border: 1px solid var(--line-hi); border-radius: 999px; padding: 10px 16px; outline: none; font-weight: 600; transition: border-color 0.15s; }
.input:focus { border-color: #555; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
select.input option, select.input optgroup { background: var(--card); }
textarea.input { border-radius: 14px; min-height: 110px; resize: vertical; line-height: 1.55; font-weight: 500; }
textarea.words { min-height: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.suffix { display: flex; align-items: center; gap: 10px; }
.suffix span { color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.hint { color: var(--faint); font-size: 12.5px; margin-top: 7px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-hi); border-radius: 999px; padding: 5px 7px 5px 12px; font-size: 12.5px; font-weight: 700; background: transparent; color: var(--text); }
.chip img { width: 18px; height: 18px; border-radius: 50%; }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.chip .x { border: 0; background: transparent; color: var(--faint); font-size: 15px; line-height: 1; padding: 0 3px; }
.chip .x:hover { color: var(--red); }
.chip.pick { padding: 7px 13px; color: var(--muted); }
.chip.pick:hover { border-color: #444; color: var(--text); }
.chip.pick.on { background: #fff; border-color: #fff; color: #000; }
.search-wrap { position: relative; }
.results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); background: var(--card-hi); border: 1px solid var(--line-hi); border-radius: 14px; max-height: 260px; overflow-y: auto; padding: 4px; }
.results button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; text-align: left; }
.results button:hover { background: var(--hover); }
.results img { width: 24px; height: 24px; border-radius: 50%; }
.rows { display: grid; gap: 8px; margin-bottom: 12px; }
.row-item { display: grid; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.row-item.level { grid-template-columns: 120px 1fr 34px; }
.row-item.shop { grid-template-columns: 1.3fr 0.8fr 0.7fr 1.5fr 34px; }
.row-labels { display: grid; grid-template-columns: 1.3fr 0.8fr 0.7fr 1.5fr 34px; gap: 8px; padding: 0 11px 6px; color: var(--faint); font-size: 12px; font-weight: 700; }

/* ── Members table ──────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .input { max-width: 320px; }
.toolbar .count { margin-left: auto; color: var(--faint); font-weight: 700; }
.table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tr { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(160px, 2fr) 80px 100px 70px 110px; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.tr.head { border-top: 0; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 14px; padding-bottom: 10px; }
.tr.click { cursor: pointer; }
.tr.click:hover { background: var(--hover); }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who div { min-width: 0; }
.who b { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roles-mini { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }
.rpill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line-hi); border-radius: 999px; padding: 2px 9px 2px 7px; font-size: 11.5px; font-weight: 700; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpill .sw { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.num { font-family: var(--display); font-weight: 700; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11.5px; font-weight: 800; }
.badge.red { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }
.badge.amber { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.badge.pink { background: rgba(244, 114, 182, 0.14); color: #f9a8d4; }
.badge.grey { background: var(--active); color: var(--muted); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; color: var(--muted); font-weight: 700; }
.mono { color: var(--faint); font-size: 12.5px; white-space: nowrap; }

/* ── Drawer ─────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 40; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(520px, calc(100% - 24px)); background: var(--frame); border: 1px solid var(--line-hi); border-radius: 20px; z-index: 41; overflow-y: auto; animation: slide 0.2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; gap: 16px; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-head h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.drawer-head p { margin: 5px 0 0; color: var(--faint); font-size: 12.5px; }
.drawer-head .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.drawer-head .icon-btn { position: absolute; top: 14px; right: 14px; }
.drawer-body { padding: 18px 22px 30px; display: grid; gap: 18px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-stats div { border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.mini-stats b { display: block; font-family: var(--display); font-weight: 700; font-size: 18px; }
.mini-stats span { color: var(--faint); font-size: 12px; font-weight: 700; }
.act-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.act-form { border: 1px solid var(--line-hi); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.act-form .row { display: flex; gap: 8px; }
.section-t { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }

/* ── Palette, save bar, toasts ──────────────────────────────────────── */
.palette { position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); background: var(--frame); border: 1px solid var(--line-hi); border-radius: 18px; z-index: 50; overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 16px 18px; outline: none; font-size: 15px; font-weight: 600; }
.palette .opts { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette .opts button { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: transparent; padding: 10px 12px; border-radius: 10px; text-align: left; color: var(--muted); font-weight: 600; }
.palette .opts button.sel, .palette .opts button:hover { background: var(--active); color: var(--text); }
.palette .opts small { margin-left: auto; color: var(--faint); font-size: 12px; }
.savebar { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 160%); display: flex; align-items: center; gap: 10px; background: #111; border: 1px solid var(--line-hi); border-radius: 999px; padding: 8px 8px 8px 20px; z-index: 30; transition: transform 0.25s; width: min(520px, calc(100% - 24px)); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6); }
.savebar.show { transform: translate(-50%, 0); }
.savebar span { flex: 1; font-weight: 700; }
#toasts { position: fixed; top: 18px; right: 18px; display: grid; gap: 8px; z-index: 60; }
.toast { background: #111; border: 1px solid var(--line-hi); border-radius: 14px; padding: 12px 16px; font-weight: 700; max-width: 360px; display: flex; gap: 10px; align-items: center; animation: slide 0.2s; }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.toast.err::before { background: var(--red); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1280px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) {
    .tr { grid-template-columns: minmax(180px, 2fr) 70px 90px 60px; }
    .tr .c-roles, .tr .c-joined { display: none; }
}
@media (max-width: 900px) {
    body:has(.frame) { padding: 0; }
    .frame, .frame.collapsed { grid-template-columns: 1fr; border-radius: 0; border: 0; min-height: 100vh; }
    .side { position: fixed; z-index: 45; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); max-height: none; background: var(--frame); transform: translateX(-105%); transition: transform 0.25s; }
    .frame.nav-open .side { transform: none; }
    .frame.nav-open .scrim { display: block; }
    .search-btn { min-width: 0; }
    .search-btn .t, .search-btn kbd, .top .btn .t { display: none; }
    .cols-2, .stats-3 { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .grid { grid-template-columns: 1fr; }
    .row-item.shop { grid-template-columns: 1fr 1fr; }
    .row-item.shop .desc { grid-column: 1 / -1; }
    .row-labels { display: none; }
    .content { padding-top: 20px; }
}
@media (max-width: 560px) {
    .tr { grid-template-columns: 1fr 60px 50px; }
    .tr .c-coins { display: none; }
    .mini-stats { grid-template-columns: repeat(2, 1fr); }
    .savebar { border-radius: 18px; flex-wrap: wrap; padding: 10px; }
    .savebar span { flex-basis: 100%; text-align: center; }
    .savebar .btn { flex: 1; }
    .hero-row { flex-wrap: wrap; }
    .hero-row .btn { margin-left: 52px; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 44; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.list-row.click { cursor: pointer; border-radius: 10px; }
.list-row.click:hover { background: var(--hover); }

/* ── Compact pass (matches the HOSTIVA admin density) ───────────────── */
html, body { font-size: 14px; }
@media (min-width: 901px) {
    .frame { grid-template-columns: 236px 1fr; max-width: 1600px; }
    .search-btn { min-width: 190px; }
}
.side { padding: 16px 10px; gap: 1px; scrollbar-width: none; }
.side::-webkit-scrollbar { width: 0; }
/* Sidebar scrolls with the wheel, without a visible scrollbar. */
.brand { gap: 10px; padding: 2px 8px 12px; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.brand b { font-size: 12px; }
.brand small { font-size: 11.5px; margin-top: 2px; }
.guild-switch { gap: 8px; margin: 0 2px 8px; padding: 5px 8px; border-radius: 10px; }
.guild-switch img, .guild-switch .gi { width: 22px; height: 22px; border-radius: 6px; }
.guild-switch select { font-size: 12.5px; }
.nav { gap: 10px; padding: 7px 10px; font-size: 13px; border-radius: 9px; }
.nav svg.i { width: 16px; height: 16px; }
.nav-label { margin: 12px 10px 4px; font-size: 10px; }
.side hr { margin: 8px 4px; }
.side .spacer { min-height: 4px; }
.top { height: 56px; padding: 0 18px; }
.search-btn { padding: 7px 10px 7px 13px; font-size: 13px; }
.top .btn { padding: 7px 14px; font-size: 13px; }
.content { padding: 24px clamp(16px, 2.6vw, 30px) 110px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: clamp(24px, 3vw, 30px); }
.page-head h1 svg.i { width: 26px; height: 26px; }
.page-head p { font-size: 14px; margin-top: 6px; }
.card { padding: 18px; }
.hero-row { padding: 16px 20px; }
.hero-row b { font-size: 14px; }
.hero-row span.sub { font-size: 13px; }
.circle { width: 34px; height: 34px; }
.circle svg.i { width: 16px; height: 16px; }
.stat { padding: 18px; }
.stat .circle { margin-bottom: 14px; }
.stat b { font-size: 26px; }
.stat span { margin-top: 8px; font-size: 13.5px; }
.stat.line b { font-size: 22px; margin-top: 8px; }
.stats, .stats-3, .cols-2, .grid, .stack { gap: 14px; }
.list-row { padding: 9px 4px; }
.tr { padding: 10px 16px; }
.nav-label.fold { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 20px); border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; font-family: inherit; }
.nav-label.fold:hover { color: var(--muted); }
.nav-label.fold svg.i { width: 13px; height: 13px; transition: transform 0.2s; }
.nav-label.fold.closed svg.i { transform: rotate(-90deg); }

/* ── Billing, locks, admin ───────────────────────────────────────────── */
.nav .lock { margin-left: auto; color: var(--faint); display: grid; }
.nav .lock svg.i { width: 13px; height: 13px; }
.badge.green { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.block-title { font-family: var(--display); font-size: 16px; font-weight: 700; margin: 10px 0 0; }
.locked-card { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.locked-card h2 { font-family: var(--display); font-size: 22px; margin: 6px 0 0; }
.locked-card p { color: var(--muted); max-width: 520px; line-height: 1.55; margin: 0; }
.locked-offers { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.locked-offers > div { border: 1px solid var(--line-hi); border-radius: 14px; padding: 12px 18px; display: grid; gap: 4px; }
.locked-offers b { font-family: var(--display); font-size: 18px; }
.locked-offers small, .price small { font-family: "Manrope", sans-serif; color: var(--faint); font-size: 12px; font-weight: 600; margin-left: 2px; }
.locked-offers span { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan.featured { border-color: #3a3a3a; background: linear-gradient(180deg, #141414, var(--card)); }
.plan-head { display: flex; align-items: center; gap: 8px; }
.plan-head b { font-family: var(--display); font-size: 16px; }
.price { font-family: var(--display); font-weight: 800; font-size: 28px; }
.price.sm { font-size: 18px; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plan li svg.i { width: 15px; height: 15px; color: var(--green); }
.plan li.off { color: var(--faint); }
.plan li.off svg.i { color: var(--faint); }
.plan .btn { width: 100%; }
.module { display: flex; flex-direction: column; gap: 10px; }
.module-head { display: flex; align-items: center; gap: 10px; }
.module-head b { font-weight: 800; }
.module-head .badge { margin-left: auto; }
.module-ico { font-size: 20px; }
.module p { color: var(--muted); margin: 0; line-height: 1.5; flex: 1; }
.module-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.palette.pay .pay-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette.pay .opts button { padding: 14px 12px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.price-item { display: grid; gap: 6px; }
.price-item span { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.price-item .row { display: flex; gap: 6px; }
.table.flat { border: 0; background: transparent; }
.tr.admin { grid-template-columns: minmax(220px, 2fr) 160px minmax(160px, 2fr) 110px; }
@media (max-width: 900px) {
    .plans { grid-template-columns: 1fr; }
    .tr.admin { grid-template-columns: 1fr auto; }
    .tr.admin > div:nth-child(2), .tr.admin > div:nth-child(3) { display: none; }
}

/* ── First steps (overview) ─────────────────────────────────────────── */
.circle.amber { background: rgba(245, 158, 11, 0.14); color: #fcd34d; }
.setup-row .t b { display: flex; align-items: center; gap: 8px; white-space: normal; }
.setup-row.ok .t b { color: var(--muted); }
.setup-row .btn { flex: none; }
button.link { border: 0; background: none; padding: 0; color: var(--muted); font-weight: 700; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
button.link:hover { color: var(--text); }

/* ── Public landing & server picker ─────────────────────────────────── */
.land { max-width: 1120px; margin: 0 auto; padding: 0 16px 60px; }
.land-top { display: flex; align-items: center; gap: 10px; padding: 18px 0; }
.land-top .brand { padding: 0; }
.land-top .grow { flex: 1; }
.land-top .who { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.land-top .who .ava { width: 28px; height: 28px; }
.land-hero { text-align: center; padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 80px); display: grid; justify-items: center; gap: 18px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-hi); border-radius: 999px; padding: 6px 14px; color: var(--muted); font-weight: 700; font-size: 13px; }
.eyebrow svg.i { width: 15px; height: 15px; color: var(--green); }
.land-hero h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 58px); line-height: 1.08; letter-spacing: -0.02em; max-width: 880px; }
.land-hero p { margin: 0; color: var(--muted); font-size: clamp(15px, 1.8vw, 17px); line-height: 1.6; max-width: 640px; }
.land-cta { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.btn.lg { padding: 13px 24px; font-size: 15px; }
.land-note { color: var(--faint); font-weight: 600; font-size: 13px; }
p.land-note { text-align: center; margin: 14px 0 0; }
.land-sec { padding: 26px 0; display: grid; gap: 16px; }
.land-sec h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(22px, 3vw, 28px); }
.land-sec .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.muted { color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { display: grid; gap: 8px; align-content: start; }
.step-n { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; font-family: var(--display); font-weight: 800; }
.step b { font-family: var(--display); font-size: 15px; margin-top: 6px; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; }
.land-foot { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 20px; color: var(--faint); font-size: 13px; }
.center-spin { margin: 0 auto 18px; }

.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.srv { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.srv img, .srv .gi { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.srv .t { flex: 1; min-width: 0; }
.srv .t b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srv .t span { color: var(--muted); font-size: 13px; }
.srv-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.srv-foot .muted { font-size: 13px; }

@media (max-width: 900px) {
    .steps { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .land-top .who { display: none; }
    .land-sec .grid, .srv-grid { grid-template-columns: 1fr; }
    .setup-row { flex-wrap: wrap; }
    .setup-row .btn { margin-left: 50px; }
}

/* ── List of cards (topics, forms, servers) ─────────────────────────── */
.items { display: grid; gap: 10px; margin-bottom: 12px; }
.item-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; background: var(--card-hi); }
.item-head { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.item-head b { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-head .grow { flex: 1; }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 12px; }
.item-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.item-field.wide { grid-column: 1 / -1; }
.item-field .label { font-size: 12px; color: var(--muted); font-weight: 700; }
.item-field textarea.input { min-height: 90px; }

/* ── Module cards ───────────────────────────────────────────────────── */
.publish-row { gap: 10px; flex-wrap: wrap; }
.publish-row select { flex: 1 1 220px; width: auto; }
.publish-row .btn { margin-left: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.card > .btn-row { margin-top: 16px; }
.brand-preview { padding: 0; overflow: hidden; }
.brand-banner { height: 120px; background: linear-gradient(135deg, #1c1c1c, #2a2a2a); background-size: cover; background-position: center; }
.brand-body { padding: 0 20px 20px; display: grid; justify-items: start; gap: 6px; }
.brand-ava { width: 88px; height: 88px; border-radius: 50%; border: 6px solid var(--card); margin-top: -44px; object-fit: cover; background: var(--active); }
.brand-body b { font-family: var(--display); font-size: 18px; }
.brand-body p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .cols-2.wide { grid-template-columns: 1fr; } }

/* "Подключить модули" under the menu: sections of unbought modules are hidden */
.nav.more-modules { color: var(--faint); margin-top: 6px; }
.nav.more-modules:hover { color: var(--text); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 800; color: var(--faint); border: 1px solid var(--line-hi); border-radius: 999px; padding: 1px 7px; }
.frame.collapsed .nav .count { display: none; }

/* ── Our own dropdowns (replace the browser's grey <select> list) ───── */
.fsel { position: relative; min-width: 0; }
.fsel-native { display: none !important; }
.fsel-btn { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; background: transparent; border: 1px solid var(--line-hi); border-radius: 999px; padding: 10px 14px 10px 16px; font-weight: 600; text-align: left; transition: border-color 0.15s, background 0.15s; }
.fsel-btn:hover { border-color: #3a3a3a; background: var(--hover); }
.fsel.open .fsel-btn { border-color: #fff; }
.fsel-btn:disabled { opacity: 0.5; pointer-events: none; }
.fsel-btn svg.i { width: 15px; height: 15px; color: var(--muted); margin-left: auto; transition: transform 0.15s; }
.fsel.open .fsel-btn svg.i { transform: rotate(180deg); }
.fsel-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsel-text.muted { color: var(--faint); }
.guild-switch .fsel { flex: 1; }
.guild-switch .fsel-btn { border: 0; padding: 0; background: none; font-weight: 700; font-size: 13px; }
.guild-switch .fsel-btn:hover { background: none; }

.fsel-pop { position: fixed; z-index: 100; background: #181818; border: 1px solid #333; border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65); padding: 6px; display: grid; gap: 6px; animation: pop-in 0.12s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.fsel-search { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; outline: none; font-weight: 600; }
.fsel-search:focus { border-color: var(--line-hi); }
.fsel-list { max-height: 280px; overflow-y: auto; display: grid; gap: 1px; scrollbar-width: thin; scrollbar-color: #2a2a2a transparent; }
.fsel-opt { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; text-align: left; font-weight: 600; font-size: 13.5px; color: var(--text); }
.fsel-opt span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsel-opt.active { background: #262626; }
.fsel-opt.selected { color: #fff; }
.fsel-opt.muted { color: var(--faint); }
.fsel-opt:disabled { color: var(--faint); opacity: 0.55; cursor: not-allowed; }
.fsel-opt svg.i { width: 15px; height: 15px; color: var(--green); }
.fsel-empty { color: var(--faint); padding: 10px; font-size: 13px; }

/* ── Settings page: one main card ───────────────────────────────────── */
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.toggles .field { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.toggles .field.changed { border-color: rgba(245, 158, 11, 0.45); }
.toggles + .fields-grid { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.fields-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px 20px; align-items: start; }
.fields-grid .field, .fields-grid .field:first-of-type { border: 0; padding: 0; }
.stack > .card.hero + .card.hero { margin-top: 0; }

/* Sidebar "connect modules" never wraps */
.nav.more-modules .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Thin dark scrollbars everywhere instead of the bright default ones */
* { scrollbar-width: thin; scrollbar-color: #262626 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #262626; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }
.publish-row .fsel { flex: 1 1 220px; }

/* ── Owner admin ────────────────────────────────────────────────────── */
.stats.admin-kpi { grid-template-columns: repeat(4, 1fr); }
.input.sm { padding: 7px 14px; font-size: 13px; width: 220px; }
.admin-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) 150px minmax(240px, 1.4fr) auto; gap: 16px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); }
.admin-row.head { border-top: 0; padding-top: 0; color: var(--faint); font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.admin-rows .admin-row:last-child { padding-bottom: 0; }
.plan-cell { display: grid; justify-items: start; gap: 4px; }
.plan-cell small { color: var(--faint); font-size: 12px; font-weight: 600; }
.mod-icons { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mod-ico { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; filter: grayscale(1); opacity: 0.3; }
.mod-ico.on { filter: none; opacity: 1; border-color: var(--line-hi); background: var(--card-hi); }
.mod-icons small { margin-left: 6px; color: var(--muted); font-weight: 700; font-size: 12px; }

.admin-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.nav-label.flat { margin: 14px 0 4px; }
.card h3 + .nav-label.flat { margin-top: 0; }
.price-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.nav-label.flat + .price-row { border-top: 0; }
.price-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--card-hi); border: 1px solid var(--line); display: grid; place-items: center; font-size: 16px; flex: none; }
.price-row .t { flex: 1; min-width: 0; }
.price-row .t b { display: block; font-weight: 700; }
.price-row .t small { color: var(--faint); font-size: 12px; }
.price-input { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-hi); border-radius: 999px; padding: 6px 14px; width: 118px; transition: border-color 0.15s; }
.price-input:focus-within { border-color: #fff; }
.price-input input { width: 100%; min-width: 0; background: none; border: 0; outline: none; font-weight: 800; font-size: 14px; text-align: right; -moz-appearance: textfield; }
.price-input input::-webkit-inner-spin-button, .price-input input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.price-input span { color: var(--faint); font-weight: 700; }
.price-row.changed .price-input { border-color: rgba(245, 158, 11, 0.6); }

.empty-state { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 28px 10px; }
.empty-state .circle { margin-bottom: 4px; }
.empty-state p { margin: 0; color: var(--muted); max-width: 340px; line-height: 1.5; font-size: 13.5px; }

@media (max-width: 1100px) {
    .admin-cols { grid-template-columns: 1fr; }
    .stats.admin-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .admin-row { grid-template-columns: 1fr auto; }
    .admin-row > :nth-child(2), .admin-row > :nth-child(3) { display: none; }
    .input.sm { width: 150px; }
}

/* ── Game servers: rows with status-bot controls ────────────────────── */
.game-row { flex-wrap: wrap; }
.game-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card .hint { margin: 12px 0 0; }
.howto-step { display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; color: var(--muted); }
.howto-step .step-n { width: 26px; height: 26px; font-size: 12px; flex: none; }
.howto-step b { color: var(--text); }
.howto-step a { color: #fff; }
.drawer-body .muted { line-height: 1.55; }
.drawer-body > .btn { justify-self: start; }
.admin-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
