/* ═══════════════════════════════════════════════════════════════════
   XFS Bot Control Panel — Cyberpunk Theme
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --bg:           #0a0a12;
    --surface:      #12121e;
    --surface2:     #1a1a2e;
    --border:       #2a2a3e;
    --text:         #d0d0e0;
    --text-dim:     #6666aa;
    --neon-cyan:    #00ddff;
    --neon-pink:    #ff3388;
    --neon-green:   #00ff88;
    --neon-yellow:  #ffee00;
    --neon-orange:  #ff6600;
    --neon-purple:  #aa66ff;
    --neon-red:     #ff3355;
    --font-mono:    'Consolas', 'Courier New', monospace;
    --radius:       8px;
    --shadow-glow:  0 0 20px rgba(0, 221, 255, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Screens ──────────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; }

/* ── Login ────────────────────────────────────────────────────────── */
#login-screen {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #12122e, var(--bg));
}

.login-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 380px;
    text-align: center;
    box-shadow: var(--shadow-glow);
    overflow: visible;
}

.logo-pulse {
    font-size: 64px;
    animation: pulse 2s ease-in-out infinite;
    color: var(--neon-cyan);
    text-shadow: 0 0 30px var(--neon-cyan);
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50%      { opacity: 1;   transform: scale(1.05); }
}

.login-box h1 {
    color: var(--neon-cyan);
    font-size: 24px;
    letter-spacing: 6px;
    margin: 8px 0 4px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 11px;
    letter-spacing: 3px;
    margin-bottom: 24px;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--text-dim);
    font-size: 10px;
}
.login-divider::before, .login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.login-divider span { padding: 0 12px; }

#login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input[type="text"], input[type="password"], input[type="number"],
textarea, select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 221, 255, 0.2);
}

.error-text {
    color: var(--neon-red);
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn-neon {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 10px 20px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-neon:hover {
    background: rgba(0, 221, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 221, 255, 0.3);
}

.btn-small {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--font-mono);
    transition: all 0.2s;
}

.btn-danger  { color: var(--neon-red);   border-color: var(--neon-red); }
.btn-danger:hover { background: rgba(255, 51, 85, 0.15); }
.btn-success { color: var(--neon-green); border-color: var(--neon-green); }
.btn-success:hover { background: rgba(0, 255, 136, 0.15); }
.btn-warn    { color: var(--neon-orange); border-color: var(--neon-orange); }
.btn-warn:hover { background: rgba(255, 102, 0, 0.15); }
.btn-info    { color: var(--neon-cyan);  border-color: var(--neon-cyan); }
.btn-info:hover { background: rgba(0, 221, 255, 0.15); }
.btn-warning { color: var(--neon-yellow); border-color: var(--neon-yellow); }
.btn-warning:hover { background: rgba(255, 238, 0, 0.15); }

/* Checkbox di selezione cartelle (stile mega.nz): nascosta di default, appare
   in hover sulla cartella, quando è spuntata, o quando la modalità "Seleziona"
   è attiva. */
.fm-fsel {
    width: 17px; height: 17px;
    flex: 0 0 17px;
    cursor: pointer;
    accent-color: var(--neon-green);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}
[data-folder-card-id]:hover .fm-fsel,
.fm-fsel:checked,
.fm-selmode .fm-fsel {
    opacity: 1;
    pointer-events: auto;
}
.fm-fsel-master {
    width: 17px; height: 17px;
    cursor: pointer;
    accent-color: var(--neon-green);
}

.verify-result-box {
    margin: 8px 0 10px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 238, 0, 0.28);
    border-radius: 6px;
    background: rgba(255, 238, 0, 0.06);
    color: var(--text);
    font-size: 12px;
}

.link-status-badge {
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    border: 1px solid var(--border);
    white-space: nowrap;
}
.link-status-online  { color: var(--neon-green);  border-color: rgba(0,255,136,0.35);  background: rgba(0,255,136,0.10); }
.link-status-offline { color: var(--neon-red);    border-color: rgba(255,51,85,0.35);   background: rgba(255,51,85,0.10); }
.link-status-error   { color: var(--neon-orange); border-color: rgba(255,102,0,0.35);   background: rgba(255,102,0,0.10); }
.link-status-unknown { color: var(--neon-yellow); border-color: rgba(255,238,0,0.35);   background: rgba(255,238,0,0.08); }

/* Active scraper tab — bright filled background */
.btn-scraper-active {
    background: rgba(0, 221, 255, 0.2) !important;
    box-shadow: 0 0 12px rgba(0, 221, 255, 0.4), inset 0 0 8px rgba(0, 221, 255, 0.1);
    border-color: var(--neon-cyan) !important;
    color: #fff !important;
    text-shadow: 0 0 6px var(--neon-cyan);
}

/* ── Main Layout ──────────────────────────────────────────────────── */
#main-screen {
    min-height: 100vh;
}

#sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-logo {
    padding: 20px 16px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 3px;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 18px; }

#nav-links {
    list-style: none;
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

#nav-links li {
    padding: 10px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-dim);
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
#nav-links li:hover {
    color: var(--text);
    background: rgba(0, 221, 255, 0.05);
}
#nav-links li.active {
    color: var(--neon-cyan);
    border-left-color: var(--neon-cyan);
    background: rgba(0, 221, 255, 0.08);
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.nav-badge {
    margin-left: auto;
    background: var(--neon-red, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
}

/* ── Support the author button ────────────────────────────────────── */
.btn-support {
    display: block;
    margin: 14px 16px 4px;
    padding: 11px 14px;
    text-align: center;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .2px;
    color: #2b1a00;
    border-radius: 12px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 6px 18px rgba(245, 158, 11, .35);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-support:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 9px 24px rgba(245, 158, 11, .45);
}
.login-box .btn-support { margin: 18px auto 0; max-width: 280px; }


#content {
    margin-left: 220px;
    padding: 24px;
    flex: 1;
    min-height: 100vh;
}

