/* profile-drawer.css — shared profile card drawer (map + feed) */

.match-category-all {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 18px 0;
    border-bottom: 1px solid var(--mc-border, rgba(255,255,255,0.06));
}
.match-category-all:last-child { border-bottom: none; padding-bottom: 6px; }

.match-cat-icons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.match-cat-icons .ucis-bubble { width: 24px; height: 24px; font-size: 10px; }
.match-cat-icons .uci-count-badge { font-size: 7px; min-width: 11px; height: 11px; }

#match-details { display: block; padding: 0 4px; }

.match-category-tit-bar { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.match-icon-wrapper { display: flex; align-items: center; flex-shrink: 0; }
.match-icon-wrapper img { width: 28px; height: 28px; opacity: 0.85; }

.match-label-wrapper { display: flex; flex-direction: column; gap: 2px; }
.match-category-label {
    font-family: "Agrandir Grand Heavy", sans-serif;
    font-size: 12px;
    color: var(--mc-text, rgba(255,255,255,0.9));
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    line-height: 1.2;
}
.match-category-label img { width: 16px; height: 16px; }
.match-category-sublabel { font-size: 10px; color: var(--mc-text-faint, rgba(255,255,255,0.38)); font-weight: 400; line-height: 1.2; }

.match-category-progress {
    width: 100%;
    height: 4px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--mc-overlay-12, rgba(255,255,255,0.12));
}

.match-percentage-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-family: "Agrandir Grand Heavy", sans-serif;
    font-size: 14px;
    color: var(--mc-text, rgba(255,255,255,0.9));
    flex-shrink: 0;
    min-width: 38px;
    text-align: right;
}

.match-category-bar {
    height: 100%;
    background-color: #FF7601;
    transition: width 1s ease;
}

.match-summary {
    margin: 30px 0;
    font-size: 18px;
    text-align: center;
    font-family: Agrandir, sans-serif;
}

.match-emoji { font-size: 24px; margin-right: 10px; }

@keyframes fillProgress {
    0% { width: 0%; opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 1; }
}

.match-category-bar {
    height: 100%;
    position: relative;
    width: 0%;
    background-color: #FF7601;
    border-radius: 10px;
    overflow: hidden;
}
.match-category-bar.animate { animation: fillProgress 1.2s ease-out forwards; }
.match-category-bar.animate::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ── Match rings — tre cerchi compatti su una riga ───────────── */
@property --match-pct {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

#match-details.match-rings-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0 4px;
}

.match-ring-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.match-ring {
    --ring-size: 64px;
    --ring-track: var(--mc-overlay-12, rgba(255, 255, 255, 0.12));
    --ring-fill: #FF7601;
    width: var(--ring-size);
    height: var(--ring-size);
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        var(--ring-fill) calc(var(--match-pct, 0) * 1%),
        var(--ring-track) 0
    );
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: --match-pct 1s ease-out;
}

.match-ring.animate {
    transition: --match-pct 1s ease-out;
}

.match-ring-inner {
    width: calc(var(--ring-size) - 8px);
    height: calc(var(--ring-size) - 8px);
    border-radius: 50%;
    background: var(--mc-bg-elevated, #0a0a0a);
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-ring-icon {
    width: 24px;
    height: 24px;
    opacity: 0.88;
    flex-shrink: 0;
}

.match-ring-meta {
    margin-top: 6px;
    width: 100%;
    text-align: center;
}

.match-ring-label {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: var(--mc-text-faint, rgba(255, 255, 255, 0.45));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
}

.match-rings-row .match-cat-icons {
    justify-content: center;
    margin-top: 4px;
    gap: 3px;
}

.match-rings-row .match-cat-icons .ucis-bubble {
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.match-rings-row .match-insights {
    flex: 0 0 100%;
    width: 100%;
    margin-top: 10px;
}

@media (max-width: 420px) {
    .match-ring {
        --ring-size: 58px;
    }
    .match-ring-icon {
        width: 22px;
        height: 22px;
    }
    .match-ring-label {
        font-size: 8px;
    }
}

@media (min-width: 769px) {
    #profile-card-overlay.profile-side-panel .match-ring {
        --ring-size: 68px;
    }
}

/* ── Mini-chat nella scheda profilo ─────────────────────────── */
#profile-actions { padding: 12px 20px 24px; }

#profile-minichat {
    margin: 16px 0 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* ── Motivazioni match (sotto la chat) ─────────────────────── */
/* Niente riserva per la tab bar: il drawer è fullscreen sopra la nav */
#profile-insights {
    padding: 4px 20px 28px;
}

#profile-insights .match-insights {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

#profile-insights .match-insights__title {
    padding-top: 12px;
    border-top: 1px solid var(--mc-border, rgba(255, 255, 255, 0.07));
}

