@font-face {
  font-family: "DM Serif Display";
  src: url("../fonts/DMSerifDisplay-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../fonts/DMSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}


/* ═══════════════════════════════════════════
   Le Alternative | Lista - Styles
   ═══════════════════════════════════════════ */

:root {
    --rosa: #e91e63;
    --rosa-light: #fce4ec;
    --rosa-lighter: #fdf0f3;
    --rosa-dark: #c2185b;
    --rosa-glow: rgba(233, 30, 99, 0.08);

    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-tertiary: #8888a0;
    --text-on-rosa: #fff;

    --bg: #ffffff;
    --bg-warm: #fefcfb;
    --bg-card: #ffffff;
    --bg-hover: #f8f6f9;
    --bg-filter: #f4f2f6;

    --border: #e8e6ee;
    --border-light: #f0eef4;
    --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.04);
    --shadow-md: 0 4px 16px rgba(26, 26, 46, 0.06);
    --shadow-lg: 0 8px 32px rgba(26, 26, 46, 0.08);
    --shadow-card: 0 1px 4px rgba(26, 26, 46, 0.04), 0 4px 12px rgba(26, 26, 46, 0.03);
    --shadow-card-hover: 0 4px 20px rgba(233, 30, 99, 0.08), 0 8px 24px rgba(26, 26, 46, 0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
	
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;


    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --max-width: 1200px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--rosa); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--rosa-dark); }

/* ─── Top Alert ─── */
.top-alert {
    background: var(--rosa);
    color: white;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    position: relative;
    z-index: 60;
}

.top-alert.hidden { display: none; }

.top-alert-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 2.5rem 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-alert-text a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 700;
}

.top-alert-text a:hover { opacity: 0.85; }

.top-alert-close {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.top-alert-close svg { width: 14px; height: 14px; color: white; }
.top-alert-close:hover { background: rgba(255, 255, 255, 0.2); }

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
#hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg);
    padding: 2rem 1.5rem;
	overflow: hidden;
}

/* Subtle radial gradient */
#hero::before {
    content: '';
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--rosa-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 640px;
    width: 100%;
    animation: heroFadeIn 0.8s var(--ease-out) both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-logo {
    margin-bottom: 1.25rem;
}

.logo-img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 8px rgba(233, 30, 99, 0.15));
    transition: transform 0.4s var(--ease-spring);
}

.logo-img:hover {
    transform: scale(1.08) rotate(-3deg);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.2;
}

.hero-title-accent {
    color: var(--rosa);
}

.hero-subtitle {
    font-size: 1.05rem;
    color: var(--rosa);
    margin-top: 0.5rem;
    text-align: center;
    font-weight: 400;
}

/* ─── Search box ─── */
.search-wrapper {
    width: 100%;
    max-width: 560px;
    margin-top: 2rem;
    position: relative;
	z-index: 10;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.75rem 1.25rem;
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-sm);
}

.search-box:focus-within {
    border-color: var(--rosa);
    box-shadow: 0 0 0 4px var(--rosa-glow), var(--shadow-md);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    transition: color 0.2s;
}

.search-box:focus-within .search-icon {
    color: var(--rosa);
}

#searchInput, #filterSearchInput {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--text-primary);
    background: transparent;
    padding: 0 0.75rem;
}

#searchInput::placeholder, #filterSearchInput::placeholder {
    color: var(--text-tertiary);
}

.search-clear {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--bg-filter);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    padding: 0;
}

.search-clear svg { width: 14px; height: 14px; color: var(--text-secondary); }
.search-clear:hover { background: var(--rosa-light); }
.search-clear:hover svg { color: var(--rosa); }
.search-clear.visible { display: flex; }
.filter-search-clear { width: 22px; height: 22px; }
.filter-search-clear svg { width: 12px; height: 12px; }

/* ─── Search Suggestions Dropdown ─── */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    overscroll-behavior: contain;
}

.search-suggestions.active { display: block; animation: suggestionsIn 0.2s var(--ease-out); }

@keyframes suggestionsIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.suggestion-item:hover, .suggestion-item.active {
    background: var(--rosa-lighter);
}

.suggestion-item:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.suggestion-item:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.suggestion-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    background: var(--bg-filter);
    padding: 3px;
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
}

.suggestion-name {
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.suggestion-category {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

/* ─── Hero Chips ─── */
.hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    max-width: 560px;
    animation: heroFadeIn 0.8s var(--ease-out) 0.3s both;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-warm);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    white-space: nowrap;
}

