:root{--bg:#0f172a;--bg-card:#1e293b;--bg-hover:#334155;--text:#f1f5f9;--text-muted:#94a3b8;--primary:#6366f1;--primary-hover:#818cf8;--success:#22c55e;--warning:#f59e0b;--danger:#ef4444;--accent:#f59e0b;--border:#334155;--radius:12px}*{box-sizing:border-box;margin:0;padding:0}body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}a{color:var(--primary);text-decoration:none}a:hover{color:var(--primary-hover)}button{cursor:pointer;border-radius:var(--radius);border:none;padding:.75rem 1.5rem;font-size:1rem;font-weight:600;transition:all .15s}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-hover)}.btn-secondary{background:var(--bg-hover);color:var(--text)}.btn-secondary:hover{background:#475569}.btn-danger{background:var(--danger);color:#fff}.btn-success{background:var(--success);color:#fff}.btn-sm{padding:.4rem .8rem;font-size:.85rem}.btn-block{width:100%}input,select{background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);color:var(--text);outline:none;width:100%;padding:.75rem 1rem;font-size:1rem;transition:border-color .15s}input:focus,select:focus{border-color:var(--primary)}.card{background:var(--bg-card);border-radius:var(--radius);margin-bottom:1rem;padding:1.25rem}.container{max-width:600px;margin:0 auto;padding:1rem 1rem 5rem}.bottom-nav{background:var(--bg-card);border-top:1px solid var(--border);z-index:100;justify-content:space-around;padding:.5rem 0;display:flex;position:fixed;bottom:0;left:0;right:0}.bottom-nav a{color:var(--text-muted);flex-direction:column;align-items:center;gap:.2rem;padding:.25rem .5rem;font-size:.7rem;display:flex}.bottom-nav a.active{color:var(--primary)}.bottom-nav svg{width:24px;height:24px}.badge{background:var(--primary);color:#fff;border-radius:20px;padding:.15rem .5rem;font-size:.7rem;font-weight:600;display:inline-block}.badge-success{background:var(--success)}.badge-warning{background:var(--warning);color:#000}.text-muted{color:var(--text-muted)}.text-center{text-align:center}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.gap-1{gap:.5rem}.gap-2{gap:1rem}.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.flex-1{flex:1}.grid-2{grid-template-columns:1fr 1fr;gap:.75rem;display:grid}.stat-card{background:var(--bg-card);border-radius:var(--radius);text-align:center;padding:1rem}.stat-card .stat-value{color:var(--primary);font-size:1.8rem;font-weight:700}.stat-card .stat-label{color:var(--text-muted);margin-top:.25rem;font-size:.8rem}.set-row{border-bottom:1px solid var(--border);grid-template-columns:40px 1fr 1fr 50px;align-items:center;gap:.5rem;padding:.5rem 0;display:grid}.set-row input{text-align:center;padding:.5rem;font-size:.95rem}.set-row .set-num{text-align:center;color:var(--text-muted);font-weight:600}.check-btn{background:var(--bg-hover);width:36px;height:36px;color:var(--text-muted);border-radius:50%;justify-content:center;align-items:center;padding:0;font-size:1.2rem;display:flex}.check-btn.completed{background:var(--success);color:#fff}.exercise-card{background:var(--bg-card);border-radius:var(--radius);margin-bottom:.75rem;padding:1rem}.exercise-card h3{margin-bottom:.5rem;font-size:1rem}.set-header{color:var(--text-muted);text-transform:uppercase;border-bottom:1px solid var(--border);grid-template-columns:40px 1fr 1fr 50px;gap:.5rem;padding-bottom:.25rem;font-size:.75rem;display:grid}.set-header span{text-align:center}.spinner{border:3px solid var(--border);border-top:3px solid var(--primary);border-radius:50%;width:40px;height:40px;margin:2rem auto;animation:.8s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.template-card{background:var(--bg-card);border-radius:var(--radius);cursor:pointer;margin-bottom:.75rem;padding:1rem;transition:background .15s}.template-card:hover{background:var(--bg-hover)}.template-card h3{margin-bottom:.25rem}.template-card .exercises-preview{color:var(--text-muted);font-size:.85rem}.rest-timer{background:var(--primary);color:#fff;border-radius:var(--radius);z-index:50;align-items:center;gap:1rem;padding:.75rem 2rem;font-size:1.5rem;font-weight:700;display:flex;position:fixed;bottom:70px;left:50%;transform:translate(-50%);box-shadow:0 4px 20px #6366f166}.rest-timer button{color:#fff;background:#fff3;padding:.4rem .8rem;font-size:.85rem}.auth-container{flex-direction:column;justify-content:center;max-width:400px;min-height:100vh;margin:0 auto;padding:2rem 1rem;display:flex}.auth-container h1{text-align:center;margin-bottom:.5rem;font-size:2rem}.auth-container .subtitle{text-align:center;color:var(--text-muted);margin-bottom:2rem}.auth-container form{flex-direction:column;gap:1rem;display:flex}.auth-container .toggle{text-align:center;color:var(--text-muted);margin-top:1rem}.error-msg{border:1px solid var(--danger);color:var(--danger);border-radius:var(--radius);background:#ef444426;padding:.75rem;font-size:.9rem}.video-container{border-radius:var(--radius);height:0;margin:1rem 0;padding-bottom:56.25%;position:relative;overflow:hidden}.video-container iframe{border:none;width:100%;height:100%;position:absolute;top:0;left:0}.modal-overlay{z-index:200;background:#000000b3;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.modal{background:var(--bg);border-radius:var(--radius) var(--radius) 0 0;width:100%;max-width:600px;max-height:85vh;padding:1.25rem;animation:.2s slideUp;overflow-y:auto}.modal-full{max-height:90vh}@keyframes slideUp{0%{opacity:0;transform:translate(-50%)translateY(100%)}to{opacity:1;transform:translate(-50%)translateY(0)}}.modal-header{justify-content:space-between;align-items:center;margin-bottom:1rem;display:flex}.modal-header h2{font-size:1.2rem}.modal-close{background:var(--bg-hover);width:36px;height:36px;color:var(--text-muted);border-radius:50%;justify-content:center;align-items:center;padding:0;font-size:1.1rem;display:flex}.day-type-grid{grid-template-columns:1fr 1fr;gap:.65rem;margin-top:.5rem;display:grid}.day-type-btn{background:var(--bg-card);color:var(--text);border:1px solid var(--border);border-radius:var(--radius);text-align:center;padding:.85rem .5rem;font-size:.95rem;font-weight:600;transition:all .15s}.day-type-btn:hover{background:var(--bg-hover);border-color:var(--primary)}.filter-chips{flex-wrap:wrap;gap:.4rem;margin-bottom:.75rem;display:flex}.chip{background:var(--bg-card);color:var(--text-muted);border:1px solid var(--border);border-radius:20px;padding:.3rem .7rem;font-size:.8rem;font-weight:500;transition:all .15s}.chip:hover{border-color:var(--primary);color:var(--text)}.chip-active{background:var(--primary);color:#fff;border-color:var(--primary)}.exercise-pick-row{border-bottom:1px solid var(--border);cursor:pointer;justify-content:space-between;align-items:center;padding:.75rem 0;transition:background .1s;display:flex}.exercise-pick-row:hover{background:var(--bg-card);margin:0 -1.25rem;padding:.75rem 1.25rem}.exercise-list{margin-top:.25rem}.day-selector{-webkit-overflow-scrolling:touch;scrollbar-width:none;gap:.35rem;display:flex;overflow-x:auto}.day-selector::-webkit-scrollbar{display:none}.day-btn{background:var(--bg-card);color:var(--text-muted);border:1px solid var(--border);white-space:nowrap;border-radius:8px;flex-shrink:0;padding:.5rem .75rem;font-size:.8rem;font-weight:600}.day-btn-active{background:var(--primary);color:#fff;border-color:var(--primary)}.macro-bar{justify-content:space-around;gap:.5rem;display:flex}.macro-item{flex-direction:column;flex:1;align-items:center;display:flex}.macro-value{font-size:1.1rem;font-weight:700}.macro-label{color:var(--text-muted);text-transform:uppercase;font-size:.7rem}.macro-progress{background:var(--border);border-radius:3px;width:100%;height:6px;margin-bottom:.3rem;overflow:hidden}.macro-progress-fill{border-radius:3px;height:100%;transition:width .3s}.calorie-card{background:var(--bg-card);border-radius:var(--radius);text-align:center;padding:1.5rem 1rem}.calorie-ring-wrap{width:140px;height:140px;margin:0 auto 1rem;position:relative}.calorie-ring{width:100%;height:100%}.calorie-ring-text{flex-direction:column;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.calorie-ring-value{font-size:1.6rem;font-weight:800}.calorie-ring-label{color:var(--text-muted);font-size:.75rem}.food-item{background:var(--bg-card);border-radius:8px;align-items:center;gap:.75rem;margin-bottom:.4rem;padding:.6rem .75rem;display:flex}.food-item-name{font-size:.9rem;font-weight:600}.food-item-macros{color:var(--text-muted);font-size:.75rem}.food-item-serving{color:var(--text-muted);white-space:nowrap;font-size:.75rem}.food-search-results{max-height:300px;overflow-y:auto}.food-result{border-bottom:1px solid var(--border);cursor:pointer;padding:.75rem;transition:background .1s}.food-result:hover{background:var(--bg-card)}.food-result-name{margin-bottom:.15rem;font-weight:600}.food-result-macros{color:var(--text-muted);font-size:.8rem}.grocery-item{background:var(--bg-card);border-radius:8px;align-items:center;gap:.6rem;margin-bottom:.35rem;padding:.55rem .75rem;transition:opacity .15s;display:flex}.grocery-item-checked{opacity:.5}.grocery-check{border:2px solid var(--border);width:26px;height:26px;color:var(--success);background:0 0;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;padding:0;font-size:.9rem;font-weight:700;transition:all .15s;display:flex}.grocery-item-checked .grocery-check{border-color:var(--success);background:#22c55e26}.grocery-item-name{font-size:.9rem;font-weight:500}.grocery-item-done{color:var(--text-muted);text-decoration:line-through}.meal-totals{background:var(--bg-hover);border-radius:8px;flex-wrap:wrap;gap:.75rem;margin-top:.25rem;padding:.5rem .75rem;font-size:.8rem;font-weight:600;display:flex}.calendar-page{padding-bottom:5rem}.calendar-header{justify-content:space-between;align-items:center;margin-bottom:1rem;display:flex}.cal-month-title{cursor:pointer;text-align:center;flex:1;font-size:1.3rem}.cal-nav-btn{background:var(--bg-card);color:var(--text);border-radius:50%;justify-content:center;align-items:center;width:40px;height:40px;padding:0;font-size:1.4rem;font-weight:700;display:flex}.cal-nav-btn:hover{background:var(--bg-hover)}.cal-grid{grid-template-columns:repeat(7,1fr);display:grid}.cal-day-labels{margin-bottom:.25rem}.cal-day-label{text-align:center;color:var(--text-muted);text-transform:uppercase;padding:.25rem 0;font-size:.7rem;font-weight:600}.cal-cell{border:1px solid var(--border);cursor:pointer;min-height:70px;padding:2px;transition:background .15s;position:relative;overflow:hidden}.cal-cell:hover{background:var(--bg-card)}.cal-cell.outside{opacity:.3;pointer-events:none}.cal-cell.today{background:#6366f11a}.cal-cell.drop-target{box-shadow:inset 0 0 0 2px var(--primary);background:#6366f140}.cal-date-num{text-align:center;border-radius:50%;width:22px;height:22px;margin:1px;font-size:.75rem;font-weight:600;line-height:22px;display:inline-block}.today-num{background:var(--primary);color:#fff}.cal-events{flex-direction:column;gap:1px;display:flex}.cal-event{cursor:grab;white-space:nowrap;text-overflow:ellipsis;background:color-mix(in srgb, var(--event-color) 20%, transparent);border-left:2px solid var(--event-color);border-radius:3px;align-items:center;gap:3px;padding:1px 3px;font-size:.6rem;line-height:1.2;transition:opacity .15s,transform .15s;display:flex;overflow:hidden}.cal-event:hover{background:color-mix(in srgb, var(--event-color) 35%, transparent)}.cal-event.completed{opacity:.5}.cal-event.dragging{opacity:.4;transform:scale(.95)}.cal-event-dot{background:var(--event-color);border-radius:50%;flex-shrink:0;width:5px;height:5px}.cal-event-text{text-overflow:ellipsis;overflow:hidden}.cal-legend{color:var(--text-muted);flex-wrap:wrap;justify-content:center;gap:1rem;margin-top:.75rem;font-size:.75rem;display:flex}.cal-legend-item{align-items:center;gap:4px;display:flex}.cal-legend-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.cal-type-picker{grid-template-columns:repeat(2,1fr);gap:.5rem;margin-bottom:.75rem;display:grid}.cal-type-btn{border-radius:var(--radius);background:var(--bg-hover);color:var(--text);text-align:center;border:2px solid #0000;padding:.6rem;font-size:.85rem;transition:all .15s}.cal-type-btn.active{border-color:var(--type-color);background:color-mix(in srgb, var(--type-color) 15%, var(--bg-card))}.cal-template-picker{margin-bottom:.75rem}.cal-template-picker label{color:var(--text-muted);margin-bottom:.5rem;font-size:.8rem;font-weight:600;display:block}.cal-template-list{border:1px solid var(--border);border-radius:var(--radius);max-height:250px;overflow-y:auto}.cal-template-group{border-bottom:1px solid var(--border)}.cal-template-group:last-child{border-bottom:none}.cal-template-group-name{color:var(--text-muted);background:var(--bg);text-transform:uppercase;z-index:1;padding:.4rem .75rem;font-size:.75rem;font-weight:700;position:sticky;top:0}.cal-template-btn{text-align:left;width:100%;color:var(--text);background:0 0;border-radius:0;justify-content:space-between;align-items:center;padding:.5rem .75rem;font-size:.85rem;display:flex}.cal-template-btn:hover{background:var(--bg-hover)}.cal-template-btn.active{background:#6366f126}.cal-event-detail{font-size:.9rem}.cal-exercise-list{margin-bottom:1rem}.cal-exercise-item{color:var(--text-muted);border-bottom:1px solid var(--border);padding:.3rem 0;font-size:.85rem}.cal-exercise-item:last-child{border-bottom:none}.cal-event-actions{gap:.75rem;margin-top:1rem;display:flex}.cal-event-actions .btn-primary{flex:1}.cal-badge-done{color:var(--success);font-weight:600}.btn-danger{background:var(--danger);color:#fff;padding:.6rem 1.2rem}.btn-danger:hover{opacity:.85}.install-banner{background:var(--surface);border:1px solid var(--border);z-index:1000;border-radius:16px;align-items:center;gap:.75rem;width:calc(100% - 2rem);max-width:420px;padding:.75rem 1rem;animation:.3s ease-out slideUp;display:flex;position:fixed;bottom:80px;left:50%;transform:translate(-50%);box-shadow:0 8px 32px #0006}.install-banner-icon{border-radius:10px;flex-shrink:0;width:44px;height:44px}.install-banner-text{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.install-banner-text strong{color:var(--text);font-size:.9rem}.install-banner-text span{color:var(--text-muted);font-size:.75rem}.install-banner-btn{background:var(--primary);color:#fff;cursor:pointer;border:none;border-radius:8px;flex-shrink:0;padding:.5rem 1rem;font-size:.85rem;font-weight:600}.install-banner-btn:hover{opacity:.9}.install-banner-close{color:var(--text-muted);cursor:pointer;background:0 0;border:none;flex-shrink:0;padding:.25rem;font-size:1.2rem}.profile-page{padding-bottom:100px}.profile-header{align-items:center;gap:1rem;margin-bottom:1.25rem;display:flex}.profile-avatar-wrap{cursor:pointer;flex-shrink:0;position:relative}.profile-avatar{object-fit:cover;border-radius:50%;justify-content:center;align-items:center;width:80px;height:80px;display:flex}.profile-avatar-placeholder{background:var(--primary);color:#fff;font-size:2rem;font-weight:700}.profile-avatar-overlay{background:var(--surface);border:2px solid var(--border);border-radius:50%;justify-content:center;align-items:center;width:28px;height:28px;font-size:.75rem;display:flex;position:absolute;bottom:0;right:0}.profile-header-info{min-width:0}.profile-name{white-space:nowrap;text-overflow:ellipsis;margin:0;font-size:1.4rem;font-weight:700;overflow:hidden}.profile-email{white-space:nowrap;text-overflow:ellipsis;font-size:.8rem;overflow:hidden}.profile-bio{color:var(--text-muted);margin-top:.25rem;font-size:.85rem;line-height:1.3}.profile-stats-grid{grid-template-columns:repeat(4,1fr);gap:.5rem;margin-bottom:1rem;display:grid}.profile-stat-card{background:var(--surface);border:1px solid var(--border);text-align:center;border-radius:12px;padding:.6rem .4rem}.profile-stat-label{color:var(--text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:.2rem;font-size:.65rem}.profile-stat-value{color:var(--text);font-size:.95rem;font-weight:700}.profile-details-card{flex-direction:column;gap:.6rem;display:flex}.profile-detail-row{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding-bottom:.5rem;font-size:.9rem;display:flex}.profile-detail-row:last-of-type{border-bottom:none;padding-bottom:0}.profile-edit-card{flex-direction:column;gap:.4rem;display:flex}.profile-section-title{color:var(--primary);margin-top:.5rem;margin-bottom:.25rem;font-size:1rem;font-weight:700}.profile-label{color:var(--text-muted);margin-top:.5rem;margin-bottom:.1rem;font-size:.8rem;font-weight:600}.profile-textarea{resize:vertical;min-height:50px;font-family:inherit}.profile-age-hint{color:var(--text-muted);margin-top:-.1rem;font-size:.75rem}.profile-row-between{justify-content:space-between;align-items:center;margin-top:.5rem;display:flex}.profile-unit-toggle{background:var(--surface);border:1px solid var(--primary);color:var(--primary);cursor:pointer;border-radius:6px;padding:.2rem .6rem;font-size:.75rem;font-weight:600}.profile-unit-toggle:active{opacity:.7}.profile-row-gap{gap:.5rem;display:flex}.profile-input-group{flex:1;position:relative}.profile-input-group .input{padding-right:2.5rem}.profile-input-suffix{color:var(--text-muted);pointer-events:none;font-size:.75rem;position:absolute;top:50%;right:.6rem;transform:translateY(-50%)}.profile-weight-diff{color:var(--primary);text-align:center;margin-top:.15rem;font-size:.8rem;font-weight:600}.profile-edit-actions{gap:.75rem;margin-top:1rem;display:flex}.profile-edit-actions .btn-outline{border:1px solid var(--border);color:var(--text);cursor:pointer;background:0 0;border-radius:8px;flex:1;padding:.6rem 1rem}.profile-edit-actions .btn-primary{flex:1}.profile-saved-toast{background:var(--success);color:#fff;z-index:2000;border-radius:8px;padding:.5rem 1.5rem;font-size:.9rem;font-weight:600;animation:2s ease-in-out fadeInOut;position:fixed;top:1rem;left:50%;transform:translate(-50%)}@keyframes fadeInOut{0%{opacity:0;transform:translate(-50%)translateY(-10px)}15%{opacity:1;transform:translate(-50%)translateY(0)}85%{opacity:1}to{opacity:0}}
