html,body,#root{background:#0a0a0a;height:100%}body{-webkit-font-smoothing:antialiased}button,input,textarea{font-family:inherit}*,:before,:after{box-sizing:border-box;margin:0;padding:0}:root{--bg:#0a0a0a;--surface:#1a1a1a;--surface2:#242424;--border:#ffffff14;--text:#f0f0f0;--text2:#888;--radius:16px}body{background:var(--bg);color:var(--text);min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.app{max-width:480px;min-height:100vh;margin:0 auto;padding:0 0 80px}.app-header{background:var(--bg);z-index:10;border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:20px 20px 12px;display:flex;position:sticky;top:0}.app-title{letter-spacing:-.5px;font-size:28px;font-weight:700}.app-date{color:var(--text2);text-transform:capitalize;margin-top:2px;font-size:13px}.header-right{align-items:center;gap:12px;display:flex}.progress-pill{background:var(--surface2);color:var(--text2);border-radius:20px;padding:4px 12px;font-size:13px;font-weight:600}.add-btn{color:#fff;cursor:pointer;background:#5e5ce6;border:none;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;padding-bottom:1px;font-size:24px;line-height:1;transition:opacity .15s;display:flex}.add-btn:hover{opacity:.85}.habit-list{flex-direction:column;gap:12px;padding:16px;display:flex}.empty-state{color:var(--text2);flex-direction:column;align-items:center;gap:8px;padding:60px 0;display:flex}.habit-card{background:var(--surface);border-radius:var(--radius);flex-direction:column;gap:10px;padding:16px;display:flex}.habit-card-header{align-items:center;gap:12px;display:flex}.habit-icon{border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;display:flex}.habit-info{cursor:pointer;flex:1;min-width:0}.habit-name{white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:600;display:block;overflow:hidden}.habit-desc{color:var(--text2);white-space:nowrap;text-overflow:ellipsis;margin-top:2px;font-size:13px;display:block;overflow:hidden}.check-btn{cursor:pointer;border:2px solid;border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;width:42px;height:42px;transition:opacity .15s,transform .1s;display:flex}.check-btn:hover{opacity:.8}.check-btn:active{transform:scale(.92)}.streak-badge{margin-left:56px;font-size:12px;font-weight:600}.pixel-grid-wrap{overflow:hidden}.modal-overlay{z-index:100;background:#000000b3;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.modal{width:100%;max-width:480px;max-height:92vh;padding-bottom:env(safe-area-inset-bottom,16px);background:#1c1c1e;border-radius:24px 24px 0 0;overflow-y:auto}.modal-header{z-index:1;background:#1c1c1e;justify-content:space-between;align-items:center;padding:20px 20px 8px;display:flex;position:sticky;top:0}.modal-header h2{font-size:18px;font-weight:700}.icon-btn{background:var(--surface2);width:32px;height:32px;color:var(--text2);cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;font-size:14px;display:flex}.habit-form{flex-direction:column;gap:20px;padding:8px 20px 20px;display:flex}.form-section{flex-direction:column;gap:8px;display:flex}.form-section label{color:var(--text2);text-transform:uppercase;letter-spacing:.5px;font-size:13px;font-weight:500}.form-input{background:var(--surface2);border:1px solid var(--border);color:var(--text);resize:none;border-radius:12px;outline:none;width:100%;padding:12px 14px;font-family:inherit;font-size:16px}.form-input:focus{border-color:#5e5ce6}.icon-picker-btn{background:var(--surface2);border:1px solid var(--border);cursor:pointer;border-radius:16px;justify-content:center;align-items:center;width:64px;height:64px;display:flex}.emoji-grid{flex-wrap:wrap;gap:6px;display:flex}.emoji-opt{background:var(--surface2);border:1px solid var(--border);cursor:pointer;border-radius:10px;justify-content:center;align-items:center;width:40px;height:40px;font-size:20px;display:flex}.emoji-opt.selected{background:#5e5ce622;border-color:#5e5ce6}.color-grid{grid-template-columns:repeat(7,1fr);gap:8px;display:grid}.color-dot{aspect-ratio:1;cursor:pointer;border:3px solid #0000;border-radius:10px;transition:transform .1s}.color-dot:hover{transform:scale(1.1)}.color-dot.selected{border-color:#fff;transform:scale(1.05);box-shadow:0 0 0 2px #ffffff4d}.advanced-toggle{color:var(--text2);cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:6px;padding:4px 0;font-size:14px;display:flex}.toggle-group{background:var(--surface2);border-radius:12px;gap:3px;padding:3px;display:flex}.toggle-btn{color:var(--text2);cursor:pointer;background:0 0;border:none;border-radius:10px;flex:1;padding:10px;font-size:14px;font-weight:500;transition:background .15s,color .15s}.toggle-btn.active{color:var(--text);background:#3a3a3c}.category-grid{flex-wrap:wrap;gap:8px;display:flex}.category-btn{border:1px solid var(--border);background:var(--surface2);color:var(--text2);cursor:pointer;border-radius:20px;padding:8px 14px;font-size:13px;transition:border-color .15s,color .15s}.category-btn.active{color:var(--text);background:#5e5ce622;border-color:#5e5ce6}.counter-row{background:var(--surface2);border-radius:12px;align-items:center;gap:16px;padding:6px 14px;display:flex}.counter-btn{width:36px;height:36px;color:var(--text);cursor:pointer;background:#3a3a3c;border:none;border-radius:50%;justify-content:center;align-items:center;font-size:20px;display:flex}.counter-val{text-align:center;flex:1;font-size:15px;font-weight:600}.form-hint{color:var(--text2);font-size:12px}.save-btn{color:#fff;cursor:pointer;border:none;border-radius:14px;width:100%;margin-top:4px;padding:16px;font-size:17px;font-weight:700;transition:opacity .15s}.save-btn:hover{opacity:.9}.delete-btn{color:#ff3b30;cursor:pointer;background:#ff3b301a;border:1px solid #ff3b3066;border-radius:14px;width:100%;padding:14px;font-size:15px;font-weight:600}.delete-btn:hover{background:#ff3b302e}.card-edit-btn{color:var(--text2);background:0 0;flex-shrink:0}.card-edit-btn:hover{color:var(--text)}.detail-modal{border-radius:24px 24px 0 0;max-height:95vh}.detail-header{align-items:center;gap:12px;padding:20px 20px 12px;display:flex}.detail-info-bar{flex-wrap:wrap;align-items:center;gap:8px;padding:4px 16px 12px;display:flex}.info-chip{background:var(--surface2);color:var(--text2);border-radius:20px;padding:5px 12px;font-size:13px;font-weight:500}.info-icon-btn{background:var(--surface2);width:32px;height:32px;color:var(--text2);cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;margin-left:auto;display:flex}.info-icon-btn:hover{color:var(--text)}.calendar-divider{background:var(--border);height:1px;margin:0 16px 16px}.calendar-wrap{padding:0 16px}.cal-day-headers{grid-template-columns:repeat(7,1fr);margin-bottom:4px;display:grid}.cal-day-label{text-align:center;color:var(--text2);padding:4px 0;font-size:12px;font-weight:500}.cal-grid{grid-template-columns:repeat(7,1fr);gap:4px;display:grid}.cal-day{aspect-ratio:1;cursor:pointer;border:1px solid #0000;border-radius:10px;flex-direction:column;justify-content:center;align-items:center;gap:1px;transition:background .1s;display:flex}.cal-day:hover:not(.future){background:#ffffff0f}.cal-day.future{cursor:default;opacity:.35}.cal-day.today{border-color:#ffffff4d!important}.cal-day-num{color:var(--text);font-size:14px;font-weight:500;line-height:1}.cal-day.future .cal-day-num{color:var(--text2)}.cal-day-count{font-size:9px;font-weight:600;line-height:1}.cal-nav{border-top:1px solid var(--border);justify-content:space-between;align-items:center;margin-top:16px;padding:16px;display:flex}.cal-nav-today{background:var(--surface2);color:var(--text);cursor:pointer;border:none;border-radius:20px;padding:7px 14px;font-size:13px;font-weight:500}.cal-nav-btn{background:var(--surface2);width:36px;height:36px;color:var(--text);cursor:pointer;border:none;border-radius:50%;justify-content:center;align-items:center;font-size:20px;display:flex}.count-sheet-overlay{z-index:200;background:#00000080;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.count-sheet{width:100%;max-width:480px;padding:20px 20px calc(20px + env(safe-area-inset-bottom,0px));background:#1c1c1e;border-radius:24px 24px 0 0;flex-direction:column;gap:16px;display:flex}.count-sheet-header{justify-content:space-between;align-items:center;display:flex}.count-sheet-chips{flex-wrap:wrap;gap:8px;display:flex}.chip{background:var(--surface2);border-radius:20px;padding:5px 12px;font-size:13px;font-weight:500}.count-progress-bar{background:var(--surface2);border-radius:2px;height:4px;overflow:hidden}.count-progress-fill{border-radius:2px;height:100%;transition:width .2s}.count-main{background:var(--surface2);border-radius:16px;justify-content:space-between;align-items:center;padding:8px 12px;display:flex}.count-action-btn{width:48px;height:48px;color:var(--text);cursor:pointer;background:#3a3a3c;border:none;border-radius:50%;justify-content:center;align-items:center;font-size:26px;line-height:1;display:flex}.count-display{font-size:32px;font-weight:700}.count-sep{color:var(--text2)}.count-presets{grid-template-columns:repeat(5,1fr);gap:8px;display:grid}.preset-btn{background:var(--surface2);color:var(--text);cursor:pointer;border:none;border-radius:12px;padding:10px 0;font-size:15px;font-weight:600}.preset-btn:hover{background:#3a3a3c}.count-actions{grid-template-columns:1fr 1fr;gap:10px;display:grid}.count-bottom-btn{cursor:pointer;color:#fff;border:none;border-radius:14px;padding:15px;font-size:16px;font-weight:700}.count-bottom-btn.secondary{background:var(--surface2);color:var(--text)}.auth-screen{background:var(--bg);justify-content:center;align-items:center;min-height:100vh;padding:24px;display:flex}.auth-card{flex-direction:column;align-items:center;gap:8px;width:100%;max-width:380px;display:flex}.auth-icon{margin-bottom:4px;font-size:52px}.auth-title{font-size:28px;font-weight:700}.auth-subtitle{color:var(--text2);margin-bottom:8px;font-size:15px}.auth-form{flex-direction:column;gap:16px;width:100%;margin-top:8px;display:flex}.auth-error{color:#ff453a;text-align:center;font-size:14px}.auth-success{color:#32d74b;text-align:center;font-size:14px}.auth-switch{color:#5e5ce6;cursor:pointer;background:0 0;border:none;margin-top:8px;padding:4px;font-size:14px}.auth-switch:hover{text-decoration:underline}.loading-spinner{border:3px solid #ffffff1a;border-top-color:#5e5ce6;border-radius:50%;width:36px;height:36px;animation:.7s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}