.hero-chip:hover {
    color: var(--rosa);
    border-color: var(--rosa-light);
    background: var(--rosa-lighter);
    transform: translateY(-1px);
}

.hero-chip svg { width: 13px; height: 13px; }

/* ─── Scroll hint ─── */
.scroll-hint {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    animation: scrollBounce 2.5s ease-in-out infinite;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 0;
}

.scroll-hint:hover { color: var(--rosa); }
.scroll-hint svg { width: 20px; height: 20px; }

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(6px); opacity: 1; }
}

/* ═══════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════ */
.filter-bar {
    position: sticky;
    top: 0;
    z-index: 45;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s;
}

.filter-bar.scrolled {
    box-shadow: var(--shadow-sm);
}

.filter-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-bar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-filter);
    border-radius: var(--radius-full);
    padding: 0.5rem 0.85rem;
    flex-shrink: 0;
    min-width: 0;
    max-width: 220px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.filter-bar-search:focus-within {
    border-color: var(--rosa);
    background: var(--bg);
}

.filter-search-icon {
    width: 16px;
    height: 16px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

#filterSearchInput {
    font-size: 0.88rem;
    min-width: 0;
    width: 100%;
    padding: 0;
}

.filter-chips-scroll {
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
}

.filter-chips-scroll::-webkit-scrollbar { display: none; }

.filter-chips {
    display: flex;
    gap: 0.4rem;
    white-space: nowrap;
    padding: 2px 0;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-filter);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--rosa-lighter);
    color: var(--rosa);
}

.filter-chip.active {
    background: var(--rosa);
    color: var(--text-on-rosa);
    border-color: var(--rosa);
}

.filter-chip .chip-emoji { font-size: 0.9rem; line-height: 1; }

.filter-clear-all {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--rosa);
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    display: none;
    flex-shrink: 0;
}

.filter-clear-all.visible { display: block; }
.filter-clear-all:hover { background: var(--rosa-lighter); }

/* Active filters display */
.active-filters {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: none;
}

.active-filters.visible {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding-bottom: 0.6rem;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--rosa-dark);
    background: var(--rosa-light);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s;
}

.active-filter-tag:hover { background: var(--rosa); color: white; }
.active-filter-tag svg { width: 10px; height: 10px; }

/* ─── Results info ─── */
.results-info {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.results-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════
   CATEGORIES & CARDS
   ═══════════════════════════════════════════ */
.categories-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.5rem 1.5rem 4rem;
}

.category-section {
    margin-bottom: 2.5rem;
}

.category-section.hidden { display: none; }

.category-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
	background-color: var(--rosa-glow);
	padding-left: 0.5em;
    border-bottom: 2px solid var(--border-light);
}

.category-name {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
}

.category-count {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

.category-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.category-description a { font-weight: 500; }

/* Alternatives from (prodotti_alternativi) */
.category-replaces {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 1rem;
}

.replaces-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
    line-height: 1.8;
}

.replaces-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-filter);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
}

    a.category-deeplink {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
    transition: color 0.2s;
}

a.category-deeplink:hover {
    color: var(--rosa);
}

/* ─── Alternative Cards Grid ─── */
.alternatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.alt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

.alt-card:hover {
    border-color: var(--rosa-light);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.alt-card.hidden { display: none; }

/* Card header */
.alt-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.alt-logo-wrap {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-filter);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    padding: 6px;
}

.alt-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.alt-logo-placeholder {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--rosa-light), var(--rosa-lighter));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--rosa);
    flex-shrink: 0;
}

.alt-info { flex: 1; min-width: 0; }

.alt-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.alt-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.alt-name a {
    color: inherit;
    transition: color 0.2s;
}

.alt-name a:hover { color: var(--rosa); }

.alt-location-badge {
	display: inline-flex;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-sm);
    background: var(--bg-filter);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
	gap: 0.2rem;
}

.alt-location-badge.eu {
    background: #e3f2fd;
    color: #1565c0;
}

/* Card description */
.alt-description {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 0.75rem;
}

.alt-description a { font-weight: 500; }

/* Pro/Con */
.alt-pros-cons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
}

.alt-pros, .alt-cons { min-width: 0; }

.pro-item, .con-item {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.pro-item::before {
    content: '✓';
    color: #4caf50;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.con-item::before {
    content: '✗';
    color: #ef5350;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Meta badges */
.alt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--bg-filter);
    color: var(--text-secondary);
    cursor: default;
}

.meta-badge.emphasis {
    background: var(--rosa-lighter);
    color: var(--rosa-dark);
}

.meta-badge.green {
    background: #e8f5e9;
    color: #2e7d32;
}