.match-insights__list--chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    line-height: 1.35;
}

.match-insights__list--chips li,
.match-insights__list--chips li.match-insights__item--icon {
    margin: 0;
    padding: 5px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mc-overlay-04, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.08));
    border-radius: 999px;
}

.match-insights__list--chips li::before {
    content: none;
}

.match-insights__list--chips .match-insights__ico {
    margin-right: 0;
    color: rgba(255, 118, 1, 0.85);
}

/* Link inline nel messaggio del profilo (es. invito a completare l'onboarding) */
.profile-message-link {
    color: var(--mc-primary, #FF7601);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.profile-message-link:hover,
.profile-message-link:focus-visible {
    color: var(--mc-primary-hover, #FF9A42);
}

/* Tipografia = .match-insights__title (design-tokens); qui solo layout + arancione */
.minichat-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mc-font-display);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--mc-primary, #FF7601);
    margin: 0;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--mc-border, rgba(255, 255, 255, 0.06));
    margin-bottom: 10px;
}

.minichat-title-text {
    font-family: var(--mc-font-display);
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.minichat-title-icon {
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
    color: var(--mc-primary, #FF7601);
}

.minichat-messages {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 4px 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.minichat-messages::-webkit-scrollbar { width: 4px; }
.minichat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.minichat-date-sep {
    align-self: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--mc-text-faint, rgba(255, 255, 255, 0.32));
    padding: 2px 0 4px;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}

.minichat-msg-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 88%;
}

.minichat-msg-row.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.minichat-msg-row.theirs {
    align-self: flex-start;
    align-items: flex-start;
}

.minichat-msg {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.42;
    word-break: break-word;
    font-family: Agrandir, sans-serif;
}

.minichat-msg-row.mine .minichat-msg {
    background-color: var(--mc-overlay-10, #141414);
    color: var(--mc-text, #ffffff);
    border-bottom-right-radius: 4px;
    box-shadow: var(--mc-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.35));
}

.minichat-msg-row.mine .minichat-msg a { color: #53bdeb; }

.minichat-msg .message-link {
    color: #53bdeb;
    text-decoration: underline;
    word-break: break-all;
}

.minichat-msg-row.mine .minichat-msg .message-link {
    color: #53bdeb;
    font-weight: 600;
}

.minichat-msg-row.theirs .minichat-msg .message-link {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
}

.minichat-msg .message-link:hover {
    color: #7ecbf0;
}

.minichat-msg-row.theirs .minichat-msg {
    background-color: #FF7601;
    color: #ffffff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(255, 118, 1, 0.35);
}

.minichat-msg-time {
    font-size: 10px;
    color: var(--mc-text-faint, rgba(255, 255, 255, 0.65));
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.minichat-icebreakers-wrap {
    margin-bottom: 4px;
}

.minichat-icebreakers-label {
    margin: 0 0 10px;
    padding: 0 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(255, 118, 1, 0.9);
    line-height: 1.35;
}

#minichat-greetings,
.minichat-greetings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 0 10px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 118, 1, 0.35) transparent;
}

#minichat-greetings::-webkit-scrollbar,
.minichat-greetings::-webkit-scrollbar { width: 4px; }
#minichat-greetings::-webkit-scrollbar-thumb,
.minichat-greetings::-webkit-scrollbar-thumb {
    background: rgba(255, 118, 1, 0.35);
    border-radius: 2px;
}

.minichat-greeting-chip {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: none;
    background: rgba(255, 118, 1, 0.08);
    border: 1px solid rgba(255, 118, 1, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--mc-text, rgba(255, 255, 255, 0.92));
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    font-family: inherit;
    white-space: normal;
    word-break: break-word;
    -webkit-tap-highlight-color: transparent;
}

.minichat-greeting-chip-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 118, 1, 0.16);
    color: #ff7601;
    font-size: 12px;
    margin-top: 1px;
}

