/* Friends and rich profile («Creuza a colori»): web/friends.js (Amici segment, invites, place strip, home activity)
   and the profile header / privacy step of web/social.js. Prefix cm- (community). Tokens: app.css. */

/* Cover colours (profile band, suggestion cards, swatches) */
.cm-cover-rosso { --cover: #c8371f; --cover-ink: #ffffff; }
.cm-cover-giallo { --cover: #f7c23b; --cover-ink: #1d1f24; }
.cm-cover-blu { --cover: #2458a6; --cover-ink: #ffffff; }
.cm-cover-verde { --cover: #1f7a4d; --cover-ink: #ffffff; }
.cm-cover-inchiostro { --cover: #1d1f24; --cover-ink: #ffffff; }
.cm-cover-crema { --cover: #efe6cf; --cover-ink: #1d1f24; }
.cm-i { width: 20px; height: 20px; flex: none; }

/* ---------- Amici header: direct messages ---------- */
.amici-dm { position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; color: var(--ink); background: var(--surface); border: var(--card-border); box-shadow: 3px 3px 0 var(--outline); text-decoration: none; }
.amici-dm:active { box-shadow: var(--press-shadow); transform: translate(2px, 2px); }
.amici-dm .tg-i { width: 22px; height: 22px; }
.amici-dm-count { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 850; border: 2px solid var(--bg); }
@media (prefers-color-scheme: dark) { .amici-dm-count { color: #121418; } }
.amici-page.has-inbox .social-top { right: 58px; top: 12px; }

/* ---------- First privacy step and «Privacy del profilo» ---------- */
.cm-setup { padding-top: 4px; }
.cm-setup-head { margin: 6px 0 18px; padding: 20px 18px 18px; border-radius: var(--r-lg); background: var(--gold); color: #1d1f24; border: var(--card-border); box-shadow: var(--card-shadow); }
.cm-setup-head .app-kicker { color: #1d1f24; opacity: .8; margin: 0 0 6px; }
.cm-setup-title { font: 900 clamp(30px, 9vw, 40px)/.95 var(--display); font-stretch: 68%; text-transform: uppercase; margin: 0 0 10px; }
.cm-setup-head p:last-child { margin: 0; font-size: 15px; font-weight: 600; }
.cm-privacy-form { display: grid; gap: 18px; }
.cm-field { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.cm-legend { font: 900 20px/1 var(--display); font-stretch: 70%; text-transform: uppercase; padding: 0; margin-bottom: 10px; }
.cm-legend small { font: 600 12.5px var(--font); text-transform: none; }
.cm-help { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: -4px 0 0; }
.cm-choices { display: grid; gap: 10px; }
@media (min-width: 520px) { .cm-choices { grid-template-columns: 1fr 1fr; } }
.cm-choice { position: relative; display: block; cursor: pointer; }
.cm-choice input, .cm-chip input, .cm-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cm-choice-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: 3px 3px 0 var(--outline); transition: background .15s, box-shadow .15s, transform .15s; }
.cm-choice-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--outline); }
.cm-choice-copy { display: grid; gap: 2px; min-width: 0; }
.cm-choice-copy strong { font-size: 16px; font-weight: 850; }
.cm-choice-copy small { color: var(--ink-2); font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.cm-choice input:checked + .cm-choice-card { background: var(--sea-soft); box-shadow: 1px 1px 0 var(--outline); transform: translate(2px, 2px); }
.cm-choice input:checked + .cm-choice-card .cm-choice-icon { background: var(--navy); color: #fff; }
.cm-choice input:focus-visible + .cm-choice-card, .cm-chip input:focus-visible + span, .cm-swatch:focus-within { outline: 3px solid var(--sea); outline-offset: 2px; }
.cm-aud { display: grid; gap: 8px; }
.cm-aud-row { display: grid; gap: 8px; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); }
.cm-aud-name { display: grid; gap: 1px; }
.cm-aud-name strong { font-weight: 850; font-size: 15px; }
.cm-aud-name small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cm-aud-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cm-chip { position: relative; display: block; cursor: pointer; min-width: 0; }
.cm-chip span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface); border: 2px solid var(--line-strong); font-weight: 800; font-size: 13.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-chip span .social-i { width: 16px; height: 16px; }
.cm-chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cm-covers { display: flex; flex-wrap: wrap; gap: 12px; }
.cm-swatch { position: relative; display: block; width: 46px; height: 46px; border-radius: 50%; background: var(--cover); border: 2px solid var(--outline); box-shadow: 3px 3px 0 var(--outline); cursor: pointer; }
.cm-swatch:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--ink); }
.cm-swatch:has(input:checked)::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 8px; border: solid var(--cover-ink); border-width: 0 0 3px 3px; transform: translateY(-2px) rotate(-45deg); }
.cm-privacy { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (prefers-color-scheme: dark) {
  .cm-choice-card, .cm-swatch { box-shadow: 3px 3px 0 #000; }
  .cm-choice input:checked + .cm-choice-card .cm-choice-icon { background: var(--sea); color: #121418; }
}

/* ---------- Profile (#u/<handle>): cover band, avatar with ink outline, counts, sections ---------- */
.cm-profile { padding-top: 0; }
.cm-band { height: 92px; margin: 0 calc(-1 * var(--gutter)); background: var(--cover, var(--navy)); border-bottom: 2px solid var(--outline); }
.cm-profile-top { align-items: flex-end; gap: 12px; }
.cm-profile .social-avatar.is-xl { width: 92px; height: 92px; margin-top: -46px; font-size: 32px; border: 3px solid var(--outline); box-shadow: 0 0 0 4px var(--bg); background-color: var(--avatar); }
.cm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 2px; }
.cm-stats .social-stat { min-width: 0; padding: 6px 0; text-decoration: none; color: inherit; }
.cm-stats .social-stat b { font-size: 18px; font-weight: 900; font-stretch: 72%; }
.cm-stats .social-stat span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.cm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.social-pill.is-friend { background: var(--ok-soft); color: var(--ok); gap: 4px; align-items: center; }
.social-pill .social-i { width: 13px; height: 13px; }
.cm-profile .social-profile-actions { flex-wrap: wrap; }
.cm-profile .social-profile-actions .button { flex: 1 1 120px; gap: 6px; }
.cm-profile .social-profile-actions .button .social-i { width: 17px; height: 17px; }
.cm-is-friend { background: var(--ok-soft) !important; color: var(--ok) !important; }
.cm-sec { margin: 18px 0 0; min-width: 0; }
.cm-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cm-sec-title { font: 900 19px/1 var(--display); font-stretch: 70%; text-transform: uppercase; margin: 0; }
.cm-who { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: 11.5px; font-weight: 800; }
.cm-who .social-i { width: 13px; height: 13px; }
.cm-sec-more { margin-left: auto; font-size: 14px; }
.cm-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-badge { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: var(--r-pill); background: var(--gold-soft); border: 2px solid var(--outline); font-size: 13px; font-weight: 750; }
.cm-badge b { font: 900 17px/1 var(--display); font-stretch: 72%; }
@media (prefers-color-scheme: dark) { .cm-badge { color: var(--ink); } }
.cm-pins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cm-pin { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: 3px 3px 0 var(--outline); color: var(--ink); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.cm-pin:active { box-shadow: var(--press-shadow); transform: translate(2px, 2px); }
.cm-pin-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; }
.cm-pin-mark .social-i { width: 19px; height: 19px; }
.cm-pin:nth-child(3n+2) .cm-pin-mark { background: var(--navy); }
.cm-pin:nth-child(3n) .cm-pin-mark { background: var(--gold); color: #1d1f24; }
.cm-pin.is-add { grid-column: 1 / -1; border-style: dashed; box-shadow: none; background: transparent; }
.cm-pin.is-add .cm-pin-mark { background: var(--surface-2); color: var(--ink); }
.cm-pin-copy { display: grid; min-width: 0; line-height: 1.2; }
.cm-pin-copy strong { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cm-pin-copy small { color: var(--muted); font-size: 12px; font-weight: 700; }
.cm-tastes { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-taste { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); border: 1.5px solid var(--line-strong); font-size: 13.5px; font-weight: 750; color: var(--ink); text-decoration: none; }
.cm-taste.is-add { border-style: dashed; }
.cm-taste .social-i { width: 15px; height: 15px; }
.cm-profile + .cm-sec { margin-top: 20px; }
.cm-sec + .social-profile-tabs, .cm-sec + .social-empty { margin-top: 18px; }
.cm-pin-edit { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.cm-pin-edit li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: var(--r-sm); background: var(--surface-2); font-weight: 750; }
.cm-pin-edit li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-pin-edit .social-i { width: 18px; height: 18px; }
.cm-dlg-h { font: 900 16px/1 var(--display); font-stretch: 70%; text-transform: uppercase; margin: 14px 0 8px; }
.cm-pin-picks, .cm-pick-places { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-pin-picks .chip .social-i { width: 15px; height: 15px; }
.cm-pick-places .cm-chip span { min-height: 36px; }
.cm-steps { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-weight: 600; }
.cm-group-emoji { font-size: 20px; }

/* ---------- Amici › Amici ---------- */
.cm-friends-page { display: grid; gap: 18px; min-width: 0; }
.cm-search { margin: 0; }
.cm-invite { padding: 16px; border-radius: var(--r-lg); background: var(--gold); color: #1d1f24; border: var(--card-border); box-shadow: var(--card-shadow); min-width: 0; }
.cm-invite-head { display: flex; gap: 12px; align-items: flex-start; }
.cm-invite-mark { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #ffffff; border: 2px solid #1d1f24; }
.cm-invite h2 { font: 900 24px/1 var(--display); font-stretch: 68%; text-transform: uppercase; margin: 2px 0 4px; }
.cm-invite p { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.4; }
.cm-invite-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cm-invite-actions .button { flex: 1 1 130px; gap: 6px; }
.cm-invite-actions .social-i { width: 17px; height: 17px; }
.cm-invite .button.secondary { background: #ffffff; color: #1d1f24; }
.cm-invite-body { display: grid; gap: 10px; justify-items: center; margin-top: 14px; min-width: 0; }
.cm-qr { width: min(232px, 72vw); padding: 10px; border-radius: var(--r-md); background: #ffffff; border: 2px solid #1d1f24; box-shadow: 4px 4px 0 #1d1f24; }
.cm-qr svg { width: 100%; height: auto; }
.cm-invite-url { width: 100%; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 2px solid #1d1f24; background: #ffffff; color: #1d1f24; font: 600 13px var(--font); text-overflow: ellipsis; }
.cm-invite-body .cm-invite-actions { margin-top: 0; width: 100%; }
.cm-fine { font-size: 12.5px !important; text-align: center; opacity: .85; }
.cm-fine .text-button { color: inherit; font-size: 12.5px; text-decoration: underline; padding: 0; min-height: 0; }
dialog .cm-invite-body { color: var(--ink); }
dialog .cm-invite-url { border-color: var(--line-strong); }
dialog .cm-qr { border-color: var(--outline); }
.cm-block { min-width: 0; }
.cm-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cm-block-head h2 { font: 900 19px/1 var(--display); font-stretch: 70%; text-transform: uppercase; margin: 0; }
.cm-count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 850; }
.cm-friends-list, .cm-requests { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cm-friend { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cm-friend-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
.cm-friend-main:hover { background: var(--surface-2); }
.cm-friend-main .social-avatar { width: 46px; height: 46px; font-size: 16px; border: 2px solid var(--outline); }
.cm-friend-copy { display: grid; min-width: 0; }
.cm-friend-copy strong { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-friend-copy small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-friend-dm { flex: none; width: 42px; height: 42px; color: var(--ink); }
.cm-req-actions { display: flex; gap: 6px; flex: none; }
.cm-req-actions .button { min-height: 36px; padding: 0 12px; }
.cm-req-actions .social-i { width: 16px; height: 16px; }
.cm-more { margin: 8px auto 0; display: flex; }
.cm-empty { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--surface-2); }
.cm-empty p { margin: 0; font-size: 14px; }
.cm-empty-line { padding: 8px; }
.cm-sugg-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 10px; scrollbar-width: none; }
.cm-sugg-rail::-webkit-scrollbar { display: none; }
.cm-sugg { scroll-snap-align: start; display: grid; gap: 10px; align-content: space-between; padding: 0 10px 12px; border-radius: var(--r-md); background: var(--surface); border: var(--card-border); box-shadow: 3px 3px 0 var(--outline); overflow: hidden; min-width: 0; }
.cm-sugg-who { display: grid; justify-items: center; gap: 2px; text-align: center; color: inherit; text-decoration: none; min-width: 0; }
.cm-sugg-band { display: block; justify-self: stretch; height: 34px; margin: 0 -10px; background: var(--cover); border-bottom: 2px solid var(--outline); }
.cm-sugg .social-avatar.is-lg { width: 58px; height: 58px; font-size: 20px; margin: -26px 0 4px; border: 2px solid var(--outline); box-shadow: 0 0 0 3px var(--surface); }
.cm-sugg strong { font-size: 14px; font-weight: 850; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-sugg small { color: var(--muted); font-size: 12px; font-weight: 650; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.cm-sugg .button { width: 100%; min-height: 36px; gap: 4px; }
.cm-sugg .button .social-i { width: 15px; height: 15px; }

/* ---------- Invite landing (#amico/<token>) ---------- */
.cm-landing-card { display: grid; justify-items: center; text-align: center; padding: 0 16px 18px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); overflow: hidden; }
.cm-landing-card .cm-band { justify-self: stretch; margin: 0 -16px; height: 84px; }
.cm-landing-card .social-avatar.is-xl { margin-top: -44px; border: 3px solid var(--outline); box-shadow: 0 0 0 4px var(--surface); }
.cm-landing-name { font: 900 30px/1 var(--display); font-stretch: 68%; text-transform: uppercase; margin: 12px 0 2px; overflow-wrap: anywhere; }
.cm-landing-lead { margin: 14px 0 0; font-size: 16px; font-weight: 650; }
.cm-landing-actions { display: grid; gap: 8px; width: 100%; margin-top: 16px; }
.cm-landing-actions .button { gap: 8px; }
.cm-landing-what { margin-top: 18px; padding: 16px; border-radius: var(--r-lg); background: var(--sea-soft); border: var(--card-border); }
.cm-landing-what h2 { font: 900 19px/1 var(--display); font-stretch: 70%; text-transform: uppercase; margin: 0 0 10px; }
.cm-landing-what ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cm-landing-what li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.cm-landing-what .social-i { width: 20px; height: 20px; color: var(--navy); margin-top: 1px; }
@media (prefers-color-scheme: dark) { .cm-landing-what .social-i { color: var(--sea); } }
.cm-landing > .cm-invite-body { margin-top: 18px; }

/* ---------- Place sheet: friends who have been there, «Invia a un amico» ---------- */
.cm-place { display: grid; gap: 12px; margin: 14px 0 8px; padding: 14px; border-radius: var(--r-lg); background: var(--sea-soft); border: var(--card-border); }
.cm-place-friends { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cm-stack { display: flex; flex: none; }
.cm-stack a { display: block; margin-left: -10px; border-radius: 50%; }
.cm-stack a:first-child { margin-left: 0; }
.cm-stack .social-avatar { width: 36px; height: 36px; border: 2px solid var(--outline); box-shadow: 0 0 0 2px var(--sea-soft); }
.cm-place-copy { display: grid; min-width: 0; line-height: 1.25; }
.cm-place-copy strong { font-weight: 850; font-size: 15px; }
.cm-place-copy small { color: var(--ink-2); font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-place-send .button, .cm-send { gap: 6px; }
.cm-send .social-i { width: 16px; height: 16px; }
@media (prefers-color-scheme: dark) { .cm-place { color: var(--ink); } }

/* ---------- Oggi: «Gli amici» ---------- */
.cm-activity { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); }
.cm-act { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; border-radius: var(--r-md); color: inherit; text-decoration: none; }
.cm-act:hover { background: var(--surface-2); }
.cm-act .social-avatar { width: 40px; height: 40px; border: 2px solid var(--outline); }
.cm-act-copy { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; }
.cm-act-copy > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.cm-act-copy strong { font-weight: 850; }
.cm-act-copy small { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.cm-act-rating { color: #b98500; margin-right: 6px; letter-spacing: 1px; }
.cm-act-thumb { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 2px solid var(--outline); }
.cm-act-kind { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--accent); }
.cm-act-kind.is-review { color: #b98500; }
.cm-act-kind.is-joined { color: var(--navy); }
.cm-act-kind .social-i { width: 19px; height: 19px; }
@media (prefers-color-scheme: dark) { .cm-act-rating, .cm-act-kind.is-review { color: var(--gold); } .cm-act-kind.is-joined { color: var(--sea); } }