/* ── Cards / Panels ───────────────────────────────────────────────── */
.hud-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.hud-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}
.hud-panel .panel-title {
    padding: 12px 16px;
    font-size: 11px;
    letter-spacing: 2px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.hud-panel .panel-body {
    padding: 16px;
}

/* ── Stat Cards ───────────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}
.stat-card.cyan::before   { background: var(--neon-cyan); }
.stat-card.pink::before   { background: var(--neon-pink); }
.stat-card.green::before  { background: var(--neon-green); }
.stat-card.yellow::before { background: var(--neon-yellow); }
.stat-card.orange::before { background: var(--neon-orange); }
.stat-card.purple::before { background: var(--neon-purple); }

.stat-card .stat-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 8px;
}
.stat-card .stat-value {
    font-size: 28px;
    font-weight: bold;
}
.stat-card.cyan .stat-value   { color: var(--neon-cyan); }
.stat-card.pink .stat-value   { color: var(--neon-pink); }
.stat-card.green .stat-value  { color: var(--neon-green); }
.stat-card.yellow .stat-value { color: var(--neon-yellow); }
.stat-card.orange .stat-value { color: var(--neon-orange); }
.stat-card.purple .stat-value { color: var(--neon-purple); }

/* ── Download Cards ───────────────────────────────────────────────── */
.dl-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.dl-card .dl-info { flex: 1; }
.dl-card .dl-name {
    font-size: 13px;
    color: var(--text);
    margin-bottom: 4px;
    word-break: break-all;
}
.dl-card .dl-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 12px;
}
.torrent-tree {
    margin: 8px 0 4px;
    padding: 8px 10px;
    background: rgba(0, 20, 36, 0.55);
    border: 1px solid rgba(0, 221, 255, 0.22);
    border-radius: 6px;
}
.torrent-tree summary {
    cursor: pointer;
    color: var(--neon-cyan);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    user-select: none;
}
.torrent-tree-pre {
    margin: 7px 0 0;
    max-height: 360px;
    overflow: auto;
    overflow-x: auto;
    white-space: pre;
    color: #b9d9ff;
    font: 11px/1.3 "Consolas", "Fira Code", monospace;
    resize: vertical;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,221,255,0.45) transparent;
}
.torrent-tree-pre::-webkit-scrollbar { width: 10px; height: 10px; }
.torrent-tree-pre::-webkit-scrollbar-thumb {
    background: rgba(0,221,255,0.35); border-radius: 5px;
}
.torrent-tree-pre::-webkit-scrollbar-thumb:hover { background: rgba(0,221,255,0.6); }

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.progress-bar .progress-fill {
    height: 100%;
    background: var(--neon-cyan);
    border-radius: 2px;
    transition: width 0.3s;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: bold;
}
.badge-cyan   { color: var(--neon-cyan);   border: 1px solid var(--neon-cyan); }
.badge-green  { color: var(--neon-green);  border: 1px solid var(--neon-green); }
.badge-red    { color: var(--neon-red);    border: 1px solid var(--neon-red); }
.badge-yellow { color: var(--neon-yellow); border: 1px solid var(--neon-yellow); }
.badge-orange { color: var(--neon-orange); border: 1px solid var(--neon-orange); }
.badge-purple { color: var(--neon-purple); border: 1px solid var(--neon-purple); }
.badge-dim   { color: var(--text-dim);    border: 1px solid var(--border); }
.badge-filled { background: rgba(0,221,255,0.12); }

/* Status badges */
.status-downloading { color: var(--neon-cyan); }
.status-completed   { color: var(--neon-green); }
.status-error       { color: var(--neon-red); }
.status-queued      { color: var(--text-dim); }
.status-uploading   { color: var(--neon-purple); }

/* ── Tables ───────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    text-align: left;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-dim);
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid rgba(42, 42, 62, 0.5);
}
.data-table tr:hover td {
    background: rgba(0, 221, 255, 0.03);
}

/* ── Page Headers ─────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 3px;
}

/* ── Toolbar ──────────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.toolbar input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* ── Logs ─────────────────────────────────────────────────────────── */
.log-container {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
}
.log-entry { white-space: pre-wrap; word-break: break-all; }
.log-entry.info    { color: var(--text-dim); }
.log-entry.warn    { color: var(--neon-yellow); }
.log-entry.error   { color: var(--neon-red); }
.log-entry.success { color: var(--neon-green); }

/* ── Search Results ───────────────────────────────────────────────── */
.search-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.search-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
}
.search-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 221, 255, 0.08);
}
.search-card.selected {
    border-color: var(--neon-green);
    box-shadow: 0 0 0 2px rgba(0, 255, 128, 0.2);
}
.search-card .card-row {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    align-items: center;
    cursor: pointer;
}
.search-card .card-cover {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.search-card .card-cover-placeholder {
    width: 60px;
    height: 80px;
    background: var(--surface);
    border-radius: 6px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-size: 24px;
}
.search-card .card-body {
    flex: 1;
    min-width: 0;
}
.search-card .card-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}
.search-card .card-meta {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.search-card .card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Host Group Tree ──────────────────────────────────────────────── */
.host-group {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}
.host-group-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
}
.host-group-header .hg-name {
    font-weight: bold;
    font-size: 13px;
    color: var(--neon-purple);
}
.host-group-header .hg-count {
    font-size: 11px;
    color: var(--text-dim);
}
.host-group-header .hg-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}
.host-group-tree {
    padding: 2px 0;
}
.host-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    font-size: 12px;
    transition: background 0.1s;
}
.host-link-row:hover {
    background: rgba(0, 221, 255, 0.04);
}
.tree-branch {
    font-family: var(--font-mono);
    color: var(--text-dim);
    width: 16px;
    flex-shrink: 0;
    font-size: 11px;
    user-select: none;
}
.host-link-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text);
}
.badge-rev {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-weight: bold;
}
.badge-fc {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    font-weight: bold;
}
.host-link-actions {
    display: flex;
    gap: 2px;
    opacity: 0.6;
    flex-shrink: 0;
}
.host-link-row:hover .host-link-actions {
    opacity: 1;
}
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
}
.btn-icon:hover {
    border-color: var(--border);
    color: var(--neon-cyan);
    background: rgba(0, 221, 255, 0.08);
}

/* ── Detail Panel (inline expand) ─────────────────────────────────── */
.detail-panel {
    border-top: 1px solid var(--border);
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.detail-panel .detail-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    padding: 6px 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #f59e0b;
}
.detail-panel .detail-password code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    color: var(--text);
    user-select: all;
}
.detail-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 6px;
    align-items: center;
}
.detail-summary-bar .ds-info {
    font-size: 12px;
    color: var(--text-dim);
}

/* ── File List ────────────────────────────────────────────────────── */
.file-list .file-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 12px;
    border-bottom: 1px solid rgba(42, 42, 62, 0.3);
    cursor: pointer;
    transition: background 0.15s;
}
.file-row:hover { background: rgba(0, 221, 255, 0.03); }
.file-row .file-icon { font-size: 18px; width: 24px; text-align: center; }
.file-row .file-name { flex: 1; font-size: 13px; }
.file-row .file-size { font-size: 11px; color: var(--text-dim); width: 80px; text-align: right; }

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}
.pagination button {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all 0.2s;
}
.pagination button.active,
.pagination button:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

/* ── Spinner ──────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--neon-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────── */

