/* ==========================================================================
   IronFlow v5 — Allenamento: settimane, lista esercizi, guided, timer, log
   ========================================================================== */

/* selettore settimane */
.week-strip { display: flex; gap: 7px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.week-strip::-webkit-scrollbar { display: none; }
.week-pill { flex: 0 0 auto; min-width: 62px; padding: 9px 6px; border-radius: var(--r-sm); text-align: center;
  background: var(--surface); border: 1px solid var(--border); transition: var(--t); }
.week-pill .wp-top { font-size: 13px; font-weight: 800; }
.week-pill .wp-sub { font-size: 9.5px; color: var(--text-3); font-weight: 650; margin-top: 1px; text-transform: uppercase; letter-spacing: 0.04em; }
.week-pill.active { background: var(--accent); border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent-glow); }
.week-pill.active .wp-sub { color: rgba(255,255,255,0.85); }
.week-pill.deload { border-color: rgba(242,184,75,0.35); }

/* card sessione */
.sess-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 10px; transition: var(--t); text-align: left; width: 100%; }
.sess-card:active { transform: scale(0.99); }
.sess-card.done { opacity: 0.62; }
.sess-card.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -14px var(--accent-glow); }
.sess-badge { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: 0 0 auto;
  font-size: 19px; font-weight: 850; background: var(--accent-soft); color: var(--accent-2); }
.sess-card.done .sess-badge { background: var(--green-soft); color: var(--green); }
.sess-main { flex: 1; min-width: 0; }
.sess-title { font-size: 15px; font-weight: 750; }
.sess-focus { font-size: 12px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-date { font-size: 11px; color: var(--text-3); font-weight: 650; margin-top: 4px; }
.sess-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-2); flex: 0 0 auto; display: grid; place-items: center; }
.sess-card.done .sess-check { background: var(--green); border-color: var(--green); }
.sess-card.done .sess-check svg { width: 15px; height: 15px; color: #04140C; }

/* lista esercizi (anteprima scheda) */
.ex-section { margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ex-sec-head { display: flex; align-items: center; gap: 10px; padding: 14px; width: 100%; text-align: left; }
.ex-sec-head .sec-ico { width: 9px; height: 9px; border-radius: 50%; }
.ex-sec-title { font-size: 14px; font-weight: 750; flex: 1; }
.ex-sec-count { font-size: 12px; color: var(--text-3); font-weight: 700; }
.ex-sec-chev { width: 18px; height: 18px; color: var(--text-3); transition: transform var(--t); }
.ex-sec-head.open .ex-sec-chev { transform: rotate(180deg); }
.ex-sec-body { border-top: 1px solid var(--border); }

.ex-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ex-row:last-child { border-bottom: none; }
.ex-thumb { width: 50px; height: 50px; border-radius: 12px; overflow: hidden; flex: 0 0 auto; background: #fff; display: grid; place-items: center; }
.ex-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ex-thumb .ph { font-size: 18px; }
.ex-body { flex: 1; min-width: 0; }
.ex-name { font-size: 14px; font-weight: 650; line-height: 1.25; }
.ex-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ex-meta .ss { color: var(--orange); font-weight: 750; }
.ex-prescr { font-weight: 750; color: var(--accent-2); }

/* superset bracket */
.ss-group { border-left: 2px solid var(--orange); margin-left: 6px; }

/* ---------------- GUIDED OVERLAY ---------------- */
.guided { position: fixed; inset: 0; z-index: 500; background: var(--bg); display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.35s var(--ease); }
.guided.open { transform: translateY(0); }
.guided-top { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-top) + 12px) var(--pad) 10px; }
.guided-close { width: 38px; height: 38px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; flex: 0 0 auto; }
.guided-close svg { width: 18px; height: 18px; }
.guided-prog { flex: 1; }
.guided-prog-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.guided-prog-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width 0.4s var(--ease); }
.guided-prog-txt { font-size: 11px; color: var(--text-3); font-weight: 650; margin-top: 5px; display: flex; justify-content: space-between; }
.guided-timer { font-variant-numeric: tabular-nums; font-weight: 750; color: var(--text-2); font-size: 13px; }