.minichat-greeting-chip-text {
    flex: 1;
    min-width: 0;
}

.minichat-greeting-chip:hover,
.minichat-greeting-chip:focus {
    background: rgba(255, 118, 1, 0.14);
    border-color: rgba(255, 118, 1, 0.5);
    color: var(--mc-text, #fff);
    outline: none;
    transform: translateY(-1px);
}

.minichat-greeting-chip:active {
    transform: scale(0.99);
}

.minichat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 0;
    margin-top: 2px;
}

.minichat-messages[style*="flex"] + .minichat-input-row,
.minichat-icebreakers-wrap:not([style*="display: none"]) + .minichat-input-row,
#minichat-greetings:not(:empty) + .minichat-input-row {
    padding-top: 12px;
}

.minichat-input {
    flex: 1;
    background: var(--mc-overlay-06, rgba(255, 255, 255, 0.07));
    color: var(--mc-text, #fff);
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    outline: none;
    font-size: 13px;
    padding: 8px 14px;
    min-width: 0;
}
.minichat-input::placeholder { color: var(--mc-text-faint, rgba(255,255,255,0.35)); }

.minichat-send-btn {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    background: var(--mc-overlay-10, rgba(255, 255, 255, 0.12));
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.14));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mc-text, rgba(255, 255, 255, 0.9));
    font-size: 12px;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.minichat-send-btn:hover {
    background: var(--mc-overlay-12, rgba(255, 255, 255, 0.18));
    border-color: var(--mc-border, rgba(255, 255, 255, 0.22));
}
.minichat-send-btn:disabled { opacity: 0.45; cursor: default; }

.minichat-full-link-wrapper {
    text-align: center;
    padding: 10px 4px 4px;
}
.minichat-full-link-wrapper a {
    font-size: 11px;
    color: var(--mc-text-faint, rgba(255,255,255,0.38));
    text-decoration: none;
    transition: color 0.15s;
}
.minichat-full-link-wrapper a:hover { color: var(--mc-text-muted, rgba(255,255,255,0.62)); }

@media (max-width: 768px) {
    #profile-actions { padding: 8px 16px 24px; }
}

/* Tema chiaro: icone match ring sono SVG bianchi (pensati per dark) → invertiti = neri */
:root[data-theme="light"] .match-ring-icon,
:root[data-theme="light"] .match-icon-wrapper img,
:root[data-theme="light"] .match-category-label img {
    filter: invert(1);
}

.match-details-guest-blur {
    position: relative;
    pointer-events: none;
    user-select: none;
}

.match-details-guest-blur .match-category-all {
    filter: blur(2px);
}

.match-details-guest-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--mc-bg-overlay, rgba(10, 15, 25, 0.85));
    z-index: 10;
}

/* Vista ospite — profilo pubblico (senza percentuali match) */
.match-details-guest-public .match-category-all {
    filter: none;
}

/*
 * Doppia linea: ogni .match-category-all ha border-bottom, e .guest-match-teaser
 * ha border-top. Quando manca Sintonia (o altra riga), l'ultima categoria resta
 * con border-bottom orfano + border-top del teaser = doppia linea.
 * :last-of-type NON basta (teaser è pure un div). Usa :has(+ teaser).
 */
.match-details-guest-public .match-category-all:has(+ .guest-match-teaser) {
    border-bottom: none;
    padding-bottom: 6px;
}

/* Tra teaser CTA e mini-chat: niente bordo extra */
#profile-body:has(.match-details-guest-public) + #profile-actions {
    border-top: none;
    box-shadow: none;
}
#profile-body:has(.match-details-guest-public) + #profile-actions #profile-minichat {
    margin-top: 8px;
    border-top: none;
}

