/* ═══════════════════════════════════════════════════════════════════
   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;
}

/* La freccetta delle voci che portano fuori dal pannello. Piccola e spenta:
   deve dire «questa si apre altrove» a chi la cerca, senza mettersi in fila
   con i contatori delle notifiche, che invece devono farsi notare. */
.nav-fuori { margin-left: auto; font-size: 11px; opacity: .45; }
li:hover > .nav-fuori { opacity: .85; }

.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;
    /* Senza questo, il valore implicito `min-width: auto` impedisce alla
       colonna di restringersi sotto la larghezza minima del contenuto:
       una qualsiasi fila di card scorrevole (caroselli dello Streaming)
       allargava #content fino a 2700+ px e faceva comparire la barra di
       scorrimento orizzontale su tutta la pagina. */
    min-width: 0;
    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;
}

/* ════════════════════════════════════════════════════════════════════
   TEMA CHIARO — la tavolozza di base
   Si accende con [data-theme="light"] sull'elemento <html>.
   Niente bianco sparato: il fondo è un grigio-azzurro di carta, le
   schede salgono verso il bianco solo quando devono farsi leggere, e i
   colori accesi della notte diventano tinte profonde, se no su carta
   non si vedono. Le regole vere e proprie stanno nel blocco generato
   in fondo al file.
   ════════════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
    --bg:           #e4e8f1;
    --surface:      #f8fafd;
    --surface2:     #eaeef6;
    --border:       #c2cad9;
    --text:         #1b2230;
    --text-dim:     #5b6479;
    --neon-cyan:    #0a6c84;
    --neon-pink:    #b31460;
    --neon-green:   #0b7a45;
    --neon-yellow:  #8a6800;
    --neon-orange:  #b34500;
    --neon-purple:  #5a34b5;
    --neon-red:     #bd1330;
    --shadow-glow:  0 2px 14px rgba(30, 50, 80, 0.10);
    /* Sfumature riusate dalle rifiniture in fondo al foglio. */
    --sf-carta:     linear-gradient(180deg, #ffffff 0%, #f3f6fb 100%);
    --sf-carta2:    linear-gradient(180deg, #f9fbfe 0%, #eef2f9 100%);
    --sf-testata:   linear-gradient(180deg, #eef2f9 0%, #e3e9f4 100%);
    --sf-rilievo:   linear-gradient(180deg, #ffffff 0%, #eef3fa 100%);
}

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); }

/* Versione del programma su ogni dominio.
   Chi è indietro non è colpevole di niente: il colore è quello dell'avviso,
   non quello dell'errore. Serve solo a spiegare perché qualcosa non va. */
.gt-c-ver { white-space: nowrap; }
.gt-ver { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.gt-ver-muta { opacity: .55; cursor: help; }
.gt-ver-vecchia { color: var(--neon-yellow); cursor: help; }
.gt-ver-vecchia b { font-weight: 700; font-size: 9.5px; letter-spacing: .6px;
    display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 3px;
    background: rgba(255,238,0,.11); border: 1px solid #6a6317; }

/* 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-fisso { font-size: 9.5px; flex: 0 0 auto; opacity: .75; }
/* Trascinata per essere rimessa in ordine. Il posto dove finirebbe si segna
   con una riga sopra e non spostando le altre: far ballare tutto l'elenco
   sotto il dito è il modo migliore per lasciarla nel posto sbagliato. */
.ch-voce[draggable="true"] { cursor: grab; }
.ch-voce-preso { opacity: .45; cursor: grabbing; }
.ch-voce-sopra { box-shadow: inset 0 2px 0 var(--neon-cyan, #4ad9e4); }
.ch-tag { font-size: 10px; padding: 1px 5px; border-radius: 8px; background: #16222e;
          color: var(--text-dim); flex: 0 0 auto; }
.ch-tag-dom { color: var(--neon-cyan, #4ad9e4); background: rgba(74,217,228,.12); }

/* ── Le cartelle dell'elenco ───────────────────────────────────────────────
   Una piega nella colonna, non un contenitore: per questo la testa è una
   riga sottile e non un titolo grosso, e per questo il rientro delle stanze
   è piccolo. Se una cartella pesasse quanto una stanza, l'elenco che voleva
   accorciarsi sarebbe più lungo di prima. */
.ch-gruppo-t { display: flex; align-items: center; gap: 6px; }
.ch-gruppo-t > span:first-child { flex: 1 1 auto; overflow: hidden;
                                  text-overflow: ellipsis; white-space: nowrap; }
.ch-cart-piu { background: none; border: 1px dashed var(--border, #24313d);
               color: var(--text-dim); font-size: 9.5px; letter-spacing: .06em;
               border-radius: 8px; padding: 1px 7px; cursor: pointer; flex: 0 0 auto; }
.ch-cart-piu:hover { color: var(--gt-amber, #f0b429); border-color: var(--gt-amber, #f0b429); }
.ch-cart { margin: 2px 0 4px; border-radius: 6px; }
.ch-cart-h { display: flex; align-items: center; gap: 5px; padding: 4px 6px;
             cursor: pointer; border-radius: 5px; font-size: 11.5px;
             color: var(--text-dim); user-select: none; }
.ch-cart-h:hover { background: rgba(240,180,41,.07); color: var(--text); }
.ch-cart-fr { font-size: 9px; flex: 0 0 auto; width: 9px; }
.ch-cart-nm { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis;
              white-space: nowrap; letter-spacing: .05em; text-transform: uppercase; }
.ch-cart-q { font-size: 10px; opacity: .55; flex: 0 0 auto; }
.ch-cart-x { background: none; border: none; color: var(--text-dim); cursor: pointer;
             font-size: 13px; line-height: 1; padding: 0 2px; flex: 0 0 auto; opacity: 0; }
.ch-cart-h:hover .ch-cart-x { opacity: .8; }
.ch-cart-x:hover { color: var(--gt-amber, #f0b429); }
/* Il filo verticale dice «queste stanze stanno lì dentro» meglio di una
   cornice: la cornice chiude, il filo accompagna. */
.ch-cart-c { margin-left: 8px; padding-left: 7px;
             border-left: 1px solid var(--border, #24313d); }
.ch-cart-giu > .ch-cart-c { display: none; }
.ch-cart-vuota { font-size: 10.5px; color: var(--text-dim); opacity: .6;
                 margin: 3px 0 3px 2px; font-style: italic; }
.ch-cart-preso { opacity: .45; }
/* Dove finirebbe la stanza che si sta trascinando. */
.ch-cart-mira { outline: 1px dashed var(--neon-cyan, #4ad9e4); outline-offset: 1px;
                background: rgba(74,217,228,.05); }
.ch-fuori { min-height: 14px; border-radius: 6px; }

/* Il riquadro della struttura: due mezzi affiancati, portala via e rimettila.
   Sono due gesti opposti e stanno bene uno accanto all'altro; incolonnati
   sembrerebbero due passi dello stesso lavoro, e non lo sono. */
.ch-stru-due { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.ch-stru-mezzo { flex: 1 1 220px; min-width: 200px; }
.ch-stru-esito { margin-top: 10px; padding: 9px 11px; border-radius: 7px;
                 background: rgba(74,217,228,.05);
                 border: 1px solid var(--border, #24313d); }
.ch-stru-ok  { color: var(--neon-green, #3ddc84); }
.ch-stru-mod { color: var(--gt-amber, #f0b429); }
.ch-stru-no  { color: var(--text-dim); }
.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); }
.ch-eco-t { font-size: 10px; letter-spacing: .12em; color: var(--gt-amber, #f0b429);
            margin-bottom: 4px; }
.ch-eco-p { font-size: 10.5px; color: #3d5063; margin-top: 5px; }

/* ── Il copione della stanza ────────────────────────────────────────────

   Il messaggio in cima. È la bacheca all'ingresso: chi entra a metà
   settimana deve trovarci l'ora del ritrovo senza dover risalire trecento
   righe. Sta attaccato alla testa e non scorre via con i messaggi, che è
   tutto il punto: se scorresse sarebbe un messaggio come gli altri.        */
.ch-fissato { display: flex; align-items: baseline; gap: 8px; margin-top: 7px;
              padding: 6px 9px; border-radius: 6px; font-size: 12.5px;
              background: rgba(240,180,41,.08);
              border: 1px solid rgba(240,180,41,.28);
              border-left: 3px solid var(--gt-amber, #f0b429); }
.ch-fis-p { flex: 0 0 auto; }
.ch-fis-t { flex: 1 1 auto; color: var(--text); line-height: 1.5;
            max-height: 84px; overflow-y: auto; word-break: break-word; }
.ch-fis-c { flex: 0 0 auto; font-size: 10.5px; color: #3d5063; }

/* Un cartello del copione. Non l'ha scritto nessuno, e si deve vedere: chi
   risponde a un cartello si sente scemo, e ha ragione lui, non il cartello. */
.ch-cartello { display: flex; gap: 8px; padding: 5px 9px; margin: 5px 0;
               font-size: 12.5px; line-height: 1.5; border-radius: 5px;
               background: rgba(74,217,228,.05);
               border-left: 2px dashed rgba(74,217,228,.45); }
.ch-cart-t { color: #8fb8c9; flex: 1 1 auto; word-break: break-word; }

/* ── Il cartellino di una domanda ─────────────────────────────────────────
   Sta dentro il filo del discorso, non in una colonna a parte: una domanda
   fatta alla stanza è un pezzo della conversazione, e chi rilegge il giorno
   dopo deve trovarla dove è stata fatta, con intorno quello che si diceva.
   Le due facce sono diverse a colpo d'occhio, perché sono due cose diverse:
   il sondaggio è azzurro e aperto, la votazione è ambrata e chiusa. */
.ch-sond-posto { margin: 8px 0; }
.ch-sond { border: 1px solid rgba(74,217,228,.32); border-left-width: 3px;
           border-radius: 7px; padding: 9px 11px 8px;
           background: linear-gradient(180deg, rgba(74,217,228,.07), rgba(74,217,228,.02)); }
.ch-sond-vot { border-color: rgba(240,180,41,.38);
               background: linear-gradient(180deg, rgba(240,180,41,.08), rgba(240,180,41,.02)); }
.ch-sond-fine { opacity: .78; }
.ch-sond-vuoto { color: #7f97a8; font-size: 12px; font-style: italic; }

.ch-sond-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
             font-size: 10.5px; letter-spacing: .09em; }
.ch-sond-k { color: var(--neon-cyan, #4ad9e4); font-weight: 700; }
.ch-sond-vot .ch-sond-k { color: #f0b429; }
.ch-sond-st { color: #6b8296; border: 1px solid #2a3a49; border-radius: 3px;
              padding: 0 5px; font-size: 9.5px; }
.ch-sond-viva { color: #58d68d; border-color: rgba(88,214,141,.4); }
.ch-sond-no   { color: #e0645f; border-color: rgba(224,100,95,.4); }
.ch-sond-a { color: #56708a; margin-left: auto; letter-spacing: 0; font-size: 11px; }

.ch-sond-d { font-size: 14px; font-weight: 600; color: var(--text);
             margin: 6px 0 8px; line-height: 1.35; word-break: break-word; }
.ch-sond-s { display: flex; flex-direction: column; gap: 3px; }

/* Una scelta. La barra sta sotto al testo e non al posto del testo: il
   grafico serve a confrontare, la parola a capire, e servono tutte e due. */
.ch-sc { position: relative; display: grid; gap: 0 8px; align-items: center;
         grid-template-columns: 18px 1fr auto;
         padding: 4px 7px; border-radius: 4px; border: 1px solid transparent;
         font-size: 12.5px; line-height: 1.4; }
.ch-sc-viva { cursor: pointer; }
.ch-sc-viva:hover { background: rgba(255,255,255,.04); border-color: #2a3a49; }
.ch-sc-mia { border-color: rgba(88,214,141,.5); background: rgba(88,214,141,.07); }
.ch-sc-mia .ch-sc-n::after { content: '\2713'; }
.ch-sc-n { color: #4d6478; font-size: 10.5px; text-align: center;
           border: 1px solid #263544; border-radius: 3px; }
.ch-sc-mia .ch-sc-n { color: #58d68d; border-color: rgba(88,214,141,.5); }
.ch-sc-t { color: #c3d4e2; word-break: break-word; }
.ch-sc-c { color: var(--text); font-variant-numeric: tabular-nums; font-size: 12px; }
.ch-sc-b { grid-column: 2 / 4; height: 3px; border-radius: 2px;
           background: #1b2734; overflow: hidden; margin-top: 3px; }
.ch-sc-b > i { display: block; height: 100%; border-radius: 2px;
               background: var(--neon-cyan, #4ad9e4); transition: width .25s ease; }
.ch-sond-vot .ch-sc-b > i { background: #f0b429; }
.ch-sc-g { grid-column: 2 / 4; color: #4d6478; font-size: 10.5px;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ch-sond-p { display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
             margin-top: 8px; padding-top: 6px; border-top: 1px solid #1d2a36;
             font-size: 10.5px; color: #56708a; }
.ch-sond-cop { border-bottom: 1px dotted #2f4152; cursor: help; }
.ch-sond-b { margin-left: 4px; font-size: 10.5px; }
.ch-sond-b-no { color: #e0645f; }

/* Il disegno in caratteri. A spaziatura fissa e senza andare a capo da solo:
   un disegno mandato a capo non è più un disegno. Se è più largo della
   colonna scorre in orizzontale, che è brutto ma è l'unica cosa onesta. */
.ch-arte { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
           font-size: 11px; line-height: 1.15; white-space: pre; overflow-x: auto;
           margin: 5px 0; padding: 7px 9px; border-radius: 5px;
           background: #0b111a; border: 1px solid #22303d;
           color: var(--ch-accento, var(--neon-cyan, #4ad9e4)); }

/* Il riquadro dove si scrive il copione. Una casella grande, perché è un
   testo e i testi si scrivono in una casella grande. */
.ch-cop-barra { display: flex; align-items: center; gap: 6px; margin-bottom: 7px;
                flex-wrap: wrap; }
.ch-cop-barra .ch-lab-n { margin-left: auto; font-size: 10.5px; }
.ch-cop-es { width: auto; max-width: 260px; font-size: 11.5px; padding: 3px 6px; }
.ch-cop-testo { width: 100%; min-height: 300px; resize: vertical;
                font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
                font-size: 12px; line-height: 1.5; tab-size: 4;
                background: #0b111a; color: #c6d8e6; border: 1px solid #22303d;
                border-radius: 6px; padding: 9px 11px; }
.ch-cop-testo:focus { outline: none; border-color: var(--gt-amber, #f0b429); }
.ch-cop-esito { margin-top: 7px; font-size: 11.5px; line-height: 1.6; min-height: 18px; }
.ch-cop-ok { color: var(--neon-green, #3ddc84); }
.ch-cop-no { color: var(--gt-amber, #f0b429); margin-top: 4px; }

/* ── L'anteprima del copione ────────────────────────────────────────────

   Due colonne: a sinistra si scrive, a destra si vede. La colonna di destra
   usa le stesse classi della stanza vera (.ch-eco, .ch-cartello, .ch-arte,
   .ch-fissato) proprio perché non sia una somiglianza ma la stessa cosa: se
   un giorno cambia il modo di disegnare un cartello, qui cambia da solo.   */
.ch-cop-doppio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
                 align-items: stretch; }
.ch-cop-doppio.ch-cop-solo { grid-template-columns: 1fr; }
.ch-cop-doppio.ch-cop-solo .ch-cop-ant { display: none; }
.ch-cop-doppio .ch-cop-testo { min-height: 340px; }
.ch-cop-vedi { font-size: 11px; }

.ch-cop-ant { display: flex; flex-direction: column; min-width: 0;
              border: 1px solid var(--ch-bordo, #22303d); border-radius: 6px;
              background: var(--ch-sfondo, #0b111a); overflow: hidden; }
.ch-cop-ant-t { flex: 0 0 auto; font-size: 9.5px; letter-spacing: .16em;
                color: #4d6274; padding: 6px 10px 5px;
                border-bottom: 1px solid var(--ch-bordo, #22303d);
                background: rgba(255,255,255,.02); }
.ch-cop-ant-c { flex: 1 1 auto; min-height: 300px; max-height: 46vh; overflow-y: auto;
                padding: 8px 10px 12px; font-size: 12.5px; line-height: 1.5;
                color: var(--ch-testo, #c6d8e6); scrollbar-width: thin; }

.ch-ant-testa { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
                padding-bottom: 6px; margin-bottom: 6px;
                border-bottom: 1px solid var(--ch-bordo, #22303d); }
.ch-ant-nome { font-size: 13px; font-weight: 600; color: var(--ch-accento, #4ad9e4); }
.ch-ant-arg { font-size: 11px; color: #6f8496; flex: 1 1 160px; }

/* Le etichettine grigie che dicono «questo pezzo, nella stanza vera, si vede
   così». Servono perché un'anteprima senza didascalia fa credere che tutto
   esca insieme, e invece il benvenuto lo vede uno solo e i cartelli girano. */
.ch-ant-eti { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase;
              color: #4d6274; margin: 12px 0 4px; }
.ch-ant-eti:first-child { margin-top: 0; }
.ch-ant-eti2 { font-family: ui-monospace, Consolas, monospace; font-size: 10px;
               color: #55708a; margin: 6px 0 2px; }
.ch-ant-riga { display: flex; gap: 7px; font-size: 12.5px; padding: 2px 0; }
.ch-ant-chi { color: var(--ch-accento, #4ad9e4); font-weight: 600; flex: 0 0 auto; }
.ch-ant-t { color: #8fa3b5; }
.ch-ant-vuoto { color: #4d6274; font-size: 12px; padding: 26px 4px; text-align: center; }
.ch-ant-col { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-ant-pal { display: inline-flex; align-items: center; gap: 5px; font-size: 11px;
              color: #8fa3b5; }
.ch-ant-pal i { width: 15px; height: 15px; border-radius: 4px; display: inline-block;
                border: 1px solid rgba(255,255,255,.18); }

@media (max-width: 900px) {
    .ch-cop-doppio { grid-template-columns: 1fr; }
}

/* ── Le barre di scorrimento ────────────────────────────────────────────

   Quando le stanze sono tre non serve niente. Quando sono ottanta e i
   presenti duecento, la barra di sistema in un tema scuro è un rettangolo
   grigio chiaro che si vede solo lui, oppure — su certi browser — non si
   vede affatto finché non ci si passa sopra, e allora non si sa nemmeno di
   poter scorrere. Qui si dice esplicitamente che c'è e quanto è lunga.     */
.ch-lato, .ch-gente, .ch-righe, .ch-fis-t, .ch-cop-testo, .ch-arte, .ch-lista-inv {
    scrollbar-width: thin;
    scrollbar-color: #2a3a4a transparent;
    overscroll-behavior: contain;
}
.ch-lato::-webkit-scrollbar, .ch-gente::-webkit-scrollbar,
.ch-righe::-webkit-scrollbar, .ch-fis-t::-webkit-scrollbar,
.ch-cop-testo::-webkit-scrollbar, .ch-arte::-webkit-scrollbar,
.ch-lista-inv::-webkit-scrollbar { width: 9px; height: 9px; }
.ch-lato::-webkit-scrollbar-track, .ch-gente::-webkit-scrollbar-track,
.ch-righe::-webkit-scrollbar-track, .ch-fis-t::-webkit-scrollbar-track,
.ch-cop-testo::-webkit-scrollbar-track, .ch-arte::-webkit-scrollbar-track,
.ch-lista-inv::-webkit-scrollbar-track { background: transparent; }
.ch-lato::-webkit-scrollbar-thumb, .ch-gente::-webkit-scrollbar-thumb,
.ch-righe::-webkit-scrollbar-thumb, .ch-fis-t::-webkit-scrollbar-thumb,
.ch-cop-testo::-webkit-scrollbar-thumb, .ch-arte::-webkit-scrollbar-thumb,
.ch-lista-inv::-webkit-scrollbar-thumb {
    background: #2a3a4a; border-radius: 5px;
    border: 2px solid transparent; background-clip: content-box;
}
.ch-lato::-webkit-scrollbar-thumb:hover, .ch-gente::-webkit-scrollbar-thumb:hover,
.ch-righe::-webkit-scrollbar-thumb:hover, .ch-cop-testo::-webkit-scrollbar-thumb:hover {
    background: var(--gt-amber, #f0b429); background-clip: content-box;
}

/* Le intestazioni dei gruppi restano appese in alto mentre si scorre. In una
   colonna di ottanta stanze, arrivati a metà non si sa più se quello che si
   sta leggendo sono i canali o le stanze private: il titolo che resta lì è
   la risposta, e costa una riga di CSS. */
.ch-lato-t, .ch-gruppo-t { position: sticky; top: -10px; z-index: 2;
                           background: #0d151e; padding-top: 4px; padding-bottom: 3px; }

/* I colori scelti dal copione. Otto proprietà con un nome nostro, scritte
   sul solo riquadro della chat: uscendo dalla stanza se ne vanno da sole,
   senza bisogno di ricordarsi di rimetterle a posto — e soprattutto senza
   che una stanza possa cambiare l'aspetto del resto del pannello, che è la
   trappola in cui finiscono tutti i sistemi a temi personalizzabili. */
#ch-centro { background: var(--ch-sfondo, #0d151e);
             border-color: var(--ch-bordo, #1b2836); }
#ch-centro .ch-txt, #ch-centro .ch-testa-n { color: var(--ch-testo, var(--text)); }
#ch-centro .ch-testa, #ch-centro .ch-scrivi { border-color: var(--ch-bordo, #1b2836); }
#ch-centro .ch-giorno span { background: var(--ch-sfondo, #0d151e); }
#ch-centro .ch-arg-e, #ch-centro .ch-lato-t { color: var(--ch-accento, #3d5063); }
#ch-centro .ch-cart-t, .ch-cop-ant .ch-cart-t { color: var(--ch-cartello, #8fb8c9); }
#ch-centro .ch-fis-t, .ch-cop-ant .ch-fis-t { color: var(--ch-fissato, var(--ch-testo, var(--text))); }
#ch-centro .ch-eco, .ch-cop-ant .ch-eco { color: var(--ch-eco, #7d99b0); }

/* 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; }

/* La chiamata per nome dentro al testo. Quella agli altri è un nome colorato
   e basta; la mia è accesa, perché in mezzo a cento righe la propria si deve
   riconoscere senza leggerle tutte. Si può cliccare: rispondere a chi ti ha
   chiamato deve costare un clic. */
.ch-men { color: var(--neon-cyan, #4ad9e4); background: rgba(74,217,228,.10);
          border-radius: 3px; padding: 0 3px; cursor: pointer; }
.ch-men:hover { background: rgba(74,217,228,.20); }
.ch-men-io { color: #0d151e; background: var(--gt-amber, #f0b429); font-weight: 700; }
.ch-men-io:hover { background: #ffc94d; }

/* Il pallino delle chiamate nella colonna di sinistra. È diverso da quello
   dei messaggi non letti apposta: cento righe di chiacchiere e una che parla
   a me non sono la stessa cosa, e si deve vedere quale delle due è. */
.ch-nuovi-me { background: var(--gt-amber, #f0b429); color: #0d151e; }

/* Il freno della stanza si deve vedere senza doverlo chiedere: chi entra e
   trova che non può scrivere subito deve capire perché, non pensare che si
   sia rotto qualcosa. */
.ch-tag-freno { background: rgba(240, 180, 41, .16); color: #f0b429;
                border-color: rgba(240, 180, 41, .35); }

/* «Per quanto?»: la domanda che si fa ogni volta che si mette qualcuno in
   silenzio o lo si manda fuori. Quattro pulsanti pronti valgono più di una
   casella da riempire, perché la risposta è quasi sempre una di quelle. */
.ch-tempo-velo { position: fixed; inset: 0; background: rgba(5,10,16,.72);
                 display: flex; align-items: center; justify-content: center; z-index: 900; }
.ch-tempo { background: #0d151e; border: 1px solid #22303d; border-radius: 8px;
            padding: 18px 20px; max-width: 440px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.ch-tempo h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em;
               color: var(--gt-amber, #f0b429); }
.ch-tempo p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: #9fb3c4; }
.ch-tempo-r { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ch-tempo-no { width: 100%; opacity: .7; }

.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 ripensamenti ──────────────────────────────────────────────────────
   La matita per correggere sta appesa alla propria riga e si vede solo
   passandoci sopra: è una cosa che si fa di rado, e un pulsante sempre
   acceso accanto a ogni riga sarebbe rumore. Il «(corretto)» invece resta
   sempre visibile — chi legge ha diritto di sapere che quella riga è stata
   cambiata dopo. */
.ch-corr { background: none; border: none; color: #3d5063; cursor: pointer;
           font-size: 12px; padding: 0 4px; flex: 0 0 auto; align-self: flex-start;
           opacity: 0; transition: opacity .12s; }
.ch-riga:hover .ch-corr, .ch-corr:focus { opacity: 1; }
.ch-corr:hover { color: var(--gt-amber, #f0b429); }
.ch-corretto { color: #4a5d70; font-size: 10.5px; font-style: italic; }
.ch-corr-in { width: 100%; min-height: 26px; max-height: 140px; resize: vertical;
              background: #0b111a; border: 1px solid var(--gt-amber, #f0b429);
              border-radius: 4px; color: #cfe3d8; font: inherit; padding: 3px 6px;
              margin-bottom: 4px; }
/* La riga a cui la ricerca ci ha portati: si accende un momento e poi torna
   com'era. Un colore che resta acceso, dopo dieci ricerche, è una stanza
   piena di righe accese e nessuna che vuol dire qualcosa. */
.ch-riga-trovata { background: rgba(240,180,41,.14);
                   box-shadow: inset 3px 0 0 var(--gt-amber, #f0b429);
                   transition: background 1.2s ease-out; }

/* ── Trova nei messaggi ──────────────────────────────────────────────── */
.ch-tr-cerca { display: flex; gap: 8px; margin: 10px 0 14px; }
.ch-tr-cerca .ch-in { flex: 1 1 auto; }
.ch-tr-r { border: 1px solid #1b2836; border-left: 3px solid #2a3a4a;
           border-radius: 5px; padding: 7px 10px; margin-bottom: 7px;
           cursor: pointer; transition: border-color .12s, background .12s; }
.ch-tr-r:hover { border-left-color: var(--gt-amber, #f0b429); background: #101a25; }
.ch-tr-d { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
           font-size: 11px; margin-bottom: 3px; }
.ch-tr-s { color: var(--neon-cyan, #4ad9e4); font-weight: 600; }
.ch-tr-a { font-weight: 600; }
.ch-tr-q { color: #3d5063; margin-left: auto; }
.ch-tr-p { font-size: 12.5px; color: #93aec4; word-break: break-word; }
.ch-tr-m { background: rgba(240,180,41,.28); color: #ffd97a; border-radius: 2px;
           padding: 0 1px; }

/* ── 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; }
/* Il titolo va a capo da solo; le parole in grassetto dentro al testo no. */
.pt-lampada .pt-lamp-t { display: block; color: #e8d8b4; font-size: 12.5px; margin-bottom: 4px;
                font-weight: 600; letter-spacing: .2px; }
.pt-lampada div b { color: #e2e9f0; font-weight: 600; }
.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); }

/* Il ponte verso la guida: chi arriva qui per la prima volta non conosce le
   parole, e la scheda gliele deve mettere in mano prima dei bottoni. */
.pt-man-guida { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
                justify-content: space-between; margin-top: 12px; padding: 12px 16px;
                border-radius: 7px; background: rgba(123,167,232,.07);
                border: 1px solid rgba(123,167,232,.22); }
.pt-man-guida span { flex: 1 1 320px; font-size: 12.2px; line-height: 1.68; color: #97a1b1; }
.pt-man-guida b { color: #cfd8e6; font-weight: 600; }
.pt-man-guida .pt-btn { flex: 0 0 auto; border-color: rgba(123,167,232,.45); color: #7ba7e8; }
.pt-man-guida .pt-btn:hover { background: rgba(123,167,232,.14); color: #a9c8f2; }

/* ── 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 .pt-lamp-t { 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;
}

/* ── Il diario ────────────────────────────────────────────────────────────
   Sta chiuso e si apre solo quando serve. È volutamente denso e monospaziato:
   non è una schermata da leggere, è una traccia da scorrere all'indietro fino
   alla riga che spiega. Alta al massimo, poi scorre: su un dominio acceso da
   mesi le righe sono sessanta e non devono spingere fuori pagina i comandi. */
.agg-diario {
    margin-top: 14px;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    background: rgba(0,0,0,.22);
    padding: 10px 12px;
}

.agg-dia-r {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 11.5px;
    line-height: 1.65;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255,255,255,.045);
}
.agg-dia-r:last-of-type { border-bottom: none; }

.agg-dia-q { flex: 0 0 auto; opacity: .5; white-space: nowrap; }
.agg-dia-v { flex: 0 0 auto; opacity: .38; white-space: nowrap; }
.agg-dia-c { flex: 1 1 auto; opacity: .88; word-break: break-word; }

.agg-dia-vuoto {
    font-size: 12.5px;
    line-height: 1.6;
    opacity: .55;
    font-style: italic;
}

.agg-dia-piede {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.08);
    font-size: 11.5px;
    line-height: 1.6;
    opacity: .55;
}

/* 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; }

/* Tranne quando il registro si apre da solo dopo un aggiornamento: lì la
   scelta «poi» ha senso, e il pulsante deve tornare visibile.              */
.agg-appena {
    text-align: left;
    margin: 0 0 12px 0;
    padding: 10px 12px;
    border-left: 3px solid var(--neon-cyan, #4dd0e1);
    background: rgba(77, 208, 225, .08);
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    line-height: 1.5;
}
[data-theme="light"] .agg-appena { background: #eaf7fa; }
.xm-box:has(.agg-appena) .xm-ghost { display: revert; }

/* ── Credenziali ─────────────────────────────────────────────────────────
   Una riga per sito, e il modulo per scriverla si apre DENTRO la riga: con
   quattordici siti in elenco, una finestrella che copre tutto fa perdere di
   vista di quale sito si stava parlando. */
.cr-riga { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap;
           border: 1px solid #1b2836; border-left: 3px solid #2a3a4a;
           border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; }
.cr-riga.cr-ok { border-left-color: #3fb27f; }
.cr-ic { font-size: 20px; line-height: 1.2; flex: 0 0 auto; }
.cr-d  { flex: 1 1 260px; min-width: 0; }
.cr-n  { font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cr-a  { font-size: 12px; color: #6f8b9e; margin-top: 2px; }
.cr-nota { font-size: 12px; color: #93aec4; margin-top: 4px; }
.cr-err  { font-size: 12px; color: #e0715f; margin-top: 4px; }
.cr-st { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
         color: #4a5d70; border: 1px solid #24313f; border-radius: 9px;
         padding: 1px 7px; font-weight: 500; }
.cr-st-ok { color: #7fdca4; border-color: #2f5a44; text-transform: none;
            letter-spacing: 0; font-size: 11px; }
.cr-st-no { color: #e0a35f; border-color: #5a4a2f; }
.cr-b  { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; }
.cr-form { flex: 1 1 100%; border-top: 1px dashed #24313f; margin-top: 8px; padding-top: 10px; }
.cr-f-r { display: flex; gap: 10px; flex-wrap: wrap; }
.cr-f-r label { display: flex; flex-direction: column; gap: 3px; flex: 1 1 200px;
                font-size: 11px; color: #6f8b9e; }
.cr-f-r input { background: #0b111a; border: 1px solid #24313f; border-radius: 4px;
                color: #cfe3d8; font: inherit; padding: 5px 8px; }
.cr-f-r input:focus { border-color: var(--gt-amber, #f0b429); outline: none; }
.cr-f-b { display: flex; gap: 8px; margin-top: 10px; }

/* Il riquadro dove si lascia cadere il file dei biscotti. Deve sembrare un
   posto dove si può lasciare cadere qualcosa, se no nessuno ci prova. */
.cr-drop { border: 1px dashed #2a3a4a; border-radius: 6px; padding: 10px 12px;
           margin-top: 10px; transition: border-color .12s, background .12s; }
.cr-drop-on { border-color: var(--gt-amber, #f0b429); background: rgba(240,180,41,.07); }
.cr-drop-t { font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
             color: #6f8b9e; margin-bottom: 4px; }
.cr-drop-p { font-size: 12px; color: #6f8b9e; margin: 0 0 6px; }
.cr-f-c { width: 100%; resize: vertical; background: #0b111a; border: 1px solid #24313f;
          border-radius: 4px; color: #9fdcbb; font: 11px/1.4 Consolas, monospace;
          padding: 5px 8px; }
.cr-drop-e { font-size: 12px; margin-top: 5px; min-height: 16px; }
.cr-si { color: #7fdca4; }
.cr-no { color: #e0a35f; }

/* ── Portatori di banda (pagina Streaming) ───────────────────────────────
   Sta in cima alla pagina perche' la domanda "perche' si ferma?" viene
   prima di tutto il resto. */
.ptr-card { margin-bottom: 18px; }
.ptr-cap { font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
           color: var(--gt-amber, #f0b429); margin-bottom: 8px; }
.ptr-spiega { font-size: 13px; line-height: 1.6; margin: 0 0 12px; }
.ptr-griglia { display: grid; gap: 6px; margin-bottom: 10px; }
.ptr-uno { display: flex; align-items: center; gap: 10px; padding: 7px 10px;
           border: 1px solid var(--border-color, #24313f); border-radius: 6px; }
.ptr-giu { opacity: .62; }
.ptr-ic { font-size: 17px; flex: 0 0 auto; }
.ptr-d { flex: 1 1 auto; min-width: 0; }
.ptr-n { font-size: 13px; font-weight: 600; }
.ptr-u { font-size: 11px; opacity: .7; margin-left: 6px; }
.ptr-nota { font-size: 11.5px; opacity: .75; }
.ptr-st { font-size: 11px; padding: 2px 8px; border-radius: 10px; flex: 0 0 auto; }
.ptr-si { background: rgba(127,220,164,.14); color: #7fdca4; }
.ptr-no { background: rgba(224,163,95,.14); color: #e0a35f; }
.ptr-fisso { font-size: 11px; opacity: .55; flex: 0 0 auto; }
.ptr-conto { font-size: 12.5px; margin: 0 0 10px; }
.ptr-form { margin-top: 10px; padding: 10px 12px; border-radius: 6px;
            border: 1px dashed var(--border-color, #24313f); }
.ptr-guida { font-size: 12px; line-height: 1.6; }
.ptr-guida ol { margin: 6px 0 6px 18px; padding: 0; }
.ptr-guida code { font-size: 11.5px; }
.ptr-f-r { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.ptr-f-r .form-input { flex: 1 1 220px; min-width: 160px; }
.ptr-esito { font-size: 12px; color: #e0a35f; min-height: 16px; margin-top: 6px; }

/* @@TEMA-CHIARO-GENERATO@@ */
/* ====================================================================
   TEMA CHIARO - RIBALTAMENTO AUTOMATICO
   Il pannello e nato di notte: quasi ogni scheda ha i suoi colori
   scritti a mano, e di giorno restavano buchi neri o scritte
   invisibili. Questo blocco e generato da _tema_chiaro.ps1: per ogni
   regola con colori fissi calcola il gemello chiaro, tenendo la tinta
   e ribaltando la luce. I fondi restano nel loro ordine (il piu buio
   diventa il grigio della pagina, quelli sopra diventano carta), i
   contorni si scuriscono e le scritte si invertono.
   NON modificare a mano: rilanciare lo script. Le rifiniture fatte a
   occhio stanno DOPO il marcatore di fine, cosi non si perdono.
   ==================================================================== */
html[data-theme="light"] #login-screen {
    background: radial-gradient(ellipse at center, #e7e7f3, var(--bg));
}
html[data-theme="light"] .torrent-tree-pre {
    color: #0053b6;
}
html[data-theme="light"] .badge-rev {
    color: #fb1818;
}
html[data-theme="light"] .badge-fc {
    color: #6e4500;
}
html[data-theme="light"] .detail-panel {
    background: rgba(24,34,52,0.045);
}
html[data-theme="light"] .detail-panel .detail-password {
    color: #6e4500;
}
html[data-theme="light"] .detail-panel .detail-password code {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .login-divider {
    color: #707070;
}
html[data-theme="light"] .login-divider::before,
html[data-theme="light"] .login-divider::after {
    border-bottom: 1px solid #b3b3b3;
}
html[data-theme="light"] .login-divider span {
    color: #005c5c;
}
html[data-theme="light"] .tickets-thumb {
    background: #dbdbdb;
}
html[data-theme="light"] .tickets-thumb button {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .fm-toolbar-actions {
    background: linear-gradient(180deg, rgba(24,34,52,0.025), rgba(24,34,52,0));
}
html[data-theme="light"] .gt-banner {
    background: linear-gradient(135deg, #e8e8ef 0%, #ebebf1 55%, #f0eae3 100%);
}
html[data-theme="light"] .gt-self {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-tab:hover {
    background: #ededf3;
}
html[data-theme="light"] .gt-head {
    background: linear-gradient(180deg, #ededf3 0%, #eaeaf0 100%);
}
html[data-theme="light"] .gt-btn {
    background: #ededf3;
}
html[data-theme="light"] .gt-btn:hover {
    background: #f0f0f5;
}
html[data-theme="light"] .gt-btn-danger {
    border-color: #d1a8b0;
    color: #ff143e;
}
html[data-theme="light"] .gt-btn-danger:hover {
    background: #f7e8ec;
}
html[data-theme="light"] .gt-tip code {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-scan {
    background: #e7e7ee;
}
html[data-theme="light"] .gt-table tbody tr {
    border-bottom: 1px solid #bdbdca;
}
html[data-theme="light"] .gt-table tbody tr:hover {
    background: #eeeef4;
}
html[data-theme="light"] .gt-pill-ok {
    border: 1px solid #6cb695;
}
html[data-theme="light"] .gt-pill-wait {
    border: 1px solid #a69f4f;
}
html[data-theme="light"] .gt-pill-run {
    border: 1px solid #76b0be;
}
html[data-theme="light"] .gt-pill-bad {
    color: #ff133f;
    border: 1px solid #d6aeb6;
}
html[data-theme="light"] .gt-pill-none {
    background: rgba(24,34,52,0.028);
}
html[data-theme="light"] .gt-ver-vecchia b {
    border: 1px solid #a69f4f;
}
html[data-theme="light"] .gt-detail-top {
    background: linear-gradient(135deg, #e8e8ee 0%, #edeae4 100%);
}
html[data-theme="light"] .gt-detail-badge.down {
    border: 2px solid #d6aeb6;
    color: #ff133f;
}
html[data-theme="light"] .gt-res-row:hover {
    background: #eeeef4;
}
html[data-theme="light"] .gt-res-auth {
    color: #005885;
}
html[data-theme="light"] .gt-stars-g {
    color: #664700;
}
html[data-theme="light"] .fed-giu-riga {
    border: 1px solid rgba(24,34,52,0.098);
}
html[data-theme="light"] .fed-giu-s {
    color: #646872;
}
html[data-theme="light"] .fed-giu-s.on,
html[data-theme="light"] .fed-giu-s:hover {
    color: #664700;
}
html[data-theme="light"] .gt-person {
    border: 1px solid rgba(24,34,52,0.168);
    background: rgba(24,34,52,0.016);
}
html[data-theme="light"] .gt-person-head:hover {
    background: rgba(24,34,52,0.022);
}
html[data-theme="light"] .gt-person-av {
    border: 1px solid rgba(24,34,52,0.22);
}
html[data-theme="light"] .gt-person-av-txt {
    background: rgba(24,34,52,0.033);
}
html[data-theme="light"] .gt-person-int {
    color: #005885;
}
html[data-theme="light"] .gt-bar {
    background: #e5e5ee;
}
html[data-theme="light"] .gt-chip-bad {
    border-color: #d6aeb6;
    color: #ff133f;
}
html[data-theme="light"] .gt-err-sm {
    color: #ff133f;
}
html[data-theme="light"] .gt-imp-wait {
    color: #684700;
}
html[data-theme="light"] .sc-search input {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .sc-err {
    color: #ff133f;
}
html[data-theme="light"] .gt-pl-form select,
html[data-theme="light"] .gt-pl-form input {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-pl-form textarea {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-pl-stat {
    background: rgba(24,34,52,0.066);
}
html[data-theme="light"] .gt-pick-list {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-pick-row {
    border-bottom: 1px solid rgba(24,34,52,0.056);
}
html[data-theme="light"] .sc-vet {
    border-top: 1px dashed #acb8c3;
}
html[data-theme="light"] .sc-vet-s {
    background: #e3e9f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .gt-vbar input {
    background: #e1e8f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .gt-vbr-su {
    border: 1px solid #a4b1be;
}
html[data-theme="light"] .gt-scaff {
    background: rgba(24,34,52,0.054);
}
html[data-theme="light"] .gt-rep-row {
    background: rgba(24,34,52,0.054);
}
html[data-theme="light"] .gt-rep-msg {
    background: rgba(24,34,52,0.019);
}
html[data-theme="light"] .gt-prof-av {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-prof-f input,
html[data-theme="light"] .gt-prof-f textarea {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .gt-msg-them {
    background: rgba(24,34,52,0.028);
}
html[data-theme="light"] .gt-av-mono {
    border: 1px solid rgba(24,34,52,0.196);
}
html[data-theme="light"] .fed-brw-dom {
    color: #57738e;
}
html[data-theme="light"] .fed-brw-sep {
    color: #354453;
}
html[data-theme="light"] .fed-brw-sum {
    color: #57738e;
}
html[data-theme="light"] .fed-brw-s {
    color: #57738e;
}
html[data-theme="light"] .fed-brw-pg {
    color: #57738e;
}
html[data-theme="light"] .fed-modo:has(input:checked) {
    border-color: #6e91b1;
}
html[data-theme="light"] .fed-modo-tit em {
    color: #57738e;
}
html[data-theme="light"] .fed-modo-nota {
    color: #526679;
}
html[data-theme="light"] .fed-modo-off .fed-modo-nota {
    color: #aa6a6a;
}
html[data-theme="light"] .ch-lato,
html[data-theme="light"] .ch-gente {
    background: #e2e9f0;
    border: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-tag {
    background: #e8edf2;
}
html[data-theme="light"] .ch-centro {
    background: #e2e9f0;
    border: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-testa {
    border-bottom: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-dom {
    color: #5e7992;
}
html[data-theme="light"] .ch-serv {
    color: #5e7992;
}
html[data-theme="light"] .ch-scrivi {
    border-top: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-scrivi input,
html[data-theme="light"] .ch-scrivi textarea {
    background: #e1e7f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-pallino {
    background: #f0f3f6;
}
html[data-theme="light"] .ch-tiepido {
    background: #fafcfb;
}
html[data-theme="light"] .ch-spento {
    background: #f0f3f6;
}
html[data-theme="light"] .ch-conto {
    color: #5e7992;
    border-bottom: 1px solid #b3bfcc;
}
html[data-theme="light"] .ch-filtro {
    background: #e1e7f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-vivo {
    color: #5e7992;
}
html[data-theme="light"] .ch-vivo-p {
    background: #f4f6f8;
}
html[data-theme="light"] .ch-arg-in {
    background: #e1e7f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-fmt {
    color: #4b5b69;
}
html[data-theme="light"] .ch-fmt:hover {
    border-color: #a7b2be;
}
html[data-theme="light"] .ch-barra-sep {
    background: #edf1f4;
}
html[data-theme="light"] .ch-barra-nota code,
html[data-theme="light"] .ch-eco code,
html[data-theme="light"] .ch-lab-n code {
    background: #e8edf2;
}
html[data-theme="light"] .ch-eco {
    color: #41515e;
    border-left: 2px solid #a7b2be;
    background: rgba(24,34,52,0.011);
}
/* Il copione sul tema chiaro. Le stesse cose, con i colori che si vedono su
   un fondo bianco: un giallo tenue su bianco sparisce, e un riquadro che si
   sa che c'è ma non si vede è peggio di non averlo. */
html[data-theme="light"] .ch-eco-t { color: #8a6200; }
html[data-theme="light"] .ch-eco-p { color: #6a7683; }
html[data-theme="light"] .ch-fissato {
    background: #fdf6e3;
    border: 1px solid #e0c98a;
    border-left: 3px solid #c99a1e;
}
html[data-theme="light"] .ch-fis-t { color: #1c2732; }
html[data-theme="light"] .ch-fis-c { color: #6a7683; }
html[data-theme="light"] .ch-cartello {
    background: #eef7fa;
    border-left: 2px dashed #7fb8c8;
}
html[data-theme="light"] .ch-cart-t { color: #285a6b; }
html[data-theme="light"] .ch-arte {
    background: #f3f6f9;
    border: 1px solid #ccd6e0;
    color: var(--ch-accento, #1c6b7d);
}
html[data-theme="light"] .ch-cop-testo {
    background: #fbfcfd;
    color: #1c2732;
    border: 1px solid #ccd6e0;
}
html[data-theme="light"] .ch-cop-ok { color: #1c7a44; }
html[data-theme="light"] .ch-cop-no { color: #8a5a00; }
html[data-theme="light"] .ch-lato-t,
html[data-theme="light"] .ch-gruppo-t { background: #f2f5f8; }
html[data-theme="light"] #ch-centro { background: var(--ch-sfondo, #fbfcfd); }
html[data-theme="light"] .ch-lato,
html[data-theme="light"] .ch-gente,
html[data-theme="light"] .ch-righe,
html[data-theme="light"] .ch-fis-t,
html[data-theme="light"] .ch-cop-testo,
html[data-theme="light"] .ch-arte,
html[data-theme="light"] .ch-lista-inv { scrollbar-color: #b6c2ce transparent; }
html[data-theme="light"] .ch-lato::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-gente::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-righe::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-fis-t::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-cop-testo::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-arte::-webkit-scrollbar-thumb,
html[data-theme="light"] .ch-lista-inv::-webkit-scrollbar-thumb {
    background: #b6c2ce; background-clip: content-box;
}
html[data-theme="light"] .ch-azione {
    color: #8429d5;
}
html[data-theme="light"] .ch-az-st {
    color: #735b91;
}
html[data-theme="light"] .ch-tag-freno {
    color: #664700;
}
html[data-theme="light"] .ch-tempo {
    background: #e2e9f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-tempo p {
    color: #303c46;
}
html[data-theme="light"] .ch-giorno::before {
    background: #eaeef3;
}
html[data-theme="light"] .ch-giorno span {
    background: #e2e9f0;
}
html[data-theme="light"] .ch-cod {
    background: #e8edf2;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-pre {
    background: #e1e7f0;
    border: 1px solid #acb8c3;
    color: #284f69;
}
html[data-theme="light"] .ch-cit {
    border-left: 3px solid #89ac9a;
    color: #344a3e;
}
html[data-theme="light"] .ch-spo {
    background: #f0f3f6;
}
html[data-theme="light"] .ch-spo-via {
    background: rgba(24,34,52,0.028);
}
html[data-theme="light"] .ch-corretto {
    color: #697c8f;
}
html[data-theme="light"] .ch-corr-in {
    background: #e1e7f0;
    color: #121a16;
}
html[data-theme="light"] .ch-tr-r {
    border: 1px solid #b0bcc9;
    border-left: 3px solid #a7b2be;
}
html[data-theme="light"] .ch-tr-r:hover {
    background: #e4eaf1;
}
html[data-theme="light"] .ch-tr-p {
    color: #32414e;
}
html[data-theme="light"] .ch-tr-m {
    color: #644800;
}
html[data-theme="light"] .ch-riq {
    background: #e2e9f0;
    border: 1px solid #a7b2be;
}
html[data-theme="light"] .ch-riq-t {
    border-bottom: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-riq-x {
    color: #4b5b69;
}
html[data-theme="light"] .ch-riq-a {
    border-top: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-lab-n {
    color: #5e7992;
}
html[data-theme="light"] .ch-in {
    background: #e1e7f0;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-nota-r {
    color: #ff133f;
}
html[data-theme="light"] .ch-inv-r {
    border-bottom: 1px solid #b3bfcc;
}
html[data-theme="light"] .ch-min {
    color: #5e7992;
}
html[data-theme="light"] .ch-tab-w {
    border: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-tab th {
    background: #e4ebf2;
    color: #4b5b69;
    border-bottom: 1px solid #b0bcc9;
}
html[data-theme="light"] .ch-tab td {
    border-bottom: 1px solid #b3bfcc;
}
html[data-theme="light"] .ch-arg-c {
    color: #384853;
}
html[data-theme="light"] .ch-conta {
    color: #5e7992;
}
html[data-theme="light"] .ch-emo-b:hover {
    border-color: #a7b2be;
}
html[data-theme="light"] .ch-tab-gu td {
    color: #25323d;
}
html[data-theme="light"] .ch-gu-c code {
    background: #e8edf2;
    border: 1px solid #acb8c3;
}
html[data-theme="light"] .ch-gu-u {
    color: #5e7992;
}
html[data-theme="light"] .xm-box {
    background: #e5e9ef;
    border: 1px solid #a7b2be;
}
html[data-theme="light"] .xm-testa {
    border-bottom: 1px solid #acb8c3;
}
html[data-theme="light"] .xm-t {
    color: #2c4d74;
}
html[data-theme="light"] .xm-x {
    color: #4e5861;
}
html[data-theme="light"] .xm-x:hover {
    background: #eaeef2;
    color: #2c4d74;
}
html[data-theme="light"] .xm-testo {
    color: #252c34;
}
html[data-theme="light"] .xm-testo b {
    color: #2c4d74;
}
html[data-theme="light"] .xm-campo {
    background: #e1e8f0;
    color: #2c4d74;
    border: 1px solid #a7b2be;
}
html[data-theme="light"] .xm-piede {
    border-top: 1px solid #acb8c3;
}
html[data-theme="light"] .xm-conto {
    color: #57616c;
}
html[data-theme="light"] .xm-btn {
    border: 1px solid #a7b2be;
    background: #e9edf2;
    color: #171d24;
}
html[data-theme="light"] .xm-btn:hover {
    background: #eceff4;
}
html[data-theme="light"] .xm-primario {
    border-color: #50949c;
    color: #005b6a;
}
html[data-theme="light"] .xm-danger {
    border-color: #c99ca2;
    color: #ff1534;
}
html[data-theme="light"] .xm-filtro {
    background: #e1e8f0;
    color: #2c4d74;
    border: 1px solid #a7b2be;
}
html[data-theme="light"] .xm-vuoto {
    color: #57616c;
}
html[data-theme="light"] .xm-voce {
    color: #171d24;
}
html[data-theme="light"] .xm-voce:hover {
    background: #e9edf2;
    border-color: #a7b2be;
}
html[data-theme="light"] .xm-voce-t {
    color: #2c4d74;
}
html[data-theme="light"] .xm-voce-s {
    color: #4e5861;
}
html[data-theme="light"] .xm-voce-p {
    color: #664700;
    border: 1px solid #c0ae82;
}
html[data-theme="light"] .gt-refresh {
    border: 1px solid #a7b2be;
    color: #724400;
}
html[data-theme="light"] .gt-refresh:hover {
    background: #ededf3;
}
html[data-theme="light"] .fed-giu-nota {
    border-top: 1px solid #acb8c3;
    background: rgba(24,34,52,0.07);
    color: #3b454f;
}
html[data-theme="light"] .gt-pers-tools {
    border-bottom: 1px dashed #a7b2be;
}
html[data-theme="light"] .gt-pers-conto {
    color: #45505a;
}
html[data-theme="light"] .gt-pers-pg {
    color: #45505a;
}
html[data-theme="light"] .gt-scelto {
    background: #e4e9f0;
    border: 1px solid #a7b2be;
    color: #2c4d74;
}
html[data-theme="light"] .gt-scelto:hover:not(:disabled) {
    background: #e7ebf1;
}
html[data-theme="light"] .gt-fr-av {
    border: 1px solid #a7b2be;
}
html[data-theme="light"] .gt-fr-av-txt {
    background: linear-gradient(135deg, #ebeff4, #e7ecf2);
    color: #11575e;
}
html[data-theme="light"] .gt-bolla {
    border: 1px solid #acb8c3;
    background: #e6ebf1;
}
html[data-theme="light"] .gt-bolla-noi {
    background: #e3ecf0;
}
html[data-theme="light"] .gt-bolla-attesa {
    border: 1px dashed #a7b2be;
    color: #45505a;
}
html[data-theme="light"] .gt-bolla-chi {
    color: #45505a;
}
html[data-theme="light"] .gt-bolla-chi b {
    color: #171d24;
}
html[data-theme="light"] .gt-bolla-txt {
    color: #0d1116;
}
html[data-theme="light"] .gt-bolla-nome b {
    color: #171d24;
}
html[data-theme="light"] .pt-caricamento {
    color: #4b505a;
}
html[data-theme="light"] .pt-testata {
    background: linear-gradient(135deg, #e8e8f1, #e6e6ed);
}
html[data-theme="light"] .pt-testata.pt-fuori {
    border-left: 4px solid #969aa3;
}
html[data-theme="light"] .pt-motto {
    color: #181e27;
}
html[data-theme="light"] .pt-p-no {
    color: #404650;
}
html[data-theme="light"] .pt-dom {
    color: #0d1116;
}
html[data-theme="light"] .pt-impronta,
html[data-theme="light"] .pt-dal {
    color: #535862;
}
html[data-theme="light"] .pt-st {
    color: #4b505a;
}
html[data-theme="light"] .pt-st:hover {
    color: #181e27;
}
html[data-theme="light"] .pt-card h4 {
    color: #181e27;
}
html[data-theme="light"] .pt-card p {
    color: #343a43;
}
html[data-theme="light"] .pt-card p.pt-p2 {
    color: #4b505a;
}
html[data-theme="light"] .pt-card code {
    color: #181e27;
    background: #e5e5ee;
}
html[data-theme="light"] .pt-card-libero {
    border-left: 3px solid #969aa3;
}
html[data-theme="light"] .pt-nota {
    color: #535862;
}
html[data-theme="light"] .pt-vuoto {
    color: #5f646f;
}
html[data-theme="light"] .pt-obblighi b {
    color: #0d1116;
}
html[data-theme="light"] .pt-obblighi span {
    color: #4b505a;
}
html[data-theme="light"] .pt-riga-check {
    color: #343a43;
}
html[data-theme="light"] .pt-input {
    background: #e5e5ee;
    color: #0d1116;
}
html[data-theme="light"] .pt-tab th {
    color: #535862;
}
html[data-theme="light"] .pt-tab td {
    color: #181e27;
}
html[data-theme="light"] .pt-piccolo {
    color: #535862;
}
html[data-theme="light"] .pt-lista {
    border-left: 3px solid #969aa3;
}
html[data-theme="light"] .pt-lista h4 span {
    color: #535862;
}
html[data-theme="light"] .pt-lista li {
    color: #181e27;
}
html[data-theme="light"] .pt-lista li small {
    color: #5f646f;
}
html[data-theme="light"] .pt-sem-i {
    color: #4b505a;
}
html[data-theme="light"] .pt-fasc {
    border-left: 3px solid #969aa3;
}
html[data-theme="light"] .pt-fasc-mia {
    background: #eae8f1;
}
html[data-theme="light"] .pt-f-giu {
    color: #124faa;
}
html[data-theme="light"] .pt-f-dec {
    color: #404650;
}
html[data-theme="light"] .pt-fasc-tipo {
    color: #4b505a;
}
html[data-theme="light"] .pt-fasc-chi,
html[data-theme="light"] .pt-fasc-ogg {
    color: #4b505a;
}
html[data-theme="light"] .pt-fasc-mot {
    color: #181e27;
}
html[data-theme="light"] .pt-v-ast {
    color: #4b505a;
}
html[data-theme="light"] .pt-esito {
    background: #e5e5ee;
    color: #181e27;
}
html[data-theme="light"] .pt-pag-dom {
    color: #0d1116;
}
html[data-theme="light"] .pt-pag-let {
    color: #4b505a;
}
html[data-theme="light"] .pt-pag-chi {
    color: #5f646f;
}
html[data-theme="light"] .pt-voce {
    color: #4b505a;
}
html[data-theme="light"] .pt-voce b {
    color: #181e27;
}
html[data-theme="light"] .pt-barra {
    background: #e5e5ee;
}
html[data-theme="light"] .pt-albo-cap {
    color: #4b505a;
}
html[data-theme="light"] .pt-albo-cap b {
    color: #181e27;
}
html[data-theme="light"] .pt-albo-testo {
    color: #181e27;
}
html[data-theme="light"] .pt-btn {
    background: #ebebf1;
    color: #181e27;
}
html[data-theme="light"] .pt-btn:hover {
    background: #ededf3;
    border-color: #adadbd;
}
html[data-theme="light"] .pt-btn-ghost {
    color: #4b505a;
}
html[data-theme="light"] .pt-btn-ghost:hover {
    background: rgba(24,34,52,0.028);
    color: #181e27;
}
html[data-theme="light"] .pt-vota {
    color: #124faa;
}
html[data-theme="light"] .pt-lampada div {
    color: #343a43;
}
html[data-theme="light"] .pt-lampada b {
    color: #5d4817;
}
html[data-theme="light"] .pt-lampada code {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .pt-manifesto {
    background: radial-gradient(120% 140% at 0% 0%, #eaeaf1 0%, #e6e6ed 62%);
}
html[data-theme="light"] .pt-man-sub {
    color: #4b505a;
}
html[data-theme="light"] .pt-man-n {
    color: rgba(22,30,44,0.055);
}
html[data-theme="light"] .pt-man-punto p {
    color: #343a43;
}
html[data-theme="light"] .pt-man-punto p.pt-p2 {
    color: #515660;
}
html[data-theme="light"] .pt-man-punto b {
    color: #0d1116;
}
html[data-theme="light"] .pt-man-chiusa {
    color: #272d36;
}
html[data-theme="light"] .pt-q-no {
    border-left-color: #969aa3;
}
html[data-theme="light"] .pt-q-si h4,
html[data-theme="light"] .pt-q-no h4 {
    color: #0d1116;
}
html[data-theme="light"] .pt-q-si li,
html[data-theme="light"] .pt-q-no li {
    color: #4b505a;
}
html[data-theme="light"] .pt-caso-n {
    color: #124faa;
}
html[data-theme="light"] .pt-caso-sit {
    color: #3e444d;
}
html[data-theme="light"] .pt-caso-passi li {
    color: #343a43;
}
html[data-theme="light"] .pt-caso-passi b {
    color: #0d1116;
}
html[data-theme="light"] .pt-caso-morale {
    color: #323d38;
}
html[data-theme="light"] .pt-gl span {
    color: #4b505a;
}
html[data-theme="light"] .pt-fq b {
    color: #0d1116;
}
html[data-theme="light"] .pt-fq span {
    color: #4b505a;
}
html[data-theme="light"] .pt-lista-sp {
    color: #5f646f;
}
html[data-theme="light"] .agg-allarme {
    border-left: 3px solid #d97c7c;
}
html[data-theme="light"] .agg-allarme b {
    color: #ff1717;
}
html[data-theme="light"] .agg-va.agg-ok {
    color: #0b5e29;
}
html[data-theme="light"] .agg-note {
    border-left: 2px solid rgba(24,34,52,0.22);
}
html[data-theme="light"] .agg-via {
    background: rgba(24,34,52,0.014);
    border: 1px solid rgba(24,34,52,0.14);
}
html[data-theme="light"] .agg-imp {
    background: rgba(24,34,52,0.07);
}
html[data-theme="light"] .agg-barra {
    border-top: 1px solid rgba(24,34,52,0.112);
}
html[data-theme="light"] .agg-novita {
    background: rgba(24,34,52,0.066);
}
html[data-theme="light"] .agg-diario {
    background: rgba(24,34,52,0.045);
    border: 1px solid rgba(24,34,52,0.14);
}
html[data-theme="light"] .agg-dia-r {
    border-bottom: 1px solid rgba(24,34,52,0.085);
}
html[data-theme="light"] .agg-dia-piede {
    border-top: 1px solid rgba(24,34,52,0.112);
}
html[data-theme="light"] .cr-riga {
    border: 1px solid #b0bcc9;
    border-left: 3px solid #a7b2be;
}
html[data-theme="light"] .cr-a {
    color: #4c5b66;
}
html[data-theme="light"] .cr-nota {
    color: #32414e;
}
html[data-theme="light"] .cr-err {
    color: #b62d17;
}
html[data-theme="light"] .cr-st {
    color: #697c8f;
    border: 1px solid #acb7c2;
}
html[data-theme="light"] .cr-st-ok {
    color: #135b30;
    border-color: #89ac9a;
}
html[data-theme="light"] .cr-st-no {
    color: #71420e;
    border-color: #b1a490;
}
html[data-theme="light"] .cr-form {
    border-top: 1px dashed #acb7c2;
}
html[data-theme="light"] .cr-f-r label {
    color: #4c5b66;
}
html[data-theme="light"] .cr-f-r input {
    background: #e1e7f0;
    border: 1px solid #acb7c2;
    color: #121a16;
}
html[data-theme="light"] .cr-drop {
    border: 1px dashed #a7b2be;
}
html[data-theme="light"] .cr-drop-t {
    color: #4c5b66;
}
html[data-theme="light"] .cr-drop-p {
    color: #4c5b66;
}
html[data-theme="light"] .cr-f-c {
    background: #e1e7f0;
    border: 1px solid #acb7c2;
    color: #1b5837;
}
html[data-theme="light"] .cr-si {
    color: #135b30;
}
html[data-theme="light"] .cr-no {
    color: #71420e;
}
html[data-theme="light"] .ptr-si {
    color: #135b30;
}
html[data-theme="light"] .ptr-no {
    color: #71420e;
}
html[data-theme="light"] .ptr-esito {
    color: #71420e;
}
/* @@FINE-TEMA-CHIARO-GENERATO@@ */


/* ════════════════════════════════════════════════════════════════════
   TEMA CHIARO — RIFINITURE A OCCHIO
   Tutto quello che il calcolo automatico non poteva indovinare: le
   sfumature vere, le scritte bianche rimaste su fondi diventati chiari,
   i pochi punti in cui il ribaltamento faceva più danno che bene.
   Questa parte sopravvive a ogni nuova generazione dello script.
   ════════════════════════════════════════════════════════════════════ */

/* ── Il fondo della pagina ──────────────────────────────────────────
   Due aloni larghissimi (uno azzurro, uno lilla) sopra una sfumatura
   verticale: da vicino sembra carta buona, non un foglio di Word. */
html[data-theme="light"] body {
    background:
        radial-gradient(1200px 620px at 8% -10%, rgba(120, 170, 220, 0.22), transparent 60%),
        radial-gradient(900px 520px at 100% 0%, rgba(190, 160, 220, 0.18), transparent 62%),
        linear-gradient(180deg, #eef1f8 0%, #e4e8f1 46%, #dce2ee 100%);
    background-attachment: fixed;
}

html[data-theme="light"] #login-screen {
    background:
        radial-gradient(ellipse at 50% 22%, #ffffff, rgba(255, 255, 255, 0) 62%),
        linear-gradient(160deg, #e8ecf5 0%, #dfe5f0 55%, #e6e1ef 100%);
}

/* ── Scritte bianche rimaste appese ─────────────────────────────────
   Erano bianche perché sotto c'era il nero. Ora sotto c'è la carta. */
html[data-theme="light"] .gt-btn:hover,
html[data-theme="light"] .pt-btn:hover,
html[data-theme="light"] .gt-refresh:hover {
    color: #10202f;
    background: linear-gradient(180deg, #ffffff 0%, #e6ecf6 100%);
}
html[data-theme="light"] .tickets-thumb button {
    color: #10202f;
    background: rgba(255, 255, 255, 0.86);
    border-color: #c2cad9;
}

/* ── Fediverso: le tinte stanno in variabili ────────────────────────
   Il fediverso non scrive i colori nelle regole ma in un pugno di
   variabili appese a .gt-wrap e .gt-tabs. Il calcolo automatico non le
   può ribaltare (non sa se una variabile finirà in un fondo o in una
   scritta), quindi le riscrivo qui a mano. */
html[data-theme="light"] .gt-wrap,
html[data-theme="light"] .gt-tabs,
html[data-theme="light"] .gt-pane {
    --gt-line:    #c6cddb;
    --gt-row:     #ffffff;
    --gt-row2:    #f2f5fb;
    --gt-head:    #e9edf6;
    --gt-amber-d: #d98c00;
}

/* L'ambra accesa va benissimo come fondo di un distintivo, ma come
   scritta su carta sparisce: dove fa da inchiostro la scurisco. */
html[data-theme="light"] .gt-logo,
html[data-theme="light"] .gt-self-stats b,
html[data-theme="light"] .gt-head-t,
html[data-theme="light"] .gt-table thead th,
html[data-theme="light"] .gt-detail-stats b,
html[data-theme="light"] .gt-flag,
html[data-theme="light"] .gt-pill-self,
html[data-theme="light"] .gt-c-name a:hover,
html[data-theme="light"] .gt-warn-n,
html[data-theme="light"] .gt-pg-n:hover:not(:disabled),
html[data-theme="light"] .gt-tip,
html[data-theme="light"] .gt-refresh {
    color: #8a4b00;
}
html[data-theme="light"] .gt-logo { text-shadow: none; }

/* La testata del fediverso: una sfumatura calda, non un lingotto nero. */
html[data-theme="light"] .gt-banner {
    background: linear-gradient(135deg, #f4f7fc 0%, #eef2f9 55%, #faf1e2 100%);
    border-color: #d3dae7;
}
html[data-theme="light"] .gt-self {
    background: rgba(255, 255, 255, 0.75);
    border-color: #d3dae7;
}
html[data-theme="light"] .gt-head {
    background: linear-gradient(180deg, #f1f4fa 0%, #e6ebf4 100%);
}
html[data-theme="light"] .gt-tab.active {
    background: linear-gradient(180deg, #ffc24d 0%, #eda200 100%);
    color: #3a2400;
    border-color: #d98c00;
}
html[data-theme="light"] .gt-btn-primary {
    background: linear-gradient(180deg, #ffc24d 0%, #eda200 100%);
    border-color: #d98c00;
    color: #3a2400;
}
html[data-theme="light"] .gt-btn-primary:hover {
    background: linear-gradient(180deg, #ffcf70 0%, #f5ae14 100%);
    color: #3a2400;
}
/* I distintivi ambra tengono la scritta scura: su giallo pieno si legge. */
html[data-theme="light"] .gt-badge,
html[data-theme="light"] .gt-tab-badge,
html[data-theme="light"] .gt-pg-n.on {
    background: #eda200;
    color: #2a1a00;
}
html[data-theme="light"] .gt-table tbody tr:hover {
    background: #eaf0fa;
}

/* ── Chat: i riquadri e la striscia di chi sta scrivendo ────────────── */
html[data-theme="light"] .ch-lato,
html[data-theme="light"] .ch-centro,
html[data-theme="light"] .ch-gente {
    background: var(--sf-carta2);
    border: 1px solid #cfd6e3;
}
html[data-theme="light"] .ch-testa {
    background: var(--sf-testata);
}

/* ── Le dodici tinte dei nomi in chat ───────────────────────────────
   Come su HexChat, ognuno ha il suo colore e lo tiene ovunque. Il conto
   lo fa il nome (in chat.js), qui ci sono solo le tinte: di notte accese
   su fondo nero, di giorno le stesse tinte ma profonde, se no su carta
   bianca il nome di chi parla si perde. */
:root {
    --ch-tinta-0:  #7fd4ff;
    --ch-tinta-1:  #8de88d;
    --ch-tinta-2:  #ffcf6b;
    --ch-tinta-3:  #ff9d8a;
    --ch-tinta-4:  #d7a6ff;
    --ch-tinta-5:  #6fe0c9;
    --ch-tinta-6:  #f79fd0;
    --ch-tinta-7:  #b8d36a;
    --ch-tinta-8:  #ffb08a;
    --ch-tinta-9:  #9fb8ff;
    --ch-tinta-10: #5fd0a8;
    --ch-tinta-11: #e6c76a;
    /* Il mio nome resta ambra, così lo trovo a colpo d'occhio nel flusso. */
    --ch-mio:      #f0b429;
}
html[data-theme="light"] {
    --ch-tinta-0:  #0a6a94;
    --ch-tinta-1:  #1c7a2c;
    --ch-tinta-2:  #8a6100;
    --ch-tinta-3:  #b03a22;
    --ch-tinta-4:  #6b34ad;
    --ch-tinta-5:  #0a7a66;
    --ch-tinta-6:  #ab3579;
    --ch-tinta-7:  #5a7010;
    --ch-tinta-8:  #9e4a18;
    --ch-tinta-9:  #3a4fb5;
    --ch-tinta-10: #0c7150;
    --ch-tinta-11: #7a6110;
    --ch-mio:      #8a4b00;
}

/* ── I chip della Libreria (pagina Streaming) ───────────────────────
   La tinta la passa pages.js in --chip (accesa, per il fondo scuro) e
   --chip-scuro (profonda, per la carta bianca). Il colore vero lo mette
   qui il CSS: così basta cambiare tema e i chip si adeguano da soli,
   senza ridisegnare la pagina. */
.lib-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    transition: all .15s;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--chip);
}
.lib-chip.on {
    border-color: var(--chip);
    background: var(--chip);
    color: #04121a;
    box-shadow: 0 0 12px color-mix(in srgb, var(--chip) 53%, transparent);
}
html[data-theme="light"] .lib-chip {
    color: var(--chip-scuro);
}
html[data-theme="light"] .lib-chip.on {
    border-color: var(--chip-scuro);
    background: var(--chip-scuro);
    color: #ffffff;
    box-shadow: 0 0 12px color-mix(in srgb, var(--chip-scuro) 35%, transparent);
}

/* ── La targhetta dei portatori di banda ────────────────────────────
   L'ambra del tema scuro su carta bianca non si legge: la stessa tinta,
   ma cotta, come per tutte le altre scritte ambra del tema chiaro. */
html[data-theme="light"] .ptr-cap {
    color: #8a4b00;
}

/* ── Scheda dell'intesa: lampadine e ponte verso la guida ───────────
   Il titolo della lampadina resta bruno; le parole in grassetto dentro
   al testo tornano del colore dell'inchiostro, se no sembrano tutte
   titoli. */
html[data-theme="light"] .pt-lampada .pt-lamp-t {
    color: #5d4817;
}
html[data-theme="light"] .pt-lampada div b {
    color: #1d2430;
}
html[data-theme="light"] .pt-man-guida {
    background: #eef3fb;
    border-color: rgba(27, 95, 181, .28);
}
html[data-theme="light"] .pt-man-guida span {
    color: #4a5563;
}
html[data-theme="light"] .pt-man-guida b {
    color: #1d2430;
}
html[data-theme="light"] .pt-man-guida .pt-btn {
    color: #1b5fb5;
    border-color: rgba(27, 95, 181, .42);
}
html[data-theme="light"] .pt-man-guida .pt-btn:hover {
    background: rgba(27, 95, 181, .10);
    color: #124faa;
}

/* ══════════════════════════════════════════════════════════════════════════
   PER INIZIARE — il percorso di chi apre l'intesa la prima volta
   ──────────────────────────────────────────────────────────────────────────
   Il difetto della versione precedente era di sparizione: un bottone non
   disponibile semplicemente non veniva disegnato, e chi arrivava nuovo si
   trovava una scheda con dei buchi senza sapere se fosse rotta o «per altri».
   Queste classi servono a due cose sole: mostrare in che punto del percorso
   sei arrivato, e lasciare al posto di ogni bottone mancante un riquadro che
   dica perché manca e da dove si passa per averlo.
   ═════════════════════════════════════════════════════════════════════════ */
.pt-st-inizio { color: #7fd3ab; }
.pt-st-inizio.active { border-bottom-color: #4caf87; }

.pt-card-inizio { border-left: 3px solid #4caf87; }
.pt-benv { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between;
           flex-wrap: wrap; }
.pt-benv > div:first-child { flex: 1; min-width: 260px; }
.pt-avanz { text-align: center; padding: 10px 16px; border-radius: 8px; flex-shrink: 0;
            background: rgba(76, 175, 135, .08); border: 1px solid rgba(76, 175, 135, .28); }
.pt-avanz-n { font-size: 26px; font-weight: 700; color: #4caf87; line-height: 1; }
.pt-avanz-n small { font-size: 14px; opacity: .6; font-weight: 600; }
.pt-avanz span { display: block; margin-top: 5px; font-size: 10.5px; letter-spacing: .6px;
                 color: #8b93a3; text-transform: uppercase; }

.pt-passi { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pt-passo { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px;
            border: 1px solid var(--pt-line); border-left-width: 3px; border-radius: 8px;
            background: var(--pt-card); }
.pt-passo-n { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
              display: flex; align-items: center; justify-content: center;
              font-size: 13px; font-weight: 700; }
.pt-passo-c { flex: 1; min-width: 0; }
.pt-passo-cap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.pt-passo-cap h4 { margin: 0; font-size: 13px; color: #e2e9f0; }
.pt-passo-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .7px; padding: 2px 8px;
                border-radius: 20px; }
.pt-passo p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.65; color: #a8b2c1; }
.pt-passo p b { color: #e2e9f0; font-weight: 600; }
.pt-passo p.pt-passo-det { color: #7f8899; font-size: 11.8px; }
.pt-passo .pt-btn-passo { margin-top: 4px; }

.pt-passo-fatto { border-left-color: #4caf87; opacity: .82; }
.pt-passo-fatto .pt-passo-n { background: rgba(76, 175, 135, .16); color: #4caf87; }
.pt-passo-fatto .pt-passo-tag { background: rgba(76, 175, 135, .14); color: #4caf87; }
.pt-passo-ora { border-left-color: #e2a33c; background: linear-gradient(90deg, rgba(226, 163, 60, .07), transparent 60%); }
.pt-passo-ora .pt-passo-n { background: rgba(226, 163, 60, .18); color: #e2a33c; }
.pt-passo-ora .pt-passo-tag { background: rgba(226, 163, 60, .16); color: #e2a33c; }
.pt-passo-info { border-left-color: #7ba7e8; }
.pt-passo-info .pt-passo-n { background: rgba(123, 167, 232, .16); color: #7ba7e8; }
.pt-passo-info .pt-passo-tag { background: rgba(123, 167, 232, .14); color: #7ba7e8; }
.pt-passo-dopo { border-left-color: #5a6172; opacity: .72; }
.pt-passo-dopo .pt-passo-n { background: rgba(120, 130, 150, .14); color: #98a2b3; }
.pt-passo-dopo .pt-passo-tag { background: rgba(120, 130, 150, .12); color: #98a2b3; }

/* Il riquadro che prende il posto di un bottone che non c'è. */
.pt-serratura { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0;
                padding: 12px 14px; border-radius: 7px;
                background: rgba(226, 163, 60, .06); border: 1px solid rgba(226, 163, 60, .22); }
.pt-serr-ic { font-size: 15px; line-height: 1.3; flex-shrink: 0; opacity: .9; }
.pt-serratura > div { flex: 1; min-width: 0; }
.pt-serratura b { display: block; color: #e6c07a; font-size: 12.5px; margin-bottom: 4px;
                  font-weight: 600; letter-spacing: .2px; }
.pt-serratura span { display: block; color: #a8b2c1; font-size: 12.3px; line-height: 1.65; }
.pt-serratura span b { display: inline; color: #e2e9f0; margin: 0; font-size: inherit; }
.pt-serratura i { color: #cfd8e6; font-style: italic; }
.pt-serratura .pt-btn { margin-top: 9px; color: #e2a33c; border-color: rgba(226, 163, 60, .40); }
.pt-serratura .pt-btn:hover { background: rgba(226, 163, 60, .12); color: #f0b429; }

/* La tabella dei cancelli: cosa è aperto, cosa no, e per quale motivo. */
.pt-cancelli td:first-child { width: 34%; color: #e2e9f0; }
.pt-cancelli .pt-can-s { width: 15%; white-space: nowrap; font-weight: 600; font-size: 11.5px; }
.pt-cancelli tr.pt-can-ok .pt-can-s { color: #4caf87; }
.pt-cancelli tr.pt-can-no .pt-can-s { color: #e2a33c; }
.pt-cancelli td:last-child { color: #8b93a3; font-size: 11.8px; line-height: 1.6; }
.pt-cancelli td:last-child b { color: #cfd8e6; }

/* Tema chiaro: stessi ruoli, contrasti rifatti a mano sul bianco. */
html[data-theme="light"] .pt-st-inizio { color: #1f7a56; }
html[data-theme="light"] .pt-avanz { background: rgba(31, 122, 86, .08);
                                     border-color: rgba(31, 122, 86, .28); }
html[data-theme="light"] .pt-avanz-n { color: #1f7a56; }
html[data-theme="light"] .pt-avanz span { color: #5b6472; }
html[data-theme="light"] .pt-passo-cap h4 { color: #1d2430; }
html[data-theme="light"] .pt-passo p { color: #414b58; }
html[data-theme="light"] .pt-passo p b { color: #1d2430; }
html[data-theme="light"] .pt-passo p.pt-passo-det { color: #5b6472; }
html[data-theme="light"] .pt-passo-fatto { border-left-color: #1f7a56; }
html[data-theme="light"] .pt-passo-fatto .pt-passo-n,
html[data-theme="light"] .pt-passo-fatto .pt-passo-tag { background: rgba(31, 122, 86, .12); color: #1f7a56; }
html[data-theme="light"] .pt-passo-ora { border-left-color: #8a4b00; }
html[data-theme="light"] .pt-passo-ora .pt-passo-n,
html[data-theme="light"] .pt-passo-ora .pt-passo-tag { background: rgba(138, 75, 0, .12); color: #8a4b00; }
html[data-theme="light"] .pt-passo-info { border-left-color: #1b5fb5; }
html[data-theme="light"] .pt-passo-info .pt-passo-n,
html[data-theme="light"] .pt-passo-info .pt-passo-tag { background: rgba(27, 95, 181, .12); color: #1b5fb5; }
html[data-theme="light"] .pt-passo-dopo .pt-passo-n,
html[data-theme="light"] .pt-passo-dopo .pt-passo-tag { color: #5b6472; }
html[data-theme="light"] .pt-serratura { background: rgba(138, 75, 0, .06);
                                         border-color: rgba(138, 75, 0, .22); }
html[data-theme="light"] .pt-serratura b { color: #8a4b00; }
html[data-theme="light"] .pt-serratura span { color: #414b58; }
html[data-theme="light"] .pt-serratura span b { color: #1d2430; }
html[data-theme="light"] .pt-serratura i { color: #1d2430; }
html[data-theme="light"] .pt-serratura .pt-btn { color: #8a4b00; border-color: rgba(138, 75, 0, .40); }
html[data-theme="light"] .pt-serratura .pt-btn:hover { background: rgba(138, 75, 0, .10); color: #6d3b00; }
html[data-theme="light"] .pt-cancelli td:first-child { color: #1d2430; }
html[data-theme="light"] .pt-cancelli tr.pt-can-ok .pt-can-s { color: #1f7a56; }
html[data-theme="light"] .pt-cancelli tr.pt-can-no .pt-can-s { color: #8a4b00; }
html[data-theme="light"] .pt-cancelli td:last-child { color: #5b6472; }
html[data-theme="light"] .pt-cancelli td:last-child b { color: #1d2430; }


