@font-face{font-family:"Playfair Display";font-style:normal;font-weight:400;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/playfair-400.ttf") format("truetype");}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:600;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/playfair-600.ttf") format("truetype");}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:700;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/playfair-700.ttf") format("truetype");}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:800;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/playfair-800.ttf") format("truetype");}
@font-face{font-family:"Inter";font-style:normal;font-weight:300;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/inter-300.ttf") format("truetype");}
@font-face{font-family:"Inter";font-style:normal;font-weight:400;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/inter-400.ttf") format("truetype");}
@font-face{font-family:"Inter";font-style:normal;font-weight:500;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/inter-500.ttf") format("truetype");}
@font-face{font-family:"Inter";font-style:normal;font-weight:600;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/inter-600.ttf") format("truetype");}
@font-face{font-family:"Inter";font-style:normal;font-weight:700;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/inter-700.ttf") format("truetype");}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:400;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/dmsans-400.ttf") format("truetype");}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:500;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/dmsans-500.ttf") format("truetype");}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:600;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/dmsans-600.ttf") format("truetype");}
@font-face{font-family:"DM Sans";font-style:normal;font-weight:700;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/dmsans-700.ttf") format("truetype");}
@font-face{font-family:"Lora";font-style:normal;font-weight:400;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/lora-400.ttf") format("truetype");}
@font-face{font-family:"Lora";font-style:normal;font-weight:500;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/lora-500.ttf") format("truetype");}
@font-face{font-family:"Lora";font-style:normal;font-weight:600;font-display:swap;src:url("https://thepsychology.club/wp-content/plugins/tpc-community/fonts/lora-600.ttf") format("truetype");}

    /* Local fonts with font-display:swap - no Google Fonts dependency */
    
    *, *::before, *::after { box-sizing: border-box; }

    :root {
        --tpc-primary: 25 50% 38%;
        --tpc-primary-strong: 25 55% 28%;
        --tpc-primary-light: 30 30% 93%;
        --tpc-primary-glow: 25 45% 48%;
        --tpc-accent: 38 65% 50%;
        --tpc-accent-warm: 30 55% 42%;
        --tpc-bg: 40 20% 96%;
        --tpc-surface: 0 0% 100%;
        --tpc-surface-muted: 40 12% 95%;
        --tpc-surface-elevated: 0 0% 100%;
        --tpc-border: 40 12% 88%;
        --tpc-border-subtle: 40 8% 92%;
        --tpc-text: 210 11% 15%;
        --tpc-text-muted: 210 8% 45%;
        --tpc-text-soft: 210 6% 58%;
        --tpc-danger: 0 72% 50%;
        --tpc-success: 145 55% 36%;
        --tpc-sidebar-bg: 200 12% 16%;
        --tpc-sidebar-text: 210 15% 78%;
        --tpc-sidebar-text-bright: 0 0% 96%;
        --tpc-sidebar-hover: 200 10% 22%;
        --tpc-sidebar-active: 25 50% 38%;
        --tpc-radius: 12px;
        --tpc-radius-lg: 16px;
        --tpc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.04);
        --tpc-shadow: 0 4px 16px -4px rgb(0 0 0 / 0.08);
        --tpc-shadow-lg: 0 12px 40px -12px rgb(0 0 0 / 0.12);
        --tpc-shadow-glow: 0 0 0 3px hsl(var(--tpc-primary) / 0.12);
        --tpc-font-heading: "Playfair Display", Georgia, serif;
        --tpc-font-body: "DM Sans", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
        --tpc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* ─── DARK MODE ─── */
    .tpc-community-shell.tpc-dark {
        --tpc-bg: 210 12% 11%;
        --tpc-surface: 210 10% 15%;
        --tpc-surface-muted: 210 10% 13%;
        --tpc-surface-elevated: 210 10% 18%;
        --tpc-border: 210 8% 22%;
        --tpc-border-subtle: 210 6% 20%;
        --tpc-text: 210 15% 90%;
        --tpc-text-muted: 210 10% 65%;
        --tpc-text-soft: 210 8% 50%;
        --tpc-primary-light: 25 30% 18%;
        --tpc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.2);
        --tpc-shadow: 0 4px 16px -4px rgb(0 0 0 / 0.3);
        --tpc-shadow-lg: 0 12px 40px -12px rgb(0 0 0 / 0.4);
        --tpc-sidebar-bg: 210 12% 10%;
        --tpc-sidebar-hover: 210 10% 16%;
    }
    .tpc-community-shell.tpc-dark .tpc-nav { background: hsl(210 12% 8%); border-bottom-color: hsl(0 0% 100% / 0.05); }
    .tpc-community-shell.tpc-dark .tpc-input,
    .tpc-community-shell.tpc-dark .tpc-select,
    .tpc-community-shell.tpc-dark .tpc-editor,
    .tpc-community-shell.tpc-dark .tpc-textarea { background: hsl(var(--tpc-surface-elevated)); color: hsl(var(--tpc-text)); border-color: hsl(var(--tpc-border)); }
    .tpc-dark-toggle { cursor: pointer; font-size: 1rem !important; padding: 4px 8px !important; border: none; background: none; }
    .tpc-community-shell.tpc-dark .tpc-dark-toggle::after { content: ""; }

    /* ─── OCEAN SCHEME ─── */
    .tpc-community-shell.tpc-scheme-ocean {
        --tpc-primary: 210 65% 45%;
        --tpc-primary-strong: 210 70% 35%;
        --tpc-primary-light: 210 40% 93%;
        --tpc-primary-glow: 210 60% 55%;
        --tpc-accent: 195 80% 42%;
        --tpc-accent-warm: 200 60% 38%;
        --tpc-bg: 210 20% 97%;
        --tpc-surface: 0 0% 100%;
        --tpc-surface-muted: 210 15% 95%;
        --tpc-surface-elevated: 0 0% 100%;
        --tpc-border: 210 15% 88%;
        --tpc-border-subtle: 210 10% 92%;
        --tpc-sidebar-bg: 215 25% 15%;
        --tpc-sidebar-text: 210 20% 78%;
        --tpc-sidebar-text-bright: 0 0% 97%;
        --tpc-sidebar-hover: 215 20% 22%;
        --tpc-sidebar-active: 210 65% 45%;
    }
    .tpc-community-shell.tpc-scheme-ocean .tpc-nav { background: hsl(215 25% 13%); }
    .tpc-community-shell.tpc-scheme-ocean .tpc-side-link.active { color: hsl(200 70% 60%); background: hsl(210 65% 45% / 0.15); }
    .tpc-community-shell.tpc-scheme-ocean .tpc-nav-link.active { color: hsl(200 70% 60%); background: hsl(210 65% 45% / 0.2); }

    .tpc-community-shell.tpc-scheme-ocean.tpc-dark {
        --tpc-bg: 215 20% 10%;
        --tpc-surface: 215 18% 14%;
        --tpc-surface-muted: 215 18% 12%;
        --tpc-surface-elevated: 215 18% 17%;
        --tpc-border: 215 12% 22%;
        --tpc-sidebar-bg: 215 22% 9%;
        --tpc-sidebar-hover: 215 18% 15%;
    }
    .tpc-community-shell.tpc-scheme-ocean.tpc-dark .tpc-nav { background: hsl(215 22% 7%); }

    /* ─── FOREST SCHEME ─── */
    .tpc-community-shell.tpc-scheme-forest {
        --tpc-primary: 150 40% 32%;
        --tpc-primary-strong: 150 45% 24%;
        --tpc-primary-light: 150 25% 93%;
        --tpc-primary-glow: 150 38% 42%;
        --tpc-accent: 38 55% 48%;
        --tpc-accent-warm: 32 50% 40%;
        --tpc-bg: 80 10% 96%;
        --tpc-surface: 60 10% 99%;
        --tpc-surface-muted: 80 8% 94%;
        --tpc-surface-elevated: 60 10% 99%;
        --tpc-border: 80 8% 87%;
        --tpc-border-subtle: 80 6% 91%;
        --tpc-sidebar-bg: 160 18% 14%;
        --tpc-sidebar-text: 150 15% 75%;
        --tpc-sidebar-text-bright: 60 10% 96%;
        --tpc-sidebar-hover: 160 14% 20%;
        --tpc-sidebar-active: 150 40% 32%;
    }
    .tpc-community-shell.tpc-scheme-forest .tpc-nav { background: hsl(160 18% 12%); }
    .tpc-community-shell.tpc-scheme-forest .tpc-side-link.active { color: hsl(140 45% 55%); background: hsl(150 40% 32% / 0.15); }
    .tpc-community-shell.tpc-scheme-forest .tpc-nav-link.active { color: hsl(140 45% 55%); background: hsl(150 40% 32% / 0.2); }

    .tpc-community-shell.tpc-scheme-forest.tpc-dark {
        --tpc-bg: 160 15% 9%;
        --tpc-surface: 160 12% 13%;
        --tpc-surface-muted: 160 12% 11%;
        --tpc-surface-elevated: 160 12% 16%;
        --tpc-border: 160 8% 20%;
        --tpc-sidebar-bg: 160 16% 8%;
        --tpc-sidebar-hover: 160 12% 14%;
    }
    .tpc-community-shell.tpc-scheme-forest.tpc-dark .tpc-nav { background: hsl(160 16% 6%); }

    /* ─── LOAD MORE COMMENTS ─── */
    .tpc-load-more-comments {
        display: block;
        width: 100%;
        padding: 8px 0;
        margin: 4px 0;
        background: none;
        border: none;
        color: hsl(var(--tpc-primary));
        font-family: var(--tpc-font-body);
        font-size: 0.82rem;
        font-weight: 600;
        cursor: pointer;
        text-align: center;
        border-radius: var(--tpc-radius);
        transition: background var(--tpc-transition);
    }
    .tpc-load-more-comments:hover {
        background: hsl(var(--tpc-primary-light));
    }

    /* ─── LOCKED SPACE LINK ─── */
    .tpc-side-link-locked { opacity: 0.55; font-style: italic; font-size: 0.82rem; }

    /* ─── SHELL ─── */
    .tpc-community-shell a:hover { color: inherit; }
    .tpc-community-shell .tpc-btn-primary:hover, .tpc-community-shell .tpc-btn-sm.tpc-btn-primary:hover { color: #fff !important; }
    .tpc-community-shell { width: 100%; max-width: 100%; margin: 0 auto; padding: 0; color: hsl(var(--tpc-text)); font-family: var(--tpc-font-body); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; background: hsl(var(--tpc-bg)); }
    .tpc-community-topbar { margin-bottom: 0; }
    .tpc-community-body { max-width: 100%; margin: 0; padding: 0; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0; align-items: stretch; min-height: calc(100vh - 56px); }
    .tpc-community-main { width: 100%; min-width: 0; overflow-x: clip; padding: 32px 40px; max-width: 780px; margin: 0 auto; }

    /* ─── SIDEBAR (dark, Circle-style) ─── */
    .tpc-community-sidebar { background: hsl(var(--tpc-sidebar-bg)); border-right: none; }
    .tpc-sidebar-inner { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 20px 14px; }
    .tpc-sidebar-inner::-webkit-scrollbar { width: 4px; }
    .tpc-sidebar-inner::-webkit-scrollbar-thumb { background: hsl(0 0% 100% / 0.1); border-radius: 4px; }
    .tpc-side-card { background: transparent; border: none; border-radius: var(--tpc-radius); box-shadow: none; padding: 12px 10px; }
    .tpc-side-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.2em; color: hsl(var(--tpc-sidebar-text-bright) / 0.85); margin-bottom: 8px; font-weight: 700; font-family: var(--tpc-font-body); padding-left: 10px; }
    .tpc-feed-shortcut { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: hsl(var(--tpc-sidebar-active)); color: #fff; font-weight: 600; font-family: var(--tpc-font-body); text-decoration: none; transition: all var(--tpc-transition); font-size: 0.9rem; }
    .tpc-feed-shortcut:hover { opacity: 0.9; }
    .tpc-side-link { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; color: hsl(var(--tpc-sidebar-text)); font-weight: 500; margin-bottom: 1px; text-decoration: none; transition: all var(--tpc-transition); font-size: 0.88rem; }
    .tpc-side-link:hover { background: hsl(var(--tpc-sidebar-hover)); color: hsl(0 0% 100%) !important; }
    .tpc-side-link.active { background: hsl(var(--tpc-sidebar-active) / 0.25); color: hsl(25 70% 75%) !important; font-weight: 600; }
    .tpc-side-link.active:hover { background: hsl(var(--tpc-sidebar-active) / 0.35); color: hsl(25 80% 85%) !important; }
    .tpc-side-empty { color: hsl(var(--tpc-sidebar-text) / 0.4); font-size: 0.84rem; padding: 6px 14px; }
    .tpc-side-auth { background: hsl(var(--tpc-sidebar-hover)); border-radius: var(--tpc-radius); }
    .tpc-side-auth h3 { margin: 0 0 6px; font-size: 0.95rem; font-family: var(--tpc-font-heading); color: hsl(var(--tpc-sidebar-text-bright)); }
    .tpc-side-auth p { margin: 0 0 12px; color: hsl(var(--tpc-sidebar-text)); font-size: 0.84rem; line-height: 1.5; }

    /* ─── NAVIGATION (clean top bar) ─── */
    .tpc-nav { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 28px; background: hsl(200 12% 13%); border-bottom: 1px solid hsl(0 0% 100% / 0.07); color: hsl(var(--tpc-sidebar-text-bright)); position: relative; width: 100%; }
    .tpc-nav-brand { font-size: 0.95rem; font-weight: 700; font-family: var(--tpc-font-body); letter-spacing: -0.01em; color: hsl(var(--tpc-sidebar-text-bright)); text-decoration: none; }
    .tpc-nav-brand:hover { opacity: 0.7; }
    .tpc-nav-links-scroll { min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .tpc-nav-links-scroll::-webkit-scrollbar { display: none; }
    /* v3.16.6 — niente wrap: la barra menu resta su una sola riga (il toggle tema non va a capo) */
    .tpc-nav-links { display: flex; gap: 1px; flex-wrap: nowrap; white-space: nowrap; justify-content: flex-end; align-items: center; }
    .tpc-nav-links > * { flex: 0 0 auto; }
    .tpc-nav-link { color: hsl(var(--tpc-sidebar-text)); font-size: 0.84rem; font-weight: 500; padding: 6px 12px; border-radius: 8px; text-decoration: none; transition: all var(--tpc-transition); font-family: var(--tpc-font-body); }
    .tpc-nav-link:hover { color: hsl(var(--tpc-sidebar-text-bright)); background: hsl(var(--tpc-sidebar-hover)); }
    .tpc-nav-link.active { color: hsl(25 50% 65%); background: hsl(var(--tpc-sidebar-active) / 0.2); font-weight: 600; }
    .tpc-nav-notif { position: relative; }
    .tpc-notif-badge { position: absolute; top: -2px; right: 0; min-width: 16px; height: 16px; border-radius: 999px; padding: 0 4px; background: hsl(var(--tpc-danger)); color: #fff; font-size: 0.6rem; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
    .tpc-nav .tpc-btn-sm { font-family: var(--tpc-font-body); font-size: 0.82rem; padding: 7px 16px; }
    .tpc-nav .tpc-btn-sm.tpc-btn-primary { background: hsl(25 50% 45%); color: #fff; }
    .tpc-nav .tpc-btn-sm.tpc-btn-primary:hover { background: hsl(25 55% 55%); color: #fff; }
    .tpc-nav .tpc-btn-sm.tpc-btn-secondary { background: hsl(0 0% 100% / 0.12); color: hsl(0 0% 95%); border-color: hsl(0 0% 100% / 0.2); }
    .tpc-nav .tpc-btn-sm.tpc-btn-secondary:hover { background: hsl(0 0% 100% / 0.22); color: #fff; border-color: hsl(0 0% 100% / 0.35); }
    .tpc-nav .tpc-nav-link { color: hsl(0 0% 75%); }
    .tpc-nav .tpc-nav-link:hover { color: #fff; background: hsl(0 0% 100% / 0.1); }

    /* ─── v3.16.7 — NAV MOBILE SU UNA SOLA RIGA: Home / Feed / Spaces ▾ / 👤 / ⎋ / 🌙 ─── */
    .tpc-nav-spaces { display: none; }
    @media (max-width: 780px) {
        .tpc-community-topbar .tpc-nav-links { gap: 4px !important; width: 100% !important; justify-content: space-between !important; }
        .tpc-community-topbar .tpc-nav-links-scroll { overflow: visible !important; }
        /* voci non richieste su mobile */
        .tpc-community-topbar .tpc-nav-members,
        .tpc-community-topbar .tpc-nav-search,
        .tpc-community-topbar .tpc-nav-notif { display: none !important; }
        .tpc-community-topbar .tpc-nav-link { padding: 6px 8px !important; font-size: 0.8rem !important; }
        /* Spaces a tendina */
        .tpc-community-topbar .tpc-nav-spaces {
            display: inline-flex !important; align-items: center; gap: 4px;
            background: hsl(0 0% 100% / 0.1); border: 1px solid hsl(0 0% 100% / 0.16);
            border-radius: 999px; cursor: pointer; color: hsl(0 0% 100% / 0.95) !important;
        }
        /* icone sole */
        .tpc-community-topbar .tpc-nav-profile,
        .tpc-community-topbar .tpc-nav-logout,
        .tpc-community-topbar .tpc-dark-toggle {
            width: 34px !important; height: 34px !important; padding: 0 !important;
            display: inline-flex !important; align-items: center !important; justify-content: center !important;
            line-height: 1 !important; border-radius: 50% !important; flex: 0 0 auto !important;
        }
        .tpc-community-topbar .tpc-nav-profile,
        .tpc-community-topbar .tpc-nav-logout { font-size: 0 !important; }
        .tpc-community-topbar .tpc-nav-profile::before { content: "👤"; font-size: 16px; line-height: 1; }
        /* icona esci: SVG inline (i glifi unicode tipo ⏻ non sono supportati da tutti i font mobile) */
        .tpc-community-topbar .tpc-nav-logout::before {
            content: ""; display: block; width: 17px; height: 17px;
            background-color: currentColor;
            -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4%22/%3E%3Cpolyline points=%2216 17 21 12 16 7%22/%3E%3Cline x1=%2221%22 y1=%2212%22 x2=%229%22 y2=%2212%22/%3E%3C/svg%3E") no-repeat center / contain;
            mask: url("data:image/svg+xml;utf8,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22black%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath d=%22M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4%22/%3E%3Cpolyline points=%2216 17 21 12 16 7%22/%3E%3Cline x1=%2221%22 y1=%2212%22 x2=%229%22 y2=%2212%22/%3E%3C/svg%3E") no-repeat center / contain;
        }
        .tpc-community-topbar .tpc-nav-logout { color: hsl(0 0% 100% / 0.95) !important; }
        .tpc-community-topbar .tpc-dark-toggle { font-size: 15px !important; }
        /* la barra spaces resta chiusa finché non si apre dal menu */
        .tpc-side-card-spaces .tpc-side-link,
        .tpc-side-card-spaces .tpc-side-empty { display: none; }
        .tpc-side-card-spaces.tpc-cats-open .tpc-side-link,
        .tpc-side-card-spaces.tpc-cats-open .tpc-side-empty { display: block; }
        .tpc-side-card-spaces:not(.tpc-cats-open) { padding: 0 !important; border: 0 !important; }
        .tpc-view-psi_home .tpc-side-card-spaces .tpc-side-label-toggle { display: none !important; }
    }


    /* ─── TYPOGRAPHY ─── */
    .tpc-page-title { font-size: 1.8rem; margin: 0 0 24px; line-height: 1.15; font-family: var(--tpc-font-heading); font-weight: 700; color: hsl(var(--tpc-text)); letter-spacing: -0.02em; }
    .tpc-section-title { font-size: 1.15rem; margin: 28px 0 14px; font-family: var(--tpc-font-heading); font-weight: 700; color: hsl(var(--tpc-text)); position: relative; padding-left: 14px; }
    .tpc-section-title::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: hsl(var(--tpc-primary)); }

    /* ─── BUTTONS ─── */
    .tpc-btn, .tpc-btn-sm { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; text-decoration: none; border-radius: 8px; transition: all var(--tpc-transition); font-weight: 600; font-family: var(--tpc-font-body); position: relative; overflow: hidden; }
    .tpc-btn { padding: 10px 20px; font-size: 0.9rem; }
    .tpc-btn-sm { padding: 8px 14px; font-size: 0.84rem; }
    .tpc-btn-primary { background: hsl(var(--tpc-primary)); color: #fff; }
    .tpc-btn-primary:hover { background: hsl(var(--tpc-primary-strong)); }
    .tpc-btn-secondary { background: hsl(var(--tpc-surface)); color: hsl(var(--tpc-text)); border: 1px solid hsl(var(--tpc-border)); }
    .tpc-btn-secondary:hover { background: hsl(var(--tpc-bg)); border-color: hsl(var(--tpc-primary) / 0.3); }
    .tpc-btn-icon { background: transparent; border: none; cursor: pointer; padding: 6px 8px; border-radius: 8px; font-size: 0.84rem; transition: all var(--tpc-transition); }
    .tpc-btn-icon:hover { background: hsl(var(--tpc-primary-light)); }
    .tpc-btn-micro { background: transparent; border: none; cursor: pointer; padding: 3px 7px; border-radius: 6px; font-size: 0.75rem; transition: all var(--tpc-transition); }
    .tpc-btn-micro:hover { background: hsl(var(--tpc-primary-light)); }
    .tpc-btn-danger, .tpc-btn-sm.tpc-btn-danger { color: hsl(var(--tpc-danger)); }
    .tpc-btn-react { background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border)); padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 0.84rem; transition: all var(--tpc-transition); font-weight: 500; color: hsl(var(--tpc-text)); }
    .tpc-btn-react:hover { background: hsl(var(--tpc-primary) / 0.1); border-color: hsl(var(--tpc-primary) / 0.3); color: hsl(var(--tpc-primary-strong)); }
    .tpc-btn-react.active { background: hsl(var(--tpc-primary) / 0.15); border-color: hsl(var(--tpc-primary) / 0.4); color: hsl(var(--tpc-primary-strong)); font-weight: 600; }
    .tpc-btn-react.disabled { cursor: default; opacity: .65; }
    .tpc-btn-send { background: hsl(var(--tpc-primary)); color: #fff; border: none; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all var(--tpc-transition); }
    .tpc-btn-send:hover { background: hsl(var(--tpc-primary-strong)); }
    .tpc-btn-cancel { background: hsl(var(--tpc-border)); color: hsl(var(--tpc-text-muted)); box-shadow: none; }

    /* ─── SHARE ─── */
    .tpc-share-wrap { position: relative; display: inline-flex; }
    .tpc-share-dropdown { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border)); border-radius: var(--tpc-radius); box-shadow: var(--tpc-shadow); padding: 6px; z-index: 50; min-width: 160px; flex-direction: column; gap: 2px; }
    .tpc-share-dropdown.open { display: flex; }
    .tpc-share-link { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 0.84rem; color: hsl(var(--tpc-text)); text-decoration: none; transition: all var(--tpc-transition); border: none; background: none; cursor: pointer; font-family: var(--tpc-font-body); width: 100%; text-align: left; }
    .tpc-share-link:hover { background: hsl(var(--tpc-primary) / 0.08); color: hsl(var(--tpc-primary-strong)); }

    /* ─── AUTH PROMPT ─── */
    .tpc-auth-prompt { padding: 40px 28px; text-align: center; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow); }
    .tpc-auth-prompt-icon { font-size: 2.5rem; margin-bottom: 12px; }
    .tpc-auth-prompt-eyebrow { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.2em; color: hsl(var(--tpc-primary)); font-weight: 700; margin-bottom: 8px; }
    .tpc-auth-prompt h3 { margin: 0 0 10px; font-size: 1.4rem; font-family: var(--tpc-font-heading); letter-spacing: -0.01em; }
    .tpc-auth-prompt p, .tpc-auth-meta { color: hsl(var(--tpc-text-muted)); }
    .tpc-auth-prompt p { max-width: 480px; margin: 0 auto 20px; line-height: 1.6; }
    .tpc-auth-meta { margin-top: 14px; font-size: 0.82rem; color: hsl(var(--tpc-text-soft)); }
    .tpc-auth-buttons, .tpc-auth-buttons-sm { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

    /* ─── SPOTS BANNER ─── */
    .tpc-spots-banner { background: hsl(var(--tpc-primary) / 0.06); border: 1px solid hsl(var(--tpc-primary) / 0.15); border-radius: var(--tpc-radius); padding: 14px 18px; margin-bottom: 16px; }
    .tpc-spots-banner.tpc-spots-full { background: hsl(var(--tpc-danger) / 0.08); border-color: hsl(var(--tpc-danger) / 0.2); text-align: center; }
    .tpc-spots-banner.tpc-spots-full p { color: hsl(var(--tpc-danger)); font-weight: 600; margin: 0; font-size: 0.9rem; }
    .tpc-spots-banner-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
    .tpc-spots-banner-label { font-size: 0.82rem; font-weight: 600; color: hsl(var(--tpc-text-muted)); text-transform: uppercase; letter-spacing: 0.05em; }
    .tpc-spots-banner-num { font-size: 0.95rem; font-weight: 700; color: hsl(var(--tpc-primary)); font-family: var(--tpc-font-heading); }
    .tpc-spots-banner-bar { height: 6px; background: hsl(var(--tpc-border)); border-radius: 999px; overflow: hidden; }
    .tpc-spots-banner-fill { height: 100%; background: hsl(var(--tpc-primary)); border-radius: 999px; transition: width 0.6s ease; }
    .tpc-spots-banner-urgency { margin: 8px 0 0; font-size: 0.82rem; font-weight: 600; color: hsl(25 70% 45%); }

    /* ─── GUEST BANNER ─── */
    .tpc-guest-banner { padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: hsl(var(--tpc-accent) / 0.06); border: 1px solid hsl(var(--tpc-accent) / 0.15); border-radius: var(--tpc-radius); font-size: 0.88rem; }
    /* Dentro la topbar: attaccata alla header, nessuno spazio bianco */
    .tpc-community-topbar .tpc-guest-banner { margin: 0 0 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0; flex-wrap: nowrap; }
    .tpc-community-topbar .tpc-guest-banner > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tpc-community-topbar .tpc-guest-banner .tpc-auth-buttons-sm { display: flex; gap: 6px; flex: 0 0 auto; }
    @media (max-width: 640px) {
        .tpc-community-topbar .tpc-guest-banner { padding: 8px 12px; font-size: 0.76rem; gap: 8px; }
        .tpc-community-topbar .tpc-guest-banner .tpc-btn-sm { padding: 5px 9px; font-size: 0.72rem; white-space: nowrap; }
        .tpc-guest-note { display: none; }
    }

    /* ─── CATEGORIE COLLASSABILI SU MOBILE (schermata Home/Oggi) ─── */
    .tpc-side-label-toggle { display: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }
    .tpc-sub-cat-toggle { display: none; background: none; border: 0; font: inherit; cursor: pointer; color: inherit; padding: 6px 10px; }
    @media (max-width: 780px) {
        .tpc-view-psi_home .tpc-side-card-spaces .tpc-side-label { display: block; width: 100%; text-align: left; }
        /* v3.16.6 — chip leggibile su qualsiasi tema (prima spariva col tema chiaro) */
        .tpc-view-psi_home .tpc-side-card-spaces .tpc-side-label-toggle {
            display: inline-flex; align-items: center; gap: 6px; width: auto;
            padding: 7px 14px; border-radius: 999px;
            background: hsl(0 0% 100% / 0.12);
            border: 1px solid hsl(0 0% 100% / 0.18);
            color: hsl(0 0% 100% / 0.95);
            letter-spacing: 0.12em;
        }
        .tpc-view-psi_home .tpc-side-card-spaces .tpc-side-link,
        .tpc-view-psi_home .tpc-side-card-spaces .tpc-side-empty { display: none; }
        .tpc-view-psi_home .tpc-side-card-spaces.tpc-cats-open .tpc-side-link,
        .tpc-view-psi_home .tpc-side-card-spaces.tpc-cats-open .tpc-side-empty { display: block; }
        .tpc-view-psi_home .tpc-sub-cat-toggle { display: inline-block; }
        .tpc-view-psi_home .tpc-sub-cats-spaces { display: none; }
        .tpc-view-psi_home .tpc-sub-nav-cats.tpc-cats-open .tpc-sub-cats-spaces { display: contents; }
    }


    /* ─── MODERATION ─── */
    .tpc-moderation-notice { background: hsl(var(--tpc-accent) / 0.06); border: 1px solid hsl(var(--tpc-accent) / 0.2); border-radius: var(--tpc-radius); padding: 12px 16px; margin-bottom: 16px; font-size: 0.88rem; }
    .tpc-moderation-info { background: hsl(var(--tpc-primary-light)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius); padding: 10px 14px; margin-bottom: 14px; font-size: 0.84rem; color: hsl(var(--tpc-text-muted)); }
    .tpc-post-pending { border-left: 3px solid hsl(var(--tpc-accent)); opacity: 0.8; }
    .tpc-badge-pending { background: hsl(var(--tpc-accent) / 0.1); color: hsl(var(--tpc-accent-warm)); font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; font-weight: 600; margin-bottom: 8px; display: inline-block; margin-left: 6px; }

    /* ─── POST CARD ─── */
    .tpc-feed, .tpc-space, .tpc-single-post, .tpc-profile, .tpc-notifications, .tpc-search { min-width: 0; max-width: 100%; overflow-x: clip; }
    .tpc-post-card { min-width: 0; max-width: 100%; overflow: hidden; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow-sm); padding: 24px; margin-bottom: 16px; transition: all var(--tpc-transition); }
    .tpc-post-card:hover { box-shadow: var(--tpc-shadow); }
    .tpc-post-restricted { position: relative; overflow: hidden; min-height: 120px; display: flex; align-items: center; justify-content: center; }
    .tpc-restricted-overlay { text-align: center; padding: 28px 20px; }
    .tpc-restricted-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.7; }
    .tpc-restricted-msg { color: hsl(var(--tpc-text-muted)); font-size: 0.9rem; margin: 0 0 12px; line-height: 1.5; }
    .tpc-post-restricted::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent, transparent 8px, hsl(var(--tpc-border-subtle) / 0.3) 8px, hsl(var(--tpc-border-subtle) / 0.3) 9px); pointer-events: none; opacity: 0.5; border-radius: var(--tpc-radius-lg); }
    .tpc-post-form-wrap { background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow-sm); padding: 24px; margin-bottom: 16px; }
    .tpc-profile-header { background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow); padding: 28px; margin-bottom: 20px; display: flex; gap: 20px; align-items: center; }
    .tpc-post-header { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; min-width: 0; max-width: 100%; }
    .tpc-avatar { border-radius: 50%; object-fit: cover; border: 2px solid hsl(var(--tpc-border-subtle)); }
    .tpc-post-meta { flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .tpc-author { font-weight: 600; text-decoration: none; color: hsl(var(--tpc-text)); font-family: var(--tpc-font-body); transition: color var(--tpc-transition); font-size: 0.92rem; }
    .tpc-author:hover { color: hsl(var(--tpc-primary)); }
    .tpc-space-tag a { color: hsl(var(--tpc-primary)); text-decoration: none; font-weight: 500; font-size: 0.84rem; }
    .tpc-space-tag a:hover { text-decoration: underline; }
    .tpc-post-content a { color: hsl(var(--tpc-primary)); text-decoration: underline; text-underline-offset: 2px; }
    .tpc-post-content a:hover { color: hsl(var(--tpc-primary-strong)); }
    .tpc-time, .tpc-space-tag, .tpc-comment-count, .tpc-profile-since, .tpc-search-results-count, .tpc-comment-time { color: hsl(var(--tpc-text-soft)); font-size: 0.78rem; }
    .tpc-edited-tag { color: hsl(var(--tpc-text-soft)); font-size: 0.74rem; font-style: italic; }
    .tpc-badge-pinned { background: hsl(var(--tpc-primary) / 0.08); color: hsl(var(--tpc-primary-strong)); font-size: 0.72rem; padding: 4px 10px; border-radius: 999px; font-weight: 600; margin-bottom: 10px; display: inline-block; border: 1px solid hsl(var(--tpc-primary) / 0.15); }
    .tpc-post-title { font-family: var(--tpc-font-heading); font-size: 1.2rem; font-weight: 700; color: hsl(var(--tpc-text)); margin: 0 0 8px; line-height: 1.3; }
    .tpc-post-title a { color: inherit; text-decoration: none; }
    .tpc-post-title a:hover { color: hsl(var(--tpc-primary)); }
    .tpc-post-content { display: block; width: 100%; min-width: 0; max-width: 100%; overflow-x: clip; line-height: 1.7; margin-bottom: 12px; word-wrap: break-word; overflow-wrap: anywhere; word-break: break-word; font-size: 0.93rem; text-align: justify; hyphens: auto; font-weight: 400; }
    /* v3.13.13 — color applicato solo ai tag testuali nativi, non ereditato a widget/embed (es. calcolatori con header colorati) */
    .tpc-post-content > p, .tpc-post-content > div:not([class]):not([style*="background"]), .tpc-post-content > ul, .tpc-post-content > ol, .tpc-post-content > blockquote, .tpc-post-content > h2, .tpc-post-content > h3, .tpc-post-content > h4, .tpc-post-content > span { color: hsl(var(--tpc-text)); }
    .tpc-post-content > p, .tpc-post-content > div:not([class]) { text-align: justify; font-weight: 400; }
    .tpc-post-content h2, .tpc-post-content h3, .tpc-post-content h4 { font-family: var(--tpc-font-heading); color: hsl(var(--tpc-text)); line-height: 1.3; margin: 18px 0 8px; text-align: left; font-weight: 700; }
    .tpc-post-content h2 { font-size: 1.35rem; }
    .tpc-post-content h3 { font-size: 1.15rem; }
    .tpc-post-content h4 { font-size: 1rem; color: hsl(var(--tpc-primary-strong)); }
    .tpc-post-content blockquote { border-left: 3px solid hsl(var(--tpc-primary)); padding: 4px 14px; margin: 12px 0; color: hsl(var(--tpc-text-muted)); font-style: italic; background: hsl(var(--tpc-bg) / 0.4); border-radius: 0 8px 8px 0; }
    .tpc-post-content ul, .tpc-post-content ol { padding-left: 24px; margin: 8px 0; text-align: left; }
    .tpc-post-content img, .tpc-post-content iframe, .tpc-post-content video, .tpc-post-content audio, .tpc-post-content embed, .tpc-post-content object { max-width: 100% !important; border-radius: var(--tpc-radius); }
    .tpc-post-content img { transition: transform var(--tpc-transition); }

    /* v3.13.9 — Galleria immagini post */
    .tpc-post-content .tpc-gallery img, .tpc-post-content [data-tpc-lightbox] img { cursor: zoom-in; }
    .tpc-gallery { margin: 12px 0 4px; }
    /* v3.13.14 — Video embed responsive 16:9 */
    /* v2026-04-28 — fix overflow orizzontale: box-sizing + display block + max-width 100% del parent */
    /* v2026-04-28b — fix overflow: forza break su URL lunghe + contiene il post */
    .tpc-post-content, .tpc-post-content *, .tpc-comment-text, .tpc-comment-text * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; word-wrap: break-word; word-break: break-word; }
    .tpc-post-content a, .tpc-comment-text a { display: inline; max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
    .tpc-post-content img, .tpc-comment-text img, .tpc-post-content iframe, .tpc-comment-text iframe, .tpc-post-content video, .tpc-comment-text video, .tpc-post-content embed, .tpc-comment-text embed, .tpc-post-content object, .tpc-comment-text object { max-width: 100% !important; height: auto; }
    /* contenitori principali del feed: impediscono che un figlio gonfi la larghezza */
    .tpc-post, .tpc-post-card, .tpc-post-body, .tpc-post-meta, .tpc-comment, .tpc-comment-body, .tpc-comment-entry, .tpc-comments-section, .tpc-feed, .tpc-thread { min-width: 0; max-width: 100%; }
    .tpc-video-embed { position: relative; display: block; box-sizing: border-box; width: 100% !important; max-width: 100% !important; margin: 14px 0; padding: 0 0 56.25% 0; height: 0; overflow: hidden; border-radius: var(--tpc-radius); background: #000; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
    .tpc-video-embed iframe, .tpc-video-embed > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; max-width: 100%; }
    .tpc-comment-text .tpc-video-embed { max-width: min(480px, 100%); margin: 8px 0; }
    /* v3.13.16 — Privacy facade (no cookie until click) */
    .tpc-video-facade { cursor: pointer; }
    .tpc-video-facade > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease, filter .25s ease; }
    .tpc-video-facade:hover > img { transform: scale(1.04); filter: brightness(.85); }
    .tpc-video-facade--vimeo { background: linear-gradient(135deg, #0d2b3e 0%, #1ab7ea 100%); }
    .tpc-video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 78px; height: 54px; padding: 0; border: 0; background: transparent; cursor: pointer; opacity: .92; transition: opacity .2s ease, transform .2s ease; z-index: 2; }
    .tpc-video-play svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
    .tpc-video-facade:hover .tpc-video-play { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    .tpc-video-badge { position: absolute; bottom: 8px; right: 10px; font-size: 10px; font-weight: 600; letter-spacing: .5px; color: #fff; background: rgba(0,0,0,.55); padding: 3px 7px; border-radius: 4px; text-transform: uppercase; z-index: 2; pointer-events: none; }
    /* v3.13.18 — toggle embed video nei form commento/reply */
    .tpc-comment-form .tpc-attach-btn .tpc-embed-icon,
    .tpc-reply-form .tpc-attach-btn .tpc-embed-icon { display: inline-block; opacity: .45; filter: grayscale(1); transition: opacity .15s, filter .15s; font-size: 1.05rem; }
    .tpc-comment-form .tpc-attach-btn.tpc-on .tpc-embed-icon,
    .tpc-reply-form .tpc-attach-btn.tpc-on .tpc-embed-icon { opacity: 1; filter: none; }
    .tpc-gallery-single .tpc-gallery-item { display: block; }
    .tpc-gallery-single .tpc-gallery-item img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--tpc-radius); border: 1px solid hsl(var(--tpc-border-subtle)); cursor: zoom-in; }
    .tpc-gallery-multi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .tpc-gallery-multi .tpc-gallery-item { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px; border: 1px solid hsl(var(--tpc-border-subtle)); cursor: zoom-in; }
    .tpc-gallery-multi .tpc-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; display: block; }
    .tpc-gallery-multi .tpc-gallery-item:hover img { transform: scale(1.05); }
    @media (max-width: 767px) {
        .tpc-gallery-multi { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 6px; scrollbar-width: thin; }
        .tpc-gallery-multi .tpc-gallery-item { flex: 0 0 78%; aspect-ratio: 4 / 3; scroll-snap-align: start; }
    }

    /* Lightbox */
    .tpc-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; animation: tpcFadeIn .15s ease; }
    .tpc-lightbox img { max-width: 95vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
    .tpc-lightbox-close, .tpc-lightbox-prev, .tpc-lightbox-next { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
    .tpc-lightbox-close:hover, .tpc-lightbox-prev:hover, .tpc-lightbox-next:hover { background: rgba(255,255,255,.25); }
    .tpc-lightbox-close { top: 18px; right: 18px; }
    .tpc-lightbox-prev { left: 18px; top: 50%; transform: translateY(-50%); }
    .tpc-lightbox-next { right: 18px; top: 50%; transform: translateY(-50%); }
    .tpc-lightbox-counter { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.7); font-size: 0.85rem; }
    @keyframes tpcFadeIn { from { opacity: 0; } to { opacity: 1; } }

    .tpc-toolbar-sep { width: 1px; background: hsl(var(--tpc-border-subtle)); margin: 4px 4px; }

    /* v3.13.10 — Edit gallery (riordina + cancella immagini in modifica post) */
    .tpc-edit-gallery-wrap { margin: 10px 0; padding: 12px; border: 1px dashed hsl(var(--tpc-border)); border-radius: var(--tpc-radius); background: hsl(var(--tpc-bg) / 0.4); }
    .tpc-edit-gallery-label { font-size: 0.85rem; font-weight: 600; color: hsl(var(--tpc-text)); margin-bottom: 8px; }
    .tpc-edit-gallery-hint { font-weight: 400; color: hsl(var(--tpc-text-muted)); font-size: 0.78rem; }
    .tpc-edit-gallery-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
    .tpc-edit-gallery-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; border: 1px solid hsl(var(--tpc-border-subtle)); background: hsl(var(--tpc-surface)); cursor: grab; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; user-select: none; }
    .tpc-edit-gallery-thumb:active { cursor: grabbing; }
    .tpc-edit-gallery-thumb:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
    .tpc-edit-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
    .tpc-edit-gallery-thumb.tpc-dragging { opacity: 0.45; transform: scale(0.96); }
    .tpc-edit-gallery-thumb.tpc-drag-over { outline: 2px dashed hsl(var(--tpc-primary)); outline-offset: -2px; }
    .tpc-edit-gallery-pos { position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 0.7rem; font-weight: 700; padding: 2px 6px; border-radius: 999px; pointer-events: none; }
    .tpc-edit-gallery-remove { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 0.75rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background .15s; padding: 0; }
    .tpc-edit-gallery-remove:hover { background: hsl(var(--tpc-destructive, 0 70% 50%)); background: #c0392b; }

    /* Polls */
    .tpc-poll { background: hsl(var(--tpc-bg) / 0.5); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius); padding: 16px; margin: 12px 0 8px; }
    .tpc-poll-question { font-weight: 700; font-size: 0.95rem; margin-bottom: 12px; color: hsl(var(--tpc-text)); }
    .tpc-poll-option { position: relative; border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; font-size: 0.88rem; overflow: hidden; }
    .tpc-poll-option-vote { display: flex; align-items: center; gap: 8px; cursor: pointer; border: 1px solid hsl(var(--tpc-border-subtle)); transition: all var(--tpc-transition); }
    .tpc-poll-option-vote:hover { border-color: hsl(var(--tpc-primary)); background: hsl(var(--tpc-primary) / 0.04); }
    .tpc-poll-result { display: flex; align-items: center; justify-content: space-between; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); }
    .tpc-poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: hsl(var(--tpc-primary) / 0.12); border-radius: 8px; transition: width 0.6s ease; z-index: 0; }
    .tpc-poll-label { position: relative; z-index: 1; font-weight: 500; }
    .tpc-poll-pct { position: relative; z-index: 1; font-weight: 700; color: hsl(var(--tpc-primary)); font-size: 0.85rem; }
    .tpc-poll-my-vote { border-color: hsl(var(--tpc-primary)); }
    .tpc-poll-my-vote .tpc-poll-bar { background: hsl(var(--tpc-primary) / 0.18); }
    .tpc-poll-meta { font-size: 0.78rem; color: hsl(var(--tpc-text-muted)); margin-top: 8px; }
    .tpc-poll-hint { font-size: 0.78rem; color: hsl(var(--tpc-text-muted)); margin-left: 8px; }
    .tpc-poll-form { display: flex; flex-direction: column; gap: 6px; }
    .tpc-poll-creator { background: hsl(var(--tpc-bg) / 0.5); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius); padding: 14px; margin-top: 8px; }
    .tpc-poll-options-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
    .tpc-input-sm { padding: 6px 10px !important; font-size: 0.85rem !important; }
    .tpc-post-content img:hover { transform: scale(1.01); }
    .tpc-post-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid hsl(var(--tpc-border-subtle)); margin-bottom: 8px; }
    .tpc-reactions-row { display: flex; gap: 4px; flex-wrap: wrap; }
    .tpc-reactions-row .tpc-btn-react { padding: 4px 10px; font-size: 0.82rem; }
    .tpc-flash-msg { background: hsl(var(--tpc-primary) / 0.1); border: 1px solid hsl(var(--tpc-primary) / 0.3); color: hsl(var(--tpc-text)); padding: 12px 18px; border-radius: var(--tpc-radius); margin-bottom: 16px; font-size: 0.9rem; }
    .tpc-post-admin { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; position: relative; }
    .tpc-visibility-form-wrap { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border)); border-radius: var(--tpc-radius); box-shadow: var(--tpc-shadow); padding: 14px; z-index: 50; min-width: 280px; flex-direction: column; gap: 8px; }
    .tpc-inline-form { display: inline; }
    .tpc-sub-form { margin-bottom: 14px; }
    .tpc-edit-form { padding: 12px 0; }
    .tpc-edit-actions { display: flex; gap: 8px; margin-top: 10px; }

    /* ─── COMMENTS ─── */
    .tpc-comments-section { border-top: 1px solid hsl(var(--tpc-border-subtle)); padding-top: 12px; margin-top: 4px; }
    /* Comment sort toggle (v3.11.0) */
    .tpc-comments-sort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; padding: 6px 8px; background: hsl(var(--tpc-bg) / 0.6); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: 999px; font-size: 0.8rem; }
    .tpc-comments-sort-label { color: hsl(var(--tpc-text-soft, var(--tpc-text)) / 0.7); font-size: 0.78rem; padding-left: 6px; }
    .tpc-comments-sort-btn { background: transparent; border: 1px solid transparent; color: hsl(var(--tpc-text)); padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 0.78rem; font-family: var(--tpc-font-body); transition: background var(--tpc-transition), color var(--tpc-transition), border-color var(--tpc-transition); }
    .tpc-comments-sort-btn:hover { background: hsl(var(--tpc-surface-soft, var(--tpc-bg))); border-color: hsl(var(--tpc-border-subtle)); color: hsl(var(--tpc-text)); }
    .tpc-comments-sort-btn.active:hover { background: hsl(var(--tpc-primary)); color: #fff; border-color: hsl(var(--tpc-primary)); }
    .tpc-comments-sort-btn.active { background: hsl(var(--tpc-primary)); color: #fff; border-color: hsl(var(--tpc-primary)); font-weight: 600; }
    .tpc-comment-entry { /* wrapper neutro per ordering JS */ }
    .tpc-comment { display: flex; gap: 10px; padding: 8px 0; transition: background var(--tpc-transition); border-radius: 10px; min-width: 0; max-width: 100%; }
    .tpc-comment:hover { background: hsl(var(--tpc-bg) / 0.5); }
    .tpc-comment-avatar img { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid hsl(var(--tpc-border-subtle)); }
    .tpc-comment-body { min-width: 0; max-width: 100%; overflow: hidden; background: hsl(var(--tpc-bg)); border-radius: 12px; padding: 10px 14px; flex: 1 1 auto; border: 1px solid hsl(var(--tpc-border-subtle)); }
    .tpc-comment-author { margin-right: 6px; }
    .tpc-comment-author a { font-weight: 600; font-size: 0.84rem; text-decoration: none; color: hsl(var(--tpc-text)); font-family: var(--tpc-font-body); }
    .tpc-comment-author a:hover { color: hsl(var(--tpc-primary)); }
    .tpc-comment-job { display: inline-block; margin-left: 4px; padding: 1px 7px; font-size: 0.7rem; font-weight: 600; line-height: 1.4; color: hsl(var(--tpc-primary)); background: hsl(var(--tpc-primary) / 0.08); border: 1px solid hsl(var(--tpc-primary) / 0.18); border-radius: 999px; vertical-align: 1px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
    .tpc-comment-text { display: block; width: 100%; min-width: 0; max-width: 100%; overflow-x: clip; font-size: 0.88rem; margin-top: 4px; line-height: 1.5; }
    .tpc-comment-text p { margin: 0 0 6px; }
    .tpc-comment-text img { max-width: 200px; height: auto; border-radius: var(--tpc-radius); display: block; margin-top: 8px; }
    .tpc-comment-actions { display: flex; gap: 4px; margin-top: 6px; }
    .tpc-comment-time { font-size: 0.75rem; color: hsl(var(--tpc-text-muted)); }
    .tpc-btn-reply { background: none; border: none; cursor: pointer; font-size: 0.75rem; color: hsl(var(--tpc-text-muted)); font-weight: 600; padding: 0; font-family: var(--tpc-font-body); }
    .tpc-btn-reply:hover { color: hsl(var(--tpc-text)); }
    .tpc-comment-replies { margin-left: 38px; border-left: 2px solid hsl(var(--tpc-border-subtle)); padding-left: 12px; }
    .tpc-comment-replies .tpc-comment-replies { margin-left: 28px; }
    .tpc-reply-form { display: flex; gap: 8px; align-items: center; padding-top: 6px; margin-left: 38px; }
    .tpc-reply-form .tpc-comment-input { font-size: 0.84rem; padding: 7px 12px; }
    .tpc-comment-form { display: flex; gap: 8px; align-items: center; padding-top: 10px; }

    /* ─── INPUTS & FORMS ─── */
    .tpc-comment-input, .tpc-search-input, .tpc-select, .tpc-select-sm, .tpc-input, .tpc-textarea { border: 1px solid hsl(var(--tpc-border)); background: hsl(var(--tpc-surface)); color: hsl(var(--tpc-text)); border-radius: 10px; font-family: var(--tpc-font-body); transition: all var(--tpc-transition); }
    .tpc-comment-input { flex: 1; min-width: 0; padding: 9px 14px; font-size: 0.88rem; outline: none; }
    .tpc-comment-input:focus, .tpc-search-input:focus, .tpc-select:focus, .tpc-input:focus, .tpc-textarea:focus { border-color: hsl(var(--tpc-primary) / 0.5); outline: none; box-shadow: var(--tpc-shadow-glow); }
    .tpc-post-form { display: flex; flex-direction: column; gap: 14px; }
    .tpc-file-hidden { display: none; }
    .tpc-attach-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 8px 14px; border-radius: 10px; font-size: 0.84rem; font-weight: 500; color: hsl(var(--tpc-text-muted)); background: hsl(var(--tpc-bg)); border: 1px dashed hsl(var(--tpc-border)); transition: all var(--tpc-transition); font-family: var(--tpc-font-body); }
    .tpc-attach-btn:hover { background: hsl(var(--tpc-primary-light)); border-color: hsl(var(--tpc-primary) / 0.3); color: hsl(var(--tpc-primary-strong)); }
    .tpc-attach-btn-lg { padding: 10px 18px; }
    .tpc-img-preview-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
    .tpc-img-preview-wrap:empty { display: none; }
    .tpc-img-preview-item { position: relative; display: inline-block; }
    .tpc-img-preview-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid hsl(var(--tpc-border)); }
    .tpc-img-preview-item .tpc-img-remove { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: hsl(0 70% 50%); color: #fff; font-size: 12px; line-height: 20px; text-align: center; cursor: pointer; border: none; padding: 0; font-weight: 700; }
    .tpc-img-preview-item .tpc-img-remove:hover { background: hsl(0 70% 40%); }
    .tpc-img-preview-info { font-size: 0.78rem; color: hsl(var(--tpc-text-muted)); margin-top: 4px; }
    .tpc-select, .tpc-search-input, .tpc-input { width: 100%; padding: 10px 14px; font-size: 0.93rem; }
    .tpc-textarea { width: 100%; padding: 10px 14px; font-size: 0.93rem; resize: vertical; min-height: 80px; }
    .tpc-select-sm { width: auto; padding: 6px 10px; font-size: 0.82rem; }

    /* ─── EDITOR ─── */
    .tpc-editor-wrap { border: 1px solid hsl(var(--tpc-border)); border-radius: var(--tpc-radius); overflow: hidden; background: hsl(var(--tpc-surface)); transition: border-color var(--tpc-transition); }
    .tpc-editor-wrap:focus-within { border-color: hsl(var(--tpc-primary) / 0.5); box-shadow: var(--tpc-shadow-glow); }
    .tpc-toolbar { display: flex; gap: 2px; padding: 8px 10px; background: hsl(var(--tpc-bg)); border-bottom: 1px solid hsl(var(--tpc-border-subtle)); flex-wrap: wrap; }
    .tpc-toolbar button { background: transparent; border: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-size: 0.84rem; transition: all var(--tpc-transition); color: hsl(var(--tpc-text-muted)); }
    .tpc-toolbar button:hover { background: hsl(var(--tpc-primary-light)); color: hsl(var(--tpc-primary-strong)); }
    .tpc-editor { min-height: 110px; padding: 16px; outline: none; font-size: 0.93rem; line-height: 1.6; font-family: var(--tpc-font-body); }
    .tpc-editor:empty:before { content: attr(data-placeholder); color: hsl(var(--tpc-text-soft)); }
    .tpc-visibility-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 0.8rem; }
    .tpc-roles-checkboxes { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.75rem; }
    .tpc-roles-checkboxes label { display: flex; gap: 4px; align-items: center; cursor: pointer; }

    /* ─── PROFILE ─── */
    .tpc-profile-header img.tpc-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid hsl(var(--tpc-primary-light)); box-shadow: var(--tpc-shadow); }
    .tpc-profile-info h1 { margin: 0 0 4px; font-size: 1.3rem; font-family: var(--tpc-font-heading); letter-spacing: -0.01em; }
    .tpc-profile-bio { color: hsl(var(--tpc-text-muted)); font-size: 0.88rem; margin: 6px 0 10px; line-height: 1.5; }
    .tpc-profile-details { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
    .tpc-profile-detail { display: inline-flex; align-items: center; gap: 5px; background: hsl(var(--tpc-primary-light)); padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; color: hsl(var(--tpc-text)); font-weight: 500; border: 1px solid hsl(var(--tpc-border-subtle)); }
    .tpc-profile-detail:hover { border-color: hsl(var(--tpc-primary) / 0.3); }
    .tpc-profile-detail a { color: hsl(var(--tpc-primary)); text-decoration: none; font-weight: 600; }
    .tpc-profile-detail a:hover { text-decoration: underline; }

    /* ─── EDIT PROFILE ─── */
    .tpc-edit-profile { background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow); padding: 28px; }
    .tpc-edit-profile-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
    .tpc-form-group { display: flex; flex-direction: column; gap: 6px; }
    .tpc-form-group label { font-weight: 600; font-size: 0.84rem; color: hsl(var(--tpc-text)); }
    .tpc-success-msg { background: hsl(var(--tpc-success) / 0.06); border: 1px solid hsl(var(--tpc-success) / 0.2); border-radius: var(--tpc-radius); padding: 12px 16px; margin-bottom: 16px; color: hsl(var(--tpc-success)); font-weight: 600; }
    .tpc-text-muted { color: hsl(var(--tpc-text-muted)); font-size: 0.84rem; }

    /* ─── NOTIFICATIONS ─── */
    .tpc-notif-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--tpc-radius); text-decoration: none; color: hsl(var(--tpc-text)); transition: all var(--tpc-transition); margin-bottom: 2px; }
    .tpc-notif-item:hover { background: hsl(var(--tpc-primary-light) / 0.5); }
    .tpc-notif-unread { background: hsl(var(--tpc-primary) / 0.04); border-left: 3px solid hsl(var(--tpc-primary)); }
    .tpc-notif-icon { font-size: 1.3rem; }
    .tpc-notif-text { flex: 1; font-size: 0.88rem; line-height: 1.4; }
    .tpc-notif-time { font-size: 0.72rem; color: hsl(var(--tpc-text-soft)); white-space: nowrap; }

    /* ─── SEARCH ─── */
    .tpc-search-form { display: flex; gap: 10px; margin-bottom: 20px; }
    .tpc-search-input { box-shadow: var(--tpc-shadow-sm); }

    /* ─── SPACES LIST ─── */
    .tpc-spaces-list-wrap { display: flex; flex-direction: column; gap: 16px; }
    .tpc-spaces-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .tpc-spaces-list h2 { grid-column: 1 / -1; margin: 0; font-family: var(--tpc-font-heading); }
    .tpc-space-card { color: hsl(var(--tpc-text)); text-decoration: none; transition: all var(--tpc-transition); padding: 20px; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow-sm); }
    .tpc-space-card:hover { border-color: hsl(var(--tpc-primary) / 0.4); transform: translateY(-2px); box-shadow: var(--tpc-shadow); }
    .tpc-space-card h3 { margin: 0 0 6px; font-size: 1rem; font-family: var(--tpc-font-heading); }
    .tpc-space-card p { font-size: 0.86rem; color: hsl(var(--tpc-text-muted)); margin: 0; line-height: 1.5; }
    .tpc-empty { color: hsl(var(--tpc-text-soft)); text-align: center; padding: 40px 20px; font-size: 0.93rem; }
    .tpc-error { color: hsl(var(--tpc-danger)); text-align: center; padding: 24px; font-weight: 600; }

    /* ─── RESPONSIVE ───
     * Changelog 2026-04-19: barra Spaces orizzontale SOLO su mobile (≤960px),
     * con colore testo leggibile su sfondo scuro della sidebar.
     */
    html, body { overflow-x: hidden; }
    @media (max-width: 960px) {
        html.tpc-community-page body { max-width: 100% !important; overflow-x: hidden !important; }
        html.tpc-community-page body .tpc-community-shell { width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }
        .tpc-community-body { width: 100% !important; grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0 !important; }
        .tpc-community-sidebar { position: static; order: 0; height: auto; background: hsl(var(--tpc-sidebar-bg)); padding: 0; border-top: 1px solid hsl(0 0% 100% / 0.08); border-bottom: 1px solid hsl(0 0% 100% / 0.08); }
        .tpc-sidebar-inner { position: static; top: auto; height: auto; overflow: visible; padding: 0; gap: 0; display: block; }
        .tpc-side-card-feed, .tpc-side-auth, .tpc-side-card:not(.tpc-side-card-spaces) { display: none; }
        /* v3.13.24 — barra spaces mobile: NO scroll orizzontale, va a capo e cresce in altezza quanto serve */
        .tpc-side-card-spaces { padding: 10px 14px; background: hsl(var(--tpc-sidebar-bg)); display: flex; gap: 8px; overflow-x: visible; overflow-y: visible; flex-wrap: wrap; justify-content: flex-start; align-items: center; max-width: 100%; }
        .tpc-side-card-spaces::-webkit-scrollbar { display: none; }
        .tpc-side-card-spaces .tpc-side-label { display: none; }
        .tpc-side-card-spaces .tpc-side-link { flex: 0 1 auto; margin-bottom: 0; white-space: normal; word-break: break-word; padding: 8px 14px; border-radius: 999px; background: hsl(0 0% 100% / 0.08); color: hsl(0 0% 100% / 0.92); text-decoration: none; font-size: 0.88rem; font-weight: 500; transition: all var(--tpc-transition); max-width: 100%; }
        .tpc-side-card-spaces .tpc-side-link:hover { background: hsl(0 0% 100% / 0.16); color: hsl(0 0% 100%); }
        .tpc-side-card-spaces .tpc-side-link.active { background: hsl(var(--tpc-sidebar-active) / 0.32); color: hsl(0 0% 100%); font-weight: 600; }
        .tpc-community-main { order: 1; width: 100% !important; padding: 20px 12px; max-width: 100%; }

        /* NAV CLASSICO MOBILE: brand sopra, menu sotto */
        .tpc-community-topbar .tpc-nav {
            display: flex !important;
            flex-direction: column !important;
            align-items: stretch !important;
            justify-content: flex-start !important;
            gap: 10px !important;
            padding: 12px 14px !important;
        }
        .tpc-community-topbar .tpc-nav-brand {
            display: flex !important;
            justify-content: center !important;
            align-items: center !important;
            align-self: center !important;
            width: auto !important;
            max-width: 100% !important;
            flex: 0 0 auto !important;
        }
        .tpc-community-topbar .tpc-nav-brand img {
            display: block !important;
            width: auto !important;
            max-width: min(100%, 280px) !important;
            height: 40px !important;
            max-height: 40px !important;
            object-fit: contain !important;
            aspect-ratio: auto !important;
            margin: 0 auto !important;
        }
        .tpc-community-topbar .tpc-nav-links-scroll {
            width: 100% !important;
            min-width: 0 !important;
        }
        .tpc-community-topbar .tpc-nav-links {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            flex-wrap: nowrap !important;
            white-space: nowrap !important;
            gap: 4px !important;
            width: 100% !important;
            min-width: 0 !important;
        }
        .tpc-community-topbar .tpc-nav-links > * {
            flex: 0 0 auto !important;
        }
        .tpc-community-shell, .tpc-community-body, .tpc-community-main, .tpc-feed, .tpc-post-card, .tpc-post-content, .tpc-comments-section, .tpc-comment, .tpc-comment-body, .tpc-comment-text {
            max-width: 100vw !important;
            min-width: 0 !important;
            overflow-x: clip !important;
        }
        .tpc-post-card {
            width: 100% !important;
            padding-left: 14px !important;
            padding-right: 14px !important;
        }
        .tpc-post-content, .tpc-comment-text, .tpc-post-content > p, .tpc-post-content > div:not([class]), .tpc-comment-text > p {
            text-align: left !important;
        }
        .tpc-post-content iframe, .tpc-post-content video, .tpc-post-content embed, .tpc-post-content object, .tpc-video-embed {
            width: 100% !important;
            max-width: 100% !important;
        }
    }

    /* ─── AUTHOR TAGS ─── */
    .tpc-author-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 3px; }
    .tpc-author-tag { font-size: 0.7rem; color: hsl(var(--tpc-text-muted)); background: hsl(var(--tpc-primary-light)); padding: 2px 9px; border-radius: 999px; font-weight: 500; display: inline-flex; align-items: center; gap: 2px; }

    /* ─── AUTH PAGES ─── */
    .tpc-auth-page { display: flex; justify-content: center; align-items: flex-start; padding: 48px 20px; min-height: 60vh; }
    .tpc-auth-card { background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius-lg); box-shadow: var(--tpc-shadow-lg); padding: 36px 32px; width: 100%; max-width: 480px; }
    .tpc-auth-card h1 { font-family: var(--tpc-font-heading); font-size: 1.5rem; margin: 0 0 8px; text-align: center; color: hsl(var(--tpc-text)); }
    .tpc-auth-subtitle { text-align: center; color: hsl(var(--tpc-text-muted)); font-size: 0.88rem; margin: 0 0 24px; }
    .tpc-auth-switch { text-align: center; color: hsl(var(--tpc-text-muted)); font-size: 0.86rem; margin-top: 20px; }
    .tpc-auth-switch a { color: hsl(var(--tpc-primary)) !important; font-weight: 600; text-decoration: none; }
    .tpc-auth-switch a:hover { color: hsl(var(--tpc-primary-strong)) !important; text-decoration: underline; }
    .tpc-register-form, .tpc-login-form { display: flex; flex-direction: column; gap: 14px; }
    .tpc-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .tpc-error-msg { background: hsl(var(--tpc-danger) / 0.05); border: 1px solid hsl(var(--tpc-danger) / 0.15); border-radius: var(--tpc-radius); padding: 12px 16px; margin-bottom: 16px; color: hsl(var(--tpc-danger)); font-size: 0.86rem; }
    .tpc-error-msg p { margin: 0 0 4px; }
    .tpc-error-msg a { color: hsl(var(--tpc-primary)); font-weight: 600; }

    /* ─── CHECKBOX GRID ─── */
    .tpc-checkbox-grid { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
    .tpc-checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.86rem; color: hsl(var(--tpc-text)); padding: 6px 10px; border-radius: 8px; transition: background var(--tpc-transition); }
    .tpc-checkbox-label:hover { background: hsl(var(--tpc-primary-light)); }
    .tpc-checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: hsl(var(--tpc-primary)); cursor: pointer; }

    /* ─── LOGIN TABS ─── */
    .tpc-login-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: 8px; overflow: hidden; border: 2px solid hsl(var(--tpc-border-subtle)); }
    .tpc-tab { flex: 1; padding: 11px; text-align: center; background: none; border: none; cursor: pointer; font-size: 0.88rem; font-weight: 600; font-family: var(--tpc-font-body); color: hsl(var(--tpc-text-muted)); transition: all var(--tpc-transition); }
    .tpc-tab:hover { color: hsl(var(--tpc-text)); background: hsl(var(--tpc-border-subtle) / 0.3); }
    .tpc-tab.active { color: hsl(0 0% 100%); background: hsl(var(--tpc-primary)); }
    .tpc-tab.active:hover { color: hsl(0 0% 100%); background: hsl(var(--tpc-primary)); }
    .tpc-magic-desc { color: hsl(var(--tpc-text-muted)); font-size: 0.86rem; margin: 0 0 16px; text-align: center; line-height: 1.5; }

    /* ─── ANNOUNCEMENTS ─── */
    .tpc-announcement { background: hsl(var(--tpc-primary-light)); border: 1px solid hsl(var(--tpc-primary) / 0.15); border-radius: var(--tpc-radius-lg); padding: 18px 22px; margin-bottom: 14px; position: relative; overflow: hidden; }
    .tpc-announcement::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: hsl(var(--tpc-primary)); }
    .tpc-announcement-badge { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--tpc-primary-strong)); background: hsl(var(--tpc-primary) / 0.1); padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
    .tpc-announcement-title { margin: 0 0 6px; font-family: var(--tpc-font-heading); font-size: 1.08rem; color: hsl(var(--tpc-text)); }
    .tpc-announcement-content { font-size: 0.9rem; color: hsl(var(--tpc-text-muted)); line-height: 1.55; margin: 0 0 6px; }
    .tpc-announcement-meta { font-size: 0.76rem; color: hsl(var(--tpc-text-soft)); }

    /* ─── BLOCKED NOTICE ─── */
    .tpc-blocked-notice { background: hsl(var(--tpc-danger) / 0.05); border: 1px solid hsl(var(--tpc-danger) / 0.15); border-radius: var(--tpc-radius); padding: 14px 18px; margin-bottom: 18px; color: hsl(var(--tpc-danger)); font-weight: 600; font-size: 0.9rem; text-align: center; }

    /* ─── MEMBERS PAGE ─── */
    .tpc-members-filters { margin-bottom: 18px; }
    .tpc-members-filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
    .tpc-members-search { max-width: 220px; }
    .tpc-members-select { max-width: 200px; }
    .tpc-members-count { color: hsl(var(--tpc-text-muted)); font-size: 0.88rem; margin: 0 0 14px; }
    .tpc-members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
    .tpc-member-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); border-radius: var(--tpc-radius); text-decoration: none; color: hsl(var(--tpc-text)); transition: all var(--tpc-transition); box-shadow: var(--tpc-shadow-sm); }
    .tpc-member-card:hover { border-color: hsl(var(--tpc-primary) / 0.4); transform: translateY(-2px); box-shadow: var(--tpc-shadow); }
    .tpc-member-card img.tpc-avatar { width: 52px; height: 52px; border-radius: 50%; border: 2px solid hsl(var(--tpc-primary-light)); flex-shrink: 0; }
    .tpc-member-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .tpc-member-name { font-weight: 600; font-size: 0.93rem; font-family: var(--tpc-font-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tpc-member-meta { font-size: 0.76rem; color: hsl(var(--tpc-text-muted)); display: flex; align-items: center; gap: 4px; }
    .tpc-members-pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
    .tpc-page-link { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: hsl(var(--tpc-surface)); border: 1px solid hsl(var(--tpc-border-subtle)); color: hsl(var(--tpc-text)); text-decoration: none; font-weight: 600; font-size: 0.86rem; transition: all var(--tpc-transition); }
    .tpc-page-link:hover { border-color: hsl(var(--tpc-primary) / 0.4); background: hsl(var(--tpc-primary-light)); }
    .tpc-page-active { background: hsl(var(--tpc-primary)); color: #fff; border-color: hsl(var(--tpc-primary)); }
    .tpc-page-active:hover { background: hsl(var(--tpc-primary-strong)); }
    @media (max-width: 700px) {
        .tpc-members-filter-form { flex-direction: column; }
        .tpc-members-search, .tpc-members-select { max-width: 100%; }
        .tpc-members-grid { grid-template-columns: 1fr; }
    }


    /* ═══════════════════════════════════════════════════════════
       SUBSTACK-BLEND LAYOUT
       ═══════════════════════════════════════════════════════════ */

    /* ─── NAV TOP ─── */
    .tpc-layout-substack .tpc-community-topbar { border-bottom: 1px solid hsl(var(--tpc-border)); background: hsl(var(--tpc-surface)); }
    .tpc-sub-nav-wrap { background: hsl(var(--tpc-surface)); }
    .tpc-sub-nav-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 32px; max-width: 1100px; margin: 0 auto; gap: 16px; }
    .tpc-sub-brand { font-family: var(--tpc-font-heading); font-size: 1.6rem; font-weight: 800; color: hsl(var(--tpc-text)); text-decoration: none; letter-spacing: -0.03em; flex-shrink: 0; }
    .tpc-sub-brand:hover { color: hsl(var(--tpc-primary)); }
    .tpc-sub-nav-left, .tpc-sub-nav-right { display: flex; align-items: center; gap: 8px; min-width: 120px; }
    .tpc-sub-nav-right { justify-content: flex-end; }
    .tpc-sub-avatar-link img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid hsl(var(--tpc-border-subtle)); }
    .tpc-sub-icon { font-size: 1.1rem; text-decoration: none; padding: 6px 8px; border-radius: 8px; transition: all var(--tpc-transition); cursor: pointer; background: none; border: none; color: hsl(var(--tpc-text-muted)); position: relative; }
    .tpc-sub-icon:hover { background: hsl(var(--tpc-primary-light)); color: hsl(var(--tpc-text)); }
    .tpc-sub-signin { font-size: 0.88rem; color: hsl(var(--tpc-text-muted)); text-decoration: none; font-weight: 500; padding: 6px 12px; border-radius: 8px; transition: all var(--tpc-transition); }
    .tpc-sub-signin:hover { color: hsl(var(--tpc-text)); background: hsl(var(--tpc-primary-light)); }
    .tpc-sub-subscribe { font-size: 0.86rem; font-weight: 600; color: #fff; background: hsl(var(--tpc-primary)); padding: 8px 20px; border-radius: 999px; text-decoration: none; transition: all var(--tpc-transition); }
    .tpc-sub-subscribe:hover { background: hsl(var(--tpc-primary-strong)); }

    /* ─── CATEGORIES NAV ─── */
    .tpc-sub-nav-cats { display: flex; justify-content: center; gap: 4px; padding: 0 32px 12px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; border-bottom: 1px solid hsl(var(--tpc-border-subtle)); }
    .tpc-sub-cat-link { font-size: 0.88rem; font-weight: 500; color: hsl(var(--tpc-text-muted)); text-decoration: none; padding: 8px 14px; border-radius: 8px; transition: all var(--tpc-transition); font-family: var(--tpc-font-body); white-space: nowrap; }
    .tpc-sub-cat-link:hover { color: hsl(var(--tpc-text)); background: hsl(var(--tpc-primary-light)); }
    .tpc-sub-cat-link.active { color: hsl(var(--tpc-text)); font-weight: 600; border-bottom: 2px solid hsl(var(--tpc-primary)); border-radius: 8px 8px 0 0; }

    /* ─── MAIN CONTENT AREA ─── */
    .tpc-substack-main { max-width: 1100px; margin: 0 auto; padding: 32px; }

    /* ─── HERO SECTION ─── */
    .tpc-sub-hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; padding-bottom: 32px; margin-bottom: 28px; border-bottom: 1px solid hsl(var(--tpc-border-subtle)); }

    .tpc-sub-hero-post { display: flex; flex-direction: column; gap: 16px; }
    .tpc-sub-hero-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--tpc-radius-lg); }
    .tpc-sub-hero-img-link { display: block; overflow: hidden; border-radius: var(--tpc-radius-lg); }
    .tpc-sub-hero-img-link:hover img { transform: scale(1.02); }
    .tpc-sub-hero-img { transition: transform 0.4s ease; }
    .tpc-sub-hero-content { display: flex; flex-direction: column; gap: 8px; }
    .tpc-sub-hero-title { font-family: var(--tpc-font-heading); font-size: 1.8rem; font-weight: 800; color: hsl(var(--tpc-text)); text-decoration: none; line-height: 1.2; letter-spacing: -0.02em; }
    .tpc-sub-hero-title:hover { color: hsl(var(--tpc-primary)); }
    .tpc-sub-hero-excerpt { font-size: 1rem; color: hsl(var(--tpc-text-muted)); line-height: 1.6; margin: 0; }
    .tpc-sub-hero-meta { display: flex; gap: 12px; align-items: center; font-size: 0.82rem; color: hsl(var(--tpc-text-soft)); flex-wrap: wrap; }
    .tpc-sub-meta-author { font-weight: 600; color: hsl(var(--tpc-text)); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.76rem; }

    /* ─── POPULAR SIDEBAR ─── */
    .tpc-sub-popular { display: flex; flex-direction: column; gap: 0; }
    .tpc-sub-popular-title { font-family: var(--tpc-font-body); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: hsl(var(--tpc-text)); margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid hsl(var(--tpc-text)); }
    .tpc-sub-popular-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid hsl(var(--tpc-border-subtle)); text-decoration: none; color: hsl(var(--tpc-text)); transition: all var(--tpc-transition); }
    .tpc-sub-popular-item:last-child { border-bottom: none; }
    .tpc-sub-popular-item:hover { color: hsl(var(--tpc-primary)); }
    .tpc-sub-popular-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
    .tpc-sub-popular-item-title { font-family: var(--tpc-font-heading); font-size: 0.95rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .tpc-sub-popular-meta { font-size: 0.72rem; color: hsl(var(--tpc-text-soft)); text-transform: uppercase; letter-spacing: 0.04em; }
    .tpc-sub-popular-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }

    /* ─── FEED TABS ─── */
    .tpc-sub-feed-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid hsl(var(--tpc-border-subtle)); }
    .tpc-sub-tab { font-size: 0.88rem; font-weight: 600; color: hsl(var(--tpc-text-muted)); padding: 10px 18px; cursor: default; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: var(--tpc-font-body); }
    .tpc-sub-tab.active { color: hsl(var(--tpc-text)); border-bottom-color: hsl(var(--tpc-primary)); }

    /* ─── GRID ─── */
    .tpc-sub-grid { display: grid; grid-template-columns: 1fr; gap: 0; }

    /* ─── SUBSTACK DARK MODE ─── */
    .tpc-layout-substack.tpc-dark .tpc-sub-nav-wrap,
    .tpc-layout-substack.tpc-dark .tpc-community-topbar { background: hsl(var(--tpc-surface)); border-color: hsl(var(--tpc-border)); }

    /* ─── SUBSTACK RESPONSIVE ─── */
    @media (max-width: 768px) {
        .tpc-sub-hero-section { grid-template-columns: 1fr; gap: 24px; }

        /* TOP NAV: logo su riga dedicata, menu/azioni completamente sotto */
        .tpc-sub-nav-top {
            padding: 10px 12px;
            display: grid;
            grid-template-columns: auto 1fr auto;
            align-items: center;
            justify-items: center;
            gap: 8px 10px;
        }
        .tpc-sub-brand {
            grid-column: 1 / -1;
            grid-row: 1;
            width: fit-content !important;
            max-width: 100%;
            align-self: center;
            justify-self: center;
            text-align: center;
            display: inline-flex;
            justify-content: center;
            align-items: center;
        }
        .tpc-sub-brand img,
        .tpc-substack-sub-header .tpc-sub-brand img { height: 40px !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; display: block !important; aspect-ratio: auto !important; }
        .tpc-sub-nav-left { grid-column: 1; grid-row: 2; min-width: auto; flex-shrink: 0; justify-self: start; }
        .tpc-sub-nav-right {
            grid-column: 2 / 4;
            grid-row: 2;
            min-width: 0;
            width: 100%;
            justify-content: center;
            flex-wrap: wrap;
            row-gap: 6px;
            column-gap: 6px;
        }
        .tpc-sub-nav-right > * { flex: 0 0 auto; }

        /* SPACES BAR: subito sotto il top nav, sticky, scrollabile orizzontalmente.
           Stesso colore di superficie del top + bordo sottile per gerarchia visiva
           (principio: ridurre rumore cromatico, separazione tramite spaziatura/bordo). */
        .tpc-sub-nav-cats {
            position: sticky;
            top: 0;
            z-index: 50;
            background: hsl(var(--tpc-surface));
            border-top: 1px solid hsl(var(--tpc-border-subtle));
            border-bottom: 1px solid hsl(var(--tpc-border-subtle));
            padding: 6px 12px;
            margin: 0;
            gap: 6px;
            justify-content: flex-start;
            /* v3.13.24 — niente scroll orizzontale: la barra cresce in altezza per accogliere tutti gli spaces */
            overflow-x: visible;
            flex-wrap: wrap;
            max-width: 100%;
            scrollbar-width: none;
            mask-image: none;
        }
        .tpc-sub-nav-cats::-webkit-scrollbar { display: none; }
        .tpc-sub-cat-link { flex: 0 1 auto; max-width: 100%; white-space: normal; word-break: break-word; }
        .tpc-layout-substack .tpc-community-topbar .tpc-sub-nav-cats { display: none; }
        .tpc-layout-substack .tpc-sub-nav-cats { display: flex; }

        .tpc-sub-brand { font-size: 1.2rem; }
        .tpc-sub-hero-title { font-size: 1.3rem; }
        .tpc-substack-main { padding: 20px 16px; }
    }
    @media (max-width: 480px) {
        .tpc-sub-brand { font-size: 1rem; }
        .tpc-sub-hero-title { font-size: 1.15rem; }
        .tpc-sub-cat-link { font-size: 0.8rem; padding: 6px 10px; }
        .tpc-sub-subscribe { padding: 6px 14px; font-size: 0.8rem; }
    }

    /* ─── IFRAME EMBED ─── */
    .tpc-iframe-wrap { width: 100%; min-height: 80vh; }
    .tpc-iframe-content { width: 100%; height: 80vh; border: 1px solid hsl(var(--tpc-border)); border-radius: var(--tpc-radius); }
    \n/* v3.13.22 — critical mobile overflow guard, loaded after custom CSS */