.guest-figli-chip {
    width: auto !important;
    min-width: 24px;
    padding: 0 8px;
    gap: 4px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.guest-figli-label {
    font-size: 9px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
}

/* Lista camperisti — pill «Con figli» in vista ospite */
.user-card-icons-strip .ucis-bubble.guest-figli-chip {
    min-width: 22px;
    padding: 0 6px;
    border-radius: 11px;
}

.user-card-icons-strip .guest-figli-label {
    font-size: 8px;
}

.guest-match-teaser {
    margin-top: 8px;
    padding: 16px 4px 8px;
    text-align: center;
    border-top: 1px solid var(--mc-border, rgba(255, 255, 255, 0.08));
}

.guest-match-teaser p {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px;
    color: var(--mc-text, rgba(255, 255, 255, 0.9));
}

/* CTA = stesso linguaggio di feed.php (.mc-cta) */
.guest-match-teaser .guest-match-teaser-cta {
    font-family: 'Agrandir Grand Heavy', sans-serif;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.guest-match-teaser .guest-match-teaser-cta:hover {
    color: #fff;
    text-decoration: none;
}

/* Pill come feed.php — anche su map (feed.css non è caricato) */
.guest-match-teaser .feed-guest-pills,
.guest-match-teaser-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.guest-match-teaser .feed-guest-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mc-overlay-08, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.12));
    color: var(--mc-text-muted, rgba(255, 255, 255, 0.85));
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    white-space: nowrap;
}

.guest-match-teaser .feed-guest-pill i {
    color: #FF7601;
    font-size: 11px;
}

/* Prompt geolocalizzazione ospite — spostato in components/guest-location-prompt.css
   (condiviso con feed.php, incluso separatamente in <head>) */

/* Login wall ospite — stessa card sobria del tour guidato, stili in style.css (.guest-login-wall-card) */
.guest-login-wall-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: guestLoginWallFadeIn 0.25s ease;
}

.guest-login-wall-overlay .guest-login-wall-card {
    animation: guestLoginWallScaleIn 0.32s ease;
}

.profile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 18px 12px;
}

.profile-nav--hidden {
    display: none;
}

.profile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.15));
    background: var(--mc-overlay-08, rgba(255, 255, 255, 0.08));
    color: var(--mc-text, #fff);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.profile-nav-btn:hover:not(:disabled) {
    background: var(--mc-overlay-12, rgba(255, 255, 255, 0.18));
}

