/* =========================================================================
   ASCOLTAMI • TI PARLO CON I MIEI VERSETTI — CSS PURO, RESPONSIVO E SENZA DUPLICATI
   ========================================================================= */
:root {
    --bg-principal: #f5f6fa;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --accent: #e74c3c;
    --accent-muted: #fadbd8;
    --border-color: #dcdde1;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --highlight: #f1c40f;
    --verse-font-base: 22px;
    --verse-size: clamp(1rem, calc(var(--verse-font-base) * 0.85 + 0.5vw), calc(var(--verse-font-base) * 1.15));
    --hover-item: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    --bg-principal: #121212;
    --bg-card: #1e1e1e;
    --text-main: #f5f6fa;
    --text-muted: #a0a0a0;
    --accent: #ff6b6b;
    --accent-muted: #4a1515;
    --border-color: #333333;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --hover-item: rgba(255, 255, 255, 0.04);
}

[data-theme="candela"] {
    --bg-principal: #1c1611;
    --bg-card: #261e17;
    --text-main: #f3e5d0;
    --text-muted: #b8a389;
    --accent: #e69d45;
    --accent-muted: #422e18;
    --border-color: #3d3024;
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    --hover-item: rgba(243, 229, 208, 0.05);
}

[data-theme="pergamena"] {
    --bg-principal: #f7f3eb;
    --bg-card: #fffdf9;
    --text-main: #2a241f;
    --text-muted: #766c61;
    --accent: #b83b2b;
    --accent-muted: #f6e2de;
    --border-color: #e6dfd3;
    --shadow: 0 6px 22px rgba(42, 36, 31, 0.06);
    --highlight: #f5d04c;
    --hover-item: rgba(184, 59, 43, 0.04);
}
[data-theme="pergamena"] #centralVerseCard {
    background: linear-gradient(180deg, var(--bg-card) 0%, color-mix(in srgb, var(--bg-principal) 45%, var(--bg-card)) 100%);
    border-top: 3px solid var(--accent);
}
[data-theme="gioia"] {
    --bg-principal: #fbf8f1;
    --bg-card: #ffffff;
    --text-main: #2d2a26;
    --text-muted: #7c7469;
    --accent: #d96b43;
    --accent-muted: #fce8df;
    --border-color: #eee6d8;
    --shadow: 0 12px 32px rgba(180, 145, 105, 0.09);
    --highlight: #ffe082;
    --hover-item: rgba(217, 107, 67, 0.05);
}

[data-theme="gioia"] .card {
    border: 1px solid rgba(238, 230, 216, 0.7);
    border-radius: 20px;
}

[data-theme="gioia"] .action-btn {
    background-color: #fdf5ee;
    border: 1px solid #f4dfd1;
    color: #5c4d3c;
    border-radius: 14px;
}

[data-theme="gioia"] .action-btn:hover,
[data-theme="gioia"] .action-btn.active {
    background-color: #fce8df;
    border-color: var(--accent);
    color: var(--accent);
}

[data-theme="gioia"] .nav-ancoraggi-fissa,
[data-theme="gioia"] .miniplayer-fluttuante-box {
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 28px rgba(180, 145, 105, 0.14);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nascosto { display: none !important; }
body {
    background-color: var(--bg-principal);
    color: var(--text-main);
    padding: clamp(12px, 3vw, 28px) clamp(10px, 2vw, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2.5vw, 20px);
    position: relative;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: clamp(16px, 4vw, 26px);
    box-shadow: var(--shadow);
    width: 100%;
    scroll-margin-top: calc(82px + env(safe-area-inset-top));
}
.card:not(#centralVerseCard) {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

.card-accento { border-left: 4px solid var(--accent); }

/* === INTESTAZIONE INTEGRATA NELLA CARD (LEGGERA E SENZA CERCHIETTI) === */
.card-top-header {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: clamp(8px, 2vw, 14px);
    padding-bottom: clamp(8px, 2vw, 14px);
    margin-bottom: clamp(12px, 2.8vw, 22px);
    border-bottom: 1px solid var(--border-color);
}

.card-top-title-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.card-top-title-group h1 {
    font-family: Georgia, serif;
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.5px;
    line-height: 1.15;
}

.card-top-sub {
    font-size: clamp(0.72rem, 1.85vw, 0.82rem);
    font-style: italic;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.card-top-actions {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1.2vw, 8px);
    flex-shrink: 0;
}

.btn-icona-nuda {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}

.btn-icona-nuda svg {
    width: clamp(19px, 4.5vw, 22px);
    height: clamp(19px, 4.5vw, 22px);
}

.btn-icona-nuda:hover {
    color: var(--accent);
    background-color: var(--hover-item);
}

.btn-icona-nuda:active {
    transform: scale(0.92);
}

/* === DISPLAY VERSETTO PRINCIPALE === */
.verse-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(14px, 2.5vw, 18px);
    width: 100%;
}

.verse-mode-title {
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 1.5px;
}

.verse-display-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-sfoglia-versetto {
    background: none;
    border: none;
    font-size: clamp(1.6rem, 5vw, 2.15rem);
    color: var(--accent);
    cursor: pointer;
    padding: 0 clamp(4px, 1.5vw, 10px);
    font-weight: 800;
    user-select: none;
    line-height: 1;
    min-height: clamp(40px, 10vw, 48px);
    min-width: clamp(36px, 9vw, 46px);
}

.verse-text {
    font-size: var(--verse-size);
    line-height: 1.6;
    font-weight: 400;
    word-wrap: break-word;
    flex: 1;
    text-align: center;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    touch-action: pan-y;
    transition: opacity 0.3s ease-in-out;
}

.verse-text.font-classico { font-family: Georgia, serif; }
.verse-text b, .verse-text strong { font-weight: 800; }

.verse-ref-riga {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: clamp(6px, 1.8vw, 10px);
    max-width: 100%;
}
.verse-ref-riga .btn-cambia-scelta {
    align-self: center;
    font-size: clamp(0.74rem, 1.9vw, 0.82rem);
    font-weight: 700;
    color: var(--accent);
}
.verse-reference {
    font-size: clamp(0.88rem, 2.5vw, 1.15rem);
    color: var(--text-muted);
    font-style: italic;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.3s ease-in-out;
}


.amen-text { font-size: clamp(1.05rem, 3vw, 1.3rem); font-weight: 800; transition: opacity 0.3s ease-in-out; }
.verse-quick-actions {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 4vw, 24px);
    margin: -4px 0;
}

