:root {
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --bg: #f7f1ec;
  --card: #fffdfb;
  --ink: #2a2325;
  --muted: #837479;
  --line: #eadfd9;
  --accent: #a65c68;
  --accent-ink: #ffffff;
  --accent-soft: #f6e6e6;
  --ok: #2e9e6b;
  --ok-soft: #e4f5ec;
  --warn: #d98a1b;
  --warn-soft: #fcf1de;
  --bad: #cf3b3b;
  --bad-soft: #fbe7e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31,27,25,.05), 0 6px 20px rgba(31,27,25,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1, h2 { font-family: var(--serif); font-weight: 600; }
h1 { font-size: 1.85rem; font-style: italic; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---------- Layout ---------- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--serif); font-style: italic; font-weight: 600; text-decoration: none; color: var(--ink); font-size: 1.25rem; }
.top nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.top nav a, .top nav .link {
  padding: 8px 12px; border-radius: 999px; text-decoration: none; font-size: .92rem; color: var(--ink);
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.top nav a:hover, .top nav .link:hover { background: var(--accent-soft); }
.top nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.crumb { display: inline-block; margin-bottom: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; }
.crumb:hover { color: var(--accent); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.card.err { background: var(--bad-soft); border-color: #f1c3c3; color: var(--bad); }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- Form ---------- */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 14px; color: var(--ink); }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #ddd3cb; border-radius: 10px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 84px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px;
  font: inherit; font-weight: 600; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.dark { background: var(--ink); border-color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad); border-color: #e6b5b5; }
.btn.small { padding: 7px 13px; font-size: .85rem; }
.btn.block { width: 100%; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pw { position: relative; }
.pw button { position: absolute; right: 8px; top: 12px; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: .8rem; padding: 6px; }

/* ---------- Login ---------- */
/* Se aggiungi una tua foto in img/hero.jpg, compare dietro al login */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px;
  background:
    linear-gradient(160deg, rgba(42,35,37,.55), rgba(166,92,104,.55)),
    url(../img/hero.jpg) center / cover no-repeat,
    radial-gradient(circle at 15% 10%, #e3b8bd 0, transparent 55%), #5b3a42;
}
.auth-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 22px; padding: 30px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.auth-card .brand { display: block; margin-bottom: 4px; font-size: 1.6rem; }
.auth-card .tagline { color: var(--muted); font-size: .85rem; margin: 0 0 22px; }
.auth-card h1 { margin-bottom: 18px; font-size: 1.5rem; }
.auth-social { text-align: center; }
.auth-social .insta { color: #fff; }
.insta { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: .9rem; font-weight: 600; }
.insta svg { width: 20px; height: 20px; flex: none; }
.insta:hover { text-decoration: underline; }
.site-foot { max-width: 980px; margin: 0 auto; padding: 8px 16px 40px; text-align: center; color: var(--muted); font-size: .85rem; }
.site-foot .insta { color: var(--accent); }
.auth-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.msg { padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin-bottom: 14px; }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- KPI / badge ---------- */
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; }
.kpi .l { color: var(--muted); font-size: .82rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.mute { background: #f0ebe6; color: var(--muted); }

/* ---------- Tabelle ---------- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fdf8f5; }
.name { font-weight: 600; }

/* Colonne ordinabili */
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
th.sortable::after { content: ' ↕'; opacity: .3; }
th.sortable[data-dir="asc"]::after { content: ' ▲'; opacity: 1; color: var(--accent); }
th.sortable[data-dir="desc"]::after { content: ' ▼'; opacity: 1; color: var(--accent); }
.head-tools { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.inline-sel { margin: 0; font-size: .8rem; color: var(--muted); }
.inline-sel select { width: auto; min-width: 150px; margin-top: 4px; padding: 9px 12px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 6px; margin: 0 0 16px; overflow-x: auto; }
.tabs a { padding: 9px 16px; border-radius: 999px; text-decoration: none; background: #fff; border: 1px solid var(--line); font-size: .92rem; white-space: nowrap; }
.tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Allenamento (cliente) ---------- */
.w-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; }
.w-card:hover { border-color: var(--accent); }
.w-card .day { color: var(--accent); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.w-card h3 { margin: 2px 0; }
.progress { height: 8px; background: #efe8e2; border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
/* Scheda esercizio (portale cliente) */
.ex-item {
  display: block; margin: 0 0 14px; padding: 16px; font-size: 1rem; font-weight: 400; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: background .2s, border-color .2s;
}
.ex-item.done { background: var(--ok-soft); border-color: #bfe3cf; }
.ex-top { display: flex; align-items: center; gap: 14px; }
.ex-item input[type=checkbox] { width: 30px; height: 30px; margin: 0; padding: 0; accent-color: var(--ok); flex: none; cursor: pointer; }
.ex-title { min-width: 0; flex: 1; }
.ex-name { font-weight: 700; font-size: 1.12rem; line-height: 1.25; }
.ex-item.done .ex-name { text-decoration: line-through; color: var(--muted); }
.ex-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 14px; }
.ex-stats > div { background: #f6efea; border-radius: 12px; padding: 8px 12px; text-align: center; }
.ex-item.done .ex-stats > div { background: rgba(255,255,255,.7); }
.ex-stats span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ex-stats b { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.ex-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); font-size: .95rem; line-height: 1.45; }
.ex-item > .btn { margin-top: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.chip { background: #f3eee9; border-radius: 8px; padding: 2px 9px; font-size: .82rem; }
.rating { display: flex; gap: 8px; margin: 8px 0 16px; }
.rating button { flex: 1; padding: 10px 0; border-radius: 12px; border: 1px solid #ddd3cb; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.rating button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.rating-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: -10px; margin-bottom: 14px; }

/* ---------- Grafici ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px system-ui, sans-serif; fill: var(--muted); }
.chart .bar { fill: var(--accent); }
.chart .bar.zero { fill: #efe8e2; }
.chart .target { stroke: var(--ink); stroke-dasharray: 4 4; stroke-width: 1.2; opacity: .5; }
.legend { font-size: .8rem; color: var(--muted); margin-top: 6px; }

/* ---------- Editor coach ---------- */
.ex { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: #fffdfc; }
.ex-head { display: flex; gap: 6px; align-items: center; }
.ex-head .n { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .8rem; display: grid; place-items: center; flex: none; }
.ex-head input { margin: 0; }
.icon { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer; flex: none; font-size: .9rem; }
.icon:hover { background: var(--accent-soft); }
.ex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 0; }
.ex-grid label, .ex > label { margin-bottom: 0; }
.ex > input, .ex > label { margin-top: 10px; }
.feedback { background: #f8f4f0; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-top: 8px; white-space: pre-wrap; }

/* ---------- Calendario settimanale ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.day-h { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: .85rem; }
.day-h small { color: var(--muted); font-weight: 600; }
.day.today .day-h span { color: var(--accent); }
.wk-item { display: block; padding: 8px; border-radius: 10px; background: var(--accent-soft); text-decoration: none; font-size: .82rem; line-height: 1.25; border: 1px solid transparent; }
.wk-item:hover { border-color: var(--accent); }
.wk-item b { display: block; word-break: break-word; }
.wk-item small { color: var(--muted); display: block; margin-top: 2px; }
.wk-item.done { background: var(--ok-soft); }
.wk-item em { font-style: normal; color: var(--ok); font-weight: 700; font-size: .75rem; }
.wk-add { margin-top: auto; text-align: center; text-decoration: none; color: var(--muted); border: 1px dashed #d8cdc4; border-radius: 10px; padding: 4px 0; font-size: 1.1rem; }
.wk-add:hover { color: var(--accent); border-color: var(--accent); }
.rest { margin: auto 0; text-align: center; color: #b8aca3; font-size: .8rem; }
.today-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; background: var(--accent-soft); border-color: #ecc9cc; }
.today-card h3 { font-family: var(--serif); font-size: 1.25rem; }

/* ---------- Modale / catalogo ---------- */
.modal { position: fixed; inset: 0; background: rgba(31,27,25,.5); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal-box { background: #fff; border-radius: 16px; padding: 18px; width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.modal-h h3 { margin: 0; }
.modal-f { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-bottom: 10px; }
.cat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }

/* ---------- Abbonamenti ---------- */
:root { --ice: #2f7ea8; --ice-soft: #e3f1f8; }
.badge.ice { background: var(--ice-soft); color: var(--ice); }
.badge + .badge { margin-left: 6px; }
.sub-card { border-left: 5px solid var(--ok); }
.sub-card.warn { border-left-color: var(--warn); background: #fffaf1; }
.sub-card.bad { border-left-color: var(--bad); background: #fff6f6; }
.sub-card.ice { border-left-color: var(--ice); background: #f4fafd; }
.sub-card.mute { border-left-color: var(--line); }
.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sub-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.sub-dates span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sub-dates b { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.sub-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); }
.sub-card.bad .sub-alert { background: var(--bad-soft); }
.sub-alert-big { padding: 14px 16px; margin-bottom: 12px; border-left: 5px solid var(--warn); background: var(--warn-soft); }
.sub-alert-big.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.sub-alert-big.ice { border-left-color: var(--ice); background: var(--ice-soft); }
.sub-pill { display: inline-block; padding: 8px 14px; border-radius: 999px; text-decoration: none; font-size: .85rem; background: var(--ok-soft); color: var(--ok); }
.sub-pill.warn { background: var(--warn-soft); color: var(--warn); }
.sub-pill.bad { background: var(--bad-soft); color: var(--bad); }
.sub-pill.ice { background: var(--ice-soft); color: var(--ice); }
.sub-pill.mute { background: #f0ebe6; color: var(--muted); }
.sub-endline { margin: -4px 0 14px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.chk { display: flex; align-items: center; gap: 8px; font-size: .95rem; font-weight: 600; }
.chk input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.plan-opt { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 400; font-size: 1rem; }
.plan-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.plan-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: none; }
.plan-opt > div { flex: 1; }
.plan-price { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.fchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip b { margin-left: 4px; }
.alert-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-decoration: none; background: var(--warn-soft); border-color: #f0d9ab; }
.alert-card .go { margin-left: auto; color: var(--accent); }
tr.row-bad td { background: #fff6f6; }
tr.row-warn td { background: #fffaf1; }
tr.row-ice td { background: #f4fafd; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 250px; }
.row-actions .btn { white-space: nowrap; }
td.nw { white-space: nowrap; }
tr.click.row-bad:hover td, tr.click:hover td { background: #fdf8f5; }

/* ---------- Foto esercizi ---------- */
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: none; background: var(--accent-soft); }
.thumb.sm { width: 44px; height: 44px; border-radius: 10px; }
.thumb.lg { width: 84px; height: 84px; border-radius: 16px; }
.thumb.lg.ph { font-size: 2.4rem; }
.thumb.ph { display: grid; place-items: center; font-size: 1.7rem; }
.thumb.sm.ph { font-size: 1.3rem; }
.ex-photo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cat-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.zoom-img { display: block; width: 100%; height: auto; border-radius: 12px; }
.ex-item .thumb { margin-top: 0; }

@media (max-width: 820px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .day-h { flex: 0 0 64px; flex-direction: column; align-items: flex-start; gap: 0; }
  .wk-item, .rest { flex: 1 1 160px; margin: 0; text-align: left; }
  .wk-add { margin: 0; flex: 0 0 44px; }
}

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: .9rem;
  transition: all .25s; z-index: 50; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--bad); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

@media (max-width: 560px) {
  h1 { font-size: 1.45rem; }
  .ex-grid { grid-template-columns: 1fr 1fr; }
  .ex-grid label:last-child { grid-column: 1 / -1; }
}

/* ================================================================== *
 *  TELEFONO
 * ================================================================== */
html { -webkit-tap-highlight-color: transparent; }
.bottom-nav, .finish-bar, .m-sort { display: none; }
.sticky-progress { padding: 14px 18px; }
.list-menu { padding: 6px 0; }
.list-menu a, .list-menu button {
  display: block; width: 100%; text-align: left; padding: 17px 20px; font: inherit; font-size: 1.05rem;
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; cursor: pointer;
}
.list-menu > :last-child { border-bottom: 0; }
.tip { position: relative; background: var(--accent-soft); border-color: #ecc9cc; padding-right: 48px; }
.tip-x { position: absolute; top: 8px; right: 8px; border: 0; background: transparent; }
.m-sort { margin: 0 0 12px; font-size: .8rem; color: var(--muted); }
.m-sort select { margin-top: 4px; }

@media (max-width: 720px) {
  .auth-wrap { min-height: 100dvh; }
  .top { height: 56px; padding: 0 16px; flex-wrap: nowrap; }
  .top nav { display: none; }
  .brand { font-size: 1.3rem; }
  main { padding: 16px 14px 8px; }
  .site-foot { padding: 4px 16px calc(96px + env(safe-area-inset-bottom) + var(--nl, 0px)); }

  /* barra di navigazione in basso, come un'app */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; gap: 2px;
    background: rgba(255, 253, 251, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom) + var(--nl, 0px));
  }
  .bottom-nav a {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 2px; border-radius: 14px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 600;
  }
  .bottom-nav a svg { width: 24px; height: 24px; }
  .bottom-nav a.on { color: var(--accent); background: var(--accent-soft); }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom) + var(--nl, 0px)); }

  h1 { font-size: 1.55rem; }
  .page-head { align-items: center; margin-bottom: 14px; }
  .card { padding: 16px; border-radius: 16px; }

  /* bersagli di tocco comodi; 16px evita lo zoom automatico di iPhone nei campi */
  .btn { min-height: 46px; }
  .btn.small { min-height: 40px; padding: 8px 14px; }
  input, select, textarea { min-height: 46px; font-size: 16px; }
  textarea { min-height: 96px; }
  .icon { width: 40px; height: 40px; }
  .fchip, .tabs a { min-height: 42px; display: inline-flex; align-items: center; }
  .ex-item input[type=checkbox] { width: 34px; height: 34px; min-height: 0; }

  .grid.kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .v { font-size: 1.5rem; }
  .head-tools { width: 100%; }
  .head-tools .inline-sel, .head-tools .btn { flex: 1; }
  .inline-sel select { width: 100%; }

  /* tabelle -> elenco di schede */
  .m-sort { display: block; }
  .tbl-wrap { overflow: visible; }
  table.stack, table.stack tbody { display: block; }
  table.stack thead { display: none; }
  table.stack tr { display: block; margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
  table.stack tr.row-bad { background: #fff6f6; }
  table.stack tr.row-warn { background: #fffaf1; }
  table.stack tr.row-ice { background: #f4fafd; }
  table.stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0; border: 0; text-align: right; background: transparent !important; }
  table.stack td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; }
  table.stack td:first-child { display: block; text-align: left; padding: 0 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  table.stack td:first-child::before, table.stack td[data-label=""]::before { content: none; }
  table.stack td[data-label=""] { display: block; text-align: left; padding-top: 10px; }
  table.stack td.nw { white-space: normal; }
  .row-actions { min-width: 0; }

  /* pannelli come fogli che salgono dal basso */
  .modal { place-items: end center; padding: 0; }
  .modal-box { max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }

  /* allenamento: avanzamento sempre visibile + pulsante Termina fisso */
  .sticky-progress { position: sticky; top: 62px; z-index: 8; padding: 10px 14px; }
  .finish-bar {
    display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom) + var(--nl, 0px)); z-index: 25;
    align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 20px;
    background: var(--ink); color: #fff; border-radius: 999px; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); font-weight: 600;
  }
  .finish-bar[hidden] { display: none; }
}

@media (max-width: 720px) {
  /* nella dashboard clienti le schede mostrano solo l'essenziale */
  #dash td[data-label="Totale"], #dash td[data-label="Ultimo allenamento"] { display: none; }
  .alert-card { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -14px; margin-right: -14px; padding: 0 14px 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .fchip { white-space: nowrap; flex: none; }
  .tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
}

@media (max-width: 720px) {
  .chart text { font-size: 15px; }
}

/* ================================================================== *
 *  Profilo, questionario, check-in, CRM
 * ================================================================== */
.q-top { margin-bottom: 12px; }
.q-top .progress { margin-top: 6px; }
.q-card h1 { margin-bottom: 8px; }
.q-sens { background: var(--ice-soft); color: var(--ice); padding: 8px 12px; border-radius: 10px; }
.q-f { display: block; margin: 0 0 20px; font-size: 1rem; font-weight: 600; }
.q-f > input, .q-f > textarea { font-weight: 400; }
.q-l { font-weight: 600; margin-bottom: 8px; }
.q-help { font-weight: 400; margin: 2px 0 6px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qchip { border: 1px solid #ddd3cb; background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 14px; font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer; text-align: left; line-height: 1.25; }
.qchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
span.qchip { cursor: default; }
.scale10 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.scale10 button { min-height: 46px; border: 1px solid #ddd3cb; background: #fff; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.scale10 button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-follow { display: block; margin: 10px 0 0; font-weight: 400; font-size: .9rem; }
.q-consent { align-items: flex-start; margin: 8px 0 14px; padding: 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 400; }
.q-consent input { margin-top: 2px; flex: none; }
.q-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.q-nav .btn { flex: 1; }
.q-nudge { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; background: var(--accent-soft); border-color: #ecc9cc; }
details.q-sum { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 0 16px; }
details.q-sum summary { cursor: pointer; padding: 14px 0; font-weight: 700; }
details.q-sum dl { margin: 0 0 12px; }
details.q-sum dt { font-size: .8rem; color: var(--muted); margin-top: 10px; }
details.q-sum dd { margin: 2px 0 0; white-space: pre-wrap; }
.flag-card { border-left: 5px solid var(--bad); background: #fff6f6; }
.flag-card ul { margin: 8px 0 0; padding-left: 20px; }

.delta { font-size: .75rem; font-weight: 700; margin-left: 4px; }
.delta.down { color: var(--ok); } .delta.up { color: var(--warn); }
.ci-vals { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.ci-vals span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ci-vals b { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; }
.ci-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb-ph { width: 92px; height: 120px; object-fit: cover; border-radius: 12px; cursor: zoom-in; background: var(--accent-soft); }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ba figure { margin: 0; text-align: center; }
.ba .thumb-ph { width: 100%; height: auto; aspect-ratio: 3 / 4; }
.ba figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.ph-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.ph-slot { text-align: center; }
.ph-box { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--accent-soft); display: grid; place-items: center; overflow: hidden; margin-bottom: 6px; font-size: 1.6rem; }
.ph-box img { width: 100%; height: 100%; object-fit: cover; }

.note-item { padding: 12px 0; border-top: 1px solid var(--line); }
.link-del { background: none; border: 0; color: var(--bad); font: inherit; font-size: .8rem; cursor: pointer; margin-left: 6px; }
.fu-card { background: var(--ice-soft); border-color: #bfdcec; }
.fu-row { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #cfe5f1; text-decoration: none; }
.fu-row:first-of-type { margin-top: 8px; }
.bad-txt { color: var(--bad); font-weight: 700; }

/* ================================================================== *
 *  Offerte e promozioni
 * ================================================================== */
.offer { position: relative; padding: 20px 18px 16px; border-radius: 18px; color: #fff;
  background: linear-gradient(145deg, #b4697a, #7a3f4b); box-shadow: 0 10px 30px rgba(122, 63, 75, .3); margin-bottom: 16px; }
.offer h3 { font-family: var(--serif); font-size: 1.4rem; font-style: italic; margin: 6px 36px 8px 0; color: #fff; }
.offer p { margin: 0 0 12px; color: rgba(255, 255, 255, .92); }
.offer-tag { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.offer-x { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .18); border-color: transparent; color: #fff; }
.offer-x:hover { background: rgba(255, 255, 255, .3); }
.offer-price { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: rgba(255, 255, 255, .16); }
.offer-price b { font-family: var(--serif); font-size: 1.5rem; }
.offer-price s { opacity: .7; margin-right: 6px; }
.offer-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.offer .btn { background: #fff; border-color: #fff; color: #7a3f4b; }
.offer .btn.ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .7); }
.link-quiet { background: none; border: 0; color: rgba(255, 255, 255, .85); font: inherit; font-size: .9rem; text-decoration: underline; cursor: pointer; padding: 8px 4px; }
.modal-offer .modal-box { background: transparent; box-shadow: none; padding: 0; max-width: 460px; }
.modal-offer .offer { margin: 0; }
.offer-prev .offer { margin: 0; }
.offer-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 0; text-align: center; }
.offer-stats b { display: block; font-family: var(--serif); font-size: 1.25rem; }
.offer-stats span { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.opt-list { display: grid; gap: 8px; }
.opt-list .chk { font-weight: 500; margin: 0; }
@media (max-width: 720px) {
  .modal-offer { place-items: center; padding: 16px; }
  .offer-stats { grid-template-columns: repeat(3, 1fr); }
}

pre.json { background: #f7f1ec; border-radius: 10px; padding: 10px 12px; font-size: .78rem; overflow-x: auto; max-height: 320px; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
code { background: #f3ebe5; border-radius: 6px; padding: 1px 6px; font-size: .85em; }

/* ---- Rinnovo nel portale e voucher ---- */
.rn-h { margin: 0 0 6px; }
.rn-sec { margin: 16px 0 8px; font-weight: 600; font-size: .86rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rn-vrow { display: flex; gap: 8px; align-items: stretch; }
.rn-vrow input { flex: 1; min-width: 0; text-transform: uppercase; }
.rn-total { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1.05rem; }
.rn-total b { font-family: var(--serif); font-size: 1.7rem; }
.rn-help { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.plan-price { margin-left: auto; text-align: right; white-space: nowrap; }
.plan-price s { display: block; font-weight: 400; font-size: .78em; line-height: 1.1; }
.rn-help .link-quiet { color: var(--accent); font-size: .95rem; }
.offer-voucher { margin: 0 0 14px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .18); font-size: .9rem; }
.vcode { font-weight: 700; letter-spacing: .04em; }
.seg { display: grid; gap: 4px; margin-bottom: 12px; }

/* ---- Badge Netlify: spazio sotto la barra di navigazione (solo telefono) ---- */
:root { --nl: 0px; }
@media (max-width: 720px) { html.nl-badge { --nl: 50px; } }

/* ---- Allenamento a schermo intero ---- */
body.player-open { overflow: hidden; }
.ex-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pl-start { margin: 0 0 14px; padding: 16px; font-size: 1.05rem; }
.player { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: var(--bg, #f6f1ed); height: 100dvh; }
.pl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); }
.pl-ic { width: 42px; height: 42px; font-size: 1.1rem; }
.pl-prog { font-size: .95rem; color: var(--muted); }
.pl-prog b { color: var(--ink); }
.pl-bar { height: 4px; background: var(--line); }
.pl-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.pl-scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; width: 100%; max-width: 640px; margin: 0 auto; }
.pl-media { position: relative; width: 100%; flex: 1 1 0; min-height: 120px; max-height: min(46dvh, 460px); background: #1c1519; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pl-media::after { content: ""; position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 0) * 100%); background: var(--accent); transition: width .25s linear; }
.pl-vid, .pl-img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; background: #1c1519; }
.pl-ph { display: flex; flex-direction: column; align-items: center; gap: 12px; color: rgba(255, 255, 255, .7); }
.pl-ph svg { width: 72px; height: 72px; }
.pl-rest { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(28, 21, 25, .88); color: #fff; text-align: center; padding: 16px; }
.pl-run { background: rgba(166, 92, 104, .92); }
.pl-rest-l { text-transform: uppercase; letter-spacing: .12em; font-size: .85rem; opacity: .85; }
.pl-count { font-family: var(--serif); font-size: clamp(4.5rem, 22vw, 7rem); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.pl-count.low { color: #ffd27a; transform: scale(1.06); transition: transform .15s ease; }
.pl-rest-n { opacity: .85; margin-bottom: 10px; }
.pl-rest-b { display: flex; gap: 10px; }
.pl-rest-b .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); background: transparent; }
.pl-body { flex: 0 1 auto; max-height: 52dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 10px; }
.pl-name { margin: 0 0 2px; font-size: 1.4rem; line-height: 1.2; }
.pl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 10px 0 8px; }
.pl-stats div { background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.pl-stats span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pl-stats b { font-family: var(--serif); font-size: 1.5rem; }
.pl-stats small { font-size: .8rem; color: var(--muted); font-family: inherit; font-weight: 400; }
.pl-dots { display: flex; gap: 8px; margin-bottom: 14px; }
.pl-dots i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); }
.pl-dots i.on { background: var(--accent); }
.pl-dots i.cur { box-shadow: 0 0 0 3px var(--accent-soft); }
.pl-tips { background: var(--accent-soft); border-radius: 14px; padding: 12px 16px; }
.pl-tips h4 { margin: 0 0 6px; font-size: .9rem; }
.pl-tips ul { margin: 0; padding-left: 18px; }
.pl-tips li { margin: 4px 0; line-height: 1.4; }
.pl-foot { width: 100%; max-width: 640px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom) + var(--nl, 0px)); background: var(--bg, #f6f1ed); border-top: 1px solid var(--line); }
.pl-main { padding: 14px; font-size: 1.1rem; }
.pl-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.pl-quiet { color: var(--muted); }
.pl-quiet:disabled { opacity: .35; }
.pl-end { margin: auto; text-align: center; padding: 24px; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 800px) { .pl-scroll { border-left: 1px solid var(--line); border-right: 1px solid var(--line); } }

/* Telefoni piccoli / schermi bassi: il video si riduce, serie e ripetizioni restano sempre visibili */
@media (max-height: 740px) {
  .pl-top { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  .pl-ic { width: 38px; height: 38px; }
  .pl-body { padding: 8px 14px 6px; }
  .pl-name { font-size: 1.15rem; }
  .pl-stats { gap: 6px; margin: 6px 0 6px; }
  .pl-stats div { padding: 6px 10px; border-radius: 12px; }
  .pl-stats span { font-size: .66rem; }
  .pl-stats b { font-size: 1.2rem; }
  .pl-dots { margin-bottom: 8px; }
  .pl-dots i { width: 10px; height: 10px; }
  .pl-tips { padding: 8px 12px; }
  .pl-tips h4 { margin-bottom: 2px; }
  .pl-tips li { margin: 2px 0; font-size: .9rem; }
  .pl-foot { padding-top: 6px; }
  .pl-main { padding: 12px; font-size: 1.05rem; }
  .pl-nav { margin-top: 0; }
  .pl-body .muted.small { display: none; }
}
@media (max-height: 600px) { .pl-tips { display: none; } .pl-media { min-height: 96px; } }

/* ---- Punti da osservare per esercizio ---- */
.ex-note b { display: block; margin-bottom: 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.ex-note ul { margin: 0; padding-left: 18px; }
.ex-note li { margin: 3px 0; }

/* ---- Modalità del programma (coach) ---- */
.mode-opts { display: grid; gap: 8px; margin-top: 10px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mode-opt input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; padding: 0; accent-color: var(--accent); }

/* ---- Gamification (programma in sequenza) ---- */
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.game-lv { display: flex; align-items: center; gap: 12px; }
.game-lv b { font-family: var(--serif); font-size: 1.35rem; }
.game-ico { width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.7rem; }
.game-xp { text-align: right; line-height: 1.1; }
.game-xp b { display: block; font-family: var(--serif); font-size: 1.7rem; color: var(--accent); }
.game-xp span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.game-bar { height: 10px; border-radius: 99px; }
.game-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.game-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.game-chip > span { font-size: 1.6rem; filter: grayscale(1); opacity: .6; }
.game-chip.hot > span, .game-chip:last-child > span { filter: none; opacity: 1; }
.game-chip b { font-family: var(--serif); font-size: 1.4rem; display: block; line-height: 1.1; }
.game-chip small { color: var(--muted); font-size: .75rem; }
.game-goal { display: flex; gap: 5px; margin-bottom: 3px; }
.game-goal i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); }
.game-goal i.on { background: var(--accent); }
.path-list { display: grid; gap: 8px; }
.path-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; }
.path-step:hover { border-color: var(--accent); }
.path-step.next { border-color: var(--accent); background: var(--accent-soft); }
.path-step.done { opacity: .75; }
.path-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 700; font-size: .9rem; }
.path-step.done .path-dot { background: var(--ok); color: #fff; }
.path-step.next .path-dot { background: var(--accent); color: #fff; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 10px; }
.medal { text-align: center; padding: 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); opacity: .55; }
.medal.on { opacity: 1; border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--card)); }
.medal span { display: block; font-size: 1.9rem; margin-bottom: 4px; }
.medal b { display: block; font-size: .82rem; line-height: 1.2; }
.medal small { display: block; margin-top: 4px; font-size: .68rem; color: var(--muted); line-height: 1.25; }
.party { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: rgba(28, 21, 25, .72); }
.party-box { width: 100%; max-width: 380px; background: var(--card); border-radius: 22px; padding: 26px 22px 20px; text-align: center; animation: pop .35s ease; }
.party-emoji { font-size: 3.6rem; }
.party-box h2 { margin: 6px 0 4px; }
.party-xp { font-family: var(--serif); font-size: 2.2rem; font-weight: 600; color: var(--accent); }
.party-line { margin: 6px 0 12px; }
.party-new { margin: 0 0 12px; padding: 10px; border-radius: 14px; background: var(--accent-soft); }
.party-medal { margin-top: 4px; font-weight: 700; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- Gamification: versione più viva ---- */
.card.game { background: linear-gradient(145deg, #7d3f4c 0%, #a65c68 55%, #c98693 100%); color: #fff; border: 0; box-shadow: 0 14px 30px -12px rgba(125, 63, 76, .65); position: relative; overflow: hidden; }
.card.game::after { content: ""; position: absolute; right: -50px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 70%); pointer-events: none; }
.card.game .muted, .card.game small { color: rgba(255, 255, 255, .8); }
.game-top { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.ring { position: relative; flex: none; width: 74px; height: 74px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: rgba(255, 255, 255, .25); }
.ring-fg { stroke: #ffe3a3; stroke-linecap: round; stroke-dashoffset: var(--o); animation: ringfill 1.1s ease-out; filter: drop-shadow(0 0 5px rgba(255, 227, 163, .8)); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.9rem; }
@keyframes ringfill { from { stroke-dashoffset: var(--c); } to { stroke-dashoffset: var(--o); } }
.game-lv { flex: 1; min-width: 0; display: block; }
.game-lvl { font-size: .68rem; letter-spacing: .16em; opacity: .85; font-weight: 700; }
.game-lv b { font-family: var(--serif); font-size: 1.45rem; color: #fff; line-height: 1.1; display: block; }
.game-sub { font-size: .8rem; opacity: .9; margin-top: 2px; }
.game-xp b { color: #ffe3a3; font-size: 1.9rem; text-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.game-xp span { color: rgba(255, 255, 255, .85); }
.game-msg { margin: 6px 0 12px; font-size: .95rem; font-weight: 600; line-height: 1.35; }
.card.game .game-row { margin-top: 0; }
.card.game .game-chip { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(2px); }
.card.game .game-chip b { color: #fff; }
.card.game .game-chip.hot { background: rgba(255, 210, 122, .22); border-color: rgba(255, 227, 163, .6); }
.game-chip .flame { display: inline-block; animation: flame 1.3s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.18) rotate(3deg); } }
.card.game .game-goal i { border-color: #ffe3a3; }
.card.game .game-goal i.on { background: #ffe3a3; box-shadow: 0 0 8px rgba(255, 227, 163, .9); }
.game-next { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .16); }
.game-next-ico { font-size: 1.8rem; }
.game-next > div { flex: 1; min-width: 0; }
.game-next b { font-size: .85rem; }
.game-next .progress { height: 7px; margin: 6px 0 3px; background: rgba(255, 255, 255, .25); }
.game-next .progress i { background: #ffe3a3; }
.today-card { position: relative; overflow: hidden; }
.today-card .btn { animation: pulsebtn 2.2s ease-in-out infinite; }
@keyframes pulsebtn { 0%, 100% { box-shadow: 0 0 0 0 rgba(166, 92, 104, .45); } 50% { box-shadow: 0 0 0 9px rgba(166, 92, 104, 0); } }
.path-week { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; margin: 8px 0 -2px; }
.path-week:first-child { margin-top: 0; }
.medal.on { box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35); }
.medal.on span { animation: medalpop .6s ease; }
@keyframes medalpop { 0% { transform: scale(.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
.medal.t-bronze.on { border-color: #cd8b52; background: linear-gradient(180deg, #fbeadb, var(--card)); }
.medal.t-silver.on { border-color: #aab2bd; background: linear-gradient(180deg, #eef1f5, var(--card)); }
.medal.t-gold.on { border-color: #e0b13a; background: linear-gradient(180deg, #fff3cc, var(--card)); }
.medal.t-diamond.on { border-color: #6fc3e8; background: linear-gradient(180deg, #def4ff, var(--card)); }
.party { background: radial-gradient(circle at 50% 30%, rgba(125, 63, 76, .85), rgba(28, 21, 25, .92)); overflow: hidden; }
.party-box { position: relative; z-index: 1; }
.party-xp { font-size: 2.6rem; }
.party-up { display: inline-block; margin: 2px 0 6px; padding: 3px 12px; border-radius: 99px; background: var(--accent); color: #fff; font-size: .7rem; letter-spacing: .14em; font-weight: 700; }
.party-box .game-bar { margin: 8px 0 10px; background: var(--line); }
.party-box .game-bar i { transition: width 1.1s ease-out; background: linear-gradient(90deg, var(--accent), #e6a9b5); }
.party-medal { padding: 6px 10px; border-radius: 10px; background: var(--card); margin-top: 6px; }
.party-emoji { animation: bounce .8s ease; }
@keyframes bounce { 0% { transform: scale(.3) rotate(-20deg); } 55% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.cf { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: cffall linear forwards; z-index: 0; }
@keyframes cffall { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), 105vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) { .ring-fg, .flame, .today-card .btn, .medal.on span, .party-emoji { animation: none !important; } }

/* ---- Generatore del piano (coach) ---- */
.pg-prev { max-height: 38vh; overflow-y: auto; margin: 10px 0; }
.pg-week { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.pg-week summary { cursor: pointer; }
.pg-w { margin-top: 8px; }
.pg-w ol { margin: 4px 0 0; padding-left: 20px; }
.pg-w li { margin: 2px 0; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }

/* ---- Panoramica dei Percorsi (cliente) ---- */
.po-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.po-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--card); }
.po-card.cur { border-color: var(--accent); background: var(--accent-soft); }
.po-card h4 { margin: 6px 0 2px; }
.po-price { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.po-tbl th, .po-tbl td { text-align: center; font-size: .85rem; }
.po-tbl th:first-child, .po-tbl td:first-child { text-align: left; }
.po-tbl .yes { color: var(--ok); font-weight: 700; }
.po-tbl .no { color: var(--muted); }
.game-lv .game-sub b { display: inline; font-family: inherit; font-size: inherit; line-height: inherit; }
.po-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.po-opt b { font-family: var(--serif); font-size: 1.25rem; }
.po-opt .btn { flex: none; white-space: nowrap; padding: 8px 16px; min-height: 0; }