.profile-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.profile-nav-counter {
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text-muted, rgba(255, 255, 255, 0.75));
    text-align: center;
    flex: 1;
    min-width: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILO — pannello destro stile Google Maps (solo mappa, desktop)
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes mapProfilePanelIn {
    from {
        transform: translateX(calc(100% + 24px));
        opacity: 0.7;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (min-width: 769px) {
    #profile-card-overlay.profile-side-panel {
        top: 62px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 16px 16px 16px 0;
        align-items: stretch;
        justify-content: flex-end;
        background: transparent;
        pointer-events: auto;
        overflow: visible;
        z-index: 10001;
        animation: none;
    }

    #profile-card-overlay.profile-side-panel #profile-card {
        pointer-events: auto;
        width: min(480px, 42vw);
        max-width: 480px;
        height: auto;
        max-height: calc(100vh - 94px);
        border-radius: 20px;
        border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.1));
        box-shadow: var(--mc-shadow-md, 0 12px 40px rgba(0, 0, 0, 0.5));
        overflow: hidden;
        overflow-y: auto;
        animation: mapProfilePanelIn 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    }

    #profile-card-overlay.profile-side-panel #profile-close {
        position: sticky;
        top: 12px;
        float: right;
        margin: 12px 12px -48px 0;
        right: auto;
        left: auto;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        z-index: 120;
        pointer-events: auto;
    }

    #profile-card-overlay.profile-side-panel #profile-close:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        transform: none;
    }

    #profile-card-overlay.profile-side-panel .modal-handle-wrapper,
    #profile-card-overlay.profile-side-panel .profile-header-sheet-handle {
        display: none;
    }

    #profile-card-overlay.profile-side-panel #profile-user-info {
        padding: 20px 18px 12px;
        gap: 12px;
    }

    #profile-card-overlay.profile-side-panel #profile-avatar {
        width: 56px;
        height: 56px;
    }

    #profile-card-overlay.profile-side-panel #profile-name {
        font-size: 17px;
        padding-right: 36px;
    }

    #profile-card-overlay.profile-side-panel .profile-distance {
        font-size: 12px;
        margin-top: 4px;
    }

    #profile-card-overlay.profile-side-panel .profile-nav {
        padding: 0 18px 10px;
    }

    #profile-card-overlay.profile-side-panel #profile-body {
        padding: 0 18px 8px;
    }

    #profile-card-overlay.profile-side-panel #profile-actions {
        padding: 8px 18px 12px;
    }

    #profile-card-overlay.profile-side-panel .match-rings-row {
        padding-top: 8px;
    }

    /* Minichat integrata nel pannello: niente box dentro box, un solo scroll */
    #profile-card-overlay.profile-side-panel #profile-minichat {
        margin: 6px 0 0;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
    }

    #profile-card-overlay.profile-side-panel .minichat-messages {
        max-height: none;
        overflow-y: visible;
    }

    #profile-card-overlay.profile-side-panel #minichat-greetings,
    #profile-card-overlay.profile-side-panel .minichat-greetings {
        max-height: none;
        overflow-y: visible;
    }

    #profile-card-overlay.profile-side-panel #profile-insights {
        padding: 0 18px 18px;
    }

    /* Viaggi + aree sosta — pannello flottante a destra (stesso template event-modal) */
    #event-details-modal.event-modal-overlay.profile-side-panel,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel {
        top: 62px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        padding: 16px 16px 16px 0;
        align-items: stretch;
        justify-content: flex-end;
        background: transparent;
        pointer-events: auto;
        overflow: visible;
        z-index: 10001;
        animation: none;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-content,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-content {
        pointer-events: auto;
        width: min(480px, 42vw);
        max-width: 480px;
        height: auto;
        max-height: calc(100vh - 94px);
        border-radius: 20px;
        border: 1px solid var(--mc-border, rgba(255, 255, 255, 0.1));
        box-shadow: var(--mc-shadow-md, 0 12px 40px rgba(0, 0, 0, 0.5));
        overflow: hidden;
        overflow-y: auto;
        animation: mapProfilePanelIn 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-close,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-close {
        display: flex !important;
        position: sticky;
        top: 12px;
        float: right;
        margin: 12px 12px -48px 0;
        right: auto;
        left: auto;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.12);
        transform: none;
        z-index: 120;
        pointer-events: auto;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-hero,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-hero {
        height: 200px;
        min-height: 200px;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-close:hover,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-close:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #fff;
        transform: none;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .mitnight-sheet-handle {
        display: none;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-header,
    #event-details-modal.event-modal-overlay.profile-side-panel .mitnight-modal-header,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-header {
        padding: 20px 18px 10px;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-title,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-title {
        font-size: 20px;
        padding-right: 36px;
    }

    #event-details-modal.event-modal-overlay.profile-side-panel .event-modal-body,
    #event-details-modal.event-modal-overlay.profile-side-panel .mitnight-modal-body,
    #mitnight-details-modal.event-modal-overlay.profile-side-panel .event-modal-body {
        padding: 0 18px 18px;
    }
}

/* Handle pill nascosta ovunque — chiusura solo con pulsante X */
.profile-header-sheet-handle {
    display: none;
}

#profile-card #profile-user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px 14px;
}

#profile-card #profile-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
}

#profile-card #profile-avatar .avatar-css {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50%;
}

#profile-card #profile-avatar .avatar-css--initial {
    background: linear-gradient(135deg, #FF7601, #FF9A4D) !important;
    border: none;
    box-shadow: none;
}

#profile-card #profile-avatar img {
    border-radius: 50%;
}

#profile-card #profile-avatar .avatar-css--initial .avatar-letter {
    color: #fff;
    font-size: 1.35rem !important;
    font-weight: 600;
    letter-spacing: 0.02em;
}

#profile-card #profile-avatar .avatar-letter {
    font-size: 1.4em !important;
}

@media (min-width: 769px) {
    .profile-header-sheet-handle {
        display: none;
    }

    #profile-card #profile-user-info {
        padding-top: 20px;
    }
}

@media (max-width: 768px) {
    #profile-card #profile-user-info {
        padding: 14px 20px 14px;
        padding-right: 56px;
    }
}
