:root{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#182235;background:#f4f6fb}*{box-sizing:border-box}body{margin:0}header{background:#111827;color:white;padding:env(safe-area-inset-top) 15px 12px}.top{display:flex;justify-content:space-between;align-items:center;gap:8px}.top small,small{letter-spacing:.17em;color:#9ca3af;font-weight:700}.top h1{font-size:25px;margin:8px 0 20px}.dot{color:#78e5a2;font-size:13px}nav{display:flex;justify-content:space-between;gap:4px}button{font:inherit;cursor:pointer}nav button{border:0;color:#a8b2c4;background:transparent;border-radius:10px;padding:12px 9px;font-weight:700;font-size:13px}nav button.active{color:#fff;background:#344054}main{max-width:780px;margin:auto;padding:16px 12px 90px}.days{display:flex;gap:8px;overflow-x:auto;padding-bottom:12px}.days button{white-space:nowrap;border:1px solid #d6deeb;background:white;border-radius:13px;padding:12px 15px;color:#0874de;font-weight:700}.days button.selected{background:#2463eb;color:#fff}.panel{background:#fff;border:1px solid #e0e6f0;border-radius:20px;padding:17px;margin:0 0 15px;box-shadow:0 1px 3px #15213a08}h2{font-size:22px;margin:9px 0 16px}h3{font-size:19px;margin:0}label{font-size:14px;color:#46536a;display:block;font-weight:600}input,select,textarea{font:inherit;color:#192337;border:1px solid #d6deeb;background:white;border-radius:11px;padding:10px;max-width:100%;min-width:0}input:focus,select:focus,textarea:focus{outline:2px solid #3b82f6;outline-offset:1px}textarea{width:100%;resize:vertical;line-height:1.45}.header-controls{display:flex;gap:12px;flex-wrap:wrap}.header-controls label{flex:1;min-width:130px}.header-controls input,.header-controls select,.othergym input{display:block;width:100%;margin-top:6px}.othergym{margin-top:12px}.saved{font-size:12px;color:#23804c;margin:12px 0 0}.exheading,.restline,.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.exheading h3{flex:1}.restline{margin:13px 0}.restline label{display:flex;align-items:center;gap:8px}.restline select{padding:7px}.historybtn{background:#edf4ff;border:1px solid #d5e6ff;color:#1558c0;border-radius:10px;padding:9px 12px;font-weight:700}.exercisegrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:13px}.smallheading{font-size:12px;font-weight:700;color:#67738a;margin:0 0 8px}.setrow{display:flex;align-items:center;gap:5px;margin:0 0 8px}.setnumber{font-size:13px;font-weight:700;color:#56657c;min-width:16px}.setrow input{width:32%;padding:10px 5px;text-align:center;font-size:15px}.setrow input:nth-of-type(2){flex:1}.multiply{font-weight:700}.skip{border:1px solid #e9a3aa;background:#f9dce0;color:#af343f;font-size:21px;font-weight:800;border-radius:10px;min-width:34px;min-height:39px}.skip.active{background:#dc2638;border-color:#dc2638;color:white}.is-skipped .setrow input,.setrow.is-skipped input{opacity:.45}.units{display:flex;gap:6px;margin:9px 0}.units select{width:50%;padding:7px 4px;font-size:13px}.notes label{margin-bottom:8px}.notes textarea{height:178px;font-size:15px}.plus,.remove{background:#eaf1fc;border:0;color:#1759be;border-radius:9px;padding:9px;font-size:12px;font-weight:700}.remove{margin-left:6px}.btn{border:0;border-radius:10px;background:#2563eb;color:white;font-weight:700;padding:12px 16px;margin:8px 0}.btn.secondary{background:#e9eef6;color:#26374f}.btn.danger{background:#b42333}.btn.armed{background:#7a1020}#toast{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:60;background:#111827;color:#fff;border-radius:12px;padding:12px 16px;font-size:14px;font-weight:600;max-width:92vw;display:none;box-shadow:0 6px 24px rgba(0,0,0,.3)}#toast.show{display:block}.tiny{font-size:12px;color:#68768c;font-weight:400}.overlay{position:fixed;inset:0;background:#0d1423a8;z-index:20;display:flex;align-items:center;justify-content:center;padding:15px}.modal{background:#fff;border-radius:20px;width:min(680px,100%);max-height:82dvh;display:flex;flex-direction:column;padding:17px}.modalhead{display:flex;justify-content:space-between;align-items:start;gap:10px}.modalhead h2{font-size:19px}.modalhead button{border:0;background:#edf1f7;border-radius:10px;font-size:23px;padding:5px 12px}.modalbody{overflow:auto;flex:1}.historyline{padding:12px 0;border-bottom:1px solid #e8ecf3;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}.editold{border:1px solid #d6deeb;background:#f5f8ff;border-radius:9px;padding:8px;font-size:12px;color:#1658bd;flex-shrink:0}.modal>.btn{width:100%;flex-shrink:0}@media(max-width:390px){.panel{padding:12px}.exercisegrid{gap:7px}.setrow{gap:3px}.setrow input{font-size:13px;padding:9px 3px}.skip{min-width:29px}.notes textarea{height:170px}.top h1{font-size:23px}}
.v4tools{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 12px}.v4tools button{border:1px solid #d1d5db;border-radius:8px;padding:7px 10px;background:#f9fafb;color:#111827;font-weight:600;min-height:36px}.v4tools .ssactive{background:#e0e7ff;border-color:#818cf8;color:#3730a3}
/* --- Migliorie v5 --- */
.lastline{font-size:13px;color:#1558c0;background:#edf4ff;border:1px solid #d5e6ff;border-radius:9px;padding:8px 10px;margin:10px 0;line-height:1.5}
.startline{font-size:13px;color:#46536a;margin:10px 0}
.donebtn{border:1px solid #b7e4c7;background:#e7f7ee;color:#166534;font-size:17px;font-weight:800;border-radius:10px;min-width:38px;min-height:39px}
.donebtn.active{background:#16a34a;border-color:#16a34a;color:#fff}
.setrow.is-done input{background:#f0fdf4}
.prbadge{display:inline-block;background:#f59e0b;color:#fff;font-size:11px;font-weight:800;border-radius:20px;padding:3px 9px;margin-left:8px;vertical-align:middle}
.progressbar{height:12px;background:#e5e7eb;border-radius:20px;overflow:hidden;margin:8px 0}
.progressbar>div{height:100%;background:#2563eb;border-radius:20px}
.summarygrid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin:10px 0}
.summarygrid .stat{background:#f4f6fb;border-radius:12px;padding:10px;text-align:center}
.summarygrid .stat b{display:block;font-size:19px}
.summarygrid .stat span{font-size:12px;color:#68768c}
.timerbar{position:fixed;left:0;right:0;bottom:0;z-index:50;background:#111827;color:#fff;display:flex;align-items:center;gap:14px;padding:12px 16px calc(12px + env(safe-area-inset-bottom));box-shadow:0 -4px 20px rgba(0,0,0,.25)}
.timerbar .ring{flex-shrink:0}
.timerbar .tinfo{flex:1;min-width:0}
.timerbar .tinfo b{font-size:22px;display:block}
.timerbar .tinfo span{font-size:12px;color:#a8b2c4}
.timerbar button{border:0;border-radius:10px;padding:12px 14px;font-weight:700;background:#344054;color:#fff}
.timerbar button.primary{background:#2563eb}
.timerbar button.skip-t{background:#b42333}
.segmented{display:inline-flex;border:1px solid #d6deeb;border-radius:11px;overflow:hidden}
.segmented button{border:0;background:#fff;padding:10px 14px;font-weight:700;color:#46536a}
.segmented button.active{background:#2563eb;color:#fff}
.sheet{position:fixed;inset:0;background:#0d1423a8;z-index:40;display:flex;align-items:flex-end;justify-content:center}
.sheet .sheetbox{background:#fff;border-radius:20px 20px 0 0;width:min(680px,100%);padding:20px;max-height:80dvh;overflow:auto}
.sheet .sheetbox h3{margin-bottom:8px}
.sheet .sheetbox p{color:#46536a;line-height:1.5}
.sheet .sheetrow{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.sheet .sheetrow .btn{flex:1}
.editor-row{border:1px solid #e0e6f0;border-radius:14px;padding:12px;margin-bottom:10px;background:#f9fafb}
.editor-row .rowline{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:8px}
.editor-row input[type=text]{flex:1;min-width:140px}
.editor-row input[type=number]{width:76px}
.editor-row select{padding:8px}
.editor-row .mini{border:1px solid #d1d5db;background:#fff;border-radius:8px;padding:8px 10px;font-weight:700;min-height:38px}
.editor-row .mini.danger{color:#b42333;border-color:#e9a3aa}
.chart{width:100%;height:auto;display:block}
.kpi{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.kpi .stat{background:#f4f6fb;border-radius:12px;padding:12px}
.kpi .stat b{display:block;font-size:20px}
.kpi .stat span{font-size:12px;color:#68768c}
.banner{background:#fef3c7;border:1px solid #f59e0b;color:#92400e;border-radius:12px;padding:12px;margin-bottom:12px;font-size:14px;line-height:1.5}
.inline-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:10px 0}
.inline-form input{flex:1;min-width:140px}

/* Gym Performance v5 */
:root{color-scheme:dark;--lime:#1677FF;--orange:#FF681F;--bg:#111315;--card:#25292B;--field:#171A1C;--muted:#AEB4B4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#F6F7F7;background:var(--bg)}
body{background:var(--bg);color:#F6F7F7}header{background:#111315;border-bottom:1px solid #33383A}.top small{color:var(--lime)}.top h1{margin:5px 0 12px;font-size:24px}.dot{color:var(--lime)}
nav{position:fixed;bottom:0;left:0;right:0;z-index:12;background:#181B1D;border-top:1px solid #34393A;padding:8px 8px calc(8px + env(safe-area-inset-bottom))}nav button{flex:1;color:#B9BDBD;font-size:12px;padding:12px 5px}nav button.active{color:#111315;background:var(--lime)}
main{padding-bottom:115px}.days button{background:#25292B;color:#D5D9D9;border-color:#3C4244}.days button.selected{background:var(--lime);color:#111315;border-color:var(--lime)}
.panel{background:var(--card);border:1px solid #383E40;box-shadow:none}.panel h2,.panel h3,h2,h3{color:#FAFAFA}.panel>small{color:var(--lime)}label{color:#D1D5D5}input,select,textarea{background:#15191A;color:#F5F5F5;border:1px solid #444B4D}input:focus,select:focus,textarea:focus{outline-color:var(--lime)}.tiny,.startline,.smallheading{color:#B7BFC0}.saved{color:var(--lime)}
.btn,.days button.selected{background:var(--lime);color:#101315}.btn.secondary,.plus,.remove,.historybtn{background:#363D3F;color:var(--lime);border-color:#4C5557}.btn.danger{background:#C53340;color:white}.v4tools button,.editor-row .mini{background:#171A1C;color:#E3E7E7;border-color:#4C5557}.v4tools .ssactive{background:#17355B;color:var(--lime);border-color:var(--lime)}
.setrow input{background:#15191A}.setrow.is-done input{background:#183451}.donebtn{background:#203B59;color:var(--lime);border-color:#397AC9}.donebtn.active{background:var(--lime);color:#111315;border-color:var(--lime)}.skip{background:#442A28;border-color:#9D5147;color:#FF9A82}.skip.active{background:#E3483C;color:#fff}.units select{background:#171A1C}.summarygrid .stat,.kpi .stat{background:#181B1D}.summarygrid .stat span,.kpi .stat span{color:#AEB4B4}.progressbar{background:#3A4042}.progressbar>div{background:var(--lime)}.prbadge{background:var(--orange);color:#111315}
.lastline{background:#152C45;color:var(--lime);border-color:#295A8E}.overlay,.sheet{background:#050606D9}.modal,.sheet .sheetbox{background:#25292B;color:#F6F7F7}.modalhead button{background:#3B4244;color:white}.historyline{border-color:#454B4D}.editold{background:#15191A;color:var(--lime);border-color:#4D5759}.sheet .sheetbox p{color:#D1D5D5}.editor-row{background:#1A1D1F;border-color:#42484A}.segmented{border-color:#4D5556}.segmented button{background:#202527;color:#D7DCDC}.segmented button.active{background:var(--lime);color:#111315}.banner{background:#453319;color:#FFDCA1;border-color:#A66E2E}
.timerbar{bottom:calc(64px + env(safe-area-inset-bottom));background:#1B1F21}.timerbar button.primary{background:var(--lime);color:#111315}.timerbar button.skip-t{background:var(--orange);color:#111315}#toast{bottom:calc(84px + env(safe-area-inset-bottom));background:#303638}
.exercisegrid{grid-template-columns:1fr 1fr}.notes textarea{height:118px}.exercise{border-left:3px solid #1677FF}.exheading h3{font-size:18px}.startline{font-size:12px}
.timed-card{background:#15191A;border:1px solid #3C4445;border-radius:15px;padding:14px;margin:12px 0}.timed-title{color:var(--lime);font-weight:900;letter-spacing:.06em}.time-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.time-field{font-size:12px;background:#25292B;border-radius:10px;padding:9px}.time-field input{display:block;width:100%;margin-top:5px;font-size:20px;font-weight:800;text-align:center}.time-field small{display:block;color:#B7BFC0;letter-spacing:0;font-weight:400;margin-top:4px}.timed-actions{display:flex;gap:8px;flex-wrap:wrap}.timed-actions .btn{flex:1;min-width:120px}
.circuit-overlay{position:fixed;inset:0;background:#0A0C0DF5;z-index:100;display:flex;align-items:center;justify-content:center;padding:18px}.circuit-shell{width:min(560px,100%);background:#25292B;border:1px solid #515A5B;border-radius:24px;padding:20px;text-align:center}.circuit-top{display:flex;align-items:center;justify-content:space-between;color:var(--lime);letter-spacing:.1em}.circuit-top button{background:#444B4D;color:white;border:0;border-radius:10px;padding:9px 13px}.circuit-shell h2{margin:24px 0 8px}.circuit-shell p{color:#BFC6C6}.circle-pair{display:flex;align-items:center;justify-content:center;gap:15px;margin:24px 0}.time-circle{border-radius:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:all .2s ease;border:5px solid #4A5153}.time-circle.big{width:190px;height:190px;max-width:56vw}.time-circle.small{width:112px;height:112px;border-width:3px;max-width:33vw}.time-circle.active-work{border-color:var(--lime);color:var(--lime)}.time-circle.active-rest{border-color:var(--orange);color:var(--orange)}.time-circle small{font-size:10px;font-weight:800}.time-circle strong{font-size:36px;letter-spacing:-.04em}.time-circle.small strong{font-size:20px}.next-phase{font-size:13px}
@media(max-width:600px){.exercisegrid{grid-template-columns:1fr}.notes textarea{height:75px}.summarygrid .stat b{font-size:17px}.setrow input{font-size:16px}.panel{padding:13px}.circle-pair{gap:8px}.time-circle.big{width:170px;height:170px}.time-circle.small{width:98px;height:98px}}

/* Beta 2: responsive date/gym and compact circular circuits */
.header-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;align-items:end}
.header-controls label{min-width:0;width:100%;overflow:hidden}
.header-controls input,.header-controls select{width:100%;min-width:0;max-width:100%;height:46px;box-sizing:border-box}
.compact-circuit{padding:16px 13px}.compact-circuit .timed-title{font-size:15px}
.circle-config{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:center;margin:18px 0 14px}
.circle-column{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}
.config-circle{width:min(100%,185px);aspect-ratio:1;border-radius:50%;border:5px solid;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#25292B}
.config-circle strong{font-size:clamp(32px,8vw,48px);line-height:1.1;color:#fff}
.config-circle span{font-size:11px;font-weight:800;margin-top:5px;letter-spacing:.04em;text-align:center}
.work-circle{border-color:var(--lime)}.work-circle span{color:var(--lime)}.rest-circle{border-color:var(--orange)}.rest-circle span{color:var(--orange)}
.cc-buttons{display:flex;gap:12px;justify-content:center}
.cc-buttons button{width:43px;height:40px;border:1px solid #667073;border-radius:10px;background:#202527;color:white;font-size:27px;font-weight:700;line-height:1}
.circuit-mini{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0}
.circuit-control{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:10px 4px;background:#25292B;border-radius:12px}
.circuit-control .cc-label{font-size:10px;letter-spacing:.04em;color:#BEC4C4;font-weight:800;text-align:center}
.circuit-control strong{font-size:19px;color:white}
.circuit-control.static strong{font-size:30px;color:var(--lime)}
.circuit-control .cc-buttons{gap:5px}.circuit-control .cc-buttons button{width:36px;height:36px;font-size:22px}
.circuit-launch{width:100%;padding:17px 12px;font-size:18px;margin:8px 0}
.circuit-advanced{display:block;margin:8px auto 12px;background:transparent;border:0;color:var(--orange);font-size:13px;padding:8px}
.circuit-switch{display:flex;gap:6px;margin-top:14px;background:#202527;padding:5px;border-radius:12px}
.circuit-switch button{flex:1;padding:10px 6px;border:0;border-radius:9px;background:transparent;color:#E0E4E4;font-weight:700}
.circuit-switch button.selected{background:var(--lime);color:#111315}
.scope-radio{display:flex;align-items:center;gap:10px;padding:10px 0;font-size:15px}.scope-radio input{width:19px;height:19px;accent-color:var(--lime)}
.sheetbox textarea{width:100%;min-height:88px;margin-top:8px;font-size:17px}
.advanced-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0}.advanced-row input{width:100px}
@media(max-width:380px){.header-controls{gap:8px}.header-controls input,.header-controls select{font-size:13px;padding:8px 4px}.config-circle{border-width:4px}.circuit-mini{gap:5px}.circuit-control{padding:9px 2px}}

/* BETA 3: full-width stacked session controls on small and large iPhones */
.header-controls{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important;align-items:stretch!important}
.header-controls label{display:block!important;min-width:0!important;width:100%!important;overflow:visible!important}
.header-controls input,.header-controls select{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;height:48px!important;margin-top:7px!important;box-sizing:border-box!important}
.header-controls input[type=date]{-webkit-appearance:none;appearance:none;min-height:48px;font-size:16px!important;padding:10px 12px!important}
.header-controls select{font-size:16px!important;padding:10px 12px!important}

/* Creatore manuale */
.builder-ex{border:1px solid #3a4142;border-radius:12px;padding:12px;margin:12px 0;background:#1b2021}.builder-ex .rowline{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.builder-ex .rowline b{flex:1;min-width:130px}.builder-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0}.builder-fields label{min-width:0;font-size:12px}.builder-fields input,.builder-fields select{width:100%;min-width:0;box-sizing:border-box}.builder-catalog{display:flex;gap:6px;flex-wrap:wrap;max-height:230px;overflow:auto;padding:8px 0}.builder-catalog button{text-align:left;white-space:normal}.days{flex-wrap:wrap}nav{flex-wrap:wrap}

/* BETA 4.2 — verde lime + arancione sportivo */
:root{--lime:#1677FF;--orange:#FF681F;--bg:#111315;--card:#24292C}
.plan-label{color:var(--lime)!important;letter-spacing:.14em;text-transform:uppercase;font-weight:800}
.exheading h3,.builder-ex .rowline b{color:var(--orange)}
.exercise{border-left-color:var(--orange)}
.restline label,.timed-title{color:var(--orange)}
.plus,.builder-catalog .mini{background:#49301F;color:#FF9A55;border:1px solid #A85C28}
.timerbar button.skip-t,.circuit-advanced{color:var(--orange)}
.archive-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #41494B}
.archive-item .tiny{margin:5px 0}.archive-item .btn{flex-shrink:0}

/* BETA 4.3: navigazione completa su iPhone, senza scorrimento orizzontale */
nav{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;flex-wrap:initial!important;padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important;overflow:visible!important}
nav button{width:100%;min-width:0;min-height:43px;padding:9px 4px!important;white-space:normal;font-size:12px!important;line-height:1.15}
main{padding-bottom:calc(170px + env(safe-area-inset-bottom))!important}
/* BETA 4.4: area libera per overlay esterni Netlify sui browser di prova.
   Il badge è iniettato dalla piattaforma e non viene rimosso dall'app. */
@media(max-width:700px){nav{bottom:56px!important;padding-bottom:8px!important;box-shadow:0 56px 0 0 #181B1D}main{padding-bottom:190px!important}.builder-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.builder-fields label{line-height:1.35}.builder-catalog .mini{padding:10px 12px}}

/* Esportazione PDF locale tramite stampa del browser: nessun servizio esterno. */
#print-plan{display:none}
@media print{
  @page{size:A4;margin:13mm}
  body.printing-plan{background:#fff!important;color:#202426!important;font:10pt/1.45 -apple-system,BlinkMacSystemFont,Arial,sans-serif!important}
  body.printing-plan > *:not(#print-plan){display:none!important}
  body.printing-plan #print-plan{display:block!important;position:static!important;background:white!important;color:#202426!important}
  #print-plan .pdf-header{display:block!important;border-bottom:3px solid #1677FF;padding:0 0 12px;margin:0 0 20px}
  #print-plan .pdf-header h1{font-size:23pt;color:#202426!important;margin:4px 0}
  #print-plan .pdf-kicker{font-size:9pt;font-weight:800;letter-spacing:2px;color:#1154B5!important}
  #print-plan .pdf-header p{color:#555!important;margin:0}
  #print-plan .pdf-day{break-inside:avoid-page;page-break-inside:avoid;margin:0 0 24px}
  #print-plan .pdf-day h2{font-size:15pt;color:#cf5c08!important;margin:0 0 2px}
  #print-plan .pdf-group{font-weight:700;margin:0 0 8px}
  #print-plan table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:8.5pt;margin-top:8px}
  #print-plan th,#print-plan td{border:1px solid #d2d5d5;padding:6px 5px;vertical-align:top;overflow-wrap:anywhere}
  #print-plan th{background:#E5F0FF!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;text-align:left}
  #print-plan th:nth-child(1){width:4%}#print-plan th:nth-child(2){width:37%}#print-plan th:nth-child(3){width:8%}#print-plan th:nth-child(4){width:12%}#print-plan th:nth-child(5){width:20%}#print-plan th:nth-child(6){width:19%}
  #print-plan .pdf-note{font-size:8pt;color:#555!important;margin-top:3px}
  #print-plan .pdf-footer{border-top:1px solid #ccc;padding-top:6px;color:#666!important;font-size:8pt}
}

/* BETA 4.5 FIX: tema blu coerente e barra inferiore compatta su iPhone. */
:root{--lime:#1677FF!important;--orange:#FF681F!important}
nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:3px!important;bottom:0!important;box-shadow:none!important;padding:6px 5px calc(6px + env(safe-area-inset-bottom))!important;align-items:stretch!important}
nav button{min-width:0!important;width:100%!important;min-height:44px!important;padding:7px 2px!important;font-size:clamp(9px,2.45vw,12px)!important;line-height:1.1!important;overflow-wrap:anywhere!important;white-space:normal!important;border-radius:9px!important}
main{padding-bottom:calc(85px + env(safe-area-inset-bottom))!important}
@media(max-width:700px){nav{bottom:0!important;box-shadow:none!important;padding-bottom:calc(6px + env(safe-area-inset-bottom))!important}main{padding-bottom:calc(85px + env(safe-area-inset-bottom))!important}}

/* BETA 4.5 bluefix3: keep all five navigation actions clear of the Netlify badge on mobile Safari. */
@media (max-width:700px){
  nav{bottom:76px!important;box-shadow:none!important;padding:5px 5px 6px!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;z-index:80!important}
  nav button{min-height:43px!important}
  main{padding-bottom:calc(155px + env(safe-area-inset-bottom))!important}
  .timerbar{bottom:calc(145px + env(safe-area-inset-bottom))!important}
  #toast{bottom:calc(148px + env(safe-area-inset-bottom))!important}
}

/* BETA 4.6 IRON RED */
:root{--lime:#FF3B4E!important;--orange:#C8CDD2!important;--bg:#151515!important;--card:#29292C!important;--field:#19191B!important;--muted:#C8CDD2!important}
body,header{background:#151515!important}.panel,.exercise,.modal,.sheet .sheetbox{background:#29292C!important}.exheading h3,.restline label,.top small,.saved{color:#FF3B4E!important}.exercise{border-left-color:#FF3B4E!important}.days button.selected,.segmented button.active{background:#FF3B4E!important;color:white!important}.btn:not(.danger):not(.secondary),.donebtn.active{background:#FF3B4E!important;color:white!important}.progressbar>div{background:#FF3B4E!important}.prbadge,.plus,.builder-catalog .mini{color:#C8CDD2!important}.skip,.remove,.btn.danger{background:#57232A!important;color:#FFABB4!important;border-color:#9D3C48!important}
nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:2px!important;bottom:76px!important;padding:5px 5px 6px!important;background:#151515!important;border-top:1px solid #343438!important;z-index:80!important;box-shadow:none!important}nav button{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;min-width:0!important;min-height:55px!important;padding:5px 1px!important;border-radius:11px!important;color:#C8CDD2!important;font-size:clamp(9px,2.25vw,11px)!important;line-height:1.1!important}nav button svg{display:block;width:23px;height:23px;flex-shrink:0}nav button span{display:block;text-align:center;white-space:normal}nav button.active{background:#242427!important;color:#FF3B4E!important}main{padding-bottom:calc(165px + env(safe-area-inset-bottom))!important}.timerbar{bottom:calc(155px + env(safe-area-inset-bottom))!important}#toast{bottom:calc(160px + env(safe-area-inset-bottom))!important}@media(min-width:701px){nav{bottom:0!important}main{padding-bottom:110px!important}}@media print{nav{display:none!important}}

/* BETA 4.7: dialogs centered above fixed navigation and external hosting badges. */
.sheet{position:fixed!important;inset:0!important;z-index:220!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:calc(16px + env(safe-area-inset-top)) 16px calc(115px + env(safe-area-inset-bottom))!important;overflow-y:auto!important;background:rgba(0,0,0,.80)!important}
.sheet .sheetbox{position:relative!important;width:min(520px,100%)!important;max-height:min(72dvh,650px)!important;overflow-y:auto!important;overscroll-behavior:contain!important;border-radius:20px!important;padding:22px!important;background:#29292C!important;border:1px solid #48484D!important;box-shadow:0 20px 60px #000A!important;margin:auto!important}
.sheet .sheetbox h3{color:#F8F8F8!important;font-size:21px!important}
.sheet .sheetrow{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
.sheet .sheetrow .btn{min-width:0!important;margin:0!important;white-space:normal!important;min-height:50px!important}
.sheet .sheetrow .btn.secondary{background:#3C3D41!important;color:#F5F5F5!important}
.sheet .sheetrow .btn.danger{background:#8B2636!important;color:white!important}
/* Remove residual blue/orange from legacy controls. */
.donebtn{background:#3A252A!important;border-color:#8E4650!important;color:#FF6B7A!important}
.donebtn.active{background:#FF3B4E!important;border-color:#FF3B4E!important;color:white!important}
.setrow.is-done input{background:#33272B!important}
.plus,.builder-catalog .mini{background:#343438!important;border:1px solid #66666B!important;color:#F2F2F2!important}
.historybtn,.editold{background:#37373B!important;color:#FF6B7A!important;border-color:#59595F!important}
input:focus,select:focus,textarea:focus{outline-color:#FF3B4E!important}
@media(max-width:390px){.sheet{padding-left:10px!important;padding-right:10px!important}.sheet .sheetbox{padding:17px!important}}

/* BETA 4.7.1: iOS-safe, viewport-centered dialogs with independently scrollable contents. */
html:has(#sheet-root .sheet),body:has(#sheet-root .sheet){overflow:hidden!important}
body.dialog-open nav,body:has(#sheet-root .sheet) nav{display:none!important}
#sheet-root{position:relative;z-index:1000}
#sheet-root .sheet{position:fixed!important;inset:0!important;z-index:1000!important;display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;box-sizing:border-box!important;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom))!important;background:rgba(0,0,0,.88)!important}
#sheet-root .sheet .sheetbox{display:flex!important;flex-direction:column!important;position:relative!important;flex:0 1 auto!important;width:min(520px,100%)!important;min-height:0!important;max-height:100%!important;max-height:calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom))!important;margin:0!important;padding:18px!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;scroll-padding-bottom:24px!important;border-radius:18px!important}
#sheet-root .sheet .sheetbox>*{flex-shrink:0}
#sheet-root .sheet .sheetbox textarea{max-height:110px!important}
#sheet-root .sheet .sheetrow{display:flex!important;flex-wrap:wrap!important;gap:9px!important;padding-bottom:12px!important}
#sheet-root .sheet .sheetrow .btn{flex:1 1 140px!important}
#sheet-root .sheet .scope-radio{display:flex!important;align-items:center!important;gap:10px!important;min-height:44px!important;padding:8px 0!important}
#sheet-root .sheet .scope-radio input{flex-shrink:0}
@media(max-height:620px){#sheet-root .sheet{align-items:stretch!important}#sheet-root .sheet .sheetbox{margin:auto!important;padding:13px!important}}