.guided-body { flex: 1; overflow-y: auto; padding: 6px var(--pad) 20px; }
.g-phase { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-2); margin-bottom: 8px; }
.g-name { font-size: 25px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 4px; }
.g-sub { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }
.g-demo { width: 100%; aspect-ratio: 4/3; border-radius: var(--r-lg); overflow: hidden; background: #fff;
  position: relative; margin-bottom: 16px; border: 1px solid var(--border); }
.g-demo img { width: 100%; height: 100%; object-fit: contain; }
.g-demo .g-demo-ph { background: var(--surface); }
.g-demo .g-demo-ph { position: absolute; inset: 0; display: grid; place-items: center; }
.g-prescr-row { display: flex; gap: 10px; margin-bottom: 16px; }
.g-prescr { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; text-align: center; }
.g-prescr-label { font-size: 10px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.g-prescr-val { font-size: 18px; font-weight: 850; margin-top: 3px; letter-spacing: -0.02em; }
.g-prescr-val.accent { color: var(--accent-2); }

.g-cues { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; }
.g-cues li { list-style: none; font-size: 13.5px; color: var(--text-2); padding-left: 20px; position: relative; margin: 7px 0; line-height: 1.4; }
.g-cues li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.g-hint { display: flex; gap: 9px; align-items: flex-start; background: var(--lime-soft); border: 1px solid rgba(255,194,75,0.25);
  border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; font-size: 13px; color: #F1D9A0; }
.g-hint svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; color: var(--gold); }
.g-warn { background: var(--accent-soft); border-color: rgba(255,106,44,0.3); color: #FFC9AC; }
.g-warn svg { color: var(--accent); }

/* set logging */
.sets-table { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.set-row { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 44px; gap: 8px; align-items: center; }
.set-row.head { font-size: 10px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0 2px; }
.set-row.head span { text-align: center; }
.set-num { width: 34px; height: 46px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: var(--text-2); }
.set-row.logged .set-num { background: var(--green-soft); color: var(--green); border-color: transparent; }
.log-input { height: 46px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); text-align: center;
  font-size: 17px; font-weight: 750; width: 100%; -moz-appearance: textfield; }
.log-input::-webkit-outer-spin-button, .log-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.log-input:focus { outline: none; border-color: var(--accent); background: var(--surface-2); }
.log-input::placeholder { color: var(--text-3); font-weight: 600; }
.set-ok { width: 44px; height: 46px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; }
.set-ok svg { width: 19px; height: 19px; color: var(--text-3); }
.set-row.logged .set-ok { background: var(--green); border-color: transparent; }
.set-row.logged .set-ok svg { color: #04140C; }

.g-actions { display: flex; flex-direction: column; gap: 10px; padding: 12px var(--pad) calc(var(--safe-bottom) + 14px);
  border-top: 1px solid var(--border); background: var(--bg-elev); }
.g-actions .row { display: flex; gap: 10px; }
.g-actions .row .btn { flex: 1; }

/* rest timer */
.rest { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; text-align: center; }
.rest-label { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--orange); margin-bottom: 6px; }
.rest-next { font-size: 15px; color: var(--text-2); margin-bottom: 26px; }
.rest-ring { position: relative; width: 240px; height: 240px; margin-bottom: 26px; }
.rest-ring svg { width: 100%; height: 100%; }
.rest-ring .val { stroke: var(--orange); }
.rest-ring.warn .val { stroke: var(--red); }
.rest-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.rest-time .t { font-size: 52px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: -0.04em; }
.rest-time .s { font-size: 12px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }
.rest-ctrls { display: flex; gap: 10px; }
.rest-btn { width: 68px; height: 52px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); font-weight: 750; font-size: 14px; }
.rest-skip { background: var(--orange); color: #1E1002; border: none; padding: 0 26px; width: auto; }

/* completion */
.finish { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.finish-emoji { font-size: 66px; margin-bottom: 12px; animation: pop 0.5s var(--ease); }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.finish h2 { font-size: 26px; font-weight: 850; letter-spacing: -0.03em; }
.finish p { color: var(--text-2); margin: 8px 0 24px; }
.finish-stats { display: flex; gap: 12px; margin-bottom: 26px; }

/* pre-check chips */
.precheck { display: flex; flex-direction: column; gap: 16px; }
.pc-group .pc-q { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.pc-opts { display: flex; gap: 8px; }
.pc-opt { flex: 1; padding: 14px 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border);
  font-size: 22px; text-align: center; transition: var(--t); }
.pc-opt.sel { border-color: var(--accent); background: var(--accent-soft); }