.meta-badge .badge-icon { font-size: 0.78rem; line-height: 1; }

/* Platforms */
.alt-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.65rem;
}

.platform-tag {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-sm);
    background: var(--bg-filter);
    color: var(--text-tertiary);
}

/* Payment badges */
.alt-payments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.18rem 0.5rem;
    border-radius: var(--radius-full);
    cursor: default;
}

.payment-badge.free { background: #e8f5e9; color: #2e7d32; }
.payment-badge.euro { background: #e3f2fd; color: #1565c0; }
.payment-badge.bitcoin { background: #fff8e1; color: #f57f17; }
.payment-badge.monero { background: #fff3e0; color: #e65100; }
.payment-badge.cash { background: #f3e5f5; color: #7b1fa2; }

/* Download links */
.alt-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-light);
}

.download-link {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--rosa);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    transition: color 0.2s;
}

.download-link:hover { color: var(--rosa-dark); }
.download-link svg { width: 12px; height: 12px; }

/* ═══════════════════════════════════════════
   PROTOCOL BLOCKS
   ═══════════════════════════════════════════ */
.protocol-block {
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
}

.protocol-header-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--rosa-lighter), var(--bg-warm));
    border-bottom: 1px dashed var(--border);
}

.protocol-header-card .alt-card-header { margin-bottom: 0.6rem; }

.proto-logo-wrap {
    width: 52px;
    height: 52px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.8);
}

.proto-name {
    font-size: 1.2rem !important;
}

.proto-name a { color: var(--rosa); }
.proto-name a:hover { color: var(--rosa-dark); }

.protocol-header-card .alt-description {
    margin-bottom: 0.5rem;
}

.protocol-header-card .alt-meta {
    margin-bottom: 0.5rem;
}

.protocol-header-card .alt-downloads {
    border-top: none;
    padding-top: 0;
    margin-top: 0.25rem;
}

.proto-sub-section {
    padding: 0 1.5rem 1rem;
}

.proto-sub-title {
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--rosa);
    margin: 1.25rem 0 0.75rem;
}

.proto-section-hidden {
    display: none !important;
}

.proto-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.75rem;
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-on-rosa);
    background: var(--rosa);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.proto-toggle-btn:hover {
    background: var(--rosa-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.toggle-arrow {
    font-size: 0.72rem;
}

/* Cards inside protocol blocks */
.protocol-block .alternatives-grid {
    gap: 0.75rem;
}

.protocol-block .alt-card {
    border: 1px solid var(--border-light);
    box-shadow: none;
}

.protocol-block .alt-card:hover {
    border-color: var(--rosa-light);
    box-shadow: var(--shadow-card-hover);
}

/* Category subtitle */
.category-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--rosa);
    margin-bottom: 0.5rem;
}

/* ─── No results ─── */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-tertiary);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.no-results-hint { font-size: 0.88rem; }

/* ═══════════════════════════════════════════
   ECOSYSTEM SIDEBAR (Desktop)
   ═══════════════════════════════════════════ */
.eco-sidebar {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s var(--ease-out);
}

.eco-sidebar.visible {
    opacity: 1;
    pointer-events: auto;
}

.eco-sidebar-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    padding: 0.5rem 0.35rem;
    opacity: 0.6;
}

.eco-sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 0.45rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    box-shadow: -4px 0 24px rgba(26, 26, 46, 0.06);
}

.eco-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    transition: all 0.35s var(--ease-out);
    height: 40px;
    width: 36px;
    flex-shrink: 0;
}

.eco-sidebar-items:hover .eco-sidebar-item {
    width: 150px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.eco-item-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-filter);
    flex-shrink: 0;
    transition: all 0.3s var(--ease-out);
    overflow: hidden;
    padding: 5px;
}

.eco-dot-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Remove old color backgrounds — dots now use logo images */

.eco-sidebar-item:hover .eco-item-dot {
    border-radius: var(--radius-sm);
}

.eco-item-info {
    display: flex;
    flex-direction: column;
    padding: 0 0.65rem 0 0.45rem;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.2s 0.1s;
    min-width: 0;
}

.eco-sidebar-items:hover .eco-sidebar-item .eco-item-info {
    opacity: 1;
}

.eco-sidebar-item:hover {
    background: var(--rosa-lighter);
}

.eco-item-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.eco-item-desc {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    line-height: 1.2;
}

/* ═══════════════════════════════════════════
   ECOSYSTEM INLINE (Mobile)
   ═══════════════════════════════════════════ */
.eco-inline {
    margin: 1.5rem 0 2.5rem;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    display: none; /* shown only on mobile via media query */
}

