/* Chat: struttura a pannelli arrotondati sullo sfondo del tema. Colori solo da theme.css (--wc-*). */
.chat-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--wc-bg); color: var(--wc-text); font-family: var(--wc-font); }
.min-w-0 { min-width: 0; }
/* La pagina della chat è bloccata a tutto schermo: scorrono solo i messaggi e gli elenchi, mai la pagina intera
   (su Safari dell'iPhone scorreva tutta, e "tirando giù" si ricaricava). */
html:has(> .chat-body) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.chat-body { position: fixed; left: 0; right: 0; top: var(--app-top, 0); height: var(--app-h, 100dvh); bottom: auto; overscroll-behavior: none; }
@media (max-width: 991.98px) { #convReduce { display: none !important; } }
.offcanvas-lg .offcanvas-header { justify-content: flex-start; gap: .6rem; }
.offcanvas-lg .offcanvas-title { font-weight: 800; }
.back-btn { position: relative; }

/* ---------- barra in alto ---------- */
.app-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; padding-top: max(.5rem, var(--safe-area-inset-top, env(safe-area-inset-top))); flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: .6rem; min-width: 0; font-weight: 800; font-size: 1.1rem; letter-spacing: -.01em; }
.brand-mark { width: 2.1rem; height: 2.1rem; border-radius: 12px; background: var(--wc-accent); color: var(--wc-accent-contrast); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.icon-btn { width: 2.5rem; height: 2.5rem; border: 0; border-radius: 14px; background: var(--wc-surface); color: var(--wc-text); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: var(--wc-shadow); transition: background .15s, color .15s; }
.icon-btn:hover, .icon-btn:focus-visible { background: var(--wc-accent-soft); color: var(--wc-accent-text); }
.icon-btn .wc-icon { width: 1.25rem; height: 1.25rem; }
.chat-header .icon-btn { box-shadow: none; background: transparent; width: 2.3rem; height: 2.3rem; } /* B14 (i) */
.chat-header .avatar { width: 2.3rem; height: 2.3rem; }
.count-badge { position: absolute; top: -.3rem; right: -.3rem; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 999px; background: var(--wc-danger); color: #fff; font-size: .68rem; font-weight: 800; line-height: 1.2rem; text-align: center; }
.count-badge.count-muted { background: var(--wc-text); color: var(--wc-surface); }
.count-badge:empty { display: none; }
.me-chip { display: flex; align-items: center; gap: .5rem; border: 0; background: var(--wc-surface); color: var(--wc-text); border-radius: 999px; padding: .25rem .8rem .25rem .25rem; max-width: 12rem; font-weight: 700; box-shadow: var(--wc-shadow); }
.me-chip:hover { background: var(--wc-accent-soft); }
.me-name { min-width: 0; }
@media (max-width: 575.98px) { .me-chip { padding: .25rem; } .me-name { display: none; } }
.me-menu { min-width: 16rem; }
.me-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; }
.me-menu .dropdown-item .wc-icon { color: var(--wc-muted); }
.theme-picker { display: flex; gap: .25rem; margin: .25rem .75rem .5rem; padding: .25rem; border-radius: 14px; background: var(--wc-surface-2); }
.theme-picker button { flex: 1; border: 0; background: none; color: var(--wc-muted); border-radius: 10px; padding: .35rem .2rem; font-size: .72rem; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.theme-picker button.active { background: var(--wc-surface); color: var(--wc-accent-text); box-shadow: var(--wc-shadow); }

/* ---------- pannelli ---------- */
.chat-layout { flex: 1; display: flex; min-height: 0; gap: .75rem; padding: 0 .75rem .75rem; }
.chat-layout .chat-side { background-color: var(--wc-surface) !important; } /* Bootstrap mette trasparente !important sugli offcanvas da desktop */
@media (min-width: 992px) {
  .chat-side { width: 300px; flex: 0 0 300px; border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); overflow-y: auto; }
  .chat-side-right { width: 240px; flex-basis: 240px; }
}
@media (max-width: 991.98px) {
  .chat-layout { padding: 0; gap: 0; }
  .chat-main { border-radius: var(--wc-radius) var(--wc-radius) 0 0; }
}
.offcanvas-lg .offcanvas-header { padding: 1rem 1rem .25rem; }
.side-head { padding: 1rem 1rem .25rem; }
.side-heading { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 .75rem; }
.filters { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
.filters::-webkit-scrollbar { display: none; }
.chip { border: 0; border-radius: 999px; padding: .35rem .65rem; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--wc-surface-2); color: var(--wc-muted); }
.chip:hover { color: var(--wc-text); }
.chip.active { background: var(--wc-accent); color: var(--wc-accent-contrast); }
.side-title { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--wc-muted); padding: .9rem 1.1rem .35rem; }
.side-title span { text-transform: none; letter-spacing: 0; }
.side-note { font-size: .82rem; color: var(--wc-muted); padding: .35rem 1.1rem .75rem; margin: 0; }
.side-note:empty { display: none; }
.conv-list { display: flex; flex-direction: column; gap: 2px; padding: 0 .5rem; }
.conv-item { display: flex; align-items: center; gap: .7rem; width: 100%; border: 0; background: none; color: var(--wc-text); text-align: left; padding: .55rem .6rem; border-radius: 16px; transition: background .12s; }
.conv-item:hover { background: var(--wc-surface-2); }
.conv-item.active { background: var(--wc-accent-soft); }
.conv-item:disabled { opacity: 1; cursor: default; }
.conv-body { flex: 1; min-width: 0; }
.conv-row { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.conv-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: .72rem; color: var(--wc-muted); flex: 0 0 auto; }
.conv-item.has-unread .conv-time { color: var(--wc-accent-text); font-weight: 700; }
.conv-preview { flex: 1; min-width: 0; font-size: .84rem; color: var(--wc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: .3rem; }
.conv-preview .wc-icon { width: 1em; height: 1em; flex: 0 0 auto; }
.conv-preview .pv-text { overflow: hidden; text-overflow: ellipsis; }
.pv-status { display: inline-flex; color: var(--wc-muted); flex: 0 0 auto; }
.pv-status .wc-icon { width: 1.05em; height: 1.05em; }
.pv-status.status-read { color: #2F8FDB; }
[data-theme="notte"] .pv-status.status-read { color: #6CC4FF; }
.conv-item.has-unread .conv-preview { color: var(--wc-text); }
.conv-note { color: var(--wc-accent-text); font-weight: 600; }
.unread-pill { min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; border-radius: 999px; background: var(--wc-accent); color: var(--wc-accent-contrast); font-size: .72rem; font-weight: 800; line-height: 1.35rem; text-align: center; flex: 0 0 auto; }
.conv-lock { color: var(--wc-muted); flex: 0 0 auto; }
.conv-tag { font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .4rem; border-radius: 6px; background: var(--wc-surface-2); color: var(--wc-muted); flex: 0 0 auto; }
.conv-tag.tag-admin { background: rgba(217, 58, 63, .12); color: var(--wc-danger); }
.conv-tag.tag-moderator { background: rgba(30, 158, 106, .14); color: var(--wc-online); }

/* ---------- avatar: iniziale su colore fisso per nome ---------- */
.avatar { --av-bg: var(--wc-accent-soft); --av-fg: var(--wc-accent-text); position: relative; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--av-bg); color: var(--av-fg); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-weight: 800; font-size: 1.05rem; line-height: 1; user-select: none; }
.avatar:empty { display: none; }
.avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; display: block; }
.avatar-sm { width: 2rem; height: 2rem; font-size: .82rem; }
.avatar-xs { width: 1.75rem; height: 1.75rem; font-size: .72rem; }
.avatar.is-channel { border-radius: 14px; }
.avatar.is-guest { --av-bg: var(--wc-surface-2); --av-fg: var(--wc-muted); }
.avatar .wc-icon { width: 1.2rem; height: 1.2rem; }
.avatar .presence { position: absolute; right: -1px; bottom: -1px; width: .8rem; height: .8rem; border-radius: 50%; background: var(--wc-online); border: 2px solid var(--wc-surface); }
.av-0 { --av-bg: #E8EAFD; --av-fg: #3B44C0; }
.av-1 { --av-bg: #FDE7EC; --av-fg: #B4234B; }
.av-2 { --av-bg: #DFF5EA; --av-fg: #17734F; }
.av-3 { --av-bg: #FFF0D9; --av-fg: #9A5A00; }
.av-4 { --av-bg: #E3F1FC; --av-fg: #1D5F99; }
.av-5 { --av-bg: #F1E6FC; --av-fg: #7134B0; }
.av-6 { --av-bg: #DDF4F4; --av-fg: #146B6B; }
.av-7 { --av-bg: #FBE6DC; --av-fg: #A6411B; }
[data-theme="notte"] .av-0 { --av-bg: #2B2F63; --av-fg: #C3C8FF; }
[data-theme="notte"] .av-1 { --av-bg: #4A2231; --av-fg: #FFB8C9; }
[data-theme="notte"] .av-2 { --av-bg: #183E30; --av-fg: #9FE6C4; }
[data-theme="notte"] .av-3 { --av-bg: #47361A; --av-fg: #FFD48C; }
[data-theme="notte"] .av-4 { --av-bg: #1B3550; --av-fg: #A9D3FA; }
[data-theme="notte"] .av-5 { --av-bg: #3A2556; --av-fg: #DDBDFF; }
[data-theme="notte"] .av-6 { --av-bg: #163F40; --av-fg: #9DE3E3; }
[data-theme="notte"] .av-7 { --av-bg: #4A2A1E; --av-fg: #FFC3A8; }

/* ---------- colonna centrale ---------- */
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--wc-chat-bg); border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); overflow: hidden; }
.chat-header { display: flex; align-items: center; gap: .55rem; padding: .3rem .6rem; border-bottom: 1px solid var(--wc-border); background: var(--wc-surface); min-height: 3.4rem; } /* B14 (i) */
.conv-title { font-weight: 800; font-size: 1.02rem; }
.conv-topic, .conv-status { font-size: .8rem; color: var(--wc-muted); }
#convCall:not(.d-none) { display: flex; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; padding: .6rem; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.empty-state { color: var(--wc-muted); text-align: center; margin-top: 3rem; padding: 0 1rem; }
.chat-composer { display: flex; gap: .35rem; align-items: flex-end; padding: .35rem .5rem; background: var(--wc-surface); border-top: 1px solid var(--wc-border); padding-bottom: max(.35rem, var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); } /* B14 (l) */
.chat-composer textarea { resize: none; max-height: 9rem; min-height: 2.5rem; overflow-y: hidden; border-radius: 22px; padding: .5rem .9rem; background: var(--wc-surface-2); border-color: transparent; line-height: 1.35; }
.chat-composer textarea:focus { background: var(--wc-surface); }
.chat-composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* R-0047: su una riga, coi puntini */
.send-btn { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: var(--wc-accent); color: var(--wc-accent-contrast); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; transition: background .15s, transform .1s; }
.send-btn:hover { background: var(--wc-accent-hover); }
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .45; }
.send-btn .wc-icon { width: 1.2rem; height: 1.2rem; }
.attach-group { display: flex; }
.attach-btn { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: var(--wc-surface-2); color: var(--wc-muted); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0; font-size: 1.1rem; }
.attach-btn:hover, .attach-btn[aria-expanded="true"] { color: var(--wc-accent-text); background: var(--wc-accent-soft); }
.attach-btn .wc-icon { width: 1.25rem; height: 1.25rem; }
.attach-menu { min-width: 12rem; }
.attach-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; }
.chat-composer.drop-target, .dm-win-composer.drop-target { outline: 2px dashed var(--wc-accent); outline-offset: -4px; }

/* ---------- fissati, risposta, sta scrivendo ---------- */
.pin-bar { display: flex; align-items: center; gap: .5rem; width: 100%; border: 0; border-bottom: 1px solid var(--wc-border); background: var(--wc-surface); color: var(--wc-text); padding: .45rem 1rem; font-size: .82rem; text-align: left; }
.pin-bar .wc-icon { color: var(--wc-accent-text); }
.pin-bar .pin-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-top: 1px solid var(--wc-border); background: var(--wc-surface); font-size: .82rem; }
.reply-bar > .wc-icon { color: var(--wc-accent-text); }
.reply-bar .reply-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--wc-accent); padding-left: .5rem; }
.typing-line { font-size: .76rem; color: var(--wc-muted); font-style: italic; padding: 0 1.1rem; min-height: 1.15rem; }
.typing-line:empty { min-height: 0; }
.toast-link { cursor: pointer; }
.toast-link:hover { text-decoration: underline; }

/* ---------- messaggi a fumetto: i miei a destra, gli altri a sinistra con avatar ---------- */
:root { --wc-tick-read: #8EE8FF; }
[data-theme="salvia"] { --wc-tick-read: #0F7FC0; }
.msg { display: flex; align-items: flex-end; gap: .5rem; margin-top: .35rem; } /* B14 (n) */
.msg.cont { margin-top: .12rem; }
/* 11.27: selezione di più messaggi da parte dello staff */
.selecting .msg { cursor: pointer; }
.selecting .msg:not(.deleted)::before { content: ''; flex: none; align-self: center; width: 20px; height: 20px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--wc-muted, #8A8FA8); }
.selecting .msg.selected::before { background: var(--wc-primary, #4B55D6); border-color: var(--wc-primary, #4B55D6); box-shadow: inset 0 0 0 3px var(--wc-surface, #fff); }
.msg.selected .msg-bubble { outline: 3px solid var(--wc-primary, #4B55D6); outline-offset: 2px; }
.sel-bar { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; border-top: 1px solid var(--wc-border); background: var(--wc-surface); }
.sel-bar.d-none { display: none; }
.sel-bar .sel-count { flex: 1; font-weight: 700; }
.msg.mine { flex-direction: row-reverse; }
.msg-av { flex: 0 0 2rem; display: flex; }
.msg.cont .msg-av { visibility: hidden; }
.is-dm .msg-av, .dm-win .msg-av { display: none; }
.msg-bubble { min-width: 0; max-width: min(82%, 36rem); padding: .3rem .6rem .35rem; border-radius: 18px 18px 18px 6px; background: var(--wc-bubble-in); color: var(--wc-bubble-in-text); display: flex; flex-wrap: wrap; align-items: flex-end; column-gap: .5rem; } /* B14 (m, n) */
.msg-bubble > * { flex: 1 1 100%; min-width: 0; }
.msg-bubble > .msg-body { flex: 0 1 auto; }
.msg-meta { flex: 0 0 auto !important; margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.is-dm .msg-head, .dm-win .msg-head, .msg.cont .msg-head { display: none; } /* B14 (m): nei privati niente nome nei fumetti */
.msg.mine .msg-bubble { background: var(--wc-bubble-out); color: var(--wc-bubble-out-text); border-radius: 18px 18px 6px 18px; }
.dm-win .msg-bubble { max-width: 85%; }
.msg-head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .1rem; }
.msg-author { font-weight: 800; font-size: .82rem; background: none; border: 0; padding: 0; color: var(--av-fg, inherit); }
.msg-author:hover { text-decoration: underline; }
.msg.mine .msg-author { color: inherit !important; }
.msg.cont .msg-author, .msg.cont .role-tag, .msg.cont .msg-head .name-badges { display: none; } /* anche il distintivo, col nome (2026-10-18) */
.role-admin { color: var(--wc-danger) !important; }
.role-moderator { color: var(--wc-online) !important; }
.role-guest { color: var(--wc-muted) !important; font-weight: 600; }
.role-tag { font-size: .6rem; }
.msg-time { font-size: .72rem; color: var(--wc-muted); }
.msg-status { display: inline-flex; color: var(--wc-muted); }
.msg-status .wc-icon { width: 1rem; height: 1rem; }
.msg.mine .msg-time, .msg.mine .msg-status, .msg.mine .msg-more, .msg.mine .msg-fwd { color: var(--wc-bubble-out-muted); }
.msg.mine .msg-status.status-read { color: var(--wc-tick-read); }
.msg-more { border: 0; background: none; color: var(--wc-muted); font-weight: 800; font-size: 1.05rem; line-height: 1; padding: 0 .3rem; border-radius: 8px; }
.msg-more:hover, .msg-more:focus-visible, .msg-more[aria-expanded="true"] { background: rgba(var(--wc-accent-rgb), .12); color: var(--wc-accent-text); }
.msg.mine .msg-more:hover, .msg.mine .msg-more[aria-expanded="true"] { background: var(--wc-quote-out); color: inherit; }
.msg-body { white-space: pre-wrap; word-break: break-word; line-height: 1.42; font-size: .97rem; } /* B14 (n) */
.msg-fwd { display: flex; align-items: center; gap: .3rem; font-size: .74rem; color: var(--wc-muted); font-style: italic; }
.msg-quote { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--wc-accent); background: rgba(var(--wc-accent-rgb), .08); color: inherit; font-size: .8rem; padding: .25rem .55rem; margin: .15rem 0 .3rem; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.mine .msg-quote { background: var(--wc-quote-out); border-left-color: currentColor; }
.msg-quote strong { color: inherit; }
.msg-reactions { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .3rem; }
.msg-reactions:empty { display: none; }
.msg-reaction { border: 1px solid var(--wc-border); background: var(--wc-surface); color: var(--wc-text); border-radius: 999px; font-size: .78rem; padding: 0 .5rem; line-height: 1.6; }
.msg-reaction.mine { border-color: var(--wc-accent); background: var(--wc-accent-soft); color: var(--wc-accent-text); }
.msg.deleted .msg-bubble { background: transparent; border: 1px dashed var(--wc-border); color: var(--wc-muted); }
.msg.deleted .msg-time, .msg.deleted .msg-status { color: var(--wc-muted); }
.msg.flash-target .msg-bubble { animation: flash-target 1.6s ease-out; }
@keyframes flash-target { 0% { box-shadow: 0 0 0 5px rgba(var(--wc-accent-rgb), .45); } 100% { box-shadow: 0 0 0 0 rgba(var(--wc-accent-rgb), 0); } }
.day-sep { display: flex; justify-content: center; margin: 1rem 0 .3rem; position: sticky; top: -.5rem; z-index: 2; pointer-events: none; }
.day-sep.covered { visibility: hidden; }
.day-sep span { font-size: .72rem; font-weight: 700; color: var(--wc-muted); background: var(--wc-surface); border: 1px solid var(--wc-border); padding: .2rem .75rem; border-radius: 999px; box-shadow: var(--wc-shadow); }
.msg-system { text-align: center; font-size: .78rem; color: var(--wc-muted); margin: .6rem 0; }
.msg-menu { position: fixed; z-index: 1085; min-width: 13rem; display: block; }
.msg-menu .reaction-row { display: flex; justify-content: space-between; gap: .15rem; padding: .25rem .5rem .4rem; }
.msg-menu .reaction-row button { border: 0; background: none; font-size: 1.3rem; padding: .1rem .25rem; border-radius: 10px; transition: transform .1s; }
.msg-menu .reaction-row button:hover { background: var(--wc-surface-2); transform: scale(1.15); }
.msg-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; }

/* ---------- allegati nei fumetti ---------- */
.msg-attach { display: block; margin: .25rem 0; max-width: min(340px, 100%); }
.msg-image { border: 0; padding: 0; background: none; border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.msg-image img { display: block; max-width: 100%; height: auto; border-radius: 12px; background: var(--wc-surface-2); }
.msg-video { max-height: 320px; width: 100%; border-radius: 12px; background: #000; }
.msg-file { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: 12px; background: rgba(var(--wc-accent-rgb), .07); color: inherit; text-decoration: none; }
.msg.mine .msg-file { background: var(--wc-quote-out); }
.msg-file:hover { color: inherit; filter: brightness(.97); }
.file-icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--wc-accent); color: var(--wc-accent-contrast); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.msg.mine .file-icon { background: var(--wc-bubble-out-text); color: var(--wc-bubble-out); }
.file-sub { display: block; font-size: .76rem; opacity: .75; }
.msg-expired { display: flex; align-items: center; gap: .35rem; font-size: .8rem; opacity: .75; font-style: italic; }
.voice { display: flex; align-items: center; gap: .6rem; width: 17rem; max-width: 100%; padding: .15rem 0; }
.voice audio { display: none; }
.voice-play { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 0; background: var(--wc-accent); color: var(--wc-accent-contrast); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.msg.mine .voice-play { background: var(--wc-bubble-out-text); color: var(--wc-bubble-out); }
.voice-bars { flex: 1; min-width: 0; height: 2rem; display: flex; align-items: center; gap: 2px; cursor: pointer; color: var(--wc-accent); }
.msg.mine .voice-bars { color: var(--wc-bubble-out-text); }
.voice-bar { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .32; transition: opacity .15s; }
.voice-bar.lit { opacity: 1; }
.voice-time { font-size: .74rem; font-variant-numeric: tabular-nums; opacity: .8; min-width: 2.2rem; text-align: right; }
.lightbox-img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.dm-win .msg-attach { max-width: 100%; }

/* ---------- anteprima dell'allegato e registrazione ---------- */
.attach-preview { padding: .45rem .8rem; border-top: 1px solid var(--wc-border); background: var(--wc-surface); }
.attach-chip { display: flex; align-items: center; gap: .6rem; }
.attach-chip img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.attach-icon { width: 2.4rem; height: 2.4rem; border-radius: 10px; background: var(--wc-accent-soft); color: var(--wc-accent-text); display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.attach-info { flex: 1; min-width: 0; }
.attach-progress { height: 4px; margin-top: .2rem; }
.rec-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--wc-danger); animation: rec-blink 1s infinite; flex: 0 0 auto; }
@keyframes rec-blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .rec-dot { animation: none; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- emoji ---------- */
.composer-field { flex: 1; min-width: 0; position: relative; display: flex; align-items: flex-end; }
.composer-field textarea { padding-right: 2.8rem; }
.emoji-btn { position: absolute; right: .3rem; bottom: .25rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: none; color: var(--wc-muted); display: flex; align-items: center; justify-content: center; }
.emoji-btn:hover, .emoji-btn[aria-expanded="true"] { color: var(--wc-accent-text); background: var(--wc-accent-soft); }
.emoji-btn .wc-icon { width: 1.25rem; height: 1.25rem; }
.emoji-pop { position: fixed; z-index: 1086; width: min(20rem, calc(100vw - 1rem)); background: var(--wc-surface); color: var(--wc-text); border: 1px solid var(--wc-border); border-radius: 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); display: flex; flex-direction: column; overflow: hidden; }
.emoji-tabs { display: flex; gap: 2px; padding: .35rem .35rem 0; border-bottom: 1px solid var(--wc-border); }
.emoji-tabs button { flex: 1; border: 0; background: none; font-size: 1.1rem; padding: .3rem 0 .4rem; border-bottom: 2px solid transparent; filter: grayscale(.6); }
.emoji-tabs button.active { border-bottom-color: var(--wc-accent); filter: none; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: .4rem; height: 13rem; overflow-y: auto; align-content: start; }
.emoji-grid button { border: 0; background: none; font-size: 1.35rem; line-height: 1; padding: .3rem 0; border-radius: 8px; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--wc-surface-2); }

/* ---------- chiamata: sempre scura, come la bozza Notte ---------- */
.call-view { position: fixed; inset: 0; z-index: 1070; background: #0E1016; color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--wc-font); }
.call-remote { width: 100%; height: 100%; object-fit: contain; background: #0E1016; }
.call-local { position: absolute; right: 1rem; top: max(1rem, var(--safe-area-inset-top, env(safe-area-inset-top))); width: 30vw; max-width: 200px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 20px; border: 2px solid rgba(255, 255, 255, .55); background: #3B3F55; transform: scaleX(-1); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.call-local.back-camera { transform: none; }
.call-info { position: absolute; left: 50%; transform: translateX(-50%); top: max(1.4rem, var(--safe-area-inset-top, env(safe-area-inset-top))); max-width: 60vw; text-align: center; }
.call-peer { font-weight: 800; font-size: 1.2rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-status { display: inline-block; margin-top: .4rem; padding: .2rem .7rem; border-radius: 999px; background: rgba(14, 16, 22, .6); font-size: .8rem; font-weight: 700; }
.call-status:empty { display: none; }
.call-controls { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(1.5rem, var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 32px; background: rgba(20, 23, 31, .82); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
.call-btn { width: 3.4rem; height: 3.4rem; border: 0; border-radius: 50%; background: #2A2F40; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; transition: background .15s, transform .1s; }
.call-btn:hover { background: #363C52; }
.call-btn:active { transform: scale(.94); }
.call-btn .wc-icon { width: 1.4rem; height: 1.4rem; }
.call-btn .ic-on, .call-btn .ic-off { display: inline-flex; }
.call-btn .ic-off, .call-btn.off .ic-on { display: none; }
.call-btn.off .ic-off { display: inline-flex; }
.call-btn.on { background: #fff; color: #14172B; } /* v13: vivavoce o Bluetooth acceso */
.call-btn.off { background: #F2F3F7; color: #14171F; }
.call-btn-danger { background: #E5484D; }
.call-btn-danger:hover { background: #D13A40; }
.call-btn-wide { width: 4.2rem; border-radius: 28px; }
.call-btn-accept { background: #1E9E6A; }
.call-btn-accept:hover { background: #18865A; }
.call-audio-avatar, .call-ring-avatar { width: 6rem; height: 6rem; border-radius: 50%; background: var(--wc-accent); color: var(--wc-accent-contrast); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; font-weight: 800; }
.call-audio-avatar { position: absolute; display: none; width: 8rem; height: 8rem; font-size: 3.2rem; box-shadow: 0 0 0 18px rgba(var(--wc-accent-rgb), .18), 0 0 0 36px rgba(var(--wc-accent-rgb), .08); }
.call-view.audio-only .call-remote, .call-view.audio-only .call-local { opacity: 0; pointer-events: none; }
.call-view.audio-only .call-audio-avatar, .call-view.no-remote-video .call-audio-avatar { display: flex; }
.call-ring-avatar { animation: ring-pulse 1.2s ease-in-out infinite; }
@keyframes ring-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--wc-accent-rgb), .5); } 50% { box-shadow: 0 0 0 16px rgba(var(--wc-accent-rgb), 0); } }
@media (prefers-reduced-motion: reduce) { .call-ring-avatar { animation: none; } }
.call-incoming { border-radius: var(--wc-radius); }
.call-choice { display: flex; flex-direction: column; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; color: var(--wc-muted); }

/* ---------- campanella degli avvisi (solo telefono) ---------- */
.bell-menu { width: min(22rem, calc(100vw - 1rem)); padding: 0; overflow: hidden; border-radius: 18px; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem; border-bottom: 1px solid var(--wc-border); }
.bell-list { max-height: min(60vh, 26rem); overflow-y: auto; overscroll-behavior: contain; }
.bell-item { display: flex; align-items: flex-start; gap: .6rem; width: 100%; border: 0; background: none; color: var(--wc-text); text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--wc-border); }
.bell-item:last-child { border-bottom: 0; }
.bell-item.unread { background: var(--wc-accent-soft); }
.bell-body { flex: 1; min-width: 0; font-size: .86rem; }
.bell-line, .bell-snippet { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bell-snippet { color: var(--wc-muted); font-size: .82rem; }
.bell-time { font-size: .7rem; color: var(--wc-muted); flex: 0 0 auto; padding-top: .15rem; }
.bell-empty { padding: 1rem .9rem; margin: 0; color: var(--wc-muted); font-size: .86rem; }

/* ---------- posizione con anteprima della mappa ---------- */
.msg-location { display: block; color: inherit; text-decoration: none; border-radius: 12px; overflow: hidden; }
/* R-0050 (B1.2): il sondaggio nei messaggi, le righe della lista e la scelta dalla graffetta. */
.poll-card { min-width: min(16rem, 62vw); max-width: 22rem; }
.poll-kind { font-size: .72rem; font-weight: 700; color: var(--wc-muted); margin-bottom: .2rem; }
/* R-0051: l'etichetta del voto, ben visibile (con il nome: colore d'accento; anonimo: grigio scuro). */
.poll-named, .poll-anon { display: inline-block; font-size: .76rem; font-weight: 800; padding: .05rem .45rem; border-radius: 999px; }
.poll-named { background: rgba(var(--wc-accent-rgb), .14); color: var(--wc-accent); }
.poll-anon { background: var(--wc-surface-2); color: var(--wc-text); }
.msg.mine .poll-named, .msg.mine .poll-anon { background: rgba(255,255,255,.22); color: inherit; }
.poll-chats { font-size: .74rem; color: var(--wc-muted); margin: -.25rem 0 .45rem; }
.msg.mine .poll-chats { color: inherit; opacity: .85; }
.poll-q { font-weight: 800; margin-bottom: .45rem; overflow-wrap: anywhere; }
.poll-opts { display: grid; gap: .35rem; }
.poll-opt { position: relative; display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left; border: 1.5px solid var(--wc-border); border-radius: 12px; background: var(--wc-surface); color: inherit; padding: .45rem .65rem; overflow: hidden; }
.poll-opt.chosen { border-color: var(--wc-accent); }
.poll-opt:disabled { opacity: 1; cursor: default; }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: rgba(var(--wc-accent-rgb), .16); transition: width .3s; }
.poll-text, .poll-n { position: relative; }
.poll-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-check { color: var(--wc-accent); font-weight: 800; margin-right: .3rem; }
.poll-n { font-weight: 800; font-size: .85rem; }
.poll-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; margin-top: .4rem; font-size: .75rem; color: var(--wc-muted); }
.poll-who { border: 0; background: none; padding: 0; color: var(--wc-accent); font-weight: 700; font-size: .75rem; }
.poll-voters { padding: .4rem 0; border-bottom: 1px solid var(--wc-border); }
.poll-row { align-items: flex-start; }
.poll-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.poll-pick { display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left; border: 1.5px solid var(--wc-border); border-radius: 14px; background: var(--wc-surface); color: inherit; padding: .5rem .65rem; }
.poll-pick.active { border-color: var(--wc-accent); background: rgba(var(--wc-accent-rgb), .08); }
.poll-pick-ico { font-size: 1.3rem; }
.poll-pick-dot { width: 1.4rem; text-align: center; color: var(--wc-accent); font-weight: 800; }
.attach-emoji { display: inline-block; width: 1.25rem; margin-right: .5rem; text-align: center; }
/* R-0051: la riga «Sondaggio chiuso» al centro della chat e il pulsante «Manda» della scelta di più chat. */
.msg-poll-closed { display: flex; justify-content: center; margin: .5rem 0; }
.poll-closed { max-width: min(26rem, 92%); text-align: center; font-size: .82rem; color: var(--wc-text); background: var(--wc-surface-2); border: 1px solid var(--wc-border); border-radius: 14px; padding: .5rem .8rem; overflow-wrap: anywhere; }
.poll-closed .poll-who { display: block; margin: .25rem auto 0; font-size: .8rem; }
/* R-0052 (B1.3): la scheda dell'evento nei messaggi e la mappa dove spostare il segnaposto. */
.event-card { min-width: min(16rem, 62vw); max-width: 22rem; }
.ev-title { font-weight: 800; font-size: 1.02rem; overflow-wrap: anywhere; }
.ev-when { font-weight: 700; margin-top: .1rem; }
.ev-place, .ev-notes { font-size: .88rem; margin-top: .2rem; overflow-wrap: anywhere; }
.ev-preview { display: block; width: 100%; height: auto; border-radius: 10px; margin-top: .4rem; }
.ev-state { display: inline-block; margin-top: .35rem; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--wc-muted); }
.ev-answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: .5rem; }
.ev-ans { display: flex; flex-direction: column; align-items: center; border: 1.5px solid var(--wc-border); border-radius: 12px; background: var(--wc-surface); color: inherit; padding: .35rem .2rem; font-weight: 700; font-size: .85rem; }
.ev-ans.chosen { border-color: var(--wc-accent); background: rgba(var(--wc-accent-rgb), .14); }
.ev-ans:disabled { opacity: .6; }
.ev-n { font-size: .78rem; font-weight: 800; }
.ev-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.ev-act { border: 0; border-radius: 999px; background: var(--wc-surface-2); color: inherit; font-size: .78rem; font-weight: 700; padding: .3rem .65rem; }
.msg.mine .ev-ans { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); }
.msg.mine .ev-ans.chosen { border-color: currentColor; background: rgba(255,255,255,.26); }
.msg.mine .ev-act { background: rgba(255,255,255,.18); }
.msg.mine .ev-state { color: inherit; opacity: .85; }
.ev-map-wrap { position: relative; margin-top: .5rem; }
.ev-map { height: 230px; border-radius: 14px; overflow: hidden; z-index: 0; }
.ev-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); font-size: 2rem; line-height: 1; pointer-events: none; z-index: 500; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
/* R-0053: la mappa dell'evento si tocca e si apre a tutto schermo. */
.ev-preview.ev-open { cursor: pointer; }
/* R-0056: la mappa dell'evento a tutto schermo (tavola «Mappa dell'evento, variante (a)»). */
.evm { position: relative; background: #e5e3df; overflow: hidden; }
.evm-map { position: absolute; inset: 0; }
.evm-back { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; z-index: 1000; }
.evm-tools { position: absolute; right: 12px; bottom: 215px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.evm.open .evm-tools { top: max(14px, env(safe-area-inset-top)); bottom: auto; flex-direction: row; }
.evm-round { width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: #1B1F2A; box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 1.15rem; font-weight: 800; display: grid; place-items: center; padding: 0; }
.evm-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--wc-surface); color: var(--wc-text); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(20,23,43,.18); padding: 8px 0 max(14px, env(safe-area-inset-bottom)); }
.evm.open .evm-sheet { top: 30%; }
.evm-grip { flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--wc-border); margin: 0 auto 8px; cursor: pointer; }
.evm-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 16px; }
.evm-kind { font-size: .75rem; font-weight: 800; color: var(--wc-muted); }
.evm-title { font-size: 1.2rem; font-weight: 800; overflow-wrap: anywhere; }
.evm-when { font-weight: 700; }
.evm-place { font-size: .9rem; color: var(--wc-muted); overflow-wrap: anywhere; }
.evm-row { display: flex; gap: 6px; margin-top: 10px; }
.evm-btn { flex: 1; min-width: 0; border: 0; border-radius: 11px; padding: 9px 4px; font-size: .76rem; line-height: 1.2; font-weight: 800; background: rgba(var(--wc-accent-rgb), .12); color: var(--wc-accent); display: flex; align-items: center; justify-content: center; text-align: center; }
.evm-btn.primary { background: var(--wc-accent); color: var(--wc-accent-contrast); }
.evm-btn.dark { background: #1B1F2A; color: #fff; }
.evm-btn.wide { display: block; width: 100%; margin-top: 14px; padding: 11px; }
.evm-notes { margin-top: 10px; padding: 9px 12px; border-radius: 12px; background: var(--wc-surface-2); font-size: .88rem; overflow-wrap: anywhere; }
.evm-label { margin-top: 12px; font-size: .72rem; font-weight: 800; color: var(--wc-muted); text-transform: uppercase; letter-spacing: .04em; }
.evm-who { font-size: .88rem; line-height: 1.6; }
.evm-pin-label { font-family: var(--bs-body-font-family); position: absolute; left: 0; bottom: 40px; transform: translateX(-50%); background: #fff; color: #1B1F2A; border-radius: 10px; padding: 3px 9px; font-size: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.evm-pin-dot { position: absolute; left: 0; bottom: -4px; transform: translateX(-50%); font-size: 36px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.35)); }
#fwList .fw-send { position: sticky; bottom: .75rem; display: block; width: calc(100% - 2rem); margin: .75rem 1rem; }
/* Nel proprio fumetto (colore d accento) le righe del sondaggio sono trasparenti, col testo del fumetto. */
.msg.mine .poll-opt { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.45); color: inherit; }
.msg.mine .poll-opt.chosen { border-color: currentColor; }
.msg.mine .poll-fill { background: rgba(255,255,255,.26); }
.msg.mine .poll-check, .msg.mine .poll-who { color: inherit; }
.msg.mine .poll-kind, .msg.mine .poll-foot { color: inherit; opacity: .85; }
.msg.mine .poll-who { text-decoration: underline; }
.msg-location:hover { color: inherit; }
.map-preview { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; background: var(--wc-surface-2); }
.msg-location .msg-file { border-radius: 0; }

/* ---------- ricerca, nuovo messaggio ---------- */
.side-heading-row { align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.side-heading-row .side-heading { margin: 0; }
.side-heading-row .icon-btn, .offcanvas-header .new-msg-btn { background: var(--wc-accent); color: var(--wc-accent-contrast); box-shadow: none; }
.search-box { display: flex; align-items: center; gap: .5rem; background: var(--wc-surface-2); border-radius: 14px; padding: 0 .4rem 0 .8rem; margin-bottom: .6rem; color: var(--wc-muted); }
.search-box input { flex: 1; min-width: 0; border: 0; background: none; color: var(--wc-text); padding: .55rem 0; outline: none; font-size: .92rem; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-box:focus-within { box-shadow: 0 0 0 2px rgba(var(--wc-accent-rgb), .35); }
.search-clear { border: 0; background: none; color: var(--wc-muted); width: 2rem; height: 2rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
#searchResults { padding: 0 .5rem .75rem; }
#searchResults .side-title { padding-left: .6rem; }
#searchResults mark { background: rgba(var(--wc-accent-rgb), .22); color: inherit; padding: 0 .1em; border-radius: 4px; }

/* ---------- schede del pannello sul telefono: Chat, Utenti, Avvisi, Tu ---------- */
@media (max-width: 991.98px) {
  #sideLeft { display: flex; flex-direction: column; }
  #sideLeft .side-view { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 992px) {
  #viewChats { display: block !important; }
  #viewUsers, #viewBell, #viewMe, #viewCalls, #viewLocali { display: none !important; }
  /* Sul computer la scheda Chiamate (dal menu in alto) prende il posto dell'elenco delle conversazioni. */
  #sideLeft.calls-open #viewChats { display: none !important; }
  #sideLeft.calls-open #viewCalls { display: block !important; overflow-y: auto; }
}
.bottom-nav { display: flex; flex: 0 0 auto; border-top: 1px solid var(--wc-border); background: var(--wc-surface); padding: .3rem .25rem max(.3rem, var(--safe-area-inset-bottom, env(safe-area-inset-bottom))); }
.bottom-nav button { position: relative; flex: 1; border: 0; background: none; color: var(--wc-muted); display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .35rem 0; font-size: .7rem; font-weight: 700; border-radius: 12px; }
.bottom-nav button .wc-icon { width: 1.35rem; height: 1.35rem; }
.bottom-nav button.active { color: var(--wc-accent-text); }
.bottom-nav button.active .wc-icon { background: var(--wc-accent-soft); border-radius: 999px; padding: .15rem .9rem; width: auto; height: 1.65rem; box-sizing: content-box; }
.bottom-nav .avatar-xs { width: 1.5rem; height: 1.5rem; font-size: .65rem; }
.bottom-nav button.active .avatar-xs { box-shadow: 0 0 0 2px var(--wc-accent); }
.nav-badge { position: absolute; top: .1rem; left: 55%; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--wc-danger); color: #fff; font-size: .66rem; line-height: 1.15rem; text-align: center; }
.me-card { display: flex; align-items: center; gap: .8rem; padding: 1.2rem 1rem .4rem; }
.me-card .avatar { width: 3.5rem; height: 3.5rem; font-size: 1.4rem; }
.me-links { padding-top: .5rem; }
.me-links .conv-item { text-decoration: none; font-weight: 600; }
.me-links .conv-item .wc-icon { color: var(--wc-muted); }

/* ---------- gruppi ---------- */
.avatar.is-group { border-radius: 16px; }
.conv-muted { color: var(--wc-muted); display: inline-flex; flex: 0 0 auto; }
.conv-muted .wc-icon { width: .95em; height: .95em; }
.invite-item { align-items: flex-start; background: var(--wc-accent-soft); }
.invite-item:hover { background: var(--wc-accent-soft); }
.invite-actions { display: flex; gap: .4rem; margin-top: .45rem; }
.new-group-entry { margin: .5rem .5rem 0; width: calc(100% - 1rem); }
.new-group-entry .avatar { background: var(--wc-accent); color: var(--wc-accent-contrast); }
.chips-picked { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.chips-picked:empty { display: none; }
.chip-picked { display: inline-flex; align-items: center; gap: .3rem; border: 0; border-radius: 999px; background: var(--wc-accent-soft); color: var(--wc-accent-text); padding: .2rem .4rem .2rem .7rem; font-size: .82rem; font-weight: 700; }
.chip-picked .wc-icon { width: .9rem; height: .9rem; }
.conv-item.picked { background: var(--wc-accent-soft); }
.conv-item .check-mark { margin-left: auto; color: var(--wc-accent-text); }
.group-head { display: flex; align-items: center; gap: .9rem; margin-bottom: .9rem; }
.group-photo { width: 4rem; height: 4rem; font-size: 1.6rem; }
.member-row { cursor: default; }
.member-row:hover { background: none; }
.member-actions { display: flex; gap: .9rem; margin-top: .15rem; font-size: .82rem; }
.readby-group { padding: .6rem .9rem; border-bottom: 1px solid var(--wc-border); }
.readby-group:last-child { border-bottom: 0; }
.readby-group .side-title { padding: 0 0 .3rem; }

.conv-head { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 0; border-radius: 14px; }
.conv-head.clickable { cursor: pointer; }
.conv-head.clickable:hover .conv-title { text-decoration: underline; }
.conv-lock { display: inline-flex; color: var(--wc-muted); flex: 0 0 auto; }
.conv-lock .wc-icon { width: .95em; height: .95em; }
.conv-menu .dropdown-item { display: flex; align-items: center; gap: .6rem; }
.conv-menu .dropdown-item .wc-icon { color: var(--wc-muted); }
.filters .chip { padding: .35rem .6rem; }
@media (min-width: 992px) { .filters { flex-wrap: wrap; overflow: visible; } } /* computer: 5 schede su due righe invece di nasconderne una */

/* ---------- amicizie, segui, richieste ---------- */
.um-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: .35rem; }
.um-avatar { width: 5rem; height: 5rem; font-size: 2rem; }
.um-counts { display: flex; gap: 1rem; margin-top: .55rem; font-size: .8rem; color: var(--wc-muted); }
.um-counts strong { display: block; color: var(--wc-text); font-size: 1rem; }
.um-rel { font-size: .82rem; color: var(--wc-muted); background: var(--wc-surface-2); border-radius: 12px; padding: .55rem .7rem; margin: 0; }
.um-rel strong { color: var(--wc-text); }
.request-item { align-items: flex-start; }
.request-item .invite-actions { margin-top: .4rem; }
.rq-body { background: var(--wc-surface-2); border-left: 3px solid var(--wc-accent); border-radius: 10px; padding: .55rem .75rem; margin: 0 0 .75rem; white-space: pre-wrap; word-break: break-word; }
.rel-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-top: 1px solid var(--wc-border); background: var(--wc-accent-soft); color: var(--wc-text); font-size: .84rem; }
.rel-bar .rel-text { flex: 1; min-width: 0; }
.rel-bar.locked { background: var(--wc-surface-2); }
.dm-win .rel-bar { padding: .45rem .7rem; font-size: .8rem; }
.rel-tag { flex-shrink: 0; font-size: .7rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--wc-accent-soft); color: var(--wc-accent-text); }

/* Cronologia delle chiamate (11.6a): righe con esito, durata, qualità a tre tacche e "Richiama" (classi ch-*: call-* è della schermata di chiamata). */
.calls-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .9rem .3rem; }
.ch-row { display: flex; align-items: center; gap: .7rem; padding: .55rem .9rem; border: 0; background: transparent; width: 100%; text-align: left; color: var(--wc-text); }
.ch-row:hover { background: var(--wc-surface-2); }
.ch-row .ch-main { flex: 1; min-width: 0; }
.ch-row .ch-name { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row.missed .ch-name { color: var(--wc-danger); }
.ch-row .ch-info { display: flex; align-items: center; gap: .3rem; font-size: .76rem; color: var(--wc-muted); }
.ch-row .ch-info .wc-icon { width: .95rem; height: .95rem; }
.ch-row .ch-side { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; font-size: .72rem; color: var(--wc-muted); }
.ch-redial { border: 0; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--wc-accent-soft); color: var(--wc-accent-text); display: grid; place-items: center; flex: 0 0 auto; }
.ch-redial .wc-icon { width: 1.1rem; height: 1.1rem; }
.q-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.q-bars i { display: block; width: 3px; border-radius: 1px; background: var(--wc-border); }
.q-bars i:nth-child(1) { height: 5px; } .q-bars i:nth-child(2) { height: 8px; } .q-bars i:nth-child(3) { height: 12px; }
.q-bars.good i { background: var(--wc-online); }
.q-bars.fair i:nth-child(-n+2) { background: #d99a1e; }
.q-bars.poor i:nth-child(1) { background: var(--wc-danger); }

/* Indicatore della qualità durante la chiamata (11.6a, Q1-Q3): tre tacche in alto a sinistra, dettagli al tocco, avviso. */
.call-quality { position: absolute; left: max(1rem, var(--safe-area-inset-left, env(safe-area-inset-left))); top: max(1.4rem, var(--safe-area-inset-top, env(safe-area-inset-top))); z-index: 2; border: 0; border-radius: 999px; background: rgba(14, 16, 22, .6); padding: .5rem .65rem; display: grid; place-items: center; }
.call-quality .q-bars { height: 14px; gap: 3px; }
.call-quality .q-bars i { width: 4px; background: rgba(255, 255, 255, .28); }
.call-quality .q-bars i:nth-child(1) { height: 6px; } .call-quality .q-bars i:nth-child(2) { height: 10px; } .call-quality .q-bars i:nth-child(3) { height: 14px; }
.call-quality-info { position: absolute; left: max(1rem, var(--safe-area-inset-left, env(safe-area-inset-left))); top: calc(max(1.4rem, var(--safe-area-inset-top, env(safe-area-inset-top))) + 2.8rem); z-index: 2; background: rgba(14, 16, 22, .82); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; padding: .55rem .75rem; font-size: .78rem; line-height: 1.5; max-width: 70vw; white-space: pre-line; }
.call-warn { position: absolute; left: 50%; transform: translateX(-50%); top: calc(max(1.4rem, var(--safe-area-inset-top, env(safe-area-inset-top))) + 4.6rem); z-index: 2; background: #f5b43c; color: #2a1b00; border-radius: 14px; padding: .45rem .8rem; font-size: .8rem; font-weight: 700; text-align: center; max-width: 80vw; }

/* Chiamate di gruppo (11.6b): griglia di riquadri, chi parla evidenziato; sul telefono 4 riquadri visibili, gli altri scorrendo. */
.gc-banner { background: var(--wc-accent-soft); color: var(--wc-accent-text); font-weight: 700; }
.gc-view { position: fixed; inset: 0; z-index: 1070; background: #0E1016; color: #fff; display: flex; flex-direction: column; font-family: var(--wc-font); }
.gc-top { display: flex; align-items: center; gap: .75rem; padding: max(.8rem, var(--safe-area-inset-top, env(safe-area-inset-top))) 1rem .6rem; }
.gc-top .call-quality { position: static; }
.gc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.gc-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-title span { font-size: .78rem; opacity: .75; }
.gc-people-btn { width: 2.6rem; height: 2.6rem; }
.gc-qinfo { top: 4rem; }
.gc-warn { top: 4.4rem; }
.gc-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: .5rem; padding: .5rem .75rem 6.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-content: start; }
.gc-grid.n1 { grid-template-columns: 1fr; }
.gc-tile { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: #1a1e28; border: 3px solid transparent; }
.gc-tile.speaking { border-color: #4ade80; }
.gc-tile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.gc-tile.screen video { object-fit: contain; }
.gc-tile .gc-face { position: absolute; inset: 0; display: grid; place-items: center; }
.gc-tile .gc-face .avatar { width: 4.5rem; height: 4.5rem; font-size: 1.8rem; }
.gc-tile .gc-name { position: absolute; left: .5rem; bottom: .5rem; display: inline-flex; align-items: center; gap: .35rem; max-width: calc(100% - 1rem); padding: .2rem .55rem; border-radius: 999px; background: rgba(14, 16, 22, .7); font-size: .78rem; font-weight: 700; }
.gc-tile .gc-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-tile .gc-name .wc-icon { width: .9rem; height: .9rem; color: #f87171; }
.gc-people { position: absolute; right: .75rem; top: 4rem; z-index: 3; width: min(22rem, calc(100vw - 1.5rem)); max-height: calc(100% - 11rem); overflow-y: auto; background: rgba(20, 23, 31, .96); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: .6rem; }
.gc-person { display: flex; align-items: center; gap: .5rem; padding: .35rem .3rem; font-size: .85rem; }
.gc-person .gc-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-person button { border: 0; border-radius: 999px; padding: .2rem .6rem; font-size: .72rem; font-weight: 700; background: rgba(255, 255, 255, .12); color: #fff; }
.gc-person button.danger { background: rgba(217, 58, 63, .85); }
.gm-calls select:disabled { opacity: .75; }
@media (max-width: 991.98px) {
  .gc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: calc((100dvh - 12rem) / 2); }
  .gc-grid.n1 { grid-template-columns: 1fr; grid-auto-rows: calc(100dvh - 12rem); }
  .gc-grid.n2 { grid-template-columns: 1fr; grid-auto-rows: calc((100dvh - 12rem) / 2); }
  .gc-tile { aspect-ratio: auto; }
}
.um-reach { font-size: .82rem; color: var(--wc-text); margin-top: .1rem; }
.avatar .presence.away { background: #F08C1E; }
/* AD1: le finestre piccole crescono con lo schermo (Bootstrap da 576 pixel in su le fissa a 300) e le schede vanno a capo; AD1-bis: 440 al massimo */
@media (min-width: 576px) { .modal-sm { --bs-modal-width: min(440px, calc(100vw - 3.5rem)); } }
.modal .filters { flex-wrap: wrap; overflow: visible; }
/* Vocali (VOC a): tieni premuto, scorri per annullare, lucchetto, riascolto */
.attach-btn.mic { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform .15s ease, background-color .15s ease; }
.attach-btn.mic.holding { background: var(--wc-danger); color: #fff; transform: scale(1.2); }
.voice-slide { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voice-lock { position: fixed; z-index: 1080; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .55rem .5rem .45rem; border-radius: 999px; background: var(--wc-surface); color: var(--wc-muted); border: 1px solid var(--wc-border); box-shadow: var(--wc-shadow); pointer-events: none; }
.voice-lock .wc-icon { width: 1.1rem; height: 1.1rem; }
.voice-lock-up { width: .5rem; height: .5rem; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.voice-review audio { flex: 1; min-width: 0; height: 2.5rem; }
.attach-chip .btn .wc-icon { width: 1rem; height: 1rem; margin-right: .25rem; vertical-align: -.15em; }

/* Video in preparazione (PROGETTO 11.21, passo A, P-AS-1 e P-AS-2) */
.msg-video-wait { position: relative; display: block; width: 260px; max-width: 100%; min-height: 120px; overflow: hidden; border-radius: 12px; background: #1b1f2a; }
.msg-video-wait img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px) brightness(.7); display: block; }
.msg-video-wait .wait-label { position: absolute; inset: auto 0 0 0; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .5rem; color: #fff; font-size: .85rem; font-weight: 600; background: rgba(0, 0, 0, .45); }
.msg-video-wait.failed .wait-label { background: rgba(160, 30, 30, .8); }

/* Copertina dei video (PROGETTO 11.21, P-CP-1 e P-CP-2) */
.cover-panel { display: flex; gap: .75rem; align-items: center; padding: .5rem; margin-top: .5rem; border: 1px solid var(--bs-border-color); border-radius: 12px; }
.cover-img { width: 72px; height: 128px; object-fit: cover; border-radius: 8px; background: #1b1f2a; flex: none; }
.cover-ctrl { display: flex; flex-direction: column; gap: .35rem; min-width: 0; flex: 1; }
.cover-box { padding: 0 .5rem .5rem; }

/* Bond, l'assistente #MyBond: pulsanti sotto i messaggi, elenco dei comandi "/", firma dello staff. */
.bond-buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bond-buttons .btn { border-radius: 999px; }
.bond-staff { font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: 2px; }
.bond-cmds { max-height: 40vh; overflow-y: auto; border-top: 1px solid var(--bs-border-color); background: var(--bs-body-bg); }
.bond-cmd { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 14px; color: inherit; }
.bond-cmd:hover, .bond-cmd:focus { background: var(--bs-tertiary-bg); }
.bond-thread { max-height: 320px; overflow-y: auto; }

/* R-0003: contenuto forse sensibile secondo il filtro automatico (anche nel visore delle storie). */
.msg-sensitive { position: relative; display: inline-block; max-width: 100%; overflow: hidden; border-radius: 12px; vertical-align: top; }
.msg-sensitive > .msg-attach { margin: 0; filter: blur(26px); }
.msg-sensitive.shown > .msg-attach { filter: none; }
.sens-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; padding: .5rem; color: #fff; background: rgba(10, 11, 20, .45); font-size: .9rem; cursor: pointer; }
.sens-cover strong { font-weight: 700; }
.sens-cover span { font-size: .8rem; opacity: .9; }

/* R-0004: «Invita un amico». */
.inv-share { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.inv-share.no-more { grid-template-columns: repeat(2, 1fr); }
.inv-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 72px; border: 0; border-radius: 14px; background: var(--bs-tertiary-bg); color: inherit; font-weight: 700; font-size: .85rem; text-decoration: none; }
.inv-btn:hover, .inv-btn:focus-visible { color: inherit; filter: brightness(.96); }
.inv-wa { background: rgba(37, 211, 102, .16); }
.inv-sms { background: rgba(75, 85, 214, .14); }

/* R-0005: «Utenti»: Persone, scudo, riga «Sei visibile…», filtro «Tutti · Amici»; stato del legame in «Persone». */
.users-head { display: flex; align-items: center; gap: .5rem; padding: .75rem .75rem .25rem; }
.users-head strong { flex: 1; font-size: 1.05rem; }
.people-btn { display: inline-flex; align-items: center; gap: .35rem; height: 36px; padding: 0 .8rem; border: 0; border-radius: 18px; background: rgba(75, 85, 214, .12); color: inherit; font-weight: 700; font-size: .85rem; }
.people-shield { width: 36px; height: 36px; border-radius: 18px; background: rgba(75, 85, 214, .12); }
.vis-row { display: flex; align-items: center; gap: .45rem; width: calc(100% - 1.5rem); margin: .25rem .75rem .5rem; padding: .45rem .7rem; border: 0; border-radius: 10px; background: rgba(31, 164, 99, .13); color: inherit; font-size: .8rem; text-align: left; }
.vis-row[data-vis="friends"] { background: rgba(229, 160, 40, .18); }
.vis-row[data-vis="none"] { background: rgba(140, 145, 160, .2); }
.vis-row .vis-text { flex: 1; }
.vis-row .vis-change { font-weight: 700; text-decoration: underline; }
.users-filter { padding: 0 .75rem .25rem; }
.rel-tag { flex: none; font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 10px; white-space: nowrap; background: var(--bs-tertiary-bg); }
.rel-friends { background: rgba(31, 164, 99, .16); }
.rel-mutual { background: rgba(75, 85, 214, .16); }
.rel-follower { background: rgba(229, 160, 40, .2); }
.fr-select { font-weight: 700; }

/* R-0006: «Chi della tua rubrica è già su #MyBond?» */
.rb-card { margin: .5rem .75rem .75rem; padding: .85rem; border-radius: 16px; background: rgba(75, 85, 214, .1); }
.rb-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.rb-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 18px; background: #4B55D6; color: #fff; }
.rb-promises { padding-left: 1.1rem; font-size: .88rem; }
.rb-promises li { margin-bottom: .45rem; }
.rb-ini { display: inline-grid; place-items: center; font-weight: 800; background: var(--bs-tertiary-bg); }

/* R-0009: messaggi eliminati senza traccia (impostazione del pannello): quello eliminato dall'autore non si mostra. */
/* R-0024 (11.40 B): si nascondono solo i messaggi che il server ha segnato «senza traccia». */
.msg.deleted-vanish { display: none; }
/* R-0024: MyBond+ come elenco, nello stile della pagina delle icone */
.plus-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 16px; background: var(--wc-surface-2); color: inherit; border: 0; }
.plus-row img, .plus-ico { flex: none; width: 56px; height: 56px; border-radius: 50%; }
.plus-ico { display: grid; place-items: center; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: 24px; }
.plus-ico .wc-icon { width: 26px; height: 26px; }
.plus-text { flex: 1; min-width: 0; margin: 0; cursor: inherit; }
.plus-text > strong, .plus-text > span { display: block; }
.plus-text > strong { font-weight: 800; }
.plus-text > span { font-size: 13px; opacity: .75; }
.plus-go { font-size: 1.4rem; opacity: .6; }
.plus-row .form-switch .form-check-input { width: 2.6em; height: 1.4em; margin: 0; }
.plus-soon { background: transparent; border: 1.5px dashed var(--wc-border); opacity: .65; }
.plus-soon .plus-ico { background: var(--wc-surface-2); }
/* R-0049 (B1.1): le schede di MyBond+, su una riga anche nella finestra (le altre .filters lì vanno a capo). */
.modal .filters.plus-tabs { flex-wrap: nowrap; overflow-x: auto; margin-bottom: .75rem; }
.plus-tabs .plus-new { font-size: .62rem; vertical-align: 1px; }
.plus-tabs .chip.active .plus-new { background: var(--wc-accent-contrast) !important; color: var(--wc-accent) !important; }
#plusList { min-height: min(40rem, 80vh); } /* la finestra non cambia altezza passando da una scheda all altra */
.plus-later { flex: none; font-size: .72rem; font-weight: 700; color: var(--wc-muted); }
.plus-soon-title { margin: 1rem .25rem .5rem; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--wc-muted); }

/* R-0011 (PROGETTO 11.37): la tendina del menu in alto scorre se è lunga (I7); sul telefono lo stesso elenco sta dentro
   la scheda «Tu», come una lista (I1); «Apri i privati in automatico» riguarda solo il computer. */
.me-menu { max-height: calc(100vh - 5rem); overflow-y: auto; }
.me-menu.me-menu-flat { display: block; position: static !important; inset: auto !important; transform: none !important; max-height: none; overflow: visible; min-width: 0; width: 100%; margin: 0; padding: .25rem 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.me-menu.me-menu-flat .dropdown-item { padding: .7rem 1rem; white-space: normal; }
.me-menu.me-menu-flat #meRole { display: none; }
@media (max-width: 991.98px) { #autoOpenItem { display: none !important; } }

/* R-0013 (PROGETTO 11.37): «+» sull'icona di «Crea un nuovo gruppo» (I3) e nome salvato del nuovo gruppo (I4). */
.new-group-entry .avatar { position: relative; overflow: visible; }
.ng-plus { position: absolute; right: -.2rem; bottom: -.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; display: grid; place-items: center; background: var(--wc-surface); color: var(--wc-accent); box-shadow: 0 0 0 2px var(--wc-accent); }
.ng-plus .wc-icon { width: .75rem; height: .75rem; }
.ng-saved { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 14px; background: var(--wc-surface-2); }
.ng-saved .avatar { flex: 0 0 auto; }

/* R-0014 (PROGETTO 11.37, I6): righe della rubrica con il nome del contatto in grande e due pulsanti. */
.rb-found { align-items: center; }
.rb-open { display: flex; align-items: center; gap: .6rem; flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.rb-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; flex: 0 0 auto; }
.rb-from { display: block; margin-top: .2rem; }

/* R-0016 (PROGETTO 11.37): «Invita su WhatsApp» in cima ai non iscritti e titoletto delle email orfane. */
.rb-wa { display: flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 12px; background: rgba(37, 211, 102, .16); color: inherit; font-weight: 700; }
.rb-wa:hover, .rb-wa:focus-visible { color: inherit; filter: brightness(.96); }
.rb-wa .wc-icon { width: 1.1rem; height: 1.1rem; }
/* R-0068: «Invita con altre app» in cima; «Invita» apre sotto la riga i tasti delle app possibili */
.rb-share { display: flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 12px; background: rgba(75, 85, 214, .12); color: inherit; font-weight: 700; }
.rb-share:hover, .rb-share:focus-visible { color: inherit; filter: brightness(.96); }
.rb-share .wc-icon { width: 1.1rem; height: 1.1rem; }
.rb-apps { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 .5rem .6rem 3.25rem; }
.rb-app { border: 0; border-radius: 999px; padding: .25rem .75rem; background: var(--bs-tertiary-bg); color: inherit; font-weight: 600; }
.rb-app:hover, .rb-app:focus-visible { color: inherit; filter: brightness(.95); }
.rb-app-wa { background: rgba(37, 211, 102, .16); }
.rb-sub { margin: .6rem 0 .2rem; font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--bs-secondary-color); }

/* R-0019 (PROGETTO 11.38): scheda «Notifiche dell’app». */
.an-state { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 16px; background: rgba(31, 157, 90, .14); }
.an-state.off { background: rgba(217, 58, 63, .14); }
.an-dot { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: #1F9D5A; }
.an-state.off .an-dot { background: #D93A3F; }
.an-list { margin-top: .75rem; border-radius: 16px; overflow: hidden; background: var(--wc-surface-2); }
.an-row { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .85rem 1rem; border: 0; background: transparent; color: inherit; text-align: left; }
.an-row + .an-row { border-top: 1px solid var(--wc-border); }

/* R-0020 (PROGETTO 11.38): pallino su «Tu» quando nel menu c’è qualcosa di nuovo. */
.bottom-nav button.has-new::after { content: ""; position: absolute; top: .3rem; left: calc(50% + .55rem); width: .55rem; height: .55rem; border-radius: 50%; background: var(--wc-accent); box-shadow: 0 0 0 2px var(--wc-surface); }

/* R-0025 (11.40 C): Info della chat del privato (js/dm-info.js), come la tavola «Info della chat privata» */
.conv-head.clickable { cursor: pointer; }
.dm-info { --bs-offcanvas-width: 360px; background: var(--wc-bg); color: var(--wc-text); }
@media (max-width: 991.98px) { .dm-info { --bs-offcanvas-width: 100%; } }
.dmi-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px; }
.dmi-title { flex: 1; margin: 0; font-size: 1rem; font-weight: 800; text-align: center; }
@media (min-width: 992px) { .dmi-title { text-align: left; } .dmi-head > .icon-btn.d-lg-none + .dmi-title { padding-left: 6px; } }
.dmi-body { flex: 1; overflow-y: auto; padding: 4px 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.dmi-who { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 2px; }
.avatar.dmi-avatar { width: 4.5rem; height: 4.5rem; font-size: 1.6rem; }
.dmi-name { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 1.3rem; font-weight: 800; overflow-wrap: anywhere; text-align: center; }
.dmi-status { min-height: 1.1em; font-size: .8rem; color: var(--wc-muted); }
.dmi-actions { display: flex; gap: 8px; }
.dmi-action { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 0; border-radius: 16px; background: var(--wc-surface); color: var(--wc-text); font-size: .8rem; font-weight: 600; }
.dmi-action .wc-icon { width: 22px; height: 22px; color: var(--wc-accent); }
.dmi-block { background: var(--wc-surface); border-radius: 16px; overflow: hidden; flex-shrink: 0; } /* R-0051: i riquadri non si schiacciano quando le righe non stanno nello schermo */
.dmi-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: none; color: inherit; text-align: left; font-size: .92rem; }
.dmi-row + .dmi-row { border-top: 1px solid var(--wc-border); }
.dmi-row:hover { background: var(--wc-surface-2); }
.dmi-row > .wc-icon { flex: none; width: 20px; height: 20px; opacity: .85; }
.dmi-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dmi-value, .dmi-chev { flex: none; color: var(--wc-muted); font-size: .85rem; }
.dmi-accent { color: var(--wc-accent); }
.dmi-accent .dmi-label { font-weight: 700; }
.dmi-danger { color: var(--wc-danger); }
.dmi-hit small { display: block; color: var(--wc-muted); font-size: .75rem; }
.dmi-empty { margin: 0; padding: 12px 4px; color: var(--wc-muted); font-size: .9rem; }

/* R-0026 (11.40 D): pagina dei file in Info della chat (js/dm-info.js) */
.dmf-head { gap: 6px; }
.dmf-tabs { flex: 1; display: flex; background: var(--wc-surface-2); border-radius: 999px; padding: 3px; }
.dmf-tabs button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 5px 0; font-size: .82rem; font-weight: 700; color: var(--wc-muted); }
.dmf-tabs button.on { background: var(--wc-surface); color: var(--wc-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.dmf-sel { flex: none; padding: 0 4px; font-weight: 700; text-decoration: none; }
.dmf-month { padding: 4px 2px 0; font-size: .75rem; font-weight: 700; color: var(--wc-muted); }
.dmf-group.dmf-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; border-radius: 12px; overflow: hidden; }
.dmf-tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: var(--wc-surface-2); overflow: hidden; }
.dmf-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dmf-tile.blur img { filter: blur(14px); }
.dmf-tile.picked img { opacity: .75; }
.dmf-dur { position: absolute; left: 6px; bottom: 5px; color: #fff; font-size: .7rem; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.dmf-check { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); color: #fff; display: grid; place-items: center; }
.picked .dmf-check { background: var(--wc-accent); }
.dmf-check .wc-icon { width: 14px; height: 14px; }
.dmf-group.dmf-doc, .dmf-group.dmf-link { display: flex; flex-direction: column; gap: 8px; }
.dmf-doc { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: var(--wc-surface); color: inherit; text-align: left; }
.dmf-doc .dmf-check { position: static; flex: none; border-color: var(--wc-border); }
.dmf-doc small, .dmf-link small { color: var(--wc-muted); font-size: .75rem; }
.dmf-ext { flex: none; width: 40px; height: 48px; border-radius: 6px; background: var(--wc-surface-2); border: 1px solid var(--wc-border); display: grid; place-items: center; font-size: .62rem; font-weight: 800; color: var(--wc-danger); }
.dmf-link { background: var(--wc-surface); border: 1px solid var(--wc-border); border-radius: 14px; overflow: hidden; }
.dmf-link-main { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; color: inherit; text-decoration: none; }
.dmf-link-ico { flex: none; width: 44px; height: 44px; border-radius: 10px; background: var(--wc-accent-soft); color: var(--wc-accent); display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; }
.dmf-go { display: flex; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-top: 1px solid var(--wc-border); background: none; color: var(--wc-accent); font-size: .8rem; font-weight: 700; }
.dmf-go span:first-child { flex: 1; text-align: left; }
.dmf-bar { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); background: var(--wc-surface); border-top: 1px solid var(--wc-border); text-align: center; }
.dmf-bar-btns { display: flex; gap: 8px; }
.dmf-bar small { color: var(--wc-muted); font-size: .72rem; }
.dmi-action:disabled { opacity: .45; }
.dmi-action.dmi-danger, .dmi-action.dmi-danger .wc-icon { color: var(--wc-danger); }

/* R-0026: visore delle foto e dei video (js/viewer.js), come la tavola «Foto, video e file della chat» (5) */
body.mbv-open { overflow: hidden; }
.mbv { position: fixed; inset: 0; z-index: 1090; display: flex; flex-direction: column; background: #0B0D16; color: #fff; outline: 0; }
.mbv-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.mbv-btn { flex: none; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; }
.mbv-who { flex: 1; min-width: 0; text-align: center; line-height: 1.25; }
.mbv-who strong, .mbv-who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbv-who span { font-size: .75rem; opacity: .75; }
.mbv-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 0; }
.mbv-media { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.mbv-sensitive { position: relative; display: flex; max-width: 100%; max-height: 100%; overflow: hidden; }
.mbv-sensitive .mbv-media { filter: blur(28px); }
.mbv-sensitive.shown .mbv-media { filter: none; }
.mbv-sensitive .sens-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: rgba(0,0,0,.35); color: #fff; }
.mbv-nav { position: absolute; top: 50%; z-index: 1; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff; font-size: 1.8rem; line-height: 1; transform: translateY(-50%); }
.mbv-nav.prev { left: 10px; }
.mbv-nav.next { right: 10px; }
.mbv-caption { max-height: 5.5em; overflow-y: auto; padding: 6px 16px; font-size: .95rem; overflow-wrap: anywhere; }
.mbv-strip { display: flex; gap: 2px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; }
.mbv-thumb { flex: none; width: 40px; height: 40px; padding: 0; border: 0; background: #222; opacity: .7; }
.mbv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mbv-thumb.on { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }
.mbv-actions { display: flex; justify-content: space-around; padding: 8px 6px calc(12px + env(safe-area-inset-bottom)); }
.mbv-act { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 4px; border: 0; background: none; color: #fff; font-size: .72rem; }
.mbv-act .wc-icon { width: 22px; height: 22px; }
.mbv-act.danger { color: #FF6B6F; }
.mbv-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px; max-width: 520px; margin: 0 auto; padding: 14px 12px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: #1B1F33; }
.mbv-sheet-head { display: flex; align-items: center; gap: 8px; }
.mbv-sheet-head strong { flex: 1; text-align: center; font-size: .9rem; }
.mbv-sheet-top { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.mbv-sheet-top .mbv-act { padding: 9px 2px; border-radius: 14px; background: #2A2F48; font-size: .78rem; font-weight: 700; }
.mbv-sheet-rows { overflow: hidden; border-radius: 14px; background: #2A2F48; }
.mbv-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; background: none; color: #fff; font-size: .9rem; text-align: left; }

/* R-0028 (11.40): galleria personale. Nella chat: anteprima da scaricare e «Media non disponibile» */
.msg-dl { position: relative; display: grid; place-items: center; min-width: 180px; min-height: 120px; max-width: 100%; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--wc-surface-2); color: #fff; }
.msg-dl img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(6px) saturate(.8); transform: scale(1.05); }
.msg-dl .dl-ico { position: relative; width: 52px; height: 52px; border-radius: 50%; background: rgba(20,23,43,.55); display: grid; place-items: center; }
.msg-dl .dl-ico .wc-icon { width: 24px; height: 24px; }
.msg-dl .dl-meta { position: absolute; left: 8px; bottom: 7px; padding: 2px 7px; border-radius: 8px; background: rgba(20,23,43,.55); font-size: .72rem; font-weight: 800; }
.msg-gone { display: flex; align-items: center; gap: 10px; }
/* «Spazio e dati» (js/spazio-dati.js), come la tavola «Galleria personale» */
#dataModal .modal-content { overflow: hidden; }
.sd-title { margin: 4px 4px 6px; font-size: 12px; font-weight: 800; color: var(--wc-muted); text-transform: uppercase; letter-spacing: .04em; }
.sd-block { margin-bottom: 10px; overflow: hidden; border-radius: 16px; background: var(--wc-surface-2); }
.sd-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; border: 0; background: none; color: inherit; text-align: left; }
.sd-row + .sd-row { border-top: 1px solid var(--wc-border); }
.sd-ico { flex: none; font-size: 18px; }
.sd-text { flex: 1; min-width: 0; }
.sd-text > strong, .sd-text > span { display: block; }
.sd-text > strong { font-weight: 600; }
.sd-text > span { font-size: 12.5px; color: var(--wc-muted); }
.sd-value, .sd-chev { flex: none; font-size: 13px; color: var(--wc-muted); }
.sd-bar { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: var(--wc-border); }
.sd-bar span { display: block; height: 100%; background: var(--wc-accent); }
.sd-note { margin: 0 4px 12px; font-size: 12.5px; line-height: 1.45; color: var(--wc-muted); }
.sd-plus { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: #EDE9FE; color: #4C1D95; font-size: 12.5px; line-height: 1.45; }
:root[data-theme="notte"] .sd-plus { background: #2E2A55; color: #C4B5FD; }
.sd-plus-name { color: #6D28D9; }
.sd-sheet-wrap { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; background: rgba(20,23,43,.45); }
.sd-sheet { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 18px 16px 22px; border-radius: 24px 24px 0 0; background: var(--wc-surface); }
.sd-sheet-title { margin-bottom: 6px; text-align: center; font-size: 16px; }
.sd-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 14px; background: none; color: inherit; text-align: left; }
.sd-opt.on { background: var(--wc-accent-soft); }
.sd-radio { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--wc-border); background: var(--wc-surface); }
.sd-opt.on .sd-radio { border: 6px solid var(--wc-accent); }
.sd-opt.on .sd-text > strong { font-weight: 700; }
/* menu «⋯» del visore: le voci che arriveranno (decisione 1a) */
.mbv-soon { cursor: default; opacity: .6; }
.mbv-soon > span:nth-child(2) { flex: 1; }
.mbv-tag { flex: none; padding: 2px 7px; border-radius: 8px; background: #9A4A07; color: #FFE7CC; font-size: 10px; font-weight: 800; }
.mbv-tag.plus { background: #2E2A55; color: #C4B5FD; }

/* R-0029 (11.40 E): «Svuota la chat» in Info della chat */
.dmi-check { margin: 2px 4px; }

/* R-0030: MyBond+ in risalto (viola e scintilla gialla dell'app), «Premium», giorni che restano della galleria */
.mb-plus { color: #6D28D9; font-weight: 700; }
:root[data-theme="notte"] .mb-plus { color: #A78BFA; }
.mb-spark { display: inline-flex; vertical-align: -2px; }
.mb-spark .wc-icon { fill: #F5B301; stroke: #D99A00; }
.plus-premium { flex: none; padding: 2px 8px; border-radius: 8px; background: #EDE9FE; color: #6D28D9; font-size: 11px; font-weight: 800; }
:root[data-theme="notte"] .plus-premium { background: #2E2A55; color: #C4B5FD; }
.sd-lost { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--wc-surface-2); border: 1.5px solid #F5B301; }
.sd-lost-days { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #FEF3C7; color: #92400E; line-height: 1.1; }
.sd-lost-days strong { font-size: 20px; }
.sd-lost-days span { font-size: 10px; }

/* R-0033 (blocco B, tavola «Tu» riordinato): in alto foto, nome e raggiungibilità, QR e matita; poi blocchi con il titolo */
.me-hero { display: flex; align-items: center; gap: .7rem; padding: .5rem .75rem .6rem; }
.me-hero .avatar { flex: none; width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
.me-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-hero-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-reach { font-size: .78rem; color: var(--wc-muted); }
.me-reach:empty { display: none; }
.me-tools { display: flex; gap: .35rem; align-self: flex-start; }
.me-tools .icon-btn { width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--wc-surface-2); display: inline-grid; place-items: center; color: var(--wc-text); text-decoration: none; }
.me-tools .nuovo-badge { position: absolute; transform: translate(.9rem, -1rem); font-size: .6rem; }
.me-block > ul { list-style: none; margin: 0; padding: 0; }
.me-sec { margin: .55rem .9rem .2rem; font-size: .68rem; font-weight: 800; color: var(--wc-muted); text-transform: uppercase; letter-spacing: .04em; }
.me-soon { opacity: .55; cursor: default; }
.me-presto { margin-left: auto; padding: .05rem .45rem; border-radius: 8px; background: var(--wc-border); color: var(--wc-muted); font-size: .65rem; font-weight: 800; }
/* Sul telefono («Tu» a tutta pagina): foto grande al centro, i blocchi come schede bianche */
.me-menu.me-menu-flat .me-hero { flex-direction: column; text-align: center; position: relative; padding: 1.2rem 1rem .4rem; }
.me-menu.me-menu-flat .me-hero .avatar { width: 4.6rem; height: 4.6rem; font-size: 1.8rem; }
.me-menu.me-menu-flat .me-hero-name { font-size: 1.15rem; }
.me-menu.me-menu-flat .me-hero #meRole { display: block; }
.me-menu.me-menu-flat .me-tools { position: absolute; top: .6rem; right: .8rem; }
.me-menu.me-menu-flat .me-block { margin: .2rem .8rem .5rem; }
.me-menu.me-menu-flat .me-block > ul { overflow: hidden; border-radius: 16px; background: var(--wc-surface); }
.me-menu.me-menu-flat .me-block > ul > li + li:not(.d-none) .dropdown-item { border-top: 1px solid var(--wc-border); }
.me-menu.me-menu-flat .me-sec { margin: .3rem .3rem .3rem; }
/* Le pagine di «Tu» (Privacy, Notifiche, #MyBond Web, Aiuto) usano le righe di Spazio e dati */
#tuModal .sd-row .wc-icon { width: 20px; height: 20px; color: var(--wc-muted); }
#tuModal .sd-row .form-switch .form-check-input { width: 2.6em; height: 1.4em; margin: 0; }
#tuModal a.sd-row { text-decoration: none; }
.sd-pad { padding: 12px 14px; }
/* «Il mio codice»: il QR resta nero su bianco anche col tema scuro, con Bond al centro */
.tu-qr-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; border-radius: 22px; background: var(--wc-surface-2); }
.tu-qr-who { display: flex; align-items: center; gap: 10px; }
.tu-qr-who .avatar { width: 2.8rem; height: 2.8rem; }
.tu-qr-box { position: relative; width: 252px; height: 252px; padding: 6px; border-radius: 16px; background: #fff; }
.tu-qr-box #qrImg { width: 240px; height: 240px; display: block; }
.tu-qr-bond { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 5px #fff; }
.tu-qr-text { margin: 0; text-align: center; font-size: 13px; line-height: 1.45; color: var(--wc-muted); }

/* R-0033 (tavola «Spazio dei 100 GB»): barra a colori per tipo (colori controllati per chi distingue male i colori;
   accanto a ogni colore sempre il nome e il numero) */
.k-image { --k: #2a78d6; }
.k-video { --k: #eb6834; }
.k-file { --k: #1baf7a; }
.k-audio { --k: #8e44ad; } /* R-0206 (P2): i vocali */
.k-free { --k: var(--wc-border); }
:root[data-theme="notte"] .k-image { --k: #3987e5; }
:root[data-theme="notte"] .k-video { --k: #d95926; }
:root[data-theme="notte"] .k-file { --k: #199e70; }
:root[data-theme="notte"] .k-audio { --k: #a463c2; }
.sd-cbar { display: flex; gap: 2px; height: 8px; margin-top: 7px; overflow: hidden; border-radius: 4px; }
.sd-cbar.big { height: 16px; border-radius: 8px; margin-top: 10px; }
.sd-seg { display: block; height: 100%; background: var(--k); border-radius: 3px; }
.sd-seg.k-free { flex: 1; }
.sd-legend { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 7px; font-size: 11.5px; color: var(--wc-muted); }
.sd-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.sd-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.sd-dot.big { width: 14px; height: 14px; }
.sd-strong { font-weight: 700; color: var(--wc-text); }
.sd-total { margin-bottom: 12px; padding: 16px; border-radius: 18px; background: var(--wc-surface-2); }
.sd-total-n { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.sd-total-of { color: var(--wc-muted); }
#dataTitle { display: flex; align-items: center; }
/* La tua galleria: il filtro del tipo toccato */
.dmf-chip-row { padding: 8px 12px; }
.dmf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--wc-surface-2); color: inherit; font-size: 13px; font-weight: 700; }
.dmf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--k); }
.dmf-chip-x { color: var(--wc-muted); }
#viewMe:has(.me-menu-flat) { background: var(--wc-bg); } /* R-0033: sul telefono le schede bianche su fondo grigio, come la tavola */
.sd-text > .sd-cbar { display: flex; } /* R-0033: la regola di .sd-text > span non deve schiacciare barra e legenda */
.sd-text > .sd-legend { display: flex; font-size: 11.5px; }
.me-menu.me-menu-flat > li > #logout { margin: .2rem .8rem .8rem; width: auto; border-radius: 16px; background: var(--wc-surface); } /* Esci nella sua scheda, come la tavola */
.me-menu.me-menu-flat > li > .dropdown-divider { display: none; }
.sd-text > .sd-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; } /* R-0033 */
.sd-headline > strong { font-weight: 600; font-size: 1rem; }

/* R-0036 (blocco C): Bond nel logo in alto; la pagina «Tema dell'app» (anteprime con i colori veri dei temi) */
.brand-mark.brand-bond { background: none; overflow: hidden; border-radius: 50%; }
.brand-mark.brand-bond img { display: block; width: 100%; height: 100%; }
.th-ico { background: linear-gradient(135deg, #E8EAFD 50%, #1E2350 50%) !important; }
.th-card { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: 12px; border: 2px solid var(--wc-border); border-radius: 18px; background: var(--wc-surface); color: inherit; text-align: left; }
.th-card.on { border-color: var(--wc-accent); }
.th-head { display: flex; align-items: center; gap: 10px; }
.th-check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 2px solid var(--wc-border); border-radius: 50%; color: #fff; font-size: 13px; font-weight: 800; }
.th-card.on .th-check { background: var(--wc-accent); border-color: var(--wc-accent); }
.th-name { flex: 1; min-width: 0; }
.th-name strong, .th-name span { display: block; }
.th-name span { font-size: 12px; color: var(--wc-muted); }
.th-tag { flex: none; padding: 2px 8px; border-radius: 8px; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: 11px; font-weight: 800; }
.th-prevs { display: flex; gap: 8px; }
.th-prev { flex: 1; display: flex; flex-direction: column; gap: 5px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--wc-muted); }
.th-box { display: flex; flex-direction: column; gap: 6px; height: 84px; padding: 9px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 12px; background: var(--b); }
.th-box i { display: block; height: 14px; border-radius: 7px; }
.th-box .in { width: 72%; background: var(--in); }
.th-box .out { align-self: flex-end; width: 58%; background: var(--out); }
.th-aurora-d { --b: #EEF1F8; --in: #FFFFFF; --out: #4B55D6; }
.th-salvia-d { --b: #E4ECE6; --in: #FFFFFF; --out: #D3EBDD; }
.th-aurora-n { --b: #0E1016; --in: #1A1E29; --out: #5560E6; }
.th-salvia-n { --b: #0E1016; --in: #1A1E29; --out: #1D7F5E; }
.th-viola-n { --b: #0E1016; --in: #1A1E29; --out: #6D5CE8; }
.plus-tile { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 2px solid var(--wc-border); border-radius: 16px; background: transparent; color: inherit; text-align: left; } /* R-0036: le icone da scegliere */
.plus-tile.on { border-color: var(--wc-accent); background: var(--wc-accent-soft); }
.plus-tile img { flex: none; border-radius: 50%; }

/* R-0037 (blocco D, tavola «Elimina più messaggi insieme»): selezione dei propri messaggi nei privati e nei gruppi. */
.chat-header { position: relative; }
.chat-header .sel-top { display: none; position: absolute; inset: 0; z-index: 4; align-items: center; gap: .6rem; padding: .3rem .6rem; background: var(--wc-surface); }
.chat-main.sel-own .chat-header .sel-top { display: flex; }
.sel-top-count { font-size: 1.05rem; }
.selecting.sel-own .msg:not(.mine) { opacity: .45; cursor: default; }
.selecting.sel-own .msg:not(.mine)::before { content: none; }
.sel-own-bar { padding: .6rem .9rem calc(.6rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--wc-border); background: var(--wc-surface); }
.sel-own-note { font-size: .8rem; color: var(--wc-muted, #5B6478); text-align: center; margin-bottom: .45rem; }
.chat-main.sel-own #composer, .chat-main.sel-own #replyBar, .chat-main.sel-own #attachPreview, .chat-main.sel-own #typingLine { display: none !important; }
.msg-menu .mb-spark { margin-left: .15rem; }
/* R-0037: come la tavola, il cerchio sul bordo sinistro (anche per i propri messaggi), la ✓ e la fascia sulla riga scelta. */
.selecting.sel-own .msg { margin-inline: -.5rem; padding: .2rem .5rem; border-radius: 12px; }
.selecting.sel-own .msg.mine::before { order: 1; margin-right: auto; margin-left: 0; display: grid; place-items: center; width: 24px; height: 24px; font-size: 13px; font-weight: 800; color: #fff; }
.selecting.sel-own .msg.mine.selected { background: var(--wc-accent-soft); }
.selecting.sel-own .msg.mine.selected::before { content: '✓'; box-shadow: none; }
.selecting.sel-own .msg.selected .msg-bubble { outline: none; }

/* R-0039 (blocco E, tavola «Bondini»): ricerca, chips e caricamento a pezzi. */
.bondini-search { display: flex; align-items: center; gap: .5rem; margin: .25rem .75rem .35rem; padding: .45rem .75rem; border-radius: 12px; background: var(--wc-surface-2); color: var(--wc-muted); }
.bondini-search .wc-icon { width: 1rem; height: 1rem; flex: none; }
.bondini-q { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--wc-text); font-size: .9rem; outline: none; }
.bondini-q::-webkit-search-cancel-button { cursor: pointer; }
.bondini-more { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; padding: .7rem; border: 0; background: transparent; font-size: .8rem; color: var(--wc-muted); }
.bondini-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--wc-border); border-top-color: var(--wc-accent); animation: bondini-spin .9s linear infinite; }
@keyframes bondini-spin { to { transform: rotate(360deg); } }

/* R-0042: «Bozza: …» nell'elenco delle conversazioni. */
.conv-draft .pv-draft { color: var(--wc-accent); font-weight: 700; }

/* ---------- Attività, i locali (R-0060, tavole «Barra e scheda» e «Locali») ---------- */
.act-page { padding: .2rem 0 1rem; }
.act-head { display: flex; align-items: center; gap: .4rem; padding: .6rem .9rem .3rem; min-height: 2.6rem; }
.act-title { font-size: 1.05rem; }
.act-sec { padding: .6rem 1rem .3rem; font-size: .72rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--wc-muted); }
.act-where { padding: 0 1rem; }
.act-note { padding: .3rem 1rem; margin: 0; font-size: .78rem; color: var(--wc-muted); }
.act-city { padding: .3rem 1rem; }
.act-sugg { display: flex; flex-direction: column; }
.act-sugg-main { display: block; font-weight: 600; } /* R-0099: «Indirizzo», via e numero sopra, comune sotto */
.act-sugg-item small { display: block; color: var(--wc-muted); font-size: .8rem; }
.act-sugg-item { border: 0; border-bottom: 1px solid var(--wc-border); background: none; color: var(--wc-text); text-align: left; padding: .55rem .3rem; }
.act-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; padding: 0 1rem; }
.act-cat { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .15rem; border: 0; border-radius: 14px; background: var(--wc-bg); color: var(--wc-text); font-size: .7rem; font-weight: 700; line-height: 1.2; text-align: center; }
.act-cat-emoji { font-size: 1.4rem; }
.act-item { display: flex; align-items: center; gap: .7rem; width: 100%; border: 0; background: none; text-align: left; }
.act-item-emoji, .act-card-emoji { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--wc-accent-soft); }
.act-item-emoji { width: 2.4rem; height: 2.4rem; font-size: 1.2rem; }
.act-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.act-item-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-item-line { font-size: .78rem; color: var(--wc-muted); }
.act-chev { color: var(--wc-muted); }
.act-find { padding: 0 1rem .4rem; }
.act-osm { margin: .8rem 0 0; text-align: center; font-size: .7rem; color: var(--wc-muted); }
.act-card-top { display: flex; gap: .8rem; padding: .2rem 1rem .6rem; }
.act-card-emoji { width: 3rem; height: 3rem; border-radius: 14px; font-size: 1.5rem; }
.act-card-name { margin: 0; font-size: 1.15rem; font-weight: 800; }
.act-card-sub { font-size: .8rem; color: var(--wc-muted); }
.act-card-open { font-size: .8rem; font-weight: 700; color: var(--wc-muted); }
.act-card-open.is-open { color: var(--wc-online); }
.act-box { margin: 0 1rem .5rem; padding: .6rem .75rem; border-radius: 14px; background: var(--wc-bg); font-size: .85rem; }
.act-box-title { margin-bottom: .2rem; font-size: .72rem; font-weight: 800; color: var(--wc-muted); }
.act-btns { display: flex; gap: .4rem; margin: 0 1rem .5rem; }
.act-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: .55rem .2rem; border: 0; border-radius: 12px; background: var(--wc-bg); color: var(--wc-text); font-size: .75rem; font-weight: 700; text-decoration: none; }
.act-ask { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin: 0 1rem .5rem; padding: .5rem .65rem; border-radius: 14px; background: rgba(255, 176, 0, .16); font-size: .82rem; }
.act-ask strong { flex: 1 1 auto; }
.act-pill { border: 1px solid var(--wc-border); border-radius: 999px; background: var(--wc-surface); color: var(--wc-text); padding: .25rem .6rem; font-size: .78rem; font-weight: 700; }
.act-report { display: block; margin: .3rem auto 0; font-size: .82rem; font-weight: 700; }
/* R-0072 (C4.3): «Sei il titolare?» in fondo alla scheda (tavola A1) */
.act-claim { display: block; width: calc(100% - 2rem); margin: .5rem 1rem .3rem; padding: .6rem .75rem; border: 0; border-radius: 14px; background: var(--wc-bg); color: inherit; font: inherit; font-size: .85rem; text-align: left; }
.act-claim strong { display: block; margin-bottom: .1rem; }
.act-claim span { color: var(--wc-muted); font-size: .8rem; }
.act-opt { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--wc-border); }
/* La campanella del pannello va a destra anche quando «Nuovo messaggio» non c’è. */
#sideBell { margin-left: auto; }
#newMsgBtnMobile:not(.d-none) + #sideBell { margin-left: .25rem; }

/* ---------- Consigli dei locali (R-0061, tavola «Locali» viste 3–6) ---------- */
.act-rec-badge { align-self: flex-start; margin-top: 3px; padding: 1px 8px; border-radius: 8px; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: .72rem; font-weight: 700; }
.act-rec { display: flex; align-items: flex-start; gap: .5rem; margin-top: .4rem; }
.act-rec-text { flex: 1; min-width: 0; }
.act-rec-note { display: block; color: var(--wc-muted); }
.act-rec-flag { font-size: .72rem; color: var(--wc-muted); }
.act-acts { display: flex; gap: .4rem; margin: 0 1rem .4rem; }
.act-act { flex: 1; padding: .6rem .3rem; border: 0; border-radius: 999px; background: var(--wc-bg); color: var(--wc-text); font-size: .8rem; font-weight: 700; }
.act-act.primary { background: var(--wc-accent); color: #fff; }
.act-pick { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 1rem .5rem; padding: .5rem .7rem; border-radius: 12px; background: var(--wc-accent-soft); font-size: .82rem; font-weight: 700; }
.act-card .act-pick { display: block; padding: 0; background: none; }
.place-prev { display: flex; align-items: center; gap: .6rem; width: 100%; min-width: 12rem; padding: .55rem; border: 0; border-radius: 12px; background: rgba(127, 127, 127, .14); color: inherit; text-align: left; }
.place-prev-emoji { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 10px; background: var(--wc-accent-soft); font-size: 1.2rem; }
.place-prev-body { display: flex; flex-direction: column; min-width: 0; font-size: .78rem; opacity: .9; }
.place-prev-body strong { font-size: .9rem; opacity: 1; }
#umPlace { font-weight: 700; }

/* ---------- Modifica dei messaggi (R-0063, B2.1) ---------- */
.msg-edited { margin-right: .3rem; font-size: .7rem; font-style: italic; color: var(--wc-muted); }
.msg.mine .msg-edited { color: inherit; opacity: .8; }
.msg-quote-edited { font-size: .92em; opacity: .85; }
.edit-hint { display: flex; align-items: center; gap: .5rem; padding: .2rem .75rem .5rem; }
.edit-hint-text { flex: 1; padding: .35rem .6rem; border-radius: 10px; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: .78rem; line-height: 1.35; }
.edit-hint-close { border: 0; background: none; color: var(--wc-muted); font-size: 1rem; padding: 0 .25rem; }

/* ---------- Invia più tardi (R-0064, B2.2) ---------- */
/* B2.5 (R-0117): l'orologio dentro il campo, l'ora scelta sopra il campo, il piccolo orologio su Invia. */
.composer-field.has-sched textarea { padding-right: 5rem; }
.sched-btn { position: absolute; right: 2.5rem; bottom: .15rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: none; padding: 0; font-size: 1.1rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.sched-btn.is-locked { filter: grayscale(1); opacity: .5; }
.sched-btn.is-on { background: var(--wc-accent); }
.sched-armed { display: flex; align-items: center; gap: .5rem; margin: .35rem .5rem 0; padding: .3rem .4rem .3rem .75rem; border-radius: 14px; background: var(--wc-accent-soft); color: var(--wc-accent-text); font-size: .82rem; font-weight: 700; }
.sched-armed strong { font-weight: 800; }
.sched-x { flex: 0 0 auto; border: 0; border-radius: 999px; background: var(--wc-surface); color: var(--wc-accent-text); font-weight: 800; font-size: .78rem; padding: .15rem .6rem; }
.send-btn { position: relative; }
.send-sched { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--wc-surface); font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--wc-accent); }
.sched-opts .sched-opt { flex-wrap: wrap; row-gap: 0; }
.sched-date { flex-basis: 100%; padding-left: 2.35rem; font-size: .8rem; font-weight: 600; color: var(--wc-muted); }
.msg.sched-pending .msg-bubble { border: 2px dashed var(--wc-accent); background: var(--wc-surface); color: var(--wc-text); }
.sched-line { margin-top: .25rem; font-size: .75rem; font-weight: 700; color: var(--wc-accent); }
.sched-link { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; }
.sched-media { font-size: .8rem; font-weight: 700; margin-bottom: .2rem; }
.sched-title { padding: 1rem 1rem .4rem; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--wc-muted); }
.sched-opt { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .65rem 1.1rem; border: 0; background: none; color: var(--wc-text); font-weight: 600; text-align: left; }
.sched-opt:hover { background: var(--wc-accent-soft); }
.sched-emoji { width: 1.6rem; text-align: center; font-size: 1.2rem; }
.sched-when { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding: .55rem .75rem; border-radius: 12px; background: var(--wc-bg); font-size: .88rem; }
.sched-when .sched-link { color: var(--wc-accent); font-weight: 700; text-decoration: none; }

/* ---------- Risposta automatica (R-0065, B2.3) ---------- */
.msg-bubble.is-auto, .msg.mine .msg-bubble.is-auto { background: rgba(255, 176, 0, .2); color: var(--wc-text); }
.msg-auto-title { font-size: .72rem; font-weight: 800; margin-bottom: .15rem; }
.auto-row { display: flex; align-items: center; gap: .75rem; }
.auto-label { flex: 1; display: flex; flex-direction: column; }
.auto-label span { font-size: .82rem; color: var(--wc-muted); }
#autoSub { display: block; font-size: .78rem; color: var(--wc-muted); font-weight: 400; }

/* ---------- Bondini e persone (R-0066, B3) ---------- */
.bondino-new { display: flex; align-items: center; gap: .4rem; padding-right: .75rem; }
.bondino-new > .conv-item { flex: 1; min-width: 0; }
.greet-btn { flex: 0 0 auto; border: 0; border-radius: 999px; padding: .3rem .7rem; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: .78rem; font-weight: 700; }
.greet-done { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--wc-muted); }
.um-mutual { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: 12px; background: var(--wc-bg); }
.um-faces { display: flex; }
.um-faces .avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--wc-surface); }
.um-faces .avatar:first-child { margin-left: 0; }
.um-mutual-text { display: flex; flex-direction: column; min-width: 0; font-size: .85rem; }
.um-mutual-text span { color: var(--wc-muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.um-actions { display: flex; gap: .4rem; }
.um-calls { display: contents; }
.um-calls.d-none { display: none !important; }
.um-act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem .2rem; border: 0; border-radius: 12px; background: var(--wc-accent-soft); color: var(--wc-accent); font-size: .78rem; font-weight: 700; }
.um-act-ico { font-size: 1.15rem; }
.um-act:disabled { background: var(--wc-bg); color: var(--wc-muted); filter: grayscale(1); opacity: .6; } /* R-0067: grigi solo per chi non è amico */
/* R-0078 (C4.5, tavola B11): la scheda «Gestita dal locale», descrizione e caratteristiche; «Gestisce …» nella scheda della persona */
.act-managed { display: inline-block; margin-top: .35rem; padding: .15rem .6rem; border-radius: 999px; background: rgba(15, 124, 130, .14); color: #0F7C82; font-size: .74rem; font-weight: 800; }
.act-desc { margin: .1rem 1rem .55rem; font-size: .86rem; line-height: 1.45; white-space: pre-line; }
.act-feats { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 1rem .55rem; }
.act-feat { padding: .15rem .6rem; border-radius: 999px; background: var(--wc-bg); font-size: .76rem; }
.um-manages { color: #0F7C82; font-weight: 700; }
.um-place { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; } /* R-0110 */
[data-theme="dark"] .act-managed, [data-theme="dark"] .um-manages { color: #5FD0D6; }
/* R-0079 (C4.6, tavola B5.4): il riquadro di una chiusura o di un orario speciale */
.act-notice { display: flex; gap: .6rem; align-items: center; margin: 0 1rem .5rem; padding: .55rem .75rem; border-radius: 12px; font-size: .84rem; line-height: 1.35; }
.act-notice.closed { background: rgba(217, 58, 71, .12); color: #B4232F; }
.act-notice.special { background: rgba(240, 138, 0, .14); color: #B25E00; }
.act-notice-i { font-size: 1.2rem; }
/* R-0080 (C4.7): le foto del locale nella scheda e la foto grande */
.act-photos { display: flex; gap: .4rem; overflow-x: auto; margin: 0 1rem .6rem; padding-bottom: .2rem; scroll-snap-type: x mandatory; }
.act-photos img { flex: none; width: 6.2rem; height: 6.2rem; object-fit: cover; border-radius: 12px; cursor: pointer; scroll-snap-align: start; background: var(--wc-bg); }
.act-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .88); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.act-viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }
/* R-0081 (C4.8): gli eventi del locale nella scheda */
.act-ev { padding: .15rem 0; font-size: .86rem; }
/* R-0085 (C4.10–C4.11): bollino dei locali verificati, «Gestita dal locale» nell'elenco e nei messaggi, orari giorno per giorno */
.act-vb { display: inline-block; width: 1.1em; height: 1.1em; margin-left: .3em; vertical-align: -.17em; flex: none; }
.act-vb svg { display: block; width: 100%; height: 100%; }
.act-item-managed { display: block; margin-top: .1rem; font-size: .72rem; font-weight: 800; color: #0F7C82; }
.place-prev-managed { align-self: flex-start; margin-top: .25rem; font-size: .68rem; }
.act-wk-now { font-size: .88rem; margin-bottom: .35rem; font-weight: 700; color: #B4232F; }
.act-wk-now.is-open { color: #0E7A4E; }
.act-wk { width: 100%; border-collapse: collapse; font-size: .88rem; }
.act-wk td { padding: .22rem 0; vertical-align: top; }
.act-wk td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.act-wk tr.today td { font-weight: 800; }
.act-wk tr.today td:first-child small { color: #0F7C82; font-weight: 700; }
.act-wk-span { display: block; }
.act-wk-span small, .act-wk-off { opacity: .65; font-weight: 400; }
.act-box .act-notice { margin-top: .5rem; }
[data-theme="dark"] .act-item-managed, [data-theme="dark"] .act-wk tr.today td:first-child small { color: #5FD0D6; }
[data-theme="dark"] .act-wk-now { color: #F08A8A; }
[data-theme="dark"] .act-wk-now.is-open { color: #5FD08E; }
/* R-0088 (C4.7.1, tavola F2): «+N» sull'ultima delle tre foto della scheda */
.act-ph-more { position: relative; flex: none; display: block; }
.act-ph-more > span { position: absolute; inset: 0; border-radius: 12px; background: rgba(0, 0, 0, .45); color: #fff; font-weight: 800; font-size: 1.15rem; display: grid; place-items: center; cursor: pointer; }

/* R-0095 (C4.14, tavola B8): Tu › I miei locali nell'app. I colori dei pallini sono quelli di business (A4). */
.ml-page { padding: .75rem 1rem; } /* R-0097: la pagina a tutto schermo */
.ml-row { border: 1px solid var(--wc-border); border-radius: 16px; padding: .9rem; margin-bottom: .75rem; background: var(--wc-surface); }
.ml-top { display: flex; align-items: center; gap: .75rem; }
.ml-ico { font-size: 1.6rem; line-height: 1; }
.ml-t { flex: 1; min-width: 0; }
.ml-t strong { display: block; }
.ml-t span { color: var(--wc-muted); font-size: .8rem; }
.ml-st { display: flex; align-items: center; gap: .75rem; margin-top: .6rem; }
.ml-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 800; padding: .2rem .6rem; border-radius: 999px; }
.ml-pill i { width: 9px; height: 9px; border-radius: 50%; }
.ml-ok { background: #D7F3E5; color: #0E7A4E; }
.ml-ok i { background: #1FA463; }
.ml-wait { background: #FFEBD2; color: #B25E00; }
.ml-wait i { background: #F08A00; }
.ml-ko { background: #FBE1E3; color: #B4232F; }
.ml-ko i { background: #D93A47; }
.ml-go { border: 0; background: none; padding: 0; color: #0F7C82; font-weight: 700; text-decoration: underline; }
/* R-0101 (C4.14.3, tavola M2–M3): l'avviso di «I miei locali» per chi non ha ancora locali. */
.ml-drop { position: relative; overflow: hidden; border-radius: 18px; padding: 1rem; margin-bottom: .75rem; color: #fff; background: linear-gradient(135deg, #0F7C82, #4B55D6); box-shadow: 0 14px 30px rgba(75, 85, 214, .28); animation: ml-down 1.1s cubic-bezier(.2, .8, .2, 1) both; }
.ml-drop::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); animation: ml-shine 2.6s 1.1s ease-in-out infinite; }
.ml-drop h4 { margin: 0 0 .6rem; font-size: 1rem; font-weight: 800; }
.ml-x { position: absolute; right: .75rem; top: .6rem; z-index: 1; border: 0; background: none; color: rgba(255, 255, 255, .9); font-size: .78rem; font-weight: 700; }
.ml-step { display: flex; gap: .6rem; align-items: flex-start; margin-top: .6rem; font-size: .85rem; opacity: 0; animation: ml-in .5s ease both; }
.ml-step:nth-of-type(1) { animation-delay: 1.2s; } .ml-step:nth-of-type(2) { animation-delay: 1.6s; } .ml-step:nth-of-type(3) { animation-delay: 2s; }
.ml-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: grid; place-items: center; font-weight: 800; font-size: .78rem; }
.ml-go2 { position: relative; z-index: 1; margin-top: .85rem; border: 0; background: #fff; color: #0F7C82; font-weight: 800; font-size: .85rem; padding: .5rem .9rem; border-radius: 12px; }
.ml-handle { margin: .5rem auto 0; width: 44px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .55); }
.ml-mini { width: 100%; display: flex; justify-content: space-between; border: 0; border-radius: 14px; padding: .65rem .9rem; margin-bottom: .75rem; color: #fff; font-size: .85rem; font-weight: 700; background: linear-gradient(135deg, #0F7C82, #4B55D6); animation: ml-in .4s ease both; }
.ml-empty { margin: 1.1rem 0; color: var(--wc-muted); font-size: .9rem; text-align: center; }
@keyframes ml-down { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ml-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes ml-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ml-drop, .ml-step, .ml-mini { animation: none; opacity: 1; } .ml-drop::after { animation: none; display: none; } }

/* R-0108 (C2.2): i pulsanti della scheda del locale. In alto le azioni, sotto «Online» coi tondi dei marchi. */
.act-main { display: flex; gap: .45rem; margin: 0 1rem .55rem; }
.act-mb { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: .35rem; padding: .72rem .3rem; border: 0; border-radius: 14px; background: var(--wc-bg); color: var(--wc-text); font-size: .86rem; font-weight: 800; white-space: nowrap; text-decoration: none; }
.act-mb .wc-icon { width: 1.05rem; height: 1.05rem; flex: none; }
.act-mb.primary { background: var(--wc-accent); color: #fff; }
.act-main.four .act-mb { flex-direction: column; gap: .2rem; font-size: .76rem; padding: .55rem .2rem; }
.act-online { margin: .15rem 1rem .7rem; }
.act-online-t { font-size: .7rem; font-weight: 800; color: var(--wc-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.act-rounds { display: flex; gap: 1.2rem; }
.act-rd { display: flex; flex-direction: column; align-items: center; gap: .3rem; border: 0; background: none; color: var(--wc-text); font-size: .74rem; font-weight: 700; padding: 0; min-width: 3.2rem; }
.act-rd-i { width: 2.9rem; height: 2.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--wc-bg); }
.act-rd-i .wc-icon { width: 1.35rem; height: 1.35rem; }
.act-rd-i.brand { background: none; }
.act-rd-i.brand svg { width: 2.9rem; height: 2.9rem; display: block; }

/* R-0114 (C2.1): «👍 I posti consigliati dai tuoi amici · N» sotto le categorie (tavola c21-c31). */
.act-friends { display: flex; align-items: center; gap: .6rem; width: calc(100% - 2rem); margin: .8rem 1rem 0; padding: .75rem .9rem; border: 0; border-radius: 14px; background: var(--wc-accent-soft); color: var(--wc-text); font-size: .88rem; text-align: left; }
.act-friends-t { flex: 1; min-width: 0; }
.act-friends .act-chev { color: var(--wc-accent); }

/* R-0115 (C3.1): la pagina «Consiglia un locale a…» (tavola c21-c31): righe col tondo da scegliere, «Manda a …» in fondo. */
.act-pickrow.on { background: var(--wc-accent-soft); }
.act-radio { flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; border: 2px solid var(--wc-border); display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #fff; }
.act-pickrow.on .act-radio { border-color: var(--wc-accent); background: var(--wc-accent); }
.act-mine { display: block; margin-top: .1rem; font-size: .74rem; font-weight: 700; color: var(--wc-accent); }
.act-send { position: sticky; bottom: 0; padding: .7rem 1rem; background: var(--wc-surface); border-top: 1px solid var(--wc-border); }


/* ---------- B14 (R-0118): barra di scrittura più bassa, un solo tasto per microfono e Invia ---------- */
.chat-composer .attach-btn, .chat-composer .send-btn { width: 2.5rem; height: 2.5rem; }
.chat-composer.is-empty .send-btn { display: none; }
.chat-composer:not(.is-empty) .attach-btn.mic { display: none; }
.chat-composer .attach-btn.mic:not(.holding) { background: var(--wc-accent); color: var(--wc-accent-contrast); }


/* R-0121: sul computer l elenco degli avvisi resta sopra le finestrelle dei privati (dm.css: .dm-dock z-index 1040). */
#bellWrap .bell-menu { z-index: 1045; }
/* R-0206: videomessaggio tondo dell'iPhone (cerchio di 200, senza fumetto; muto finché non si tocca). */
.msg-attach.msg-tondo{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:0;border:0;background:none;cursor:pointer}
.msg-tondo-video{width:200px;height:200px;border-radius:50%;object-fit:cover;background:#000;display:block}
.msg-tondo-nota{font-size:.78rem;color:var(--bs-secondary-color,#6c757d)}
.msg-tondo-nota:empty{display:none}
/* Come nella tavola: il cerchio senza fumetto attorno (l ora resta sotto). */
.msg-bubble:has(.msg-tondo){background:transparent!important;box-shadow:none!important;border:0!important;padding-left:0;padding-right:0}
