/* Profilo dei gusti, quiz e «Per te» (web/taste.js). Mobile first, tokens of web/app.css (light and dark). */

.tg-glyph { width: 20px; height: 20px; flex: none; }
.tg-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--sea-soft); color: var(--ink-2); font-size: 13px; line-height: 1.45; margin: 0 0 12px; }
.tg-note .tg-glyph { width: 18px; height: 18px; color: var(--sea); margin-top: 1px; }
.tg-subtitle { font: 650 20px/1.2 var(--display); margin: 22px 0 10px; font-stretch: var(--display-stretch);}
.tg-empty-line { color: var(--muted); font-size: 13.5px; padding: 12px 0; }
.tg-persona-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-deep); font-size: 12px; font-weight: 800; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .tg-persona-badge { color: var(--accent); } }
.tg-meta-link { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-deep); font-weight: 750; font-size: 13px; text-decoration: none; }
.tg-meta-link .tg-glyph { width: 16px; height: 16px; }
@media (prefers-color-scheme: dark) { .tg-meta-link { color: var(--accent); } }

/* ---------- Weather chip ---------- */
.tg-weather { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 9px; border-radius: var(--r-pill); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; max-width: 100%; }
.tg-weather > span { overflow: hidden; text-overflow: ellipsis; }
.tg-weather .tg-glyph { width: 18px; height: 18px; color: #d18b1f; }
.tg-weather.is-wet .tg-glyph { color: var(--sea); }
.tg-weather b { color: var(--ink); font-weight: 800; }
.tg-weather b small { font-size: 11px; color: var(--muted); font-weight: 700; }

/* ---------- Home «Per te» ---------- */
.tg-home-slot:empty { display: none; }
.tg-home .app-section-title { margin-top: 22px; }
.tg-home-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -2px 0 6px; }
.tg-home.is-loading .app-section-title h2 { color: var(--muted); }
.tg-rail { grid-auto-columns: min(74%, 270px); }
.tg-rail .tg-card { height: 100%; }