.eco-inline-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.eco-inline-logo {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.eco-inline-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.eco-inline-subtitle {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.eco-inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.6rem;
}

.eco-inline-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1rem 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    text-align: center;
}

.eco-inline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--rosa-light);
}

.eco-card-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
    flex-shrink: 0;
    background: var(--bg-filter);
    padding: 5px;
}

.eco-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.eco-card-desc {
    font-size: 0.68rem;
    color: var(--text-tertiary);
}

/* ─── Categories trigger ─── */
.cat-trigger {
    position: fixed;
    top: 5.5rem;
    left: 1.5rem;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1em;
    padding: 0.55rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.3s var(--ease-out);
}
.cat-trigger svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.cat-trigger-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.cat-trigger:hover { border-color: var(--accent); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.cat-trigger:hover .cat-trigger-label { color: var(--accent); }
.cat-trigger.badge-hidden { opacity: 0; pointer-events: none; transform: translateY(-12px); }
.theme-toggle.badge-hidden { opacity: 0; pointer-events: none; transform: translateY(-12px); }

/* ─── Overlay ─── */
.cat-overlay {
    position: fixed; inset: 0;
    z-index: 55;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}
.cat-overlay.open { opacity: 1; pointer-events: auto; }

/* ─── Drawer (desktop: da sinistra) ─── */
.cat-drawer {
    position: fixed;
    top: 0; left: 0;
    z-index: 60;
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease-out);
    overflow: hidden;
}
.cat-drawer.open { transform: translateX(0); }
.cat-drawer-handle { display: none; }
.cat-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.15rem 1rem;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.cat-drawer-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 400; color: var(--text-primary); }
.cat-drawer-close { background: none; border: none; cursor: pointer; padding: 0.25rem; border-radius: 50%; transition: background 0.2s; }
.cat-drawer-close svg { width: 16px; height: 16px; color: var(--text-secondary); }
.cat-drawer-close:hover { background: var(--bg-hover); }

.cat-drawer-list { list-style: none; margin: 0; padding: 0.4rem 0; overflow-y: auto; flex: 1; }
.cat-drawer-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.15rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cat-drawer-item a:hover { background: var(--bg-hover); border-left-color: var(--accent); color: var(--accent); }
.cat-drawer-item a i { width: 18px; text-align: center; font-size: 0.875rem; color: var(--text-tertiary); flex-shrink: 0; transition: color 0.15s; }
.cat-drawer-item a:hover i { color: var(--accent); }

/* ─── Mobile: bottom sheet ─── */
@media (max-width: 768px) {
    .cat-trigger-label { display: none; }
    .cat-trigger { top: 10rem; left: 1rem; padding: 0.45rem 0.65rem; }

    .cat-drawer {
        top: auto;
        bottom: 0; left: 0; right: 0;
        width: 100%;
        height: 65vh;
        border-right: none;
        border-top: 1px solid var(--border);
        border-radius: 1.25rem 1.25rem 0 0;
        transform: translateY(110%);
    }
    .cat-drawer.open { transform: translateY(0); }

    .cat-drawer-handle {
        display: block;
        width: 36px; height: 4px;
        background: var(--border);
        border-radius: 2px;
        margin: 0.75rem auto 0;
        flex-shrink: 0;
    }
    .cat-drawer-header { padding-top: 0.6rem; }
}

/* ─── Back to top ─── */
.back-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 45;
    width: 46px;
    height: 46px;
    background: var(--bg-card);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.75);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.back-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}
.back-top:hover {
    box-shadow: var(--shadow-card-hover);
    transform: scale(1.08);
}
.back-top-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.back-top-track {
    fill: none;
    stroke: var(--border-light);
    stroke-width: 2;
}
.back-top-progress {
    fill: none;
    stroke: var(--rosa);
    stroke-width: 2.2;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.12s linear;
}
.back-top-arrow {
    width: 17px;
    height: 17px;
    color: var(--rosa);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .back-top { bottom: 1rem; right: 1rem; width: 42px; height: 42px; }
}



/* ─── Desktop: show sidebar, hide inline ─── */
@media (min-width: 769px) {
    .eco-sidebar { display: flex; }
    .eco-inline { display: none !important; }
}