.btn-micro-azione {
    width: 34px;
    height: 34px;
    opacity: 0.72;
}
.btn-micro-azione:hover,
.btn-micro-azione.active {
    opacity: 1;
    color: var(--accent);
}
.btn-micro-azione svg {
    width: 18px;
    height: 18px;
}
.btn-micro-azione svg .heart-path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}
.btn-micro-azione.active svg .heart-path {
    fill: var(--accent);
    stroke: var(--accent);
}

.sfumato-invisibile { opacity: 0 !important; }

.banner-riga-unica {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(4px, 1.2vw, 8px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
    box-shadow: var(--shadow);
    touch-action: pan-y;
    user-select: none;
}

.banner-nav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    min-width: 28px;
    min-height: 30px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.banner-nav-btn:hover { color: var(--accent); }

.banner-testo-singolo {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 10px);
    cursor: pointer;
    overflow: hidden;
    transition: opacity 0.24s ease;
}

.banner-pillola {
    flex-shrink: 0;
    background-color: var(--accent-muted);
    color: var(--accent);
    font-size: clamp(0.66rem, 1.7vw, 0.74rem);
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.banner-messaggio {
    flex: 1;
    min-width: 0;
    font-size: clamp(0.76rem, 2vw, 0.85rem);
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-card-compatta {
    width: 100%;
    max-width: min(92vw, 460px);
    margin: clamp(8px, 2vw, 14px) auto 0 auto;
    padding: clamp(6px, 1.5vw, 9px) clamp(10px, 2.2vw, 14px);
    background-color: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: clamp(10px, 2.5vw, 14px);
    cursor: pointer;
    text-align: left;
    opacity: 0.9;
    transition: opacity 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.qr-card-compatta:hover {
    opacity: 1;
    border-color: var(--accent);
    background-color: var(--bg-principal);
}

.qr-canvas-container {
    flex: 0 0 auto;
    padding: 3px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
[data-theme="dark"] .qr-canvas-container { background: #f5f6fa; border-color: #555555; }
[data-theme="candela"] .qr-canvas-container { background: #f3e5d0; border-color: #5c4936; }

.qr-img-principale { display: block; width: clamp(62px, 16vw, 70px); height: auto; aspect-ratio: 1 / 1; }


.qr-info-compatta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.qr-titolo-compatto {
    font-size: clamp(0.75rem, 2vw, 0.84rem);
    font-weight: 800;
    color: var(--accent);
    line-height: 1.25;
}
.qr-caption {
    font-size: clamp(0.7rem, 1.85vw, 0.78rem);
    color: var(--text-muted);
    line-height: 1.35;
    cursor: pointer;
}
.qr-caption strong { color: var(--accent); text-decoration: underline; }
.qr-link-copertina-ai {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-color);
    font-size: clamp(0.7rem, 1.85vw, 0.78rem);
    font-weight: 700;
    color: var(--accent);
    line-height: 1.3;
    cursor: pointer;
}
.qr-link-copertina-ai:hover { text-decoration: underline; }
.qr-info-compatta .check-grassetto-row { margin-top: 4px; }


.pill-luce-custodita {
    width: 100%;
    max-width: min(92vw, 460px);
    margin: clamp(6px, 1.5vw, 10px) auto 0 auto;
    padding: clamp(8px, 2vw, 11px) clamp(12px, 2.8vw, 16px);
    background-color: var(--accent-muted);
    color: var(--text-main);
    border: 1px solid var(--accent);
    border-radius: 12px;
    font-size: clamp(0.78rem, 2vw, 0.86rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.14s ease, opacity 0.14s ease;
}
.pill-luce-custodita:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}
.pill-luce-azione {
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}



/* Timer & Ritmo */
.timer-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: clamp(12px, 2.6vh, 20px);
}

.timer-bar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(6px, 2vw, 12px);
    width: 100%;
}
.timer-bar-row .pace-options { flex-shrink: 0; flex-wrap: nowrap; gap: clamp(4px, 1.2vw, 8px); }
.timer-bar-row button.pace-link {
    background: transparent;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: clamp(0.76rem, 2.1vw, 0.88rem);
    width: clamp(32px, 8.5vw, 38px);
    height: clamp(32px, 8.5vw, 38px);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}
.timer-bar-row button.pace-link svg { width: clamp(14px, 3.8vw, 18px); height: clamp(14px, 3.8vw, 18px); }
.timer-bar-row button.pace-link:hover {
    color: var(--accent);
    background-color: var(--hover-item);
}
.timer-bar-row button.pace-link:active {
    transform: scale(0.92);
}
.timer-track {
    flex: 1;
    min-width: 15%;
    height: clamp(6px, 1.3vh, 9px);
    background-color: var(--border-color);
    border-radius: 999px;
    overflow: hidden;
}

.timer-bar { height: 100%; width: 0%; background-color: var(--accent); border-radius: 999px; will-change: width; }
.timer-label {
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(0.72rem, 2.2vw, 0.84rem);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    line-height: 1.15;
    margin-bottom: -2px;
}

.timer-label.cliccabile { cursor: pointer; }
.salta-voce-link { text-decoration: underline; opacity: 0.85; font-weight: 600; }

.pace-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2px, 0.5vh, 4px);
    margin-top: calc(clamp(12px, 2.5vw, 18px) * -1);
    font-size: clamp(0.8rem, 2.1vw, 0.88rem);
    font-weight: 700;
    color: var(--text-muted);
    width: 100%;
}

.pace-options { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: clamp(4px, 1.2vw, 6px); }
.pace-link { cursor: pointer; color: var(--text-muted); padding: clamp(3px, 0.8vw, 4px) clamp(5px, 1.2vw, 6px); }
.pace-link.active { color: var(--accent); text-decoration: underline; }
.check-grassetto-row {
    font-size: clamp(0.76rem, 2vw, 0.84rem);
    opacity: 0.9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.check-grassetto-row label {
    cursor: pointer;
    user-select: none;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
}
.check-grassetto-row input {
    accent-color: var(--accent);
    margin-top: 2px;
    flex-shrink: 0;
}

.qr-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    cursor: pointer;
}

/* === PULSANTIERA PRINCIPALE === */
.action-bar-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(68px, 21%, 140px)), 1fr));
    width: 100%;
    margin-top: clamp(12px, 2.5vw, 16px);
    padding-top: clamp(12px, 2.5vw, 16px);
    border-top: 1px solid var(--border-color);
    gap: clamp(4px, 1.5vw, 10px);
}

