:root{--ink:#233c33;--green:#285444;--muted:#6c786e;--paper:#f7f6f0;--line:#dddfd4;--orange:#b65d31;--serif:Georgia,'Times New Roman',serif}
*{box-sizing:border-box}
body{margin:0;color:var(--ink);background:var(--paper);font:16px/1.6 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
a{color:inherit;text-decoration:none}
a:hover{text-decoration:underline}
button,input,textarea,select{font:inherit}
button,.button,.file-button{border:1px solid var(--green);border-radius:7px;background:var(--green);color:#fff;padding:10px 17px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;font-size:.88rem;font-weight:600;line-height:1.4;text-decoration:none;gap:6px}
button:hover,.button:hover{filter:brightness(.94);text-decoration:none}
button:disabled{opacity:.45;cursor:default}
.secondary,.file-button{background:transparent;color:var(--green);border-color:#c5cdbf}
.text-button{border:0;background:transparent;color:var(--green);padding:7px;cursor:pointer}
.danger{color:#a83e32}
.danger-button{background:#a83e32;border-color:#a83e32;color:#fff}
.small-btn{padding:7px 12px;font-size:.8rem}
.notif-active{background:#eaf4ed!important;color:var(--green)!important;border-color:#b0d2b7!important}
.full-width{width:100%}
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}

.site-header{max-width:1280px;margin:auto;display:flex;justify-content:space-between;align-items:center;padding:24px 5%;border-bottom:1px solid var(--line);gap:24px}
.brand{display:flex;align-items:center;gap:12px;font:26px var(--serif);font-weight:bold}
.brand small{font:9px system-ui;letter-spacing:2px;display:block;margin-top:6px}
.brand-mark{border:1px solid #9bab97;border-radius:50%;display:grid;place-items:center;width:48px;height:48px;font:30px var(--serif)}
nav{display:flex;align-items:center;gap:20px;font-size:13px;flex-wrap:wrap}
nav form{margin:0}
.user-badge{background:#e7eee8;color:var(--green);padding:4px 10px;border-radius:20px;font-weight:600;font-size:12px}

.wake-bar{background:#eef1ea;border-bottom:1px solid var(--line);padding:6px 5%}
.wake-bar-inner{max-width:1180px;margin:auto;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;font-size:12px}
.wake-pill{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;border-radius:999px;font-weight:600}
.wake-pill.on{background:#dfeee3;color:#225238}
.wake-pill.pending{background:#fff3db;color:#805316}
.wake-pill.off{background:#e9ebe6;color:var(--muted)}
.wake-toggle-label{display:inline-flex;align-items:center;gap:6px;margin:0;font-weight:500;font-size:12px;cursor:pointer}
.wake-toggle-label input{margin:0;width:auto}

main{max-width:1180px;margin:auto;padding:0 28px 60px;min-height:75vh}
h1,h2,h3{font-family:var(--serif);font-weight:normal;line-height:1.15}
h1{font-size:clamp(30px,4vw,46px);margin:10px 0 14px;letter-spacing:-1px}
h2{font-size:25px;margin:0 0 10px}
h3{font-size:21px;margin:6px 0 10px}
p{margin-top:0}
.eyebrow{font-size:10px;font-weight:700;letter-spacing:2px;color:var(--muted);display:block}
.muted,small{color:var(--muted);font-size:12px}
.divider{border:0;border-top:1px solid var(--line);margin:24px 0}

.intro{display:flex;justify-content:space-between;align-items:center;padding:52px 0 34px;gap:24px}
.intro h1{margin-bottom:14px}
.intro p{color:var(--muted);font-size:15px;max-width:620px}
.intro-stamp{flex-shrink:0;transform:rotate(12deg);border:1px solid #a3b29e;border-radius:50%;width:125px;height:125px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;font-size:9px;letter-spacing:2px;line-height:1.7;color:#718369}
.intro-stamp b{font-size:27px;line-height:1}

.section-label{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:28px 0 16px;flex-wrap:wrap}
.section-label h2{margin:0}
.section-label>span{font-size:12px;color:var(--muted)}

.panel{background:#fff;border:1px solid var(--line);border-radius:10px;padding:26px;margin:20px 0}
.empty{text-align:center;padding:55px 20px;border:1px dashed var(--line);border-radius:12px;background:#fff8}
.empty>span{font-size:48px;color:#88977d;display:block;margin-bottom:8px}
.empty p{color:var(--muted)}

label{display:block;font-size:13px;font-weight:600}
input:not([type=checkbox]):not(.stepper-input),textarea,select{display:block;width:100%;padding:10px 12px;border:1px solid #cbd1c5;border-radius:6px;background:#fff;color:var(--ink);margin:6px 0 16px;font-size:15px}
input[type=checkbox]{accent-color:var(--green);margin-right:8px}
input:not(.stepper-input):focus,textarea:focus,select:focus{outline:2px solid #9eb8a7;outline-offset:2px}
textarea{resize:vertical}
.checkbox-row{display:flex;align-items:flex-start;gap:8px;margin:12px 0 18px;font-weight:500}
.checkbox-row input{margin-top:4px}

.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}
.field-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}

.auth-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:26px;margin-top:28px;align-items:start}
.user-chips{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.chip{display:inline-flex;align-items:center;gap:4px;padding:5px 12px;border-radius:999px;border:1px solid var(--line);background:#f7f8f3;font-size:13px;font-weight:600}
.chip.active,.chip:hover{background:var(--green);color:#fff;border-color:var(--green);text-decoration:none}

.machine-mini-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}
.machine-mini-card{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;transition:transform .15s}
.machine-mini-card:hover{transform:translateY(-2px);text-decoration:none}
.machine-mini-card img,.thumbnail{width:52px;height:52px;object-fit:cover;border-radius:8px;flex-shrink:0;background:#e8ebdb}
.machine-mini-placeholder,.thumbnail-placeholder{width:52px;height:52px;border-radius:8px;background:#e8ebdb;display:grid;place-items:center;font-size:22px;flex-shrink:0}
.machine-mini-card small{display:block;color:var(--muted)}

.active-session-banner{background:#e7f2ea;border:1px solid #9ec4aa;border-radius:10px;padding:18px 22px;margin:18px 0;display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.active-session-banner h3{margin:4px 0}

.routine-cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:20px;margin-top:28px}
.routine-summary-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px 22px;cursor:pointer;transition:transform .16s,box-shadow .16s,border-color .16s;display:flex;flex-direction:column;justify-content:space-between}
.routine-summary-card:hover,.routine-summary-card:focus-visible{transform:translateY(-3px);box-shadow:0 10px 26px #233c3312;border-color:#9bb0a0;outline:none}
.routine-card-header{padding-bottom:12px;border-bottom:1px solid var(--line);width:100%}
.routine-card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}
.routine-card-top h2{margin:4px 0 0;font-size:22px}
.routine-card-notes{margin:10px 0 0;font-size:13px;color:var(--muted);line-height:1.45;width:100%;word-break:break-word}
.routine-card-duration{text-align:right;background:#eef3ee;padding:6px 11px;border-radius:8px;flex-shrink:0}
.routine-card-duration strong{display:block;color:var(--green);font-size:15px;line-height:1.2;font-variant-numeric:tabular-nums}
.routine-card-duration small{font-size:11px;color:var(--muted)}
.routine-card-exercises{list-style:none;padding:6px 0 0;margin:0}
.routine-card-exercises li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:9px 0;border-bottom:1px dashed #e6e8df;font-size:14px}
.routine-card-exercises li:last-child{border-bottom:0;padding-bottom:0}
.routine-ex-name{font-weight:500}
.routine-ex-meta{display:inline-flex;align-items:baseline;gap:8px;color:var(--muted);font-size:13px;flex-shrink:0}
.routine-ex-meta strong{color:var(--ink);font-weight:600}
.routine-bottom-actions{margin-top:26px;display:flex;justify-content:center}

.routine-days-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(460px,1fr));gap:22px}
.day-card{margin:0;display:flex;flex-direction:column;justify-content:space-between}
.day-card-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:14px}
.day-card-header h2,.day-card-header h3{margin:4px 0}
.day-exercise-list{list-style:none;padding:0;margin:0}
.day-exercise-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-top:1px solid var(--line);flex-wrap:wrap}
.day-exercise-main{display:flex;align-items:center;gap:12px}
.day-exercise-main small{display:block}
.day-exercise-timers{display:flex;gap:6px;flex-wrap:wrap}
.tag{font-size:11px;background:#eef2ea;color:var(--ink);padding:4px 9px;border-radius:5px;font-weight:600}
.tag.rest{background:#fff2df;color:#875018}
.badge{font-size:11px;color:#3d6449;background:#e3efe6;padding:4px 9px;border-radius:5px;font-weight:700}

.catalog-layout{display:grid;grid-template-columns:1fr 1.35fr;gap:24px;align-items:start}
.catalog-item{display:flex;width:100%;text-align:left;justify-content:flex-start;margin-bottom:10px;gap:12px;background:#fafaf6;color:var(--ink);border:1px solid var(--line);padding:10px 14px}
.catalog-item.selected-catalog-item{border-color:var(--green);background:#ebf2ed}
.catalog-item-row{display:flex;align-items:center;gap:8px;margin-bottom:8px;background:#fafaf6;border:1px solid var(--line);border-radius:8px;padding:3px 10px 3px 6px;transition:background .15s,border-color .15s}
.catalog-item-row.selected-catalog-item{border-color:var(--green);background:#ebf2ed}
.catalog-item-row.disabled-machine{opacity:0.65;background:#f3f4ef}
.catalog-item-button{display:flex;flex:1;align-items:center;background:transparent;border:0;padding:8px 6px;text-align:left;gap:12px;cursor:pointer;color:var(--ink);min-width:0}
.catalog-visibility-btn{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:8px;border:1px solid transparent;background:transparent;color:var(--muted);cursor:pointer;transition:background .15s,color .15s,border-color .15s;flex-shrink:0;padding:0}
.catalog-visibility-btn:hover{background:#e8ece4;color:var(--ink)}
.catalog-visibility-btn.is-active{color:var(--green)}
.catalog-visibility-btn.is-active:hover{background:#dfeee3;color:#1e4d34}
.catalog-visibility-btn.is-disabled{color:#8b939e;background:#edf0eb;border-color:#dbe1d8}
.catalog-visibility-btn.is-disabled:hover{background:#dbe1d8;color:#374151}
.tag.tag-active{background:var(--green);color:#fff}
.tag-zone{background:#e0e7ff;color:#3730a3;font-weight:700;font-size:11px;padding:2px 7px;border-radius:4px}
.tag-muscle{background:#f3f4f6;color:#4b5563;font-size:11px;padding:2px 7px;border-radius:4px}
.badge-common{background:#eef2f7 !important;color:#31507a !important}
.badge-user{background:#fef3c7 !important;color:#92400e !important}
.badge-disabled{background:#f3f4f6 !important;color:#6b7280 !important}
.badge-in-routine{background:#e6f4ea !important;color:#137333 !important;border:1px solid #b7e1cd;font-weight:700}
.search{display:flex;align-items:center;border:1px solid #ccd2c4;border-radius:7px;background:#fff;padding:0 14px;gap:10px}
.search input{border:0;margin:0;padding:9px 0;outline:none}
.photo-picker{margin:12px 0}
.photo-picker>img{display:block;max-width:300px;max-height:200px;object-fit:cover;border-radius:10px;margin-bottom:14px;border:1px solid var(--line)}
.photo-empty{padding:24px;border:1px dashed var(--line);border-radius:8px;color:var(--muted);margin-bottom:14px;text-align:center}
.file-button{position:relative;overflow:hidden;cursor:pointer}
.file-button input{position:absolute;inset:0;opacity:0;cursor:pointer;margin:0;width:100%;height:100%}

.detail-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap}
.step-card{background:#fff;border:1px solid var(--line);padding:14px 18px;border-radius:10px;margin:12px 0}
.step-card.done{background:#f1f6ef;border-color:#b8ccb9}
.step-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;flex-wrap:wrap}
.step-heading{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.step-heading h2{font-size:17px;margin:0;line-height:1.25}
.step-number{font:700 20px var(--sans);color:#6b7c65;min-width:20px}
.step-status{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:1px;font-weight:700}
.step-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:3px}
.step-tags span{font-size:11px;background:#f1f3ea;padding:2px 7px;border-radius:4px;font-weight:600}
.step-edit-link{font-size:12px;color:var(--green);text-decoration:underline;text-underline-offset:3px;font-weight:600}

.day-view-bar{display:flex;justify-content:space-between;align-items:center;gap:16px;margin:22px 0 14px;flex-wrap:wrap}
.day-view-title{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
.day-view-title h1{margin:0;font-size:clamp(24px,3.2vw,34px)}
.back-inline{font-size:13px;color:var(--muted);font-weight:600}

/* Tarjeta resumen global anclada arriba */
.day-sticky-summary{position:sticky;top:8px;z-index:20;background:#fff;border:2px solid var(--green);border-radius:12px;padding:10px 18px;margin:8px 0 18px;box-shadow:0 6px 20px #1f352b14}
.global-summary-top{display:flex;justify-content:space-between;align-items:center;gap:14px}
.global-time-block{display:flex;flex-direction:column;gap:2px}
.global-time-block.right{text-align:right}
.global-label{font-size:10px;font-weight:700;letter-spacing:1.4px;color:var(--muted)}
.global-clock{font-variant-numeric:tabular-nums;font-size:clamp(20px,3.2vw,28px);font-weight:800;color:var(--green);line-height:1.1}
.global-clock.muted-clock{color:var(--ink);opacity:.8}
.global-center-control{display:flex;align-items:center;justify-content:center}
.global-play-btn{
    min-width:96px;
    padding:6px 14px;
    font-size:13px;
    font-weight:700;
    border-radius:8px;
    text-align:center;
    white-space:nowrap;
    cursor:pointer;
    transition:background .15s ease,border-color .15s ease,transform .08s ease;
}
.global-play-btn:active{transform:scale(.97)}
.global-play-btn.running{background:#b85828;border-color:#b85828;color:#fff}
.global-play-btn.paused{background:#d98b19;border-color:#d98b19;color:#fff}
.global-play-btn.done{background:#2e7d47;border-color:#2e7d47;color:#fff;cursor:default}
.global-progress-track{height:6px;background:#e4e7de;border-radius:999px;overflow:hidden;margin-top:8px}
.global-progress-fill{display:block;height:100%;width:0%;background:linear-gradient(90deg,#285444,#3ca360);border-radius:999px;transition:width .25s linear}

/* Fila en vivo de Ejercicio / Descanso en la barra anclada */
.global-live-stage{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:8px 12px;
    margin:8px 0 6px;
    border-radius:10px;
    background:#f8faf6;
    border:1px solid #dce4d8;
    transition:background-color .2s ease,border-color .2s ease;
}
.global-live-stage.is-exercise{
    background:#eff7f1;
    border-color:#2d6a4f;
    box-shadow:0 0 0 1px #2d6a4f22;
}
.global-live-stage.is-rest{
    background:#fff3f1;
    border-color:#d93829;
    box-shadow:0 0 0 1px #d9382922;
}
.global-live-stage.is-prep{
    background:#fffbf0;
    border-color:#e09f18;
}
.global-live-stage.is-inter{
    background:#f2f6fa;
    border-color:#4a6fa5;
}
.stage-info-col{
    display:flex;
    flex-direction:column;
    gap:3px;
    min-width:0;
    flex:1;
}
.stage-badges-line{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}
.stage-badge{
    font-size:12px;
    font-weight:800;
    letter-spacing:.6px;
    text-transform:uppercase;
    padding:3px 9px;
    border-radius:6px;
    line-height:1.1;
    display:inline-flex;
    align-items:center;
    gap:4px;
}
.stage-badge.stage-exercise{background:#2d6a4f;color:#fff}
.stage-badge.stage-rest{background:#d93829;color:#fff}
.stage-badge.stage-prep{background:#d48b14;color:#fff}
.stage-badge.stage-inter{background:#4a6fa5;color:#fff}
.stage-badge.stage-idle{background:#e2e8df;color:#4f5d4e}
.stage-counter{
    font-size:13px;
    font-weight:800;
    color:var(--ink);
    background:#fff;
    border:1px solid #d4ded0;
    padding:2px 8px;
    border-radius:6px;
    letter-spacing:.3px;
}
.stage-machine{
    font-size:14px;
    font-weight:700;
    color:var(--ink);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.stage-clock-col{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    flex-shrink:0;
}
.stage-clock{
    font-variant-numeric:tabular-nums;
    font-size:clamp(26px,4.5vw,36px);
    font-weight:900;
    line-height:1;
    color:var(--ink);
    letter-spacing:-.5px;
}
.stage-clock.clock-exercise{color:#2d6a4f}
.stage-clock.clock-rest{color:#d93829}
.stage-clock.clock-prep{color:#d48b14}

.workout-machine-card{transition:border-color .2s,box-shadow .2s}
.workout-machine-card.card-running{border-color:#2e7d47;box-shadow:0 8px 24px #28544418}
.workout-machine-card.card-finished{background:#f3f7f2;border-color:#b2cbb6}

.workout-machine-header{
    display:flex;
    flex-direction:column;
    gap:5px;
    margin-bottom:8px;
}
.workout-machine-title-row{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}
.workout-machine-title{
    margin:0;
    font-size:18px;
    font-weight:700;
    color:var(--ink);
    line-height:1.25;
}
.workout-machine-title .step-number{
    font:700 18px var(--sans);
    color:var(--green);
    display:inline;
    margin-right:2px;
}
.workout-machine-tags-row{
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}
.workout-machine-tags-row span{
    font-size:13px;
    font-weight:700;
    padding:3px 9px;
    border-radius:6px;
    display:inline-flex;
    align-items:center;
    line-height:1.2;
}
.workout-machine-actions-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:2px;
}
.workout-machine-photo-wrap{
    display:flex;
    justify-content:flex-end;
    align-items:center;
}
.workout-machine-photo{
    width:64px;
    height:64px;
    object-fit:cover;
    border-radius:10px;
    border:1px solid var(--line);
    flex-shrink:0;
    box-shadow:0 1px 3px rgba(0,0,0,0.06);
}
.workout-machine-photo-placeholder{
    width:64px;
    height:64px;
    border-radius:10px;
    background:#e8ebdb;
    display:grid;
    place-items:center;
    font-size:26px;
    flex-shrink:0;
    text-decoration:none;
}
.superset-photos{display:flex;gap:6px}
.superset-photos .workout-machine-photo{width:64px;height:64px;border-radius:10px}

.tag-ex{background:#e3f3e7!important;color:#1d5e34!important;border:1px solid #c2e2c8}
.tag-rest{background:#fce8e6!important;color:#9c2b23!important;border:1px solid #f6c8c4}

.card-timer-controls{
    display:flex;
    align-items:center;
    gap:6px;
}
.card-timer-summary{display:none}
.card-play-btn{
    min-width:110px;
    height:64px;
    padding:0 20px;
    font-size:15px;
    font-weight:700;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-align:center;
    white-space:nowrap;
}
.card-play-btn.running{background:#b85828;border-color:#b85828}
.card-reset-btn{
    height:64px;
    min-width:44px;
    padding:0 12px;
    font-size:18px;
    font-weight:700;
    border-radius:10px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.card-prep-banner{background:#fff7e3;border:2px solid #d98b19;border-radius:8px;padding:8px 12px;margin-bottom:10px}
.prep-banner-main{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:6px}
.prep-banner-text{font-size:13px;font-weight:700;color:#824d00}
.prep-banner-countdown{font-variant-numeric:tabular-nums;font-size:24px;font-weight:900;color:#b86b00;line-height:1}
.prep-banner-track{height:5px;background:#f3dfb5;border-radius:999px;overflow:hidden}
.prep-banner-fill{display:block;height:100%;width:0%;background:#d98b19;border-radius:999px;transition:width .18s linear}

.previous-reference{display:none}

.sets-table{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.set-row{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:#fafaf7;transition:background .2s,border-color .2s,box-shadow .2s}
.set-row.row-active-prep{background:#fff9eb;border-color:#d98b19;box-shadow:0 0 0 2px #d98b1924}
.set-row.row-active-exercise{background:#ebf7ee;border-color:#2e7d47;box-shadow:0 0 0 2px #2e7d4724}
.set-row.row-active-rest{background:#fff1f0;border-color:#c94438;box-shadow:0 0 0 2px #c9443824}
.set-row.row-done{background:#f2f5f0;border-color:#c5d3c4}

.set-row-main{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.set-number-cell{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.set-number-cell strong{font-size:14px}
.set-live-status{font-size:11px;font-weight:700;padding:2px 7px;border-radius:999px;background:#ecefe6;color:var(--muted);font-variant-numeric:tabular-nums}
.set-live-status.status-prep{background:#d98b19;color:#fff}
.set-live-status.status-exercise{background:#2e7d47;color:#fff}
.set-live-status.status-rest{background:#c94438;color:#fff}
.set-live-status.status-done{background:#d7e8da;color:#225533}

.set-inputs-group{display:flex;gap:8px;align-items:center}
.set-inputs-group.superset{display:flex;gap:8px;align-items:center}
.superset-subgroup{display:flex;align-items:center;gap:6px}
.superset-subgroup-inputs{display:flex;align-items:center;gap:6px}
.superset-machine-label{font-size:11px;font-weight:700;color:var(--muted);background:#edf1e8;padding:2px 7px;border-radius:4px;white-space:nowrap}
.superset-separator{font-size:14px;color:#d98b19;font-weight:700;user-select:none;padding:0 2px}
.tag.tag-superset{background:#fef3c7;color:#92400e;border:1px solid #fde68a;font-weight:700;display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;letter-spacing:0.3px}
.workout-machine-tags-row .tag.tag-superset{font-size:13px;padding:3px 8px;border-radius:6px;line-height:1;justify-content:center}
.tag.tag-exec-order{background:#e8f0fe;color:#1a56db;border:1px solid #bfdbfe;font-weight:700;display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:6px;font-size:13px;letter-spacing:0.3px}
.pill-order-badge{background:#e8f0fe;color:#1e40af;font-size:11px;font-weight:700;padding:1px 6px;border-radius:4px;margin-right:4px;display:inline-block}
.superset-title-plus{color:var(--muted);font-weight:500;font-size:0.9em}
.superset-photos{display:flex;gap:4px}
.superset-photos .workout-machine-photo{width:36px;height:36px;border-radius:6px}
.superset-config-box{background:#f9faf6;border:1px dashed #cbd1c5;border-radius:8px;padding:12px 14px;margin-top:10px}

/* Stepper unified controls */
.set-input-cell{width:130px}
.set-inputs-group.superset .set-input-cell{width:104px}

.stepper-box{
    display:flex;
    align-items:stretch;
    border:1.5px solid #cbd2c4;
    border-radius:7px;
    background:#ffffff;
    height:36px;
    box-sizing:border-box;
    box-shadow:0 1px 2px rgba(0,0,0,0.03);
    transition:border-color .15s ease,box-shadow .15s ease;
    width:100%;
    overflow:hidden;
}
.stepper-box:focus-within{
    border-color:var(--green);
    box-shadow:0 0 0 2px rgba(40,84,68,0.18);
}

.stepper-btn{
    background:transparent;
    border:0;
    color:var(--green);
    font-size:20px;
    font-weight:700;
    width:32px;
    min-width:32px;
    height:100%;
    padding:0;
    margin:0;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    user-select:none;
    -webkit-tap-highlight-color:transparent;
    transition:background .12s ease;
    line-height:1;
}
.stepper-btn:hover{
    background:#f0f4ec;
}
.stepper-btn:active{
    background:#e2e9dc;
}
.stepper-btn-minus{
    border-right:1px solid #eef1e9 !important;
}
.stepper-btn-plus{
    border-left:1px solid #eef1e9 !important;
}

.stepper-input-wrap{
    display:flex;
    align-items:center;
    justify-content:center;
    flex:1;
    height:100%;
    min-width:0;
    padding:0 3px;
    background:transparent;
    cursor:text;
}

.stepper-box input,
.stepper-box input.stepper-input{
    display:inline-block !important;
    border:0 !important;
    background:transparent !important;
    background-color:transparent !important;
    box-shadow:none !important;
    border-radius:0 !important;
    margin:0 !important;
    padding:0 !important;
    height:100% !important;
    min-height:0 !important;
    line-height:1 !important;
    font-size:16px !important;
    font-weight:700 !important;
    color:var(--ink) !important;
    text-align:right !important;
    font-variant-numeric:tabular-nums !important;
    width:42px !important;
    min-width:30px !important;
    max-width:56px !important;
    outline:none !important;
    appearance:none !important;
    -webkit-appearance:none !important;
    -moz-appearance:textfield !important;
}
    outline:none !important;
    appearance:none !important;
    -webkit-appearance:none !important;
    -moz-appearance:textfield !important;
}

.stepper-box input:focus,
.stepper-box input.stepper-input:focus{
    outline:none !important;
    box-shadow:none !important;
    border:0 !important;
}

.stepper-box input::-webkit-outer-spin-button,
.stepper-box input::-webkit-inner-spin-button{
    -webkit-appearance:none !important;
    margin:0 !important;
}

.stepper-unit{
    font-size:13px;
    font-weight:600;
    color:var(--muted);
    user-select:none;
    margin-left:3px;
    margin-right:2px;
    pointer-events:none;
    white-space:nowrap;
}

/* Compact stepper for supersets */
.stepper-box.compact{
    height:36px;
}
.stepper-box.compact .stepper-btn{
    width:28px;
    min-width:28px;
    font-size:18px;
}
.stepper-box.compact input,
.stepper-box.compact input.stepper-input{
    font-size:14px !important;
    width:34px !important;
    max-width:42px !important;
}
.stepper-box.compact .stepper-unit{
    font-size:11px;
    margin-left:2px;
}

.input-with-unit{display:flex;align-items:center;border:1px solid #cbd1c5;border-radius:6px;background:#fff;padding-right:8px}
.input-with-unit input{border:0;margin:0;padding:7px 10px;font-weight:600;min-width:0;text-align:right}
.input-with-unit input:focus{outline:none}
.input-with-unit span{font-size:12px;color:var(--muted);font-weight:600;user-select:none;margin-left:4px}

.set-dual-progress{display:flex;gap:3px;height:5px;width:100%;border-radius:999px;overflow:hidden;background:#e4e7de;padding:0;margin-top:3px}
.bar-segment{height:100%;position:relative;border-radius:999px;overflow:hidden}
.bar-exercise-track{background:#d5e6d9}
.bar-rest-track{background:#f2d6d3}
.bar-exercise-fill{display:block;height:100%;width:0%;background:#2e7d47;border-radius:999px;transition:width .18s linear}
.bar-rest-fill{display:block;height:100%;width:0%;background:#c94438;border-radius:999px;transition:width .18s linear}

.inter-card-timer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    background:#fff5f3;
    border:2px dashed #d93829;
    border-radius:12px;
    padding:14px 20px;
    margin:12px 0 20px;
    color:#8f241b;
    box-shadow:0 4px 14px rgba(217,56,41,0.08);
}
.inter-timer-label{font-size:14px;font-weight:600}
.inter-timer-label strong{color:#a82015}
.inter-timer-clock{font-variant-numeric:tabular-nums;font-size:28px;font-weight:900;color:#d93829}

.progress-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:20px}
.progress-card{margin:0}
.best-weight-pill{text-align:right;background:#e8f1ea;padding:6px 12px;border-radius:8px}
.best-weight-pill strong{display:block;color:var(--green);font-size:16px}
.progress-timeline{list-style:none;padding:0;margin:0;border-top:1px solid var(--line)}
.progress-timeline li{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:8px 0;border-bottom:1px solid var(--line);font-size:13px}
.progress-session-link{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap;color:inherit}
.progress-sets-col{display:flex;flex-direction:column;align-items:flex-end;gap:2px;text-align:right}
.progress-set-line{font-size:13px;line-height:1.35;white-space:nowrap}
.session-summary-pills{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.session-machine-pill{font-size:12px;background:#f3f5ee;border:1px solid var(--line);padding:5px 10px;border-radius:6px}

.error{color:#9e382f;background:#fff0e9;border:1px solid #ecd0c3;padding:14px;border-radius:6px;margin:14px 0}
.notice{padding:14px;background:#e2eddf;border-radius:6px;margin:14px 0}
.save-toast{padding:10px 14px;background:#e2eddf;color:#1e4a2f;border-radius:6px;margin:10px 0;font-size:13px;font-weight:600}
.sticky-actions{position:sticky;bottom:12px;background:#f7f6f0f2;backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:8px;padding:14px 18px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:24px}
.sticky-actions>span{font-size:12px;color:var(--muted)}
.delete-area{margin-top:28px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.site-footer{max-width:1124px;margin:20px auto;padding:25px 0;border-top:1px solid var(--line);font:18px var(--serif);display:flex;justify-content:space-between}
.site-footer span{font:11px system-ui;color:var(--muted)}
#blazor-error-ui{display:none;position:fixed;bottom:0;width:100%;background:#fff0e9;padding:15px;z-index:20}
#blazor-error-ui .dismiss{float:right}
.components-reconnect-hide{display:none}
.components-reconnect-show,.components-reconnect-failed,.components-reconnect-rejected{display:block!important;position:fixed;inset:auto 15px 15px;background:#fff4e5;border:1px solid #d8b98a;padding:18px;z-index:50;border-radius:8px;text-align:center}

@media(max-width:900px){
    .auth-grid,.catalog-layout,.routine-days-grid{grid-template-columns:1fr}
    .field-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
    .intro-stamp{display:none}
    .site-header{flex-wrap:wrap}
}
@media(max-width:640px){
    main{padding:0 16px 40px}
    .site-header{padding:18px 16px;gap:14px}
    .brand{font-size:23px}
    nav{width:100%;justify-content:space-between;gap:10px}
    .field-grid,.field-grid.three{grid-template-columns:1fr}
    .day-sticky-summary{padding:8px 10px;top:6px;margin:6px 0 12px}
    .global-summary-top{gap:8px}
    .global-clock{font-size:19px}
    .global-label{font-size:9px;letter-spacing:1px}
    .global-play-btn{min-width:82px;padding:5px 10px;font-size:12px}
    .global-live-stage{padding:6px 10px;margin:6px 0 4px}
    .stage-badge{font-size:11px;padding:2px 7px}
    .stage-counter{font-size:12px;padding:1px 6px}
    .stage-machine{font-size:13px}
    .stage-clock{font-size:24px}
    .global-progress-track{height:5px;margin-top:6px}
    .set-row-main{flex-direction:column;align-items:stretch;gap:6px;margin-bottom:5px}
    .set-number-cell{justify-content:space-between}
    .set-inputs-group{width:100%;gap:8px}
    .set-input-cell{flex:1;width:auto;min-width:0}
    .set-inputs-group.superset{
        display:flex;
        flex-direction:column;
        align-items:stretch;
        gap:6px;
        width:100%;
    }
    .superset-separator{display:none}
    .superset-subgroup{
        display:flex;
        flex-direction:column;
        gap:5px;
        width:100%;
        background:#f8faf6;
        border:1px solid #e1e6dc;
        border-radius:7px;
        padding:6px 8px;
    }
    .superset-machine-label{
        font-size:11px;
        font-weight:700;
        color:var(--green);
        background:transparent;
        padding:0;
        white-space:normal;
    }
    .superset-subgroup-inputs{
        display:flex;
        gap:6px;
        width:100%;
    }
    .superset-subgroup-inputs .set-input-cell{
        flex:1;
        width:auto;
        min-width:0;
    }
    .stepper-box{height:38px}
    .stepper-btn{width:36px;min-width:36px;font-size:22px}
    .stepper-box input,.stepper-box input.stepper-input{font-size:17px !important;width:44px !important;min-width:32px !important;max-width:58px !important}
    .stepper-unit{font-size:13px}
    .stepper-box.compact{height:36px}
    .stepper-box.compact .stepper-btn{width:32px;min-width:32px;font-size:18px}
    .stepper-box.compact input,.stepper-box.compact input.stepper-input{font-size:15px !important;width:38px !important;min-width:28px !important;max-width:48px !important}
    .stepper-box.compact .stepper-unit{font-size:12px}
    .workout-machine-title{font-size:16px}
    .workout-machine-title .step-number{font-size:16px}
    .workout-machine-photo{width:56px;height:56px;border-radius:8px}
    .workout-machine-photo-placeholder{width:56px;height:56px;font-size:24px;border-radius:8px}
    .superset-photos .workout-machine-photo{width:56px;height:56px;border-radius:8px}
    .workout-machine-tags-row span{font-size:12px;padding:2px 8px}
    .tag.tag-exec-order{font-size:12px;padding:2px 8px}
    .workout-machine-tags-row .tag.tag-superset{font-size:12px;padding:2px 7px}
    .card-play-btn{min-width:96px;height:56px;padding:0 16px;font-size:14px;border-radius:8px}
    .card-reset-btn{height:56px;min-width:40px;padding:0 10px;font-size:16px;border-radius:8px}
    .panel,.step-card{padding:12px 14px;margin:10px 0}
}

.session-footer-actions{
    display:flex;
    justify-content:center;
    align-items:center;
    margin:32px 0 44px;
}
.session-footer-buttons{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
    width:100%;
    max-width:360px;
}
.add-machine-btn{
    width:100%;
    height:48px;
    font-size:15px;
    font-weight:700;
}
.finish-session-btn{
    width:100%;
    min-width:240px;
    height:50px;
    font-size:16px;
    font-weight:700;
    box-shadow:0 4px 14px rgba(45,106,79,0.3);
}
.remove-machine-btn{
    height:56px;
    width:40px;
    min-width:40px;
    padding:0;
    font-size:18px;
    color:#b3261e;
    border-color:#f5c6cb;
    background:#fff5f5;
    border-radius:8px;
}
.remove-machine-btn:hover{
    background:#ffe5e5;
    color:#900;
}
.session-completed-banner{
    display:flex;
    align-items:center;
    gap:14px;
    background:#eaf4ed;
    color:var(--green);
    border:1px solid #b7dfc8;
    padding:12px 20px;
    border-radius:10px;
    font-weight:700;
}
.tag-in-progress{
    background:#fff3cd;
    color:#856404;
    border:1px solid #ffeeba;
    font-size:11px;
    font-weight:700;
    padding:2px 8px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    gap:4px;
}

/* Modal de añadir aparato al entrenamiento */
.modal-backdrop{
    position:fixed;
    top:0;
    left:0;
    right:0;
    bottom:0;
    background:rgba(0,0,0,0.6);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:9999;
    padding:16px;
    backdrop-filter:blur(3px);
}
.modal-dialog{
    background:#ffffff;
    border-radius:14px;
    width:100%;
    max-width:520px;
    max-height:90vh;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    box-shadow:0 12px 36px rgba(0,0,0,0.25);
    animation:modalPop 0.2s cubic-bezier(0.16,1,0.3,1);
}
@keyframes modalPop{
    from{opacity:0;transform:scale(0.94) translateY(12px)}
    to{opacity:1;transform:scale(1) translateY(0)}
}
.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:18px 20px 14px;
    border-bottom:1px solid #e7ebe4;
}
.modal-header h3{margin:0;font-size:18px;color:var(--ink)}
.close-btn{
    background:transparent;
    border:0;
    font-size:20px;
    color:var(--muted);
    cursor:pointer;
    padding:4px 8px;
    line-height:1;
    border-radius:6px;
}
.close-btn:hover{color:var(--ink);background:#f1f3ea}
.modal-body{
    padding:18px 20px;
    display:flex;
    flex-direction:column;
    gap:16px;
}
.form-select{
    width:100%;
    height:42px;
    border:1px solid #c8d4c4;
    border-radius:8px;
    padding:0 12px;
    font-size:15px;
    background:#fafbfa;
    color:var(--ink);
    margin-top:6px;
}
.selected-machine-preview{
    display:flex;
    align-items:center;
    gap:14px;
    background:#f4f7f2;
    border:1px solid #dbe3d8;
    border-radius:10px;
    padding:10px 14px;
}
.preview-photo{width:54px;height:54px;border-radius:8px;object-fit:cover;border:1px solid #c2cdc0}
.preview-placeholder{width:54px;height:54px;border-radius:8px;background:#e2ebd9;display:flex;align-items:center;justify-content:center;font-size:26px}
.last-weight-hint{font-size:12px;color:var(--green);margin-top:4px;font-weight:600}
.quick-config-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:10px;
}
.config-field{
    display:flex;
    flex-direction:column;
    gap:6px;
}
.config-field label{font-size:13px;color:var(--ink)}
.config-field label small{font-size:11px;color:var(--muted)}
.time-chips{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:2px;
}
.chip-btn{
    background:#f1f4ee;
    border:1px solid #d4ded0;
    border-radius:20px;
    padding:6px 12px;
    font-size:13px;
    font-weight:600;
    color:var(--ink);
    cursor:pointer;
    transition:all 0.15s;
}
.chip-btn:hover{background:#e3ebe0}
.chip-btn.selected{
    background:var(--green);
    color:#ffffff;
    border-color:var(--green);
    box-shadow:0 2px 6px rgba(45,106,79,0.25);
}
.modal-footer{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    padding:14px 20px 18px;
    border-top:1px solid #e7ebe4;
}