/* ── Tablet ( ≤ 900px ) ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .form-row  { grid-template-columns: 1fr; }
    .form-row label { text-align: left; }
}

/* ── Mobile ( ≤ 768px ) ──────────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Sidebar → bottom nav bar ─────────────────────────────────── */
    #sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border);
        z-index: 100;
        overflow: visible;
        background: var(--surface);
    }
    .sidebar-logo { display: none; }
    .sidebar-footer { display: none; }
    #sidebar > .btn-support { display: none; }

    /* Hide text labels in nav, show only icons */
    #nav-links li .nav-label { display: none; }

    #nav-links {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0;
        gap: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    #nav-links::-webkit-scrollbar { display: none; }

    #nav-links li {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 2px;
        padding: 8px 12px 6px;
        font-size: 9px;
        letter-spacing: 0.5px;
        text-align: center;
        border-left: none;
        border-top: 2px solid transparent;
        white-space: nowrap;
        min-width: 56px;
    }
    #nav-links li.active {
        border-left-color: transparent;
        border-top-color: var(--neon-cyan);
    }
    .nav-icon { font-size: 17px; width: auto; }

    /* ── Content area ─────────────────────────────────────────────── */
    #content {
        margin-left: 0;
        padding: 12px 10px 72px;  /* bottom padding for nav bar */
        min-height: 100vh;
    }

    /* ── Page headers ─────────────────────────────────────────────── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 14px;
    }
    .page-header h2 {
        font-size: 16px;
        letter-spacing: 2px;
    }

    /* ── Stat cards ───────────────────────────────────────────────── */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 14px;
    }
    .stat-card {
        padding: 10px 12px;
    }
    .stat-card .stat-value {
        font-size: 22px;
    }
    .stat-card .stat-label {
        font-size: 9px;
    }

    /* ── Toolbar ──────────────────────────────────────────────────── */
    .toolbar {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        align-items: stretch;
    }
    .toolbar input[type="text"] {
        min-width: 0;
        width: 100%;
        flex: 1 1 100%;
    }
    .toolbar .btn-neon {
        flex: 1 1 100%;
        text-align: center;
    }
    .toolbar .btn-small,
    .toolbar button:not(.btn-neon) {
        flex: 1 1 auto;
        text-align: center;
        white-space: nowrap;
    }

    /* ── Download cards ───────────────────────────────────────────── */
    .dl-card {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    .dl-card .dl-name {
        font-size: 12px;
        word-break: break-word;
    }
    .dl-card .dl-meta {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
    }
    .dl-card .dl-meta span {
        word-break: break-all;
    }

    /* ── Search / Scraper cards ───────────────────────────────────── */
    .search-card .card-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px;
    }
    .search-card .card-cover,
    .search-card .card-cover-placeholder {
        width: 50px;
        height: 66px;
    }
    .search-card .card-body {
        flex: 1 1 calc(100% - 120px);
        min-width: 0;
    }
    .search-card .card-title {
        font-size: 12px;
    }
    .search-card .card-meta {
        font-size: 10px;
    }
    .search-card .card-actions {
        width: 100%;
        justify-content: flex-end;
    }

    /* ── Category buttons in scraper page ─────────────────────────── */
    .btn-small {
        padding: 6px 10px;
        font-size: 10px;
    }

    /* ── Host group tree (extract detail) ─────────────────────────── */
    .host-group-header {
        padding: 8px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .host-group-header .hg-name { font-size: 12px; }
    .host-group-header .hg-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .host-link-row {
        padding: 5px 8px;
        gap: 4px;
    }
    .host-link-name {
        font-size: 11px;
    }

    /* ── Detail panel (expanded cards) ────────────────────────────── */
    .detail-panel {
        padding: 10px;
    }
    .detail-summary-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px;
    }
    .detail-panel .detail-password {
        font-size: 11px;
        flex-wrap: wrap;
    }

    /* ── File manager ─────────────────────────────────────────────── */
    .file-row {
        gap: 8px;
        padding: 8px;
    }
    .file-row .file-name {
        font-size: 12px;
        word-break: break-word;
        white-space: normal;
    }
    .file-row .file-size {
        font-size: 10px;
        width: auto;
        flex-shrink: 0;
    }

    /* ── Tables ───────────────────────────────────────────────────── */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* ── Logs ─────────────────────────────────────────────────────── */
    .log-container {
        max-height: calc(100vh - 160px);
        padding: 8px;
        font-size: 10px;
    }

    /* ── Pagination ───────────────────────────────────────────────── */
    .pagination {
        flex-wrap: wrap;
        gap: 3px;
    }
    .pagination button {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* ── HUD Panels ───────────────────────────────────────────────── */
    .hud-panel .panel-body {
        padding: 10px;
    }
    .hud-panel .panel-title {
        padding: 8px 10px;
        font-size: 10px;
    }

    /* ── Login ────────────────────────────────────────────────────── */
    .login-box {
        width: calc(100vw - 32px);
        max-width: 380px;
        padding: 24px 20px;
    }
    .login-box h1 {
        font-size: 20px;
        letter-spacing: 4px;
    }
    .logo-pulse {
        font-size: 48px;
    }

    /* ── Form rows → stacked ──────────────────────────────────────── */
    .form-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    .form-row label {
        text-align: left;
        font-size: 11px;
    }

    /* ── Generic small-screen helpers ─────────────────────────────── */
    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ── Small phones ( ≤ 400px ) ─────────────────────────────────────── */
@media (max-width: 400px) {
    #content {
        padding: 8px 6px 72px;
    }
    .stats-row {
        grid-template-columns: 1fr;
    }
    .stat-card .stat-value {
        font-size: 20px;
    }
    #nav-links li {
        padding: 6px 8px 4px;
        min-width: 48px;
        font-size: 8px;
    }
    .nav-icon { font-size: 15px; }
    .page-header h2 { font-size: 14px; }
    .search-card .card-cover,
    .search-card .card-cover-placeholder {
        width: 42px;
        height: 56px;
    }
}

/* ── Scrollbar ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Form sections ────────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}
.form-row label {
    font-size: 12px;
    color: var(--text-dim);
    text-align: right;
}


/* Telegram Login Widget */
.tg-login-section {
    text-align: center;
    margin: 20px 0 10px;
    overflow: visible;
    min-height: 50px;
}
#tg-widget-container {
    text-align: center;
    overflow: visible;
    min-height: 50px;
}
#tg-widget-container iframe {
    border: none !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 auto !important;
}
.login-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #333;
}
.login-divider span {
    padding: 0 12px;
    color: #0ff;
}