.action-btn {
    width: 100%;
    min-width: 0;
    min-height: clamp(46px, 11vw, 54px);
    padding: clamp(6px, 1.5vw, 8px) clamp(2px, 1vw, 6px);
    border-radius: 10px;
    background: var(--bg-principal);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.8vw, 5px);
    color: var(--text-muted);
    font-size: clamp(0.62rem, 2.1vw, 0.78rem);
    font-weight: 700;
    touch-action: none;
    user-select: none;
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.action-btn > span {
    transition: opacity 0.16s ease, transform 0.16s ease;
}
.action-btn.sfumato-invisibile > span {
    opacity: 0;
    transform: translateY(-4px);
}


.action-btn:hover { border-color: var(--border-color); color: var(--accent); }
.action-btn:active { transform: scale(0.96); }
.action-btn svg { width: clamp(18px, 4vw, 22px); height: clamp(18px, 4vw, 22px); fill: currentColor; flex-shrink: 0; }
.action-btn .drawer-emoji-icon { margin-right: 0; font-size: clamp(1.1rem, 3.5vw, 1.35rem); }
.action-btn svg.icona-outline { fill: none; }
.action-btn svg .heart-path { fill: none; stroke: currentColor; stroke-width: 2; }
.action-btn.active, #favoriteBtn.active { color: var(--accent); }
.action-btn.active svg .heart-path, #favoriteBtn.active svg .heart-path { fill: var(--accent); stroke: var(--accent); }

