:root {
  --bg: #0e0f1a;
  --bg-soft: #161827;
  --card: #1c1f31;
  --card-hi: #242843;
  --border: #2c3050;
  --text: #eef0fb;
  --muted: #9aa0c2;
  --accent: #8b6cff;
  --accent-2: #ff5c9d;
  --accent-grad: linear-gradient(135deg, #8b6cff 0%, #ff5c9d 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --red: #ff5c5c;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --modal-x-gap: 42px; /* zona riservata alla X di chiusura (alto-dx): il primo header/titolo di un modale deve lasciarla libera */
  --kb: 0px; /* px coperti dalla tastiera software (aggiornato via visualViewport in app.js) */
  color-scheme: dark; /* controlli nativi (select, date picker, scrollbar) in tema scuro */
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overscroll-behavior-y: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #1a1c33 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(14,15,26,.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.25rem; }
.brand-mark { display: block; flex: none; }
.ob-hero { text-align: center; margin: 6px 0 20px; }
.ob-mark { display: block; margin: 0 auto 14px; filter: drop-shadow(0 10px 24px rgba(139,108,255,.35)); }
.ob-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 8px; }
.ob-grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ob-hero .view-sub { max-width: 32ch; margin-left: auto; margin-right: auto; }
.brand-name { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.city-chip {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 12px; font-size: .85rem; cursor: pointer; font-weight: 600;
}

/* Layout */
/* overflow-x: clip = rete di sicurezza contro lo scroll orizzontale (es. <select> nativi
   larghi quanto l'opzione più lunga nel Profilo). clip non crea un contenitore di scroll,
   quindi non interferisce con l'header sticky né con la tabbar fixed (entrambi fuori da main). */
main { max-width: 680px; margin: 0 auto; padding: 16px; overflow-x: clip; }
/* Desktop: colonna più larga (niente "telefono ingrandito"); lo swipe-deck resta stretto via .deck max-height */
@media (min-width: 1100px) { main { max-width: 880px; } }
.view-title { font-size: 1.5rem; font-weight: 800; margin: 6px 0 4px; }
.view-sub { color: var(--muted); margin: 0 0 16px; font-size: .92rem; }

/* Segmented control */
.segmented { display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin: 0 0 16px; }
.segmented button { flex: 1; border: none; background: none; color: var(--muted); padding: 9px; border-radius: 9px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.segmented button.on { background: var(--accent-grad); color: #fff; }

/* Filters */
.filters { display: grid; gap: 10px; margin-bottom: 18px; }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-row > * { flex: 1; min-width: 130px; }
label.field { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
select, input[type=text], input[type=date], textarea {
  width: 100%; background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; font-size: .95rem; font-family: inherit;
  color-scheme: dark;
}
/* Menu a tendina nativo: forza sfondo scuro e testo chiaro sulle opzioni
   (altrimenti su alcuni browser/OS il popup resta bianco e il testo invisibile). */
select option, select optgroup {
  background: var(--card); color: var(--text);
}
textarea { resize: vertical; min-height: 84px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range-val { font-weight: 700; color: var(--accent); }

/* ===== Swipe deck ===== */
.deck { position: relative; height: min(70vh, calc(100dvh - 230px)); max-height: 560px; margin-top: 6px; }
.swipe-card {
  position: absolute; inset: 0; border-radius: 24px; overflow: hidden;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; will-change: transform; touch-action: pan-y;
}
.swipe-card .hero { height: 46%; display: grid; place-items: center; position: relative; }
.swipe-card .hero .big-emoji { font-size: 6rem; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.swipe-card .hero .compat {
  position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 999px; padding: 7px 12px; font-weight: 800; font-size: .85rem;
}
.swipe-card .body { padding: 16px 18px; flex: 1; overflow-y: auto; background: var(--card); }
.swipe-card .name { font-size: 1.4rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.swipe-card .name .score { font-size: .9rem; }
.swipe-card .loc { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.swipe-card .tagline { font-style: italic; color: var(--text); margin: 10px 0; opacity: .9; }
.swipe-card .common { background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.35); color: #6ee7b7;
  border-radius: 12px; padding: 9px 12px; font-size: .85rem; margin-top: 8px; font-weight: 600; }
.stamp {
  position: absolute; top: 26px; font-size: 1.7rem; font-weight: 900; padding: 6px 16px; border-radius: 12px;
  border: 4px solid; opacity: 0; transform: rotate(-16deg); pointer-events: none; letter-spacing: 1px;
}
.stamp.like { left: 22px; color: var(--ok); border-color: var(--ok); }
.stamp.nope { right: 22px; color: var(--red); border-color: var(--red); transform: rotate(16deg); }

/* P2: "pass" allontanato dal centro (space-between) + meno enfasi del primario "connetti" */
.deck-actions { display: flex; justify-content: space-between; align-items: center; gap: 0; margin: 18px auto 0; max-width: 300px; }
.round-btn {
  width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); font-size: 1.6rem; cursor: pointer; display: grid; place-items: center;
  box-shadow: var(--shadow); transition: transform .12s ease, color .15s ease;
}
.round-btn:active { transform: scale(.9); }
/* pass: più piccolo e silenzioso (muted), il rosso appare solo all'interazione */
.round-btn.pass { color: var(--muted); width: 54px; height: 54px; }
.round-btn.pass:active { color: var(--red); }
.round-btn.like { color: var(--ok); width: 70px; height: 70px; font-size: 1.9rem; }
.round-btn.info { color: var(--accent); }
/* ---- Scopri (Ampio): peek deck, evidenza, mini-onda, segnali scena, nudge, undo, stato ---- */
.round-btn .ic { width: 26px; height: 26px; }
.round-btn.pass .ic { width: 22px; height: 22px; }
.round-btn.like .ic { width: 30px; height: 30px; }
@media (hover: hover) { .round-btn.pass:hover { color: var(--red); } }
.swipe-card.peek { transform: scale(.94) translateY(14px); filter: brightness(.8) saturate(.9); opacity: .9; pointer-events: none; }
.swipe-card .hero .feat-badge { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 5px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: 999px; padding: 5px 11px; font-weight: 800; font-size: .72rem; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.swipe-card .hero .feat-badge .ic { width: 13px; height: 13px; }
.swipe-card .hero .compat { display: inline-flex; align-items: center; gap: 6px; }
.swipe-card .hero .compat .ic { width: 15px; height: 15px; }
.aff-wave.mini { width: 42px; height: 14px; margin: 0; opacity: 1; }
.swipe-card .common { display: flex; align-items: center; gap: 6px; }
.swipe-card .common .ic { width: 14px; height: 14px; flex: 0 0 auto; }
.scene-signals { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.scene-sig { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: rgba(139,108,255,.12); color: #cdbcff; border: 1px solid rgba(139,108,255,.28); }
.scene-sig .ic { width: 12px; height: 12px; }
.disc-nudge { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: 14px; margin: 8px 0 12px; background: linear-gradient(135deg, rgba(139,108,255,.14), rgba(255,92,157,.10)); border: 1px solid rgba(139,108,255,.3); font-size: .86rem; }
.disc-nudge > .ic { width: 20px; height: 20px; flex: 0 0 auto; }
.disc-nudge span { flex: 1 1 auto; }
.disc-nudge .btn { flex: 0 0 auto; }
.deck-undo { display: flex; justify-content: center; margin-top: 12px; }
.deck-undo .ic { width: 14px; height: 14px; }
.disc-empty { text-align: center; }
.disc-empty-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 12px; }
.disc-empty-actions .btn { width: 100%; max-width: 320px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.disc-empty-actions .ic, .disc-filters-toggle .ic, .df-chev .ic { width: 15px; height: 15px; }
.disc-filters-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.df-chev { display: inline-flex; align-items: center; }
.pstate { display: inline-flex; align-items: center; gap: 3px; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
.pstate .ic { width: 11px; height: 11px; }
.pstate.ps-match { background: rgba(139,108,255,.16); color: #cdbcff; }
.pstate.ps-like { background: rgba(255,92,157,.14); color: #ffa3bd; }
.pstate.ps-pass { background: rgba(255,255,255,.07); color: var(--muted); }
.compat-mini .ic { width: 14px; height: 14px; vertical-align: middle; }
.dist .ic { width: 13px; height: 13px; vertical-align: middle; }
/* ---- Fase 0: helper condivisi (stelle, conferma, danger) ---- */
.rating-stars { display: inline-flex; align-items: center; gap: 1px; vertical-align: middle; }
.rating-stars .rs-star { color: var(--border); display: inline-flex; }
.rating-stars .rs-star.on { color: #f5c842; }
.rating-stars .rs-star .ic { width: 14px; height: 14px; }
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm-actions .btn { flex: 1; }
.btn.danger { background: linear-gradient(135deg, #ff5c7a, #ff5c9d); color: #fff; border: none; }
/* ---- Strumenti (Ampio): chip brani, risonanza accordatore ---- */
.song-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.song-chip { font-size: .8rem; font-weight: 600; padding: 7px 11px; border-radius: 10px; cursor: pointer; background: rgba(139,108,255,.12); color: #cdbcff; border: 1px solid rgba(139,108,255,.28); }
.song-chip:active { transform: scale(.96); }
.tuner-meter.resonant { box-shadow: 0 0 18px var(--accent-2, #ff5c9d); }
.tuner-meter.resonant .needle { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.tuner-cents .ic { width: 14px; height: 14px; vertical-align: middle; }
.tuner-cap .ic { width: 13px; height: 13px; vertical-align: middle; }
@media (prefers-reduced-motion: reduce) { .tuner-meter.resonant { box-shadow: 0 0 10px var(--accent-2, #ff5c9d); } }
/* ---- Lezioni (Ampio): badge online, tag completata, chip-button a11y ---- */
.badge-online { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); vertical-align: middle; }
.badge-online .ic { width: 12px; height: 12px; }
.tag.done { background: rgba(139,108,255,.14); color: #cdbcff; border-color: rgba(139,108,255,.35); }
.teacher-card .name { flex-wrap: wrap; }
button.chip { font: inherit; line-height: 1.2; }
/* ---- Palco (Ampio): stato warn, empty-CTA, filtro disponibilità ---- */
.tag.warn { background: rgba(251,191,36,.14); color: #fcd34d; border-color: rgba(251,191,36,.4); }
.aff-note.warn-note::before { background: var(--warn, #fcd34d); }
.aff-note.warn-note { color: #fcd34d; }
.empty-ctas { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.empty-ctas .btn { flex: 0 0 auto; }
.avail-filter { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.avail-filter .ic { width: 14px; height: 14px; }
/* ---- Profilo (Ampio): completezza, repertorio in evidenza, icone hub ---- */
.completion-card .cmp-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin: 10px 0; }
.completion-card .cmp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .4s ease; }
.cmp-steps { display: flex; flex-direction: column; gap: 7px; }
.cmp-step { display: inline-flex; align-items: center; gap: 7px; text-align: left; padding: 9px 11px; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: .86rem; }
.cmp-step .ic { width: 14px; height: 14px; flex: 0 0 auto; }
.cmp-step .cmp-w { margin-left: auto; color: var(--accent); font-weight: 700; font-size: .78rem; }
.cmp-step:active { transform: scale(.99); }
.rep-item.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rep-star { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.rep-star .ic { width: 15px; height: 15px; }
.rep-star.on { color: #f5c842; border-color: #f5c842; }
/* In evidenza = stella PIENA dorata (coerente con il "salvato" della Bacheca). */
.rep-star.on .ic { fill: currentColor; }
.hub-item .ic { width: 22px; height: 22px; }
.hub-row .ic { width: 16px; height: 16px; vertical-align: middle; }
/* ---- Chat (Ampio): liste, timestamp, typing, quick-reply, card ---- */
.thread-row.unread .name { font-weight: 800; }
.thread-time { font-size: .72rem; color: var(--muted); flex: 0 0 auto; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64vw; }
.msg-day-sep { text-align: center; margin: 10px 0 6px; }
.msg-day-sep span { font-size: .7rem; color: var(--muted); background: var(--bg-soft); padding: 2px 10px; border-radius: 999px; }
.bubble .b-time { display: block; font-size: .62rem; opacity: .6; margin-top: 3px; text-align: right; }
.bubble .b-ticks { margin-left: 4px; }
.bubble.typing { display: inline-flex; gap: 4px; align-items: center; }
.bubble.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: typingdot 1s infinite; }
.bubble.typing span:nth-child(2) { animation-delay: .15s; }
.bubble.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typingdot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble.typing span { animation: none; } }
.quick-bar { display: flex; gap: 7px; overflow-x: auto; padding: 8px 0; }
.quick-chip { flex: 0 0 auto; font-size: .8rem; font-weight: 600; padding: 7px 11px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.quick-chip .ic { width: 13px; height: 13px; }
.msg-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.msg-card .mc-head { font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.msg-card .mc-head .ic { width: 15px; height: 15px; }
.msg-card .mc-body { font-size: .85rem; opacity: .95; }
.chat-head .icon-btn .ic { width: 18px; height: 18px; }
.thread-empty { text-align: center; color: var(--muted); padding: 24px 12px; }

/* Match — momento-firma "due voci che entrano in fase" */
.match-overlay {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 24px;
  background:
    radial-gradient(900px 620px at 50% 40%, rgba(139,108,255,.20), transparent 62%),
    rgba(10,11,20,.94);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: fade .3s ease both;
}
.match-stage { position: relative; width: min(360px, 86vw); height: 220px; margin-bottom: 4px; }
.match-wave {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
          mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.match-orbs {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 84px;
  transition: gap .6s cubic-bezier(.2,.9,.3,1.2);
}
.match-overlay.locked .match-orbs { gap: 20px; }
.match-orb { position: relative; }
/* Ingrandimento volutamente maggiore (84→92px) per il momento-firma Match: enfasi dell'aggancio. */
.match-orb .avatar.lg {
  width: 92px; height: 92px; font-size: 2.8rem; border: none;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 0 rgba(139,108,255,0);
  transition: box-shadow .55s ease;
}
.match-orb.me   { animation: orbInL .6s cubic-bezier(.2,.9,.3,1.2) both; }
.match-orb.them { animation: orbInR .6s cubic-bezier(.2,.9,.3,1.2) both; }
.match-overlay.locked .match-orb.me   .avatar.lg { box-shadow: 0 0 0 3px var(--bg), 0 0 38px 6px rgba(139,108,255,.6); }
.match-overlay.locked .match-orb.them .avatar.lg { box-shadow: 0 0 0 3px var(--bg), 0 0 38px 6px rgba(255,92,157,.6); }
@keyframes orbInL { from { transform: translateX(-42px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes orbInR { from { transform: translateX(42px);  opacity: 0; } to { transform: none; opacity: 1; } }
.match-ring {
  position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; margin: -65px 0 0 -65px;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.55); opacity: 0; pointer-events: none;
}
.match-ring.go { animation: ringPulse .9s ease-out forwards; }
@keyframes ringPulse { 0% { transform: scale(.35); opacity: .65; } 100% { transform: scale(1.9); opacity: 0; } }
.match-copy, .match-actions {
  opacity: 0; transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.match-overlay.locked .match-copy    { opacity: 1; transform: none; transition-delay: .08s; }
.match-overlay.locked .match-actions { opacity: 1; transform: none; transition-delay: .18s; }
.match-title {
  font-size: 2.4rem; margin: 0 0 6px; letter-spacing: -.02em; font-weight: 900;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.match-sub { color: var(--muted); margin: 0 auto 16px; max-width: 30ch; font-size: .95rem; }
.match-sub b { color: var(--text); }
.match-actions { display: flex; flex-direction: column; gap: 10px; width: min(320px, 80vw); }
@media (prefers-reduced-motion: reduce) {
  .match-overlay, .match-orb.me, .match-orb.them { animation: none; }
  .match-copy, .match-actions { transition: none; opacity: 1; transform: none; }
}

/* =================== Sistema icone & motivo "risonanza" =================== */
/* Icone vettoriali coerenti (vedi icons.js). Colore via currentColor. */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex: 0 0 auto; }
.ic-lg { width: 22px; height: 22px; }
.btn .ic, .chip .ic, .tag .ic, .segmented button .ic, .section-label .ic,
.city-chip .ic, .round-btn .ic, .notif-row .ic { vertical-align: middle; }
/* glifo a gradiente (solo dove ammesso: firma/risonanza). Richiede #jmGrad in index.html */
.ic.grad { stroke: url(#jmGrad); }
.ic.grad ellipse, .ic.grad circle[fill] { fill: url(#jmGrad); }

/* Toast con icona opzionale (iniettata raw da toast(msg, icon)) */
.toast { display: inline-flex; align-items: center; gap: 9px; }
.toast .ic { width: 18px; height: 18px; }
.toast .ic.ok { color: var(--ok); }
.toast .ic.accent { color: var(--accent); }

/* notif-icon: ora può contenere un SVG coerente */
.notif-icon .ic { width: 20px; height: 20px; color: var(--accent); vertical-align: middle; }

/* Empty-state: illustrazione d'onda sopra al testo (fallback = solo testo) */
.empty-ill { width: 88px; height: 53px; display: block; margin: 0 auto 14px; color: var(--muted); }

/* Spot art (illustrazioni brandizzate) */
.spot { display: block; width: 100%; max-width: 240px; height: auto; margin: 0 auto; }
.empty .spot { max-width: 200px; margin-bottom: 8px; }
.ob-steps { display: flex; gap: 10px; margin: 2px 0 18px; }
.ob-step { flex: 1 1 0; min-width: 0; text-align: center; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 14px; padding: 10px 6px 8px; }
.ob-step .spot { width: auto; height: 58px; }
.ob-step small { display: block; margin-top: 2px; font-size: .68rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
/* P2 onboarding: indicatore di avanzamento + validazione inline */
.ob-progress { margin: 2px 0 16px; }
.ob-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ob-progress-head b { font-size: .82rem; color: var(--text); font-weight: 700; }
.ob-progress-head span { font-size: .8rem; color: var(--accent); font-weight: 800; }
.ob-progress-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border-soft); overflow: hidden; }
.ob-progress-bar > i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--accent-grad); transition: width .35s var(--ease-settle); }
.field-err { color: var(--red); font-size: .78rem; margin: 6px 0 0; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.field-err[hidden] { display: none; }
.field-err .ic { width: 13px; height: 13px; flex: 0 0 auto; }
input.input-error, textarea.input-error { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,92,92,.16); }
@media (prefers-reduced-motion: reduce) { .ob-progress-bar > i { transition: none; } }

/* Reveal Sintonia: onda gradiente che si "disegna" sotto il punteggio */
.aff-wave { display: block; width: 140px; height: 30px; margin: 4px auto 0; opacity: 0; }
.aff-wave path { fill: none; stroke: url(#jmGrad); stroke-width: 2.6; stroke-linecap: round;
  stroke-dasharray: 240; stroke-dashoffset: 240; }
.aff-reveal .aff-wave { animation: affWaveIn .8s ease .15s forwards; }
.aff-reveal .aff-wave path { animation: affWaveDraw 1.05s ease .15s forwards; }
@keyframes affWaveIn { to { opacity: .95; } }
@keyframes affWaveDraw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .aff-wave { opacity: .95; }
  .aff-wave path { stroke-dashoffset: 0; }
  .aff-reveal .aff-wave, .aff-reveal .aff-wave path { animation: none; }
}

/* Cards */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.card.flat { cursor: default; }
.card:active:not(.flat) { transform: scale(.99); }
.card-head { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; background: var(--card-hi); flex: 0 0 auto; border: 2px solid rgba(255,255,255,.15);
}
.avatar.lg { width: 84px; height: 84px; font-size: 2.6rem; }
.card-head .meta { flex: 1; min-width: 0; }
.card-head .name { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.card-head .loc { color: var(--muted); font-size: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: .76rem; padding: 4px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); }
.tag.accent { background: rgba(139,108,255,.16); color: #c3b5ff; border-color: rgba(139,108,255,.4); }
.tag.lvl { background: rgba(52,211,153,.14); color: #6ee7b7; border-color: rgba(52,211,153,.35); }
.score { display: inline-flex; align-items: center; gap: 3px; font-size: .82rem; color: var(--warn); font-weight: 700; }
.dist { font-size: .8rem; color: var(--muted); }

/* Event card */
.slot-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.slot { font-size: .8rem; padding: 6px 11px; border-radius: 10px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.slot.open { background: rgba(255,92,157,.15); color: #ffa3bd; border: 1px dashed var(--accent-2); }
.slot.filled { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); text-decoration: line-through; opacity: .7; }
.event-date { font-size: .82rem; color: var(--accent); font-weight: 700; }

/* ---- Bacheca: card annuncio (reclutamento) ---- */
.ad-card { display: flex; flex-direction: column; gap: 10px; }
.ad-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 8px 28px rgba(139,108,255,.14); }
.ad-card.expired { opacity: .62; }
.ad-top { display: flex; align-items: flex-start; gap: 11px; }
.ad-av { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.ad-head { flex: 1 1 auto; min-width: 0; }
.ad-title { font-weight: 700; font-size: 1.06rem; line-height: 1.25; }
.ad-meta { color: var(--muted); font-size: .84rem; margin-top: 3px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ad-meta .ic { width: 14px; height: 14px; }
.ad-save { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); cursor: pointer; display: grid; place-items: center; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.ad-save .ic { width: 18px; height: 18px; transition: fill .15s ease; }
.ad-save.on { color: var(--accent); border-color: var(--accent); background: rgba(139,108,255,.12); }
/* Salvato = stella PIENA (non solo contorno colorato): feedback immediato e chiaro. */
.ad-save.on .ic { fill: currentColor; }
.ad-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-badge { font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.ad-badge .ic { width: 12px; height: 12px; }
.ad-badge.feat { background: linear-gradient(135deg, rgba(139,108,255,.22), rgba(255,92,157,.22)); color: #cdbcff; border: 1px solid rgba(139,108,255,.4); }
.ad-badge.new { background: var(--accent-2); color: #fff; }
.ad-badge.exp { background: rgba(255,255,255,.08); color: var(--muted); }
.ad-badge.mine { background: rgba(52,211,153,.14); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.ad-when { font-size: .85rem; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ad-when .ic { width: 15px; height: 15px; }
.ad-seek { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ad-seek-lbl { font-size: .78rem; color: var(--muted); font-weight: 600; margin-right: 2px; }
.ad-slot { font-size: .82rem; font-weight: 600; padding: 7px 12px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; background: rgba(255,92,157,.14); color: #ffa3bd; border: 1px dashed var(--accent-2); transition: transform .08s ease, background .15s ease; }
.ad-slot .ic { width: 14px; height: 14px; }
.ad-slot:hover { background: rgba(255,92,157,.24); }
.ad-slot:active { transform: scale(.95); }
.ad-slot:disabled { opacity: .5; cursor: default; }
.ad-full { font-size: .85rem; color: #6ee7b7; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.ad-full .ic { width: 15px; height: 15px; }
.ad-foryou { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-radius: 14px; margin-bottom: 12px; background: linear-gradient(135deg, rgba(139,108,255,.14), rgba(255,92,157,.10)); border: 1px solid rgba(139,108,255,.3); font-size: .9rem; }
.ad-foryou > .ic { width: 20px; height: 20px; flex: 0 0 auto; }
.ad-foryou span { flex: 1 1 auto; }
.ad-foryou .btn { flex: 0 0 auto; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent-grad); color: #fff; border: none; border-radius: 12px;
  padding: 13px 18px; font-size: .98rem; font-weight: 700; cursor: pointer; width: 100%; }
.btn.secondary { background: var(--card-hi); color: var(--text); border: 1px solid var(--border); }
.btn.small { width: auto; padding: 9px 14px; font-size: .85rem; }
.btn:active { opacity: .85; }
.btn:disabled { opacity: .5; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--muted); cursor: pointer; font-size: .85rem; user-select: none; }
.chip.on { background: rgba(139,108,255,.2); color: #fff; border-color: var(--accent); }

/* Livello per-strumento */
/* P2: base condivisa delle righe-lista — un'unica superficie/bordo/raggio (de-drift).
   `.list-item` è la classe-base riusabile; le regole specifiche tengono solo i propri delta.
   (set-row resta volutamente "flat": riga d'impostazione senza chrome da card.) */
.list-item,
.hub-row, .rep-item, .lvl-row, .notif-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); color: var(--text);
}
.lvl-row { margin-bottom: 8px; min-width: 0; }
.lvl-row .lvl-inst { font-weight: 700; font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* min-width:0 → in flex il select può restringersi invece di sforare (i <select> nativi
   sono larghi quanto l'opzione più lunga). Resta comodo (~150px) quando c'è spazio. */
.lvl-row select { width: auto; min-width: 0; max-width: 60%; flex: 0 1 auto; }
/* Stesso principio per i <select> nelle righe label↔controllo (es. "Il tuo strumento" nel Profilo) */
.row-between { min-width: 0; }
.row-between > select { min-width: 0; flex: 0 1 auto; }

/* Riepilogo Profilo Profondo */
.dp-row { margin-bottom: 12px; }
.dp-top { display: flex; justify-content: space-between; font-size: .9rem; font-weight: 600; margin-bottom: 5px; }
.dp-pct { color: var(--muted); font-weight: 700; }
.dp-bar { height: 8px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.dp-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent-grad); }
.dp-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* Repertoire */
.rep-item { margin-bottom: 8px; }
.rep-item .song { font-weight: 600; }
.rep-item .artist { color: var(--muted); font-size: .82rem; }
.key-badge { background: var(--accent-grad); color: #fff; font-weight: 800; font-size: .85rem; border-radius: 9px; padding: 5px 11px; flex: 0 0 auto; letter-spacing: .3px; }
.key-badge.concert { background: rgba(54,209,220,.16); color: var(--accent-3-soft); box-shadow: none; border: 1px solid rgba(54,209,220,.4); font-weight: 700; }
.key-badge.muted { background: rgba(255,255,255,.06); color: var(--muted); box-shadow: none; font-weight: 600; }
.rep-concert { margin-top: 8px; font-size: .86rem; color: var(--muted); }
.rep-concert b { color: var(--accent-3-soft); }
.rep-del { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }

/* Endorsements */
.endo { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin-top: 6px; }
.endo .bar { background: var(--bg-soft); border-radius: 999px; height: 8px; overflow: hidden; align-self: center; }
.endo .bar > i { display: block; height: 100%; background: var(--accent-grad); border-radius: 999px; }
.endo .lbl { font-size: .85rem; color: var(--muted); }
.endo .num { font-weight: 700; font-size: .85rem; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
  padding-bottom: var(--kb); transition: padding-bottom .2s ease; } /* §5: solleva il modale sopra la tastiera */
.modal { background: var(--bg); width: 100%; max-width: 680px; max-height: calc(92vh - var(--kb)); overflow-y: auto;
  border-radius: 22px 22px 0 0; border: 1px solid var(--border); border-bottom: none;
  padding: 8px 18px calc(28px + var(--safe-bottom)); animation: slideup var(--dur-modal) var(--ease-settle); }
.modal .grip { width: 42px; height: 5px; background: var(--border); border-radius: 999px; margin: 8px auto 14px; }
.modal { position: relative; }
.modal-close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--border-soft); background: rgba(255,255,255,.06); color: var(--text);
  font-size: .95rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 6; }
.modal-close:hover { background: rgba(255,255,255,.13); }
/* ===== STANDARD anti-sovrapposizione con la X =====
   La X di chiusura occupa SEMPRE l'angolo alto-destra del modale (zona --modal-x-gap).
   Regola: il primo header/titolo del contenuto le lascia spazio, così niente si sovrappone.
   Tre casi coperti:
   1) titolo semplice (la maggioranza dei modali): primo <h2> → padding a destra;
   2) titolo centrato: padding simmetrico per restare centrato e libero dalla X;
   3) header con azione a destra (Notifiche "Pulisci", menù chat): classe .modal-head. */
.modal > h2:first-of-type { padding-right: var(--modal-x-gap); }
.modal > h2:first-of-type[style*="center"] { padding-left: var(--modal-x-gap); }
.modal-head { padding-right: var(--modal-x-gap); }

/* Schermata pre-lezione brandizzata (videolezione) */
.vl-brand { display: inline-flex; align-items: center; gap: 8px; }
.vl-logo { font-size: 1.6rem; display: inline-flex; }
.vl-logo .ic { width: 22px; height: 22px; }
.vl-name { font-weight: 800; letter-spacing: -.02em; font-size: 1.25rem; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.vl-badge { display: inline-block; margin-top: 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--accent); background: rgba(139,108,255,.12); border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px 10px; }
.modal h2 { margin: 4px 0 2px; padding-right: 40px; }

/* Selettore strumenti riusabile (ricerca + tag + "Altro") */
.ins-picker { display: flex; flex-direction: column; gap: 9px; }
.ins-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-tags:empty { display: none; }
.ins-tag { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: linear-gradient(135deg, rgba(139,108,255,.32), rgba(255,92,157,.28)); color: #fff; }
.ins-tag button { background: none; border: none; color: #fff; cursor: pointer; font-size: .78rem; opacity: .8; padding: 0; line-height: 1; }
.ins-tag button:hover { opacity: 1; }
.ins-input-wrap { position: relative; }
.ins-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 8; max-height: 244px; overflow-y: auto;
  background: var(--card, #171a2b); border: 1px solid var(--border-soft); border-radius: 12px; padding: 6px; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.ins-opt { display: block; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; border: none; background: none; color: var(--text); cursor: pointer; font-size: .9rem; }
.ins-opt:hover { background: rgba(255,255,255,.07); }
.ins-other { color: var(--accent); font-weight: 600; }
.ins-empty { padding: 9px 11px; color: var(--muted); font-size: .85rem; }
.ins-opt.active { background: rgba(255,255,255,.1); }
.ins-opt mark { background: rgba(139,108,255,.35); color: inherit; border-radius: 3px; padding: 0 1px; }
.ins-fam-tag { float: right; color: var(--muted); font-size: .72rem; font-weight: 600; opacity: .85; margin-left: 8px; }
.ins-syn { color: var(--accent); }
.ins-sect { padding: 9px 11px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.ins-fam { border-top: 1px solid var(--border-soft); }
.ins-fam summary { padding: 9px 11px; cursor: pointer; font-weight: 600; font-size: .9rem; list-style: none; }
.ins-fam summary span { color: var(--muted); font-weight: 500; font-size: .78rem; }
.ins-fam summary::-webkit-details-marker { display: none; }

/* Filtri inline in Scopri (sulla pagina del match) */
.disc-filters { margin-bottom: 14px; }
.disc-filters-body { margin-top: 10px; }
.section-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.linkrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.linkrow a { color: #c3b5ff; text-decoration: none; font-size: .9rem; background: var(--card); padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); }

@keyframes slideup { from { transform: translateY(100%);} to { transform: translateY(0);} }
@keyframes fade { from { opacity: 0;} to { opacity: 1;} }
@keyframes pop { 0% { transform: scale(0);} 100% { transform: scale(1);} }

/* Tabbar */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(22,24,39,.92); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + var(--safe-bottom)); max-width: 680px; margin: 0 auto; }
.tab { background: none; border: none; color: var(--muted); cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 1.35rem; padding: 4px 10px; }
.tab small { font-size: .68rem; font-weight: 600; }
.tab.active { color: var(--accent); }
.tab .dot { position: absolute; top: 2px; right: 6px; width: 9px; height: 9px; background: var(--accent-2); border-radius: 50%; }

/* Tools (metronomo/accordatore) */
.tool-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.bpm-display { text-align: center; font-size: 3.6rem; font-weight: 900; letter-spacing: -2px; }
.bpm-display small { font-size: .9rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.beat-dots { display: flex; justify-content: center; gap: 12px; margin: 14px 0; }
.beat-dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--bg-soft); border: 1px solid var(--border); transition: transform .05s, background .05s; }
.beat-dots i.on { background: var(--accent); transform: scale(1.5); }
.beat-dots i.accent.on { background: var(--accent-2); }
.beat-dots i.accent { border-color: var(--accent-2); }
.beat-dots i.accent2 { border-color: var(--accent); }
.beat-dots i.accent2.on { background: var(--accent); box-shadow: 0 0 14px var(--accent); }
.metro-accent { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .88rem; color: var(--muted); }
.bpm-controls { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.bpm-controls button { width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-size: 1.4rem; cursor: pointer; }
.tuner-note { text-align: center; font-size: 4.5rem; font-weight: 900; line-height: 1; margin: 4px 0; }
.tuner-cents { text-align: center; color: var(--muted); font-weight: 700; }
.tuner-meter { height: 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; position: relative; margin: 16px 0 8px; }
.tuner-meter .center { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--ok); }
.tuner-meter .needle { position: absolute; top: -3px; width: 14px; height: 18px; border-radius: 6px; background: var(--accent-2); transform: translateX(-50%); left: 50%; transition: left .08s ease; }
.tuner-meter.in .needle { background: var(--ok); }
/* Accordatore: doppia nota (reale + letta), stile Soundcorset */
.tuner-dual { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.tuner-side { flex: 1; min-width: 0; text-align: center; }
.tuner-cap { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; }
.tuner-dual .tuner-note { font-size: 3rem; margin: 2px 0 0; }
.tuner-note.alt { background: none; -webkit-background-clip: initial; background-clip: initial; color: var(--accent-3-soft); }
.tuner-side.played { border-left: 1px solid var(--border-soft); }
.ref-tones { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ref-tones button { min-width: 48px; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); font-weight: 800; cursor: pointer; }
.ref-tones button.on { background: var(--accent-grad); color: #fff; }

/* Misc */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.badge-new { background: var(--accent-2); color: #fff; font-size: .65rem; padding: 2px 7px; border-radius: 999px; font-weight: 700; }
.hint { background: rgba(139,108,255,.1); border: 1px solid rgba(139,108,255,.3); border-radius: 12px; padding: 12px 14px; font-size: .85rem; color: #c3b5ff; margin-bottom: 16px; }
.toast { position: fixed; bottom: calc(96px + var(--kb) + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--card-hi); color: var(--text); padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 80; font-size: .9rem; animation: fade .2s; max-width: 90%;
  display: inline-flex; align-items: center; gap: 8px; }
.toast.error { border-color: var(--accent-2); }
.toast .ic { width: 16px; height: 16px; flex: 0 0 auto; }
.toast-action { background: none; border: none; color: var(--accent); font-weight: 800; cursor: pointer; padding: 2px 4px; flex: 0 0 auto; }
.msg-thread { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 80%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.35; }
.bubble.them { background: var(--card); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.me { background: var(--accent-grad); align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input { flex: 1; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-rep { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
@media (max-width: 480px){ .add-rep { grid-template-columns: 1fr 1fr; } }
.locked { text-align: center; color: var(--muted); padding: 14px; border: 1px dashed var(--border); border-radius: 12px; }

/* Profilo Profondo & Sintonia */
.lk { margin: 14px 0; }
.lk-q { font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.likert { display: flex; gap: 6px; }
.likert button { flex: 1; padding: 11px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); font-weight: 700; cursor: pointer; }
.likert button.on { background: var(--accent-grad); color: #fff; border-color: transparent; }
.lk-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: 4px; }
.aff-note { font-size: .8rem; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 12px; line-height: 1.45; }
.aff-score { text-align: center; font-size: 2.2rem; font-weight: 900; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.warn-chip { background: rgba(251,191,36,.14); border: 1px solid rgba(251,191,36,.4); color: #fcd34d; border-radius: 10px; padding: 8px 11px; font-size: .82rem; margin-top: 8px; }

/* =========================================================================
   POLISH LAYER v2 — rifinitura grafica "pro" (sovrascrive le regole sopra)
   ========================================================================= */
:root {
  --bg: #0b0c14;
  --bg-soft: #161a2b;          /* superficie soft solida */
  --surface-solid: #171a2b;
  --card: #181b2bcc;
  --card-hi: #20243c;
  --border: #2a2f52;
  --border-soft: #ffffff14;
  --text: #f1f3ff;
  --muted: #969cc4;
  --accent: #8b6cff;
  --accent-2: #ff5c9d;
  --accent-3: #36d1dc;
  --accent-grad: linear-gradient(135deg, #8b6cff 0%, #ff5c9d 100%);
  /* Variante "profonda" della firma: solo per superfici attive con testo bianco che richiedono ≥4.5:1 (es. tab attivo). */
  --accent-grad-deep: linear-gradient(135deg, #6d4bd8, #c0307a);
  --accent-3-soft: #8be9f0;    /* ciano testo (variante chiara di --accent-3) */
  --glow: 0 8px 30px rgba(139,108,255,.35);
  --radius: 18px;
  --shadow: 0 10px 34px rgba(0,0,0,.45);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.3);
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Motion language (vedi STYLEGUIDE.md): 4 durate base + 3 firma, 3 easing */
  --dur-tap: 120ms; --dur-base: 200ms; --dur-modal: 250ms; --dur-sheet: 280ms;
  --dur-match: 600ms; --dur-aff: 850ms; --dur-pulse: 1700ms;
  --ease-settle: ease-out; --ease-loop: ease-in-out; --ease-spring: cubic-bezier(.2,.9,.3,1.2);
  /* z-index layers (scala documentata) */
  --z-header: 20; --z-tabbar: 30; --z-modal-backdrop: 50; --z-modal: 60; --z-overlay: 70; --z-toast: 80; --z-tooltip: 90;
  --z-system: 100;   /* banner di sistema (offline): sopra i modali, sempre visibile */
}

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 8% -8%, rgba(139,108,255,.20), transparent 60%),
    radial-gradient(800px 520px at 100% 4%, rgba(255,92,157,.16), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(54,209,220,.10), transparent 60%),
    #0b0c14;
  background-attachment: fixed;
}

/* Tipografia */
.view-title { letter-spacing: -.02em; font-weight: 800; }
.brand-name { letter-spacing: -.02em; }
h2 { letter-spacing: -.01em; }

/* Header glass */
.app-header { background: rgba(11,12,20,.62); border-bottom: 1px solid var(--border-soft); }
.city-chip { background: rgba(255,255,255,.06); border-color: var(--border-soft); backdrop-filter: blur(8px); transition: transform .12s, background .2s; }
.city-chip:active { transform: scale(.96); }

/* Superfici a vetro */
select, input[type=text], input[type=date], textarea {
  background: rgba(255,255,255,.05); border-color: var(--border-soft);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139,108,255,.18); background: rgba(255,255,255,.07);
}
/* Focus visibile da tastiera su tutti i controlli (a11y) */
button:focus-visible, a:focus-visible, .tab:focus-visible, .chip:focus-visible,
.icon-btn:focus-visible, .round-btn:focus-visible, [role="button"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px;
}

/* Card piu' "premium" */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)), var(--surface-solid);
  border: 1px solid var(--border-soft); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover:not(.flat) { transform: translateY(-2px); border-color: rgba(139,108,255,.5); box-shadow: var(--shadow); }
.card:active:not(.flat) { transform: scale(.99); }

/* Pulsanti */
.btn {
  background: var(--accent-grad); border-radius: 14px; letter-spacing: .01em;
  box-shadow: var(--glow); position: relative; overflow: hidden;
  transition: transform .14s ease, box-shadow .2s, filter .2s;
}
.btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.22), transparent 45%); pointer-events: none; }
.btn:hover { filter: brightness(1.06); box-shadow: 0 10px 36px rgba(139,108,255,.5); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.secondary { background: rgba(255,255,255,.06); box-shadow: none; border: 1px solid var(--border-soft); }
.btn.secondary::after { display: none; }

/* Chips & tag */
.chip { background: rgba(255,255,255,.05); border-color: var(--border-soft); transition: transform .12s, background .2s, border-color .2s; }
.chip:active { transform: scale(.95); }
.chip.on { background: linear-gradient(135deg, rgba(139,108,255,.32), rgba(255,92,157,.28)); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(139,108,255,.3); }
.tag { background: rgba(255,255,255,.045); border-color: var(--border-soft); }

/* Segmented */
.segmented { background: rgba(255,255,255,.045); border-color: var(--border-soft); }
.segmented button.on { box-shadow: var(--glow); }

/* Avatar con anello */
.avatar { border: 2px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15), 0 4px 14px rgba(0,0,0,.35); }
.avatar.lg { box-shadow: inset 0 0 0 3px rgba(0,0,0,.15), 0 10px 26px rgba(0,0,0,.45); }

/* Swipe card: profondita' + overlay */
.swipe-card { border-radius: 26px; border: 1px solid var(--border-soft); box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.swipe-card .hero { height: 48%; }
.swipe-card .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.35)); }
.swipe-card .hero .big-emoji { font-size: 6.4rem; animation: float 4s ease-in-out infinite; }
.swipe-card .hero .compat { background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.3); box-shadow: var(--shadow-sm); font-size: .9rem; }
.swipe-card .body { background: var(--surface-solid); }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* Pulsanti rotondi del deck */
.round-btn { background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .2s, background .2s; }
.round-btn.like { background: linear-gradient(135deg, rgba(52,211,153,.25), rgba(54,209,220,.2)); box-shadow: 0 8px 24px rgba(52,211,153,.3); }
.round-btn.pass:hover { box-shadow: 0 8px 24px rgba(255,92,92,.25); }
.round-btn:active { transform: scale(.88); }

/* Key badge & score */
.key-badge { box-shadow: 0 4px 12px rgba(139,108,255,.35); }
.aff-score { font-size: 2.4rem; letter-spacing: -.02em; }

/* Tab bar: indicatore attivo */
.tabbar { background: rgba(13,14,24,.8); border-top: 1px solid var(--border-soft); }
.tab { position: relative; transition: color .2s, transform .12s; }
.tab:active { transform: scale(.92); }
.tab.active::after {
  content: ""; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 3px; border-radius: 3px; background: var(--accent-grad); box-shadow: var(--glow);
}

/* Modal */
.modal { background: linear-gradient(180deg, #14162a, #0d0e18); border-color: var(--border-soft); }
.modal .grip { background: rgba(255,255,255,.18); }

/* Scrollbar discreta */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; }

/* Endorsement bar piu' viva */
.endo .bar { background: rgba(255,255,255,.06); }
.hint { background: linear-gradient(135deg, rgba(139,108,255,.14), rgba(255,92,157,.1)); border-color: rgba(139,108,255,.3); }
/* Pattern condiviso aiuto/spiegazione: ancora-accento a sinistra (strutturale, non decorativa) */
.hint, .aff-note { position: relative; padding-left: 16px; }
.hint::before, .aff-note::before { content: ""; position: absolute; left: 7px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }

@media (prefers-reduced-motion: reduce) { .swipe-card .hero .big-emoji { animation: none; } }

/* Insight della Sintonia */
.insight { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 14px;
  border-radius: 16px; background: linear-gradient(135deg, rgba(139,108,255,.18), rgba(255,92,157,.14));
  border: 1px solid rgba(139,108,255,.4); box-shadow: var(--shadow-sm); line-height: 1.5; }
.insight-emoji { font-size: 1.6rem; line-height: 1; }
.resonate { margin-top: 10px; font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.resonate button { background: rgba(255,255,255,.07); border: 1px solid var(--border-soft); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.resonate button:active { transform: scale(.95); }

/* =========================================================================
   POLISH LAYER v3 — dock flottante (fix tap su mobile) + avatar premium
   ========================================================================= */
body { padding-bottom: calc(92px + var(--safe-bottom)); }

/* Tab bar ancorata in basso: a tutta larghezza, solida, con safe-area (niente "dock" flottante) */
.tabbar {
  left: 0; right: 0; bottom: 0;
  border-radius: 0;
  background: rgba(14,15,26,.94); backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(0,0,0,.45);
  padding: 7px 10px calc(7px + var(--safe-bottom)); gap: 4px;
}
.tab {
  flex: 1 1 0; min-width: 0; min-height: 54px; border-radius: 18px; padding: 6px 2px; gap: 3px;
  touch-action: manipulation; justify-content: center; overflow: hidden;
}
.tab span { font-size: 1.3rem; line-height: 1; }
.tab small { font-size: .62rem; letter-spacing: .01em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.active { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); background: var(--accent-grad-deep); box-shadow: 0 8px 20px rgba(139,108,255,.5); } /* variante profonda della firma: bianco ≥4.5:1 (WCAG AA) */
.tab.active::after { content: none; }   /* rimuove l'indicatore a barretta della v2 */
.tab .dot { top: 8px; right: calc(50% - 18px); }

/* Avatar premium: profondità, anello e riflesso "glass" */
.avatar { position: relative; border: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.12), inset 0 -10px 18px rgba(0,0,0,.28); }
.avatar::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.05) 38%, transparent 60%); }
.avatar.lg { box-shadow: 0 14px 34px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.14), inset 0 -16px 28px rgba(0,0,0,.3); }
.avatar > * { position: relative; z-index: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }

/* Hero swipe card: emoji con alone premium */
.swipe-card .hero .big-emoji { filter: drop-shadow(0 10px 22px rgba(0,0,0,.5)); }

/* Foto profilo */
.avatar.photo { background-size: cover; background-position: center; background-repeat: no-repeat; }
.avatar-wrap { position: relative; display: inline-grid; place-items: center; cursor: pointer; }
.avatar-wrap .cam { position: absolute; bottom: 2px; right: 2px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: .9rem; background: var(--accent-grad);
  border: 2px solid var(--bg); box-shadow: var(--shadow-sm); }

/* Dock: compatta icone/etichette (safe-area SEMPRE preservata sul fondo) */
.tabbar { max-width: 560px; padding: 7px 7px calc(7px + var(--safe-bottom)); gap: 2px; }
.tab { min-height: 50px; padding: 5px 0; border-radius: 15px; }
.tab span { font-size: 1.18rem; }
.tab small { font-size: .58rem; }
/* Schermi stretti: 5 voci → etichette un filo più piccole senza tagliarsi */
@media (max-width: 400px) {
  .tabbar { gap: 1px; padding: 6px 4px calc(6px + var(--safe-bottom)); }
  .tab { border-radius: 13px; }
  .tab span { font-size: 1.05rem; }
  .tab small { font-size: .6rem; letter-spacing: 0; }  /* mai sotto ~.6rem: leggibilità label nav persistente */
}

/* =========================================================================
   POLISH v4 — Cassetta attrezzi PRO + fix pulsante AVVIA del metronomo
   ========================================================================= */
.tool-card { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)), var(--surface-solid);
  border: 1px solid var(--border-soft); border-radius: 22px; box-shadow: var(--shadow); }

/* Numero BPM a gradiente */
.bpm-display { letter-spacing: -3px; line-height: 1; }
.bpm-display #bpmVal { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Beat dots con glow */
.beat-dots i { width: 14px; height: 14px; border: 1px solid var(--border-soft); background: rgba(255,255,255,.06); transition: transform .06s ease, background .06s, box-shadow .06s; }
.beat-dots i.on { background: var(--accent); box-shadow: 0 0 14px var(--accent); transform: scale(1.6); }
.beat-dots i.accent.on { background: var(--accent-2); box-shadow: 0 0 14px var(--accent-2); }

/* FIX: la dimensione fissa vale solo per i tasti +/-, non per il pulsante Avvia */
.bpm-controls { gap: 14px; margin: 14px 0 6px; }
.bpm-controls button:not(.btn) {
  width: 54px; height: 54px; min-width: 54px; border-radius: 16px; font-size: 1.5rem; font-weight: 700;
  background: rgba(255,255,255,.06); border: 1px solid var(--border-soft); color: var(--text);
  display: grid; place-items: center; transition: transform .1s, background .2s;
}
.bpm-controls button:not(.btn):active { transform: scale(.9); background: rgba(255,255,255,.12); }
.bpm-controls .btn { flex: 1; width: auto; height: 54px; font-size: 1.05rem; }

/* Tuner PRO */
.tuner-note { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tuner-meter { height: 14px; background: rgba(255,255,255,.06); border-color: var(--border-soft); }
.tuner-meter.in .needle { box-shadow: 0 0 16px var(--ok); }
.ref-tones button { background: rgba(255,255,255,.06); border-color: var(--border-soft); transition: transform .1s; }
.ref-tones button:active { transform: scale(.94); }

/* ===== Notifiche (campanella header) ===== */
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions[hidden] { display: none; }
.icon-btn {
  position: relative; background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; width: 44px; height: 44px;
  font-size: 1.05rem; cursor: pointer; display: grid; place-items: center;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot { position: absolute; top: 6px; right: 7px; width: 9px; height: 9px; background: var(--accent-2); border-radius: 50%; border: 2px solid var(--bg); }

/* Bottone avatar in header → apre il drawer destro. Solo desktop (vedi @media ≥760px). */
#meBtn { display: none; }
.me-btn { padding: 0; overflow: hidden; }
.me-btn .avatar { width: 100%; height: 100%; font-size: 1.05rem; border: none; box-shadow: none; }
.me-btn .avatar::after { display: none; }
.me-btn[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }

/* ===== Drawer destro (desktop): profilo, menù core, impostazioni ===== */
.drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px); display: flex; justify-content: flex-end; animation: fade var(--dur-base) ease; }
.drawer { width: min(380px, 92vw); max-width: 380px; height: 100%; overflow-y: auto;
  background: var(--surface-solid, var(--card)); border-left: 1px solid var(--border);
  box-shadow: -18px 0 50px rgba(0,0,0,.5); padding: 14px 16px calc(20px + var(--safe-bottom));
  animation: drawerIn var(--dur-sheet, .28s) var(--ease-settle, ease) both; }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer { animation: fade var(--dur-base) ease both; } .drawer-backdrop { animation: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.drawer-head b { font-size: 1.1rem; }
.drawer-head .modal-close { position: static; }
/* Riga identità: avatar grande + nome + meta, cliccabile per andare al profilo completo */
.drawer-id { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); border-radius: 16px;
  padding: 12px; cursor: pointer; color: var(--text); margin-bottom: 12px; }
.drawer-id:active { transform: scale(.99); }
.drawer-id .avatar { width: 56px; height: 56px; font-size: 1.7rem; }
.drawer-id-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-id-txt b { font-size: 1.02rem; display: flex; align-items: center; }
.drawer-id-txt .loc { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-id .hub-chev { color: var(--muted); margin-left: auto; align-self: center; }
.drawer .hub-grid { margin: 0 0 12px; }
.drawer .section-label { margin-top: 14px; }
/* Spazi promossi nativi (house ads): coerenti con le card del feed, MAI col gradiente-firma (§11). */
.promo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.promo-tag { font-size: .68rem; font-weight: 700; letter-spacing: .02em; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.promo-info { background: none; border: none; color: var(--muted); padding: 4px; cursor: pointer; display: inline-grid; place-items: center; border-radius: 8px; }
.promo-info .ic { width: 16px; height: 16px; }
@media (hover: hover) { .promo-info:hover { color: var(--text); } }
.promo-av { background: var(--card-hi); color: var(--accent); display: grid; place-items: center; }
.promo-av .ic { width: 22px; height: 22px; }
/* Badge verificato (fiducia): pastiglia accento con check, accanto al nome. */
.verified-badge { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; vertical-align: middle; margin-left: 5px; }
.verified-badge .ic { width: 13px; height: 13px; }
/* Guida interattiva una-tantum (stepped-modal). Niente gradiente-firma se non sulla CTA finale (§11). */
.guide { position: relative; }
/* La guida si chiude con la X standard del modale (niente più "Salta" sovrapposto alla X). */
.guide-art { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 64px; margin: 6px 0 12px; }
.guide-art > svg { max-height: 96px; width: auto; }
.guide-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--card-hi); color: var(--accent); }
.guide-icon .ic { width: 28px; height: 28px; }
.guide-step h2 { margin: 0 0 6px; text-align: center; }
.guide-copy { text-align: center; color: var(--muted); line-height: 1.5; margin: 0; }
.guide-step { animation: guideFade var(--dur-base) var(--ease-settle); }
@keyframes guideFade { from { opacity: 0 } to { opacity: 1 } }
.guide-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.guide-foot .btn { flex: 0 0 auto; }
.guide-dots { display: flex; gap: 6px; flex: 1; justify-content: center; }
.guide-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border); transition: background var(--dur-base) var(--ease-settle); }
.guide-dots i.on { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .guide-step { animation: none; } .guide-dots i { transition: none; } }
.notif-row { justify-content: flex-start; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.notif-row.unread { border-color: var(--accent); position: relative; }
/* Cue non solo-colore (WCAG 1.4.1): un pallino di forma, oltre al bordo accento, marca i non letti. */
.notif-row.unread::after { content: ""; position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); }
.notif-row.tap { cursor: pointer; }
.notif-row.tap:active { transform: scale(.99); }
.notif-icon { font-size: 1.3rem; line-height: 1.4; }
.notif-time { color: var(--muted); font-size: .76rem; margin-top: 3px; }

/* ===== Feed sociale ===== */
#composer textarea { min-height: 64px; margin-top: 10px; }
/* Composer: 3 accessori uniformi (icona+label, target ≥44px) + 1 solo primario "Pubblica" */
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.composer-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-tool { min-height: 44px; gap: 6px; }
/* margin-left:auto: "Pubblica" resta a destra sia in riga sia quando va a capo da solo */
.composer-send { min-height: 44px; flex: 0 0 auto; gap: 6px; margin-left: auto; }
.post .post-text { line-height: 1.5; margin: 4px 0 0; white-space: pre-wrap; word-break: break-word; }
.post-img { width: 100%; border-radius: 12px; margin-top: 10px; display: block; }
#postPreview .post-img { max-height: 220px; object-fit: cover; }
/* Autore cliccabile + carosello foto (stile Instagram) */
.card-head.author-clickable { cursor: pointer; }
.post-carousel { position: relative; overflow: hidden; border-radius: 12px; margin-top: 10px; touch-action: pan-y; }
.pc-track { display: flex; transition: transform .25s ease; }
.pc-track .post-img { min-width: 100%; width: 100%; margin: 0; border-radius: 0; }
.pc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 999px; border: none;
  background: rgba(0,0,0,.5); color: #fff; cursor: pointer; font-size: 1.3rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pc-prev { left: 8px; } .pc-next { right: 8px; }
.pc-count { position: absolute; top: 8px; right: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.pc-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); }
.pc-dots i.on { background: #fff; }
.composer-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.composer-thumb { position: relative; width: 66px; height: 66px; border-radius: 10px; overflow: hidden; }
.composer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.composer-thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .7rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.post-actions { display: flex; gap: 10px; margin-top: 12px; }
.post-act { flex: 1; background: var(--bg-soft); border: 1px solid var(--border); color: var(--muted); border-radius: 12px; padding: 8px; font-weight: 700; cursor: pointer; font-size: .9rem; }
.post-act.liked { color: var(--accent); border-color: var(--accent); }
.post-act:active { transform: scale(.97); }
/* ---- Feed: tipi di post, allegati jam, hashtag, in-risonanza ---- */
.post-act { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.post-act .ic { width: 16px; height: 16px; }
.post-more { flex: 0 0 46px !important; }
.composer-types { margin: 10px 0 4px; }
.post-type-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-bottom: 8px; background: rgba(139,108,255,.14); color: #cdbcff; border: 1px solid rgba(139,108,255,.32); }
.post-type-badge .ic { width: 13px; height: 13px; }
.post-type-badge.t-live { background: rgba(255,92,157,.14); color: #ffa3bd; border-color: rgba(255,92,157,.34); }
.post-type-badge.t-traguardo { background: rgba(245,200,66,.14); color: #f5d06b; border-color: rgba(245,200,66,.34); }
.post-type-badge.t-cerco { background: rgba(52,211,153,.12); color: #6ee7b7; border-color: rgba(52,211,153,.3); }
.post.type-jam-event { border-color: rgba(139,108,255,.34); }
.in-ris { display: inline-flex; align-items: center; gap: 3px; font-size: .66rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: linear-gradient(135deg, rgba(139,108,255,.2), rgba(255,92,157,.2)); color: #cdbcff; vertical-align: middle; }
.in-ris .ic { width: 11px; height: 11px; }
.htag { color: var(--accent); font-weight: 600; cursor: pointer; }
.mention { color: var(--accent-2); font-weight: 600; }
.jam-embed { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; margin-top: 10px; padding: 10px 12px; border-radius: 13px; background: var(--bg-soft); border: 1px solid var(--border); cursor: default; }
.jam-embed.tap { cursor: pointer; }
.jam-embed.tap:active { transform: scale(.99); }
.je-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.je-ic .ic { width: 18px; height: 18px; }
.je-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.je-meta b { font-size: .92rem; }
.je-meta span { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.je-meta .ic { width: 13px; height: 13px; }
.je-go { flex: 0 0 auto; color: var(--muted); transform: rotate(45deg); }
.je-go .ic { width: 16px; height: 16px; }
.jam-embed [data-rmjam] { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.jam-embed [data-rmjam] .ic { width: 14px; height: 14px; }
.jam-pick { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 11px 13px; margin-bottom: 8px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); cursor: pointer; }
.jam-pick b { font-size: .95rem; }
.jam-pick span { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.jam-pick span .ic { width: 13px; height: 13px; }
.jam-pick:active { transform: scale(.99); }
.post-comments { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.comment { font-size: .9rem; line-height: 1.45; margin-bottom: 7px; }
.add-comment { display: flex; gap: 8px; margin-top: 8px; }
.add-comment input { flex: 1; }

/* ===== Mappa jam ===== */
.jam-map {
  position: relative; height: 220px; border-radius: var(--radius); margin-bottom: 8px; overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(120px 120px at 30% 35%, rgba(139,108,255,.18), transparent 70%),
    radial-gradient(140px 140px at 75% 70%, rgba(255,92,157,.16), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 28px),
    var(--bg-soft);
}
.jam-me { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); font-size: 1.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
/* Mappa jam: linguetta (bottom-sheet) con maniglia — la lista si espone su richiesta */
.jam-map-wrap { position: relative; margin-bottom: 8px; }
.jam-map-wrap .jam-map { height: 380px; margin-bottom: 0; background: #0b0c14; z-index: 0; }
.jam-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; z-index: 2;
  background: var(--surface-solid, #171a2b); border: 1px solid var(--border-soft); border-bottom: none;
  border-radius: 18px 18px 0 0; box-shadow: 0 -12px 30px rgba(0,0,0,.45);
  transform: translateY(calc(100% - 94px)); transition: transform var(--dur-sheet) var(--ease-settle);
  display: flex; flex-direction: column; }
.jam-sheet.open { transform: translateY(0); }
.jam-sheet-grip { padding: 9px 0 2px; display: flex; justify-content: center; cursor: grab; touch-action: none; }
.jam-sheet-grip .grip-bar { width: 42px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.28); }
.jam-sheet-head { text-align: center; font-weight: 700; font-size: .9rem; padding: 4px 12px 8px; }
.jam-sheet-list { overflow-y: auto; padding: 0 12px 14px; flex: 1; }
.jam-pin {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  padding: 2.5px; cursor: pointer;
  background: var(--accent-grad); box-shadow: 0 5px 14px rgba(0,0,0,.55);
}
.jam-pin > span { display: grid; place-items: center; width: 100%; height: 100%;
  border-radius: 50%; background: var(--card); font-size: 1.02rem; }
.jam-pin::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid #ff5c9d; }
.jam-pin.ok { background: linear-gradient(135deg, #34d399, #1aa88f); }
.jam-pin.ok::after { border-top-color: #1aa88f; }
.jam-pin:active { transform: scale(.92); }
.jam-divicon { background: transparent !important; border: none !important; } /* niente box bianco di Leaflet */
/* Pulsante "la mia posizione" + controlli Leaflet in tema scuro */
.map-search { display: flex; gap: 8px; margin-bottom: 8px; }
.map-search input { flex: 1; }
.leaflet-popup-content-wrapper, .leaflet-tooltip { background: var(--card) !important; color: var(--text) !important; border: 1px solid var(--border-soft) !important; }
.leaflet-popup-tip { background: var(--card) !important; }
.map-locate { position: absolute; top: 10px; right: 10px; z-index: 3; width: 38px; height: 38px; border-radius: 999px;
  background: var(--card); color: var(--text); border: 1px solid var(--border-soft); cursor: pointer; font-size: 1.1rem; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.leaflet-control-attribution { background: rgba(0,0,0,.55) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--accent-3-soft) !important; }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--card) !important; color: var(--text) !important; border-color: var(--border-soft) !important; }
/* I tile CARTO "dark_all" su tema scuro sono poco leggibili: alzo soprattutto il
   CONTRASTO per far emergere le strade (filtro uniforme per-tile → nessuna cucitura). */
.leaflet-tile { filter: brightness(1.2) contrast(1.5) saturate(1.05); }
/* Velo nei colori del brand (viola→rosa) sopra le sole tile (z-index tra tilePane 200 e
   markerPane 600): in soft-light tinge la mappa "come la nostra" senza spegnere le strade,
   e lascia intatti pin/controlli. pointer-events:none → mappa interattiva. */
.jam-map::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 250;
  background: radial-gradient(130% 110% at 50% 0%, rgba(139,108,255,.34), rgba(255,92,157,.18) 58%, rgba(139,108,255,.10));
  mix-blend-mode: soft-light; }

/* ===== Lezioni (slot a calendario) ===== */
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.slot-btn {
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 12px; font-weight: 700; font-size: .85rem; cursor: pointer; line-height: 1.3;
}
.slot-btn:active { transform: scale(.96); }

/* ===== Accordatore: nota letta (trasposizione) ===== */
.tuner-written { text-align: center; color: var(--accent); font-weight: 800; margin-top: -2px; margin-bottom: 4px; }

/* ===== Feed: emoji bar + reaction picker ===== */
.emoji-bar, .react-picker {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; margin: 8px 0;
}
.emoji-bar[hidden], .react-picker[hidden] { display: none; }
.emoji-bar button, .react-picker button {
  background: none; border: none; font-size: 1.35rem; line-height: 1; cursor: pointer;
  padding: 5px 6px; border-radius: 8px; transition: transform .1s, background .15s;
}
.emoji-bar button:active, .react-picker button:active { transform: scale(1.25); background: var(--card-hi); }
.react-picker { justify-content: space-between; }
.post-act.reacted { color: var(--accent); border-color: var(--accent); }

/* ===== Navigazione: shrink-on-scroll (mobile) + sidebar verticale (desktop) ===== */
.tabbar { transition: transform var(--dur-sheet) var(--ease-settle), padding var(--dur-base) ease; }
.tab small { display: block; text-align: center; transition: opacity .18s ease, max-height .18s ease; max-height: 20px; }
/* Shrink-on-scroll: collassa a sole icone — le 5 destinazioni restano SEMPRE visibili */
.tabbar.nav-shrink { padding-top: 3px; padding-bottom: calc(3px + var(--safe-bottom)); }
.tabbar.nav-shrink .tab { min-height: 44px; }   /* touch target ≥44 anche da collassato */
.tabbar.nav-shrink .tab small { max-height: 0; opacity: 0; overflow: hidden; }
.tabbar.nav-hidden { transform: translateY(170%); }
/* P2: header condensabile su scroll, in coppia con lo shrink della tabbar (stesso handler).
   Su desktop non si attiva (lo stesso gating innerWidth>=760 rimuove la classe). */
.app-header { transition: padding var(--dur-base) ease, transform var(--dur-sheet) var(--ease-settle); will-change: transform; }
.app-header .brand-mark, .app-header .brand-name { transition: width var(--dur-base) ease, height var(--dur-base) ease, font-size var(--dur-base) ease; }
.app-header.header-shrink { padding-top: 8px; padding-bottom: 8px; }
.app-header.header-shrink .brand-mark { width: 24px; height: 24px; }
.app-header.header-shrink .brand-name { font-size: 1.05rem; }
/* Auto-hide premium (solo mobile): scrollando giù l'header esce tutto fuori schermo;
   torna appena scorri su. Slide intero, niente stati intermedi (no sfarfallio). */
.app-header.header-hidden { transform: translateY(-100%); }
/* Desktop: l'header È la top bar di navigazione → non si nasconde MAI. */
@media (min-width: 760px) { .app-header.header-hidden { transform: none; } }
/* prefers-reduced-motion: niente animazioni della nav (coerente col resto) */
@media (prefers-reduced-motion: reduce) { .tabbar, .tab small, .app-header, .app-header .brand-mark, .app-header .brand-name { transition: none; } }
/* Tab "genitore" (sei in Palco/Lezioni/Strumenti): accent + cue non cromatico */
.tab.parent-active { color: var(--accent); }
.tab.parent-active::after { content: ""; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 16px; height: 2px; border-radius: 2px; background: var(--accent); }
/* Onboarding: niente tabbar (e niente spazio riservato) */
body.onboarding .tabbar { display: none; }
body.onboarding { padding-bottom: 24px; }
/* Scroll-lock dello sfondo quando un modale/overlay è aperto */
body.modal-open { overflow: hidden; }
/* ---- P1: hover per puntatore + touch target ---- */
@media (hover: hover) {
  .chip:hover, .segmented button:hover, .hub-item:hover, .hub-row:hover, .quick-chip:hover, .song-chip:hover, .cmp-step:hover, .jam-pick:hover, .thread-row:hover, .ad-slot:hover, .round-btn:hover, .rep-star:hover, .ad-save:hover { filter: brightness(1.12); }
}
@media (hover: hover) and (min-width: 760px) { .tab:hover { background: rgba(255,255,255,.06); } }
.rep-star, .rep-del { min-width: 40px; min-height: 40px; }
.ad-save { min-width: 44px; min-height: 44px; }
.chip, .quick-chip, .city-chip { min-height: 36px; }
/* ---- P1: transizione d'ingresso vista ---- */
#app.view-enter { animation: viewEnter .2s ease both; }
@keyframes viewEnter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #app.view-enter { animation: none; } }
/* ---- P1: stato di caricamento (spinner) ---- */
.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .is-loading::after { animation: none; } }
/* Live-region screen-reader */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
/* Tastiera aperta su mobile: nascondi la tabbar */
@media (max-width: 759px) { body.kb-open .tabbar { transform: translateY(170%); } }
/* rail-brand: testata del rail desktop; nascosta (e senza spazio) sul dock mobile.
   Base PRIMA del media query, così l'override a display:flex (≥760px) vince per ordine. */
.rail-brand { display: none; }
/* ≥760px: niente più rail laterale invasivo. Top bar in stile Facebook —
   brand a sinistra, nav principale centrata, azioni+avatar a destra (la stessa
   banda della header). Il profilo e il menù core vivono nel drawer destro (#meBtn). */
@media (min-width: 760px) {
  body { padding-bottom: 24px; }
  /* La header diventa la top bar: altezza minima stabile così la nav fissa ci si allinea */
  .app-header { padding: 8px 22px; min-height: 60px; }
  /* Nav principale: riga orizzontale centrata, sovrapposta al centro della header */
  .tabbar {
    flex-direction: row; justify-content: center; align-items: center;
    top: 0; left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
    width: auto; max-width: none; height: 60px; margin: 0; gap: 6px;
    padding: 0; overflow: visible;
    background: transparent; backdrop-filter: none; border: none; box-shadow: none;
    z-index: 21;
  }
  /* niente shrink/hide/keyboard-collapse: la top bar resta sempre piena e centrata */
  .tabbar.nav-hidden, .tabbar.nav-shrink { transform: translateX(-50%); padding: 0; }
  body.kb-open .tabbar { transform: translateX(-50%); }
  .tabbar.nav-shrink .tab { min-height: 0; }
  .tabbar.nav-shrink .tab small { max-height: none; opacity: 1; }
  /* Tab orizzontali a pillola: icona + etichetta affiancate */
  .tab {
    flex: 0 0 auto; width: auto; min-height: 0;
    flex-direction: row; gap: 8px; padding: 9px 16px; border-radius: 999px;
  }
  .tab small { font-size: .9rem; }
  .tab span { font-size: 1.15rem; }
  .tab .dot { top: 6px; right: 10px; }
  .tab-ic { width: 22px; height: 22px; }
  /* "Sei qui" sulle viste-hub: sottolineatura sotto la pill */
  .tab.parent-active::after { content: ""; bottom: 2px; left: 50%; top: auto; right: auto; transform: translateX(-50%); width: 18px; height: 2px; }
  /* Il brand è già nella header: niente testata-rail */
  .rail-brand { display: none; }
  /* Profilo esce dalla top bar: vive nel drawer destro (avatar). Su mobile resta in basso. */
  .tab[data-view="profile"] { display: none; }
  /* Avatar/menù: visibile solo da desktop (mobile usa la tab Profilo in basso) */
  #meBtn { display: grid; }
}

/* P2: modali su desktop — centrati, angoli pieni, fade+scale (non più bottom-sheet) */
@media (min-width: 760px) {
  .modal-backdrop { align-items: center; }
  .modal {
    max-width: 560px; border-radius: var(--radius); border-bottom: 1px solid var(--border-soft);
    padding-bottom: 24px; animation: modalPop var(--dur-modal) var(--ease-spring) both;
  }
  .modal .grip { display: none; }   /* niente maniglia drag su desktop */
}
@keyframes modalPop { from { opacity: 0; transform: scale(.95) translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: fade var(--dur-base) ease both; } }

/* ===== Hub Profilo + Impostazioni/Aiuto/Segnala ===== */
.icon-btn.on { color: var(--accent); }

/* Icone vettoriali (nav + header): tratto coerente; attivo = pill gradiente + pulse "vivo" */
.tab-ic { width: 25px; height: 25px; display: block; }
.hd-ic { width: 22px; height: 22px; display: block; }
/* Nodo "risonanza" rosa nelle icone nav/header; bianco quando il tab è attivo (sulla pillola a gradiente) */
.tab-ic .rnode, .hd-ic .rnode { fill: var(--accent-2); }
.tab.active .tab-ic .rnode { fill: #fff; }
@keyframes ic-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.13); } }
.tab.active .tab-ic { animation: ic-pulse 1.7s ease-in-out infinite; }
.icon-btn:active .hd-ic { transform: scale(.9); }
@media (prefers-reduced-motion: reduce) { .tab.active .tab-ic { animation: none; } }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 4px; }
.hub-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 16px;
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); color: var(--text); cursor: pointer; }
.hub-item span { font-size: 1.5rem; }
.hub-item small { font-weight: 600; font-size: .8rem; }
.hub-item:active { transform: scale(.97); }
.hub-list { display: flex; flex-direction: column; gap: 8px; }
.hub-row { width: 100%; cursor: pointer; font-size: .95rem; font-weight: 600; }
.hub-row:active { transform: scale(.99); }
.hub-chev { color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: .95rem; }
.faq { border: 1px solid var(--border-soft); border-radius: 12px; padding: 0 12px; margin-bottom: 8px; background: rgba(255,255,255,.03); }
.faq summary { padding: 12px 0; cursor: pointer; font-weight: 600; }
.faq .faq-a { padding: 0 0 12px; color: var(--muted); line-height: 1.5; font-size: .9rem; }
.rep-reason { cursor: pointer; }

/* Standing di partecipazione (pill sobrio, percentile circoscritto per città) */
.rank-line { margin: 4px 0 2px; display: flex; }
.rank-line.rl-center { justify-content: center; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--muted);
  background: rgba(255,255,255,.05); border: 1px solid var(--border-soft); border-radius: 999px; padding: 2px 10px; line-height: 1.5; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status-pill.top { color: #cbbcff; }
.status-pill.top::before { background: var(--accent); }

/* ===== P2: Aggiorna / pull-to-refresh (Feed & Bacheca) ===== */
.hdr-actions { display: flex; gap: 8px; flex: 0 0 auto; }
/* indicatore pull-to-refresh: pillola in alto, scivola col gesto, gira durante il refresh */
.ptr-indicator {
  position: fixed; top: 8px; left: 50%; z-index: 25;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm);
  color: var(--accent); opacity: 0; pointer-events: none;
  transform: translateX(-50%) translateY(-60px);
  transition: opacity .15s ease;
}
.ptr-indicator .ic { width: 20px; height: 20px; }
.ptr-indicator.ptr-visible { opacity: 1; }
.ptr-indicator.ptr-ready { color: var(--accent-2); border-color: var(--accent-2); }
.ptr-indicator.ptr-snap { transition: transform .22s ease, opacity .15s ease; }
.ptr-indicator.ptr-spin .ic { animation: spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ptr-indicator.ptr-spin .ic { animation: none; } .modal-backdrop { transition: none; } }

/* ===== §5: testi user-generated lunghi — niente overflow orizzontale =====
   `anywhere` (non `break-word`) così le parole lunghissime spezzano ANCHE in contesto flex. */
.view-title, .ad-title, .je-meta b, .jam-pick b, .bubble, .post-text { overflow-wrap: anywhere; }
.card-head .name, .swipe-card .name { flex-wrap: wrap; overflow-wrap: anywhere; min-width: 0; }

/* ===== §5: stato offline — banner globale (foundation per il backend) ===== */
.net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-system);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: calc(32px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0;
  background: var(--warn, #fbbf24); color: #1a1400; font-size: .82rem; font-weight: 700;
  transform: translateY(-100%); transition: transform .25s ease; will-change: transform;
}
.net-banner .ic { width: 15px; height: 15px; flex: 0 0 auto; }
.net-banner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.offline .net-banner { transform: translateY(0); }
body.offline { padding-top: calc(32px + env(safe-area-inset-top, 0px)); }
body.offline .app-header { top: calc(32px + env(safe-area-inset-top, 0px)); }
@media (prefers-reduced-motion: reduce) { .net-banner { transition: none; } }
