:root {
  --navy: #23266f;
  --navy-2: #2f3496;
  --blue: #1e6bff;
  --red: #c8372d;
  --bg: #f3f5fa;
  --card: #ffffff;
  --txt: #161a33;
  --muted: #5d6480;
  --border: #e1e5ef;
  --chip: #eef1fb;
  --warn-bg: #fff3e6;
  --warn-txt: #8a4300;
  --figure-bg: radial-gradient(120% 80% at 50% 30%, #3a3f5c 0%, #1d2032 60%, #14161f 100%);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(22, 26, 51, .06), 0 6px 20px rgba(22, 26, 51, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1122;
    --card: #171b33;
    --txt: #eef0fa;
    --muted: #a3a9c4;
    --border: #2a2f50;
    --chip: #232850;
    --warn-bg: #3a2814;
    --warn-txt: #ffcf9e;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1122; --card: #171b33; --txt: #eef0fa; --muted: #a3a9c4;
  --border: #2a2f50; --chip: #232850; --warn-bg: #3a2814; --warn-txt: #ffcf9e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button { font: inherit; color: inherit; }

/* ───── Header ───── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: #fff;
  border-bottom: 1px solid #e1e5ef;
  color: var(--navy);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; }
.brand img { height: 28px; width: auto; }
.brand span {
  font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--navy); border-left: 1px solid #d5d9e8; padding-left: 10px; white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; color: var(--navy); text-decoration: none;
}
.icon-btn:hover { background: #eef1fb; }

main { max-width: 980px; margin: 0 auto; padding: 16px 16px 48px; outline: none; }

/* ───── Elementi comuni ───── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px;
}
.card h3 { font-size: 17px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--card); border-radius: 12px;
  padding: 11px 16px; cursor: pointer; font-weight: 600; text-decoration: none;
}
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; width: 100%; }

.seg {
  display: inline-flex; padding: 3px; border-radius: 12px; background: var(--chip); gap: 2px;
}
.seg button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--txt); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 12px; }

/* ───── Home ───── */
.hero h1 { font-size: 26px; margin: 4px 0 6px; }
.hero p { margin: 0 0 14px; color: var(--muted); }
.home-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .home-grid { grid-template-columns: 380px 1fr; align-items: start; } }

.map-card { padding: 12px; }
.map-figure { background: var(--figure-bg); border-radius: 12px; position: relative; }
.map-figure image, .fig image, .thumb image { image-rendering: auto; }
.map-figure svg { display: block; width: 100%; height: min(64vh, 560px); }
.hit { fill: #4a8dff; fill-opacity: .1; stroke: none; cursor: pointer; transition: fill-opacity .15s; }
.hit:hover, .hit.on { fill-opacity: .35; }
.map-hint { text-align: center; font-size: 14px; color: var(--muted); margin: 10px 4px 0; line-height: 1.4; }
.hot { cursor: pointer; }
.hot-dot { fill: #fff; stroke: #1e6bff; stroke-width: 1.4; }
.hot-ring { fill: #2f7bff; opacity: .4; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: hotpulse 2.2s ease-out infinite; }
.hot:hover .hot-dot, .hot.on .hot-dot { fill: #1e6bff; }
@keyframes hotpulse { 0% { transform: scale(.45); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
.map-tip { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 15px; text-align: center; }
.map-tip-hand { display: inline-block; animation: tiphand 1.6s ease-in-out infinite; }
@keyframes tiphand { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .hot-ring, .map-tip-hand { animation: none; } }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.chip {
  display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 15px;
}
.chip:hover { border-color: var(--blue); }
.chip .ico { font-size: 20px; }

.search {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--txt); font-size: 16px; outline: none;
}
.search:focus { border-color: var(--blue); }

/* ───── Lista muscoli ───── */
.list { display: grid; gap: 10px; }
.m-item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px 10px 10px; text-decoration: none; box-shadow: var(--shadow);
}
.m-item:hover { border-color: var(--blue); }
.thumb { width: 72px; height: 88px; background: var(--figure-bg); border-radius: 10px; overflow: hidden; }
.thumb svg { width: 100%; height: 100%; display: block; }
.m-item h3 { font-size: 16px; margin-bottom: 3px; }
.m-item p { margin: 0; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-bottom: 4px; }
.badge.p1 { background: #1e6bff; color: #fff; }
.badge.p0 { background: var(--chip); color: var(--muted); }
.chev { color: var(--muted); }

/* ───── Dettaglio ───── */
.detail-head h1 { font-size: 24px; margin: 2px 0 2px; }
.detail-head .latin { font-style: italic; color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.figures { display: grid; gap: 10px; grid-template-columns: 1fr; }
.figures.two { grid-template-columns: 1fr 1fr; }
.fig { background: var(--figure-bg); border: 1px solid #2a2e45; border-radius: 14px; overflow: hidden; position: relative; }
.fig svg { display: block; width: 100%; height: 380px; touch-action: manipulation; }
.figures.two .fig svg { height: 340px; }
.fig .fig-label {
  position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: #e8ebf7; background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 99px;
}
.fig .fig-side {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #e8ebf7;
  background: rgba(0,0,0,.35); padding: 3px 8px; border-radius: 99px; white-space: nowrap;
}
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 0; font-size: 13.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend svg { width: 22px; height: 22px; flex: none; }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 40px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center;
}
.callout { background: #eaf1ff; color: #13306e; border-radius: 12px; padding: 12px 14px; font-size: 14.5px; margin-top: 4px; }
.warn { background: var(--warn-bg); color: var(--warn-txt); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.cols { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 820px) {
  .detail-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; }
  .detail-grid .sticky { position: sticky; top: 72px; }
}
.sessions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.session { background: var(--chip); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.session span { font-size: 13px; color: var(--muted); }
.session b { font-size: 20px; color: var(--navy); }
:root[data-theme="dark"] .session b { color: #c9ceff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .session b { color: #c9ceff; } }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { border-radius: 10px; padding: 6px 2px; text-align: center; background: var(--chip); color: var(--muted); }
.day b { display: block; font-size: 14px; }
.day span { font-size: 10.5px; }
.day.on { background: var(--navy); color: #fff; }
/* ───── Video ───── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vcard { text-decoration: none; display: block; }
.vthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #23266f, #1e6bff); }
.vthumb.tall { aspect-ratio: 9 / 16; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(10, 12, 30, .55); display: grid; place-items: center; }
.vtitle { font-size: 13.5px; font-weight: 600; margin-top: 6px; line-height: 1.3; }
.vgroup { font-size: 15px; margin: 16px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.vgroup:first-of-type { margin-top: 4px; }
.vgroup a { color: var(--blue); text-decoration: none; font-weight: 600; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; }
.player.portrait { aspect-ratio: 9 / 16; width: min(100%, calc(78vh * 9 / 16)); margin: 0 auto; }
.player iframe, .player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vpromo { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; text-decoration: none; }
.vpromo-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--navy); display: grid; place-items: center; }
ul.flags { margin: 0; padding-left: 20px; }
ul.flags li { margin-bottom: 4px; }
.ref { font-size: 13px; color: var(--muted); }

/* ───── Figura anatomica (tavole 3D) ───── */
.zone.p1 { fill: url(#solid); filter: url(#soft); }
.zone.p0 { fill: url(#dots); stroke: #6fa3ff; stroke-width: .3; stroke-dasharray: 1 .8; filter: url(#softer); }
.tp .halo { stroke: #fff; stroke-linecap: round; }
.tp .mark { stroke: #0c0e1d; stroke-linecap: round; }
.tp .pulse { fill: none; stroke: #0c0e1d; stroke-opacity: .5; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tp .pulse { animation: none; opacity: 0; } }

/* ───── Accesso con seriale ───── */
.gate { position: fixed; inset: 0; z-index: 60; background: linear-gradient(160deg, #23266f, #1e3fa8); display: grid; place-items: center; padding: 16px; overflow: auto; }
.gate-box { background: var(--card); border-radius: 22px; padding: 26px 22px; width: 100%; max-width: 420px; box-shadow: 0 24px 70px rgba(0,0,0,.35); }
.gate-logo { height: 36px; display: block; margin: 0 auto 18px; background: #fff; border-radius: 8px; padding: 4px 8px; }
.gate-device { display: block; width: 140px; height: auto; margin: 0 auto 14px; border-radius: 14px; }
.device { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; margin: 0 0 14px; padding: 10px; border-radius: 12px; background: var(--chip); }
.device img { width: 110px; height: auto; border-radius: 10px; display: block; }
.device p { margin: 0; font-size: 14px; }
.gate-box h1 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.gate-box p { font-size: 15px; color: var(--muted); margin: 0 0 14px; text-align: center; }
.gate-label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.gate-input { font-size: 20px; letter-spacing: .06em; text-transform: uppercase; text-align: center; font-variant-numeric: tabular-nums; }
.pcard { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; text-decoration: none; }
.pcard img { width: 64px; height: 84px; object-fit: cover; object-position: top; border-radius: 10px; background: #fff; }
.pcard b { display: block; font-size: 16px; line-height: 1.25; margin: 2px 0; }
.pimg { width: 100%; height: auto; display: block; border-radius: 10px; background: #fff; }
.howto { display: grid; grid-template-columns: 0.7fr 1fr; gap: 8px; margin: 0 0 14px; }
.howto figure { margin: 0; }
.howto.gel { grid-template-columns: 1fr 1fr; margin: 0 0 12px; }
.howto img { width: 100%; height: 150px; object-fit: cover; border-radius: 10px; display: block; }
.howto figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.gate-input::placeholder { text-transform: none; letter-spacing: .02em; }
.gate-msg { min-height: 22px; margin: 8px 0 4px !important; font-size: 14px !important; color: var(--red) !important; }
.gate-msg.ok { color: #157a3c !important; }
.gate-help { font-size: 13px !important; margin: 14px 0 0 !important; }
.btn[disabled] { opacity: .6; cursor: wait; }

/* ───── Profilazione ───── */
.onboard { max-width: 520px; }
.ob-opts { display: grid; gap: 8px; margin: 4px 0 14px; }
.ob-opt { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; text-align: left; padding: 12px; border: 2px solid var(--border); border-radius: 14px; background: var(--card); cursor: pointer; }
.ob-opt .ico { font-size: 26px; text-align: center; }
.ob-opt b { display: block; font-size: 16px; }
.ob-opt span span { font-size: 13px; color: var(--muted); }
.ob-opt[aria-checked="true"] { border-color: var(--navy); background: var(--chip); }
.ob-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ob-pill { border: 2px solid var(--border); background: var(--card); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.ob-pill[aria-checked="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.onboard select { margin-bottom: 14px; font-size: 15px; }
.ob-cancel { width: 100%; margin-top: 8px; }
.ob-privacy { display: grid; gap: 10px; margin-top: 4px; }
.ck { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 13.5px; line-height: 1.4; text-align: left; }
.ck input { width: 20px; height: 20px; margin: 0; accent-color: var(--navy); }
.ck a, .privacy-box a { color: var(--blue); }
.privacy-box { max-height: 86vh; overflow: auto; }
.privacy-box h4 { margin: 14px 0 4px; font-size: 15px; }
.privacy-box p { font-size: 14px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.foot { text-align: center; font-size: 13px; color: var(--muted); padding: 0 16px 32px; }
.foot a { color: var(--muted); }
.proto { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px; text-decoration: none; margin-bottom: 8px; background: var(--card); }
.proto:hover { border-color: var(--blue); }
.proto .pdf { width: 44px; height: 44px; border-radius: 10px; background: #c8372d; color: #fff; font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.proto b { display: block; font-size: 15px; line-height: 1.3; }
.profile-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--chip); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; text-decoration: none; margin-bottom: 8px; }

/* ───── Modale ───── */
.modal { position: fixed; inset: 0; background: rgba(10, 12, 30, .55); display: grid; place-items: center; padding: 16px; z-index: 70; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border-radius: 20px; padding: 22px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h2 { margin-bottom: 10px; font-size: 21px; }
.modal-box p { margin: 0 0 10px; font-size: 15px; }
.modal-box .btn { margin-top: 8px; }

@media (max-width: 460px) {
  .brand span { display: none; }
}
@media (max-width: 380px) {
  .figures.two .fig svg { height: 300px; }
}

/* Promemoria delle 2 ore */
.timerbar { display: block; width: 100%; border: 0; cursor: pointer; text-align: center;
  background: var(--navy); color: #fff; font: inherit; font-size: 14px; padding: 9px 16px; }
.timerbar.done { background: #b45309; }
.tm-card .tm-ring { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; }
.tm-ring b { font-size: 30px; color: var(--navy); letter-spacing: -.02em; }
.tm-ring span { color: var(--muted); font-size: 14px; }
.tm-card .btn { width: 100%; }
.tm-stats { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); }
.tm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #d5d9e8; margin: 0 1px; vertical-align: -1px; }
.tm-dot.on { background: var(--blue); }

/* Misura i tuoi progressi (Sport) */
.tests-promo .vpromo-ico { font-size: 22px; }
.ts-ico { width: 40px; height: 40px; border-radius: 12px; background: rgba(30,107,255,.12); display: grid; place-items: center; font-size: 20px; flex: none; }
.ts-live { text-align: center; padding: 18px 0 8px; }
.ts-big { font-size: 56px; font-weight: 800; color: var(--navy); letter-spacing: -.02em; line-height: 1.1; min-height: 62px; }
.ts-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ts-col { background: rgba(35,38,111,.06); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ts-col b { font-size: 22px; color: var(--navy); }
.ts-hist { list-style: none; margin: 0; padding: 0; }
.ts-hist li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.ts-done { background: #e8f7ee; color: #14532d; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ts-big, :root:not([data-theme="light"]) .ts-col b, :root:not([data-theme="light"]) .tm-ring b { color: #c9ceff; } }

/* ══════════════════════════════════════════════════════════════
   Stile Equistasi — solo i colori del sito equistasi.com
   Indaco #29235C · Giallo #FADC00 · Blu #1D71B8 · Azzurro #488CC5 · Grigio #F4F6F8
   ══════════════════════════════════════════════════════════════ */
:root {
  --indigo: #29235C;
  --yellow: #FADC00;
  --eqblue: #1D71B8;
  --sky: #488CC5;
  --grey: #F4F6F8;
  --navy: #29235C;
  --blue: #1D71B8;
  --bg: #F4F6F8;
  --card: #ffffff;
  --txt: #1d1946;
  --muted: #5f5d7e;
  --border: #e6e7ee;
  --chip: #F4F6F8;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(41, 35, 92, .06), 0 8px 24px rgba(41, 35, 92, .07);
  --tab-h: 66px;
  --warn-bg: #fff8cc;
  --warn-txt: #29235C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #14112f; --card: #1f1a48; --txt: #f4f6f8; --muted: #b3b0cf; --border: #2e2862; --chip: #29235C; --warn-bg: #3a3410; --warn-txt: #fff3a0; }
}
:root[data-theme="dark"] { --bg: #14112f; --card: #1f1a48; --txt: #f4f6f8; --muted: #b3b0cf; --border: #2e2862; --chip: #29235C; --warn-bg: #3a3410; --warn-txt: #fff3a0; }

body { font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; }
main { padding-top: 0; padding-bottom: 12px; }

/* Barra in alto */
.top { background: #fff; border-bottom: 0; box-shadow: 0 1px 0 rgba(41, 35, 92, .06); }
.brand span { border: 0; border-radius: 99px; padding: 3px 10px; background: var(--yellow); color: var(--indigo); font-size: 11.5px; }
.icon-btn { color: var(--indigo); border-radius: 14px; }
.icon-btn:hover { background: var(--grey); }
@media (max-width: 819px) { .top .nav-link { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .top { background: #1f1a48; } :root:not([data-theme="light"]) .icon-btn { color: #fff; } }

/* Intestazione indaco con l'onda gialla, come sul sito */
.hero {
  position: relative; margin: 0 -16px 18px; padding: 20px 20px 64px; color: #fff;
  background: var(--indigo);
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 46px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 46' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C90 0 170 6 240 22 C300 36 350 34 400 14 L400 46 L0 46Z' fill='%23FADC00'/%3E%3Cpath d='M0 38 C90 12 170 16 240 30 C300 42 350 42 400 26 L400 46 L0 46Z' fill='%23F4F6F8'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::after { filter: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 46' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C90 0 170 6 240 22 C300 36 350 34 400 14 L400 46 L0 46Z' fill='%23FADC00'/%3E%3Cpath d='M0 38 C90 12 170 16 240 30 C300 42 350 42 400 26 L400 46 L0 46Z' fill='%2314112f'/%3E%3C/svg%3E"); } }
@media (min-width: 1012px) { .hero { margin: 0 0 18px; border-radius: 0 0 28px 28px; } }
.hero .eyebrow { color: var(--yellow); }
.hero h1 { color: #fff; font-size: 30px; line-height: 1.12; margin: 6px 0 8px; }
.hero h1 .hl { color: var(--yellow); }
.hero p { color: rgba(255, 255, 255, .82); margin: 0; font-size: 15.5px; }
.hero .profile-chip { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.hero-img { display: block; width: 100%; max-height: 170px; object-fit: cover; border-radius: 18px; margin: 14px 0 0; border: 3px solid var(--yellow); }

.eyebrow { color: var(--eqblue); font-weight: 800; letter-spacing: .1em; font-size: 11.5px; }
.detail-head { padding-top: 16px; }
.detail-head h1 { font-size: 26px; color: var(--indigo); }
.detail-head h1 .hl { color: var(--eqblue); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .detail-head h1 { color: #fff; } :root:not([data-theme="light"]) .detail-head h1 .hl { color: var(--yellow); } }

/* Schede */
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card h3 { font-size: 17.5px; color: var(--indigo); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card h3 { color: #fff; } }

/* Pulsanti: indaco, e giallo per l'azione principale */
.btn { border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; background: var(--grey); color: var(--indigo); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--yellow); color: var(--indigo); box-shadow: 0 6px 16px rgba(250, 220, 0, .35); }
.btn.primary:hover { background: #ffe31f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn { background: #29235C; color: #fff; } :root:not([data-theme="light"]) .btn.primary { background: var(--yellow); color: var(--indigo); } }

/* Selettori */
.seg { border-radius: 999px; padding: 4px; background: var(--grey); }
.seg button { border-radius: 999px; padding: 8px 16px; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--indigo); color: #fff; box-shadow: none; }

/* Mappa */
.map-card { padding: 14px; }
.map-figure { border-radius: 18px; overflow: hidden; }
.map-tip { background: var(--yellow); color: var(--indigo); border-radius: 999px; font-weight: 800; }
.hot-dot { fill: var(--yellow); stroke: var(--indigo); stroke-width: 1.2; }
.hot:hover .hot-dot, .hot.on .hot-dot { fill: #fff; }
.hot-ring { fill: var(--yellow); }
.tp-dot { fill: #1b1840; stroke: var(--yellow); stroke-width: .9; cursor: pointer; }
.tp-dot:hover, .tp-dot.on { fill: var(--yellow); stroke: #1b1840; }
.hit { fill: var(--yellow); fill-opacity: .08; }
.hit:hover, .hit.on { fill-opacity: .3; }

/* Zone */
.chips { gap: 10px; }
.chip { border: 0; border-radius: 16px; padding: 12px; box-shadow: var(--shadow); gap: 12px; color: var(--indigo); }
.chip .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 21px; flex: none; background: rgba(250, 220, 0, .28); }
.chips .chip:nth-child(even) .ico { background: rgba(72, 140, 197, .18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip { color: #fff; } }
.search { border-radius: 14px; border: 2px solid transparent; background: var(--grey); }
.search:focus { border-color: var(--eqblue); background: var(--card); }

/* Liste */
.m-item { border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.thumb { border-radius: 12px; }
.badge.p1 { background: var(--eqblue); }
.steps li::before { background: var(--yellow); color: var(--indigo); font-weight: 800; }
.callout { background: rgba(72, 140, 197, .14); color: inherit; border-radius: 14px; }
.warn { border-radius: 14px; }
.device { border-radius: 16px; background: var(--grey); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .device { background: #29235C; } }
.fig { border: 0; border-radius: 18px; }
.howto img { border-radius: 14px; }
.session { border-radius: 14px; background: var(--grey); }
.session b { color: var(--indigo); }
.day { border-radius: 10px; background: var(--grey); }
.day.on { background: var(--indigo); color: #fff; }
.day.on span { color: var(--yellow); }

/* Schede con icona */
.vpromo-ico { border-radius: 14px; background: var(--yellow); }
.vpromo-ico svg path { fill: var(--indigo); }
.tests-promo .vpromo-ico { background: var(--sky); }
.proto { border: 0; border-radius: 16px; box-shadow: var(--shadow); }
.proto .pdf { border-radius: 12px; background: var(--indigo); color: var(--yellow); }
.vthumb { border-radius: 14px; background: var(--indigo); }
.play { background: var(--yellow); }
.play svg path { fill: var(--indigo); }
.player { border-radius: 18px; }

/* Promemoria: scheda indaco con accenti gialli */
.tm-card { background: var(--indigo); color: #fff; }
.tm-card h3, .tm-card b, .tm-ring b { color: #fff !important; }
.tm-ring b { color: var(--yellow) !important; }
.tm-card .small, .tm-ring span, .tm-stats { color: rgba(255, 255, 255, .82); }
.tm-card .btn { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.tm-card .btn.primary { background: var(--yellow); color: var(--indigo); }
.tm-card .warn, .tm-card .callout { background: rgba(250, 220, 0, .18); color: #fff; }
.tm-dot { background: rgba(255, 255, 255, .3); }
.tm-dot.on { background: var(--yellow); }
.timerbar { background: var(--indigo); color: #fff; font-weight: 700; }
.timerbar b { color: var(--yellow); }
.timerbar.done { background: var(--yellow); color: var(--indigo); }
.timerbar.done b { color: var(--indigo); }

/* Test sport con illustrazioni */
.ts-ico { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--grey); }
.ts-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-item:has(.ts-ico) { grid-template-columns: 64px 1fr auto; }
.ts-hero { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 18px; margin: 0 0 14px; }
.ts-col { border-radius: 14px; background: var(--grey); }
.ts-col b { color: var(--indigo); }
.ts-big { color: var(--indigo); }
.ts-done { background: rgba(250, 220, 0, .25); color: var(--indigo); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ts-col { background: #29235C; } :root:not([data-theme="light"]) .ts-col b, :root:not([data-theme="light"]) .ts-big { color: var(--yellow); } :root:not([data-theme="light"]) .ts-done { color: #fff; } }

/* Accesso e profilazione */
.gate { background: var(--indigo); }
.gate::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 46' preserveAspectRatio='none'%3E%3Cpath d='M0 30 C90 0 170 6 240 22 C300 36 350 34 400 14 L400 46 L0 46Z' fill='%23FADC00'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat; }
.gate-box { position: relative; z-index: 1; border-radius: 24px; }
.ob-opt { border-radius: 16px; }
.ob-opt[aria-checked="true"] { border-color: var(--indigo); background: rgba(250, 220, 0, .18); }
.ob-pill[aria-checked="true"] { border-color: var(--indigo); background: var(--indigo); color: #fff; }
.ck input { accent-color: var(--indigo); }
.modal-box { border-radius: 24px; }

/* Barra di navigazione in basso (indaco, voce attiva gialla) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 6px 8px env(safe-area-inset-bottom);
  background: var(--indigo);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: rgba(255, 255, 255, .7); font-size: 11.5px; font-weight: 700; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a .tb-ic { display: grid; place-items: center; width: 48px; height: 30px; border-radius: 999px; }
.tabbar a.on { color: #fff; }
.tabbar a.on .tb-ic { background: var(--yellow); color: var(--indigo); }
@media (min-width: 820px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; width: 420px; border-radius: 22px; height: var(--tab-h); padding: 6px 8px; box-shadow: 0 12px 30px rgba(41, 35, 92, .3); } }
.foot { padding-bottom: calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.tests-promo .vpromo-ico { overflow: hidden; padding: 0; }
.tests-promo .vpromo-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Profilo attuale e pulsante "Cambia profilo" */
.profile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 10px 10px 10px 14px; border-radius: 18px; background: rgba(255, 255, 255, .1); }
.profile-now { display: flex; flex-direction: column; min-width: 0; }
.profile-now .small { font-size: 12px; color: rgba(255, 255, 255, .7); }
.profile-now b { font-size: 15px; color: #fff; line-height: 1.25; }
.profile-switch { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  background: var(--yellow); color: var(--indigo); font-weight: 800; font-size: 15px; text-decoration: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.profile-switch:active { transform: scale(.97); }

/* Sotto-menu patologie sotto "Patologia neurologica" */
.ob-opt.has-sub { grid-template-columns: 40px 1fr auto; }
.ob-caret { font-size: 18px; color: var(--muted); transition: transform .2s; }
.ob-opt[aria-checked="true"] .ob-caret { transform: rotate(180deg); color: var(--indigo); }
.ob-sub { margin: -4px 0 4px 18px; padding: 12px 12px 4px; border-left: 3px solid var(--yellow); background: var(--grey); border-radius: 0 14px 14px 0; animation: obsub .2s ease-out; }
.ob-sub .gate-label { margin-bottom: 8px; }
.ob-sub .ob-pills { margin-bottom: 8px; }
.ob-sub .ob-pill { padding: 10px 16px; font-size: 15px; }
@keyframes obsub { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ob-sub { background: #29235C; } }

/* Come funziona a fumetti */
.howsteps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.howsteps figure { margin: 0; }
.howsteps img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; display: block; background: var(--grey); }
.howsteps figcaption { font-size: 12.5px; line-height: 1.3; margin-top: 6px; font-weight: 600; }
.howsteps figcaption > b:first-child { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); color: var(--indigo); font-size: 12px; margin-right: 4px; }

/* Copertina a fumetti: un tocco porta alla mappa */
.hero-cover { position: relative; display: block; width: 100%; margin: 16px 0 0; padding: 0; border: 3px solid var(--yellow); border-radius: 20px; overflow: hidden; background: #fff; cursor: pointer; }
.hero-cover img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; }
.hero-cover-cta { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); white-space: nowrap;
  background: var(--yellow); color: var(--indigo); font-weight: 800; font-size: 15px; padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(41, 35, 92, .35); animation: ctapulse 2s ease-in-out infinite; }
.hero-cover:active { transform: scale(.99); }
@keyframes ctapulse { 0%, 100% { transform: translateX(-50%) scale(1); } 50% { transform: translateX(-50%) scale(1.05); } }
.map-card { scroll-margin-top: 70px; }
.map-card.flash { animation: mapflash 1.2s ease-out; }
@keyframes mapflash { 0% { box-shadow: 0 0 0 0 rgba(250, 220, 0, .9); } 100% { box-shadow: 0 0 0 18px rgba(250, 220, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .hero-cover-cta, .map-card.flash { animation: none; } }

/* Home neurologico: copertina che porta ai protocolli */
.hero-cover.neuro img { max-height: 240px; object-position: center 20%; }
.sec-title { font-size: 20px; color: var(--indigo); margin: 4px 2px 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sec-title { color: #fff; } }
.protos-anchor { scroll-margin-top: 70px; border-radius: 22px; }
.protos-anchor.flash { animation: mapflash 1.2s ease-out; }

/* Visore PDF e ingrandimento immagini */
.pdf-pages { display: grid; gap: 12px; }
.pdf-page { width: 100%; height: auto; display: block; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: 12px; background: #fff; }
.zoom-ov { position: fixed; inset: 0; z-index: 80; background: rgba(20, 17, 47, .92); overflow: auto; padding: 60px 10px 20px; }
.zoom-ov img { width: 100%; max-width: 1000px; height: auto; display: block; margin: 0 auto; border-radius: 12px; background: #fff; }
.zoom-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: auto !important; z-index: 81; }

/* Accetto le condizioni ed entro */
.ck-accept { padding: 12px; border-radius: 14px; background: rgba(250, 220, 0, .22); border: 2px solid var(--yellow); font-size: 14.5px; }
.ck-accept input { width: 24px; height: 24px; }
.ob-submit { width: 100%; margin-top: 4px; }

.ts-safety { margin: 0 0 14px; }

/* Promemoria giornalieri (app nativa) */
.tm-daily { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .18); }
.tm-daily .ck { color: #fff; font-size: 14px; }
.tm-times { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.tm-times input { margin-left: 6px; font: inherit; border: 0; border-radius: 10px; padding: 6px 8px; background: rgba(255, 255, 255, .15); color: #fff; }

/* Shop: riquadro «Shop» */
.shop-card { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; background: var(--indigo, #29235C); color: #fff; }
.shop-card .shop-ico { width: 46px; height: 46px; border-radius: 14px; background: var(--yellow, #FADC00); display: grid; place-items: center; font-size: 24px; flex: none; }
.shop-card .shop-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.shop-card .shop-txt b { font-size: 1.05rem; }
.shop-card .shop-txt .small { color: rgba(255,255,255,.85); }
.shop-card .chev { font-size: 1.8rem; color: var(--yellow, #FADC00); }
.shop-card:hover { filter: brightness(1.08); }

/* Scelta della lingua (Italiano / English) */
.lang-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--grey, #F4F6F8); margin: 0 auto 12px; }
.lang-switch button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; color: var(--indigo, #29235C); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: var(--indigo, #29235C); color: #fff; }
.gate-box .lang-switch { align-self: center; }

/* Avviso: le mappe sono solo esempi */
.example-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: #fff8cc; color: var(--indigo, #29235C); font-size: 13px; line-height: 1.45; }

/* Metodo alternativo: metamero e dermatomero */
.meta-region { padding: 0; overflow: hidden; }
.meta-region > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.meta-region > summary::-webkit-details-marker { display: none; }
.meta-region > summary::after { content: '›'; margin-left: 6px; font-size: 22px; color: var(--muted, #6b7280); transition: transform .2s; }
.meta-region[open] > summary::after { transform: rotate(90deg); }
.meta-region .seg-badge { margin-left: auto; background: #29235C; color: #FADC00; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.meta-body { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 16px; padding: 0 16px 16px; align-items: start; }
.meta-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta-figs figure { margin: 0; background: #1e1a46; border-radius: 14px; overflow: hidden; }
.meta-figs svg { display: block; width: 100%; height: 280px; }
.meta-figs figcaption { color: #fff; font-size: 12px; font-weight: 700; text-align: center; padding: 4px 6px 7px; }
.meta-figs .zbox { fill: none; stroke: #FADC00; stroke-width: 1.6; }
.meta-figs .vdot { fill: #FADC00; stroke: #1e1a46; stroke-width: .8; }
.meta-figs .vlabel { font: 800 4.2px 'Open Sans', sans-serif; fill: #FADC00; paint-order: stroke; stroke: #1e1a46; stroke-width: 1px; }
.meta-find { margin: 0; padding-left: 18px; }
.meta-find li { margin: 4px 0; }
.meta-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-top: 12px; }
.meta-link .meta-ico { font-size: 26px; }
.meta-link b { display: block; }
.howsteps.comic { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .howsteps.comic { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .meta-body { grid-template-columns: 1fr; } .meta-figs svg { height: 260px; } }

/* Due criteri: trigger point o metamero */
.criteria h3 { margin-top: 0; }
.criteria .crit { display: flex; gap: 12px; align-items: flex-start; margin: 10px 0; }
.criteria .crit p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.criteria .crit-ico { font-size: 24px; line-height: 1; flex: none; width: 36px; height: 36px; display: grid; place-items: center; background: var(--grey, #F4F6F8); border-radius: 50%; }
.criteria .crit-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.criteria .crit-btns .btn { text-align: center; text-decoration: none; justify-content: center; }
@media (max-width: 380px) { .criteria .crit-btns { grid-template-columns: 1fr; } }