/* ════════════════════════════════════════════════════════════════════
   LIGHT THEME — toggled via [data-theme="light"] on <html>
   Variables only — markup/components stay identical.
   ════════════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
    --bg:           #f4f5fa;
    --surface:      #ffffff;
    --surface2:     #eef0f7;
    --border:       #c8ccda;
    --text:         #1a1d2e;
    --text-dim:     #5a6080;
    --neon-cyan:    #007a99;
    --neon-pink:    #c01464;
    --neon-green:   #0a8a44;
    --neon-yellow:  #b08a00;
    --neon-orange:  #c04400;
    --neon-purple:  #6533c0;
    --neon-red:     #c01430;
    --shadow-glow:  0 2px 12px rgba(0, 122, 153, 0.10);
}

html[data-theme="light"] body {
    background: linear-gradient(180deg, #f4f5fa 0%, #e7eaf3 100%);
}

html[data-theme="light"] #login-screen {
    background: radial-gradient(ellipse at center, #ffffff, #e7eaf3);
}

html[data-theme="light"] .logo-pulse,
html[data-theme="light"] .login-box h1 {
    text-shadow: 0 0 12px rgba(0, 122, 153, 0.3);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
    background: #ffffff;
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="light"] .btn-small {
    background: var(--surface2);
    color: var(--text);
}

#btn-theme {
    margin-right: 6px;
}

/* ════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS + CONNECTION BANNER
   ════════════════════════════════════════════════════════════════════ */
#toast-container {
    position: fixed; top: 16px; right: 16px;
    z-index: 9999; display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    min-width: 240px; max-width: 420px;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--neon-cyan);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    font-size: 13px; line-height: 1.4;
    opacity: 0; transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
    cursor: pointer;
    white-space: pre-wrap;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { border-left-color: var(--neon-green); }
.toast-warn    { border-left-color: var(--neon-yellow); }
.toast-error   { border-left-color: var(--neon-red); }

#conn-banner {
    position: fixed; top: 0; left: 0; right: 0;
    padding: 8px 16px; text-align: center;
    background: var(--neon-red); color: #fff;
    font-size: 13px; font-weight: 500; letter-spacing: .3px;
    z-index: 10000; transform: translateY(-100%);
    transition: transform .25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#conn-banner.show { transform: translateY(0); }

/* ── Copy-to-clipboard buttons ──────────────────────────────────── */
.copy-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-dim); padding: 2px 6px; border-radius: 3px;
    font-family: var(--font-mono); font-size: 10px; cursor: pointer;
    margin-left: 6px; transition: all .15s ease;
}
.copy-btn:hover { color: var(--neon-cyan); border-color: var(--neon-cyan); }
.copy-btn.copied { color: var(--neon-green); border-color: var(--neon-green); }

/* ── Video / audio player — responsive (mobile) ─────────────────── */
.fm-player-video { max-width: 80vw; max-height: 70vh; }
@media (max-width: 768px) {
    .fm-player-box {
        max-width: 100vw !important;
        width: 100vw;
        max-height: 100vh !important;
        height: auto;
        border-radius: 0 !important;
        padding: 8px !important;
        gap: 6px !important;
        box-sizing: border-box;
    }
    .fm-player-video {
        max-width: 96vw !important;
        width: 96vw;
        max-height: 56vh !important;
    }
    /* Selettori sottotitoli / lingua / qualità: impilati, leggibili */
    .fm-player-box select {
        font-size: 16px !important;   /* evita zoom auto iOS */
        padding: 8px 10px !important;
        min-height: 40px;
        max-width: 90vw;
    }
    .fm-player-box button { min-height: 38px; }
}

/* ── Bot Start banner (web panel, user never pressed Start) ───────── */
#bot-start-banner {
    margin: 0 0 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 238, 0, 0.08);
    border: 1px solid rgba(255, 238, 0, 0.35);
    border-left: 4px solid var(--neon-yellow);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}
#bot-start-banner .bsb-icon { font-size: 18px; flex-shrink: 0; }
#bot-start-banner a {
    color: var(--neon-cyan);
    font-weight: bold;
    text-decoration: none;
}
#bot-start-banner a:hover { text-decoration: underline; }
@media (max-width: 768px) {
    #bot-start-banner { margin: 0 0 12px; padding: 10px 12px; font-size: 12px; }
}

/* ── Marcatori cartella (badge + animazioni leggere) ─────────────────── */
@keyframes xfsMkPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes xfsMkHotGlow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(255,59,92,0)); }
    50%      { filter: drop-shadow(0 0 4px rgba(255,59,92,.65)); }
}
.xfs-mk-badge { transform-origin: center; }
.xfs-mk-anim { animation: xfsMkPulse 1.8s ease-in-out infinite; will-change: transform; }
.xfs-mk-hot-glow { animation: xfsMkHotGlow 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
    .xfs-mk-anim, .xfs-mk-hot-glow { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TICKET SYSTEM
   ═══════════════════════════════════════════════════════════════════════ */

.tickets-wrap {
    display: flex;
    gap: 16px;
    height: calc(100vh - 120px);
    min-height: 520px;
    overflow: hidden;
}

.tickets-col {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tickets-col-list {
    flex: 0 0 320px;
    max-width: 360px;
}

.tickets-col-thread {
    flex: 1 1 auto;
    min-width: 0;
}

.tickets-col-actions {
    flex: 0 0 260px;
    max-width: 300px;
}

.tickets-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.tickets-list-header h3 {
    margin: 0;
    color: var(--neon-cyan);
    font-size: 16px;
}

.tickets-count {
    background: var(--bg);
    color: var(--text-dim);
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: bold;
}

.tickets-new-btn {
    margin: 12px 16px 0;
}

.tickets-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.tickets-select,
.tickets-search {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

.tickets-select { flex: 0 0 auto; }
.tickets-search { flex: 1 1 auto; }

.tickets-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.tickets-card {
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    background: var(--bg);
    transition: background .15s, border-color .15s;
}

.tickets-card:hover { border-color: var(--neon-cyan); }
.tickets-card.selected { border-color: var(--neon-cyan); background: rgba(0,221,255,0.08); }
.tickets-card.unread { box-shadow: inset 3px 0 0 var(--neon-cyan); }

.tickets-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.tickets-card-id {
    font-weight: bold;
    color: var(--neon-cyan);
    font-size: 13px;
}

.tickets-card-time {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 11px;
}

.tickets-unread-badge {
    background: var(--neon-red);
    color: #fff;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.tickets-card-subject {
    font-weight: bold;
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.tickets-card-who {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 4px;
}

.tickets-card-preview {
    color: var(--text-dim);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tickets-thread-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
}

.tickets-thread-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    color: var(--text);
    font-size: 15px;
    flex: 1;
    min-width: 0;
}

.tickets-thread-title span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tickets-thread-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tickets-empty {
    color: var(--text-dim);
    text-align: center;
    padding: 30px 16px;
    font-size: 13px;
}

.tickets-back-btn {
    display: none;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.tickets-bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 10px;
    position: relative;
}

.tickets-bubble.user {
    align-self: flex-start;
    background: var(--bg);
    border: 1px solid var(--border);
}

.tickets-bubble.admin {
    align-self: flex-end;
    background: rgba(0,221,255,0.12);
    border: 1px solid var(--neon-cyan);
}

.tickets-bubble.system {
    align-self: center;
    background: rgba(255,193,7,0.1);
    border: 1px dashed var(--neon-yellow);
    color: var(--text-dim);
    font-size: 12px;
    max-width: 70%;
}

.tickets-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 12px;
}

.tickets-bubble-name {
    font-weight: bold;
    color: var(--neon-cyan);
}

.tickets-bubble-time {
    color: var(--text-dim);
    font-size: 11px;
}

.tickets-edit-btn {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    margin-left: auto;
}

.tickets-edit-btn:hover {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    background: rgba(0,221,255,0.06);
}

.tickets-edit-wrap {
    margin-top: 8px;
    padding: 8px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.tickets-bubble-body {
    color: var(--text);
    line-height: 1.55;
    font-size: 14px;
    word-break: break-word;
}

.tickets-bubble-body a {
    color: var(--neon-cyan);
    text-decoration: underline;
}

.tickets-bubble-body img {
    max-width: 100%;
    border-radius: 6px;
    margin: 4px 0;
}

.tickets-bubble-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.tickets-bubble-gallery img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.tickets-bubble-note {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 6px;
}

.tickets-reply-area {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    background: var(--bg);
}

.tickets-reply-area.tickets-blocked {
    color: var(--neon-red);
    text-align: center;
    font-size: 13px;
}

/* Composer */
.tickets-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tickets-editor-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.tickets-editor-tab {
    background: var(--bg);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 6px 6px 0 0;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    margin-bottom: -1px;
    white-space: nowrap;
}

.tickets-editor-tab.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--surface2);
    background: var(--surface2);
    font-weight: bold;
}

.tickets-editor-textarea {
    width: 100%;
    min-height: 120px;
    max-height: 220px;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0 8px 8px 8px;
    padding: 10px;
    font-size: 13px;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.tickets-editor-large .tickets-editor-textarea {
    min-height: 240px;
    max-height: 55vh;
    font-size: 14px;
}

.tickets-editor-large .tickets-editor-dropzone {
    padding: 16px;
    font-size: 13px;
}

.tickets-editor-large .tickets-editor-thumbs img {
    width: 96px;
    height: 96px;
}

.tickets-title-wrap {
    margin-bottom: 4px;
}

.tickets-title-input {
    width: 100%;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
}

.tickets-title-input:focus {
    border-color: var(--neon-cyan);
}

.tickets-preview-wrap {
    display: none;
    margin-top: 4px;
}

.tickets-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-dim);
    padding: 0 2px 4px;
}

.tickets-editor-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tickets-editor-dropzone {
    flex: 1;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
}

.tickets-editor-dropzone:hover,
.tickets-editor-dropzone.active {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0,221,255,0.06);
}

