:root{--bg:#f8fafc;--panel:#fff;--text:#0f172a;--muted:#64748b;--line:#e2e8f0;--brand:#3b82f6;--brand-hover:#2563eb;--danger:#ef4444;--success:#10b981}*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;line-height:1.5;overflow-x:hidden}.mobile-body{min-height:100vh;display:flex;flex-direction:column}.mobile-container{flex:1 1;display:flex;flex-direction:column}.app-header{height:50px;display:flex;align-items:center;justify-content:center;padding:0 1rem;background:#fff;border-bottom:1px solid var(--line);position:-webkit-sticky;position:sticky;top:0;z-index:100}.app-header h1{font-size:1.1rem;font-weight:600;margin:0}.auth-wrapper{padding:2.5rem 1.5rem;flex:1 1;display:flex;flex-direction:column}.auth-title{font-size:1.75rem;font-weight:700;margin-bottom:.5rem}.auth-subtitle{color:var(--muted);font-size:1rem;margin-bottom:2.5rem}.form-group{margin-bottom:1.25rem}.form-label{display:block;font-size:.875rem;font-weight:500;margin-bottom:.5rem;color:var(--text)}.input-field{width:100%;height:3rem;padding:0 1rem;border:1px solid var(--line);border-radius:.75rem;background:#fff;font-size:1rem;transition:all .2s;outline:none}.input-field:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(59,130,246,.1)}.textarea-field{height:auto;padding:.75rem 1rem;resize:vertical;min-height:4.5rem;line-height:1.5;font-family:inherit}.btn-primary{width:100%;height:3.25rem;background:var(--brand);color:#fff;border:none;border-radius:.75rem;font-size:1.1rem;font-weight:600;margin-top:1rem;cursor:pointer;transition:background .2s}.btn-primary:active{background:var(--brand-hover);transform:scale(.98)}.btn-primary:disabled{opacity:.6;cursor:not-allowed}.auth-footer{margin-top:auto;padding-top:2rem;text-align:center;font-size:.9rem;color:var(--muted)}.auth-link{color:var(--brand);text-decoration:none;font-weight:600}.error-msg{background:#fef2f2;color:var(--danger);padding:.75rem 1rem;border-radius:.75rem;font-size:.9rem;margin-bottom:1.5rem;border:1px solid #fee2e2}.mobile-card{background:#fff;margin:1rem;padding:1.5rem;border-radius:1rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.05)}.user-name{font-size:1.25rem;font-weight:700;margin-bottom:1rem}.btn-logout{background:#f1f5f9;color:var(--danger);border:none;border-radius:.75rem;padding:.75rem 1rem;font-weight:600;width:100%;margin-top:1rem}.habit-calendar-header{padding:1rem 1.5rem;background:#fff;border-bottom:1px solid var(--line)}.habit-calendar-header h1{font-size:1.25rem;font-weight:700;margin:0}.month-nav{display:flex;align-items:center;gap:1rem}.month-nav button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:.5rem;color:var(--brand);transition:transform .2s}.month-nav button:hover{transform:scale(1.1)}.month-nav button:active{transform:scale(.95)}.month-nav span{font-size:1.1rem;font-weight:600;min-width:120px;text-align:center}.calendar-container{padding:1.5rem;background:#fff;margin:1rem;border-radius:1rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.05)}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:.5rem;gap:.5rem;margin-bottom:.75rem}.calendar-weekday{text-align:center;font-size:.85rem;font-weight:600;color:var(--muted);padding:.5rem 0}.calendar-days{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:.5rem;gap:.5rem}.calendar-day{aspect-ratio:1;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:.75rem;cursor:pointer;transition:all .2s;position:relative;background:transparent;border:none}.calendar-day:hover:not(.empty):not(.other-month){background:#f1f5f9;transform:scale(1.05)}.calendar-day:active:not(.empty):not(.other-month){transform:scale(.95)}.calendar-day.empty{cursor:default}.calendar-day.other-month{opacity:.3;cursor:default}.calendar-day.today{background:#eff6ff;border:2px solid var(--brand)}.day-number{font-size:1rem;font-weight:600;color:var(--text);margin-bottom:.25rem}.other-month .day-number{color:var(--muted)}.habit-dots{display:flex;gap:.2rem;height:12px;align-items:center}.habit-dot{width:8px;height:8px;border-radius:50%;transition:all .3s ease;box-shadow:0 1px 2px rgba(0,0,0,.1)}.habit-dot.completed{transform:scale(1.1)}.habit-dot.uncompleted{opacity:.5;transform:scale(.8)}@keyframes dotPulse{0%,to{transform:scale(1)}50%{transform:scale(1.15)}}.habit-dot.just-completed{animation:dotPulse .4s ease-in-out}.detail-header{display:flex;align-items:center;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid var(--line)}.back-button{background:none;border:none;font-size:1.5rem;cursor:pointer;padding:.5rem;color:var(--brand);margin-right:1rem;transition:transform .2s}.back-button:hover{transform:scale(1.1)}.back-button:active{transform:scale(.9)}.detail-header h1{font-size:1.25rem;font-weight:700;margin:0}.detail-content{padding:1.5rem 1.5rem 6rem}.habit-card{background:#fff;border-radius:1rem;padding:1.5rem;margin-bottom:1rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.05);transition:all .3s ease}.habit-card:active{transform:scale(.98)}.habit-card-primary{min-height:160px;display:flex;flex-direction:column;justify-content:space-between}.habit-card-header{display:flex;align-items:center;gap:1rem;margin-bottom:1rem}.habit-color-indicator{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.5rem;transition:all .3s ease;flex-shrink:0}.habit-name{font-size:1.25rem;font-weight:700}.habit-actions{display:flex;gap:.25rem;margin-left:auto;flex-shrink:0}.habit-action-btn{background:none;border:none;font-size:1rem;cursor:pointer;padding:.35rem;border-radius:.5rem;transition:all .2s;opacity:.6}.habit-action-btn:hover{opacity:1;background:#f1f5f9}.habit-action-btn:active{transform:scale(.9)}.habit-toggle-btn{width:100%;height:3.5rem;border:none;border-radius:.75rem;font-size:1.1rem;font-weight:600;cursor:pointer;transition:all .3s ease;display:flex;align-items:center;justify-content:center;gap:.75rem}.habit-toggle-btn.completed{color:#fff}.habit-toggle-btn.uncompleted{background:#f1f5f9;color:var(--text)}.habit-toggle-btn:hover{transform:translateY(-2px);box-shadow:0 4px 8px rgba(0,0,0,.1)}.habit-toggle-btn:active{transform:translateY(0)}@keyframes checkmarkPop{0%{transform:scale(0)}50%{transform:scale(1.2)}to{transform:scale(1)}}.check-icon{animation:checkmarkPop .3s ease-out}.extra-habits-section{margin-top:.5rem;margin-bottom:1rem}.expand-toggle{width:100%;padding:.75rem;background:#f8fafc;border:1px dashed var(--line);border-radius:.75rem;cursor:pointer;font-size:.9rem;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:.5rem;transition:all .2s}.expand-toggle:hover{background:#f1f5f9;color:var(--text)}.extra-habits-list{max-height:0;overflow:hidden;transition:max-height .4s ease,margin-top .3s ease;margin-top:0}.extra-habits-list.expanded{max-height:2000px;margin-top:.75rem}.habit-card-extra{opacity:.9;min-height:auto}.habit-card-extra .habit-card-header{margin-bottom:.75rem}.habit-card-extra .habit-color-indicator{width:40px;height:40px;font-size:1.25rem}.habit-card-extra .habit-name{font-size:1.1rem}.habit-card-extra .habit-toggle-btn{height:2.75rem;font-size:1rem}.add-habit-btn{width:100%;padding:1rem;background:none;border:2px dashed var(--line);border-radius:1rem;font-size:1rem;font-weight:600;color:var(--brand);cursor:pointer;transition:all .2s;margin-top:.5rem}.add-habit-btn:hover{background:#eff6ff;border-color:var(--brand)}.add-habit-btn:active{transform:scale(.98)}.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:1000;padding:1.5rem;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}@keyframes slideUp{0%{transform:translateY(20px);opacity:0}to{transform:translateY(0);opacity:1}}.modal-content{background:#fff;border-radius:1.25rem;padding:1.75rem;width:100%;max-width:400px;animation:slideUp .3s ease-out;box-shadow:0 20px 60px rgba(0,0,0,.15)}.modal-title{font-size:1.25rem;font-weight:700;margin:0 0 1.25rem;text-align:center}.modal-actions{display:flex;gap:.75rem;margin-top:1.5rem}.modal-btn{flex:1 1;height:3rem;border:none;border-radius:.75rem;font-size:1rem;font-weight:600;cursor:pointer;transition:all .2s}.modal-btn:active{transform:scale(.97)}.modal-btn:disabled{opacity:.6;cursor:not-allowed}.modal-btn-cancel{background:#f1f5f9;color:var(--text)}.modal-btn-cancel:hover{background:#e2e8f0}.modal-btn-primary{background:var(--brand);color:#fff}.modal-btn-primary:hover{background:var(--brand-hover)}.modal-btn-danger{background:var(--danger);color:#fff}.modal-btn-danger:hover{background:#dc2626}.color-picker{display:flex;flex-wrap:wrap;gap:.75rem}.color-option{width:40px;height:40px;border-radius:50%;border:3px solid transparent;cursor:pointer;transition:all .2s}.color-option:hover{transform:scale(1.1)}.color-option.selected{border-color:var(--text);transform:scale(1.1);box-shadow:0 2px 8px rgba(0,0,0,.2)}@media (max-width:480px){.calendar-day{padding:.25rem}.day-number{font-size:.85rem}.habit-dot{width:6px;height:6px}.habit-dots{height:10px}}