/* ─── Mobile: hide sidebar, show inline ─── */
@media (max-width: 768px) {
    .eco-sidebar { display: none !important; }
    .eco-inline { display: block; }
    
    .eco-inline-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .eco-inline-card {
        padding: 0.85rem 0.5rem;
    }
    
    .eco-card-logo {
        width: 36px;
        height: 36px;
    }
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
#footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.7);
    padding: 3rem 1.5rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.footer-logo {
    width: 32px;
    height: 32px;
}

.footer-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

.footer-text {
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-text a { color: rgba(255, 255, 255, 0.9); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.footer-text a:hover { color: var(--rosa-light); }

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--rosa-light); }


/* ═══════════════════════════════════════════
   CHANGELOG BADGE & PANEL
   ═══════════════════════════════════════════ */
.changelog-badge {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-family: var(--font-body);
}

.changelog-badge svg {
    width: 16px;
    height: 16px;
    color: var(--rosa);
    flex-shrink: 0;
}

.changelog-badge-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.changelog-badge:hover {
    border-color: var(--rosa-light);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.changelog-badge:hover .changelog-badge-label { color: var(--rosa); }

/* Panel */
.changelog-panel {
    position: fixed;
    bottom: 7.5rem;
    left: 1.5rem;
    z-index: 55;
    width: 340px;
    max-height: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: all 0.3s var(--ease-out);
}

.changelog-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.changelog-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
}

.changelog-panel-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.changelog-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.changelog-panel-close svg { width: 16px; height: 16px; color: var(--text-tertiary); }
.changelog-panel-close:hover { background: var(--bg-filter); }

.changelog-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.15rem;
}

/* .changelog-entry {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-light);
}

.changelog-entry:last-child { border-bottom: none; } */

.changelog-date {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rosa);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.changelog-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-top: 0.15rem;
}

.changelog-overlay {
    position: fixed;
    inset: 0;
    z-index: 44;
    display: none;
}

.changelog-overlay.open { display: block; }

a.changelog-entry {
    display: block;
    text-decoration: none;
    transition: background 0.15s;
    margin: 0 -1.15rem;
    padding: 0.55rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
}

a.changelog-entry:last-child { border-bottom: none; }
a.changelog-entry:hover { background: var(--rosa-lighter); }

.changelog-badge.badge-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

.changelog-panel-body::-webkit-scrollbar { width: 4px; }
.changelog-panel-body::-webkit-scrollbar-track { background: transparent; }
.changelog-panel-body::-webkit-scrollbar-thumb {
    background: var(--rosa-light);
    border-radius: 2px;
}
.changelog-panel-body::-webkit-scrollbar-thumb:hover { background: var(--rosa); }
.changelog-panel-body { scrollbar-width: thin; scrollbar-color: var(--rosa-light) transparent; }

/* ─── Community badge ─── */
.community-badge {
    position: fixed;
    bottom: 4.5rem;
    left: 1.5rem;
    z-index: 45;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    font-family: var(--font-body);
}
.community-badge svg {
    width: 16px;
    height: 16px;
    color: var(--rosa);
    flex-shrink: 0;
}
.community-badge-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.community-badge:hover {
    border-color: var(--rosa-light);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}
.community-badge:hover .community-badge-label { color: var(--rosa); }
.community-badge.badge-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

/* ─── Community panel ─── */
.community-panel {
    position: fixed;
    bottom: 7.5rem;
    left: 1.5rem;
    z-index: 55;
    width: 300px;
    background: var(--bg-card);
    border: 1px solid var(--rosa-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: all 0.3s var(--ease-out);
}
.community-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.community-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    background: var(--rosa);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.community-panel-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: #fff;
}
.community-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: background 0.2s;
}
.community-panel-close svg { width: 16px; height: 16px; color: rgba(255,255,255,0.8); }
.community-panel-close:hover { background: rgba(255,255,255,0.15); }
.community-panel-body { padding: 0.4rem 0; }

.community-entry {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    padding: 0.7rem 1.15rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}
.community-entry:last-child { border-bottom: none; }
.community-entry:hover { background: var(--rosa-lighter); }
.community-entry-icon {
    width: 22px;
    height: 22px;
    color: var(--rosa);
    flex-shrink: 0;
}
.community-entry-info { display: flex; flex-direction: column; gap: 0.1rem; }
.community-entry-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}
.community-entry-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


.flag-icon {
    width: 22px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
}

.alt-location-badge {
    position: relative;
}

.loc-check {
    position: absolute;
    top: -4px;
    right: -6px;
    width: 16px;
    height: 16px;
    background: #4caf50;
    color: white;
    font-size: 9px;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    border: 1.5px solid var(--bg-card);
}

/* ─── Blog suggestions in dropdown ─── */
.blog-suggestion-divider {
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--rosa);
    padding: 0.5rem 1rem 0.25rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.25rem;
}
.blog-suggestion-item .suggestion-icon i { color: var(--rosa); }
.blog-suggestion-item:hover { border-left: 2px solid var(--rosa); }