.tickets-editor-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tickets-thumb {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

.tickets-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tickets-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0,0,0,.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    line-height: 1;
    font-size: 10px;
}

.tickets-thumb-file {
    width: auto;
    min-width: 120px;
    height: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface2);
}

.tickets-thumb-icon {
    font-size: 22px;
}

.tickets-thumb-name {
    font-size: 11px;
    color: var(--text);
    word-break: break-word;
    max-width: 120px;
}

.tickets-thumb-size {
    font-size: 10px;
    color: var(--text-dim);
}

.tickets-file-attach {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--neon-cyan);
    font-size: 13px;
    text-decoration: none;
    word-break: break-word;
    max-width: 100%;
}

.tickets-file-attach:hover {
    border-color: var(--neon-cyan);
    background: rgba(0,221,255,0.06);
}

.tickets-editor-preview {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    min-height: 120px;
    max-height: 240px;
    overflow-y: auto;
    color: var(--text);
    transition: max-height .2s ease;
}

.tickets-editor-preview.expanded {
    max-height: 70vh;
}

.tickets-editor-preview h1,
.tickets-editor-preview h2,
.tickets-editor-preview h3 {
    color: var(--neon-cyan);
    margin: 6px 0 4px;
}

/* Actions panel */
.tickets-actions {
    padding: 16px;
}

.tickets-actions h4 {
    margin: 0 0 12px;
    color: var(--neon-cyan);
    font-size: 14px;
}

.tickets-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.tickets-info-label {
    color: var(--text-dim);
}

.tickets-action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .tickets-col-actions {
        display: none;
    }
    .tickets-col-list { flex: 0 0 280px; }
}

@media (max-width: 760px) {
    .tickets-wrap {
        position: relative;
        height: auto;
        min-height: calc(100vh - 100px);
    }
    .tickets-col-list,
    .tickets-col-actions,
    .tickets-col-thread {
        position: absolute;
        inset: 0;
        max-width: none;
        border: none;
        border-radius: 0;
        background: var(--surface2);
        z-index: 1;
    }
    .tickets-col-thread,
    .tickets-col-actions {
        z-index: 2;
        transform: translateX(100%);
        transition: transform .2s ease;
    }
    .tickets-col-thread.visible,
    .tickets-col-actions.visible {
        transform: translateX(0);
    }
    .tickets-back-btn.visible-mobile { display: inline-block; }
}

/* ── File Manager toolbar (redesign) ────────────────────────────────── */
.fm-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.fm-toolbar-search { display: flex; position: relative; }
.fm-toolbar-search input {
    flex: 1;
    border-radius: 10px !important;
    padding: 11px 14px !important;
    font-size: 14px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.25);
}
.fm-toolbar-search input:focus {
    outline: none;
    border-color: var(--neon-green) !important;
    box-shadow: 0 0 0 2px rgba(0,255,136,.18), inset 0 1px 3px rgba(0,0,0,.25);
}
.fm-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,0));
}
.fm-toolbar-actions .btn-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid var(--border);
    transition: transform .08s ease, filter .15s ease, box-shadow .15s ease;
}
.fm-toolbar-actions .btn-small:hover {
    transform: translateY(-1px);
    filter: brightness(1.12);
    box-shadow: 0 3px 10px rgba(0,0,0,.35);
}
.fm-toolbar-actions .btn-small:active { transform: translateY(0); }
.fm-toolbar-actions select {
    border-radius: 9px;
    padding: 7px 10px;
    font-size: 12.5px;
}
@media (max-width: 640px) {
    .fm-toolbar-actions { gap: 5px; padding: 6px; }
    .fm-toolbar-actions .btn-small { padding: 6px 9px; font-size: 11.5px; }
    .fm-toolbar-search input { padding: 10px 12px !important; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FEDIVERSO — pagina federazione fra domini
   ═════════════════════════════════════════════════════════════════════════ */
.fed-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 1100px) {
    .fed-grid { grid-template-columns: 1.6fr 1fr; }
    #fed-search-card { grid-row: span 2; }
}

.fed-config { border-left: 3px solid var(--neon-purple); }
.fed-config.fed-on  { border-left-color: var(--neon-green); }
.fed-config.fed-off { border-left-color: var(--text-dim); }
.fed-config-head { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: flex-start; }
.fed-badge {
    display: inline-block; font-family: var(--font-mono); font-size: 10.5px;
    letter-spacing: 1.4px; padding: 3px 9px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim); margin-bottom: 6px;
}
.fed-on .fed-badge { color: var(--neon-green); border-color: var(--neon-green); box-shadow: 0 0 12px rgba(0,255,136,.18); }
.fed-instance { margin: 2px 0 4px; font-size: 20px; }
.fed-domain { color: var(--neon-cyan); font-size: 12.5px; }
.fed-stats { display: flex; gap: 22px; }
.fed-stats div { text-align: center; }
.fed-stats b { display: block; font-size: 24px; color: var(--neon-cyan); font-family: var(--font-mono); }
.fed-stats span { font-size: 11px; color: var(--text-dim); }