html.tpc-community-page,html.tpc-community-page body{max-width:100%!important;overflow-x:hidden!important;}
html.tpc-community-page body .site,html.tpc-community-page body #page,html.tpc-community-page body .site-content,html.tpc-community-page body .content-area,html.tpc-community-page body #primary,html.tpc-community-page body main.site-main,html.tpc-community-page body article,html.tpc-community-page body .entry-content,html.tpc-community-page body .wp-block-post-content{min-width:0!important;max-width:100vw!important;box-sizing:border-box!important;overflow-x:clip!important;}
.tpc-community-shell,.tpc-community-body,.tpc-community-main,.tpc-feed,.tpc-space,.tpc-single-post,.tpc-post-card,.tpc-post-header,.tpc-post-meta,.tpc-post-content,.tpc-comments-section,.tpc-comment-entry,.tpc-comment,.tpc-comment-body,.tpc-comment-text{min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
.tpc-community-shell,.tpc-community-main,.tpc-feed,.tpc-post-card,.tpc-post-content,.tpc-comment-body,.tpc-comment-text{overflow-x:clip!important;}
.tpc-post-meta,.tpc-comment-body{flex:1 1 auto!important;}
.tpc-post-content,.tpc-comment-text,.tpc-post-content *,.tpc-comment-text *{overflow-wrap:anywhere!important;word-wrap:break-word!important;word-break:break-word!important;}
.tpc-post-content img,.tpc-comment-text img{height:auto!important;max-width:100%!important;}
.tpc-post-content iframe,.tpc-comment-text iframe,.tpc-post-content video,.tpc-comment-text video,.tpc-post-content embed,.tpc-comment-text embed,.tpc-post-content object,.tpc-comment-text object,.tpc-video-embed{width:100%!important;max-width:100%!important;}
.tpc-video-embed{box-sizing:border-box!important;margin-left:0!important;margin-right:0!important;overflow:hidden!important;}
@media(max-width:960px){html.tpc-community-page body .tpc-community-shell{position:relative!important;width:100vw!important;max-width:100vw!important;margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;} .tpc-community-body,.tpc-community-main,.tpc-feed,.tpc-post-card,.tpc-post-content,.tpc-comments-section,.tpc-comment,.tpc-comment-body,.tpc-comment-text{max-width:100%!important;overflow-x:clip!important;}.tpc-community-main{width:100%!important;padding-left:12px!important;padding-right:12px!important;}.tpc-post-card{width:100%!important;padding-left:14px!important;padding-right:14px!important;}.tpc-post-content,.tpc-comment-text,.tpc-post-content>p,.tpc-post-content>div:not([class]),.tpc-comment-text>p{text-align:left!important;}}\n