/* Pannelli Interni (Sveglia & Incolla AI) */
.pannello-interno-card { display: none; flex-direction: column; gap: 12px; margin-top: 10px; border: none; padding: 0; box-shadow: none; }
.pannello-interno-card.aperto { display: flex; }
.titolo-pannello-interno { font-size: 0.85rem; color: var(--text-main); font-weight: 800; text-align: center; text-transform: uppercase; letter-spacing: 0.5px; }
.sottotitolo-pannello-interno { font-size: 0.76rem; color: var(--text-muted); text-align: center; margin-top: -6px; }
.lista-orari-sveglia { display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; }
.riga-orario-sveglia {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(6px, 1.8vw, 10px);
    font-size: clamp(0.78rem, 2.1vw, 0.86rem);
    font-weight: 600;
}
.input-orario-sveglia {
    padding: clamp(5px, 1.4vw, 7px) clamp(8px, 2vw, 10px);
    font-size: clamp(0.82rem, 2.2vw, 0.9rem);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-principal);
    color: var(--text-main);
    min-height: 40px;
    max-width: 100%;
}
.footer-pannello-sveglia { display: flex; gap: 10px; width: 100%; justify-content: center; align-items: center; border-top: 1px dashed var(--border-color); padding-top: 10px; font-size: 0.85rem; }
.btn-stato-sveglia { padding: 6px 16px; font-size: 0.8rem; font-weight: 800; background-color: var(--border-color); color: var(--text-main); border: none; border-radius: 8px; cursor: pointer; min-height: 40px; }
.btn-stato-sveglia.attivo { background-color: #27ae60; color: #ffffff; }
.btn-conferma-verde { background-color: #27ae60; color: #ffffff; border-color: #27ae60; }

.tabs-barra-antologia {
    display: flex;
    flex-wrap: wrap;
    background: var(--bg-principal);
    padding: clamp(3px, 1vw, 5px);
    border-radius: 12px;
    gap: clamp(3px, 1vw, 5px);
    margin-bottom: clamp(12px, 2.8vw, 18px);
    width: 100%;
}

.tab-btn-antologia {
    flex: 1 1 min(100%, 88px);
    min-width: 0;
    min-height: clamp(38px, 9vw, 44px);
    padding: clamp(5px, 1.4vw, 8px) clamp(3px, 1vw, 6px);
    border: none;
    border-radius: 8px;
    font-size: clamp(0.68rem, 2.2vw, 0.84rem);
    font-weight: 800;
    cursor: pointer;
    background: transparent;
    color: var(--text-main);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tab-btn-antologia.attivo { background: var(--accent); color: #ffffff; }

.tab-badge { font-size: 0.72rem; padding: 2px 6px; background: var(--border-color); color: var(--text-main); border-radius: 10px; margin-left: 3px; font-weight: 900; }
.tab-btn-antologia.attivo .tab-badge { background: rgba(255, 255, 255, 0.25); color: #ffffff; }

.list-header-block { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.list-header-title { font-size: clamp(0.75rem, 2vw, 0.85rem); font-weight: 800; color: var(--text-muted); text-transform: uppercase; display: inline-flex; align-items: center; gap: clamp(4px, 1vw, 6px); }
.badge-filtro-attivo { display: none; background: var(--highlight); color: #1e272e; font-size: clamp(0.68rem, 1.8vw, 0.74rem); font-weight: 900; padding: 2px clamp(5px, 1.4vw, 7px); border-radius: 10px; }
.badge-filtro-attivo.visibile { display: inline-block; }
.list-global-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.header-action-btn {
    background: var(--bg-principal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: clamp(5px, 1.4vw, 7px) clamp(8px, 2vw, 11px);
    min-height: clamp(34px, 8vw, 38px);
    cursor: pointer;
    font-size: clamp(0.72rem, 1.9vw, 0.78rem);
    font-weight: 700;
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.header-action-btn:hover { border-color: var(--accent); color: var(--accent); }
.header-action-btn[disabled], .header-action-btn.disattivato-forzato { opacity: 0.45; cursor: default; pointer-events: none; }
.search-box-wrapper {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    width: 100%;
}
.search-input-container {
    position: relative;
    flex: 1 1 180px;
    min-width: 0;
    display: flex;
    align-items: center;
}
.search-input {
    width: 100%;
    padding: clamp(8px, 2vw, 11px) clamp(34px, 8vw, 40px) clamp(8px, 2vw, 11px) clamp(10px, 2.5vw, 14px);
    font-size: clamp(0.95rem, 2.4vw, 1rem);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-principal);
    color: var(--text-main);
    outline: none;
    min-height: 44px;
}
.search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}
.btn-pulisci-ricerca {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    z-index: 2;
    min-height: 36px;
}
.btn-pulisci-ricerca:hover { color: var(--accent); }

.search-input:focus { border-color: var(--accent); }

.btn-cerca-scrittura {
    padding: 10px 12px;
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid #27ae60;
    background: var(--bg-principal);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
    color: #27ae60;
    white-space: nowrap;
    flex-shrink: 0;
}

.scrollable-list-content {
    max-height: clamp(280px, 42vh, 420px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
    width: 100%;
    text-align: left;
}


.list-item {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vw, 9px);
    font-size: clamp(0.86rem, 2.2vw, 0.96rem);
    line-height: 1.52;
    padding: clamp(10px, 2.6vw, 15px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    contain: layout style;
}

.list-item:hover { background-color: var(--hover-item); }
.item-meta { font-size: clamp(0.72rem, 1.8vw, 0.8rem); color: var(--text-muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.item-text { color: var(--text-main); }
.item-reference { font-size: clamp(0.8rem, 2vw, 0.88rem); color: var(--accent); font-weight: 700; font-style: italic; }
.item-link-ai { font-size: clamp(0.76rem, 1.9vw, 0.84rem); color: var(--accent); text-decoration: none; font-weight: 600; }
.item-link-ai:hover { text-decoration: underline; }
.item-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(95px, 42%, 140px)), 1fr));
    gap: clamp(5px, 1.4vw, 8px);
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}
.item-btn {
    padding: clamp(6px, 1.6vw, 9px) clamp(8px, 2vw, 12px);
    min-height: 40px;
    font-size: clamp(0.75rem, 2vw, 0.84rem);
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-principal);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.item-btn:hover { border-color: var(--accent); color: var(--accent); }
.item-btn.attivo { background-color: var(--accent); color: #ffffff; border-color: var(--accent); }
.item-btn.btn-cuore-lista { gap: 5px; }
.item-btn.btn-cuore-lista svg { width: 15px; height: 15px; flex-shrink: 0; }
.item-btn.btn-cuore-lista svg .heart-path { fill: none; stroke: currentColor; stroke-width: 2; }
.item-btn.btn-cuore-lista.active {
    color: var(--accent);
    border-color: var(--accent);
    background-color: var(--accent-muted);
}
.item-btn.btn-cuore-lista.active svg .heart-path {
    fill: var(--accent);
    stroke: var(--accent);
}

.disabilitato-soft { opacity: 0.4; pointer-events: none; }

.btn-pieno-casa { width: 100%; }

.textarea-nota-live {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-principal);
    color: var(--text-main);
    font-size: 0.88rem;
    line-height: 1.45;
    resize: vertical;
    outline: none;
}
.stato-salvataggio-nota { color: #27ae60; font-style: italic; font-weight: 700; font-size: clamp(0.7rem, 1.8vw, 0.78rem); }
.stato-salvataggio-nota.in-scrittura { color: var(--accent); }
.testo-diario-serif { font-family: Georgia, serif; font-size: clamp(0.96rem, 2.4vw, 1.12rem); line-height: 1.55; font-style: italic; }
.box-nota-diario { margin-top: calc(0.4rem + 0.5vw); border-top: 1px dashed var(--border-color); padding-top: clamp(8px, 2vw, 12px); }
.contatore-caratteri-nota { font-size: clamp(0.68rem, 1.7vw, 0.76rem); color: var(--text-muted); text-align: right; margin-top: 4px; font-style: italic; }
.contatore-caratteri-nota span { font-weight: 700; }

.highlight-match { background-color: var(--highlight); color: #000000; border-radius: 2px; padding: 0 2px; font-weight: 800; }
.empty-notify { font-size: 0.9rem; color: var(--text-muted); text-align: center; padding: 20px 10px; font-style: italic; }

/* === SEZIONI DI ASCOLTAMI (BIGLIETTINO, IMPARATE DA ME, RISORSE, MURO, OFFERTA) === */
.titolo-sezione-casa { margin: 0 0 6px 0; font-size: clamp(1rem, 2.5vw, 1.15rem); color: var(--text-main); }
.sottotitolo-sezione-casa { margin: 0 0 12px 0; font-size: clamp(0.84rem, 2vw, 0.9rem); color: var(--text-muted); line-height: 1.5; }
.eyebrow-casa { display: block; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); margin-bottom: 6px; }

.campo-testo-casa {
    width: 100%;
    padding: clamp(8px, 2vw, 11px) clamp(10px, 2.4vw, 13px);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-principal);
    color: var(--text-main);
    font-size: clamp(0.95rem, 2.4vw, 1rem);
    resize: vertical;
    outline: none;
    margin-bottom: 10px;
}

.campo-testo-casa:focus { border-color: var(--accent); }

.riquadro-interno-casa { margin: clamp(10px, 2.2vw, 14px) 0; padding: clamp(11px, 2.8vw, 16px); border-radius: 10px; background: var(--bg-principal); border: 1px solid var(--border-color); }
.riquadro-interno-casa p { font-size: clamp(0.84rem, 2.1vw, 0.92rem); line-height: 1.5; margin-bottom: 8px; }
.box-domande-guida { background: var(--bg-card); border-left: 3px solid var(--accent); padding: clamp(9px, 2.2vw, 12px) clamp(10px, 2.5vw, 14px); border-radius: 6px; font-size: clamp(0.82rem, 2.1vw, 0.88rem); line-height: 1.55; margin-bottom: 12px; }
.selettore-ai-locale { padding: clamp(10px, 2.4vw, 14px); border-radius: 8px; background: var(--bg-card); border: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.riquadro-interno-casa p:last-child { margin-bottom: 0; color: var(--text-muted); }
.testo-bigliettino-estratto { font-family: Georgia, serif; font-size: clamp(0.98rem, 2.4vw, 1.12rem); font-weight: 700; line-height: 1.5; color: var(--text-main); margin-bottom: 4px; }
.rif-bigliettino-estratto { font-size: 0.82rem; font-weight: 800; color: var(--accent); margin-bottom: 12px; }
.box-ai-facoltativo { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 8px; }
.select-casa { width: 100%; padding: 9px 10px; min-height: 44px; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-principal); color: var(--text-main); font-size: 0.88rem; }
.btn-cambia-scelta { background: transparent; border: none; color: var(--text-muted); font-size: 0.78rem; text-decoration: underline; cursor: pointer; align-self: flex-end; padding: 4px; }
.btn-cambia-scelta:hover { color: var(--accent); }
.riga-bottoni-flex { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.riga-bottoni-flex > button,
.riga-bottoni-flex > select {
    flex: 1 1 min(100%, clamp(115px, 42%, 180px));
    min-width: 0;
}

.box-vocale-casa { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-color); display: flex; flex-direction: column; gap: 6px; }
.player-vocale-nativo { width: 100%; height: 36px; border-radius: 8px; }
.link-vocale-esterno { display: inline-block; font-size: 0.82rem; font-weight: 700; color: var(--accent); text-decoration: none; }


.btn-sostegno-primario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    text-align: center;
    text-decoration: none;
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
    padding: clamp(10px, 2.4vw, 13px) clamp(12px, 3vw, 16px);
    border: none;
    border-radius: 10px;
    font-size: clamp(0.85rem, 2.3vw, 0.96rem);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-sostegno-primario:hover { opacity: 0.92; }
.btn-outline-casa { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-top: 14px; }

.risorsa-link-card { display: block; text-decoration: none; padding: clamp(10px, 2.5vw, 14px) clamp(12px, 3vw, 16px); margin-bottom: 10px; border-radius: 10px; border: 1px solid var(--border-color); background: var(--bg-principal); transition: border-color 0.15s ease, transform 0.15s ease; }
.risorsa-titolo { color: var(--text-main); font-weight: 700; font-size: clamp(0.9rem, 2.3vw, 0.98rem); margin-bottom: 2px; }
.risorsa-sub { color: var(--text-muted); font-size: clamp(0.78rem, 2vw, 0.84rem); line-height: 1.35; }
.lista-muro-intenzioni { display: flex; flex-direction: column; gap: 8px; max-height: clamp(200px, 38vh, 260px); overflow-y: auto; }
.bigliettino-intenzione { background-color: var(--bg-principal); border-left: 3px solid var(--accent); border-radius: 6px; padding: clamp(9px, 2.2vw, 12px); font-size: clamp(0.82rem, 2.1vw, 0.88rem); color: var(--text-main); line-height: 1.45; }

.risorsa-link-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.risorsa-ultima { margin-bottom: 0; }
/* Muro Intenzioni, Guida Home & Footer */
.meta-intenzione { font-size: clamp(0.7rem, 1.8vw, 0.78rem); color: var(--text-muted); margin-bottom: 2px; font-style: italic; }
.testo-intenzione { color: var(--text-main); font-size: clamp(0.84rem, 2.1vw, 0.94rem); line-height: 1.45; }

.btn-sostieni-preghiera { background: transparent; border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-muted); font-size: 0.75rem; padding: 4px 8px; cursor: pointer; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.btn-sostieni-preghiera.attivo { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.pwa-box { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: clamp(12px, 3vw, 16px); box-shadow: var(--shadow); font-size: clamp(0.78rem, 2vw, 0.84rem); color: var(--text-muted); line-height: 1.5; }
.footer-legale { padding: 6px 0 calc(clamp(88px, 14vh, 105px) + env(safe-area-inset-bottom)) 0; text-align: center; font-size: clamp(0.72rem, 1.9vw, 0.78rem); color: var(--text-muted); line-height: 1.55; display: flex; flex-direction: column; gap: 8px; }
.pwa-box strong.titolo-pwa { color: var(--text-main); display: block; margin-bottom: 4px; }
.pwa-box kbd { background: var(--bg-principal); border: 1px solid var(--border-color); border-radius: 4px; padding: 1px 5px; font-size: 0.8rem; color: var(--text-main); }

/* === BARRA FISSA IN BASSO, DRAWER LATERALI & MINIPLAYER === */

.nav-ancoraggi-fissa {
    position: fixed;
    bottom: calc(clamp(6px, 1.5vw, 10px) + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(14px, 3vw, 18px);
    padding: clamp(4px, 1vw, 7px) clamp(4px, 1.2vw, 10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1px, 0.6vw, 6px);
    z-index: 9999;
    width: min(96vw, 650px);
}

.nav-link-ancora {
    flex: 1 1 0%;
    min-width: 0;
    min-height: clamp(42px, 10vw, 48px);
    padding: clamp(3px, 0.8vw, 5px) 1px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    font-size: clamp(0.6rem, 2.3vw, 0.84rem);
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    text-transform: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-link-ancora::first-line {
    font-size: clamp(1.05rem, 4.2vw, 1.45rem);
    line-height: 1.2;
}

.nav-link-ancora:hover,
.nav-link-ancora.attivo {
    color: var(--accent);
    font-weight: 800;
}


 
.drawer-strumenti-laterale {
    position: fixed;
    top: 0;
    right: 0;
    width: min(88vw, 310px);
    height: 100dvh;
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 18px rgba(0, 0, 0, 0.16);
    padding: calc(clamp(14px, 3vw, 18px) + env(safe-area-inset-top)) clamp(12px, 3vw, 15px) calc(24px + env(safe-area-inset-bottom)) clamp(12px, 3vw, 15px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vw, 8px);
    transform: translate3d(105%, 0, 0);
    visibility: hidden;
    will-change: transform;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
    z-index: 10001;
}
.drawer-strumenti-laterale.show { transform: translate3d(0, 0, 0); visibility: visible; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.drawer-header h3 { margin: 0; font-size: 1rem; color: var(--accent); font-weight: 800; }
.btn-chiudi-drawer { cursor: pointer; background: var(--border-color); color: var(--text-main); border: none; padding: 6px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 800; }

.drawer-emoji-icon { font-size: 1.2rem; width: 26px; text-align: center; display: inline-block; flex-shrink: 0; margin-right: 6px; }

.strumento-riga-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
    min-height: clamp(42px, 9vw, 46px);
    padding: clamp(8px, 2vw, 11px) clamp(10px, 2.5vw, 13px);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-principal);
    color: var(--text-main);
    cursor: pointer;
    font-size: clamp(0.8rem, 2.1vw, 0.86rem);
    font-weight: 600;
}
.strumento-riga-btn:hover { background-color: var(--hover-item); color: var(--accent); border-color: var(--accent); }
.btn-drawer-info { color: #2980b9; }
.btn-drawer-ok { color: #27ae60; }
.btn-drawer-danger { color: var(--accent); font-weight: 800; }

.drawer-sezione-avanzata {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.drawer-titolo-gruppo { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }

.sidebar-filtri-laterale {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 380px);
    height: 100dvh;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    box-shadow: 5px 0 18px rgba(0, 0, 0, 0.14);
    z-index: 10001;
    transform: translate3d(-105%, 0, 0);
    visibility: hidden;
    will-change: transform;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.28s;
    display: flex;
    flex-direction: column;
    padding: calc(clamp(14px, 3vw, 18px) + env(safe-area-inset-top)) clamp(14px, 3vw, 18px) calc(20px + env(safe-area-inset-bottom)) clamp(14px, 3vw, 18px);
}
.sidebar-filtri-laterale.show { transform: translate3d(0, 0, 0); visibility: visible; }

.grid-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, clamp(52px, 16vw, 72px)), 1fr));
    gap: clamp(4px, 1.2vw, 6px);
    max-height: 48dvh;
    overflow-y: auto;
    padding: clamp(6px, 1.5vw, 8px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}
.book-btn { background-color: var(--accent); color: #ffffff; border: 1px solid var(--accent); min-height: 40px; padding: 6px 4px; font-size: 0.78rem; font-weight: 700; border-radius: 6px; cursor: pointer; text-align: center; }
.book-btn:not(.active):not(.special-btn) { background-color: var(--bg-principal); color: var(--text-main); border-color: var(--border-color); }
.book-btn.special-btn { background-color: var(--border-color); color: var(--text-main); border-color: var(--border-color); }

/* Miniplayer Fluttuante */
.miniplayer-fluttuante-box {
    position: fixed;
    top: calc(clamp(6px, 1.8vw, 14px) + env(safe-area-inset-top));
    left: 50%;
    transform: translate3d(-50%, -140%, 0);
    width: min(96vw, 650px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(12px, 2.8vw, 20px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.14);
    padding: clamp(5px, 1.4vw, 8px) clamp(8px, 2.2vw, 16px);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, visibility 0.34s;
}



.miniplayer-fluttuante-box.visibile {
    transform: translate3d(-50%, 0, 0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.miniplayer-contenuto { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.miniplayer-testo-blocco { display: flex; flex-direction: column; text-align: left; min-width: 0; flex: 1; }
.miniplayer-testo { font-size: clamp(0.8rem, 2.2vw, 0.9rem); font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miniplayer-rif { font-size: clamp(0.68rem, 1.8vw, 0.74rem); color: var(--text-muted); font-style: italic; }
.miniplayer-azioni { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.miniplayer-azioni button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: clamp(34px, 8.5vw, 38px);
    height: clamp(34px, 8.5vw, 38px);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.16s ease, background-color 0.16s ease, transform 0.12s ease;
}
.miniplayer-azioni button:hover {
    color: var(--accent);
    background-color: var(--hover-item);
}
.miniplayer-azioni button:active {
    transform: scale(0.92);
}
.miniplayer-azioni button svg .heart-path { fill: none; stroke: currentColor; stroke-width: 2; }
.miniplayer-azioni button.active { color: var(--accent); }
.miniplayer-azioni button.active svg .heart-path { fill: var(--accent); stroke: var(--accent); }

/* === MODALI, CANTI, EDITOR GRAFICO & MODALITÀ SILENZIO === */
.welcome-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 2vw, 16px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s;
}
.welcome-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.welcome-modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: clamp(12px, 2.5vw, 16px);
    width: 100%;
    max-width: min(calc(100vw - clamp(16px, 4vw, 32px)), 560px);
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.modale-canti-card { max-width: min(96vw, 780px); }
.modale-anziani-card { max-width: min(96vw, 680px); }
.welcome-modal-header { position: relative; padding: clamp(12px, 2.5vw, 16px) clamp(34px, 7vw, 42px) clamp(10px, 2vw, 12px) clamp(14px, 3vw, 20px); border-bottom: 1px dashed var(--border-color); text-align: center; }
.welcome-modal-header h2 { color: var(--accent); font-size: clamp(1.05rem, 3.5vw, 1.65rem); font-weight: 900; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.welcome-modal-header p { font-size: clamp(0.78rem, 2vw, 0.86rem); color: var(--text-muted); font-style: italic; }

.btn-chiudi-modale-x {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text-muted);
    font-weight: 700;
    line-height: 1;
    min-width: 36px;
    min-height: 36px;
}

.welcome-modal-body { padding: clamp(12px, 3vw, 18px) clamp(14px, 3.5vw, 20px); overflow-y: auto; font-size: clamp(0.86rem, 2.2vw, 0.94rem); line-height: 1.55; color: var(--text-main); text-align: left; }
.welcome-modal-body h3 { color: var(--accent); font-size: 1rem; font-weight: 800; text-transform: uppercase; margin: 16px 0 8px 0; }
.welcome-modal-body h3:first-of-type { margin-top: 0; }
.welcome-modal-body ul { list-style: none; margin-bottom: 14px; }
.welcome-modal-body li { margin-bottom: 8px; padding-left: 14px; position: relative; }
.welcome-modal-body li::before { content: "•"; color: var(--accent); font-weight: bold; position: absolute; left: 0; }

.legal-box { background-color: var(--bg-principal); border-left: 4px solid var(--text-muted); padding: 12px; border-radius: 0 8px 8px 0; font-size: 0.8rem; color: var(--text-muted); margin-top: 14px; }
.legal-box ol { padding-left: 16px; margin-top: 6px; }
.legal-box li { padding-left: 0; margin-bottom: 6px; }
.legal-box li::before { content: none; }

.welcome-modal-footer { padding: clamp(10px, 2vw, 12px) clamp(14px, 3vw, 20px); border-top: 1px solid var(--border-color); display: flex; justify-content: center; background-color: var(--bg-card); }
.welcome-btn-close {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    padding: clamp(10px, 2.4vw, 13px) clamp(18px, 4vw, 24px);
    min-height: 44px;
    font-size: clamp(0.84rem, 2.2vw, 0.92rem);
    font-weight: 800;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    max-width: min(85vw, 260px);
    text-transform: uppercase;
}
.btn-chiudi-neutro { background-color: var(--border-color); color: var(--text-main); }

/* Libreria Canti 100% Fluida senza media query */
.griglia-canti-responsive { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: clamp(8px, 2vw, 12px); max-height: clamp(350px, 60vh, 460px); }
.colonna-elenco-canti { background: var(--bg-principal); border: 1px solid var(--border-color); border-radius: 10px; padding: 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; max-height: clamp(132px, 32vh, 350px); }
.colonna-testo-canto { padding: clamp(10px, 2.5vw, 14px); border-radius: 10px; border: 1px solid var(--border-color); border-left: 4px solid var(--accent); background: var(--bg-principal); min-height: clamp(200px, 34vh, 350px); max-height: clamp(240px, 42vh, 350px); display: flex; flex-direction: column; overflow: hidden; }
#testo-canto-corpo { white-space: pre-wrap; margin-top: 8px; flex: 1; }
#autore-canto-attivo { display: block; margin-bottom: 4px; }

/* Modalità Anziani & Offerta Libera */
.corpo-anziani { display: flex; flex-direction: column; gap: 16px; }
.box-testo-anziani { margin-top: 0; padding: 20px; text-align: center; }
.testo-grande-anziani { font-family: Georgia, serif; font-size: clamp(1.35rem, 4.5vw, 1.95rem); line-height: 1.55; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }
.rif-grande-anziani { font-size: clamp(1rem, 2.8vw, 1.2rem); font-weight: 800; color: var(--accent); }
.btn-grande-anziani { padding: 14px 18px; font-size: clamp(0.95rem, 2.5vw, 1.08rem); }
.pillola-meditazione { font-size: clamp(0.68rem, 1.8vw, 0.76rem); font-weight: 700; padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px); border-radius: 20px; border: 1px solid var(--border-color); background: var(--bg-principal); color: var(--text-muted); }
.pillola-meditazione.attivo { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.pillola-meditazione.fatto { background: rgba(39, 174, 96, 0.15); color: #27ae60; border-color: #27ae60; }

/* Modalità Silenzio Puro & Toast */
.invocazione-silenzio {
    font-size: clamp(0.76rem, 2vw, 0.88rem);
    font-style: italic;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    margin-bottom: clamp(8px, 2vh, 16px);
    opacity: 0.88;
}

body.modalita-silenzio #invocazioneSpiritoSilenzio {
    display: block !important;
}

body.modalita-silenzio #filtriSidebar,
body.modalita-silenzio #drawerStrumenti,
body.modalita-silenzio .nav-ancoraggi-fissa,
body.modalita-silenzio .banner-riga-unica,
body.modalita-silenzio .card:not(#centralVerseCard),
body.modalita-silenzio #centralVerseCard > *:not(.verse-container),
body.modalita-silenzio .verse-container > *:not(#invocazioneSpiritoSilenzio):not(.verse-display-row):not(#verseReference):not(#verseAmen),
body.modalita-silenzio #btnSfogliaIndietro,
body.modalita-silenzio #btnSfogliaAvanti,
body.modalita-silenzio .pwa-box,
body.modalita-silenzio .footer-legale,
body.modalita-silenzio #miniplayerFluttuante { display: none !important; }


body.modalita-silenzio .container { min-height: 90vh; justify-content: center; }
body.modalita-silenzio #centralVerseCard { border: none; box-shadow: none; background: transparent; }

#btnEsciSilenzio {
    display: none;
    position: fixed;
    bottom: calc(28px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 9999;
}
body.modalita-silenzio #btnEsciSilenzio { display: inline-flex; align-items: center; gap: 6px; }

#toastGratitudine {
    position: fixed;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--accent);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    width: min(calc(100vw - clamp(20px, 4vw, 40px)), 520px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    text-align: center;
}
#toastGratitudine.visibile { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* Canvas Editor Grafico 100% Responsive e Layout Compatto senza Scorrimento */
#editorGraficoModal .welcome-modal-card {
    max-width: min(calc(100vw - clamp(16px, 4vw, 32px)), 500px);
    max-height: 94dvh;
}
#editorGraficoModal .welcome-modal-header {
    padding: clamp(8px, 1.5vh, 12px) 36px clamp(6px, 1vh, 10px) 16px;
}
#editorGraficoModal .welcome-modal-body {
    padding: clamp(8px, 1.5vh, 12px) 16px;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.2vh, 10px);
}
#editorGraficoModal .riquadro-interno-casa {
    margin-top: 0;
    padding: clamp(6px, 1.2vh, 10px);
    text-align: center;
}
#editorGraficoModal .riquadro-interno-casa .sottotitolo-sezione-casa {
    margin: 4px 0 0 0;
    font-size: clamp(0.72rem, 1.8vw, 0.8rem);
}
#canvasEditorInterattivo {
    width: auto;
    max-width: 100%;
    max-height: clamp(180px, 33vh, 260px);
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    touch-action: none;
    cursor: grab;
}

#canvasEditorInterattivo:active { cursor: grabbing; }

#editorGraficoModal .riga-bottoni-flex:has(input[type="range"]) {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
    margin-top: 2px;
}
#editorGraficoModal .riga-bottoni-flex:has(input[type="range"]) label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 0;
    font-size: clamp(0.66rem, 1.6vw, 0.74rem);
}
#editorGraficoModal input[type="range"] {
    width: 100%;
    accent-color: var(--accent);
}
#editorGraficoModal .riga-bottoni-flex {
    margin-top: 2px;
}
#editorGraficoModal .welcome-modal-footer {
    padding: clamp(8px, 1.4vh, 12px) 16px;
}

/* Pulsanti e intestazioni Libreria Canti (sostituisce gli stili inline in JS) */
.canto-gruppo-titolo {
    font-size: clamp(0.7rem, 1.8vw, 0.75rem);
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    position: sticky;
    top: 0;
    background: var(--bg-principal);
    padding: clamp(8px, 1.5vh, 10px) 4px;
    margin: 0 0 8px 0;
    border-bottom: 1px solid var(--border-color);
    z-index: 5;
}
#elenco-titoli-canti .canto-gruppo-titolo { top: -6px; padding: 4px 2px; margin-bottom: 4px; border-bottom: none; }
#tuttiVersettiList .canto-gruppo-titolo { position: static; }
#tuttiVersettiList {
    width: calc(100% - 4px);
    margin: 0 auto clamp(10px, 2vh, 14px) auto;
    max-height: clamp(250px, 44vh, 390px);
    padding: 0 clamp(8px, 2vw, 12px) clamp(10px, 2vh, 14px) clamp(8px, 2vw, 12px);
    background: var(--bg-principal);
    border: 1px solid var(--border-color);
    border-radius: 0;
}

