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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(145deg, #000000 0%, #0d0d0d 30%, #1a1a1a 60%, #0a0a0a 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

.error-banner {
    position: fixed;
    z-index: 10000;
    top: 14px;
    left: 50%;
    width: min(560px, calc(100% - 28px));
    transform: translateX(-50%);
    padding: 11px 14px;
    border: 1px solid #7f1d1d;
    border-radius: 8px;
    color: #fecaca;
    background: rgba(69, 10, 10, 0.96);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.error-banner.hidden {
    display: none;
}

.hidden {
    display: none;
}

.app {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid #2a2a2a;
}

.header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background: linear-gradient(180deg, #1f1f1f, #141414);
    border: 1px solid #333;
    color: #aaa;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-btn:hover {
    border-color: #555;
    color: #fff;
}

.nav-btn.active {
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
    border-color: #666;
    color: #fff;
}

/* Do not reveal tracker-restricted navigation while /auth/me is loading. */
body.role-pending [data-tracker-hidden] {
    visibility: hidden;
    pointer-events: none;
}

.tab {
    display: none;
}

.tab.active {
    display: block;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

input[type="text"],
input[type="password"] {
    background: linear-gradient(180deg, #111, #0a0a0a);
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: #555;
}

button {
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
    border: 1px solid #444;
    color: #ddd;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

button:hover {
    background: linear-gradient(180deg, #333, #222);
    border-color: #666;
    color: #fff;
}

.bot-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(135deg, #141414, #0d0d0d);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 14px 18px;
    cursor: context-menu;
    outline: none;
}

.bot-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.bot-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bot-name {
    font-weight: 500;
    font-size: 1rem;
}

.bot-status {
    font-size: 0.8rem;
    color: #888;
}

.bot-status.online { color: #4ade80; }
.bot-status.connecting { color: #facc15; }
.bot-status.error { color: #f87171; }
.bot-status.banned { color: #fb923c; }

.ban-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid #ef4444;
    border-radius: 4px;
    color: #fecaca;
    background: #5f1717;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    vertical-align: 1px;
}

.mc-ver-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 5px;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #94a3b8;
    background: #1e293b;
    font-size: 0.65rem;
    font-weight: 600;
    vertical-align: 1px;
}

.bot-leave-wait {
    display: block;
    font-size: 0.78rem;
    color: #fb923c;
    margin-top: 2px;
}

.bot-coords {
    font-size: 0.78rem;
    color: #666;
    font-family: Consolas, monospace;
}

.bot-stats {
    font-size: 0.78rem;
    color: #888;
}

.proxy-tag {
    font-size: 0.65rem;
    color: #888;
    border: 1px solid #333;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s;
}

.proxy-tag:hover {
    color: #4ade80;
    border-color: #4a6a4a;
    background: #1a2a1a;
}

.proxy-add-btn {
    margin-left: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.65rem;
    cursor: pointer;
    text-decoration: underline;
}

.proxy-add-btn:hover {
    color: #4ade80;
}

.proxy-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.proxy-modal-head h2 {
    margin: 0;
}

.proxy-edit-btn {
    border: 1px solid #333;
    background: #111;
    color: #aaa;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.proxy-edit-btn:hover:not(:disabled) {
    color: #4ade80;
    border-color: #4a6a4a;
}

.proxy-edit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.proxy-edit-hint {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #fbbf24;
}

.proxy-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.proxy-view-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #0a0a0a;
    font-size: 0.85rem;
    color: #888;
}

.proxy-inline-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: #ddd;
    font-family: Consolas, monospace;
    font-size: 0.85rem;
    text-align: right;
    padding: 0;
    outline: none;
    box-shadow: none;
}

.proxy-inline-input::placeholder {
    color: #555;
}

.proxy-inline-input:disabled {
    color: #666;
    opacity: 0.7;
}

.proxy-inline-input.proxy-inline-edit:not(:disabled) {
    color: #fff;
    border-bottom: 1px solid #333;
    padding-bottom: 2px;
}

.proxy-inline-input.proxy-inline-edit:focus {
    border-bottom-color: #4a6a4a;
}

.bot-actions {
    display: flex;
    gap: 8px;
}

.bot-actions button {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-danger {
    border-color: #5c2020;
    color: #f87171;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #3a1515, #2a1010);
    border-color: #7a3030;
}

.empty {
    text-align: center;
    color: #555;
    padding: 40px;
    font-size: 0.9rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.settings-form button {
    margin-top: 16px;
}

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

.settings-actions button {
    margin-top: 0;
    flex: 1;
    min-width: 140px;
}

.autoreg-settings-block {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(145deg, #000000 0%, #0a0a0a 35%, #141414 70%, #050505 100%);
    border: 1px solid #1f1f1f;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 6px 20px rgba(0, 0, 0, 0.5);
}

.autoreg-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.autoreg-settings-title {
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(90deg, #ffffff, #777777);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.autoreg-switch {
    flex-shrink: 0;
}

.autoreg-settings-desc {
    margin: 0 0 14px;
    font-size: 0.78rem;
    color: #666;
}

.autoreg-field-label {
    display: block;
    margin: 10px 0 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #888;
}

.autoreg-field {
    width: 100%;
    padding: 10px 12px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88rem;
    color: #e8e8e8;
    background: linear-gradient(180deg, #000000 0%, #0a0a0a 50%, #050505 100%);
    border: 1px solid #262626;
    border-radius: 8px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.55);
}

.autoreg-field:focus {
    border-color: #3a3a3a;
    outline: none;
}

.settings-form label {
    font-size: 0.85rem;
    color: #888;
}

.settings-form input {
    width: 100%;
}

.settings-form button {
    align-self: flex-start;
}

.autosell-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.autosell-toolbar-hint {
    margin-bottom: 16px;
}

.autosell-queues {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.autosell-queue-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.autosell-queue-card.running {
    border-color: #3a7bd5;
}

.autosell-queue-card.collapsed {
    padding-bottom: 10px;
}

.autosell-queue-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.autosell-queue-name {
    flex: 1;
    min-width: 120px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    color: inherit;
    padding: 4px 0;
}

.autosell-collapse {
    width: 32px;
    min-width: 32px;
    padding: 5px;
    font-size: 18px;
    line-height: 1;
}

.autosell-queue-body {
    display: grid;
    gap: 8px;
    overflow: hidden;
}

.autosell-queue-card.collapsed .autosell-queue-body {
    display: none;
}

.autosell-queue-status {
    font-size: 13px;
    color: var(--muted);
    margin: 8px 0;
}

.autosell-queue-status.running {
    color: #6eb5ff;
}

@media (max-width: 760px) {
    .app {
        padding: 14px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .header h1 {
        font-size: 1.35rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav-btn {
        flex: 1 1 auto;
        min-width: calc(33.33% - 6px);
        text-align: center;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .toolbar {
        flex-wrap: wrap;
    }

    .toolbar button {
        flex: 1 1 auto;
    }

    .bot-card-main {
        flex-wrap: wrap;
        gap: 10px;
    }

    .bot-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .chat-controls,
    .info-controls,
    .logs-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-input-row {
        flex-wrap: wrap;
    }

    .chat-input-row input {
        min-width: 0;
        width: 100%;
    }

    .settings-form {
        max-width: none;
    }

    .modal-box {
        width: calc(100vw - 24px);
        max-width: 480px;
        margin: 12px;
    }
}

.autosell-panel-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    background: linear-gradient(90deg, #ffffff, #888888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.autosell-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
    margin: 4px 0;
}

.autosell-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    background: #11141b;
    border: 1px solid #292f3d;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #bbb;
}

.autosell-toggle-row .switch {
    flex: 0 0 auto;
}

.autosell-hint {
    font-size: 0.78rem;
    color: #666;
    line-height: 1.4;
    margin-top: 4px;
}

.autosell-nicks-area {
    width: 100%;
    min-height: 160px;
    resize: vertical;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #ddd;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.45;
    box-sizing: border-box;
}

.autosell-proxy-fields.hidden {
    display: none;
}

[data-role="clan-fields"].hidden {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-box {
    background: linear-gradient(145deg, #141414, #0a0a0a);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 22px 22px 18px;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-wide {
    max-width: 360px;
}

#mods-modal .modal-box {
    max-width: 340px;
    padding: 14px 14px 12px;
    gap: 8px;
    max-height: min(72vh, 520px);
}

#mods-modal .modal-box h2 {
    font-size: 0.95rem;
    margin: 0;
}

.mods-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    max-height: min(52vh, 380px);
    padding-right: 2px;
}

.mod-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: #0e0e0e;
    border: 1px solid #222;
    border-radius: 6px;
}

.mod-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.mod-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: #e0e0e0;
    line-height: 1.2;
}

.mod-desc {
    font-size: 0.68rem;
    color: #555;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mod-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.mod-gear-slot {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mod-gear {
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 5px;
    background: transparent;
    border: 1px solid #2a2a2a;
    color: #777;
}

.mod-gear:hover {
    color: #fff;
    border-color: #555;
    background: #1a1a1a;
}

.switch-sm {
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

#mod-settings-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mod-settings-field {
    width: 100%;
    max-width: 100%;
}

.mod-settings-field-sm {
    max-width: 96px;
}

.mod-nicks-area {
    min-height: 88px;
    resize: vertical;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    padding: 8px 10px;
    background: linear-gradient(180deg, #0a0a0a, #050505);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #e0e0e0;
}

.mod-nicks-area:focus {
    border-color: #444;
    outline: none;
}

.mod-nicks-area::placeholder {
    color: #555;
}

.autoleave-friends-block {
    margin-top: 6px;
    padding: 10px;
    border-radius: 8px;
    background: #0a0a0a;
    border: 1px solid #1f1f1f;
}

.autoleave-friends-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #9ca3af;
    background: none;
    -webkit-text-fill-color: unset;
}

.autoleave-friends-area {
    width: 100%;
    min-height: 96px;
    resize: vertical;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.45;
    padding: 8px 10px;
    color: #ececec;
    background: #050505;
    border: 1px solid #262626;
    border-radius: 6px;
}

.autoleave-friends-area:focus {
    border-color: #3a3a3a;
    outline: none;
}

.autoleave-friends-area::placeholder {
    color: #444;
}

.autoleave-friends-hint {
    margin: 6px 0 0;
    font-size: 0.7rem;
    color: #666;
}

.mod-dd {
    min-width: 0;
    max-width: 180px;
}

.mod-seg {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
}

.mod-seg-btn {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
    border-radius: 5px;
    border: 1px solid #2a2a2a;
    background: #121212;
    color: #9ca3af;
    font-size: 0.72rem;
    line-height: 1.2;
    cursor: pointer;
}

.mod-seg-btn:hover {
    border-color: #3a3a3a;
    color: #e5e7eb;
}

.mod-seg-btn.active {
    border-color: #4b5563;
    background: #1a1a1a;
    color: #f3f4f6;
}

#mod-settings-body.autosave-settings {
    gap: 5px;
}

#mod-settings-body.autosave-settings .mod-nicks-area {
    min-height: 64px;
}

#mod-settings-body.autosave-settings .mod-hint {
    margin-top: 2px;
    font-size: 0.68rem;
    line-height: 1.25;
}

.autocmd-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.autocmd-row .autocmd-msg {
    flex: 1;
    min-width: 0;
}

.autocmd-del {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 6px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    cursor: pointer;
}

.autocmd-del:hover {
    color: #f87171;
    border-color: #5a3030;
    background: #1a1010;
}

.btn-add-cmd {
    align-self: flex-start;
    margin-top: 4px;
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
    background: linear-gradient(180deg, #141414, #0a0a0a);
    border: 1px solid #333;
    color: #ccc;
    cursor: pointer;
}

.btn-add-cmd:hover {
    border-color: #4a6a4a;
    color: #4ade80;
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
}

#mod-settings-modal .modal-box {
    max-width: 360px;
    padding: 14px;
    gap: 8px;
    max-height: min(78vh, 560px);
}

.mod-hint {
    font-size: 0.72rem;
    color: #555;
    margin-top: 2px;
}

.modal-box h2 {
    font-size: 1.1rem;
    margin: 0 0 2px;
    color: #ddd;
}

.modal-box label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}

.modal-box > input[type="text"],
.modal-box > input[type="password"] {
    margin-top: 0;
}

.create-ver-seg {
    width: 100%;
    gap: 6px;
    margin-top: 2px;
}

.create-ver-seg .mod-seg-btn {
    padding: 10px 12px;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 8px;
    border: 1px solid #2e2e2e;
    background: linear-gradient(180deg, #161616, #0c0c0c);
    color: #9ca3af;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.create-ver-seg .mod-seg-btn:hover {
    border-color: #454545;
    color: #e5e7eb;
}

.create-ver-seg .mod-seg-btn.active {
    border-color: #4a6a4a;
    background: linear-gradient(180deg, #1a2a1a, #0f1a0f);
    color: #b7f0c8;
    box-shadow: inset 0 0 0 1px rgba(74, 106, 74, 0.25);
}

.autosell-queue-body > .create-ver-seg {
    margin-bottom: 4px;
}

.proxy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    margin-bottom: 2px;
    font-size: 0.85rem;
    color: #aaa;
}

.proxy-fields.hidden {
    display: none;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: #222;
    border: 1px solid #444;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}

.slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background: #888;
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .slider {
    background: #2a3a2a;
    border-color: #4a6a4a;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
    background: #4ade80;
}

.switch.switch-sm .slider::before {
    width: 14px;
    height: 14px;
    left: 2px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.switch.switch-sm input:checked + .slider::before {
    transform: translate(18px, -50%);
    background: #4ade80;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 8px;
}

.btn-primary {
    background: linear-gradient(180deg, #2a3a2a, #1a2a1a);
    border-color: #4a6a4a;
}

.chat-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.chat-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.chat-select label {
    font-size: 0.8rem;
    color: #888;
}

.dd {
    position: relative;
    min-width: 180px;
}

.dd-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: linear-gradient(180deg, #141414, #0a0a0a);
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
}

.dd-btn:hover, .dd.open .dd-btn {
    border-color: #555;
    background: linear-gradient(180deg, #1a1a1a, #0d0d0d);
}

.dd-arrow {
    color: #666;
    font-size: 0.7rem;
}

.dd-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    background: linear-gradient(180deg, #141414, #0a0a0a);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dd-list.hidden {
    display: none;
}

.dd.open .dd-list {
    display: block;
}

.dd-item {
    width: 100%;
    display: block;
    background: transparent;
    border: none;
    color: #ccc;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}

.dd-item:hover {
    background: linear-gradient(90deg, #1f1f1f, #151515);
    color: #fff;
}

.dd-item.active {
    background: linear-gradient(90deg, #1a2a1a, #121a12);
    color: #4ade80;
}

.chat-messages {
    height: 380px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0a0a0a, #050505);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0a0a0a;
}

.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #0a0a0a, #050505);
    border-left: 1px solid #1f1f1f;
    border-radius: 0 8px 8px 0;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #2a2a2a, #141414);
    border: 1px solid #333;
    border-radius: 5px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #3a3a3a, #1f1f1f);
    border-color: #444;
}

.chat-messages::-webkit-scrollbar-button {
    display: none;
}

.chat-msg {
    font-size: 0.82rem;
    line-height: 1.4;
    padding: 6px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #141414, #0d0d0d);
    border: 1px solid #1f1f1f;
}

.chat-msg.out {
    border-color: #2a3a2a;
    background: linear-gradient(135deg, #0f1510, #0a100a);
}

.chat-msg .chat-meta {
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 2px;
}

.chat-msg .chat-meta span {
    color: #4ade80;
}

.chat-msg.out .chat-meta span {
    color: #60a5fa;
}

.chat-input-row {
    display: flex;
    gap: 10px;
}

.chat-input-row input {
    flex: 1;
}

.chat-empty {
    color: #555;
    text-align: center;
    padding: 40px;
    font-size: 0.85rem;
}

.info-controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: flex-end;
    gap: 12px 16px;
    margin-bottom: 14px;
}

.info-subtabs {
    display: flex;
    gap: 6px;
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid #202020;
}

.info-subtab {
    background: #141414;
    border: 1px solid #2a2a2a;
    color: #999;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
}

.info-subtab:hover {
    color: #ddd;
    border-color: #444;
}

.info-subtab.active {
    color: #fff;
    border-color: #666;
    background: linear-gradient(180deg, #222, #181818);
}

.logs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 8px;
}

.logs-hint {
    margin: 0 0 10px;
    color: #666;
    font-size: 0.78rem;
}

.logs-hint-kick {
    margin-top: 16px;
}

.bot-logs {
    height: 420px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0a0a0a, #050505);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0a0a0a;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.82rem;
}

.kick-logs {
    height: 260px;
}

.compass-log {
    line-height: 1.5;
    padding: 7px 10px;
    border-radius: 5px;
    border: 1px solid #2a2418;
    background: #12100a;
}

.kick-log {
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid #2a1a1a;
    background: #120c0c;
}

.kick-log-time {
    color: #888;
}

.kick-log-user {
    color: #8ab4ff;
    font-weight: 600;
}

.kick-log-msg {
    color: #ff9f7a;
}

.compass-log-time {
    color: #888;
}

.compass-log-user {
    color: #8ab4ff;
    font-weight: 600;
}

.compass-log-action {
    color: #f0c14a;
    font-weight: 600;
}

.compass-log-action.compass-gone {
    color: #ff9f7a;
}

.compass-log-action.compass-here {
    color: #7ee787;
}

.info-logs {
    height: 420px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0a0a0a, #050505);
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a #0a0a0a;
}

.info-log {
    font-size: 0.8rem;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: 6px;
    background: linear-gradient(135deg, #141414, #0d0d0d);
    border: 1px solid #1f1f1f;
    font-family: Consolas, 'Courier New', monospace;
}

.info-date,
.info-time {
    color: #666;
}

.info-bot {
    color: #4ade80;
}

.info-player {
    color: #f87171;
}

.info-coords {
    color: #a78bfa;
}

.info-dist {
    color: #fbbf24;
}

.logs-controls select,
.balance-filters select,
select.autoreg-field {
    appearance: none;
    -webkit-appearance: none;
    color: #e0e0e0;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 0.82rem;
    min-width: 118px;
    padding: 8px 32px 8px 10px;
    background-color: #0a0a0a;
    background-image:
        linear-gradient(180deg, #141414, #0a0a0a),
        linear-gradient(45deg, transparent 50%, #888 50%),
        linear-gradient(135deg, #888 50%, transparent 50%);
    background-position: 0 0, calc(100% - 14px) 55%, calc(100% - 9px) 55%;
    background-size: 100% 100%, 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.logs-controls select:focus,
.balance-filters select:focus,
select.autoreg-field:focus {
    border-color: #555;
    outline: none;
}

.logs-controls select {
    min-width: 150px;
}

.bot-actions button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

:root {
    --panel: #141414;
    --panel-soft: #1a1a1a;
    --border: #303030;
    --muted: #858585;
    --accent: #aeb7c9;
}

.header {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.brand-row,
.account-panel {
    display: flex;
    align-items: center;
}

.brand-row {
    justify-content: space-between;
    gap: 18px;
}

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

.site-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 5px 12px rgba(0, 0, 0, .45));
}

.account-panel {
    gap: 10px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 10px;
    border: 1px solid #333;
    border-radius: 999px;
    color: #ddd;
    background: linear-gradient(180deg, #1c1c1c, #131313);
    font-size: 0.82rem;
}

#user-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quota-badge {
    color: #999;
    font-size: 0.72rem;
    font-weight: 700;
}

.logout-btn {
    padding: 7px 11px;
    border-color: #3a3a3a;
}

[data-admin-only],
[data-tracker-desk] {
    display: none !important;
}

body.is-admin .nav-btn[data-admin-only],
body.is-admin #btn-restart[data-admin-only] {
    display: block !important;
}

body.is-admin .kick-logs-block[data-admin-only] {
    display: block !important;
}

body.is-admin section.tab[data-admin-only].active {
    display: block !important;
}

body.is-admin .autoreg-settings-block[data-admin-only] {
    display: block !important;
}

body.is-admin .info-subtab[data-admin-only] {
    display: inline-block !important;
}

body.is-admin .info-balance-clear[data-admin-only]:not(.hidden) {
    display: inline-block !important;
}

body.is-tracker .nav-btn:not([data-tab="bots"]):not([data-tab="info"]):not([data-tab="logs"]) {
    display: none !important;
}

body.is-tracker .nav-btn[data-tab="bots"],
body.is-tracker .nav-btn[data-tab="info"],
body.is-tracker .nav-btn[data-tab="logs"] {
    display: block !important;
}

body.is-tracker .info-subtab:not([data-info="balance"]) {
    display: none !important;
}

body.is-tracker .info-subtab[data-info="balance"] {
    display: inline-block !important;
}

body.is-tracker.can-checktop .info-subtab[data-info="checktop"],
body.is-tracker.can-checktop .info-subtab[data-info="player"],
body.is-tracker.can-checktop .info-subtab[data-info="clan"] {
    display: inline-block !important;
}

body.is-admin .info-subtab[data-tracker-desk],
body.is-tracker .info-subtab[data-tracker-desk],
body.can-checktop .info-subtab[data-tracker-desk] {
    display: inline-block !important;
}

body.is-tracker section.tab:not(#tab-bots):not(#tab-info):not(#tab-logs) {
    display: none !important;
}

body.is-tracker section.tab#tab-logs.active {
    display: block !important;
}

body.is-tracker #info-bot-wrap {
    display: none !important;
}

.balance-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    grid-column: 1 / -1;
    width: 100%;
}

.balance-filters.hidden {
    display: none !important;
}

.player-time-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    grid-column: 1 / -1;
}

.player-time-controls.hidden {
    display: none !important;
}

.player-time-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
}

.player-time-controls input {
    background: #141414;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    min-width: 160px;
}

.player-time-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 0.92rem;
}

.player-time-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-time-row {
    display: grid;
    grid-template-columns: minmax(72px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    font-size: 0.86rem;
}

.player-time-grief {
    font-weight: 600;
}

.player-time-dur {
    font-variant-numeric: tabular-nums;
    color: #8ab4ff;
}

.player-time-seen {
    color: #888;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

.clan-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 14px;
    grid-column: 1 / -1;
    width: 100%;
}

.clan-controls.hidden {
    display: none !important;
}

.clan-controls label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
}

.clan-controls input {
    background: #141414;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    min-width: 120px;
}

.btn-lookup {
    align-self: flex-end;
    min-width: 0;
    padding: 7px 12px;
    font-size: 0.78rem;
    line-height: 1.2;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
    background: #1a1a1a;
    color: #e8e8e8;
    cursor: pointer;
}

.btn-lookup:hover {
    border-color: #60a5fa;
    color: #fff;
}

.clan-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 8px;
    padding: 6px 2px 10px;
    border-bottom: 1px solid #2a2a2a;
    line-height: 1.35;
    font-size: 0.88rem;
}

.clan-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.clan-row,
.clan-member-row,
.clan-stint-row,
.clan-nick-row {
    display: grid;
    align-items: center;
    gap: 4px 10px;
    padding: 4px 2px;
    border: none;
    border-bottom: 1px solid #222;
    border-radius: 0;
    background: transparent;
    font-size: 0.8rem;
    line-height: 1.25;
}

.clan-row {
    grid-template-columns: minmax(90px, 1.4fr) 42px minmax(70px, 1fr) minmax(70px, 1fr) minmax(56px, auto);
    cursor: pointer;
}

.clan-row:hover,
.clan-member-row:hover,
.clan-stint-row:hover,
.clan-nick-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.clan-member-row {
    grid-template-columns: minmax(90px, 1.2fr) minmax(70px, 1fr) minmax(70px, 1fr) minmax(70px, 1fr);
}

/* when | nick | badge | clan | grief | role | exp | coins */
.clan-nick-list .clan-nick-row {
    grid-template-columns:
        minmax(118px, auto)
        minmax(88px, 1.15fr)
        52px
        minmax(72px, 1fr)
        minmax(52px, auto)
        minmax(64px, 0.85fr)
        minmax(56px, 0.75fr)
        minmax(56px, 0.75fr);
    padding: 3px 2px;
    font-size: 0.74rem;
}

.clan-nick-list .clan-when {
    color: #666;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.clan-nick-list .clan-nick-row .clan-main {
    min-width: 0;
}

.clan-nick-list .clan-nick-row .clan-main strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clan-nick-list .clan-badge {
    color: #94a3b8;
    white-space: nowrap;
}

.clan-nick-list .clan-name {
    color: #e5e7eb;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clan-nick-list .clan-role {
    color: #cbd5e1;
    white-space: nowrap;
}

.clan-nick-list .clan-exp,
.clan-nick-list .clan-coins {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: right;
}

.clan-nick-list .clan-coins {
    color: #86efac;
}

.clan-stint-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.clan-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    min-width: 0;
}

.clan-main strong {
    font-weight: 600;
}

.clan-rank {
    color: #aaa;
    font-variant-numeric: tabular-nums;
}

.clan-aside {
    text-align: right;
    white-space: nowrap;
}

.clan-muted {
    color: #888;
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.balance-filters label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: #888;
}

.balance-filters input {
    background: #141414;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    min-width: 118px;
}

.balance-filters select {
    min-width: 118px;
}

#bal-filter-nick {
    min-width: 150px;
}

#bal-filter-amount,
#bal-filter-range {
    min-width: 110px;
}

.info-type {
    font-weight: 600;
}

.info-type-snapshot { color: #93c5fd; }
.info-type-balance_up { color: #86efac; }
.info-type-balance_down { color: #f87171; }
.info-type-balance_transfer { color: #c4b5fd; }
.info-type-funpay { color: #fbbf24; }
.info-type-fp_existence { color: #fb923c; }

.checktop-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 0.82rem;
}

.checktop-controls.hidden,
.info-subtab.hidden {
    display: none !important;
}

.checktop-switch {
    display: inline-flex;
    gap: 3px;
    padding: 2px;
    border: 1px solid #2d2d2d;
    border-radius: 8px;
    background: #101010;
}

.checktop-mode {
    min-width: 0;
    padding: 5px 10px;
    font-size: 0.75rem;
    line-height: 1;
    border-color: transparent;
    background: transparent;
    color: #9ca3af;
}

.checktop-mode.active {
    color: #fff;
    border-color: #3b82f6;
    background: #1e3a5f;
}

.checktop-row {
    display: grid;
    grid-template-columns: 22px minmax(40px, auto) minmax(90px, 1fr) minmax(90px, auto) minmax(150px, auto);
    gap: 6px 8px;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.78rem;
    line-height: 1.25;
    border-bottom: 1px solid #222;
}

.checktop-row.info-log {
    padding: 2px 8px;
    margin: 0;
    border-radius: 4px;
    background: transparent;
    border: none;
    border-bottom: 1px solid #222;
}

.checktop-when {
    white-space: nowrap;
    justify-self: end;
    font-variant-numeric: tabular-nums;
}

.checktop-place {
    color: #64748b;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.info-balance-clear {
    background: #141414;
    border: 1px solid #2a2a2a;
    color: #ccc;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
}

.info-balance-clear:hover {
    color: #fff;
    border-color: #444;
}

.info-delta {
    font-weight: 600;
}

.info-delta-up {
    color: #86efac;
}

.info-delta-down {
    color: #f87171;
}

.info-bal {
    color: #e5e7eb;
    font-variant-numeric: tabular-nums;
}

.info-fp {
    color: #fbbf24;
    font-weight: 700;
    margin-left: 4px;
}

.info-note {
    color: #94a3b8;
    margin-left: 4px;
}

.info-fp-banner {
    color: #f87171;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.info-fp-banner.hidden {
    display: none;
}

.info-balance-log {
    border-color: #1f2a1f;
    background: #0c120c;
}

[data-quota-feature] {
    display: none !important;
}

body.can-autosell .nav-btn[data-quota-feature] {
    display: block !important;
}

body.can-autosell section.tab[data-quota-feature].active {
    display: block !important;
}

[hidden] {
    display: none !important;
}

.secret-input {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.secret-input > input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-right: 42px !important;
}

.secret-toggle {
    position: absolute;
    z-index: 2;
    right: 4px;
    top: 0;
    bottom: 0;
    margin: auto 0 !important;
    transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    color: #9a9a9a;
    background: transparent !important;
    cursor: pointer;
    line-height: 0;
    box-shadow: none !important;
}

.secret-toggle svg {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

.secret-toggle:hover {
    color: #d0d0d0;
    border: 0 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    transform: none;
}

.secret-toggle:focus-visible {
    outline: 1px solid #666;
    outline-offset: 1px;
}

.proxy-card-grid,
.proxy-fields.proxy-card-grid,
.autosell-proxy-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    margin-top: 8px;
    border: 1px solid #303030;
    border-radius: 8px;
    background: linear-gradient(145deg, #121212, #0c0c0c);
}

#modal .modal-box,
#proxy-modal .modal-box {
    max-width: 420px;
}

.proxy-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.proxy-field > span:first-child,
.proxy-field > label {
    color: #888;
    font-size: .75rem;
    font-weight: 650;
}

.proxy-field .proxy-inline-input,
.proxy-field input,
.proxy-field .secret-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.proxy-field .proxy-inline-input {
    min-height: 39px;
    padding: 9px 11px;
    border: 1px solid #333;
    border-radius: 7px;
    background: #0a0a0a;
    text-align: left;
}

.autosell-proxy-fields > input,
.autosell-proxy-fields > .secret-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.users-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.users-head h2 {
    margin-bottom: 4px;
    font-size: 1.2rem;
}

.users-head p,
.user-meta {
    color: var(--muted);
    font-size: .78rem;
}

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

.users-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.user-card {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(190px, 1.6fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: linear-gradient(145deg, #161616, #101010);
}

.user-card-head,
.user-control,
.user-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-card-head {
    justify-content: flex-start;
    margin: 0;
}

.user-card-name {
    min-width: 0;
    overflow: hidden;
    color: #eee;
    font-weight: 700;
    text-overflow: ellipsis;
}

button.user-card-name-link {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #8ec7ff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(142, 199, 255, .35);
    text-underline-offset: 2px;
    cursor: pointer;
}

button.user-card-name-link:hover {
    color: #b7dcff;
    text-decoration-color: rgba(183, 220, 255, .7);
}

button.user-card-name-link:focus-visible {
    outline: 1px solid #6aa8e0;
    outline-offset: 2px;
    border-radius: 2px;
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border: 1px solid #5a4a1c;
    border-radius: 8px;
    background: linear-gradient(180deg, #2a2414, #1c180e);
    color: #f0e2b0;
    font-size: 0.86rem;
    position: sticky;
    top: 0;
    z-index: 20;
}

.impersonation-banner.hidden {
    display: none;
}

.impersonation-banner-text {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.impersonation-label {
    color: #cbb67a;
}

#impersonation-username {
    overflow: hidden;
    color: #ffe9a8;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.impersonation-stop-btn {
    flex: 0 0 auto;
    padding: 6px 12px;
    border: 1px solid #7a6430;
    border-radius: 6px;
    color: #fff4d0;
    background: linear-gradient(180deg, #4a3a16, #2e240e);
    font-size: 0.8rem;
    cursor: pointer;
}

.impersonation-stop-btn:hover {
    border-color: #9a8040;
    background: linear-gradient(180deg, #5a481c, #3a2e12);
}

.impersonation-stop-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.admin-badge {
    padding: 2px 7px;
    border: 1px solid #555;
    border-radius: 999px;
    color: #bbb;
    font-size: .65rem;
}

.user-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0;
}

.user-control {
    gap: 7px;
    color: #aaa;
    font-size: .8rem;
}

.user-control input[type="number"],
.user-control input[type="text"][data-user-quota],
.user-control input[data-user-quota] {
    width: 72px;
    padding: 6px 8px;
    border: 1px solid #3a3a3a;
    border-radius: 6px;
    color: #eee;
    background: #0a0a0a;
    -moz-appearance: textfield;
    appearance: textfield;
}

.user-control input[type="number"]::-webkit-outer-spin-button,
.user-control input[type="number"]::-webkit-inner-spin-button,
.user-control input[data-user-quota]::-webkit-outer-spin-button,
.user-control input[data-user-quota]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.user-card-actions {
    margin: 0;
}

.user-save-status {
    min-height: 16px;
    color: #aaa;
    font-size: .75rem;
}

.user-card-actions .btn-primary {
    padding: 7px 10px;
    border-color: #444;
    background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
}

@media (max-width: 760px) {
    .brand-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .account-panel {
        width: 100%;
    }

    .user-chip {
        flex: 1;
    }

    #modal .modal-box,
    #proxy-modal .modal-box {
        max-width: 100%;
    }

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

    .user-controls,
    .user-card-actions {
        justify-content: space-between;
    }

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

    .info-subtabs,
    .balance-filters {
        grid-column: 1;
    }

    .checktop-controls {
        align-items: center;
        flex-direction: row;
    }

    .checktop-row {
        grid-template-columns: 22px minmax(40px, auto) minmax(70px, 1fr) minmax(80px, auto) minmax(130px, auto);
        font-size: 0.72rem;
    }

    .checktop-when {
        justify-self: start;
    }

    .clan-nick-list .clan-nick-row {
        grid-template-columns:
            minmax(100px, auto)
            minmax(72px, 1fr)
            48px
            minmax(56px, 0.9fr)
            minmax(44px, auto)
            minmax(52px, 0.8fr)
            minmax(48px, 0.7fr)
            minmax(48px, 0.7fr);
        font-size: 0.7rem;
        overflow-x: auto;
    }

    .clan-row {
        grid-template-columns: minmax(80px, 1fr) 36px minmax(60px, 1fr);
    }
}


/* Info: bot selector only for Detect / Dealer */
body.info-sub-balance #info-bot-wrap,
body.info-sub-player #info-bot-wrap,
body.info-sub-clan #info-bot-wrap,
body.info-sub-checktop #info-bot-wrap {
    display: none !important;
}

/* баланс после изменения — нейтральный; прирост остаётся зелёным/красным в .info-delta-* */
.info-bal {
    color: #e5e7eb;
    font-variant-numeric: tabular-nums;
}

.info-balance-log .info-bal {
    color: #cbd5e1;
}

.info-note {
    color: #94a3b8;
}

.player-time-row.info-log,
.clan-row.info-log,
.clan-member-row.info-log,
.clan-nick-row.info-log,
.clan-head.info-log,
.checktop-row.info-log {
    margin-bottom: 4px;
}

.checktop-place {
    color: #fbbf24;
    font-weight: 600;
}

.player-time-head.info-log {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.info-log .clan-muted { color: inherit; }
.clan-row.info-log,
.clan-member-row.info-log,
.clan-nick-row.info-log {
    cursor: default;
}
.clan-row.info-log { cursor: pointer; }
.clan-hit-row.info-log { cursor: pointer; }

/* ---------------- AutoFunpay ---------------- */

.funpay-bar,
.funpay-run,
.funpay-profile,
.funpay-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
}

.funpay-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
}

.funpay-bar-key {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1 1 220px;
    min-width: 0;
}

.funpay-key-label {
    font-size: 0.7rem;
    color: #888;
    font-weight: 600;
}

.funpay-key-input {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #ddd;
    padding: 6px 10px;
    font-size: 0.82rem;
}

.funpay-key-input:focus {
    outline: none;
    border-color: #3a3a3a;
}

.funpay-bar-actions,
.funpay-run-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.funpay-bar-actions button,
.funpay-run-actions button,
.funpay-test-row button {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.funpay-status {
    font-size: 0.72rem;
    color: #666;
    line-height: 1.35;
    flex: 1 1 12em;
    min-width: 0;
}

.funpay-profiles {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.funpay-versions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.funpay-version-block {
    border: 1px solid #2a2a2e;
    border-radius: 10px;
    padding: 1rem;
    background: #16161a;
}

.funpay-responses {
    display: grid;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.funpay-responses-title {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.25rem;
}

.funpay-response textarea {
    width: 100%;
    min-height: 2.5rem;
    resize: vertical;
    background: #0f0f12;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e8e8e8;
    padding: 0.4rem 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
}

.funpay-lot,
.funpay-units {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.8rem;
    color: #aaa;
    min-width: 10rem;
}

.funpay-lot input,
.funpay-units input {
    background: #0f0f12;
    border: 1px solid #333;
    border-radius: 6px;
    color: #e8e8e8;
    padding: 0.35rem 0.5rem;
}

.funpay-version {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.funpay-version-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #d4c89a;
    letter-spacing: 0.02em;
}

.funpay-version-profiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.funpay-version-profiles--single {
    grid-template-columns: minmax(0, 360px);
}

@media (max-width: 800px) {
    .funpay-version-profiles { grid-template-columns: 1fr; }
    .funpay-version-profiles--single { grid-template-columns: 1fr; }
}

.funpay-profile {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.funpay-profile-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ddd;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.funpay-profile-state {
    font-size: 0.68rem;
    font-weight: 500;
    color: #666;
    text-align: right;
}

.funpay-profile-state.funpay-on,
.funpay-status.funpay-on {
    color: #4caf7d;
}

.funpay-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.funpay-profile-fields label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    color: #666;
    min-width: 0;
}

.funpay-block input {
    font-size: 0.82rem;
}

.funpay-profile-fields input {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #ddd;
    padding: 5px 8px;
    font-size: 0.8rem;
}

.funpay-profile-fields input:focus,
.funpay-test-row input:focus {
    outline: none;
    border-color: #3a3a3a;
}

.funpay-profile-fields input[data-edited="1"] {
    border-color: #8a7428;
    box-shadow: inset 0 0 0 1px rgba(138, 116, 40, 0.28);
}

.funpay-run {
    margin: 10px 0;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.funpay-problems {
    padding: 8px 10px;
    border: 1px solid #4a2b2b;
    background: #1a1010;
    border-radius: 6px;
    font-size: 0.74rem;
    color: #d98b8b;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.funpay-test-row {
    display: grid;
    grid-template-columns: minmax(8.5em, 11.5em) minmax(7.5em, 9.5em) 4.6em auto minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}

.funpay-test-row label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    color: #666;
    min-width: 0;
}

.funpay-test-row input {
    width: 100%;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #ddd;
    padding: 5px 8px;
    font-size: 0.8rem;
}

.funpay-test-row button {
    justify-self: start;
}

.funpay-hint {
    font-size: 0.68rem;
    color: #4a4a4a;
    line-height: 1.35;
    padding-bottom: 4px;
}

.funpay-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 10px;
}

@media (max-width: 800px) {
    .funpay-bottom { grid-template-columns: 1fr; }
    .funpay-test-row {
        grid-template-columns: 1fr 1fr 4.6em;
    }
    .funpay-test-row button,
    .funpay-hint {
        grid-column: 1 / -1;
    }
}

.funpay-panel {
    padding: 10px 12px;
}

.funpay-panel-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 8px;
}

.funpay-queue,
.funpay-log {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.funpay-empty {
    font-size: 0.75rem;
    color: #555;
}

.funpay-order {
    border: 1px solid #262626;
    border-left: 2px solid #3a3a3a;
    border-radius: 6px;
    padding: 6px 8px;
    background: #101010;
}

.funpay-order-queued { border-left-color: #8a7a4a; }
.funpay-order-running { border-left-color: #4c7daf; }
.funpay-order-done { border-left-color: #4caf7d; }
.funpay-order-failed { border-left-color: #af4c4c; }
.funpay-order-cancelled { border-left-color: #6a6a6a; }

.funpay-order-queued .funpay-order-state { color: #c4b56a; }
.funpay-order-running .funpay-order-state { color: #7eb0d4; }
.funpay-order-done .funpay-order-state { color: #6dbf8f; }
.funpay-order-failed .funpay-order-state { color: #d98b8b; }
.funpay-order-cancelled .funpay-order-state { color: #888; }

.funpay-order-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: #777;
}

.funpay-order-state {
    font-weight: 600;
    color: #bbb;
}

.funpay-order-id {
    overflow-wrap: anywhere;
}

.funpay-order-test {
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    padding: 0 4px;
}

.funpay-order-cancel {
    margin-left: auto;
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 2px;
}

.funpay-order-cancel:hover { color: #d98b8b; }

.funpay-order-body {
    font-size: 0.76rem;
    color: #ccc;
    margin-top: 3px;
}

.funpay-order-error {
    font-size: 0.72rem;
    color: #d98b8b;
    margin-top: 3px;
    word-break: break-word;
}

.funpay-log {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #0c0c0c;
    border: 1px solid #222;
    border-radius: 6px;
    padding: 6px 8px;
}

.funpay-log-line {
    font-family: inherit;
    font-size: 0.72rem;
    color: #a8a8a8;
    line-height: 1.45;
    word-break: break-word;
}

/* ---- player inventory panel ---- */
#inventory-modal .modal-box {
    max-width: 640px;
    padding: 16px 16px 14px;
    gap: 10px;
    max-height: min(88vh, 760px);
    overflow-y: auto;
}

.inventory-status {
    font-size: 0.78rem;
    color: #9a9a9a;
}

.inventory-status.inv-warn {
    color: #e0a33a;
}

.inventory-layout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.inventory-gear {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
}

.inventory-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 300px;
    min-width: 260px;
}

.inventory-grid,
.inventory-hotbar {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
}

.inv-slot {
    position: relative;
    min-height: 46px;
    padding: 4px 3px;
    border: 1px solid #2c2c2c;
    border-radius: 5px;
    background: #101010;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s, background 0.12s;
}

.inv-slot:hover {
    border-color: #4a4a4a;
    background: #161616;
}

.inv-slot.inv-empty {
    background: #0b0b0b;
    opacity: 0.55;
}

.inv-slot.inv-held {
    border-color: #3f7fd0;
    box-shadow: inset 0 0 0 1px rgba(63, 127, 208, 0.45);
}

.inv-slot.inv-selected {
    border-color: #d0a63f;
    box-shadow: inset 0 0 0 1px rgba(208, 166, 63, 0.55);
}

.inv-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.inv-name {
    font-size: 0.6rem;
    line-height: 1.15;
    text-align: center;
    color: #d8d8d8;
    word-break: break-word;
    overflow: hidden;
    max-height: 100%;
}

.inv-count {
    position: absolute;
    right: 3px;
    bottom: 2px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px #000;
}

.inv-gear {
    min-height: 52px;
    flex-direction: column;
    gap: 2px;
}

.inv-gear-label {
    font-size: 0.58rem;
    color: #7d7d7d;
    text-transform: lowercase;
}

.inv-gear-offhand {
    margin-top: 4px;
}

.inv-cursor {
    min-height: 46px;
    width: 92px;
}

.inventory-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inventory-quick button,
.inventory-hotbar-targets button {
    font-size: 0.74rem;
    padding: 5px 9px;
}

.inventory-quick button:disabled,
.inventory-hotbar-targets button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.inventory-hotbar-pick {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inventory-quick-label {
    font-size: 0.72rem;
    color: #8a8a8a;
}

.inventory-hotbar-targets {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.inventory-cursor {
    display: flex;
    align-items: center;
    gap: 10px;
}