/* ─── Suggestion no-results hint ─── */
.suggestion-no-results {
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.blog-hint-inline {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--rosa);
    font-size: inherit;
    font-weight: 600;
    text-decoration: underline;
    padding: 0;
}


/* ── Anchor copy button ── */
.category-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.anchor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-tertiary, #aaa);
    opacity: 0;
    transition: opacity 0.2s ease, border-color 0.2s ease,
                background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.anchor-btn svg {
    width: 0.95rem;
    height: 0.95rem;
    pointer-events: none;
}

/* Mostra il bottone solo al hover del titolo */
.category-name:hover .anchor-btn,
.anchor-btn:focus-visible {
    opacity: 1;
    border-color: var(--border, #e5e5e5);
    color: var(--rosa, #d53f8c);
}

.anchor-btn:hover {
    background: rgba(213, 63, 140, 0.08);
    border-color: var(--rosa, #d53f8c);
}

/* Stato "copiato" */
.anchor-btn--copied {
    opacity: 1 !important;
    background: rgba(213, 63, 140, 0.12);
    border-color: var(--rosa, #d53f8c);
    color: var(--rosa, #d53f8c);
}

.anchor-btn--copied svg {
    /* Sostituisce visivamente l'icona con un check tramite clip */
    stroke: var(--rosa, #d53f8c);
}

.anchor-btn {
    position: relative; /* necessario per il tooltip */
}

.anchor-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.anchor-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-primary);
}

.anchor-tooltip--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}


/* ── Blog search toggle ── */
.blog-search-toggle {
       display: flex;
       justify-content: flex-end;
       margin-top: 0;
       padding-right: 0;
   }

.blog-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    user-select: none;
}

.blog-toggle-track {
    position: relative;
    width: 28px;
    height: 16px;
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background 0.2s;
    flex-shrink: 0;
}

.blog-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s var(--ease-spring);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#blogSearchCheck:checked + .blog-toggle-track {
    background: var(--rosa);
}

#blogSearchCheck:checked + .blog-toggle-track .blog-toggle-thumb {
    transform: translateX(12px);
}

#blogSearchCheck {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.blog-toggle-text {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
    transition: color 0.2s;
}

.blog-toggle-label:hover .blog-toggle-text {
    color: var(--rosa);
}

/* Search sub-row: tema a sinistra, blog toggle a destra */
.search-sub-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0 0.25rem;
    transform: translateY(-4px);
}
 
/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 3.5rem;
    left: 1.5rem;
    z-index: 45;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.3s var(--ease-out);
    color: var(--text-tertiary);
}
 
.theme-toggle:hover {
    border-color: var(--rosa);
    color: var(--rosa);
    background: var(--rosa-lighter);
    transform: scale(1.08);
}
 
.theme-toggle svg {
    width: 15px;
    height: 15px;
    transition: opacity 0.2s, transform 0.3s var(--ease-spring);
}
 
/* Light mode: mostra luna, nascondi sole */
.theme-icon-sun { display: none; }
.theme-icon-moon { display: block; }
 
/* Dark mode: mostra sole, nascondi luna */
html[data-theme="dark"] .theme-icon-sun { display: block; }
html[data-theme="dark"] .theme-icon-moon { display: none; }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {

    .theme-toggle { top: 8rem; left: 1rem; width: 32px; height: 32px; }
    .hero-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }

    .alternatives-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar-inner {
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
    }

    .filter-bar-search {
        max-width: 100%;
        width: 100%;
        order: -1;
    }

    .filter-chips-scroll { order: 1; }
    .filter-clear-all { order: 2; }

    .alt-pros-cons {
        gap: 0.25rem 1rem;
    }

    .categories-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .proto-sub-section {
        padding: 0 1rem 1rem;
    }

    .protocol-header-card {
        padding: 1.25rem 1rem;
    }
	
	.changelog-badge {
        bottom: 1rem;
        left: 1rem;
        padding: 0.45rem 0.65rem;
    }

    .changelog-badge-label { display: none; }

    .community-badge-label { display: none; }

    .community-badge {
    bottom: 2.8rem;
    left: 1rem;
    padding: 0.45rem 0.65rem;
	}

    .changelog-panel {
        left: 1rem;
        right: 1rem;
        bottom: 3.5rem;
        width: auto;
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    #hero { padding: 1.5rem 1rem; }
    .logo-img { width: 64px; height: 64px; }
    .hero-subtitle { font-size: 0.92rem; }

    .search-box { padding: 0.6rem 1rem; }
    #searchInput { font-size: 0.95rem; }

    .hero-chips { gap: 0.35rem; }
    .hero-chip { padding: 0.3rem 0.7rem; font-size: 0.75rem; }

    .alt-card { padding: 1rem; }
	
	.alternatives-grid {
    grid-template-columns: 1fr;
	}	
}