.canto-gruppo-titolo.archivio { color: var(--text-muted); z-index: 6; margin-top: 4px; }

.canto-riga-btn {
    width: 100%;
    text-align: left;
    padding: 7px 10px;
    margin-bottom: 4px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-main);
    cursor: pointer;
    font-size: clamp(0.78rem, 2vw, 0.82rem);
    display: block;
}

.canto-riga-btn.consigliato { border-color: var(--accent); font-weight: 700; }
.canto-riga-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Contenitore e card Avvisi Toast (sostituisce gli stili inline di mostraAlertSicuro) */
.toast-container-ascoltami {
    position: fixed;
    bottom: calc(75px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: min(calc(100vw - clamp(20px, 4vw, 40px)), 460px);
    pointer-events: none;
}
.toast-avviso-card {
    pointer-events: auto;
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--accent);
    border-left: 5px solid var(--accent);
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    font-size: clamp(0.82rem, 2.2vw, 0.9rem);
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast-avviso-card.visibile { opacity: 1; transform: translateY(0); }
.toast-avviso-chiudi {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.canvas-registrazione-offscreen {
    position: fixed;
    left: -9999px;
    top: 0;
    pointer-events: none;
    opacity: 0.01;
}
.input-file-compatto {
    flex: 1 1 min(100%, 200px);
    min-width: 0;
    min-height: 40px;
    font-size: clamp(0.76rem, 2vw, 0.84rem);
    color: var(--text-main);
    padding: clamp(6px, 1.5vw, 8px);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    cursor: pointer;
}
/* === 25. MOTORE UNIVERSALE PONTE AI & MINI-GUIDA === */
.box-risposta-ai-locale {
    width: 100%;
    margin-top: 12px;
    padding: clamp(12px, 3vw, 18px);
    background-color: var(--bg-principal);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.box-risposta-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}
.item-btn.btn-conferma-verde:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: default;
    opacity: 0.75;
    box-shadow: none;
}

.box-risposta-ai-corpo,
#editorRiflessioneLocaleVersetto {
    font-family: var(--font-family);
    font-size: clamp(0.95rem, 2.4vw, 1.05rem);
    line-height: 1.58;
    color: var(--text-main);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.barra-rientro-mobile-ai {
    position: fixed;
    bottom: calc(74px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: min(94vw, 520px);
    background-color: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: clamp(10px, 2.5vw, 14px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    z-index: 10010;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.barra-rientro-mobile-riga {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(6px, 1.8vw, 8px);
}
#modaleIncollaManualeAI {
    z-index: 10020;
}

.btn-incolla-mobile-ai,
.item-btn.btn-conferma-verde {
    background-color: #27ae60;
    color: #ffffff;
    border-color: #27ae60;
}
.btn-incolla-mobile-ai {
    flex: 1;
    min-height: 46px;
    font-size: clamp(0.86rem, 2.2vw, 0.95rem);
    font-weight: 800;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.25);
}
.btn-incolla-mobile-ai:hover,
.item-btn.btn-conferma-verde:hover {
    background-color: #219150;
    border-color: #219150;
    color: #ffffff;
}

.sottotitolo-guida-rientro {
    font-size: clamp(0.75rem, 1.9vw, 0.82rem);
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
}
.guida-passi-lista {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0;
    text-align: left;
}
.guida-passo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background-color: var(--bg-principal);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: clamp(0.86rem, 2.2vw, 0.94rem);
    line-height: 1.45;
}
.guida-passo-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.box-risposta-ai-corpo strong { font-weight: 800; color: var(--text-main); }
.box-risposta-ai-corpo em { font-style: italic; }
.box-risposta-ai-titolo-md { font-weight: 800; color: var(--accent); margin-top: 6px; display: block; }
.box-risposta-ai-punto { padding-left: 12px; position: relative; margin: 3px 0; }
.box-risposta-ai-punto::before { content: "•"; color: var(--accent); font-weight: 800; position: absolute; left: 0; }
#modaleGuidaPassoPassoAI,
#avvisoGoogleAiModal {
    z-index: 10005;
}
.barra-azioni-rapide-etimologia {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(68px, 21%, 130px)), 1fr));
    gap: clamp(4px, 1.4vw, 8px);
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
}
.barra-azioni-rapide-etimologia .item-btn {
    min-height: 36px;
    padding: 5px 6px;
    font-size: clamp(0.7rem, 1.9vw, 0.78rem);
    border-radius: 8px;
}