.fed-admin { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.fed-switches { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.fed-switch { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; }
.fed-switch input { width: 17px; height: 17px; accent-color: var(--neon-green); }
.fed-nameline, .fed-addpeer { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 12px; }
.fed-nameline input, .fed-addpeer input {
    flex: 1 1 200px; padding: 9px 11px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-family: var(--font-mono); font-size: 13px;
}
.fed-nameline input:focus, .fed-addpeer input:focus,
.fed-searchbar input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: var(--shadow-glow); }

.fed-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fed-table th { text-align: left; color: var(--text-dim); font-weight: 500; font-size: 11px;
    letter-spacing: 1px; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.fed-table td { padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.fed-table code { color: var(--neon-cyan); font-size: 12px; }
.fed-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.fed-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px;
    font-family: var(--font-mono); border: 1px solid var(--border); }
.fed-pill-active  { color: var(--neon-green);  border-color: var(--neon-green); }
.fed-pill-pending { color: var(--neon-yellow); border-color: var(--neon-yellow); }
.fed-pill-blocked { color: var(--neon-red);    border-color: var(--neon-red); }
.fed-pill-error   { color: var(--neon-orange); border-color: var(--neon-orange); }
.fed-pill-done    { color: var(--neon-green);  border-color: var(--neon-green); }
.fed-err { color: var(--neon-red); font-size: 11.5px; margin-top: 3px; }
.fed-hint { color: var(--text-dim); font-size: 12px; margin-top: 10px; }

.fed-searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.fed-searchbar input {
    flex: 1; padding: 11px 13px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text); font-size: 14px;
}
.fed-states { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fed-chip { font-size: 11px; padding: 3px 10px; border-radius: 999px;
    border: 1px solid var(--border); color: var(--text-dim); font-family: var(--font-mono); }
.fed-chip-local { color: var(--neon-green); border-color: var(--neon-green); }

.fed-results { display: flex; flex-direction: column; gap: 9px; }
.fed-item { display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 11px 13px; background: var(--surface2); border: 1px solid var(--border);
    border-radius: var(--radius); border-left: 3px solid var(--neon-purple); }
.fed-item-local { border-left-color: var(--neon-green); }
.fed-item-title { font-weight: 600; margin-bottom: 3px; }
.fed-item-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-dim); }
.fed-item-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.fed-flag { color: var(--neon-cyan); font-family: var(--font-mono); }
.fed-local-tag { color: var(--neon-green); }
.fed-item-actions { display: flex; gap: 6px; flex-shrink: 0; }
.fed-warn { color: var(--neon-yellow); font-size: 12px; margin-top: 10px; }

.fed-mine-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--border); }
.fed-mine-row:last-child { border-bottom: none; }

.fed-toast { position: fixed; bottom: 22px; right: 22px; z-index: 9999;
    background: var(--surface2); border: 1px solid var(--neon-green);
    border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: var(--text);
    box-shadow: 0 8px 28px rgba(0,0,0,.5); transition: opacity .5s ease, transform .5s ease; }
.fed-toast-err { border-color: var(--neon-red); }
.fed-toast-out { opacity: 0; transform: translateY(10px); }

@media (max-width: 640px) {
    .fed-item { flex-direction: column; align-items: stretch; }
    .fed-item-actions { justify-content: flex-end; }
    .fed-stats { width: 100%; justify-content: space-around; }
    .fed-table th:nth-child(2), .fed-table td:nth-child(2) { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   FEDIVERSO v2 — "server browser" in stile GameTracker
   Tabella densa, intestazioni ambra, righe alternate, pillole di stato.
   ═══════════════════════════════════════════════════════════════════════ */
.gt-wrap { --gt-amber: #ffa726; --gt-amber-d: #c77800; --gt-line: #2a2a3e;
    --gt-row: #14141f; --gt-row2: #171724; --gt-head: #1c1c2b; }

.gt-banner {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    flex-wrap: wrap; padding: 14px 18px; margin-bottom: 14px; border-radius: var(--radius);
    background: linear-gradient(135deg, #14141f 0%, #1d1d2e 55%, #241a10 100%);
    border: 1px solid var(--gt-line); border-left: 4px solid var(--gt-amber);
}
.gt-logo { font-family: var(--font-mono); font-size: 26px; font-weight: 800; letter-spacing: 4px;
    color: var(--gt-amber); text-shadow: 0 0 14px rgba(255,167,38,.45); line-height: 1; }
.gt-tagline { font-size: 11.5px; color: var(--text-dim); letter-spacing: 1.4px;
    font-family: var(--font-mono); margin-top: 5px; }

.gt-self { display: flex; align-items: center; gap: 14px; padding: 8px 12px;
    background: rgba(0,0,0,.28); border: 1px solid var(--gt-line); border-radius: var(--radius); }
.gt-self-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green); flex-shrink: 0; }
.gt-self.off .gt-self-dot { background: var(--neon-red); box-shadow: 0 0 10px var(--neon-red); }
.gt-self-txt b { display: block; font-size: 14px; }
.gt-self-txt span { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }
.gt-self-stats { display: flex; gap: 16px; padding-left: 12px; border-left: 1px solid var(--gt-line); }
.gt-self-stats div { text-align: center; }
.gt-self-stats b { display: block; font-size: 17px; color: var(--gt-amber); font-family: var(--font-mono); }
.gt-self-stats span { font-size: 9.5px; color: var(--text-dim); letter-spacing: .8px; }
.gt-warn-n { color: var(--neon-yellow) !important; }

.gt-tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--gt-amber-d); }
.gt-tab { background: var(--gt-head); border: 1px solid var(--gt-line); border-bottom: none;
    color: var(--text-dim); padding: 9px 15px; font-size: 12px; letter-spacing: 1px;
    font-family: var(--font-mono); cursor: pointer; border-radius: 6px 6px 0 0; }
