/* ═══════════════════════════════════════════════════════════════════
   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; }

/* Rimando alla pagina di presentazione pubblica (/home) */
.btn-visita {
    display: block;
    margin: 10px auto 0;
    max-width: 344px;
    padding: 10px 14px;
    text-align: center;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .2px;
    color: var(--neon-cyan, #4ad9e4);
    border: 1px solid rgba(74, 217, 228, .35);
    border-radius: 12px;
    background: rgba(74, 217, 228, .07);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn-visita:hover {
    background: rgba(74, 217, 228, .16);
    border-color: rgba(74, 217, 228, .6);
    transform: translateY(-1px);
}


#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; }

/* I colori stanno su .gt-wrap, ma le schede servono anche fuori di lì (le
   notifiche non hanno un banner): se le ridichiaro qui funzionano ovunque. */
.gt-tabs { --gt-amber: #ffa726; --gt-amber-d: #c77800; --gt-line: #2a2a3e; --gt-head: #1c1c2b;
    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-head-tools select {
    padding: 7px 9px; background: var(--surface2); border: 1px solid var(--gt-line);
    border-radius: 5px; color: var(--text); font-size: 11.5px;
    font-family: var(--font-mono); cursor: pointer; }
.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-auth { color: #7fd4ff; }

/* ── Giudizi: cinque stelle e una riga ─────────────────────────────────── */
.gt-stars { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.gt-stars-g { color: #ffc94a; letter-spacing: 1px; font-size: 12px; }
.gt-stars-n { font-size: 11px; opacity: .85; }
.gt-giu { padding: 2px 6px !important; }
.fed-giu-box { max-width: 720px; }
.fed-giu-lista { display: flex; flex-direction: column; gap: 6px; }
.fed-giu-riga { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px;
                border: 1px solid rgba(255,255,255,.07); border-radius: 6px; }
.fed-giu-nasc { opacity: .45; text-decoration: line-through; }
.fed-giu-chi { font-weight: 600; font-size: 12px; }
.fed-giu-txt { font-size: 12px; opacity: .9; flex: 1;
               overflow-wrap: anywhere; }
.fed-giu-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fed-giu-scelta { display: inline-flex; gap: 2px; }
.fed-giu-s { background: none; border: none; cursor: pointer; font-size: 20px;
             line-height: 1; color: #6b7280; padding: 0 1px; }
.fed-giu-s.on, .fed-giu-s:hover { color: #ffc94a; }
.fed-giu-foot #fed-giu-t { flex: 1; min-width: 200px; }

/* ── Persone della federazione ───────────────────────────────────────────── */
.gt-people { display: flex; flex-direction: column; gap: 10px; }
.gt-person { border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
             background: rgba(255,255,255,.03); overflow: hidden; }
.gt-person-local { border-color: rgba(0,255,136,.28); }
.gt-person-head { display: flex; align-items: flex-start; gap: 12px; padding: 12px;
                  cursor: pointer; }
.gt-person-head:hover { background: rgba(255,255,255,.04); }
.gt-person-av { width: 56px; height: 56px; border-radius: 50%; flex: 0 0 auto;
                object-fit: cover; border: 1px solid rgba(255,255,255,.18); }
.gt-person-av-txt { display: flex; align-items: center; justify-content: center;
                    font-weight: 700; font-size: 20px; color: var(--text-dim);
                    background: rgba(255,255,255,.06); }
.gt-person-txt { flex: 1 1 auto; min-width: 0; }
.gt-person-n { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.gt-person-int { font-size: 12px; color: #7fd4ff; margin-top: 3px; }
.gt-person-act { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.gt-person-body { padding: 0 12px 12px 12px; }

.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; }
/* Una prenotazione non e' un errore: e' una promessa. Il tono lo dice. */
.gt-imp-wait { color: #ffd479; font-size: 11.5px; margin-top: 4px; }

/* Lo scaffale: pochi campi in riga, e un grigio per le spiegazioni.          */
.sc-search { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.sc-search input { flex: 1 1 220px; background: rgba(0,0,0,.35);
                   border: 1px solid var(--gt-line, #2a3550); color: var(--text);
                   padding: 7px 10px; border-radius: 3px; font-size: 12.5px; }
.sc-muted { color: var(--text-dim); font-size: 12px; }
.sc-err   { color: #ff7d95; font-size: 12.5px; }

/* Il modulo per pianificare: campi in colonna con l'etichetta sopra, perche'
   una riga di menu a tendina senza etichette non la capisce nessuno.        */
.gt-pl-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.gt-pl-form label { display: flex; flex-direction: column; gap: 4px;
                    font-size: 10.5px; letter-spacing: .06em; color: var(--text-dim);
                    text-transform: uppercase; }
.gt-pl-form select, .gt-pl-form input {
    background: rgba(0,0,0,.35); border: 1px solid var(--gt-line); color: var(--text);
    padding: 6px 8px; border-radius: 3px; font-size: 12px; min-width: 170px; }
.gt-pl-form #gt-pl-share { min-width: 280px; }
.gt-pl-form #gt-pl-ora { min-width: 110px; }

/* REGOLA CAPITALE: l'attributo hidden vince su tutto.
   I campi del modulo erano dichiarati display:flex e restavano visibili anche
   quando il codice li nascondeva: si sceglieva «controlla quali domini sono in
   linea» e comparivano lo stesso «da quale condivisione» e «in che modo». */
#gt-fediverso [hidden], .gt-wrap [hidden], .gt-panel [hidden], .gt-pl-form [hidden] { display: none !important; }

/* Il modulo largo: alcune cose (oggetto di un ticket, testo di un messaggio)
   non stanno in una colonnina da 170 pixel.                                 */
.gt-pl-wide { flex: 1 1 100%; }
.gt-pl-wide input, .gt-pl-wide select, .gt-pl-wide textarea { width: 100%; box-sizing: border-box; }
.gt-pl-form textarea { background: rgba(0,0,0,.35); border: 1px solid var(--gt-line);
    color: var(--text); padding: 8px 10px; border-radius: 3px; font-size: 12.5px;
    font-family: inherit; resize: vertical; }

/* Blocchi del piano: un titolo, poi i campi. Serve a separare «cosa fare»
   da «su cosa» e da «quando», che sono tre domande diverse.                */
.gt-pl-block { flex: 1 1 100%; border-top: 1px solid var(--border); padding-top: 10px;
    margin-top: 4px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.gt-pl-blabel { flex: 1 1 100%; font-size: 10.5px; letter-spacing: .08em;
    text-transform: uppercase; color: var(--gt-amber, #f0b429); margin-bottom: 2px; }
.gt-pl-hint { flex: 1 1 100%; font-size: 12.5px; color: var(--text-dim);
    background: rgba(240,180,41,.06); border-left: 2px solid var(--gt-amber, #f0b429);
    padding: 8px 11px; border-radius: 0 3px 3px 0; line-height: 1.5; }
.gt-pl-stat { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 12px;
    background: rgba(0,0,0,.22); border: 1px solid var(--border); border-radius: 4px;
    margin-bottom: 12px; font-size: 12.5px; }
.gt-pl-stat b { color: var(--text); }

/* Il selettore ricercabile: una tendina con trecento voci non è una scelta,
   è un labirinto. Qui si scrive due lettere e la lista si accorcia.        */
.gt-pick { flex: 1 1 100%; }
.gt-pick > input { width: 100%; box-sizing: border-box; }
.gt-pick-list { max-height: 230px; overflow-y: auto; margin-top: 6px;
    border: 1px solid var(--border); border-radius: 4px; background: rgba(0,0,0,.25); }
.gt-pick-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 7px 11px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.gt-pick-row:last-child { border-bottom: none; }
.gt-pick-row:hover { background: rgba(240,180,41,.09); }
.gt-pick-row.sel { background: rgba(240,180,41,.16); box-shadow: inset 2px 0 0 var(--gt-amber, #f0b429); }
.gt-pick-t { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-pick-m { color: var(--text-dim); font-size: 11px; white-space: nowrap; flex: 0 0 auto; }
.gt-pick-empty { padding: 14px; text-align: center; color: var(--text-dim); font-size: 12.5px; }
.gt-row-bad { box-shadow: inset 2px 0 0 var(--neon-red, #ff4d6d); }
.gt-code-sm { font-size: 11px; opacity: .75; }

/* ── La vetrina e le richieste ──────────────────────────────────────────
   Le due caselle stanno sotto il disco che riguardano, non in una pagina
   di impostazioni da qualche altra parte: si spuntano guardando la riga di
   cui si sta decidendo la sorte.                                          */
.sc-vet { display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
          margin-top: 8px; padding-top: 8px; border-top: 1px dashed #22303d; }
.sc-vet-c { display: inline-flex; align-items: center; gap: 6px;
            font-size: 12px; color: var(--text-dim); cursor: pointer; }
.sc-vet-c input { accent-color: var(--gt-amber, #f0b429); cursor: pointer; }
.sc-vet-c:hover { color: var(--text); }
.sc-vet-s { background: #0e1620; color: var(--text); border: 1px solid #22303d;
            border-radius: 5px; padding: 3px 6px; font-size: 11.5px; }

/* Il contatore delle richieste. Deve dare un po' fastidio: una richiesta
   che nessuno guarda lascia qualcuno ad aspettare per settimane. */
.sc-badge { display: inline-block; margin-left: 8px; min-width: 20px; padding: 1px 7px;
            border-radius: 10px; background: var(--neon-red, #ff4d6d); color: #0b0f14;
            font-size: 11.5px; font-weight: 700; text-align: center;
            animation: sc-batti 2.4s ease-in-out infinite; }
.sc-badge-go { background: var(--neon-green, #3ddc84); animation: none; }
@keyframes sc-batti { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .sc-badge { animation: none; } }
.sc-row-new { box-shadow: inset 2px 0 0 var(--gt-amber, #f0b429);
              background: rgba(240,180,41,.05); }

/* La barra della vetrina: resta attaccata in basso mentre si scorre, perché
   spuntare venti file e poi dover ritrovare il pulsante è una piccola
   crudeltà. */
.gt-vbar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center;
           gap: 12px; margin-top: 10px; padding: 10px 14px;
           background: rgba(14,22,32,.96); border: 1px solid var(--gt-amber, #f0b429);
           border-radius: 8px; box-shadow: 0 -6px 18px rgba(0,0,0,.45); }
.gt-vbar input { flex: 1 1 auto; min-width: 120px; background: #0b131c; color: var(--text);
                 border: 1px solid #22303d; border-radius: 5px; padding: 6px 9px; font-size: 12.5px; }
.gt-vck { width: 16px; height: 16px; accent-color: var(--gt-amber, #f0b429); cursor: pointer; }
.gt-pick-sel { background: rgba(240,180,41,.10); }

/* Le schede dello scaffale. Prima era tutto in colonna e una richiesta già
   accettata sembrava «tornare indietro» perché restava nello stesso elenco
   di quelle da decidere: ora ognuna ha il suo posto e il suo numero. */
.sc-pane { margin-top: 14px; }

/* Sfogliare gli scaffali: la vetrina si apre piena, non vuota. Una riga per
   disco, e ci si entra dentro con un clic. Le briciole dicono dove si è. */
.gt-vbrisciole { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                 margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.gt-vbr-su { background: none; border: 1px solid #2b3d50; color: var(--neon-cyan, #4ad9e4);
             border-radius: 6px; padding: 4px 10px; font-size: 11.5px; font-weight: 600;
             cursor: pointer; font-family: inherit; }
.gt-vbr-su:hover { border-color: var(--neon-cyan, #4ad9e4); background: rgba(74,217,228,.08); }
.gt-vbr-qui { font-size: 13px; font-weight: 700; color: var(--text); }

.gt-scaffali { display: grid; gap: 9px; }
.gt-scaff { display: flex; align-items: center; gap: 14px; cursor: pointer;
            border: 1px solid var(--border); border-radius: 8px; padding: 12px 15px;
            background: rgba(0,0,0,.18);
            transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.gt-scaff:hover { border-color: var(--gt-amber, #f0b429); background: rgba(240,180,41,.06);
                  transform: translateY(-1px); }
.gt-scaff-on { border-left: 3px solid var(--neon-green, #3ddc84); }
.gt-scaff-ic { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.gt-scaff-main { flex: 1 1 auto; min-width: 0; }
.gt-scaff-t { font-size: 14.5px; font-weight: 700; color: var(--text);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-scaff-s { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px;
              font-size: 12px; }
.gt-scaff-n { flex: 0 0 auto; text-align: right; font-size: 13px; line-height: 1.35; }
.gt-scaff-n b { color: var(--gt-amber, #f0b429); font-size: 15px; }
.gt-scaff-a { flex: 0 0 auto; }
@media (max-width: 620px) {
    .gt-scaff { flex-wrap: wrap; }
    .gt-scaff-n { text-align: left; }
}

/* ── Segnalazioni ───────────────────────────────────────────────────────
   Ognuna è una piccola conversazione: chi ha scritto, cosa, e la risposta. */
.gt-rep-sec { margin-bottom: 20px; }
.gt-rep-sect { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
    color: var(--gt-amber, #f0b429); border-bottom: 1px solid var(--border);
    padding-bottom: 6px; margin-bottom: 10px; }
.gt-rep-row { border: 1px solid var(--border); border-radius: 4px; padding: 11px 13px;
    margin-bottom: 9px; background: rgba(0,0,0,.18); }
.gt-rep-closed { opacity: .62; }
.gt-rep-head { display: flex; gap: 10px; align-items: flex-start; }
.gt-rep-ic { font-size: 17px; line-height: 1.2; flex: 0 0 auto; }
.gt-rep-t { flex: 1 1 auto; min-width: 0; }
.gt-rep-body { margin: 9px 0 0 27px; }
.gt-rep-msg { font-size: 12.5px; line-height: 1.55; padding: 8px 11px; border-radius: 4px;
    background: rgba(255,255,255,.035); margin-bottom: 7px; white-space: pre-wrap; }
.gt-rep-reply { background: rgba(80,200,140,.09); border-left: 2px solid #35c98a; }
.gt-rep-who { display: block; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-dim); margin-bottom: 4px; }
.gt-rep-act { display: flex; gap: 7px; flex-wrap: wrap; margin: 9px 0 0 27px; }

/* ── Profilo della persona ──────────────────────────────────────────── */
.gt-prof { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.gt-prof-l { flex: 0 0 190px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.gt-prof-r { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; }
.gt-prof-av { width: 150px; height: 150px; border-radius: 50%; overflow: hidden;
    border: 2px solid var(--gt-amber, #f0b429); background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 46px; font-weight: 700; color: var(--gt-amber, #f0b429); letter-spacing: .04em; }
.gt-prof-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gt-prof-f { display: flex; flex-direction: column; gap: 4px;
    font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-dim); }
.gt-prof-f input, .gt-prof-f textarea {
    background: rgba(0,0,0,.35); border: 1px solid var(--gt-line, #2a3550); color: var(--text);
    padding: 8px 10px; border-radius: 3px; font-size: 12.5px; font-family: inherit;
    text-transform: none; letter-spacing: 0; resize: vertical; }
.gt-prof-meta { margin-top: 16px; padding-top: 11px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-dim); }

/* ── Ticket: un filo di messaggi, come una chat ─────────────────────── */
.gt-thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px;
    max-height: 460px; overflow-y: auto; padding-right: 4px; }
.gt-msg { max-width: 82%; padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
    line-height: 1.55; }
.gt-msg-b { white-space: pre-wrap; word-break: break-word; }
.gt-msg-who { font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-dim); margin-bottom: 4px; display: flex; gap: 8px; }
.gt-msg-us { align-self: flex-end; background: rgba(240,180,41,.12);
    border: 1px solid rgba(240,180,41,.28); border-bottom-right-radius: 2px; }
.gt-msg-them { align-self: flex-start; background: rgba(255,255,255,.05);
    border: 1px solid var(--border); border-bottom-left-radius: 2px; }


/* ── 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; }

/* Tetti di condivisione: una griglia che si adatta, ogni voce con la sua
   etichetta sopra il campo. Su schermo stretto diventa una colonna sola. */
.gt-lim-grid { display: grid; gap: 10px 14px; margin: 10px 0;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.gt-lim-grid .gt-lbl { display: flex; flex-direction: column; gap: 4px; }
.gt-lim-grid input { width: 100%; }
.gt-lbl-inline { font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-dim); display: inline-flex; align-items: center; gap: 5px;
    white-space: nowrap; }
.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; }
}

/* ── Fediverso · finestra SFOGLIA (albero remoto, un livello per volta) ──────
   Non è un albero espandibile ma un file manager: si entra e si esce dalle
   cartelle. Con 4000 cartelle un albero aperto tutto insieme sarebbe
   illeggibile, e soprattutto costringerebbe a scaricarlo tutto.            */
.fed-brw-ov { position: fixed; inset: 0; z-index: 9000; display: none;
              align-items: center; justify-content: center;
              background: rgba(8, 16, 28, .62); backdrop-filter: blur(3px); }
.fed-brw-box { width: min(880px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
               background: linear-gradient(#f7fbff, #e8f1fb);
               border: 1px solid #7fa8d0; border-radius: 8px;
               box-shadow: 0 18px 48px rgba(0, 0, 0, .45); overflow: hidden; }
.fed-brw-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
                padding: 10px 14px; background: linear-gradient(#d9e9fb, #bcd8f2);
                border-bottom: 1px solid #7fa8d0; }
.fed-brw-tit { font-weight: 700; color: #14385c; display: flex; align-items: center; gap: 8px;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fed-brw-dom { font-weight: 400; font-size: .82em; color: #4a6d90; }
.fed-brw-aut { font-weight: 400; font-size: .82em; color: #1b5e9e; }
.fed-brw-desc { padding: 8px 14px; font-size: .86em; color: #34506b; background: #f4f9ff;
                border-bottom: 1px solid #cfe0f2; }
.fed-brw-crumbs { padding: 7px 14px; font-size: .86em; background: #eef5fd;
                  border-bottom: 1px solid #cfe0f2; overflow-x: auto; white-space: nowrap; }
.fed-brw-crumbs a { color: #1b5e9e; text-decoration: none; }
.fed-brw-crumbs a:hover { text-decoration: underline; }
.fed-brw-sep { color: #8fa9c2; margin: 0 6px; }
.fed-brw-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 14px; }
.fed-brw-sum { font-size: .82em; color: #4a6d90; margin-bottom: 8px; }
.fed-brw-tab { width: 100%; border-collapse: collapse; font-size: .9em; }
.fed-brw-tab tr { border-bottom: 1px solid #e2ecf7; }
.fed-brw-tab tr:hover { background: #f0f7ff; }
.fed-brw-tab tr.fed-brw-on { background: #dcefda; }
.fed-brw-tab td { padding: 5px 6px; vertical-align: middle; }
.fed-brw-c { width: 26px; }
.fed-brw-i { width: 24px; text-align: center; }
.fed-brw-n { word-break: break-all; }
.fed-brw-n a { color: #1b5e9e; text-decoration: none; font-weight: 600; }
.fed-brw-n a:hover { text-decoration: underline; }
.fed-brw-s { width: 90px; text-align: right; color: #4a6d90; font-size: .88em; white-space: nowrap; }
.fed-brw-b { width: 90px; text-align: right; color: #2c4f72; white-space: nowrap; }
.fed-brw-pg { display: flex; align-items: center; justify-content: center; gap: 10px;
              margin-top: 10px; font-size: .86em; color: #4a6d90; }
.fed-brw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px;
                padding: 10px 14px; background: linear-gradient(#e8f1fb, #d5e6f8);
                border-top: 1px solid #7fa8d0; }
.fed-brw-cnt { font-size: .88em; color: #14385c; font-weight: 600; }
.fed-brw-act { display: flex; gap: 8px; }
@media (max-width: 620px) {
    .fed-brw-s { display: none; }
    .fed-brw-box { width: 97vw; max-height: 94vh; }
}

/* ── Fediverso · «Come vuoi che arrivi?» ─────────────────────────────────────
   Tre modi di ottenere la stessa cartella, con conti in bolletta molto
   diversi. Si mostrano come tre schede alte e leggibili, non come tre righe
   di menu: la differenza fra «pochi secondi» e «tre ore» merita spazio.   */
.fed-modo-ov { display: flex; z-index: 9100; }
.fed-modo-box { width: min(620px, 94vw); max-height: 90vh; display: flex; flex-direction: column;
                background: linear-gradient(#f7fbff, #e8f1fb);
                border: 1px solid #7fa8d0; border-radius: 8px;
                box-shadow: 0 18px 48px rgba(0, 0, 0, .45); overflow: hidden; }
.fed-modo-body { flex: 1 1 auto; overflow-y: auto; padding: 12px 14px;
                 display: flex; flex-direction: column; gap: 10px; }
.fed-modo { display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
            padding: 11px 12px; border: 1px solid #cfe0f2; border-radius: 6px;
            background: #fdfeff; transition: border-color .12s, background .12s; }
.fed-modo:hover { border-color: #7fa8d0; background: #f2f8ff; }
.fed-modo:has(input:checked) { border-color: #3d84c6; background: #e7f2fd;
                               box-shadow: inset 0 0 0 1px #3d84c6; }
.fed-modo input { margin-top: 3px; flex: 0 0 auto; }
.fed-modo-txt { min-width: 0; }
.fed-modo-tit { font-weight: 700; color: #14385c; margin-bottom: 3px; }
.fed-modo-tit em { font-weight: 400; font-style: normal; color: #4a6d90; }
.fed-modo-des { font-size: .88em; color: #33536f; line-height: 1.45; }
.fed-modo-nota { font-size: .82em; font-style: italic; color: #5c7d9c; margin-top: 5px; }
.fed-modo-off { opacity: .55; cursor: not-allowed; }
.fed-modo-off:hover { border-color: #cfe0f2; background: #fdfeff; }
.fed-modo-off .fed-modo-nota { color: #a04a4a; }

/* ── La chat a stanze ───────────────────────────────────────────────────
   Tre colonne: dove si va, cosa si dicono, chi c'è. La colonna di mezzo è
   l'unica che cresce; le due laterali restano strette perché servono a
   orientarsi, non a essere lette.                                         */
.ch-grid { display: grid; grid-template-columns: 236px 6px minmax(240px,1fr) 6px 216px;
           gap: 6px; margin-top: 12px; height: calc(100vh - 240px); min-height: 420px; }
.ch-lato, .ch-gente { background: #0d151e; border: 1px solid #1b2836; border-radius: 8px;
                      padding: 10px; overflow-y: auto; }
.ch-lato-t { font-size: 11px; letter-spacing: .12em; color: var(--text-dim);
             margin: 6px 0 8px; text-transform: uppercase; }
.ch-gruppo { margin-bottom: 12px; }
.ch-gruppo-t { font-size: 11px; color: var(--gt-amber, #f0b429); margin-bottom: 4px;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-voce { display: flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 5px;
           cursor: pointer; font-size: 12.5px; color: var(--text); }
.ch-voce:hover { background: rgba(240,180,41,.09); }
.ch-voce-on { background: rgba(240,180,41,.16); box-shadow: inset 2px 0 0 var(--gt-amber, #f0b429); }
.ch-voce-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.ch-voce-g { color: var(--text-dim); font-size: 11px; flex: 0 0 auto; }
.ch-tag { font-size: 10px; padding: 1px 5px; border-radius: 8px; background: #16222e;
          color: var(--text-dim); flex: 0 0 auto; }
.ch-tag-ok { color: var(--neon-green, #3ddc84); }
.ch-nuovi { background: var(--neon-red, #ff4d6d); color: #0b0f14; font-size: 10.5px;
            font-weight: 700; border-radius: 9px; padding: 0 6px; }

.ch-centro { display: flex; flex-direction: column; background: #0d151e;
             border: 1px solid #1b2836; border-radius: 8px; overflow: hidden; }
.ch-testa { padding: 10px 12px; border-bottom: 1px solid #1b2836; }
.ch-testa-n { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.ch-testa-d { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.ch-testa-a { margin-top: 7px; display: flex; gap: 6px; }
.ch-vuoto { color: var(--text-dim); font-size: 12.5px; }
.ch-righe { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; }
.ch-riga { display: flex; gap: 8px; padding: 3px 0; font-size: 13px; line-height: 1.45;
           align-items: baseline; }
.ch-riga-io .ch-chi { color: var(--gt-amber, #f0b429); }
.ch-ora { color: #3d5063; font-size: 10.5px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.ch-chi { color: var(--neon-cyan, #4ad9e4); flex: 0 0 auto; max-width: 190px;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-dom { color: #46647f; font-size: 10.5px; margin-left: 2px; }
.ch-txt { color: var(--text); word-break: break-word; flex: 1 1 auto; }
.ch-txt a { color: var(--neon-cyan, #4ad9e4); }
.ch-serv { color: #46647f; font-size: 11.5px; font-style: italic; padding: 2px 0; }
.ch-scrivi { display: flex; gap: 8px; padding: 9px 12px; border-top: 1px solid #1b2836;
             align-items: flex-end; }
.ch-scrivi input, .ch-scrivi textarea {
                   flex: 1 1 auto; background: #0b111a; color: var(--text);
                   border: 1px solid #22303d; border-radius: 6px; padding: 8px 10px;
                   font-size: 13px; font-family: inherit; resize: none; line-height: 1.45;
                   max-height: 140px; overflow-y: auto; }
.ch-scrivi textarea:focus { outline: none; border-color: var(--gt-amber, #f0b429); }
.ch-scrivi input:disabled, .ch-scrivi textarea:disabled { opacity: .5; }

.ch-tizio { display: flex; align-items: center; gap: 5px; padding: 3px 2px; font-size: 12.5px; }
.ch-pallino { width: 7px; height: 7px; border-radius: 50%; background: #2a3a4a; flex: 0 0 auto; }
.ch-on, .ch-acceso { background: var(--neon-green, #3ddc84);
                     box-shadow: 0 0 5px rgba(61,220,132,.6); }
.ch-via { background: var(--gt-amber, #f0b429); box-shadow: 0 0 5px rgba(240,180,41,.5); }
.ch-tiepido { background: #3f6b52; }
.ch-spento { background: #2a3a4a; }
.ch-tizio-zitto { opacity: .45; }
.ch-segno { color: var(--gt-amber, #f0b429); width: 11px; flex: 0 0 auto; }
.ch-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-mod { margin-left: auto; display: none; gap: 2px; }
.ch-tizio:hover .ch-mod { display: flex; }
.ch-mini { background: none; border: none; cursor: pointer; font-size: 11px; opacity: .6; padding: 0 2px; }
.ch-mini:hover { opacity: 1; }
.ch-conto { font-size: 10.5px; color: #46647f; padding: 0 2px 6px;
            border-bottom: 1px solid #16222e; margin-bottom: 6px; }

/* ── Quello che si è aggiunto dopo ───────────────────────────────────────
   La chat era tre colonne e una casella. Adesso ha i comandi, la lista dei
   canali, l'argomento in cima e le colonne che si tirano: sono le stesse
   cose che avevano i programmi di chat prima che qualcuno decidesse che
   togliere fosse un progresso.                                            */

/* Le maniglie fra le colonne. Sono strette perché non devono farsi notare,
   ma il cursore che cambia forma le rende trovabili senza spiegazioni. */
.ch-tira { cursor: col-resize; border-radius: 3px; background: transparent;
           transition: background .12s; }
.ch-tira:hover, body.ch-tirando .ch-tira { background: rgba(240,180,41,.35); }
body.ch-tirando { user-select: none; cursor: col-resize; }

.ch-filtro { width: 100%; box-sizing: border-box; background: #0b111a; color: var(--text);
             border: 1px solid #22303d; border-radius: 5px; padding: 5px 8px;
             font-size: 12px; margin-bottom: 8px; }
.ch-filtro:focus { outline: none; border-color: var(--gt-amber, #f0b429); }

/* Il pallino che dice che il programma sta guardando. Non lampeggia sempre:
   fa un battito quando arriva qualcosa, che è l'unico momento in cui vale
   la pena guardarlo. */
.ch-vivo { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px;
           color: #46647f; margin-right: 6px; font-variant-numeric: tabular-nums; }
.ch-vivo-p { width: 6px; height: 6px; border-radius: 50%; background: #2f4a5e; }
.ch-vivo-on .ch-vivo-p { animation: ch-batti .9s ease-out; }
@keyframes ch-batti {
  0%   { background: var(--neon-green, #3ddc84); box-shadow: 0 0 0 0 rgba(61,220,132,.55); }
  100% { background: #2f4a5e; box-shadow: 0 0 0 7px rgba(61,220,132,0); }
}

/* L'argomento. Sta sotto il nome perché è la seconda cosa che si legge
   entrando, e la matita è lì accanto perché chi comanda non deve andarla
   a cercare in un menu. */
.ch-arg { display: flex; align-items: center; gap: 7px; margin-top: 5px;
          font-size: 12px; color: var(--text); }
.ch-arg-e { font-size: 9.5px; letter-spacing: .1em; color: #3d5063; flex: 0 0 auto; }
.ch-arg-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
            flex: 0 1 auto; min-width: 0; }
/* La matita sta attaccata all'argomento, non in fondo alla riga: si corregge
   quello che si sta leggendo, e l'occhio non deve attraversare mezza pagina
   per trovare il pulsante che riguarda la parola che ha appena letto. */
.ch-arg .ch-mini { flex: 0 0 auto; margin-right: auto; }
.ch-arg-in { flex: 1 1 auto; background: #0b111a; color: var(--text);
             border: 1px solid #22303d; border-radius: 5px; padding: 4px 7px; font-size: 12px; }
.ch-arg-in:focus { outline: none; border-color: var(--gt-amber, #f0b429); }

/* La barra dei segni. Sette pulsanti, non venti: chi scrive in grassetto
   dieci volte al giorno impara i segni a mano, e chi lo fa una volta al mese
   ha bisogno del pulsante. */
.ch-barra { display: flex; align-items: center; gap: 2px; padding: 5px 12px 0;
            flex-wrap: wrap; }
.ch-fmt { background: none; border: 1px solid transparent; color: #6e8ba3; cursor: pointer;
          font-size: 12px; padding: 2px 7px; border-radius: 4px; line-height: 1.4; }
.ch-fmt:hover { background: rgba(240,180,41,.12); color: var(--gt-amber, #f0b429);
                border-color: #2a3a4a; }
.ch-fmt-on { background: rgba(240,180,41,.2); color: var(--gt-amber, #f0b429);
             border-color: var(--gt-amber, #f0b429); }
.ch-barra-sep { width: 1px; height: 14px; background: #22303d; margin: 0 5px; }
.ch-barra-nota { margin-left: auto; font-size: 10.5px; color: #3d5063; }
.ch-barra-nota code, .ch-eco code, .ch-lab-n code { background: #16222e; border-radius: 3px;
                                                    padding: 0 4px; color: var(--neon-cyan, #4ad9e4); }

/* Le righe di servizio del programma: le risposte ai comandi. Sono rientrate
   e grigie perché non le ha scritte nessuno, e non devono farsi scambiare
   per qualcosa che qualcuno ha detto. */
.ch-eco { color: #7d99b0; font-size: 12px; padding: 4px 8px; margin: 3px 0 3px 18px;
          border-left: 2px solid #2a3a4a; background: rgba(255,255,255,.02); line-height: 1.5; }
.ch-eco a { color: var(--neon-cyan, #4ad9e4); }
.ch-eco-no { color: var(--neon-red, #ff4d6d); }

/* Il /me: non è una frase detta, è una cosa fatta, e si vede. */
.ch-azione { color: #c9a6e8; font-size: 13px; padding: 3px 0; line-height: 1.45; }
.ch-azione .ch-ora { margin-right: 8px; }
.ch-az-st { color: #8a6bb0; }
.ch-az-t { font-style: italic; }

/* Quando qualcuno mi nomina. Una riga sola, un filo di sfondo: abbastanza
   per accorgersene scorrendo, non tanto da urlare. */
.ch-riga-me { background: rgba(240,180,41,.07); border-left: 2px solid var(--gt-amber, #f0b429);
              margin-left: -12px; padding-left: 10px; }

.ch-giorno { text-align: center; margin: 10px 0 6px; position: relative; }
.ch-giorno::before { content: ''; position: absolute; left: 0; right: 0; top: 50%;
                     height: 1px; background: #1b2836; }
.ch-giorno span { position: relative; background: #0d151e; padding: 0 10px;
                  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
                  color: #3d5063; }

/* I segni nel testo. Il nascosto è l'unico che fa qualcosa al clic: sotto
   c'è una parola che qualcuno ha deciso di non far leggere di sfuggita. */
.ch-cod { background: #16222e; border: 1px solid #22303d; border-radius: 3px;
          padding: 0 4px; font-size: 12px; color: var(--neon-cyan, #4ad9e4); }
.ch-pre { background: #0b111a; border: 1px solid #22303d; border-radius: 5px;
          padding: 7px 9px; margin: 4px 0; font-size: 12px; color: #b8d0e0;
          overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.ch-cit { display: block; border-left: 3px solid #2f5a44; padding-left: 8px;
          color: #7fae95; font-style: italic; }
.ch-spo { background: #2a3a4a; color: transparent; border-radius: 3px; padding: 0 3px;
          cursor: pointer; user-select: none; }
.ch-spo-via { background: rgba(255,255,255,.05); color: inherit; user-select: text;
              cursor: auto; }
.ch-leg { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
          vertical-align: middle; margin-right: 2px; }

/* ── I riquadri ──────────────────────────────────────────────────────── */
.ch-ov { position: fixed; inset: 0; background: rgba(4,8,12,.72);
         backdrop-filter: blur(3px); z-index: 900; display: flex;
         align-items: center; justify-content: center; padding: 20px;
         animation: ch-appare .12s ease-out; }
@keyframes ch-appare { from { opacity: 0 } to { opacity: 1 } }
.ch-riq { background: #0d151e; border: 1px solid #2a3a4a; border-radius: 10px;
          box-shadow: 0 18px 50px rgba(0,0,0,.6); width: min(880px, 100%);
          max-height: 88vh; display: flex; flex-direction: column; }
.ch-riq-t { display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; border-bottom: 1px solid #1b2836;
            font-size: 12.5px; letter-spacing: .1em; color: var(--gt-amber, #f0b429); }
.ch-riq-x { background: none; border: none; color: #6e8ba3; font-size: 22px;
            line-height: 1; cursor: pointer; padding: 0 4px; }
.ch-riq-x:hover { color: var(--neon-red, #ff4d6d); }
.ch-riq-c { padding: 14px 16px; overflow-y: auto; }
.ch-riq-a { padding: 11px 16px; border-top: 1px solid #1b2836; display: flex;
            gap: 8px; justify-content: flex-end; }
.ch-chiedi { font-size: 13px; line-height: 1.6; color: var(--text); margin: 0; }

.ch-lab { display: block; font-size: 10px; letter-spacing: .1em; color: #3d5063;
          margin: 12px 0 4px; text-transform: uppercase; }
.ch-riq-c > .ch-lab:first-child { margin-top: 0; }
.ch-lab-n { text-transform: none; letter-spacing: 0; color: #46647f; font-size: 11.5px;
            line-height: 1.5; }
.ch-in { width: 100%; box-sizing: border-box; background: #0b111a; color: var(--text);
         border: 1px solid #22303d; border-radius: 5px; padding: 7px 9px; font-size: 13px;
         font-family: inherit; }
.ch-in:focus { outline: none; border-color: var(--gt-amber, #f0b429); }
.ch-in-n { width: 62px; }
.ch-due { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.ch-scelta { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px;
             font-size: 12.5px; line-height: 1.5; cursor: pointer; }
.ch-scelta input { margin-top: 3px; flex: 0 0 auto; }
.ch-scelta-r { margin-top: 0; align-items: center; }
.ch-nota-r { margin: 14px 0 0; padding: 8px 10px; border-radius: 6px; font-size: 11.5px;
             line-height: 1.5; background: rgba(255,77,109,.08);
             border: 1px solid rgba(255,77,109,.25); color: #ffa8b8; }

.ch-lista-inv { margin-top: 12px; max-height: 300px; overflow-y: auto; }
.ch-inv-r { display: flex; align-items: center; gap: 7px; padding: 5px 4px;
            border-bottom: 1px solid #16222e; font-size: 12.5px; }
.ch-inv-r .ch-mini { margin-left: auto; display: block; }

/* ── La lista dei canali ─────────────────────────────────────────────── */
.ch-filtri { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
             margin-bottom: 12px; }
.ch-filtri .ch-in { width: auto; flex: 0 0 auto; }
.ch-filtri #li-q { flex: 1 1 180px; min-width: 140px; }
.ch-min { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: #46647f; }
.ch-tab-w { max-height: 46vh; overflow-y: auto; border: 1px solid #1b2836; border-radius: 6px; }
.ch-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ch-tab th { position: sticky; top: 0; background: #101c27; text-align: left;
             padding: 7px 9px; font-size: 10px; letter-spacing: .1em; color: #6e8ba3;
             border-bottom: 1px solid #1b2836; cursor: pointer; user-select: none;
             white-space: nowrap; }
.ch-tab th:hover { color: var(--gt-amber, #f0b429); }
.ch-tab th.ch-ord::after { content: ' \25BC'; font-size: 8px; }
.ch-tab th.ch-ord-su::after { content: ' \25B2'; }
.ch-tab td { padding: 6px 9px; border-bottom: 1px solid #16222e; vertical-align: middle; }
.ch-tab tbody tr:hover { background: rgba(240,180,41,.06); }
.ch-num { text-align: right; font-variant-numeric: tabular-nums; }
.ch-arg-c { color: #8aa5ba; max-width: 320px; overflow: hidden; text-overflow: ellipsis;
            white-space: nowrap; }
.ch-conta { margin-top: 8px; font-size: 11px; color: #46647f; }

.ch-emo { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
          gap: 3px; max-height: 46vh; overflow-y: auto; }
.ch-emo-b { background: none; border: 1px solid transparent; border-radius: 5px;
            font-size: 19px; line-height: 1.5; cursor: pointer; padding: 2px; }
.ch-emo-b:hover { background: rgba(240,180,41,.14); border-color: #2a3a4a; }

.ch-gu-t { margin-bottom: 12px; }
.ch-gu-g { font-size: 10.5px; letter-spacing: .1em; color: var(--gt-amber, #f0b429);
           margin: 16px 0 6px; }
.ch-gu-g:first-child { margin-top: 0; }
.ch-tab-gu td { font-size: 12.5px; color: #a9c1d4; line-height: 1.5; }
.ch-tab-gu tbody tr:hover { background: transparent; }
.ch-gu-c { white-space: nowrap; width: 1%; vertical-align: top; }
.ch-gu-c code { background: #16222e; border: 1px solid #22303d; border-radius: 3px;
                padding: 1px 5px; color: var(--neon-cyan, #4ad9e4); font-size: 12px; }
.ch-gu-u { color: #46647f; font-size: 11px; margin-left: 5px; font-style: italic; }
.ch-gu-a { color: #3d5063; font-size: 10.5px; margin-top: 2px; }

@media (max-width: 900px) {
  .ch-grid { grid-template-columns: 1fr !important; height: auto; }
  .ch-tira { display: none; }
  .ch-lato, .ch-gente { max-height: 200px; }
  .ch-righe { min-height: 320px; }
  .ch-due { grid-template-columns: 1fr; }
  .ch-arg-c { max-width: 140px; }
}


/* ══ MODALI SCURI (XFSModale) ══════════════════════════════════════════
   Il pannello è nero: le finestre del browser, bianche e in inglese, ci
   cascavano dentro come un lampione acceso in faccia. Queste no. */
.xm-velo { position: fixed; inset: 0; z-index: 4000; display: flex;
           align-items: center; justify-content: center; padding: 20px;
           background: rgba(4,8,13,.72); backdrop-filter: blur(3px);
           opacity: 0; transition: opacity .16s ease; }
.xm-velo.xm-on { opacity: 1; }
.xm-box { width: min(560px, 100%); max-height: 84vh; display: flex; flex-direction: column;
          background: #10161f; border: 1px solid #2a3a4b; border-radius: 12px;
          box-shadow: 0 24px 60px rgba(0,0,0,.65);
          transform: translateY(10px) scale(.985); transition: transform .16s ease; }
.xm-velo.xm-on .xm-box { transform: none; }

.xm-testa { position: relative; padding: 15px 46px 13px 18px; border-bottom: 1px solid #22303d; }
.xm-t { font-size: 15px; font-weight: 700; color: #e8eef5; letter-spacing: .01em; }
.xm-sotto { margin-top: 10px; }
.xm-x { position: absolute; top: 10px; right: 12px; width: 28px; height: 28px;
        background: none; border: none; color: #7b8c9d; font-size: 21px; line-height: 1;
        cursor: pointer; border-radius: 6px; }
.xm-x:hover { background: #1b2531; color: #e8eef5; }

.xm-corpo { padding: 16px 18px; overflow: auto; }
.xm-testo { font-size: 13.5px; line-height: 1.55; color: #b9c6d3; }
.xm-testo b { color: #e8eef5; }
.xm-campo { width: 100%; margin-top: 13px; background: #0b131c; color: #e8eef5;
            border: 1px solid #2a3a4b; border-radius: 7px; padding: 9px 11px;
            font-size: 13.5px; font-family: inherit; resize: vertical; }
.xm-campo:focus { outline: none; border-color: #4ad9e4; box-shadow: 0 0 0 2px rgba(74,217,228,.14); }

.xm-piede { display: flex; align-items: center; justify-content: flex-end; gap: 9px;
            padding: 13px 18px; border-top: 1px solid #22303d; }
.xm-conto { margin-right: auto; font-size: 11.5px; color: #6d7f91; }
.xm-btn { border-radius: 7px; padding: 8px 16px; font-size: 12.5px; font-weight: 600;
          cursor: pointer; font-family: inherit; border: 1px solid #2a3a4b;
          background: #182231; color: #cfdae6; }
.xm-btn:hover { background: #1f2b3c; }
.xm-primario { background: #1f7a86; border-color: #2c9aa8; color: #eafcff; }
.xm-primario:hover { background: #2b93a1; }
.xm-danger { background: #7a2230; border-color: #a63142; color: #ffe9ec; }
.xm-danger:hover { background: #97303f; }

/* La lente. Con quaranta domini in un menu a tendina non si trova niente:
   qui si scrive tre lettere e la lista si stringe. */
.xm-lente { position: relative; }
.xm-lente-ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
               font-size: 13px; opacity: .65; pointer-events: none; }
.xm-filtro { width: 100%; background: #0b131c; color: #e8eef5; border: 1px solid #2a3a4b;
             border-radius: 7px; padding: 8px 11px 8px 32px; font-size: 13px; font-family: inherit; }
.xm-filtro:focus { outline: none; border-color: #4ad9e4; box-shadow: 0 0 0 2px rgba(74,217,228,.14); }

.xm-lista-corpo { padding-top: 8px; }
.xm-lista { display: grid; gap: 4px; }
.xm-vuoto { padding: 22px 4px; text-align: center; font-size: 13px; color: #6d7f91; }
.xm-voce { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
           background: none; border: 1px solid transparent; border-radius: 8px;
           padding: 9px 11px; cursor: pointer; font-family: inherit; color: #cfdae6; }
.xm-voce:hover { background: #18222f; border-color: #2a3a4b; }
.xm-voce-ic { font-size: 17px; flex: 0 0 auto; }
.xm-voce-m { flex: 1 1 auto; min-width: 0; display: block; }
.xm-voce-t { display: block; font-size: 13.5px; font-weight: 600; color: #e8eef5;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xm-voce-s { display: block; font-size: 11.5px; color: #7b8c9d; margin-top: 2px;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xm-voce-p { flex: 0 0 auto; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
             text-transform: uppercase; color: #f0b429; border: 1px solid #4a3a12;
             background: rgba(240,180,41,.10); border-radius: 20px; padding: 2px 9px; }

/* ══ Finestre del fediverso in tema scuro ══════════════════════════════
   Queste finestre erano rimaste chiare, in stile Aero, dentro un pannello
   nero: si apriva il giudizio e sembrava di accendere una lampadina in
   faccia. Il tema chiaro resta per chi lo sceglie; di default no. */
html:not([data-theme="light"]) .fed-brw-box,
html:not([data-theme="light"]) .fed-modo-box {
    background: #10161f; border-color: #2a3a4b; color: #cfdae6; }
html:not([data-theme="light"]) .fed-brw-head {
    background: #16202c; border-bottom-color: #22303d; }
html:not([data-theme="light"]) .fed-brw-tit { color: #e8eef5; }
html:not([data-theme="light"]) .fed-brw-dom,
html:not([data-theme="light"]) .fed-brw-sum,
html:not([data-theme="light"]) .fed-brw-s,
html:not([data-theme="light"]) .fed-brw-pg { color: #8497a8; }
html:not([data-theme="light"]) .fed-brw-aut,
html:not([data-theme="light"]) .fed-brw-n a,
html:not([data-theme="light"]) .fed-brw-crumbs a { color: #4ad9e4; }
html:not([data-theme="light"]) .fed-brw-desc {
    background: #131c26; color: #b9c6d3; border-bottom-color: #22303d; }
html:not([data-theme="light"]) .fed-brw-crumbs {
    background: #131c26; border-bottom-color: #22303d; }
html:not([data-theme="light"]) .fed-brw-sep { color: #56697c; }
html:not([data-theme="light"]) .fed-brw-tab tr { border-bottom-color: #1d2937; }
html:not([data-theme="light"]) .fed-brw-tab tr:hover { background: #18222f; }
html:not([data-theme="light"]) .fed-brw-tab tr.fed-brw-on { background: rgba(61,220,132,.12); }
html:not([data-theme="light"]) .fed-brw-b { color: #cfdae6; }
html:not([data-theme="light"]) .fed-brw-foot {
    background: #16202c; border-top-color: #22303d; }
html:not([data-theme="light"]) .fed-brw-cnt { color: #e8eef5; }
html:not([data-theme="light"]) .fed-giu-riga { border-color: #22303d; background: rgba(0,0,0,.20); }
html:not([data-theme="light"]) .fed-giu-chi { color: #e8eef5; }
html:not([data-theme="light"]) .fed-giu-txt { color: #b9c6d3; }
html:not([data-theme="light"]) .fed-giu-foot #fed-giu-t {
    background: #0b131c; color: #e8eef5; border: 1px solid #2a3a4b;
    border-radius: 6px; padding: 7px 10px; }
html:not([data-theme="light"]) .fed-giu-s { color: #55677a; }
html:not([data-theme="light"]) .fed-giu-s.on,
html:not([data-theme="light"]) .fed-giu-s:hover { color: #ffc94a; }

/* ── Fediverso · pulsante aggiorna e nota dei giudizi ────────────────── */
.gt-refresh { margin-left: auto; align-self: center; background: none; border: 1px solid #2a3a4b;
    color: #ffa726; font-size: 15px; line-height: 1; cursor: pointer; padding: 6px 11px;
    border-radius: 6px 6px 0 0; }
.gt-refresh:hover { background: #22223a; color: #fff; }
.gt-refresh:disabled { opacity: .55; cursor: default; }
.gt-gira { animation: gt-gira 900ms linear infinite; }
@keyframes gt-gira { to { transform: rotate(360deg); } }
.fed-giu-nota { padding: 9px 14px; font-size: 11.5px; line-height: 1.5;
    border-top: 1px solid #22303d; background: rgba(0,0,0,.25); color: #94a5b6; }
html[data-theme="light"] .fed-giu-nota { background: #eef5fd; color: #4a6d90;
    border-top-color: #cfe0f2; }

/* ── Fediverso · le pubblicazioni di una persona ─────────────────────── */
.gt-pers-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    padding: 8px 0 10px; border-bottom: 1px dashed #2a3a4b; margin-bottom: 8px; }
.gt-pers-tools .gt-pers-q { flex: 1 1 260px; min-width: 200px; }
.gt-pers-conto { font-size: 11.5px; color: #8497a8; margin: 0 0 8px; letter-spacing: .3px; }
.gt-pers-pg { display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 10px; font-size: 12px; color: #8497a8; }

/* ── Fediverso · scelta di un dominio (al posto del menu a tendina) ──── */
.gt-scelto { display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; text-align: left; cursor: pointer; padding: 9px 12px;
    background: #0f1620; border: 1px solid #2a3a4b; border-radius: 6px;
    color: #e8eef5; font-family: inherit; font-size: 13px; }
.gt-scelto:hover:not(:disabled) { border-color: #ffa726; background: #141d29; }
.gt-scelto:disabled { opacity: .55; cursor: default; }
.gt-scelto-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gt-scelto-ic { flex-shrink: 0; opacity: .8; }

/* ── Fediverso · rubrica con la faccia ──────────────────────────────── */
.gt-fr-ic { display: flex; align-items: center; justify-content: center; }
.gt-fr-av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 1px solid #2a3a4b; display: block; }
.gt-fr-av-txt { display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1d2b3a, #14202c); color: #7fd7e0;
    font-size: 13px; font-weight: 700; letter-spacing: .5px; }

/* ── Fediverso · pillola "roba nuova" ────────────────────────────────── */
.gt-pill-new { background: #3ddc84; color: #06240f; font-weight: 700;
    box-shadow: 0 0 10px rgba(61,220,132,.35); }

/* ── Fediverso · segnalazioni come una conversazione ─────────────────────
   Prima erano due righe di testo appiccicate, la seconda con lo sfondo un
   po' diverso: non si capiva chi diceva cosa. Due bolle affacciate lo
   dicono senza bisogno di leggere. */
.gt-conv { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 2px; }
.gt-bolla { border-radius: 10px; padding: 10px 13px; font-size: 13px; line-height: 1.55;
    max-width: 88%; border: 1px solid #22303d; background: #131c26; }
.gt-bolla-loro { align-self: flex-start; border-left: 3px solid #ffa726; }
.gt-bolla-noi  { align-self: flex-end; border-right: 3px solid #4ad9e4;
    background: #101d24; }
.gt-bolla-attesa { align-self: center; max-width: 100%; text-align: center;
    background: transparent; border: 1px dashed #2a3a4b; color: #8497a8; font-size: 12px; }
.gt-bolla-chi { display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    font-size: 11.5px; color: #8497a8; margin-bottom: 6px; }
.gt-bolla-chi b { color: #cfdae6; font-weight: 600; }
.gt-bolla-av { font-size: 14px; }
.gt-bolla-quando { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; opacity: .8; }
.gt-bolla-txt { color: #e2e9f0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 620px) { .gt-bolla { max-width: 100%; } }
.gt-bolla-nome b { color: #cfdae6; font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════════════
   PATTO FEDERALE — la scheda del governo della rete
   «La federazione non punisce. Smette di fidarsi.»
   Palette volutamente più fredda di quella ambra del server browser: qui non
   si cercano contenuti, si legge chi risponde di cosa.
   ═════════════════════════════════════════════════════════════════════════ */
#gt-pane-patto { --pt-line: #2a2a3e; --pt-card: #14141f; --pt-card2: #171724;
                 --pt-ok: #4caf87; --pt-no: #e0574a; --pt-med: #e2a33c; }

.pt-caricamento { padding: 26px; text-align: center; color: #8b93a3; font-size: 13px; }

.pt-testata { border: 1px solid var(--pt-line); border-radius: 8px; padding: 16px 18px;
              margin-bottom: 14px; background: linear-gradient(135deg, #16162a, #101018); }
.pt-testata.pt-dentro { border-left: 4px solid var(--pt-ok); }
.pt-testata.pt-fuori  { border-left: 4px solid #5a6172; }
.pt-motto { font-size: 15px; font-style: italic; color: #cfd8e6; margin-bottom: 12px; letter-spacing: .3px; }
.pt-stato-riga { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; }
.pt-pillola { padding: 4px 12px; border-radius: 20px; font-weight: 700; font-size: 11px; letter-spacing: .6px; }
.pt-p-ok { background: rgba(76,175,135,.16); color: var(--pt-ok); border: 1px solid rgba(76,175,135,.4); }
.pt-p-no { background: rgba(120,130,150,.14); color: #98a2b3; border: 1px solid rgba(120,130,150,.35); }
.pt-dom { color: #e2e9f0; font-weight: 600; }
.pt-impronta, .pt-dal { color: #7f8899; font-family: var(--font-mono); font-size: 11px; }

.pt-sotto-tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--pt-line);
                 margin-bottom: 14px; }
.pt-st { background: none; border: none; border-bottom: 2px solid transparent; color: #8b93a3;
         padding: 9px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: .7px;
         cursor: pointer; transition: color .15s, border-color .15s; }
.pt-st:hover { color: #cfd8e6; }
.pt-st.active { color: #fff; border-bottom-color: var(--pt-ok); }
.pt-st .gt-tab-badge { margin-left: 6px; }

.pt-card { background: var(--pt-card); border: 1px solid var(--pt-line); border-radius: 8px;
           padding: 16px 18px; margin-bottom: 14px; }
.pt-card h3 { margin: 0 0 10px; font-size: 14px; color: #fff; letter-spacing: .3px; }
.pt-card h4 { margin: 0 0 6px; font-size: 12px; color: #cfd8e6; }
.pt-card p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.65; color: #a8b2c1; }
.pt-card p.pt-p2 { color: #8b93a3; }
.pt-card code { font-family: var(--font-mono); font-size: 11.5px; color: #cfd8e6;
                background: #0e0e18; padding: 1px 5px; border-radius: 3px; }
.pt-card-libero { border-left: 3px solid #5a6172; background: var(--pt-card2); }
.pt-nota { font-size: 11.5px; color: #7f8899; line-height: 1.6; }
.pt-nota.pt-allarme { color: var(--pt-med); }
.pt-vuoto { padding: 18px; text-align: center; color: #6f7889; font-size: 12px; line-height: 1.7; }

.pt-obblighi { list-style: none; margin: 0; padding: 0; }
.pt-obblighi li { padding: 9px 0 9px 20px; border-bottom: 1px solid rgba(42,42,62,.6); position: relative; }
.pt-obblighi li:last-child { border-bottom: none; }
.pt-obblighi li::before { content: '·'; position: absolute; left: 6px; color: var(--pt-ok);
                          font-size: 20px; line-height: 1; }
.pt-obblighi b { display: block; color: #e2e9f0; font-size: 12.5px; margin-bottom: 3px; }
.pt-obblighi span { display: block; color: #8b93a3; font-size: 11.8px; line-height: 1.6; }

.pt-riga-check { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px;
                 font-size: 12.5px; color: #a8b2c1; cursor: pointer; }
.pt-riga-check input { margin-top: 2px; }
.pt-riga-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.pt-input { flex: 1 1 240px; background: #0e0e18; border: 1px solid var(--pt-line); border-radius: 5px;
            color: #e2e9f0; padding: 7px 10px; font-size: 12.5px; }
.pt-azioni { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.pt-tab { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.pt-tab th { text-align: left; padding: 7px 8px; color: #7f8899; font-size: 10.5px;
             letter-spacing: .7px; border-bottom: 1px solid var(--pt-line); }
.pt-tab td { padding: 8px; border-bottom: 1px solid rgba(42,42,62,.5); color: #cfd8e6; }
.pt-tab tr.pt-revocato td { opacity: .45; text-decoration: line-through; }
.pt-mono { font-family: var(--font-mono); }
.pt-piccolo { font-size: 10.5px; color: #7f8899; }

.pt-liste { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.pt-lista { flex: 1 1 190px; background: var(--pt-card2); border-radius: 6px; padding: 10px 12px;
            border-left: 3px solid #5a6172; }
.pt-lista h4 span { color: #7f8899; font-weight: 400; }
.pt-lista ul { list-style: none; margin: 0; padding: 0; }
.pt-lista li { font-size: 11.8px; color: #cfd8e6; padding: 3px 0; }
.pt-lista li small { display: block; color: #6f7889; font-size: 10.5px; }
.pt-l-b { border-left-color: var(--pt-ok); }
.pt-l-g { border-left-color: var(--pt-med); }
.pt-l-n { border-left-color: var(--pt-no); }

.pt-sem { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; padding: 2px 8px;
          border-radius: 3px; }
.pt-sem-b { background: rgba(76,175,135,.15); color: var(--pt-ok); }
.pt-sem-g { background: rgba(226,163,60,.15); color: var(--pt-med); }
.pt-sem-n { background: rgba(224,87,74,.15); color: var(--pt-no); }
.pt-sem-i { background: rgba(120,130,150,.13); color: #8b93a3; }
.pt-voto { font-size: 16px; font-weight: 700; font-family: var(--font-mono); }
.pt-voto small { font-size: 10px; opacity: .55; font-weight: 400; }
.pt-v-alto { color: var(--pt-ok); } .pt-v-medio { color: var(--pt-med); } .pt-v-basso { color: var(--pt-no); }

.pt-fascicoli { display: flex; flex-direction: column; gap: 10px; }
.pt-fasc { background: var(--pt-card); border: 1px solid var(--pt-line); border-left: 3px solid #5a6172;
           border-radius: 6px; padding: 12px 14px; }
.pt-fasc-mia { border-left-color: var(--pt-med); background: #191426; }
.pt-fasc-cap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 5px; }
.pt-rif { font-family: var(--font-mono); font-size: 12px; color: #fff; font-weight: 600; }
.pt-fase { font-size: 9.5px; font-weight: 700; letter-spacing: .6px; padding: 2px 8px; border-radius: 3px; }
.pt-f-att { background: rgba(226,163,60,.15); color: var(--pt-med); }
.pt-f-giu { background: rgba(90,140,220,.16); color: #7ba7e8; }
.pt-f-dec { background: rgba(120,130,150,.14); color: #98a2b3; }
.pt-f-mia { background: rgba(224,87,74,.15); color: var(--pt-no); }
.pt-fasc-tipo { font-size: 11px; color: #8b93a3; }
.pt-fasc-chi, .pt-fasc-ogg { font-size: 11.5px; color: #8b93a3; margin-bottom: 4px; }
.pt-fasc-mot { font-size: 12.5px; color: #cfd8e6; line-height: 1.6; margin: 7px 0;
               white-space: pre-wrap; word-break: break-word; }
.pt-voti { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11px; margin-top: 6px; }
.pt-v-si { color: var(--pt-no); } .pt-v-no { color: var(--pt-ok); } .pt-v-ast { color: #8b93a3; }
.pt-esito { margin-top: 8px; padding: 7px 10px; background: #0e0e18; border-radius: 5px;
            font-size: 12px; color: #cfd8e6; }
.pt-fasc-az { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.pt-pagella { display: flex; flex-direction: column; gap: 3px; padding: 10px 0;
              border-bottom: 1px solid rgba(42,42,62,.5); }
.pt-pagella:last-child { border-bottom: none; }
.pt-pag-cap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pt-pag-dom { font-size: 13px; color: #e2e9f0; font-weight: 600; min-width: 170px; }
.pt-pag-let { font-size: 11px; color: #8b93a3; font-style: italic; }
.pt-pag-chi { font-size: 10.8px; color: #6f7889; font-family: var(--font-mono); }
.pt-miogiudizio { padding: 12px 0; border-bottom: 1px solid rgba(42,42,62,.5); }
.pt-miogiudizio:last-child { border-bottom: none; }
.pt-voce { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #8b93a3;
           margin-top: 5px; }
.pt-voce span { flex: 0 0 150px; }
.pt-voce b { flex: 0 0 52px; text-align: right; color: #cfd8e6; font-family: var(--font-mono); font-size: 11px; }
.pt-barra { flex: 1; height: 6px; background: #0e0e18; border-radius: 3px; overflow: hidden; }
.pt-barra i { display: block; height: 100%; background: linear-gradient(90deg, #3c7f66, var(--pt-ok)); }

.pt-albo { display: flex; flex-direction: column; }
.pt-alboriga { display: flex; gap: 11px; padding: 10px 0;
               border-bottom: 1px solid rgba(42,42,62,.5); }
.pt-alboriga:last-child { border-bottom: none; }
.pt-albo-ic { font-size: 15px; flex: 0 0 22px; text-align: center; }
.pt-albo-cap { font-size: 11.5px; color: #8b93a3; margin-bottom: 3px; }
.pt-albo-cap b { color: #cfd8e6; text-transform: uppercase; letter-spacing: .5px; font-size: 10.5px; }
.pt-albo-q { margin-left: 8px; font-family: var(--font-mono); font-size: 10.5px; opacity: .8; }
.pt-albo-testo { font-size: 12.3px; color: #cfd8e6; line-height: 1.6; }

/* Tema chiaro: la scheda deve restare leggibile anche di giorno. */
[data-theme="light"] #gt-pane-patto { --pt-line: #d9dee7; --pt-card: #fff; --pt-card2: #f6f8fb; }
[data-theme="light"] .pt-testata { background: linear-gradient(135deg, #f2f5fa, #e9edf4); }
[data-theme="light"] .pt-motto,
[data-theme="light"] .pt-dom,
[data-theme="light"] .pt-card h3,
[data-theme="light"] .pt-obblighi b,
[data-theme="light"] .pt-fasc-mot,
[data-theme="light"] .pt-albo-testo,
[data-theme="light"] .pt-pag-dom,
[data-theme="light"] .pt-rif { color: #1d2430; }
[data-theme="light"] .pt-card p,
[data-theme="light"] .pt-obblighi span,
[data-theme="light"] .pt-tab td,
[data-theme="light"] .pt-lista li { color: #4a5563; }
[data-theme="light"] .pt-card code,
[data-theme="light"] .pt-barra,
[data-theme="light"] .pt-esito,
[data-theme="light"] .pt-input { background: #eef1f6; }

/* Pulsanti della scheda: non riuso .btn-neon del pannello perché qui la
   palette è fredda e i verdi/rossi hanno un significato preciso. */
.pt-btn { background: #1c1c2b; border: 1px solid var(--pt-line); border-radius: 5px;
          color: #cfd8e6; padding: 7px 14px; font-family: inherit; font-size: 12px;
          cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.pt-btn:hover { background: #24243a; border-color: #3a3a55; color: #fff; }
.pt-btn:disabled { opacity: .45; cursor: default; }
.pt-btn-si { border-color: rgba(76,175,135,.55); color: var(--pt-ok); }
.pt-btn-si:hover { background: rgba(76,175,135,.14); border-color: var(--pt-ok); color: var(--pt-ok); }
.pt-btn-ghost { background: transparent; color: #8b93a3; }
.pt-btn-ghost:hover { background: rgba(255,255,255,.05); color: #cfd8e6; }
.pt-btn-mini { padding: 4px 10px; font-size: 11px; }
.pt-revoca { border-color: rgba(224,87,74,.45); color: var(--pt-no); }
.pt-revoca:hover { background: rgba(224,87,74,.13); border-color: var(--pt-no); color: var(--pt-no); }
.pt-vota { border-color: rgba(90,140,220,.45); color: #7ba7e8; }
[data-theme="light"] .pt-btn { background: #f2f5fa; color: #3a4553; }
[data-theme="light"] .pt-btn:hover { background: #e6ecf4; color: #1d2430; }

/* ═══════════════════════════════════════════════════════════════════════════
   FIDUCIA DISTRIBUITA — manifesto, lampadine e guida
   «Non si distribuiscono solo file. Si distribuisce fiducia.»
   ═══════════════════════════════════════════════════════════════════════════*/
.pt-insegna { font-size: 11px; font-weight: 700; letter-spacing: 2.4px; text-transform: uppercase;
              color: var(--pt-ok); margin-bottom: 7px; }
.pt-corpo { margin-top: 4px; }

/* ── La lampadina: il pezzo che spiega ─────────────────────────────────── */
.pt-lampada { display: flex; gap: 11px; align-items: flex-start; margin: 12px 0;
              padding: 12px 14px; border-radius: 7px;
              background: linear-gradient(180deg, rgba(226,163,60,.09), rgba(226,163,60,.04));
              border: 1px solid rgba(226,163,60,.24); border-left: 3px solid var(--pt-med); }
.pt-lamp-ic { font-size: 16px; line-height: 1.2; flex: 0 0 auto; filter: saturate(1.2); }
.pt-lampada div { font-size: 12.3px; line-height: 1.72; color: #a8b2c1; }
.pt-lampada b { display: block; color: #e8d8b4; font-size: 12.5px; margin-bottom: 4px;
                font-weight: 600; letter-spacing: .2px; }
.pt-lampada code { background: rgba(0,0,0,.28); }

/* ── Il manifesto ──────────────────────────────────────────────────────── */
.pt-manifesto { border: 1px solid var(--pt-line); border-radius: 9px; padding: 20px 22px;
                margin-bottom: 14px;
                background: radial-gradient(120% 140% at 0% 0%, #1a1a2b 0%, #101019 62%); }
.pt-man-cap { display: flex; gap: 15px; align-items: center; margin-bottom: 16px;
              padding-bottom: 14px; border-bottom: 1px solid var(--pt-line); }
.pt-man-sigillo { font-size: 30px; line-height: 1; color: var(--pt-ok); flex: 0 0 auto;
                  text-shadow: 0 0 22px rgba(76,175,135,.45); }
.pt-man-cap h3 { margin: 0 0 4px; font-size: 16px; color: #fff; letter-spacing: .4px; }
.pt-man-sub { margin: 0; font-size: 12px; color: #8b93a3; font-style: italic; }
.pt-man-punti { display: flex; flex-wrap: wrap; gap: 14px; }
.pt-man-punto { flex: 1 1 260px; background: var(--pt-card2); border-radius: 7px;
                padding: 14px 16px 12px; border-top: 2px solid var(--pt-ok); position: relative; }
.pt-man-punto:nth-child(2) { border-top-color: #7ba7e8; }
.pt-man-punto:nth-child(3) { border-top-color: var(--pt-med); }
.pt-man-n { position: absolute; top: 11px; right: 13px; font-size: 30px; font-weight: 800;
            color: rgba(255,255,255,.055); line-height: 1; font-family: var(--font-mono); }
.pt-man-punto h4 { margin: 0 0 7px; font-size: 13px; color: #fff; letter-spacing: .2px; }
.pt-man-punto p { margin: 0 0 8px; font-size: 12.3px; line-height: 1.68; color: #a8b2c1; }
.pt-man-punto p.pt-p2 { color: #828b9b; font-size: 11.9px; margin-bottom: 0; }
.pt-man-punto b { color: #e2e9f0; }
.pt-man-chiusa { margin-top: 16px; padding: 13px 16px; border-radius: 7px;
                 background: rgba(76,175,135,.07); border: 1px dashed rgba(76,175,135,.3);
                 font-size: 12.8px; line-height: 1.7; color: #b9c4d2; text-align: center; }
.pt-man-chiusa b { color: var(--pt-ok); }

/* ── Quando sì / quando no ─────────────────────────────────────────────── */
.pt-quando { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.pt-q-si, .pt-q-no { flex: 1 1 250px; background: var(--pt-card2); border-radius: 7px;
                     padding: 12px 15px; border-left: 3px solid var(--pt-ok); }
.pt-q-no { border-left-color: #5a6172; }
.pt-q-si h4, .pt-q-no h4 { margin: 0 0 8px; font-size: 12px; color: #e2e9f0; }
.pt-q-si ul, .pt-q-no ul { margin: 0; padding-left: 17px; }
.pt-q-si li, .pt-q-no li { font-size: 11.9px; line-height: 1.62; color: #8b93a3; padding: 3px 0; }

/* ── I casi d'esempio ──────────────────────────────────────────────────── */
.pt-card-guida { border-left: 3px solid #7ba7e8; }
.pt-st-guida.active { border-bottom-color: #7ba7e8; }
.pt-caso { background: var(--pt-card2); border-radius: 7px; padding: 14px 16px; margin: 12px 0;
           border: 1px solid rgba(42,42,62,.8); }
.pt-caso-cap { display: flex; gap: 11px; align-items: center; margin-bottom: 8px; }
.pt-caso-n { flex: 0 0 24px; height: 24px; border-radius: 50%; background: rgba(123,167,232,.15);
             color: #7ba7e8; font-size: 12px; font-weight: 700; display: flex;
             align-items: center; justify-content: center; font-family: var(--font-mono); }
.pt-caso-cap h4 { margin: 0; font-size: 13px; color: #fff; }
.pt-caso-sit { margin: 0 0 9px; font-size: 12.2px; line-height: 1.66; color: #9aa4b3;
               font-style: italic; }
.pt-caso-passi { margin: 0 0 10px; padding-left: 19px; }
.pt-caso-passi li { font-size: 12.1px; line-height: 1.68; color: #a8b2c1; padding: 4px 0; }
.pt-caso-passi b { color: #e2e9f0; }
.pt-caso-morale { padding: 9px 12px; border-radius: 6px; background: rgba(76,175,135,.07);
                  border-left: 2px solid var(--pt-ok); font-size: 12.1px; line-height: 1.66;
                  color: #9fb5ab; }

/* ── Glossario e domande ───────────────────────────────────────────────── */
.pt-glossario { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.pt-gl { flex: 1 1 220px; background: var(--pt-card2); border-radius: 6px; padding: 11px 13px;
         border-left: 2px solid var(--pt-ok); }
.pt-gl b { display: block; color: #fff; font-size: 12.5px; margin-bottom: 4px; }
.pt-gl span { display: block; font-size: 11.7px; line-height: 1.62; color: #8b93a3; }
.pt-faq { display: flex; flex-direction: column; }
.pt-fq { padding: 11px 0; border-bottom: 1px solid rgba(42,42,62,.6); }
.pt-fq:last-child { border-bottom: none; }
.pt-fq b { display: block; color: #e2e9f0; font-size: 12.5px; margin-bottom: 5px; }
.pt-fq span { display: block; font-size: 12.1px; line-height: 1.7; color: #8b93a3; }
.pt-lista-sp { margin: 0 0 7px; font-size: 11px; color: #6f7889; line-height: 1.55; }

/* ── Tema chiaro ───────────────────────────────────────────────────────── */
[data-theme="light"] .pt-manifesto { background: linear-gradient(135deg, #f4f7fb, #eaeff6); }
[data-theme="light"] .pt-man-cap h3,
[data-theme="light"] .pt-man-punto h4,
[data-theme="light"] .pt-caso-cap h4,
[data-theme="light"] .pt-gl b,
[data-theme="light"] .pt-fq b { color: #1d2430; }
[data-theme="light"] .pt-man-punto p,
[data-theme="light"] .pt-caso-passi li,
[data-theme="light"] .pt-lampada div,
[data-theme="light"] .pt-gl span,
[data-theme="light"] .pt-fq span,
[data-theme="light"] .pt-q-si li,
[data-theme="light"] .pt-q-no li { color: #4a5563; }
[data-theme="light"] .pt-man-punto,
[data-theme="light"] .pt-caso,
[data-theme="light"] .pt-gl,
[data-theme="light"] .pt-q-si,
[data-theme="light"] .pt-q-no { background: #f2f5fa; }
[data-theme="light"] .pt-lampada { background: #fdf6e6; border-color: rgba(190,140,40,.35); }
[data-theme="light"] .pt-lampada b { color: #8a6410; }
[data-theme="light"] .pt-man-n { color: rgba(0,0,0,.06); }
[data-theme="light"] .pt-man-chiusa,
[data-theme="light"] .pt-caso-morale { color: #3f6455; }

/* ═══════════════════════════════════════════════════════════════════════════
   LA SCHEDA DEGLI AGGIORNAMENTI
   Sta in cima alle impostazioni. Deve dire tre cose in un colpo d'occhio:
   che versione gira qui, se ne è uscita una nuova, e cosa si può farne.
   Niente allarmismo: il rosso è riservato alla sicurezza, e solo a quella.
   ═══════════════════════════════════════════════════════════════════════════ */

#scheda-agg { margin-bottom: 18px; }
.agg-attesa { opacity: .6; font-size: 13px; padding: 6px 0; }

.agg-allarme {
    background: rgba(255,77,77,.10);
    border: 1px solid rgba(255,77,77,.45);
    border-left: 3px solid #ff4d4d;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13.5px;
    line-height: 1.55;
}
.agg-allarme b { color: #ff7b7b; }

.agg-righe { display: flex; flex-direction: column; gap: 7px; }
.agg-r { display: flex; gap: 14px; align-items: baseline; font-size: 13.5px; }
.agg-et {
    flex: 0 0 152px;
    opacity: .55;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.agg-va { font-family: 'Consolas', 'Menlo', monospace; }
.agg-va.agg-nuova { color: var(--neon-yellow, #ffd24a); font-weight: 600; }
.agg-va.agg-ok    { color: #4ade80; }

.agg-note {
    margin-top: 12px;
    padding: 10px 14px;
    border-left: 2px solid rgba(255,255,255,.16);
    font-size: 13.5px;
    line-height: 1.6;
    opacity: .85;
}

/* ── Le due strade, affiancate e pari ──────────────────────────────────────
   Nessuna delle due è «quella giusta»: chi amministra un server serio spesso
   preferisce la seconda, e non deve sembrare la scelta di serie B.          */
.agg-scelte {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 18px;
}
@media (max-width: 900px) { .agg-scelte { grid-template-columns: 1fr; } }

.agg-via {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.agg-via-t {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--neon-cyan, #4ad9ff);
}
.agg-via-p { font-size: 13px; line-height: 1.6; opacity: .8; }
.agg-via button { align-self: flex-start; margin-top: 2px; }

.agg-avanz { font-size: 12.5px; opacity: .75; font-family: 'Consolas', monospace; }

.agg-link a {
    font-family: 'Consolas', monospace;
    font-size: 13px;
    color: var(--neon-cyan, #4ad9ff);
    word-break: break-all;
}
.agg-imp-t { font-size: 11.5px; opacity: .5; letter-spacing: .04em; }
.agg-imp {
    display: block;
    font-family: 'Consolas', monospace;
    font-size: 11.5px;
    line-height: 1.5;
    word-break: break-all;
    background: rgba(0,0,0,.28);
    border-radius: 5px;
    padding: 7px 9px;
    user-select: all;
}
.agg-cmd {
    font-family: 'Consolas', monospace;
    font-size: 11.5px;
    opacity: .55;
    word-break: break-all;
}

.agg-barra {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.agg-spento {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.6;
    opacity: .7;
}

/* Quello che non si fa, scritto piccolo ma scritto. */
.agg-mai {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.65;
    opacity: .45;
    font-style: italic;
}

/* Il registro delle novità dentro la finestrella: è scritto a mano con i suoi
   riquadri, e dentro un <pre> resta com'è stato pensato.                    */
.agg-novita {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 11.5px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 58vh;
    overflow-y: auto;
    margin: 0;
    text-align: left;
}

[data-theme="light"] .agg-via { background: #f6f8fb; border-color: rgba(0,0,0,.10); }
[data-theme="light"] .agg-imp { background: #eef1f6; }
[data-theme="light"] .agg-allarme { background: #fdeaea; border-color: rgba(190,40,40,.35); }
[data-theme="light"] .agg-allarme b { color: #a02020; }

/* Il registro delle novità è scritto a 79 colonne: dentro la finestrella
   stretta si spezzerebbe tutto. Quando c'è lui, la finestra si allarga. */
.xm-box:has(.agg-novita) { max-width: 860px; width: 94vw; }
.agg-novita { background: rgba(0,0,0,.22); border-radius: 6px; padding: 12px 14px; }
[data-theme="light"] .agg-novita { background: #f2f4f8; }
/* Il registro delle novità non è una domanda: non c'è niente da annullare. */
.xm-box:has(.agg-novita) .xm-ghost { display: none; }