/* ─── Animations for cards ─── */
.alt-card {
    animation: cardIn 0.4s var(--ease-out) both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger delay via JS data-index attribute */
.alt-card[data-index="0"] { animation-delay: 0ms; }
.alt-card[data-index="1"] { animation-delay: 40ms; }
.alt-card[data-index="2"] { animation-delay: 80ms; }
.alt-card[data-index="3"] { animation-delay: 120ms; }
.alt-card[data-index="4"] { animation-delay: 160ms; }
.alt-card[data-index="5"] { animation-delay: 200ms; }

/* Scrollbar styling */
.search-suggestions::-webkit-scrollbar { width: 6px; }
.search-suggestions::-webkit-scrollbar-track { background: transparent; }
.search-suggestions::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (prefers-color-scheme: dark) {
    :root {
        --rosa: #f06292;
        --rosa-light: #2a1520;
        --rosa-lighter: #1e1218;
        --rosa-dark: #f48fb1;
        --rosa-glow: rgba(240, 98, 146, 0.12);

        --text-primary: #e8e6f0;
        --text-secondary: #a8a6b8;
        --text-tertiary: #78768a;
        --text-on-rosa: #fff;

        --bg: #121218;
        --bg-warm: #14141c;
        --bg-card: #1a1a24;
        --bg-hover: #22222e;
        --bg-filter: #1e1e28;

        --border: #2a2a38;
        --border-light: #222230;
        --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
        --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
        --shadow-card-hover: 0 4px 20px rgba(240, 98, 146, 0.1), 0 8px 24px rgba(0, 0, 0, 0.25);
    }

    body { color-scheme: dark; }

    .top-alert { background: #c2185b; }

    .search-box { background: var(--bg-card); }

    .alt-card { background: var(--bg-card); border-color: var(--border); }

    .filter-bar { background: var(--bg); }

    .meta-badge { background: var(--bg-filter); color: var(--text-secondary); }
    .meta-badge.emphasis { background: var(--rosa-light); color: var(--rosa-dark); }
    .meta-badge.green { background: #1a2e1a; color: #81c784; }

    .payment-badge { background: var(--bg-filter); color: var(--text-secondary); }
    .payment-badge.free { background: #1a2a1a; color: #81c784; }

    .platform-tag { background: var(--bg-filter); color: var(--text-secondary); }

    .filter-chip { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }
    .filter-chip.active { background: var(--rosa); color: white; border-color: var(--rosa); }

    .hero-chip { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }

    .category-description a { color: var(--rosa); }

    .replaces-tag { background: var(--bg-filter); color: var(--text-secondary); }

    .download-link { color: var(--text-secondary); }
    .download-link:hover { color: var(--rosa); }

    .protocol-header-card { background: var(--bg-filter); border-color: var(--border); }

    .alt-location-badge.eu { background: #1a2040; color: #90caf9; }

    .footer-inner { border-top-color: var(--border); }

    .eco-sidebar { background: var(--bg-card); border-color: var(--border); }
    .eco-inline { background: var(--bg-card); border-color: var(--border); }
    .eco-inline-card { background: var(--bg-filter); border-color: var(--border); }

    .community-panel, .changelog-panel { background: var(--bg-card); border-color: var(--border); }
    .cat-drawer { background: var(--bg-card); }

    .back-top { background: var(--bg-card); border-color: var(--border); }

    .no-results { color: var(--text-secondary); }

    .active-filter-tag { background: var(--rosa-light); color: var(--rosa); }

    img.alt-logo { filter: brightness(0.9); }
	
	#footer { background: #1a1a2e; }
	
	.footer-text a:hover {
		color: var(--rosa);
	}
	
	.footer-links a:hover {
		color: var(--rosa);
	}

    .eco-sidebar-items {
        background: rgba(26, 26, 36, 0.92);
        border-color: var(--border);
    }

    .eco-sidebar-item:hover { background: var(--bg-hover); }

    .proto-logo-wrap { background: rgba(30, 30, 40, 0.8); }

    .eco-inline-card { background: var(--bg-card); }
}

html[data-theme="dark"] {
    --rosa: #f06292;
    --rosa-light: #2a1520;
    --rosa-lighter: #1e1218;
    --rosa-dark: #f48fb1;
    --rosa-glow: rgba(240, 98, 146, 0.12);
 
    --text-primary: #e8e6f0;
    --text-secondary: #a8a6b8;
    --text-tertiary: #78768a;
    --text-on-rosa: #fff;
 
    --bg: #121218;
    --bg-warm: #14141c;
    --bg-card: #1a1a24;
    --bg-hover: #22222e;
    --bg-filter: #1e1e28;
 
    --border: #2a2a38;
    --border-light: #222230;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-card-hover: 0 4px 20px rgba(240, 98, 146, 0.1), 0 8px 24px rgba(0, 0, 0, 0.25);
 
    color-scheme: dark;
}
 
html[data-theme="dark"] .top-alert { background: #c2185b; }
 
html[data-theme="dark"] .search-box { background: var(--bg-card); }
 
html[data-theme="dark"] .alt-card { background: var(--bg-card); border-color: var(--border); }
 
html[data-theme="dark"] .filter-bar {
    background: rgba(18, 18, 24, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
 
html[data-theme="dark"] .meta-badge { background: var(--bg-filter); color: var(--text-secondary); }
html[data-theme="dark"] .meta-badge.emphasis { background: var(--rosa-light); color: var(--rosa-dark); }
html[data-theme="dark"] .meta-badge.green { background: #1a2e1a; color: #81c784; }
 
html[data-theme="dark"] .payment-badge { background: var(--bg-filter); color: var(--text-secondary); }
html[data-theme="dark"] .payment-badge.free { background: #1a2a1a; color: #81c784; }
html[data-theme="dark"] .payment-badge.euro { background: #1a2040; color: #90caf9; }
html[data-theme="dark"] .payment-badge.bitcoin { background: #2a2210; color: #ffc107; }
html[data-theme="dark"] .payment-badge.monero { background: #2a1a10; color: #ff9800; }
 
html[data-theme="dark"] .platform-tag { background: var(--bg-filter); color: var(--text-secondary); }
 
html[data-theme="dark"] .filter-chip { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }
html[data-theme="dark"] .filter-chip.active { background: var(--rosa); color: white; border-color: var(--rosa); }
 
html[data-theme="dark"] .hero-chip { background: var(--bg-card); border-color: var(--border); color: var(--text-secondary); }
 
html[data-theme="dark"] .category-description a { color: var(--rosa); }
 
html[data-theme="dark"] .replaces-tag { background: var(--bg-filter); color: var(--text-secondary); }
 
html[data-theme="dark"] .download-link { color: var(--text-secondary); }
html[data-theme="dark"] .download-link:hover { color: var(--rosa); }
 
html[data-theme="dark"] .protocol-header-card {
    background: linear-gradient(135deg, var(--bg-filter), var(--bg-warm));
    border-color: var(--border);
}
html[data-theme="dark"] .proto-logo-wrap { background: rgba(30, 30, 40, 0.8); }
 
html[data-theme="dark"] .alt-location-badge.eu { background: #1a2040; color: #90caf9; }
 
html[data-theme="dark"] #footer { background: #0e0e14; }
 
html[data-theme="dark"] .eco-sidebar-items {
    background: rgba(26, 26, 36, 0.92);
    border-color: var(--border);
}
html[data-theme="dark"] .eco-sidebar-item:hover { background: var(--bg-hover); }
html[data-theme="dark"] .eco-inline { background: var(--bg-card); border-color: var(--border); }
html[data-theme="dark"] .eco-inline-card { background: var(--bg-filter); border-color: var(--border); }
 
html[data-theme="dark"] .community-panel,
html[data-theme="dark"] .changelog-panel { background: var(--bg-card); border-color: var(--border); }
html[data-theme="dark"] .cat-drawer { background: var(--bg-card); }
 
html[data-theme="dark"] .back-top { background: var(--bg-card); }
 
html[data-theme="dark"] .no-results { color: var(--text-secondary); }
 
html[data-theme="dark"] .active-filter-tag { background: var(--rosa-light); color: var(--rosa); }
 
html[data-theme="dark"] img.alt-logo { filter: brightness(0.9); }
 
html[data-theme="dark"] .search-suggestions { background: var(--bg-card); border-color: var(--border); }
html[data-theme="dark"] .suggestion-item:hover,
html[data-theme="dark"] .suggestion-item.active { background: var(--bg-hover); }
 
html[data-theme="dark"] .blog-toggle-thumb { background: var(--bg-card); }
 
html[data-theme="dark"] .theme-toggle {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-tertiary);
}