/* ---------- Recommendation cards ---------- */
.tg-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: var(--card-border); border-radius: var(--r-lg); box-shadow: var(--card-shadow); overflow: hidden; min-width: 0; transition: transform .15s var(--ease), box-shadow .15s; }
.tg-card:hover { box-shadow: var(--shadow-2); }
.tg-card:active { transform: scale(.985); }
.tg-card-hit { position: absolute; inset: 0; z-index: 1; border-radius: inherit; background: transparent; }
.tg-card-hit:focus-visible { outline-offset: -3px; }
.tg-cover { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; color: rgba(255, 255, 255, .93); overflow: hidden;
  background: radial-gradient(90% 90% at 85% 5%, color-mix(in srgb, var(--c2, #7fa8f0) 85%, #ffffff) 0%, transparent 58%), linear-gradient(150deg, var(--c1, #2458a6) 0%, var(--c2, #7fa8f0) 100%); }
.tg-cover::after { content: ""; position: absolute; inset: auto -10% -45% -10%; height: 70%; background: radial-gradient(closest-side, rgba(255,255,255,.14), transparent); pointer-events: none; }
.tg-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tg-cover-glyph { width: 46%; max-width: 92px; height: auto; aspect-ratio: 1; stroke-width: 1.3; filter: drop-shadow(0 3px 8px rgba(0,0,0,.15)); }
.tg-cover-badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: var(--r-pill); background: rgba(10, 22, 27, .55); color: #fff; font-size: 11.5px; font-weight: 750; backdrop-filter: blur(8px); max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 12px; flex: 1; min-width: 0; }
.tg-card-kicker { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-card h3 { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tg-card-sub { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tg-why { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 0; color: var(--accent-deep); font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.tg-why .tg-glyph { width: 15px; height: 15px; margin-top: 1px; }
.tg-why span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-color-scheme: dark) { .tg-why { color: var(--accent); } }
.tg-fb { position: relative; z-index: 2; display: flex; gap: 6px; justify-content: flex-end; margin-top: auto; padding-top: 6px; }
.tg-fb-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); transition: background .15s, color .15s, transform .12s; }
.tg-fb-btn .tg-glyph { width: 18px; height: 18px; }
.tg-fb-btn:hover { background: var(--surface-3); }
.tg-fb-btn:active { transform: scale(.9); }
.tg-fb-btn.is-on { background: var(--accent); color: var(--accent-ink); }
.tg-fb-btn.is-dismiss { background: transparent; color: var(--muted); }

/* Compact list (page #per-te): cover on the left */
.tg-list { display: grid; gap: 10px; }
.tg-card.is-compact { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
.tg-card.is-compact .tg-cover { aspect-ratio: auto; min-height: 118px; height: 100%; }
.tg-card.is-compact .tg-cover-glyph { width: 52%; }
.tg-card.is-compact .tg-cover-badge { left: 6px; right: 6px; bottom: 6px; justify-content: center; font-size: 10.5px; padding: 0 6px; }
.tg-card.is-compact .tg-card-body { padding: 10px 12px; }
.tg-card.is-compact h3 { font-size: 15px; }
.tg-card.is-compact .tg-fb { padding-top: 4px; }
.tg-card.is-compact .tg-fb-btn { width: 32px; height: 32px; }

/* Skeletons */
.tg-card.is-skeleton { pointer-events: none; box-shadow: none; }
.tg-card.is-skeleton .tg-cover { background: var(--surface-2); }
.tg-card.is-skeleton .tg-card-body i { display: block; height: 10px; border-radius: 6px; background: var(--surface-2); margin: 4px 0; animation: tg-pulse 1.4s ease-in-out infinite; }
.tg-card.is-skeleton .tg-card-body i:nth-child(1) { width: 40%; }
.tg-card.is-skeleton .tg-card-body i:nth-child(2) { width: 85%; height: 14px; }
.tg-card.is-skeleton .tg-card-body i:nth-child(3) { width: 65%; }
.tg-skel-lines i { display: block; height: 34px; border-radius: var(--r-pill); background: var(--surface-2); margin: 8px 0; animation: tg-pulse 1.4s ease-in-out infinite; }
.tg-skel-lines i:nth-child(2) { width: 80%; }
.tg-skel-lines i:nth-child(3) { width: 60%; }
@keyframes tg-pulse { 50% { opacity: .55; } }

/* ---------- Plans («Stasera») ---------- */
.tg-plan { margin: 14px 0 4px; padding: 16px; border-radius: var(--r-lg); color: #f3efe8; background: radial-gradient(120% 90% at 100% 0%, #3f3a78 0%, transparent 60%), linear-gradient(160deg, #1c2f4a 0%, #13233a 100%); box-shadow: var(--shadow-2); min-width: 0; }
.tg-plan .app-kicker { color: var(--gold); }
.tg-plan-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.tg-plan-head h3 { font: 650 22px/1.15 var(--display); margin-top: 3px; overflow-wrap: anywhere; font-stretch: var(--display-stretch);}
.tg-plan-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--gold); flex: none; }
.tg-plan .tg-why { color: #f7d9a6; }
.tg-plan-fit { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; font-size: 12.5px; font-weight: 700; color: rgba(243,239,232,.8); }
.tg-plan-fit .tg-glyph { width: 15px; height: 15px; }
.tg-plan-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 0; }
.tg-plan-steps li { position: relative; }
.tg-plan-step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px 8px 8px; border-radius: var(--r-md); background: rgba(255,255,255,.08); color: inherit; text-align: left; text-decoration: none; transition: background .15s; }
.tg-plan-step:hover { background: rgba(255,255,255,.14); }
.tg-plan-dot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(150deg, var(--c1), var(--c2)); }
.tg-plan-dot .tg-glyph { width: 20px; height: 20px; }
.tg-plan-copy { flex: 1; min-width: 0; }
.tg-plan-copy strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-plan-copy small { display: block; font-size: 12px; color: rgba(243,239,232,.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-plan-chev { width: 16px; height: 16px; opacity: .6; }
.tg-plan-line { display: block; width: 2px; height: 10px; margin-left: 26px; background: rgba(255,255,255,.22); }
.tg-plans { display: grid; gap: 12px; grid-auto-flow: column; grid-auto-columns: min(88%, 420px); overflow-x: auto; padding: 2px var(--gutter) 10px; margin: 0 calc(-1 * var(--gutter)); scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.tg-plans::-webkit-scrollbar { display: none; }
.tg-plans > * { scroll-snap-align: start; }
.tg-plans:has(> :only-child) { grid-auto-columns: 100%; }
.tg-plans .tg-plan { margin: 0; }
#detail-dialog .tg-plan { margin-top: 6px; }

/* ---------- Invite «Raccontaci i tuoi gusti» ---------- */
.tg-invite { position: relative; margin: 14px 0 6px; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--accent) 0%, #c8371f 100%); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
.tg-invite-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none; border-radius: inherit; }
.tg-invite:has(.tg-invite-close) .tg-invite-link { padding-right: 52px; }
.tg-invite-art { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.2); flex: none; }
.tg-invite-art .tg-glyph { width: 24px; height: 24px; }
.tg-invite-copy { flex: 1; min-width: 0; }
.tg-invite-copy strong { display: block; font-size: 15px; line-height: 1.3; }
.tg-invite-copy small { display: block; font-size: 12.5px; color: rgba(255,255,255,.88); line-height: 1.35; margin-top: 2px; }
.tg-invite-chev { width: 18px; height: 18px; }
.tg-invite-close { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; }
.tg-invite-close .tg-glyph { width: 16px; height: 16px; }
.tg-invite:has(.tg-invite-close) .tg-invite-chev { display: none; }
.tg-invite.is-compact { margin: 6px 0 12px; }
.tg-quiz-again { margin: 0 0 12px; }
.tg-quiz-again .text-button { display: inline-flex; align-items: center; gap: 6px; }
.tg-quiz-again .tg-glyph { width: 16px; height: 16px; }

/* ---------- Page #per-te ---------- */
.tg-perte-head { margin-bottom: 4px; }
.tg-perte-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.tg-filters { display: grid; gap: 6px; margin: 10px 0 4px; }
.tg-filter { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 2px var(--gutter) 4px; margin: 0 calc(-1 * var(--gutter)); scrollbar-width: none; }
.tg-filter::-webkit-scrollbar { display: none; }
.tg-filter .chip { height: 34px; padding: 0 13px; font-size: 13px; flex: none; }
.tg-filter-label { flex: none; width: 74px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tg-results { min-height: 200px; }
.tg-block { margin-top: 4px; }
.tg-generic { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--line-strong); margin: 12px 0 0; }
.tg-generic > .tg-glyph { color: var(--accent); }
.tg-generic > span { flex: 1; min-width: 0; }
.tg-generic strong { display: block; font-size: 14px; }
.tg-generic small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tg-generic .button { flex: none; }
.tg-foot { display: flex; gap: 8px; align-items: flex-start; margin: 20px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.tg-foot .tg-glyph { width: 16px; height: 16px; margin-top: 1px; }
.tg-empty .tg-icon-bubble { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--accent-soft); color: var(--accent-deep); }
.tg-empty .actions { justify-content: center; }

/* ---------- Profile ---------- */
.tg-profile-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 16px; border-radius: var(--r-xl); color: #f3efe8; background: radial-gradient(120% 90% at 100% 0%, #3a6fc0 0%, transparent 60%), linear-gradient(160deg, #2458a6 0%, #1d4a8f 100%); box-shadow: var(--shadow-2); }
.tg-profile-head .app-kicker { color: var(--gold); }
.tg-avatar { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; flex: none; font: 650 26px/1 var(--display); color: #fff; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); font-stretch: var(--display-stretch);}
.tg-avatar .tg-glyph { width: 26px; height: 26px; }
.tg-profile-id { flex: 1; min-width: 0; }
.tg-profile-id h1 { font: 650 24px/1.1 var(--display); margin: 3px 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-stretch: var(--display-stretch);}
.tg-profile-id p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 12.5px; font-weight: 700; color: rgba(243,239,232,.8); }
.tg-profile-head .tg-persona-badge { background: rgba(255,255,255,.14); color: #fff; }
.tg-profile-city { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.tg-profile-city .tg-glyph { width: 14px; height: 14px; }
.tg-profile-head { position: relative; }
.tg-profile-id h1 { padding-right: 40px; }
.tg-persona-edit { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); }
.tg-persona-edit:hover { background: rgba(255,255,255,.2); }
.tg-persona-edit .tg-glyph { width: 18px; height: 18px; }

/* Taste editor: 3-state chips */
.tg-gusti-count { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 0 4px; }
.tg-group { margin-top: 14px; }
.tg-group h3 { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tg-group h3 span { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); font-size: 11px; letter-spacing: 0; }
.tg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13.5px; transition: background .15s, color .15s, box-shadow .15s; max-width: 100%; }
.tg-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-chip .tg-glyph { width: 15px; height: 15px; }
.tg-chip.is-like { background: var(--accent); color: var(--accent-ink); }
.tg-chip.is-dislike { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tg-chip.is-dislike span { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.tg-chip.is-static { min-height: 34px; padding: 0 12px; }
.tg-save-status { min-height: 1.2em; margin: 12px 0 0; font-size: 12.5px; color: var(--muted); font-weight: 650; }

/* What was learned */
.tg-bars { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; }
.tg-bars li { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(40px, 1fr) auto; grid-template-areas: "label bar val" "forget forget forget"; align-items: center; gap: 4px 10px; }
.tg-bar-label { grid-area: label; font-weight: 750; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-bar { grid-area: bar; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.tg-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.tg-bar i.is-neg { background: var(--muted); }
.tg-bar-val { grid-area: val; font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.tg-forget { grid-area: forget; justify-self: start; font-size: 12.5px; }
@media (min-width: 480px) {
  .tg-bars li { grid-template-columns: minmax(0, 9em) minmax(60px, 1fr) auto auto; grid-template-areas: "label bar val forget"; }
  .tg-forget { justify-self: end; }
}

/* Preferences block of the profile form */
.tg-prefs { display: grid; gap: 14px; }
.tg-fieldset legend { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.tg-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-pill { position: relative; }
.tg-pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tg-pill span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-weight: 750; font-size: 13.5px; transition: .15s; }
.tg-pill span small { font-weight: 650; font-size: 12px; color: var(--muted); }
.tg-pill input:checked + span { background: var(--ink); color: var(--bg); }
.tg-pill input:checked + span small { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.tg-pill input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.tg-prefs .personal-check { padding: 2px 0; }

/* Groups and notifications links */
.tg-links { display: grid; gap: 8px; margin: 0 0 14px; }
.tg-link-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); box-shadow: var(--card-shadow); text-decoration: none; }
.tg-link-card > span:nth-child(2) { flex: 1; min-width: 0; }
.tg-link-card strong { display: block; font-size: 14.5px; }
.tg-link-card small { display: block; color: var(--muted); font-size: 12.5px; }
.tg-link-card > .tg-glyph { width: 16px; height: 16px; color: var(--muted); }
.tg-link-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); flex: none; }

/* Privacy and consents: switches */
.tg-consents { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 2px; }
.tg-consent-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tg-consent-row:last-child { border-bottom: 0; }
.tg-consent-row > div { flex: 1; min-width: 0; }
.tg-consent-row strong { display: block; font-size: 14.5px; line-height: 1.3; }
.tg-consent-row small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 3px; }
.tg-switch { position: relative; flex: none; width: 52px; height: 32px; }
.tg-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.tg-switch-ui { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-3); transition: background .2s; }
.tg-switch-ui::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.tg-switch input:checked + .tg-switch-ui { background: var(--ok); }
.tg-switch input:checked + .tg-switch-ui::after { transform: translateX(20px); }
.tg-switch input:focus-visible + .tg-switch-ui { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.tg-switch input:disabled { cursor: not-allowed; }
.tg-switch input:disabled + .tg-switch-ui { opacity: .5; }
.tg-privacy-links { flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.tg-privacy-links .text-button { display: inline-flex; align-items: center; gap: 6px; }
.tg-privacy-links .tg-glyph { width: 16px; height: 16px; }
.tg-log { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.tg-log li { display: flex; gap: 10px; align-items: flex-start; }
.tg-log strong { display: block; font-size: 14px; }
.tg-log small { color: var(--muted); font-size: 12.5px; }
.tg-log-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--line-strong); flex: none; }
.tg-log-dot.is-on { background: var(--ok); }
/* «Privacy e scelte» (cantiere A): basis label, data actions, short-quiz save and refine link */
.tg-consent-copy { flex: 1; min-width: 0; }
.tg-basis { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 800; letter-spacing: .01em; line-height: 1.5; }
.tg-basis.is-contract { background: var(--surface-2); color: var(--ink-2); }
.tg-basis.is-legitimate_interest { background: var(--sea-soft); color: var(--sea); }
.tg-basis.is-consent { background: var(--accent-soft); color: var(--accent-deep); }
.tg-privacy-gps { display: flex; gap: 8px; align-items: flex-start; }
.tg-privacy-gps .tg-glyph { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.tg-privacy-links, .tg-privacy-data { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.tg-privacy-data { padding-top: 12px; border-top: 1px solid var(--line); }
.tg-privacy-data .text-button { display: inline-flex; align-items: center; gap: 6px; }
.tg-privacy-data .tg-glyph { width: 16px; height: 16px; }
.tg-quiz-saving { align-items: center; text-align: center; padding-top: 32px; }
.tg-quiz-saving h1 { font: 650 clamp(26px, 7.5vw, 32px)/1.1 var(--display); margin: 6px 0 8px; outline: none; font-stretch: var(--display-stretch);}
.tg-quiz-saving .error-box { text-align: left; }
.tg-done-mark.is-error { background: var(--danger); }
.tg-refine { margin-top: 16px; text-align: left; width: 100%; }
.tg-q-privacy { margin: 4px 0 0; }
.tg-persona-form .tg-personas { margin: 10px 0 4px; }

/* ---------- Persona options (quiz and profile dialog) ---------- */
.tg-personas { display: grid; gap: 10px; }
.tg-persona { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1.5px solid var(--line-strong); text-align: left; transition: border-color .15s, background .15s, transform .12s; }
.tg-persona:active { transform: scale(.985); }
.tg-persona[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.tg-persona-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); flex: none; }
.tg-persona[aria-checked="true"] .tg-persona-icon { background: var(--accent); color: #fff; }
.tg-persona-copy { flex: 1; min-width: 0; }
.tg-persona-copy strong { display: block; font-size: 15.5px; }
.tg-persona-copy small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.tg-persona-tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); color: transparent; flex: none; }
.tg-persona-tick .tg-glyph { width: 15px; height: 15px; }
.tg-persona[aria-checked="true"] .tg-persona-tick { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Quiz #gusti-quiz ---------- */
@media (max-width: 959px) {
  body[data-page="gusti-quiz"] .app-bottom-nav { display: none; }
  body[data-page="gusti-quiz"] .workspace { padding-bottom: 12px; }
}
.tg-quiz-page { max-width: 460px; margin: 0 auto; }
.tg-quiz { display: flex; flex-direction: column; min-height: calc(100dvh - var(--header-h) - var(--safe-top) - 40px); }
.tg-quiz-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 10px; }
.tg-round { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); flex: none; }
.tg-round.is-empty { visibility: hidden; }
.tg-round .tg-glyph { width: 18px; height: 18px; }
.tg-quiz-progress { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.tg-quiz-progress span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #f7c23b); transition: width .3s var(--ease); }
.tg-quiz-count { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 38px; text-align: right; }
.tg-quiz-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tg-quiz-intro { margin: 8px 0 16px; }
.tg-quiz-intro h1 { font: 650 clamp(28px, 8vw, 36px)/1.05 var(--display); margin: 6px 0 8px; letter-spacing: -0.02em; outline: none; font-stretch: var(--display-stretch);}
.tg-quiz-intro p { color: var(--muted); font-size: 14.5px; margin: 0; }
.tg-area { margin-top: 14px; }
.tg-area span small { color: var(--muted); font-weight: 650; }
.tg-quiz-foot { position: sticky; bottom: 0; padding: 12px 0 calc(8px + var(--safe-bottom)); background: linear-gradient(to top, var(--bg) 78%, transparent); display: grid; gap: 8px; justify-items: center; z-index: 3; }
.tg-quiz-foot > .button { width: 100%; }
.tg-quiz-ask { text-align: center; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; outline: none; }

.tg-stack { position: relative; height: clamp(300px, 54dvh, 440px); margin: 0 6px 6px; }
.tg-qcard { position: absolute; inset: 0; display: flex; flex-direction: column; border-radius: 26px; overflow: hidden; color: #fff; background: linear-gradient(160deg, var(--c1) 0%, var(--c2) 100%); box-shadow: var(--shadow-3); touch-action: pan-y; user-select: none; -webkit-user-select: none; transition: transform .25s var(--ease), opacity .25s; will-change: transform; --yes: 0; --no: 0; }
.tg-qcard[data-depth="0"] { z-index: 3; cursor: grab; }
.tg-qcard[data-depth="1"] { z-index: 2; transform: translateY(12px) scale(.95); opacity: .75; box-shadow: var(--shadow-2); }
.tg-qcard[data-depth="2"] { z-index: 1; transform: translateY(24px) scale(.9); opacity: .45; box-shadow: none; }
.tg-qcard.is-dragging { transition: none; cursor: grabbing; }
.tg-qcard.is-out-right { transform: translateX(130%) rotate(16deg) !important; opacity: 0; }
.tg-qcard.is-out-left { transform: translateX(-130%) rotate(-16deg) !important; opacity: 0; }
.tg-qcard.is-out-down { transform: translateY(40%) scale(.9) !important; opacity: 0; }
.tg-qcard-art { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; background: radial-gradient(80% 70% at 75% 15%, rgba(255,255,255,.28), transparent 60%); }
.tg-qcard-art::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, rgba(0,0,0,.18), transparent); }
.tg-qcard-glyph { width: min(46%, 150px); height: auto; aspect-ratio: 1; stroke-width: 1.15; filter: drop-shadow(0 6px 14px rgba(0,0,0,.18)); }
.tg-qcard-stamp { position: absolute; top: 18px; padding: 6px 12px; border-radius: 10px; border: 3px solid currentColor; font-weight: 900; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.9); pointer-events: none; }
.tg-qcard-stamp.is-like { left: 16px; color: var(--ok); transform: rotate(-10deg); opacity: var(--yes); }
.tg-qcard-stamp.is-dislike { right: 16px; color: var(--danger); transform: rotate(10deg); opacity: var(--no); }
.tg-qcard-copy { padding: 16px 20px 20px; background: rgba(8, 18, 22, .22); backdrop-filter: blur(6px); }
.tg-qcard-copy h2 { font: 650 26px/1.1 var(--display); margin-bottom: 6px; letter-spacing: -0.015em; font-stretch: var(--display-stretch);}
.tg-qcard-copy p { margin: 0; font-size: 14.5px; line-height: 1.4; color: rgba(255,255,255,.9); }
.tg-qbtns { display: flex; align-items: flex-end; justify-content: center; gap: 18px; }
.tg-qbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.tg-qbtn .tg-glyph { width: 62px; height: 62px; padding: 17px; border-radius: 50%; background: var(--surface); box-shadow: var(--card-shadow); border: var(--card-border); transition: transform .12s var(--ease); }
.tg-qbtn:active .tg-glyph { transform: scale(.9); }
.tg-qbtn.is-dislike .tg-glyph { color: var(--danger); }
.tg-qbtn.is-like .tg-glyph { color: #fff; background: var(--accent); border-color: transparent; }
.tg-qbtn.is-skip .tg-glyph { width: 48px; height: 48px; padding: 13px; color: var(--muted); }
.tg-quiz-hint { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.4; }
@media (hover: none) { .tg-kbd { display: none; } }
.tg-q-budget .tg-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tg-q-budget .tg-seg-btn { padding: 6px 10px; }
.tg-plan.is-day { background: radial-gradient(120% 90% at 100% 0%, #3a6fc0 0%, transparent 60%), linear-gradient(160deg, #2458a6 0%, #1d4a8f 100%); }
.personal-profile-page .text-button > svg { width: 18px; height: 18px; flex: none; }
.setup-persona .setup-section-heading, .setup-consents .setup-section-heading { gap: 10px; }
.setup-persona .setup-section-heading span, .setup-consents .setup-section-heading span { white-space: nowrap; flex: none; }
.tg-quiz-skipall { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.tg-quiz-skipall .tg-glyph { width: 14px; height: 14px; }

.tg-q-block { margin: 0 0 18px; }
.tg-q-block h2 { font-size: 15px; margin-bottom: 8px; }
.tg-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.tg-seg-btn { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 40px; padding: 6px 14px; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line-strong); text-align: left; transition: .15s; }
.tg-seg-btn strong { font-size: 14px; }
.tg-seg-btn small { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.tg-seg-btn[aria-checked="true"], .tg-seg-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.tg-seg-btn[aria-checked="true"] small, .tg-seg-btn[aria-pressed="true"] small { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.tg-q-consents { padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: var(--card-border); }
.tg-consent-check { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.tg-consent-check input { margin-top: 2px; }
.tg-consent-check strong { display: block; font-size: 14.5px; line-height: 1.3; }
.tg-consent-check small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }

.tg-quiz-done { align-items: center; text-align: center; padding-top: 24px; }
.tg-quiz-done h1 { font: 650 clamp(30px, 8.5vw, 38px)/1.05 var(--display); margin: 6px 0 8px; outline: none; font-stretch: var(--display-stretch);}
.tg-quiz-done > p { color: var(--muted); max-width: 34ch; }
.tg-done-mark { width: 64px; height: 64px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 14px; color: #fff; background: conic-gradient(from 210deg, #c8371f, #f7c23b, #2458a6, #c8371f); box-shadow: var(--shadow-2); }
.tg-done-mark .tg-glyph { width: 30px; height: 30px; stroke-width: 2.2; }
.tg-summary-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 8px 0 12px; }
.tg-summary-no { font-size: 13px; color: var(--muted); max-width: 36ch; }
.tg-quiz-done .tg-note { text-align: left; }
.tg-quiz-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }

/* ---------- Onboarding: persona and consents (web/onboarding.js) ---------- */
.setup-persona { margin-bottom: 18px; }
.setup-persona-options { display: grid; gap: 8px; }
.setup-persona-option { position: relative; display: block; }
.setup-persona-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.setup-persona-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1.5px solid transparent; transition: .15s; }
.setup-persona-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); color: var(--sea); flex: none; }
.setup-persona-icon svg { width: 22px; height: 22px; }
.setup-persona-copy { min-width: 0; }
.setup-persona-copy strong { display: block; font-size: 15px; }
.setup-persona-copy small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.setup-persona-option input:checked + .setup-persona-card { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
.setup-persona-option input:checked + .setup-persona-card .setup-persona-icon { background: var(--accent); color: #fff; }
.setup-persona-option input:focus-visible + .setup-persona-card { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.setup-area { margin: 12px 0 0; }
.setup-persona:has(input[value="visitor"]:checked) .setup-area { display: none; }
.setup-area span .muted { font-weight: 650; }
.setup-consents { margin-top: 6px; }
.setup-consents-intro { margin: -4px 0 0; }
.setup-consents .setup-choice-list { margin: 12px 0 0; }

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
  .tg-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tg-plans { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 2px 0 10px; }
  .tg-filter { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 960px) {
  .tg-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tg-quiz { min-height: calc(100dvh - var(--header-h) - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .tg-qcard, .tg-quiz-progress span { transition: none; }
}
.tg-cover-credit { position: absolute; right: 6px; top: 6px; z-index: 1; max-width: 70%; padding: 2px 6px; border-radius: 6px; background: rgba(10,22,27,.55); color: #fff; font-size: 10px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }

/* ---------- Gusti v2, part G (docs/GUSTI_V2.md §6-7): «Da scoprire» and «Perché me lo proponi?» ----------
   Creuza look: the yellow of the highlights with the ink outline (like .tg-place-chip), tokens only, light and dark. */
.tg-explore-badge { position: absolute; top: 10px; left: 10px; z-index: 2; pointer-events: none; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill); background: var(--gold); color: #1d1f24; border: 2px solid var(--outline); box-shadow: 2px 2px 0 var(--outline); font-size: 11.5px; font-weight: 850; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.tg-explore-badge .tg-glyph { width: 14px; height: 14px; flex: none; }
.tg-card.is-compact .tg-explore-badge { top: 6px; left: 6px; height: 22px; padding: 0 7px; font-size: 10.5px; }
.tg-card.is-compact .tg-explore-badge .tg-glyph { display: none; }
.tg-explore-badge.is-inline { position: static; justify-self: start; align-self: start; box-shadow: none; }
/* «Mi interessa» / «Non fa per me»: two pills, above the card's open button (.tg-card-hit, z-index 1) */
.tg-xfb { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tg-xfb-btn { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); border: 2px solid var(--line-strong); font: inherit; font-size: 13px; font-weight: 800; line-height: 1.1; cursor: pointer; transition: transform .12s var(--ease), box-shadow .12s, background .15s, color .15s; }
.tg-xfb-btn .tg-glyph { width: 16px; height: 16px; flex: none; }
.tg-xfb-btn:hover { background: var(--surface-2); }
.tg-xfb-btn.is-yes { background: var(--gold); color: #1d1f24; border-color: var(--outline); box-shadow: 2px 2px 0 var(--outline); }
.tg-xfb-btn.is-yes:hover { background: color-mix(in srgb, var(--gold) 85%, #ffffff); }
.tg-xfb-btn.is-yes.is-on { background: var(--accent); color: var(--accent-ink); }
.tg-xfb-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.tg-card.is-compact .tg-xfb { gap: 6px; margin-top: 6px; }
.tg-card.is-compact .tg-xfb-btn { min-height: 36px; padding: 0 10px; font-size: 12.5px; }
/* «Perché me lo proponi?»: a native <details>, above the card's open button */
.tg-whybox { position: relative; z-index: 2; margin: 0; font-size: 12.5px; }
.tg-whybox-sum { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; max-width: 100%; color: var(--muted); font-weight: 750; cursor: pointer; list-style: none; border-radius: var(--r-xs); -webkit-user-select: none; user-select: none; }
.tg-whybox-sum::-webkit-details-marker { display: none; }
.tg-whybox-sum::marker { content: ""; }
.tg-whybox-sum .tg-glyph { width: 15px; height: 15px; flex: none; }
.tg-whybox-sum:hover { color: var(--ink); }
.tg-whybox-chev { transform: rotate(90deg); transition: transform .15s var(--ease); }
.tg-whybox[open] .tg-whybox-chev { transform: rotate(-90deg); }
.tg-whybox-body { margin: 2px 0 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1.5px solid var(--line); }
.tg-whybox-list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 7px; }
.tg-whybox-list li { position: relative; display: grid; gap: 2px; padding-left: 14px; color: var(--ink); font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.tg-whybox-list li::before { content: ""; position: absolute; left: 1px; top: .45em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.tg-whybox-list small { color: var(--muted); font-size: 12px; font-weight: 550; line-height: 1.4; }
.tg-whybox-link { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; color: var(--accent-deep); font-weight: 800; text-decoration: none; }
.tg-whybox-link .tg-glyph { width: 15px; height: 15px; }
.tg-whybox-link:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { .tg-whybox-link { color: var(--accent); } }
.tg-xfb-btn:focus-visible, .tg-whybox-sum:focus-visible, .tg-whybox-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
/* on a coloured block (the home hero, .home-pick): light text */
.tg-whybox.is-dark .tg-whybox-sum { color: rgba(255, 255, 255, .92); }
.tg-whybox.is-dark .tg-whybox-sum:hover { color: #ffffff; }
.tg-whybox.is-dark .tg-whybox-body { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .24); }
.tg-whybox.is-dark .tg-whybox-list li { color: #ffffff; }
.tg-whybox.is-dark .tg-whybox-list li::before { background: var(--gold); }
.tg-whybox.is-dark .tg-whybox-list small { color: rgba(255, 255, 255, .92); font-weight: 500; }
.tg-whybox.is-dark .tg-whybox-link { color: #ffffff; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tg-whybox.is-dark .tg-whybox-link .tg-glyph { color: var(--gold); }
.tg-whybox.is-dark :focus-visible { outline-color: var(--gold); }
@media (prefers-reduced-motion: reduce) {
  .tg-whybox-chev, .tg-xfb-btn { transition: none; }
}