.gt-tab:hover { color: var(--text); background: #22223a; }
.gt-tab.active { background: var(--gt-amber-d); color: #120c02; font-weight: 700; border-color: var(--gt-amber); }

.gt-pane { padding-top: 14px; }
.gt-panel { background: var(--surface); border: 1px solid var(--gt-line);
    border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.gt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 9px 13px; background: linear-gradient(180deg, #23233a 0%, #1a1a29 100%);
    border-bottom: 1px solid var(--gt-line); }
.gt-head-t { font-family: var(--font-mono); font-size: 12px; letter-spacing: 1.6px;
    color: var(--gt-amber); font-weight: 700; }
.gt-head-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gt-head-tools input, .gt-seedrow input {
    padding: 7px 10px; background: var(--surface2); border: 1px solid var(--gt-line);
    border-radius: 5px; color: var(--text); font-size: 12.5px; min-width: 190px; }
.gt-body { padding: 13px; }

.gt-btn { display: inline-flex; align-items: center; justify-content: center;
    background: #22223a; border: 1px solid var(--gt-line); color: var(--text);
    padding: 7px 12px; font-size: 11.5px; letter-spacing: .6px; font-family: var(--font-mono);
    border-radius: 5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.gt-btn:hover { background: #2d2d4a; border-color: var(--gt-amber); color: #fff; }
.gt-btn-xs { padding: 4px 8px; font-size: 10.5px; }
.gt-btn-primary { background: var(--gt-amber-d); border-color: var(--gt-amber); color: #150e02; font-weight: 700; }
.gt-btn-primary:hover { background: var(--gt-amber); color: #150e02; }
.gt-btn-danger { border-color: #7a2233; color: #ff8fa3; }
.gt-btn-danger:hover { background: #48121f; border-color: var(--neon-red); color: #fff; }
.gt-btn:disabled { opacity: .55; cursor: default; }

/* Lampadine dei suggerimenti ---------------------------------------- */
.gt-bulb { background: transparent; border: 1px solid transparent; cursor: pointer;
    font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 5px; filter: grayscale(.6); }
.gt-bulb:hover { filter: none; background: rgba(255,167,38,.12); border-color: var(--gt-amber-d); }
.gt-bulb.on { filter: none; background: rgba(255,167,38,.2); border-color: var(--gt-amber); }
.gt-tip { display: flex; gap: 9px; align-items: flex-start; margin: 0; padding: 11px 14px;
    background: rgba(255,167,38,.07); border-left: 3px solid var(--gt-amber);
    border-bottom: 1px solid var(--gt-line); font-size: 12.5px; line-height: 1.55; color: var(--text); }
.gt-tip code { background: rgba(0,0,0,.35); padding: 1px 5px; border-radius: 3px;
    font-family: var(--font-mono); font-size: 11.5px; color: var(--neon-cyan); }
.gt-tip-ic { font-size: 15px; line-height: 1.3; }

.gt-offline { margin-top: 12px; padding: 11px 14px; border-radius: var(--radius);
    background: rgba(255,51,85,.08); border: 1px solid var(--neon-red); font-size: 13px; }

.gt-scan { padding: 6px 13px; font-size: 11.5px; color: var(--text-dim);
    font-family: var(--font-mono); border-bottom: 1px solid var(--gt-line); background: #12121c; }
.gt-scan-ok { color: var(--neon-green); }
.gt-scanning { color: var(--neon-yellow); }

/* Tabella server ----------------------------------------------------- */
.gt-tablewrap { overflow-x: auto; }
.gt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.gt-table thead th { background: var(--gt-head); color: var(--gt-amber); text-align: left;
    padding: 8px 10px; font-size: 10.5px; letter-spacing: 1.1px; font-family: var(--font-mono);
    border-bottom: 2px solid var(--gt-amber-d); white-space: nowrap; }
.gt-sortable { cursor: pointer; user-select: none; }
.gt-sortable:hover { color: #fff; }
.gt-table tbody tr { background: var(--gt-row); border-bottom: 1px solid #1f1f2e; }
.gt-table tbody tr:nth-child(even) { background: var(--gt-row2); }
.gt-table tbody tr:hover { background: #262640; }
.gt-table td { padding: 7px 10px; vertical-align: middle; }
.gt-table code { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); }
.gt-r-self { background: rgba(255,167,38,.09) !important; box-shadow: inset 3px 0 0 var(--gt-amber); }
.gt-r-off { opacity: .55; }
.gt-c-rank { width: 34px; color: var(--text-dim); font-family: var(--font-mono); }
.gt-c-st { width: 26px; }
.gt-c-name a { color: var(--text); text-decoration: none; font-weight: 600; }
.gt-c-name a:hover { color: var(--gt-amber); text-decoration: underline; }
.gt-num { text-align: right; font-family: var(--font-mono); }
.gt-c-act { white-space: nowrap; }
.gt-c-act .gt-btn { margin-left: 4px; }
.gt-loading { padding: 22px 12px !important; text-align: center; color: var(--text-dim); }
.gt-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.gt-dot.up { background: var(--neon-green); box-shadow: 0 0 7px var(--neon-green); }
.gt-dot.down { background: #66233a; }
.gt-ping-good { color: var(--neon-green); }
.gt-ping-mid { color: var(--neon-yellow); }
.gt-ping-bad, .gt-ping-na { color: var(--text-dim); }

.gt-pill { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 9.5px;
    letter-spacing: .9px; font-family: var(--font-mono); font-weight: 700; white-space: nowrap; }
.gt-pill-ok { background: rgba(0,255,136,.13); color: var(--neon-green); border: 1px solid #17603f; }
.gt-pill-wait { background: rgba(255,238,0,.11); color: var(--neon-yellow); border: 1px solid #6a6317; }
.gt-pill-run { background: rgba(0,221,255,.12); color: var(--neon-cyan); border: 1px solid #175a6a; }
.gt-pill-bad { background: rgba(255,51,85,.12); color: #ff7d95; border: 1px solid #6a1a2a; }
.gt-pill-none { background: rgba(255,255,255,.05); color: var(--text-dim); border: 1px solid var(--gt-line); }
.gt-pill-self { background: rgba(255,167,38,.15); color: var(--gt-amber); border: 1px solid var(--gt-amber-d); }

/* Dettaglio dominio (server info) ------------------------------------ */
.gt-detail-top { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 15px;
    background: linear-gradient(135deg, #16161f 0%, #1e1a12 100%); border-bottom: 1px solid var(--gt-line); }
.gt-detail-badge { width: 78px; height: 78px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-family: var(--font-mono);
    font-size: 11px; letter-spacing: 1px; flex-shrink: 0; }
.gt-detail-badge.up { background: rgba(0,255,136,.1); border: 2px solid var(--neon-green); color: var(--neon-green); }
.gt-detail-badge.down { background: rgba(255,51,85,.08); border: 2px solid #6a1a2a; color: #ff7d95; }
.gt-detail-id h3 { margin: 0 0 3px; font-size: 19px; }
.gt-detail-id a { color: var(--neon-cyan); font-size: 12.5px; font-family: var(--font-mono); text-decoration: none; }
.gt-detail-sw { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.gt-detail-stats { margin-left: auto; display: flex; gap: 20px; }
.gt-detail-stats b { display: block; font-size: 21px; color: var(--gt-amber); font-family: var(--font-mono); }
.gt-detail-stats span { font-size: 9.5px; color: var(--text-dim); letter-spacing: .8px; }
.gt-detail-body { padding: 13px; }

/* Righe di contenuto -------------------------------------------------- */
.gt-res { display: flex; flex-direction: column; gap: 1px; }
.gt-res-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: var(--gt-row); border-left: 3px solid transparent; }
.gt-res-row:nth-child(even) { background: var(--gt-row2); }
.gt-res-row:hover { background: #262640; border-left-color: var(--gt-amber); }
.gt-res-local { border-left-color: var(--neon-green); }
.gt-res-ic { font-size: 19px; flex-shrink: 0; }
.gt-res-main { flex: 1; min-width: 0; }
.gt-res-title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px;
    overflow: hidden; text-overflow: ellipsis; }
.gt-res-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    font-size: 11.5px; color: var(--text-dim); }
.gt-res-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.gt-res-act { display: flex; gap: 5px; flex-shrink: 0; }
.gt-flag { color: var(--gt-amber); font-family: var(--font-mono); }

.gt-imp-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px;
    border-bottom: 1px solid var(--gt-line); }
.gt-imp-row:last-child { border-bottom: none; }
.gt-imp-main { flex: 1; min-width: 0; }
.gt-imp-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.gt-bar { position: relative; height: 17px; margin-top: 7px; background: #0e0e18;
    border: 1px solid var(--gt-line); border-radius: 3px; overflow: hidden; }
.gt-bar-in { height: 100%; background: linear-gradient(90deg, var(--gt-amber-d), var(--gt-amber));
    transition: width .6s ease; }
.gt-bar-t { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-family: var(--font-mono); color: #fff; text-shadow: 0 1px 3px #000; }

.gt-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 13px; }
.gt-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 9px;
    border-radius: 999px; border: 1px solid var(--gt-line); color: var(--text-dim);
    font-family: var(--font-mono); background: var(--surface2); }
.gt-chip-bad { border-color: #6a1a2a; color: #ff7d95; }
.gt-chip-x { background: none; border: none; color: inherit; cursor: pointer; font-size: 14px;
    line-height: 1; padding: 0 2px; }
.gt-chip-x:hover { color: var(--neon-red); }
.gt-seedrow { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.gt-seedrow input { flex: 1; }
.gt-check { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13px; cursor: pointer; }
.gt-check input { width: 17px; height: 17px; accent-color: var(--gt-amber); cursor: pointer; }
.gt-muted { color: var(--text-dim); font-size: 12.5px; }
.gt-err { color: var(--neon-red); font-size: 12.5px; }
.gt-err-sm { color: #ff7d95; font-size: 11.5px; margin-top: 4px; }

/* ── Paginazione ────────────────────────────────────────────────────────
   Le liste del fediverso possono contare centinaia di righe: la ricerca
   filtra su tutto, la barra qui sotto mostra solo la fetta corrente.      */
.gt-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; padding: 9px 12px; border-top: 1px solid var(--border);
    background: var(--surface2); }
.gt-pg-info { font-size: 11.5px; color: var(--text-dim); font-family: var(--font-mono); }
.gt-pg-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.gt-pg-n { min-width: 28px; height: 26px; padding: 0 7px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); font-size: 11.5px; cursor: pointer;
    border-radius: 3px; font-family: var(--font-mono); }
.gt-pg-n:hover:not(:disabled) { border-color: var(--gt-amber); color: var(--gt-amber); }
.gt-pg-n.on { background: var(--gt-amber); border-color: var(--gt-amber); color: #1a1200; font-weight: 700; }
.gt-pg-n:disabled { opacity: .35; cursor: default; }
.gt-pg-gap { color: var(--text-dim); padding: 0 3px; align-self: center; }

/* ── Identità del dominio: avatar, descrizione, tag ─────────────────── */
.gt-av { display: inline-flex; align-items: center; justify-content: center; flex: none;
    border-radius: 5px; object-fit: cover; vertical-align: middle; color: #fff;
    font-weight: 700; letter-spacing: .5px; overflow: hidden; }
.gt-av-sm { width: 22px; height: 22px; font-size: 10px; margin-right: 7px; }
.gt-av-md { width: 40px; height: 40px; font-size: 15px; margin-right: 10px; }
.gt-av-lg { width: 96px; height: 96px; font-size: 34px; border-radius: 8px; }
.gt-av-mono { border: 1px solid rgba(255,255,255,.14); }
.gt-r-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; line-height: 1.35; }
.gt-detail-desc { font-size: 12.5px; color: var(--text); margin: 7px 0 5px; line-height: 1.45; }
.gt-profile { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.gt-prof-av { display: flex; flex-direction: column; gap: 7px; align-items: center; }
.gt-prof-txt { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 6px; }
.gt-prof-txt textarea { resize: vertical; font-family: inherit; }
.gt-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-dim); }
.gt-sm { font-size: 11.5px; }
.gt-badge { background: var(--gt-amber); color: #1a1200; font-size: 10.5px; font-weight: 700;
    border-radius: 9px; padding: 1px 7px; margin-left: 7px; }
.gt-tab-badge { background: var(--gt-amber); color: #1a1200; font-size: 10px; font-weight: 700;
    border-radius: 9px; padding: 1px 6px; margin-left: 7px; font-family: var(--font-mono);
    animation: gt-pulse 1.6s ease-in-out infinite; }
@keyframes gt-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

@media (max-width: 760px) {
    .gt-banner { flex-direction: column; align-items: stretch; }
    .gt-self { flex-wrap: wrap; }
    .gt-self-stats { padding-left: 0; border-left: none; width: 100%; justify-content: space-around; }
    .gt-head-tools { width: 100%; }
    .gt-head-tools input { min-width: 0; flex: 1; }
    .gt-table th:nth-child(6), .gt-table td:nth-child(6),
    .gt-table th:nth-child(7), .gt-table td:nth-child(7) { display: none; }
    .gt-res-row, .gt-imp-row { flex-wrap: wrap; }
    .gt-res-act, .gt-imp-act { width: 100%; justify-content: flex-end; }
    .gt-detail-stats { margin-left: 0; width: 100%; justify-content: space-around; }
    .gt-pager { justify-content: center; }
    .gt-profile { flex-direction: column; align-items: stretch; }
    .gt-prof-av { flex-direction: row; align-items: center; }
}