/* === 29. PUNTO 6.2 ROADMAP: COPERTINE AI & ANTEPRIMA SCRIPTORIO A4 === */
.box-copertina-ai-stato {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: clamp(6px, 1.8vw, 10px);
    padding: clamp(8px, 2.2vw, 12px) clamp(10px, 2.5vw, 14px);
    background-color: var(--bg-principal);
    border: 1px dashed var(--accent);
    border-radius: clamp(8px, 2vw, 12px);
    margin-bottom: clamp(8px, 2vw, 12px);
}
.anteprima-copertina-mini {
    width: clamp(40px, calc(38px + 1.5vw), 52px);
    height: clamp(40px, calc(38px + 1.5vw), 52px);
    object-fit: cover;
    border-radius: clamp(6px, 1.5vw, 9px);
    border: 1px solid var(--border-color);
}
/* === 30. PUNTO 6.4 ROADMAP: CACCIA AL TESORO BIBLICA === */
.caccia-progresso-riga {
    display: flex;
    justify-content: space-between;
    gap: clamp(4px, 1.2vw, 8px);
    margin-bottom: clamp(10px, 2.4vw, 14px);
}
.caccia-tappa-pill {
    flex: 1;
    height: clamp(6px, 1.5vw, 9px);
    border-radius: 999px;
    background-color: var(--border-color);
    transition: background-color 0.2s ease;
}
.caccia-tappa-pill.completata { background-color: #27ae60; }
.caccia-tappa-pill.attiva { background-color: var(--accent); }
.caccia-opzioni-griglia {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(6px, 1.6vw, 10px);
    margin-top: clamp(8px, 2vw, 12px);
}
.caccia-opzione-btn {
    text-align: left;
    justify-content: flex-start;
    padding: clamp(9px, 2.2vw, 12px) clamp(11px, 2.6vw, 15px);
    line-height: 1.4;
}
/* === 31. PUNTO 6.5 ROADMAP: ALBUM DI GESÙ & FIGURINE A4 (CSS FLUIDO) === */
.album-scene-lista {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vw, 10px);
    max-height: clamp(210px, calc(34dvh + 2vw), 320px);
    overflow-y: auto;
    margin: clamp(8px, 2vw, 14px) 0;
    padding-right: clamp(2px, 0.8vw, 6px);
}
.album-scena-item {
    display: flex;
    align-items: flex-start;
    gap: clamp(8px, 2vw, 12px);
    padding: clamp(8px, 2.2vw, 13px) clamp(10px, 2.5vw, 15px);
    background-color: var(--bg-principal);
    border: 1px solid var(--border-color);
    border-radius: clamp(8px, 2vw, 12px);
    font-size: clamp(0.8rem, calc(0.76rem + 0.6vw), 0.92rem);
    line-height: 1.45;
    text-align: left;
}
.album-figurina-badge {
    flex-shrink: 0;
    width: clamp(24px, calc(22px + 1.2vw), 32px);
    height: clamp(24px, calc(22px + 1.2vw), 32px);
    border-radius: clamp(6px, 1.5vw, 9px);
    background-color: var(--accent);
    color: #ffffff;
    font-weight: 800;
    font-size: clamp(0.76rem, 2vw, 0.88rem);
    display: flex;
    align-items: center;
    justify-content: center;
}