:root{--bg: #f5f7fa;--surface: #ffffff;--surface-subtle: #f1f5f9;--border: rgba(15, 23, 42, .08);--border-strong: rgba(15, 23, 42, .14);--text: #0f172a;--text-muted: #64748b;--text-soft: #94a3b8;--success: #059669;--success-strong: #047857;--success-bg: rgba(5, 150, 105, .09);--success-border: rgba(5, 150, 105, .24);--success-glow: rgba(5, 150, 105, .22);--fail: #dc2626;--fail-strong: #b91c1c;--fail-bg: rgba(220, 38, 38, .08);--fail-border: rgba(220, 38, 38, .22);--fail-glow: rgba(220, 38, 38, .2);--amber: #d97706;--amber-bg: rgba(217, 119, 6, .12);--accent: #0f172a;--accent-text: #ffffff;--nav-bg: rgba(255, 255, 255, .86);--shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);--shadow-md: 0 8px 24px rgba(15, 23, 42, .07);--radius: 20px}[data-theme=dark]{--bg: #0b0f14;--surface: #131922;--surface-subtle: #1b2330;--border: rgba(255, 255, 255, .08);--border-strong: rgba(255, 255, 255, .14);--text: #f8fafc;--text-muted: #94a3b8;--text-soft: #64748b;--success: #10b981;--success-strong: #34d399;--success-bg: rgba(16, 185, 129, .12);--success-border: rgba(16, 185, 129, .3);--success-glow: rgba(16, 185, 129, .28);--fail: #f43f5e;--fail-strong: #fb7185;--fail-bg: rgba(244, 63, 94, .12);--fail-border: rgba(244, 63, 94, .3);--fail-glow: rgba(244, 63, 94, .26);--amber: #f59e0b;--amber-bg: rgba(245, 158, 11, .16);--accent: #f8fafc;--accent-text: #0b0f14;--nav-bg: rgba(19, 25, 34, .86);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .25);--shadow-md: 0 12px 32px rgba(0, 0, 0, .4)}*,*:before,*:after{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,SF Pro Display,Inter,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;min-height:100dvh}button,input{font:inherit;color:inherit}button{cursor:pointer}.app-shell{min-height:100dvh;display:flex;flex-direction:column;align-items:center}.app-main{width:100%;max-width:480px;padding:max(14px,env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom));flex:1}.view{display:flex;flex-direction:column;gap:14px}.top-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px}.top-bar__title{display:flex;align-items:baseline;gap:8px}.wordmark{font-size:1.25rem;font-weight:800;letter-spacing:-.04em}.date-chip{font-size:.8rem;color:var(--text-muted);font-weight:500}.top-bar__actions{display:flex;align-items:center;gap:8px}.sync-pill{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);border-radius:999px;padding:6px 11px;font-size:.75rem;font-weight:600;transition:transform .15s ease,border-color .2s ease}.sync-pill:active{transform:scale(.96)}.sync-dot{width:7px;height:7px;border-radius:999px;background:var(--success)}.sync-pill--saving .sync-dot,.sync-pill--pending .sync-dot,.sync-pill--offline .sync-dot{background:var(--amber)}.sync-pill--saving .sync-dot{animation:pulse 1s infinite ease-in-out}.sync-pill--pending,.sync-pill--offline{color:var(--amber);border-color:#f59e0b59;background:var(--amber-bg)}.icon-btn{width:36px;height:36px;border-radius:12px;border:1px solid var(--border);background:var(--surface);color:var(--text);display:inline-flex;align-items:center;justify-content:center;transition:transform .15s ease,background .15s ease}.icon-btn:active{transform:scale(.94)}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px;box-shadow:var(--shadow-sm)}.hero-card{display:flex;flex-direction:column;gap:14px}.hero-metrics{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}.hero-metric{display:flex;flex-direction:column;gap:2px}.hero-metric--right{align-items:flex-end;text-align:right}.hero-divider{width:1px;height:36px;background:var(--border)}.metric-label{font-size:.74rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted)}.metric-value{font-size:2rem;font-weight:800;letter-spacing:-.04em;line-height:1.1;font-variant-numeric:tabular-nums}.metric-value--rate{color:var(--success)}.ratio-bar{height:7px;border-radius:999px;background:var(--surface-subtle);overflow:hidden;display:flex;gap:2px}.ratio-bar__success{background:var(--success);height:100%;transition:width .35s cubic-bezier(.22,1,.36,1)}.ratio-bar__fail{background:var(--fail);height:100%;transition:width .35s cubic-bezier(.22,1,.36,1)}.ratio-bar__empty{width:100%;background:var(--surface-subtle)}.target-strip{display:flex;flex-direction:column;gap:6px;padding-top:4px;border-top:1px solid var(--border)}.target-strip__head{display:flex;justify-content:space-between;align-items:center;font-size:.78rem}.target-strip__label{font-weight:600;color:var(--text-muted)}.target-strip.is-met .target-strip__label{color:var(--success)}.target-strip__numbers{font-weight:700;font-variant-numeric:tabular-nums}.target-track{height:6px;border-radius:999px;background:var(--surface-subtle);overflow:hidden}.target-fill{height:100%;border-radius:999px;background:var(--accent);transition:width .35s cubic-bezier(.22,1,.36,1)}.target-strip.is-met .target-fill{background:var(--success)}.action-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.action-btn{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;min-height:190px;padding:18px 16px 16px;border-radius:24px;border:1.5px solid var(--border);background:var(--surface);text-align:left;user-select:none;-webkit-user-select:none;touch-action:manipulation;box-shadow:var(--shadow-sm);transition:transform .14s cubic-bezier(.22,1,.36,1),border-color .2s ease,background .2s ease,box-shadow .2s ease}.action-btn:active{transform:scale(.975)}.action-btn--success{background:linear-gradient(180deg,var(--surface) 0%,var(--success-bg) 100%);border-color:var(--success-border)}.action-btn--fail{background:linear-gradient(180deg,var(--surface) 0%,var(--fail-bg) 100%);border-color:var(--fail-border)}.action-btn--success.is-armed{background:var(--success);border-color:var(--success);color:#fff;box-shadow:0 12px 28px var(--success-glow);transform:scale(1.015)}.action-btn--fail.is-armed{background:var(--fail);border-color:var(--fail);color:#fff;box-shadow:0 12px 28px var(--fail-glow);transform:scale(1.015)}.action-btn__top{position:relative;z-index:2;display:flex;align-items:center;gap:8px}.action-btn__icon{width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.action-btn--success .action-btn__icon{background:var(--success-bg);color:var(--success)}.action-btn--fail .action-btn__icon{background:var(--fail-bg);color:var(--fail)}.action-btn.is-armed .action-btn__icon{background:#fff3;color:#fff}.action-btn__label{font-size:.94rem;font-weight:700;letter-spacing:-.01em}.action-btn__count{position:relative;z-index:2;font-size:3.35rem;font-weight:800;letter-spacing:-.05em;line-height:1;font-variant-numeric:tabular-nums;margin:14px 0 10px;transition:transform .2s cubic-bezier(.22,1,.36,1)}.action-btn--success .action-btn__count{color:var(--success)}.action-btn--fail .action-btn__count{color:var(--fail)}.action-btn.is-armed .action-btn__count{color:#fff}.action-btn.is-pop .action-btn__count{animation:countPop .36s cubic-bezier(.22,1,.36,1)}.action-btn__prompt{position:relative;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:100%;padding:8px 10px;border-radius:12px;font-size:.78rem;font-weight:700;background:#0f172a0d;color:var(--text-muted);transition:background .2s ease,color .2s ease}[data-theme=dark] .action-btn__prompt{background:#ffffff12}.action-btn.is-armed .action-btn__prompt{background:#ffffff38;color:#fff}.action-btn__hold-fill{position:absolute;inset:0;z-index:1;transform-origin:bottom;pointer-events:none;transition:none}.action-btn--success .action-btn__hold-fill{background:#10b98142}.action-btn--fail .action-btn__hold-fill{background:#f43f5e3d}.action-btn__arm-bar{position:absolute;left:0;right:0;bottom:0;height:4px;z-index:3;background:#ffffffd9;transform-origin:left;animation:armCountdown 2.6s linear forwards}.quick-bar{display:flex;align-items:center;justify-content:space-between;gap:8px}.mode-chip,.ghost-chip{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--border);background:var(--surface);color:var(--text-muted);border-radius:999px;padding:7px 13px;font-size:.78rem;font-weight:600}.mode-chip__dot{width:6px;height:6px;border-radius:999px;background:var(--text-soft)}.ghost-chip{color:var(--text)}.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.section-title{margin:0;font-size:.92rem;font-weight:700;letter-spacing:-.01em}.section-meta{font-size:.76rem;color:var(--text-muted);font-variant-numeric:tabular-nums}.empty-note{margin:4px 0;font-size:.85rem;color:var(--text-muted);line-height:1.45}.event-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}.event-row{display:flex;align-items:center;justify-content:space-between;padding:10px 0;border-top:1px solid var(--border);gap:8px}.event-row:first-child{border-top:none;padding-top:2px}.event-row__left,.event-row__right{display:flex;align-items:center;gap:8px}.event-dot{width:8px;height:8px;border-radius:999px}.event-dot--success{background:var(--success)}.event-dot--fail{background:var(--fail)}.event-outcome{font-size:.86rem;font-weight:600}.event-time{font-size:.78rem;color:var(--text-muted);font-variant-numeric:tabular-nums}.save-badge{font-size:.7rem;font-weight:600;padding:2px 7px;border-radius:999px}.save-badge.is-saved{color:var(--success);background:var(--success-bg)}.save-badge.is-pending{color:var(--amber);background:var(--amber-bg)}.undo-link{border:none;background:transparent;color:var(--text-muted);font-size:.78rem;font-weight:600;padding:4px 6px;border-radius:8px}.undo-link.is-primary{color:var(--fail);background:var(--fail-bg);padding:4px 9px}.expand-btn{margin-top:8px;width:100%;border:1px solid var(--border);background:var(--surface-subtle);color:var(--text-muted);border-radius:12px;padding:9px;font-size:.8rem;font-weight:600}.segmented{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--surface-subtle);padding:3px;border-radius:12px;gap:3px}.segmented__btn{border:none;background:transparent;color:var(--text-muted);border-radius:9px;padding:8px 10px;font-size:.82rem;font-weight:600;transition:background .15s ease,color .15s ease}.segmented__btn.is-active{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}.stats-card{display:flex;flex-direction:column;gap:14px}.stats-period-label{display:flex;justify-content:space-between;font-size:.78rem;color:var(--text-muted);font-weight:500}.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat-tile{background:var(--surface-subtle);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:3px}.stat-tile__label{font-size:.72rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}.stat-tile__value{font-size:1.5rem;font-weight:800;letter-spacing:-.03em;font-variant-numeric:tabular-nums}.stat-tile__value--success{color:var(--success)}.stat-tile__value--fail{color:var(--fail)}.week-chart{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;padding-top:6px;border-top:1px solid var(--border)}.week-bar{border:none;background:transparent;padding:4px 0;display:flex;flex-direction:column;align-items:center;gap:5px}.week-bar__count{font-size:.68rem;font-weight:700;color:var(--text-muted);min-height:14px;font-variant-numeric:tabular-nums}.week-bar__track{width:100%;max-width:24px;height:54px;border-radius:8px;background:var(--surface-subtle);display:flex;align-items:flex-end;overflow:hidden}.week-bar__fill{width:100%;background:var(--success);border-radius:6px;display:flex;flex-direction:column;justify-content:flex-start;overflow:hidden;transition:height .3s ease}.week-bar__fill.is-empty{background:var(--border)}.week-bar__fail{width:100%;background:var(--fail)}.week-bar__label{font-size:.72rem;font-weight:600;color:var(--text-muted)}.week-bar.is-today .week-bar__label{color:var(--text);font-weight:800}.day-list{list-style:none;margin:0;padding:0}.day-row{width:100%;border:none;border-top:1px solid var(--border);background:transparent;padding:12px 2px;display:flex;align-items:center;justify-content:space-between;text-align:left;gap:10px}.day-list li:first-child .day-row{border-top:none;padding-top:4px}.day-row__left{display:flex;flex-direction:column;gap:2px}.day-row__title{display:flex;align-items:center;gap:6px;font-size:.92rem;font-weight:700}.day-row__sub{font-size:.74rem;color:var(--text-muted);font-variant-numeric:tabular-nums}.tiny-tag{font-size:.65rem;font-weight:700;padding:2px 6px;border-radius:999px;background:var(--surface-subtle);color:var(--text-muted)}.tiny-tag--success{background:var(--success-bg);color:var(--success)}.day-row__right{display:flex;align-items:center;gap:12px;font-variant-numeric:tabular-nums}.day-row__counts{display:flex;align-items:center;gap:4px;font-weight:700;font-size:.95rem}.count-ok{color:var(--success)}.count-sep{color:var(--text-soft)}.count-fail{color:var(--fail)}.day-row__rate{min-width:42px;text-align:right;font-size:.82rem;font-weight:700;color:var(--text-muted)}.sheet-backdrop{position:fixed;inset:0;z-index:50;background:#00000085;backdrop-filter:blur(4px);display:flex;align-items:flex-end;justify-content:center;padding:12px}.sheet{width:100%;max-width:480px;background:var(--surface);border:1px solid var(--border);border-radius:24px;padding:18px 18px calc(18px + env(safe-area-inset-bottom));box-shadow:var(--shadow-md);max-height:85dvh;display:flex;flex-direction:column;gap:14px;overflow:hidden}.sheet__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.sheet__head h3{margin:0;font-size:1.05rem;font-weight:800}.sheet__sub{margin:2px 0 0;font-size:.78rem;color:var(--text-muted)}.sheet__body{overflow-y:auto;display:flex;flex-direction:column;gap:16px;padding-right:2px}.close-btn{width:32px;height:32px;border-radius:999px;border:1px solid var(--border);background:var(--surface-subtle);color:var(--text);font-size:.85rem}.sheet-summary{display:flex;align-items:center;justify-content:space-between;background:var(--surface-subtle);border-radius:14px;padding:12px 14px}.sheet-summary>div{display:flex;flex-direction:column}.sheet-summary strong{font-size:1.2rem;font-variant-numeric:tabular-nums}.mini-heading{margin:0 0 8px;font-size:.82rem;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em}.correction-form,.sheet-form{display:flex;flex-direction:column;gap:12px}.stepper-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stepper-box{display:flex;flex-direction:column;gap:6px}.stepper-row{display:grid;grid-template-columns:38px 1fr 38px;gap:4px;align-items:center}.stepper-btn{height:42px;border-radius:12px;border:1px solid var(--border);background:var(--surface-subtle);font-size:1.2rem;font-weight:700}.stepper-input{width:100%;height:42px;text-align:center;border-radius:12px;border:1px solid var(--border-strong);background:var(--surface);font-size:1rem;font-weight:700;font-variant-numeric:tabular-nums}.settings-card{display:flex;flex-direction:column;gap:12px}.settings-desc{margin:-4px 0 0;font-size:.82rem;color:var(--text-muted);line-height:1.4}.settings-hint{margin:0;font-size:.78rem;color:var(--text-muted);line-height:1.4}.preset-row{display:flex;flex-wrap:wrap;gap:8px}.preset-chip{border:1px solid var(--border);background:var(--surface-subtle);color:var(--text);border-radius:999px;padding:7px 14px;font-size:.82rem;font-weight:700}.preset-chip.is-active{background:var(--accent);color:var(--accent-text);border-color:var(--accent)}.inline-form{display:flex;gap:8px}.inline-form .text-input{flex:1}.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:8px;border-top:1px solid var(--border);cursor:pointer}.toggle-row span{display:flex;flex-direction:column;gap:2px}.toggle-row strong{font-size:.88rem}.toggle-row small{font-size:.76rem;color:var(--text-muted)}.toggle-row input[type=checkbox]{width:20px;height:20px;accent-color:var(--success)}.sync-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.privacy-note{margin:0;padding-top:10px;border-top:1px solid var(--border);font-size:.76rem;color:var(--text-muted);line-height:1.45}.field-label{font-size:.8rem;font-weight:600;color:var(--text-muted)}.text-input{width:100%;height:46px;padding:0 14px;border-radius:13px;border:1px solid var(--border-strong);background:var(--surface);font-size:.96rem;outline:none;transition:border-color .15s ease}.text-input:focus{border-color:var(--success)}.primary-btn{width:100%;height:48px;border:none;border-radius:14px;background:var(--accent);color:var(--accent-text);font-size:.95rem;font-weight:700;transition:opacity .15s ease,transform .12s ease}.primary-btn:disabled{opacity:.5;cursor:not-allowed}.primary-btn:active:not(:disabled){transform:scale(.985)}.secondary-btn{height:46px;padding:0 16px;border-radius:13px;border:1px solid var(--border-strong);background:var(--surface-subtle);color:var(--text);font-size:.86rem;font-weight:700;white-space:nowrap}.danger-btn{width:100%;height:46px;border-radius:14px;border:1px solid var(--fail-border);background:var(--fail-bg);color:var(--fail);font-size:.9rem;font-weight:700}.login-shell{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:24px 16px}.login-card{width:100%;max-width:390px;background:var(--surface);border:1px solid var(--border);border-radius:26px;padding:28px 24px 22px;box-shadow:var(--shadow-md);display:flex;flex-direction:column;gap:20px}.login-brand{display:flex;align-items:center;gap:14px}.brand-mark{color:#0f172a;display:flex}[data-theme=dark] .brand-mark{color:#1e293b}.login-title{margin:0;font-size:1.5rem;font-weight:800;letter-spacing:-.04em}.login-subtitle{margin:2px 0 0;font-size:.84rem;color:var(--text-muted)}.login-form{display:flex;flex-direction:column;gap:10px}.password-wrap{position:relative;display:flex;align-items:center}.password-wrap .text-input{padding-right:64px}.password-toggle{position:absolute;right:8px;border:none;background:transparent;color:var(--text-muted);font-size:.8rem;font-weight:600;padding:6px 8px}.form-error{margin:0;font-size:.82rem;font-weight:600;color:var(--fail);background:var(--fail-bg);padding:9px 12px;border-radius:10px}.login-footnote{margin:0;text-align:center;font-size:.74rem;color:var(--text-soft)}.loading-pulse{font-size:1.4rem;font-weight:800;letter-spacing:-.04em;color:var(--text-muted);animation:pulse 1.2s infinite ease-in-out}.toast{position:fixed;left:50%;bottom:calc(78px + env(safe-area-inset-bottom));transform:translate(-50%);z-index:40;background:var(--accent);color:var(--accent-text);padding:11px 16px;border-radius:999px;box-shadow:var(--shadow-md);display:inline-flex;align-items:center;gap:14px;font-size:.84rem;font-weight:600;max-width:calc(100vw - 32px);animation:toastIn .2s cubic-bezier(.22,1,.36,1)}.toast__undo{border:none;background:#ffffff2e;color:inherit;border-radius:999px;padding:4px 11px;font-size:.78rem;font-weight:700}[data-theme=dark] .toast__undo{background:#0b0f1424}.tab-bar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--nav-bg);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-top:1px solid var(--border);display:grid;grid-template-columns:repeat(3,1fr);padding:6px 8px calc(8px + env(safe-area-inset-bottom))}@media(min-width:520px){.tab-bar{max-width:480px;left:50%;transform:translate(-50%);bottom:12px;border:1px solid var(--border);border-radius:20px;padding:6px;box-shadow:var(--shadow-md)}}.tab-btn{border:none;background:transparent;color:var(--text-muted);display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 4px;border-radius:12px;font-size:.7rem;font-weight:600;transition:color .15s ease}.tab-btn.is-active{color:var(--text)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.4}}@keyframes countPop{0%{transform:scale(1)}45%{transform:scale(1.16)}to{transform:scale(1)}}@keyframes armCountdown{0%{transform:scaleX(1)}to{transform:scaleX(0)}}@keyframes toastIn{0%{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%)}}
